scatterBrain Using the Image Window

Page Index


The Image Window is the nerve centre of scatterBrain. It serves as the main program menu and displays the 2-D images of scattering data and File Tree of exposures collected. This window has several key sections (see below) that contain some of the useful features of scatterBrain.


Top Menu (top left)

File List (left) and Search Box (above previous one): used to access the Context Menu and to search for a specific file

Image Context Menu: export data, sum images and produce different plots, e.g. contour plots

Controls Tabs (right side): define beam centre, define masks, change image scaling, etc...

Top Menu

The Top Menu is used for data selection steps such as loading the Experiment File and Log File; as well as access menus for exporting images, changing display settings and accessing help information.

     Tools Menu

The 'Tools' option of the top menu in the Image Window is used to access several features such as exporting images and converting data acquired using SAXS15ID to a format that may be read into scatterBrain. The table below lists some of the more commonly used options under the Tools Menu and their uses.


Export Image -> Export Current Image

Exports the currently loaded image in a format that is suitable for viewing and printing with other programs. The exported image has the same colour table and scaling applied as in the Image Window. Common formats such as JPEG and PNG are available. Exported images should not be used for analysis. They contain much less information in them than the original data as the bit depth is reduced to allow conventional programs to be used view and print the image.

Export Image -> Export Current Image with Annotations

Exports the currently loaded image and includes the masking and beam centre annotations. Exported images should not be used for analysis. They contain much less information in them than the original data as the bit depth is reduced to allow conventional programs to be used view and print the image.

Convert SAXS15ID log/saxs files to scatterBrain experiment file

Converts the old log file and SAXS file used by SAXS15ID to a log file that may be used in scatterBrain. This is typically only used to re-examine old data as SAXS15ID is no longer used or supported at the SAXS beamline.

     Settings Menu

The 'Settings' is used to access controls for a second detector and to change some general settings. These are detailed further in the table below.

Use 2nd Detector

Allows data collected from a second detector, e.g. the WAXS detector, to be plotted on the same 1-D plot as the SAXS data

General Setting

Provides access to a range of general settings for image processing:

Zinger Threshold

sets the limit at which a single pixel is automatically excluded as an outlier or 'zinger'

Number of Sectors

specifies how many steps are used when producing a plot of intensity vs. angle around the image

q-vector bin size

pixel binning used when producing a 1-D profile from the SAXS image

Show Error Bars

toggle whether or not error bars are shown for 1-D profiles in the Plot Window

Set Starting Directory

allows a choice of the default directory for loading files

Check For Updates on start up?

toggle whether or not scatterBrain will check for a more recent version upon starting up.


     Help Menu

The 'Help' contains some useful tools and instructions for scatterBrain and for Image Window features. The menu options, detailed in the table below, are a useful first check for troubleshooting.

Help

Opens a new window which provides some general help information for scatterBrain

Context Help

Opens a new window which contains a list of keyboard and mouse controls for the Image Window, Plot Window and Masks

About scatterBrain

Opens a new window with some general notes about the scatterBrain program

Version Notes

Opens a new window containing a list of changes through different versions of scatterBrain

Check for Updates

Checks whether or not the running scatterBrain program is the latest version. Requires internet connection


Context Menu

The Context Menu provides a range of features that may be applied to the currently selected files in the File List. Many of the options in the Image Window Context Menu provide access to additional types of plots that may be useful for different sample systems, e.g. contour plots and sector plots.


To access the Context Menu:

  • On the File List select the images to be used
  • Do Shift+Left Click and/or Control+Left Click to select multiple images
  • Right-click (anywhere in the File List) to open Context Menu

Select desired command

Deselect All: deselect all of the currently highlighted/selected files in the Image Window. This is of particular use after searching for a specific filename as a group of files may be automatically selected after the search.

Save profiles to individual files: Exports radially averaged, 1-D profiles of each of the selected files to individual files. This will export the same data as if the files were loaded, plotted and exported from the Plot Window. Convenient option for batch exporting of raw data.

Save profiles to one large file: Exports radially averaged, 1-D profiles of all of the selected files to a single, large file. This will export the same data as if the files were loaded, plotted and exported from the Plot Window. This offers an alternative, convenient option for batch exporting of data if it is not necessary to visually check it in the Plot Window or perform background subtraction. 

Sum Images: Adds together all of the currently selected images to produce a single, summed image of the data that appears at the top of the file list. Upon selecting this option, a dialog box will open to select where the summed image will be saved. Normalisation parameters from the log file are also summed together to allow normalisation of the summed image. If the Experiment File is saved after creating a summed image it will be possible to access it again in future, otherwise it will not be recognised in the file list.


     Contour Plots

Contour: creates a contour plot of the selected files in which Q is shown on the X-axis, file number is shown on the Y-axis and intensity is mapped to a colour table. The contour plot will be shown in a new window which opens once all of the data is loaded. Additional controls for the Contour Plot are located within the pop-up window to allow background subtraction, scaling, etc...

     Movies

This feature requires the full version of IDL due to licencing restrictions. Movies are generated by collating the selected files (useful to display evolution of a system over time). Only the 2-D images are included in the video.


     Mosaic Plots

Produces a single, mosaic image from the selected files that provides another option for viewing changes in the scattering data over time. By displaying many images concurrently, comparison between images is easier than loading images individually. The mosaic image will appear in a new window which also contains controls for adjusting scaling and zoom of the image. A secondary window also appears to allow selection of a colour table for the mosaic.

     Sector Plots

Performs a sector integration of the currently loaded image by averaging the intensity in all pixels in a sector, or arc to plot radial angle vs. intensity. This would be expected to be flat for a perfectly isotropic sample and show variation with angle for an anisotropic sample. The plot appears in a new window which contains additional controls for the sector plot such as background subtraction, colour table selection and scaling. The angular range of each sector is defined by the number of sectors used, N, i.e. 360/N degrees per sector. The number of sectors may be set in the Settings Menu of the Image Window. 


Control Tabs

Control Tabs The control tabs on the right-hand side of the image window, enable access to various functions and information. 

Details Tab: displays some data from the Log File entry for the currently loaded image. Information such as the Exposure Time, Beamstop Counts and Scaling Factor (for normalisation) is shown on the tab. Some of the text boxes on this tab are blank, e.g. Data Directory, as they are not currently implemented.

Image Tab: has controls for toggling whether or not loaded images are autoscaled and for adding or deleting reference rings at a defined q value.

Histogram - opens a new window with a plot of the current greyscale settings of the image and allow manual control of contrast. A different colour table may be applied using the "Controls" menu within the Histogram window.

Autoscale - defines whether or not newly loaded images will be scaled automatically.

Add Ring / Delete Ring - Reference rings may be added to or deleted from specific q values.

Delete All Rings - may be used to remove all reference rings

 

QRange Tab (Defining Beam Centre): QRange tab provides tools for finding and adjusting the beam centre (position of the direct beam on the detector). The currently defined beam centre is shown in the text boxes in the lower half of the tab. It may be adjusted using the arrow buttons in this section. It may also be defined using by selecting a highly scattering ring in the image or by integrating 1-D profiles from each quadrant of the detector.

 

Masks Tab: buttons to toggle whether or not Masks are visible in the Image Window and allows the Mask definition interface to be opened. The visibility of currently defined masks is controlled using radio buttons at the top of the tab.

Define Masks - new window containing the full mask controls. The use of Masks in scatterBrain is covered in depth in the Defining and Using Masks section.

 

Norm Tab: The Norm tab is not currently used in scatterBrain.


Defining or Adjusting Beam Centre

ScatterBrain performs radial averaging and other functions around a software defined beam centre. Typically the software beam should be placed at the physical beam centre (where the beam is) is for a given image. There are two methods to determine and set the beam centre using the detector image: ring/arc (when you have a diffracting sample that produces continuous circular rings/arcs (e.g. silver behenate), or a 4 quadrant method. The 4 quadrant method has the advantage that you can almost always use it, often even with just background scattering from the instrument without needing a diffracting sample.

Beam centres can move if the detector moves during an experiment. Generally small changes due to beam drift are well managed by the beamline's optical position feedback system.

Ring/Arc Method

  1. choose and load the configuration you want to adjust, because beam centres are specific to each configuration.
  2. load a pattern containing diffraction rings.
  3. open the Qrange tab (in 2D image window).
  4. click the button "Find from Ring/Arc" button.
  5. as per on-screen instruction, left mouse click on three points around a circle or arc. Make sure the three points are all on the same ring/arc.Put each click as close to the radial centre of the ring, and spread your clicks widely in azimuthal angle (eg about 120 degrees apart if you can).
  6. Right-mouse click when you have finished clicking the 3 points.ScatterBrain will then fit an ellipse to the the diffraction ring/arc using the three points you clicked as starting points.
  7. scatterBrain may not update its display to show you the new beam position. Easiest way to update the 2D display (showing the new beam centre) is reload the scattering pattern (from left-column of filenames). If you are using a beamstop mask, the position of the beamstop mask will very likely move with the new beam centre because its position is usually defined relative to the beam centre.
  8. if you are happy with the new beam centre, save the configuration with the small "Save" button in the Configuration Selector area of the image window. If you are not happy with the result, reload the configuration rather than save it, or exit scatterBrain without saving anything.


4 Sector Method

This method relies only on relatively isotropic scattering in the pattern. ScatterBrain divides up the image into 4 quadrants (90 degree azimuthal sectors) to help you determine a beam centre. For an isotropic pattern, each quadrant's 1D intensity profile is identical only if the beam centre is correct. If the beam centre is wrong, it is easy to see difference in 1D patterns between each quadrant. You manually move the beam centre to make the 1D profiles from each quadrant overlap, and when they do, that's a good beam centre. This method is especially sensitive at low angle for fairly steeply sloped intensity profiles. You can also see diffraction peaks (if you have them) mis-align when the beam centre is wrong. Usually the 4 sector method makes it easy to set a beam centre to better than a pixel of the true beam centre.

  1. choose and load the configuration you want to adjust, because beam centres are specific to each configuration.
  2. remove all plots from the 1D plot window. Its much easier to use the 4 sector method without extra 1D profiles visually getting in the way.
  3. load a pattern to use for beam centering. Use something with isotropic scattering, with a reasonably steep intensity slope at low q. Power-law scattering samples or air shots (instrument background) are usually good.
  4. open the Qrange tab (in 2D image window).
  5. click the button "Find from 4 sectors" button.
  6. click the tickbox "Auto Update 4 sectors". When the tick box is active, each time you change the beam centre, scatterBrain will recalculate and replot the 1D profiles of each quadrant.
  7. adjust the beam centre in X and/or Y, using the arrow buttons which moves one pixel at a time. Watch the 1D window to see if patterns overlap better or deviate more. Keep making adjustments until the patterns overlap. Sometimes you have to iterate in 2 dimensions (X and Y). Using the arrow buttons gets you to the nearest whole pixel adjustment. If you're not sure you're at the beam centre, move the beam centre again (even if you move a bit too far) and come back to the best result from plus and minus in each direction (horizontal and vertical). Getting within nearest pixel is usually perfectly adequate. If you want to move less than a pixel, adjust the number in the beamstop box in the decimel places. Keep making adjustments until you get the best overlap you can, within the accuracy you need (1 pixel is usually enough). A bit of practice makes it easy.
  8. if you are happy with the new beam centre, save the configuration with the small "Save" button in the Configuration Selector area of the image window. If you are not happy with the result, reload the configuration rather than save it, or just exit scatterBrain without saving anything..
  9. untick the box "Auto Update 4 Sectors'
  10. Remove 1D patterns from the profiles window.


Defining and Using Masks

Masks are among the key tools of scatterBrain and are used to define a region of pixels on the detector to be ignored (excluding mask) or as an inclusive boundary (including mask). They are useful for defining the active area of the detector, removing bad pixels, and analysis of partial sections scattering patterns.

Types of Masks

Including Mask - defines a boundary within which all pixels will be included in data processing and analysis within scatterBrain. They are of particular use when examining a restricted section of a scattering pattern such as part of an anisotropic pattern. Note: The mask around the frame of the detector is an Including Mask that sets the boundary of the analysis 


Excluding Masks - defines a boundary within which all pixels will be ignored in data processing and analysis. Useful to remove sections of a scattering pattern with errors or no information (bad detector pixels or detector areas that have no signal due to the geometry of the SAXS camera). The mask around the beamstop is an Excluding Mask set to ignore the pixels in the mask as there is no data in that region.


When multiple including and excluding masks are combined the exclusion of a pixel takes priority over inclusion. For a pixel to be included in data processing it must lie within all Including Masks and outside all Excluding Masks. Pixels covered by the beamstop lie within the Including Mask around the frame of the detector but are also within the Excluding beamstop mask. They are ignored for data processing as their position inside an Excluding Mask takes priority.

Adding and Removing Masks 

Polygonal Masks - enclose an area of pixels defined by a 2-D polygon, an example of which is shown below. A series of points are defined and linked together to form the polygonal border of the mask. The polygon may contain any number of points and existing points may be added, deleted or moved to modify a mask. When a polygonal mask is selected in the 'scatterBrain Mask Definitions' window the mask may be defined or modified using the Image Window. A Left-Click in the Image Window adds a new point to the mask definition, A Right-Click in the Image Window moves the currently selected point from its old location to the location of the click. For more precise control when defining a polygonal mask, it is recommended to zoom in on the Image Window.


Circular Masks - enclose an area of pixels defined by a 2-D polygon which approximates a circle. Thus, the Circle Mask is essentially an automated polygonal mask. The mask calculates the vertices of the polygon based on the defined centre coordinates, radius and angular range. To allow definition of a ring, the Circle Mask is implemented to use both a minimum and maximum radius while use of a minimum and maximum angle allow creation of a segment. For a full circle, Angle Min should be set to zero and Angle Max set to 360. It is also possible to set the mask to be Beam Relative such that X & Y coordinates of zero are mapped to the Beam Centre. This allows the Circle Mask to be easily centred around the beam.


Combining Data from Different Camera Lengths, Including WAXS

Using scatterBrain to combine data sets collected using different camera lengths, i.e. data covering different Q-ranges, remains an upgrade pathway in the software. As this is not fully implemented in scatterBrain, it is necessary to combine the data sets using separate software. Many different programs may be used for this process, but Microsoft Excel and Wavemetrics Igor Pro are perhaps the most common. As the precise method may vary depending on the software used, the guide below covers the general steps only.

  1. Use scatterBrain to perform scaling and background subtraction
  2. Export the data from scatterBrain as dat file/s
  3. Repeat steps 1 and 2 for data from the other camera length (or WAXS)
  4. Import the data from both camera lengths into the software used to combine the data sets
  5. Plot data from both camera lengths on a single plot
  6. If no Absolute Calibration is applied, scale one data set until the plots are overlapping
    • If an Absolute Calibration has been applied, it should not be necessary to scale the data sets
  7. Use the software to append higher Q data to the lower Q data set
    • The precise method for this will depend upon the software used
  8. Save the now combined data set as an ASCII file that may be used for further analysis