MLx Home | Contents | MLx
menu | MLx buttons
| Widgets | Index | What's New |
- -> S Wdow - Add spot tools.
- Clear - Clear graphics (spots or rings)
- Show... - Show array, spots, bv lines, spot deviations, camera
- Pop... Brings spot or ring window to the front.
- Measure... Measure basis vectors, set cam constant, D values
- S Rad... Set spot radius.
- Delta xf... Set scale factor for arrows showing spot deviations.
(magnifies arrow length).
- Parameters... Shows parameter list - similar in concept to
- Read the image
- Write it as a TIFF file (no LZW compression) so that MacLispix
can read it. (NIH Image does not support LZW compressed files
the image if necessary, so that the spots are white on
the image if necessary, so that the orientation is correct.
- Make the image small enough with the zoom button.
- Mouse actions
- Dragging the center circle drags the array.
- Dragging a circle on one of the main basis vectors will change
the vector, twisting, expanding or contracting the array in that
- Shift-clicking inside or outside the array will erase or
add a layer of circles.
- Command-clicking on a spot will erase/draw it. Use this to
delete unwanted spots.
- Option-clicking on a spot will show a zoomed image of that
spot. If the image outside the spot is option-clicked, the title
of the single spot window will change to "Peak" and
a zoomed image of the clicked position will appear.
- ->S Window
- Adds the spot tools to an image window. Initializes the spot
pattern if the tools are already there.
- (Will not erase drawing already there so that previous pattern
can be easily matched. Use clear button to erase drawings.)
- Show Button
- Shows array of spots defined by the current center and basis
- To erase old spots, click on the clear button to erase
all spots, then click the show button to show the new
- Drawing occurs in the exclusive-or mode. When the show button
is pressed, all of the spots are 'drawn', but those that
are already there will be erased, and vs.vs.
- Note - the clear button clears the display (the window graphics),
but does not clear the positions or status of the spots in memory.
- If the image window is hidden, click the show button once
to bring the window to the front, and again to show the spots.
- use the S Rad... button
to adjust the size of the circles. They should include only one
- Shows spots at their actual locations. Will be slightly different
from the array locations.
- Shows spots (and lines connecting them) that were used to
calculate the averaged basis vectors.
- Spot Delta Shows deviations of actual measured spot
center from center calculated from the basis vectors, as yellow
arrows. The Delta xf button
sets the scale factor for the length of these vectors. Use the
Clear button first for a less cluttered display of the deviations.
- Camera Constant Shows the value of the camera constant
(which can be edited) for the front spot window. Also shows the
spot used to set the constant (with a known D value), if the
camer constant was set that way.
- Match Pattern to Image (roughly.
Have only one spot within each circle.)
to add or remove a layer of spots (removed 1/9/98. See
commands in Measure... button.)
- Drag center spot to move pattern
- Change the basis vectors by dragging a spot along
either one. Spots further out give more precision.
- Inspect individual spots
- Command-click a spot to add or remove it.
- Option-click a spot to display a zoomed version in
a small window.
- Do this before invoking the Measure...Measure
D button. This designates the spot to measure.
- For spots, the center of the small window is the spot center
position calculated from the basis vectors.
- For peaks ('spots' in the diffraction image that are not
in the array), the center of the small window is the click position
in the spot image window.
- Blue 'x' marks the center to be used in measuring basis vectors.
If this is too far off center, remove that spot.
- Note - if the spot is off center by more than one fourth
the radius of the spot circles, it will be excluded from the
measurement of the basis vectors automatically. The spot circle
radius is set by the S Rad...
- Measure Basis Vectors
- Measure Button
- Set Array
- Only the end points are used, as shown in the resulting graph.
- Repeated clicks will 'home in' on the array, adjusting both
the center and the basis vectors.
- Values are printed to the Listener.
- If the camera constant has been set, a second line is printed
to the listener with the lengths of the basis vectors (in pixels)
multiplied by the camera constant.
- Add Spot Layer
- If spots have been deleted, and then the layer containing
that spot is deleted then added back on, the previously deleted
spots will be restored, the same as if the (deleted) spot had
- Remove Spot Layer
- Set Cam C
- Set the camera constant by clicking on a spot with known
D value. Enter the D value.
- Alternatively, Don't use this measure button. Just edit the
value displayed using the Show...Camera
- Measure D
- Mark and list the last clicked peak or spot and its D value,
calculated using the camera constant and the spot center measured
from the image.
- Marks the spot window with a circle and text with
the label and D value. These marks are superimposed graphics
that will not be saved if the window is saved as a TIFF file.
- Lists the spot by label, d value and location in the
D value (text) window. This window can be saved as a text file
(file->save as) and reloaded with Measure (button)->Open
- Note - for spots on the array, the D values will deviate
from the value that would be calculated from the basis vectors
by an amount proportionate to the lengths of the yellow arrows
displayed using the Show...Spot
- The measurements appear in a text window. Lines are added
as more measurements are made. Corresponding points are labeled
in the image window.
- This window can be saved to a file.
- The window can also be edited.
- The first 20 spaces are for the label.
- Words following the label are for the coordinate, D-value
and comments. have a semi-colon preceed any comments so that
the file can be read back in again.
- Open D file
- Opens a text file made with the above window. The front measurement
window is used to label the spots in the front spot window.
- Measure D values for single spots
- 'Spots' actually means diffraction spots in the array. This
does not work for these.
- 'Peaks' means diffraction spots that are not in the array.
This works for any of these.
For a diffraction spot example, load the rutile spots.tiff
image in the Demo_images/EDIF folder with the MLx->Image
Invoke the ->S Window button.
This is analogous to the -> R Window
button. The image of the diffraction spots is converted
to a window with the spot measuring tools.
Move (and zoom?) the window so that all of it visible.
The window will appear black except for a few white spots. This
digression was left into this demonstration because many diffraction
images are just of this nature, where they must be scaled appropriately
to visualize the diffraction spots. I.e., the contrast and brightness
must be adjusted to see the spots. The image is a 16 bit TIFF
image, but the diffraction spots intensities (less than 2500)
are small compared to the few bright pixels (65530) in the image
that are noise. The contrast and brightness must be adjusted to
see the spots. The range of brightness of the spots is so large,
that the contrast and brightness must be adjusted in any case
to position the spots tool accurately. (As initially displayed,
zero in the image is black, and 65530 is white. Since the intensities
of the spots are less than 4% of the intensity of the few bright
pixels, they will be shown as black.)
To see the diffraction pattern, scale the image by clipping .5%
of the outliers. The few very bright pixels make up a small percentage
(much less than 5%) of the image area. Excluding them from the
calculation of what intensity to show as white will render the
diffraction spots visible.
Initialize Button | top
Places an initialized pattern of spots in the center of the image.
After the scale->clip button is used and the init
Spots menu is invoked, the image appears this way:
The spot pattern tool is placed arbitrarily on the image. Most
of the spots are now visible, but the brighter ones are clipped
too much to measure their positions acccurately.
Show Spots | top
Redisplays the spots (as adjusted). This is analogous to the Show Ring menu.
Matching the pattern
to the image
- Use the Contrast Slider
to make the spots as small as possible. To adjust the slider,
hold the mouse down and bring the cursor onto the small circle
at either end. The circle will 'stick' to the cursur as long
as the mouse is down, and can be moved with the mouse. Sometimes
the movement is sluggish, as the image updates, but eventually,
the circle will 'snap' to the cursor location.
- Position the center of the spot pattern (double circle) squarely
over one of the brightest spots. The Contrast slider has hidden
most of the gray level information in the image, but at least
the bright spots as small enough to put within the central circle.
- The two lines radiating from the central circle denote the
basis vectors. Any circle that is in a line with a basis vector
can be used to adjust it. It is best to use a spot that is as
far as possible away from the central spot to adjust the basis
vector lengths and directions (which follow the spot as it moves).
The size of the spot pattern can be increased or decreased (by
adding or deleting a border of circles) by command-option-clicking
either outside or inside the pattern.
This is what the image looks like after
- Adjusting the contrast slider to see the dimmer spots as
- Adding another layer or two of circles by shift-clicking
outside the circle pattern.
- Positioning circles in line with the basis vectors on top
of their corresponding spots in the pattern. This is done by
dragging them with the mouse. Spots A and B are good candidates
for adjusting the spot pattern because they are near the outside
(further from the center) so that adjustment is more precise.
The spots in the image do not need to be in the exact center
of the circles, as will be seen in the next step, but the closer,
- Turn off (delete) circles that obviously do not correspond
to spots in the image by command-clicking them. This would certainly
include circles C-I that lie on the beam stop, and spots J,K,L
that lie partly outside the image.
- Trim | top
Deletes circles (spot markers) that are outside of the window.
All circles that are not over a reasonable spot should be deleted.
Use the Trim to window menu to turn off any spots that
have 'leaked' over the edge as you have moved the pattern.
- Move the diffraction image down a couple of inches (mouse
the title bar) so that the image displayed in the next step will
be visible. Note - in the process of clicking on various windows,
if the circle pattern becomes partly erased, click on the grow
square (lower right) to erase all of them, then invoke the Show
Spots menu again to redraw them.
- Inspect the spots by option
clicking them. The area immediately surrounding the spot
will be shown zoomed up, in a small window above the diffraction
image window. Reposition the windows as necessary so that both
the diffraction image and the small zoomed spot window can be
seen. Also three 'x'es will be seen in the small window. They
correspond to the brightest pixel in the area, the intensity
weighted centroid for the area, and the intensity weighted centroid
for pixels of 80% - 100% of max brightness for the area (blue).
Here is the same pattern as above, with various 'spots' labeled:
and here are the spots as zoomed for inspection by control-clicking
a This is a distinct, bright spot near the center. Note
that the scaling is done for the vicinity of the spot only, so
that it is shown more like it really is - a bright spot on a
relatively dark background. It does not appear this way in the
image above, because the scaling was done to show the dimmer
spots, thereby clipping spot a as well as others, and
making it appear blurred.
b There is really no spot here, as far as I can tell.
C This would be a good spot, except for the noise pixel
that is nearby. The 'refined' spot location (blue 'x') is pulled
off the obvious center (near the maximum pixel or red 'x'). Omit
d This is a dim but good spot. Dim, because the skirt
is more apparent in the zoom-up. The averaged or 'refined' spot
is offset a little from the maximum in what appears to be the
e Another bright spot, like a, except that this
spot happens to be centered on a pixel. The red 'x' marking the
center of the maximum pixel is overwritten by the blue 'x', which
is the 'averaged' location.
- In the zoomed images (or blow ups) of the individual spots
above, the colored 'x'es denote various measurements of the spot
center. The blow up shows all of the pixels that are used to
measure the spot center. Note that the spot in the diffraction
image can be almost outside the circle overlying it (in the larger
image), and still have its location measured properly. Conversely,
if a noisy pixel is within this area (such as in C), the
measured spot location will be thrown off.
- The colored 'x's mean:
- Red Marks the center
of the maximum pixel within the blow-up (essentially within the
- Green Marks the weighted
centroid for the blow-up. This generally is thrown off of the
spot due to the assymetric nature of the skirt, and is not used.
However, this measurement step measures the minimum and maximum
intensities within the blow up. The pixels that are 80% - 100%
of the maximum brightness are used in the next step.
- Blue Marks the weighted
centroid for the brightest pixels as described above. These will
be the few bright pixels in the skirt of the spot that are close
to the maximum pixel itself. This seems to give a reliable indication
of the 'real' spot center.
The spots at the edge of the pattern of circles are what are
used to determine the basis vectors. It is best to inspect ALL
of them. Some spots that look good may not be located correctly
because of noise in the image and should be ommitted. Don't worry
- the next closest spot to the pattern center will be used. The
spots can be clicked on rapidly, going around the edge of the
pattern - the blow up is displayed immediately in the small 'spot'
BV Average | top
Once the circles are adjusted, this measures the spot locations
from the image, and calculates the basis vector lengths and the
angle between them. The following figure shows a suitable selection
of circles for the Rutile spots.tiff, and the spots circled in
green that are used to calculate the length (and direction) of
the basis vector shown in red.
The vectors between the green circles are calculated from the
measured spot positions from the image. All the green vectors
are then averaged together for a good determination of the basis
vector shown in red. The same is done for the other basis vector
(shown in black).
The printout should look something like this:
Basis vectors: 49.26 pixels, 53.23 pixels, 56.91 deg.