How to use

After the program is opened, users will be able to select a file or a folder to process by pressing the button or select an option on the menu bar.

../../_images/start3.png-

When an image is selected, the program will automatically process the image if it has not been processed before. There are 2 tabs in the program, Original image, and Results.

Original Image

In this tab, the original image will be shown along with various options displayed on the right, Display Options, Image Processing, and Fix Center.

Display Options

../../_images/disp_options1.png-

All options in Display Options will not affect any processing. These options allow users to see more detail in the image by setting minimal intensity, maximum intensity, and zooming. You can also choose whether or not to see the meridional and equatorial axes. To zoom in, the user needs to simply press the Zoom in button, and select the zoom region by drawing a rectangle as shown below. Once ‘Zoom in’ or ‘Full’ button is clicked, the current zoom level is persisted when moved to the next image. The check box Persist max intensity is used to persist the max intensity when we move to the next image.

../../_images/image_tab.png-

Image Processing

../../_images/image_processing.png-

Mode Orientation Checkbox

This checkox uses the mode of the orientation angles in calculated from all the images in the folder as the rotation angle for fitting the images. All the images in the folder must be processed first before using this checkbox.

Save Cropped Image Checkbox

As discussed in the working of Quadrant Folding, we enlarge the image such that the diffraction center is at the center of the resulting image. On selecting this option the resulting quadrant folded image (which is saved in qf_results) is cropped such that the size of the image is same as the original input image size.

Set Rotation and Center

Before setting manual rotation and center, it’s better to zoom the image to the area of the diffraction because it will be easier to set these parameters correctly. To set the rotation and center, you need to click 2 positions of the image. The first one will be a reflection peak on one side of the equator, and the second one will be the corresponding (opposite) reflection peak on the other side of the equator. To cancel, press ESC.
../../_images/center3.png-

Set Center By Chords

Before setting center by chords, it’s better to zoom the image to the area of the diffraction because it will be easier to set these parameters correctly. This method is used to find the diffraction center and uses the fact that “All perpendiculars to the chords in a circle intersect at the center”. On clicking this button, you will be prompted to select points along the circumference of the diffraction patter. As you select these points, perpendicular lines to the chords formed using these points start to appear on the image in blue color. Once you finish selecting the points, click the same button again to start processing. The diffraction center will then be calculated by taking the average of the intersection points of the perpendicular lines (blue lines in the figure).
../../_images/chords1.png-

Set Center By Perpendiculars

Before setting center by perpendiculars, it’s better to zoom the image to the area of the diffraction because it will be easier to set these parameters correctly. This method finds the center of diffraction using intersection of perpendicular lines. On clicking this button, you are prompted to select multiple positions in the image. You can start by clicking the first reflection peak on one side of the equator and the second will be the corresponding (opposite) reflection peak on the other side of the equator. This forms one horizontal line. You can continue drawing as many horizontal lines using this process of selecting reflection peaks. Next, you can click the reflection peak vertically above the equator and the following point symmetrically below the equator. Again, you can draw multiple such lines. Once you finish selecting the points, click the same button (Set Center By Perpendiculars) again to start processing. The diffraction center will then be calculated by taking the average of the intersection points obtained by the horizontal and vertical lines plotted.
../../_images/perpendiculars1.png-

Set Rotation Angle

This assumes that the center of diffraction is correct. After the button is clicked, the program will allow users to select an angle by moving a line. Clicking on image when the line is on the equator of the diffraction will set manual rotation angle. To cancel, press ESC.
../../_images/rotation1.png-

The Mask Threshold is used for excluding certain pixel values when calculating the folded image. The program will ignore pixels with intensity below mask threshold. This can be used to remove the dark gaps in images resulting from the gaps between detector elements in Pilatus detectors, as well as other detector abnormalities.

To fix the center position to a user supplied value, you can check Fix Center check box, specify the coordinates of the beam center (before rotation). The image will be reprocessed when x, or y is changed. This will affect the next image if it’s still checked.

Double Zoom

This feature is used to zoom into subpixel level accuracy. On checking this box, a new subplot is created on the top right of the image. As you move the mouse pointer into the image area, 10 x 10 pixels centered at the location of the mouse pointer is cropped from the image and scaled up to 5 times and plotted in the subplot mentioned earlier. This feature can be used ONLY with set Rotation and Center feature. Click the double zoom check box so that the subplot appears. Click on Set Center and Rotation button. Drag your mouse pointer to the position you want to select the first point (or the first reflection peak as described earlier). Click the image to freeze the subplot region. A message appears, check do not show again box to not see this message again. Click on the exact point in the subplot region, which plots an equivalent point in the main image. Perform the previous two steps to select the second point. Uncheck the Double Zoom checkbox to hide the subplot window.
../../_images/DoubleZoom1.png-

Set Region of Interest

This feature is used to select part of the image and perform Quadrant folding on that part. For example, we would want to ignore the artefacts on the edges of the image. On clicking this button, a default rectangle appears around the center of diffraction. As you move the mouse pointer into the image area, the vertical edges of the rectangle move to where the mouse pointer is located in a symmetrical fashion. Click on the image to accept the current width of the region. Next, as you move the pointer, the horizontal edges of the rectangle start moving to where the mouse pointer is located in a symmetrical fashion. Click on the image to accept the current height of the fitting region. Once the width and height is fixed, the resultant image will be cropped to the region selected by the rectangle following which we process quadrant folding on the resultant image. Therefore, any artefacts present outside the selected region are ignored while quadrant folding. One can only select the region of interest about the center of diffraction. ../../_images/SetRegionOfInterest.png-

Results

In this tab, the resulting image will be displayed along with options on the right. Display Options will provide the same options as in Original Image tab. Users can specify min and max display intensity, and zooming.

../../_images/results1.png-

For the background subtraction section, by default, the program will not apply any background subtraction. To apply background subtraction, you can choose a method by method drop-down list. There are currently 6 options, Circularly Symmetric, 2D Convex hull, Roving Window, White-top-hat, Smoothed-Gaussian, and Smoothed-Boxcar

For each method, users can select R-min and R-max manually by pressing the button and select R-min and R-max in the image as shown below

../../_images/rmin_rmax.png-

Circularly Symmetric

../../_images/csym_set.png-

2D convex hull

../../_images/2dcon_set.png-

Roving Window

../../_images/roving.png-

White top hat

../../_images/tophat_set.png-

Smoothed Gaussian

../../_images/smooth_g.png-

Smoothed Boxcar

../../_images/smooth_b.png-

You can change the parameters and click Apply to make the program re-process the background subtraction

Merging

For the merging settings, they will be under the white line in the Background Subtraction section. There is the ability to set also another top hat parameter for regions of the image outside the R-max so the top hat parameter can be different inside and outside the merge radius if desired.

To set the merge gradient, simply change the value in the Merge Gradient spinbox