- Background image compression factor
- Compress (sample) this number of pixels into 1 pixel in each
direction for background image.
- Box size (pixels - compressed image)
- Size, in pixels, of box (after compression of the image)
for each background calculation - preferably an odd number.
- Percentage of pixels for background
- Percentage of pixels within a box to treat as background.
If minus the required percentage value is given is given,
then pixel values of zero will be omitted from the calculation.
The IPDISP type measurement options may be made by selecting the
'IPDISP Options' item from the drop down menu in the image display section
of the screen. The following dialogue will be shown:
Figure 3: IPDISP Dialogue Window

Note: As this is a pop-up dialogue, no active strip is shown; both
the menu and parameter table are active till the dialogue is dismissed. For
this particular 'user supplied' dialogue, the main window objects are
inactivated while the dialogue is visible and the dialogue can only be closed
using its menu 'Close' button and not by clicking on the close button on the
dialogue window border.
As indicated above, the following IPDISP measurement options are available:
- Measure the image centre position.
- Calculate and display resolution circles.
- Measure spot resolutions.
- Measure cell related spacings.
- Fit a circle and calculate its centre position.
List of subsections in this section:
Measure Centre Option
Display Resolution Circles
Spot Resolution Option
Cell Spacing Option
Fit Circle Option
When the 'Measure Centre' menu item is selected, the following menu is
displayed:
Figure 4: 'Measure Centre' menu

When the 'Measure Centre' menu item is selected, the message
<<<Select centre on image>>>
is output in the dialogue's I/O window. A centre position is selected by
moving the image cursor to the required position on the image (or magnifying
window) and clicking Button 1 of the mouse. The new centre position is marked
by a cross on the image and its coordinates are updated in the parameter
table. The centre mark on the image may be displayed or erased using the
other menu buttons. The input of new centre positions may be repeated
as often as required. (The 'Measure Centre' button does not really need
to be used as its only function is to display the message in the I/O
window).
A new image centre position may also be selected by changing the values
of the 'x_cen' and 'y_cen' parameters in the parameter table.
When the required centre has been input, the menu 'Return' button is used
to return to the main IPDISP measure menu.
The 'Show Circles' and 'Erase Circles' options from the IPDISP options
menu enable the display or removal of resolution based circles on the image
display. Resolution circles can only be displayed if values for the crystal
to detector distance and the wavelength have been set. In PXimage, these
will normally need to be set via the parameter table in the dialogue
window unless already set via one of the other sets of user options or
via the input of a DDM file when the program was run. If either value is
zero, a warning dialogue will be displayed.
Four resolution circles are drawn using the four resolution values in
the parameter table. These may either be set individually or, if the
'Set all circles' parameter value is set to 'Yes', four values will be
calculated from a single value input for the outer resolution
circle. In this case, for an input resolution limit 'res', the four
resolution rings will be at 'res', '1.5*res', '2.0*res' and '4.0*res'
Angstroms.
The resolution circle positions will be based on the current measured
centre position (taking into account any detector tilt if set).
The values of the crystal to detector distance, the wavelength, and the image
centre positions (and detector tilt) need to be set correctly for this option.
If the crystal to detector distance or the wavelength is zero, a warning
dialogue will be displayed.
When the 'Spot Resolution' menu item is selected, the following menu is
displayed:
Figure 5: 'Spot Resolution' menu

When the 'Measure Spots' menu item is selected, the message
<<<Select spots on image>>>
is output in the dialogue's I/O window.
The user may then position the image cursor on any spot position (or other
place) and click Button 1 of the mouse. The selected (spot) position will be
marked on the image by a red cross and the calculated resolution
will be displayed on the dialogue's I/O window.
When required, the crosses marking the selected spots may be removed
by pressing the 'Erase Symbols' button on the menu. When the required
spot resolutions have been determined, the option is completed via
the 'Return' button on the menu and the main IPDISP options menu will
be re-displayed.
The values of the crystal to detector distance, the wavelength, and the image
centre positions (and detector tilt) need to be set correctly for this option.
If the crystal to detector distance or the wavelength is zero, a warning
dialogue will be displayed.
For this option, each measurement requires the input of two spot positions
along a row of spots and the number of orders separating the two spots.
When the 'Cell Spacing' menu item is selected, the following menu is
displayed:
Figure 6: 'Cell Spacing' menu

When the 'Measure Spots' menu item is selected, the message
<<<Select first spot on image>>>
is output in the dialogue's I/O window. The user may then position the
image cursor on the first spot position and click Button 1 of the mouse.
The selected spot position will be marked on the image. The message
<<<Select second spot on image>>>
is then output. The second spot is then selected and its position will
be marked on the image. The following prompt is then output to the
dialogue's I/O window:
Enter number of orders:
The user inputs the number of orders and the calculated cell spacing
is output to the dialogue's I/O window. Further pairs of spot positions
and order numbers may then be input as needed.
When required, the crosses marking the selected spots may be removed
by pressing the 'Erase Symbols' button on the menu. When the required
cell spacings have been determined, the option is completed via
the 'Return' button on the menu and the main IPDISP options menu will
be re-displayed.
For this option, a series of positions on the image is measured around
a circle (e.g. a Wax ring image) and a circle is fitted to these points
by a least squares procedure.
When the 'Fit Circle' menu item is selected, the following menu is
displayed:
Figure 7: 'Fit Circle' menu

If a circle has already been input, a new circle may be started by selecting
the 'New Circle' menu item. Image points may be added or deleted using
image cursor position and clicking Button 1 of the mouse. When the dialogue
is first displayed, the 'Add Points' mode is assumed. When new points are
added, their positions will be marked with crosses on the image. If points
are added incorrectly, select the 'Delete Points' option and point to
the required marked points on the image and click Button 1 of the mouse
to delete them (one at a time). To add further points, select the 'Add Points'
option (again) and continue as before.
When the required number of points have been input (minimum of three), a circle
may be fitted by selecting the 'Fit Circle' item from the menu. The fitted
circle will be displayed on the image and its centre marked (magenta cross).
A circle radius in mm and a rms error from the fitting in mm will be output
to the dialogue's I/O window. The centre position of the circle, in rasters,
is also shown. An example of a circle fitting is shown below:
Figure 8: Example of a fitted circle

If the purpose of fitting a circle was to determine the image centre position,
the found centre position may be selected as a new image centre position by
selecting the 'Set Centre' menu item. The circle and its associated points
may be removed from the image display by selecting the 'Erase Symbol' menu
item. When the required circles have been fitted, the option is completed via
the 'Return' button on the menu and the main IPDISP options menu will
be re-displayed.
The image display object used in the PXImage program stores a set of
Diffraction Data Module (DDM) parameters. This is used primarily as
a means of passing image related parameters bewteen the different
sets of 'user defined' options accessed via the drop down menu in
the image display section of the screen. In this context 'user defined'
refers to the fact that new sets of options can be added to the image
display object and made accessible via the drop down menu. However
this is a computer programming task and not something that can be
done by a user of the PXImage program which has the fixed set of
options described in this document.
When the 'DDM File Options' item is selected from the drop down menu,
the following dialogue is displayed:
Figure 9: DDM file options dialogue

Note: As this is a pop-up dialogue, no active strip is shown;
both the menu and parameter table are active till the dialogue is dismissed.
For this particular 'user supplied' dialogue, the main window objects are
inactivated while the dialogue is visible and the dialogue can only be closed
using its menu 'Close' button and not by clicking on the close button on
the dialogue window border.
The 'DDM File Options' item enables the DDM parameters to be read in from
a file, edited manually through the parameter table, or written out to a
file. An option is also available to calculate and display a predicted
pattern on the current image. The handling of file names in analogous
to that described for reading and writing images i.e. a file selector
or input of a file name via the I/O window (in this case the one within
the current dialogue) may be used depending on the circumstances.
The parameter table in the dialogue is the standard DDM parameter table
and allows for any of the DDM parameters to be examined or reset. It is
a multiple layer (or multiple table) parameter table with the first layer
containing the most important parameters required for predicting a
diffraction pattern.
The 'Find Setting Options' may be used to determine the crystal orientation,
using a Fourier Transform method, for the displayed image when the cell
parameters are known (Rotation images only). The initially determined
setting may then be refined either by matching pairs of predicted and
observed spot positions or, if the setting is sufficiently close, by
searching for the spot positions close to the predicted positions. The
method is related to the auto-indexing procedure described by Campbell (1998)
though the problem is simplified by assuming a known cell and full
3-dimensional Fourier transforms using FFTs are not needed.
The examples is this section use a diffraction image from a Prismane
protein which was made available to the author when researching the
3D-FFT method. The structure has been solved by Arendsen et al.
(1996). The figure below shows the image in question:
Figure 10: Prismane Protein Image

At the time of writing, the procedure it still at rather an experimental
stage. Two different Fourier Transform methods have been coded though only
one is currently used in the PXImage program. Similarly, more options are
coded for the refinement stages than are currently used here. Also, at
this stage, no distortion corrections are included in the refinement.
It may well be profitable to use the option in conjunction with a demonstration
image as a learning tool to give a feel for a crystal orientation determination
and refinement procedure. The difference plots displayed at the refinement
stage give a visual feel for how well the refinement is proceeding and can
show up any systematic errors at the end of a refinement. These would be
dealt with by a distortion correction during a fuller analysis of the data
using a program such as MOSFLM.
To carry out the determination of the crystal setting, the 'Find Setting
Options' item is selected from the drop down menu in the image display
section of the screen. The following dialogue will be shown:
Figure 11: Find settings dialogue

Note: As this is a pop-up dialogue, no active strip is shown;
both the menu and parameter table are, in general, active till the dialogue
is dismissed though parameter table input may be disabled at some stages
(e.g. while using the refinement options). For this particular 'user supplied'
dialogue, the main window objects are inactivated while the dialogue is
visible and the dialogue can only be closed using its menu 'Close' button
and not by clicking on the close button on the dialogue window border.
The listed options are described in the sub-sections that follow:
- Measure the centre
- Calculate a background image
- Find spots on the image
- Find the crystal setting
- Show and clear a predicted pattern
- Refine a setting
Following the 'Measure Centre' option (if required), the next two stages
in determining the crystal orientation from the image involve determining
a background image and, following that, searching for spots on the image
and determining their positions (and average size). If the default parameters
are OK for these stages, they need not be explicitly requested if a setting
is to be found as these calculations will automatically be carried out (if
they have not already been done) when the 'Find Setting' option is selected.
List of subsections in this section:
Measure Centre Option
Find Background Option
Find Spots Option
Find Setting Option
Show and Clear Prediction Options
Match and Refine Option
Search and Refine Option
Accept Setting Option
The 'Measure Centre' option is essentially the same as that described
above in the IPDISP options section.
The 'Find Background' option is essentially the same as the 'Calculate
Background Image' option described above. The adjustable parameters bg_cmp,
bg_box and bg_pcnt are available on the second layer of the dialogue's
parameter table.
The 'Find Spots' option has its own menu with items to find the spots, and
to show or clear the found spots on the image display. The method, (based
on the old IMSTILLS program of Andrew Leslie), searches for pixels
at a certain threshold above background to determine those pixels which are
presumed to belong to spots. The method continuously updates a spot position
by updating the calculation of its centre of gravity as the spot is
built up from contiguous above threshold pixels. The adjustable parameters
for the method (second layer of the dialogue's parameter table) are 'rexcl',
'spots thr' and 'minpix'. The method uses rmin+rexcl and rmax-rexcl as
the actual limits for the minimum and maximum radii to avoid edge of detector
problems with the spot search calculation. Pixels with values greater
than 'spots_thr'*sqrt(background) above local background are considered
as being pixels which belong to spots. 'minpix' is the minimum number of
pixels which may be considered to be a spot.
The find spots method normally then carries out a second pass to try and
remove artefacts from the list. This may be enabled or disabled via the
'reprocess' parameter in the parameter table. The basic method allows
for a series of parameters to be adjusted but these are all fixed when
used in the context of the PXImage program. The method searches around
each spot position in the stored spots list (in PXImage using a box 3.0
times the spot size based on the spot sizes found for the 25% of spots
between positions 70% and 95% in the spots list sorted by intensity) and
finds better spot positions and sizes, normally using lower thresholds than
in the original search. For any large spots (more than twice the average
size in either dimension found as described) a surrounding box is examined
using a threshold of 25% of the maximum pixel intensity in that box to see
if it may contain multiple spots; if so these will be separated and added
to the spots list provided that they are not already there (a spot within
0.3 of a spot dimension in each direction). If any of these spots are
still more than twice the average size in either dimension, they are
flagged as bad spots. All other spots are then examined
by taking taking a box of data around the spot (in PXImage 3.0 times the
average spot size) and centering an ellipse (axial ratio based on average
spot sizes) and expanding/contracting it to find the size where a given
percentage (in PXImage 90%) of the pixels are above a threshold of, in
PXImage, 3.0 standard deviations above the background. A new
centre of gravity is then determined based on the pixels within this
ellipse. The process is iterated (in PXImage 2 iterations). If the ellipse
expands to the box limit without sufficient below threshold pixels found
the the spot is flagged as a bad spot. If the new centre of
gravity determined is too far from the original spot position (more than
0.33 of the average spot dimension in either direction), then the spot is
flagged as a bad spot.
When the spot list has been found, spot statistics are output to the
dialogue's I/O window. These give the number of spots found, the average
spot size in pixels along each axis and the average and maximum spot
intensities. The number of rejected bad spots is also shown with, in
brackets, the number which were too big from the box search, the number
which were too big from the elliptical search and the number which had
too big a shift on re-processing.
Before carrying out the setting determination, appropriate values need
to be set for all the parameters on the first layer of the dialogue's
parameter table (the pixel sizes should have been correctly input when
the image file was read but may be checked using the 'DDM File' options
described above if required). The success of the method depends on having
good estimates of these parameters and special care should be taken to
determine an accurate image centre position. If the image background has
not already been calculated or the spots on the image found, then these
stages are automatically carried out using the current values set for any
of the tuning parameters.
Two possible methods are available for finding peaks in a Fourier transform
corresponding to the cell vectors.
- Method 1
- Rotate a vector in appropriate steps around two angles, one through
90 degress and the other through 360 degrees (As done in MOSFLM program)
and look for peaks along those vectors at the cell distances (looking at
a grid of 9 points around each such position if the FT value passes
a low resolution threshold limit) and calculating the Fourier
transform at these points. Peaks are stored for consideration if
their height exceeds a threshold of 3.0 times a standard deviation
calculated from a low resolution FT scan. This is the method currently
used by PXImage.
- Method 2
- Search on an orthogonal grid but only calculate Fourier transform
values for points which are within 1.5 grid units of a given cell vector
length.
As the required parts of the Fourier transforms are very sparse for both
methods, a simple Fourier transform calculation is done (using integer
arithmetic) rather than using a Fast Fourier Transform.
The maximum difference in degrees from an input cell angle
to consider as a reasonable match is set in the PXImage program
at 2.5 degrees.
The method finds a list of acceptable peaks at each of the cell lengths
and sorts them into descending order of peak height. Then, starting with
the cell parameter which has the highest peak height overall, the peaks
corresponding to the other cell lengths are examined to find sets of
the three cell vectors with the required angles (within the chosen tolerance)
between the vectors. If a potential setting is found, a search is made
for other vectors related to the basic cell vectors (e.g. 011, 101, 110,
and 111 and, for centred lattices, vectors from the origin to the centred
positions). In some cases, the third vector from a cell may not have a
sufficiently high peak to have been included in a peak list because a
single image may tend to give strong peaks in only two of the dimensions
depending on the crystal setting. Therefore, if a third vector is not found
after determining a possible pair of vectors, then, as the orientation can
be determined from just two vectors, a search is made over the related
vectors. If sufficient of these (2/3) can be found with acceptable peak
heights, a potential solution is considered to have been found. For
each solution an initial refinement of the orientation is done using the
given cell parameters and the positions of the found peaks for the
corresponding vectors.
The details of any possible setting solutions found are listed on the
dialogues's I/O window. The details given for each solution are:
- A solution number (used to identify it).
- The number 3 or 2 to indicate whether it was found initially from
a three vector or two vector solution (see above).
- The values found for the missetting angles PhiX, PhiY, PhiZ.
- The peak heights for each of the cell vectors relative to a value
of 1.0 for the maximum peak height for a peak from the first solution.
- The number of cell related vectors found over the number examined.
If no solutions are found an error message stating this will be output
instead. If several solutions are found, they may in some cases just
correspond to equivalent settings. In general, the first solution
should be the most likely to be correct.
When a setting has been found, a prediction may displayed on the image
or cleared from the image. This may be done for any of the potential
setting solutions listed, the required one being selected via the
dialogues's parameter table situated under the menu. When a solution
is selected, its missetting angles will be displayed as the 'Found
PhiX', 'Found PhiY' and 'Found PhiZ' items in the dialogue's
main parameter table. It may be noted that, if values are set manually
for these found missetting angles, a prediction may be done even before
any setting solution has been determined. Similarly they may be adjusted
manually if required though they will obviously be reset if another
solution is selected. These found missetting angles are not stored in
the internal DDM unless the 'Accept Solution' item is selected from the
menu (see below).
In the parameter table below the menu, there is also a parameter enabling
the symbol sizes to be adjusted as desired, perhaps using the small size
when looking at the whole image or one of the larger sizes when examining
a portion of the image in detail.
If, after selecting a solution via the parameter table and carrying out a
prediction, it can be seen that the orientation is basically correct but
the predicted spots are not say within a spot size of the observed spots,
the match and refine option may be used to refine the orientation. Its
use is obviously dependent on being able to tell which predicted spot
goes with which observed spot which is unfortunately not always clear
even if there is a basic pattern match.
When the 'Match and Refine' item is selected the following menu is
displayed:
Figure 12: Match and refine menu

Pairs of predicted followed by observed spot positions are input using
the image cursor position and clicking the mouse Button 1. If needed,
the matches list can be cleared. Also, matches may be deleted by selecting
the 'Delete Matches' item and pointing to the predicted position for
an existing matched pair and clicking the mouse Button 1; after deleting any
such matches, the 'Add Matches' item enables further new matches to be
input and added to the list.
Options are available to output the matches list to a file or read in
such a file. This could be useful if problems are anticipated with the
refinement (e.g. unsure of some of the choices made) enabling a list
to be re-input and modified for further refinement attempts.
<br/
When the matches list has been prepared, the 'Refine Using Matches' option
may be used to refine the orientation related parameters. The parameters
to be refined are selected from the parameter table below the menu. After
a refinement a difference plot is displayed on the image. This should
hopefully indicate the progress of the refinement or highlight problem
areas. Details of the refined parameters are output to the dialogue's
I/O window.
If the refinement proceeds in a satisfactory manner, the 'Accept Refined
Parameters' item may be selected to accept the refined parameters which
will then be stored in the internal DDM. The 'Search and Refine' option
may then be used to carry out further refinement, probably using more
spots.
Further details about the refineable parameters, the difference plots,
output of refinement results and accepting the results may be found in the
description of the 'Search and Refine' option below.
If, after selecting a solution via the parameter table and carrying out a
prediction, it can be seen that the orientation has been well determined
i.e. that most of the predicted spots are say within a spot size of the
observed spots (at least in the lower resolution part of the pattern),
then the search and refine option may be used to refine the orientation
related parameters.
When the 'Search and Refine' item is selected the following menu is
displayed:
Figure 13: Search and refine menu

The refinement may be carried out in three different ranges of increasing
resolution. It should be noted that the resolution used here is based
on the image 'rmax' parameter; if the prediction does not reach this limit,
it will be necessary to adjust the DDM resolution parameter (which may
be found on the second layer of the dialogue's main parameter table). Similarly
it may be necessary to adjust the DDM mosaicity parameter (also on second
layer of the parameter table) to get a better fit in terms of the numbers
of predicted and observed spots.
The program determines the centre of gravity of an observed spot by
examining the pixel data in a box surrounding the predicted position.
The size of the box used is dependent on the average spot size determined
from the 'find spots' method and may have dimensions from 1.0 to 5.0 times
that size. By default the box used is 2.0 times the spot size. The factor
used is the 'box_factor' parameter on the second layer of the dialogue's
main parameter table. Pixels with values above the image background level
by more than 'search_thr' times the square root of the background value
are used in the spot position calculation. The 'search_thr' parameter
(also on the second layer of the parameter table) is set to 10.0 by default
but may be adjusted if necessary. If part of a spot lies outside the
box, as determined by the centre of gravity position and spot size, then
the box position is shifted appropriately and a second spot position
determination is carried out.
The parameters to be refined, when one of the 'Refine...' items is selected,
are chosen via the parameter table below the menu. When the Phi values are
included in a refinement, the PhiZ parameter is in fact refined separately
from any of the other parameters though this is transparent to the user.
When refining cell parameters, only the unique parameters will be refined
provided that the symmetry parameters have been correctly set. It should
be noted that, as the crystal to detector distance is treated as a
refineable parameter, the 'A' cell parameter is never refined.
When a refinement has been carried out, a difference plot is overlayed
on the displayed image. This shows the predicted spot positions (red
symbols), observed spot positions (green symbols) and vectors showing
the magnitude and direction of the discrepancies between the observed
and predicted positions (centred on the observed position). Each difference
vector is exaggerated from its actual value by a factor of 10.
An example of a difference plot, after only a medium resolution refinement
of the missetting angles, is shown below.
Figure 14: Difference plot after refining phis

A similar plot is shown after refining the centre position and the crystal to
detector distance:
Figure 15: Difference plot after refining phis

Though this is much improved, it can be seen that there is one difference
vector very much larger than the others. Zooming in on this area shows
the following:
Figure 16: Part of a difference plot showing a bad fit

In this case, it can be seen that the weak spot at the predicted position
has been missed and the edge of the neighbouring strong spot found in error.
If there are many such anomalies, it may help to change the threshold limit
(in this case, lowering it would probably enable the correct spot to be
found) or decreasing the box size (the search would then probably not
extend as far as the neighbouring spot). However, if only a few such problem
mismatches are found it is better to use the 'Delete Observations' option
from the menu. When this has been selected, the menu item name changes to
'Cancel Delete' and bad matches may be removed by pointing to a predicted
position with the image cursor and clicking Button 1 of the mouse. When
the required bad matches have been deleted, select the 'Cancel Delete'
item on the menu. The following plot shows the same section of the image
after the bad match has been removed. A list of these omitted reflections
is stored.
Figure 17: Part of the difference plot after removing the bad fit

Another section of a difference plot is shown before including cell
parameters in the refinement and then at the end of the refinement when
all refineable parameter have been refined:
Figure 18: Part of a difference plot before final refinement

Figure 19: Part of the difference plot after final reinement

The difference plot for a complete image at the end of the refinement is
shown below:
Figure 20: Difference plot at the end of a refinement

After a refinement, the details of the refined parameters are output
to the I/O window together with an rms deviation, in rasters, between
the observed and predicted positions. The number of observations included
in the refinement is also shown. For the current example, an rms of 0.7
rasters for 556 observations was found as shown below:
Figure 21: Example of refinement results

Though this is a good result, closer examination of the difference
plot shows that there are some systematic errors with the difference
vectors showing different trends in different parts of the image. Zoomed
versions of two sections of the image from towards the bottom left and
bottom right are shown below.
Figure 22: Section of the final difference plot

Figure 23: Another section of the final difference plot

In this example, the image was recorded on a spirally scanned MAR image
plate system and radial and tangential distortion corrections are required
to remove these systematic errors. For the reasons indicated earlier in
this document, such corrections are not currently included in the PXImage
program.
If a list of omitted reflections has been made, then this remains in use until
a return is made from the 'Search and Refine' menu. If 'Search and Refine' is
requested again, then the user is given the option of retaining or clearing
the omitted reflections list before carrying out the new refinements.
After a refinement has been carried out, the DDM parameters are not updated
with the refied values unless the 'Accept Setting' menu item is selected.
This may be done within the 'Search and Refine' procedure or the 'Match
and Refine' procedure or after returning to the main 'Find Setting Options'
menu. If a refined setting has not been accepted then the refinement results
will be 'lost' if 'Search and Refine' or 'Match and Refine' is re-entered
(see also 'Accept Setting' option description below). If a list of bad
matches was made and the 'Search and Refine' procedure is re-entered, a
pop-up dialogue gives the user the option of continuing to use or of
clearing that list. If refined parameters have been accepted, then these
will be taken as the new starting parameters if the 'Search and Refine'
procedure is re-entered. Repeating the procedure with these new parameters
as a starting point may enable further spots to be found and may enable
and possible enable an improved refinement.
After a setting has been determined or a refinement carried out, the initially
determined setting parameters or refined parameters are not used to update
the parameters in the DDM unless the 'Accept Setting' option has been
selected. If this is not done, then these parameter values will be 'lost'
if a new refinement is requested ('Search and Refine' or 'Match and Refine)
or if the 'Find Settings Option' is closed. If accepted, then the new
parameter values will be used to update the internal DDM set of parameters
and predictions via the 'DDM File Options' menu will use these new parameter
values and that option may also be used to write a DDM file containing the
updated values.
A demonstration set of data can be set up and details passed to
the program when it is run. In such a case, a 'Demonstration Image' item
will appear in the program's main menu and this may be used to
display the demonstration image. A Lysozyme image file and a
Prismane Protein image file have been deposited with the program
together with DDM files which contain the basic parameters required
to determine a crystal orientation but with the missetting angles
set to zero. The Prismane example has been used as an example for
the 'Find Setting' option described and illustrated above and it
may be a useful starting point for user to investigate that option.
The 'Max' threshold for the image display needs to be lowered e.g. to
250 to enable a clearer view of the diffraction pattern itself though
this has no effect on the setting calculations or refinement.
A suggested refinement sequence for the Prismane case, which should
be applicable fairly generally, is as follows (using the 'Search and
Refine' option after the initial setting has been determined and
using the first solution):
Refine 0.3 Resolution (Phis)
Refine 0.3 Resolution (Phis, centre)
Refine 0.3 Resolution (Phis, centre, c_to_d)
Refine 0.5 Resolution (Phis, centre, c_to_d)
Refine 0.5 Resolution (Phis, centre, c_to_d, cell)
Refine full Resolution (Phis, centre, c_to_d, cell)
To see the 'bad match' illustrated in the text, the first two
refinement steps after finding the setting were:
Refine 0.3 Resolution (Phis)
Refine 0.5 Resolution (Phis, centre, c_to_d)
The PXImage program may either be run as an application or as an
Applet. It requires both the class files for the PXImage program
and for the Jdl library which will normally be available in a .jar
file. Details of setting up the classpath etc. parameters are not
given here as they depend on where and how the classes are stored.
The examples are shown with the options to include a demonstration
image (and related data), in this case for the Prismane protein
which has been illustrated in the 'Find Setting Option' examples
described above.
- Running PXImage as an application
- After java command, the following switches and parameters may be given:
-dif filename (Demonstration image file name)
-dsf filename/code (Demonstration image SPD file name or image
type code (as in program's parameter table)
-ddm filename (A DDM (Diffraction Data Module) file name
for a DDM associated with the demonstration
image)
-typ code (Default image type code (one of valid codes
as shown in parameter table menu e.g. m,
mv, a, aq4 etc.)
-spd filename (Default spd file name - in this case "-ityp spd"
would normally also be given for the previous
switch)
-idw npix (Set the required width in pixels for the
image display area >= 100)
e.g. java PXImage -dif prismane.img -dis m -ddm pris_start.ddm -typ a
These switches enable the input of details for a demonstration image
and associated image type and, if desired, DDM file, default starting values
for the image file type, and a user defined width in pixels for the image
display area to override the default width of 400 pixels.
- Running PXImage as an applet
-
The program may be run as an applet in two different forms, either with
the main program window within the Web page or with a small launcher
applet within the web page which then launches the program in its own
window.
Various parameters may be set when the applet is run. These are the
same items as described above for the program switches when the program
is run as an application. For the applets, the parameters are as follows:
demo_file=filename
demo_spd=filename/code
demo_ddm=filename
image_type=code
spd_file=filename
img_display_width=npix
The following are two examples of the applet 'html' tags used to run the
two cases using the Prismane files for the demonstration image and
'ADSC' images as the default image type for user input images. In this
example it is assumed that all files are in the same directory as the
'html' file containing the applet tagged data.
<applet archive="PXImage.jar,Jdl.jar"
code="PXImage_applet.class"
width=680 height=550>
<param name=demo_file value=prismane.img>
<param name=demo_spd value=m>
<param name=demo_ddm value=prismane_start.img>
<param name=image_type value=a>
</applet>
<applet archive="PXImage.jar,/Jdl.jar"
code="PXImage_applet_launcher.class"
width=130 height=130>
<param name=demo_file value=prismane.img>
<param name=demo_spd value=m>>
<param name=demo_ddm value=prismane_start.img>
<param name=image_type value=a>
</applet>
When run as an applet, various Security related issues aries. These
are discussed in a separate Security
Document.
The table below summarises the Diffraction Data
Module (DDM) parameters most relevant to the use of PXImage. Some of the
other DDM parameters such as selecting areas of the image or non-default
detector geometry, will affect the predictions made if non-default values
are used. Full details of the DDM parameters are given in the documentation
of the Diffraction Data Module. In the table below keywords followed by []
indicate crystal set based parameters and those followed by [][] indicate
image based parameters. For PXImage only a single set and single image are
of interest.
Dataset Parameters
Diffraction type TYPE Diffraction type: Rotation, Laue, Weissenberg
Crystal Based Parameters
Sample Parameters
Crystal system SYSTEM The crystal system Tri, Mon, Ort,
Tet, Hex, Rho or Cub.
Lattice type LATTICE Lattice type P, A, B, C, I, F or R.
Crystal symmetry SYMMETRY The space group symmetry followed by
the space group number, space group
name or symmetry operators or 'clear'
'clear' to clear current symmetry.
Cell A[], B[], C[], ALPHA[], BETA[], GAMMA[]
The cell parameters in Angstroms and
degrees.
Resolution RESOLUTION[][] The resolution limit in Angstroms.
Mosaicity MOSAICITY[][] The mosaic spread in degrees.
Orientation parameters:
Missetting angles PHI_X[][], PHI_Y[][], PHI_Z[][]
The missetting angles in degrees.
Orienting phi PHI_ORIENT[] Goniometer angle for image used to
set the orientation PHI's.
Current Experiment
Rotation ranges ROTSTART[], ROTEND[]
Rotation start and end angles in
degrees. This is a suffixed
parameter so several ranges may
be input if required. May use
ROTSTART1, ROTSTART2 etc.
Osc or inc angle ANGLE_OSC[] Oscillation angle in degrees (or
ANGLE_INC[] spindle increment for Laue (+ve)).
(aliased names).
Detector and Source Parameters
Detector Setting
Distance DISTANCE[][] The crystal to detector distance
in mm. (also called 'ctod' in PXimage)
Maximum radius RMAX[] Maximum radius on detector in mm.
Rotations TAU_X[], TAU_Y[], TAU_Z[]
Rotations of the detector around the
three detector axes. Theta tilt
is TAU_Z.
Source parameters
Wavelength WAVELENGTH[] The wavelength in Angstroms.
Image Parameters
X-centre X_CEN[] 'X' centre position in rasters.
Y-centre Y_CEN[] 'Y' centre position in rasters.
Pixel size (x) PIX_X[] Pixel size in 'x' in mm.
Pixel size (y) PIX_Y[] Pixel size in 'y' in mm.
Minimum radius RMIN[] Minimum radius in mm.
'rmin' x-centre R_XCEN[] 'x' centre of 'rmin' circle in
rasters.
'rmin' y-centre R_YCEN[] 'y' centre of 'rmin' circle in
rasters .
x,y limits X_MIN[], X_MAX[] Y_MIN[], Y_MAX[]
Limits on 'x' and 'y' in rasters.
The WI format consists of a fixed set of header items followed by the
pixel data based on the standard Java data types (int, boolean, double)
as follows:
ns_ras (int)
nf_ras (int)
iorder (int)
ktype (int) (3 for diffraction image, 0 for RBG picture image)
nax1_rasts (int)
nax2_rasts (int)
min_val (int)
max_val (int)
null_pixel (int)
ovld_pixel (int)
ovfl_flag (boolean)
pixsiz_x (double)
pixsiz_y (double)
followed by ns_ras*nf_ras (int) pixel values.
Details of the header items can be found in the documentation of the
JdlImageData class in the Jdl/JdlPX package.
For diffraction images, the pixel values are the pixel intensities. For
picture files each integer is the Java RGB color model default format
for integer RGB values with packed with alpha, red, green and blue components
(0-255) for each pixel (0xAARRGGBB).
The spatial distortion files (spdfil for short) contain information which
characterises the image file which is to be viewed - in turn these
characteristics are determined by the detector, the collection
software/hardware, and site specific setup.
The spdfils are short ASCII files which typically contain several lines of
comments and two lines of data. The data lines look like:
# IMGTYP NHEAD LRECL NPIXEL NPXREC IMGDRC ENDED
#.......#.......#.......#.......#.......#.......#.......
RAX 1 1024 950 950 +y+x litend
#
# YPXMAX ZPXMAX YBEAM ZBEAM YPXSIZ ZPXSIZ ROFF TOFF
#.........#.........#.........#.........#.........#.........#.........#.........
950. 950. 425.0 425.0 0.2034 0.210 0.0 0.0
Lines beginning with # are comments and are ignored by when reading the file.
The following sections describe the meaning of the different items in the data
lines and how to customise existing spdfils or create new ones. Because the
files are 'legacy' files, the PXImage program assumes that the original rigid
formatting requirements of the data lines are adhered to.
Descriptions of spdfil data items:
Line 1: IMGTYP, NHEAD, LRECL, NPIXEL, NPXREC, IMGDRC, ENDED
These entries have the following fixed fortran format: (A8, 4I8, 2A8), i.e.
imgtyp (string, 8 character field), nhead/lrecl/npixel/npxrec (integers, each
with an 8 character field), imgdrc/ended (strings, each with 8 character
field).
- IMGTYP
- Image type, eg 'MAR', EMBL', 'RAX', 'MLDS', 'GEL' etc. Only used for
reference purposes for the user. (Not used by PXImage)
- NHEAD
- Number of header records. (1 for MAR, 0 if none)
- LRECL
- Record length (may be longer than actual image size; mustn't be smaller
than NPIXEL)
- NPIXEL
- Number of image pixels to read from each record; this corresponds to the
number of pixels along the 'fast' axis.
- NPXREC
- Number of records to read; this corresponds to the number of pixels along
the 'slow' axis.
- IMGDRC
- Image direction; string of the form e.g. -x+y which corresponds to the
MOSFLM convention (as adopted in the Diffraction Data Module (DDM) used by
PXImage) for the order and direction of the slow and fast axes stored in the
image file.
- ENDED
- Endedness of machine that wrote the image file: 'litend' (little-ended,
ie least significant bit written first - this is the default) (Vax- or
PC-like) 'bigend' (big-ended, ie most significant bit written first) (SGI,
ESV, Sun, etc.) This may also contain the string sqt (eg 'bigsqt') indicating
squashed data above 32767, or ovf (e.g. 'bigovf') indicating Mar-style
overflow table.
Line 2: FPXMAX, SPXMAX, FBEAM, SBEAM, FPXSIZ, SPXSIZ, ROFF, TOFF
These entries have the following fixed fortran format: (8F10.4) i.e. each
of the entries are reals with a 10 character field and 4 decimal places.
- FPXMAX
- Maximum usable pixel number along fast axis
- SPXMAX
- Maximum usable pixel number along slow axis
- FBEAM
- Fast axis centre coordinate of main beam (guess at FPXMAX/2)
- SBEAM
- Slow axis centre coordinate of main beam (guess at SPXMAX/2)
- FPXSIZ
- Pixel size in mm along fast axis
- SPXSIZ
- Pixel size in mm along slow axis
- ROFF
- Radial offset correction for radially scanned MAR image.
- TOFF
- Tangential offset correction for radially scanned MAR image.
Note: PXImage only uses the two pixel size parameters from this line.
Note also that in the original description of the line 2 entries FPXMAX, FBEAM
and FPXSIZ were described in terms of Yms and SPXMAX, SBEAM and SPXSIZ in
terms of Zms axes.
Of these, NPIXEL, NPXREC, FPXSIZ and SPXSIZ are detector properties. IMGDRC,
ENDED are collection characteristics. FBEAM and SBEAM are site specific. In
PXImage, the centre position from the spd file is ignored and the centre
position will be input manually or measured from the image when it is needed.
Only the pixel size parameters are used by PXimage.
ROFF and TOFF are corrections to do with scanning errors for detectors scanned
in a spiral and the data then converted to a rectangular grid for storage
in the image file - these are corrections for the case when the spiral is
off-centre. They should in any case be small so set them both to zero if you
don't have any better estimate (again the values are ignored by PXimage).
Arendsen, A., Bulsink, Y., Hagen, W., Hadden, J., Card, G., McAlpine, A.S.,
Bailey, S., Zaitsev, V. and Lindley, P. "Crystallization and Preliminary
X-ray crystallographic Analysis of the Putative [6Fe-6S] Prismane
Protein from Desulfovibrio Vulgaris (Hildenborough)", Acta Cryst. (1996),
D52, 1211-1213
Campbell, J.W. "XDL_VIEW, an X-windows-based toolkit for
crystallographic and other applications" J. Appl. Cryst. (1995), 28,
236-242
Campbell, J.W. "The Practicality of Using a Three-Dimensional Fast Fourier
Transform in Auto-Indexing Protein Single-Crystal Oscillation Images",
J. Appl. Cryst. (1998), 31, 407-413
Collaborative Computational Project, Number 4 "The CCP4 Suite: Programs for
Protein Crystallography" Acta Cryst. (1994), D50, 760-763
Leslie A.G.W. In CCP4 and ESF-EACBM Newsletter on Protein Crystallography
(1992),No. 26, DRAL Daresbury Laboratory, Warrington, WA4 4AD, England
Wonacott A.J., Dockerill S. and Brick P. "MOSFLM program" (1980) Unpublished
Notes.