Phase Tool Tutorial
This tool is for combining elemental images into phases or components.
The tool shows a list of phases, or a list of maps for the selected
phase, depending on the Showing Phases / Showing
Maps button, which changes when you click it. Selected phase
or map is in RED.
Note: NOT Map capability
is now available when editing thresholds. The dialog presented by the
'Edit Threshold' button has a 'Continue' choice as always, and a new 'Not
Map' choice. If this button is clicked, the thresholds will appear as
negative, indicating that the NOT map is to be used, which is whatever is
NOT red in the thresholded image, i.e., pixels with levels not between the
thresholds. The Results Button, and the %-area column in the list of
maps will reflect the change to using a NOT map.
- Elemental images - all of the same dimensions. (Setup
- Phase descriptions. For each phase: (Add, Delete,
and Edit -... buttons)
- List of elemental images
- Thresholds for each image
- Rules for combining the images. The
default is 'and' (coincidence of elements). For the moment,
that is all that is available.
- Color of the phase in the combined color phase map.
- Output (Results button)
- Maps (masks) for the phases
- Combined color map for all phases
- Map (mask) for pixels in no phase
- Map (mask) for pixels in more than one phase.
- Setup / Print ... - prints lists of:
- Unused maps. These are maps in the tool, but not yet used in any
- Percent of total counts (summed intensitites) of maps in unused pixels.
I.e. percent of map 'information' that is not used in any phase.
- Percent of thresholded map pixels that overlap each phase. This
should be nearly 100% for maps in their designated phases, and near 0%
for the other phases. (?)
- Setup / Save Tool and Load Tool.
Saves the selected elemental image names, and information displayed in
the lower part of the tool: phases, maps, thresholds, rules
and colors. Specifying phases can be tedious. This allows
saving your work and continuing at a later time. Your work is saved
in a text file with a ".lisp" extension. This file should
be in the same folder (directory) as the elemental maps. You can
edit this file with a text editor to change phase names, colors, etc.
Load tool will load the maps from their files, and restore the tool to
the state when it was saved.
- This is how the tool looks when opened. Note that it has 0 maps.
It is in the "Define Phase" mode (button at upper
left) so that the Add button can
add the first phase. Once a phase is added, maps (thresholded
elemental images) can be added to the phase by clicking "Define
Phase" so that it says "Choose Map",
then using Add.
Before adding maps, the elemental images must be loaded and selected by
the Tool, using the Setup button.
Note about the Define Phase Button.
This button has been renamed, but the illustrations that follow
have not been revised, and use the old name.
Load or Select Elemental Images (Maps)
- Option 1- if this is new
data. Setup / Select and Load Maps
- If you have previously saved your work using Setup / Save Tool,
go to Option 2.
- Register your elemental maps (images) in the phase tool, either from
files, or from open images. Once you do this, the number of
available maps is shown at the upper right of the tool, just to the left
of the Help! button.
- Setup / Select and Load Maps Navigate to
and select elemental images. Use control or shift key for multiple
selection. Load all images at once.
- Setup / Select Map Images Already Open Select
the maps from a list of open images. This option allows adding
maps to those already in the Phase Tool.
- Images should be gray level, and all the same size. Lispix will
warn you if they are not, but do nothing else. Offsized maps will
not hurt at this point, if you do nothing with them. However, Setup
/ Delete Offsized Maps makes the Phase Tool forget them, and
closes their windows.
- Images will be displayed at upper left. Only last image will be
visible. You may zoom or tile the images if desired. At the appropriate
time, Lispix will bring whatever map you are working on to the front,
so you save screen space by just leaving the images where they are.
If you zoom the maps (Shift - Zoom / in, out, 2, 3, etc.)
they will remain stacked, still conserving screen space. If you
tile them, you can restack them using Windows / Stack in the Lispix Menu
2- if you have previously saved your work.
Setup / Load Tool
- You can save your work using Setup / Save Tool.
This saves the state of the tool for work at a later time.
- If you have previously saved work using Save Tool,
you can restore your work using Load Tool. This
will load the elemental images (maps) from the image files and restore
your phases, maps, thresholds and color selections. The tool state
file is a text file, which should be in the same folder as the elemental
maps. You can edit this file directly in a text editor to change
phase names, thresholds, colors, etc. However the usual way to proceed
is to add phases or maps using the tool, and then use Setup /
Save Tool again.
- This is how the tool looks after loading one of my files. Note
the 13 maps are stacked on the left, and their number shown in the top
line of the tool.
- Here is another example - data and tool information by Jeff Davis, NIST:
- After selecting maps and thresholds for each phase, the %-area of the
maps will still not yet be shown, as no phase masks have yet been calculated
using any of the Results / Show ... commands. There
is always one phase that is selected, and it is shown in red. (Change
the selection by clicking on another phase.) Add,
Delete, and Edit Color work on the selected
phase. When Showing Phases is clicked on so that it then
says Showing Maps, the maps and thresholds are listed
for the selected phase. The colors listed in the tool are the colors
for each phase in the combined color phase map, shown below.
- For the views of the tool shown above, I first clicked on Phase-02 so
that it turned red. Then I clicked on "Showing Phases".
Note that it now says "Showing Maps", and "for Phase-02"
is shown above the list of maps. In this case, there is only one
map, "s5-Fe", for phase-02, and it is selected and shown in
- The %-area of the maps is not yet shown, as no phase masks have yet
been made using any of the Results / Show ... commands.
After invoking Results / Show Mask of Selected Phase,
the mask (circled in red below) will appear below and to the right of
the stack of elemental images and the percent area will be shown for that
map in the tool when in the "Showing Phases" mode.
- Results / Show Individual Phase Masks will show the
masks for all phases, tiled, slightly below where the individual maps
are shown. Since all of the phase masks have now been calculated,
all of the percent areas are shown in the tool.
- Similarly, Results / Show Combined Phase Maps will,
in the process of calculating the masks for all the phases, show the percent
area for all of the phases. Percent area accounted for, and not
accounted for are shown at bottom of phase maps.
- The combined phase maps, seen above, are shown tiled, slightly above
and to the left of the individual phase maps. A
is the color phase map, using the colors listed in the tool. If
you edit the colors, you must redisplay the map to see the new colors.
B is a mask of pixels used
in more than one phase (shown in white in map A, but harder to see there).
C is a mask of unused pixels,
shown in black in map A.
- Here is Jeff's example, showing combined phase masks:
- The percentage of non-zero pixels appears at the lower left of each
map image. You can turn this off using Results / Toggle
Percent Area Overlays. The percent of assigned pixels,
and the percent of pixels not assigned add up to 100%. The % pixel
overlap is the percentage of map area with pixels assigned to two or more
Adding Phases, Maps and Thresholds
- Add Note - the button at upper left says "Showing
Phases", that it a list of phases is shown in the tool.
After clicking Add, the first phase will be shown in the
list. The selected phase is shown in red, and since this phase is the
only one, it is selected. Clicking on Showing Phases
will make the button then say "Showing Maps" and a list of maps
for the selected phase appears in the tool.
- Select a map to threshold.
- The Threshold Slider will move under the map, but the title and threshold
values will not be correct until you either move the slider a bit, or click
the C! (for color) button.
- Click 'Continue' in the dialog. This will add the map
and thresholds to the list of maps for the selected phase. Note that
Add either adds a phase or a map, depending on what the "Showing"
button says the tool is doing.
- You can change the thresholds at any time by selecting a phase and map,
then using Edit Thresholds, which should display
the map, put the threshold slider under it, and set both to the thresholds
recorded in the tool. After you have selected the new thresholds
(and before doing much of anything else), click 'Continue' in
the dialog to put the new threshold values into the tool. This proceedure
is more convenient than deleting a map, and then adding it back in, which
would do the same thing.
Continue adding phases and maps as desired. Note that:
- You can see what maps are used in which phases using Setup / Print
- You can save and restore your maps and phases using Save Tool and
Load Tool in the Setup button..
- You can change the color of any phase with the Edit Color button.
Use Results / Show Combined Phase Maps to show new color
- Delete will delete a phase or a map, depending on
whether the tool is showing phases or showing maps.
Searching for Unused Pixels
You can use Results / Show Combined Phase Maps
at any time. The second image shows overlapping pixels and the third (red
arrow), unused pixels. The second or third images are masks that can be
used with the PPP tool to get spectra for these pixels.
Setup / Print Map Usage lists the maps
and what phases use them. This makes it easy to spot elemental images
that have not yet been used:
Setup / Print Unused Map % Intensities first asks you to click
on the unused pixel mask to put it in front, and then lists the percentage of
summed pixel intensities in each elemental image that overlaps the unused pixel
mask. This will work for any mask, but for the unused pixel mask in particular,
it in effect lists the percentage of counts that are not yet accounted for,
for each elemental image. For example, the high percentages for Ni and
Ca below may indicate as-yet unspecified phases.
Setup / Print Thresholded Map vs Phase
Percents again asks you first to click on the unused pixel map, and
then prints a table listing the phases, and maps for each phase. For each
map, it gives the map name, thresholds values, a percentage of the thresholded
(red - i.e. selected for that particular phase) pixels for the map that overlap
the zero use mask, and percentages of the thresholded pixels that overlap each
of the phases.
Sometimes, the columns don't line up quite right, but they will if you copy
and paste (or save and load) the table into a spreadsheet program.
This table might help spot errors in the thresholds for each phase.
Note that in this case, none of the maps have any thresholded pixels that are
not used, because there is only one map used for each phase, so all of the pixels
for the map have to be used. If two maps were used for a phase, then any
pixels that were not thresholded in both maps would not be used in the phase.
Also note the diagonal line of 100%'s (I colored these in Excel*
by hand) shows that each map shows up entirely in its own phase. The Al
map, used for Phase-04 also happens to half way overlap Phase-03. To investigate
this, I made a color overlay of Phase-03 (green) and thresholded Aluminum (red
& blue) with these steps:
- Selected Phase-03 in the tool and made a mask of the phase with Results
/ Show Mask of Selected Phase.
- Selected the Al map in Phase-04, clicked Edit Threshold,
then made a mask of the thresholded map using Thresholds / Make Mask
in the Threshold Slider.
- Combined the mask from step 1 - in green, with the mask from step 2 - in
red and blue, into an RGB overlay using the 2
& 3 Variable Tool
Phase-03 - green
Thresholded Al - red & blue
Color phase map.
Phase-03 is green.
The thresholded Aluminum pixels are either white or magenta in the left map
above. The magenta pixels are the Al pixels that have not been used in
any phase. Note that 52% of the thresholded Al pixels overlap Phase-03,
which means 48% are unused. From the Percent Summed Intensities table
above, 4.72% of the Aluminum counts are not yet used. The difference of
a factor of ten between the 48% and 4.72% is because the 48% is of the thresholded
pixels, which are only 14.7% of the map:
while the 4.72% is of the summed intensities for the entire map, which is not
insignificant in the non-thresholded pixels - what might be considered "background"
The white pixels in the left map are those that overlap Phase-03. Inspection
shows that these are part of, and account for most of the white (overlap) pixels
in the color phase map on the right. The white pixels in the right map
are pixels of any phase that overlap any other phase.
Setup / Print Tool lists the Phases
and the maps for each phase, for documentation. This is the table within
And this is the same table after copying and pasting into a spreadsheet program
that imports text tab-delimited files: