DIOPTAS(1) | Dioptas | DIOPTAS(1) |
dioptas - Dioptas Documentation
Dioptas is a GUI program for fast integration and exploration of 2D X-ray diffraction Images. It provides the capability of calibrating, integrating, creating masks, showing multiple pattern overlays and display phases line positions. The basis of the integration and calibration algorithm is the pyFAI library. The usage of pyFAI allows integration times on the order of 80 milliseconds and calibration of every possible detector geometry.
Dioptas has three different modules which can all be accessed by the tab indicators on the left side of the user interface: Calibration, Mask, Integration.
The Calibration module enables you to calibrate the detector geometry. Within the Mask module you can select regions you want to exclude from the image integration and the Integration module is the heart of Dioptas, where you will spend most time for data exploration. It shows both, the image and integrated pattern, and one can overlay different pattern and show line position of phases.
The basis for data exploration in are the image and pattern widgets available in all 3 modules. The interaction with these widgets is tried to be as intuitive as possible, without extra need of different selection modes. All widgets support to following mouse commands:
Every image widget has a color bar and a histogram either on the side of the image (Mask module and Calibration Module) or on the top (integration module). The colors of the color bars can be easily adjusted. You can switch to a completely different color-scale by right clicking the color bar. This creates a pop-up where one of the predefined color scales can be selected. The position of the individual colors can be adjusted by dragging the triangle of this color. Further the colors can be changed completely by double clicking (left) it, which will pop up a color chooser. It is in addition also possible to add a complete new color by double clicking (left) next to the color bar. The histogram next to the color bar shows the intensity distribution of the loaded image on a log scale. The sliders two lines define the scaling of the image in the image view. Please feel free to adjust their position by dragging them.
Make sure you are in the calibration mode, which should be selected on the left side of the window.
Load the calibration image by clicking the "Load file" button on the upper right side of the window. Now you can insert the starting values for the calibration in the menu on the right. The calibration procedure will estimate distance and center position of the x-ray, as well as detector rotation. For this procedure the wavelength and pixel width/height have to be defined based on the experimental setup and detector used. Please choose the correct calibrant from the Calibrant drop-down list. In case your calibrant is not available, your own calibrant can be added in the dioptas/calibrants folder as a text file containing a list of d-spacings, Dioptas will automatically have this calibrant available in the combobox after a restart. Different detector orientations can be accommodated by rotation or flipping the image. These image transformations will be applied to all subsequent loaded images in the calibration module and in the integration module.
In order for Dioptas to find the correct geometry it needs an initial guess for the position of some of the rings. This is done by selecting several peaks on each diffraction ring. The parameters for peak selection are given in the "Peak Selection" section on the right site of the calibration module, when "Calibration Parameters" is selected.
By default automatic peak search is selected, which tries to automatically find peaks on a clicked ring. To search on the first ring please click on it with the left mouse button. In case it is very difficult to "hit" the ring with the mouse you can just zoom in by using the drag-zoom or mouse-wheel zoom. If the peak search was successful it should look like this:
If the automatic peak searching fails (when Dioptas fails to select other peaks on the first diffraction ring) there are several available options:
After the peaks/ring(s) have been selected we can start the calibration procedure. This is done by clicking the "Calibrate" Button on the lower left of the interface. This will calculate the geometric parameters based on the current peak selection and then automatically refine the calibration parameters.
After refinement Dioptas will automatically create a 360 degree cake image and an integrated pattern. When the procedure is finished it will jump to the "Cake" tab (top tab-bar above the image) and show the cake image. In this image you can easily check if the calibration was successful (by checking if the cake lines are straight). Additionally, the pattern is plotted with calculated calibrant positions in the "Pattern" Tab. All peak maxima should coincide with phase line positions. The resulting calibration parameters are shown by clicking the pyFAI parameters or Fit2d Parameters tabs in the right control panel. The current calibration parameters can be saved by clicking the Save Calibration button on the lower right of the user interface. To fast reuse the a calibration, the calibration can be reloaded by clicking Load Calibration.
If the calibration failed, either the start values are wrong, the initial peak selection was faulty or the refinement parameters need to be adjusted. For a new peak selection, just click "clear all peaks" and start the the peak selection again, make sure that current peak number belongs to the corresponding clicked ring. The meaning of each of the refinement options are explained in the next section.
The refinement options are defined on the right control panel of the Calibration module, when "Calibration Parameters" is selected.
There are several options available:
If the calibration/refinement fails you can in principle play with all parameters. However, the most common adjustments are the number of rings and the Intensity Min factor.
In the mask module areas can be defined which will be excluded from integration or calibration. There are several geometries available to select different kind of areas. Additionally it is possible to mask based on threshold values and perform automatic cosmic removal. All tools are available on the right control panel in the Mask view. It can be either chosen to mask a certain region or unmask it (select either on the top of the control panel).
To select a specific geometry just click on it and an orange border will show which one is active right now. All geometric shapes are created by using left clicks:
In order to do threshold masking, please insert the wanted number next to the desired Thresh button and click the button.
Cosmic removal is an automatic optimization procedure trying to mask cosmic rays from the image. This procedure can take considerable amount of time, please be patient.
The integration module is the heart of Dioptas. Here you can automatically integrate multiple images to pattern, browse between images and integrated pattern, compare multiple pattern to each other, perform background subtraction and compare pattern peak positions and intensities to the ones of known phases.
In the integration module the current image is displayed on the left side with the integrated pattern shown on the lower right. The control panel has several tabs for different functions.
The "Img" and "Pattern" tabs are primarily for loading and browsing images and pattern, respectively. In the "Overlay" tab integrated pattern can be loaded for comparing them to the currently loaded shown active pattern. The "Phase" tab enables opening/editing jcpds files and changing the equation of state parameters of the loaded phases. The "Cor" tab gives options for performing intensity corrections. Here the absorption of a c-BN seat and diamond in a diamond anvil cell, or the detector scintillator can be corrected prior to integration. The controls in the "Bkg" tab can be used to define an image as background prior to integration and doing automatic background subtraction of the integrated pattern. The "X" (special) tab contains several additional optional features like cBN absorption correction, manual selection of the number of integrating bins.
Images and pattern can be loaded by clicking the Load button in the respective modules. Images can be in different file formats: .img, .sfrm, .dm3, .edf, .xml, .cbf, .kccd, .msk, .spr, .tif, .mccd, .mar3450, .pnm, or any other common image formats. Pattern files should be 2 column files. If there is a header present it should be commented by '#' signs.
Images loaded will be automatically integrated if a calibration is available (either by performing it in the calibration window or by loading a previously saved calibration file (* *.poni*) file). There are too modes for file browsing (clicking the "<" and ">" buttons):
In case you want to browse through files in larger steps the "step" value can be adjusted. Any newly added file to the current img working directory can be opened automatically by checking the autoprocess checkbox in the Image module.
By default the integrated pattern is not saved. To automatically save the integrated patterns choose an output folder in the Pattern tab by clicking the "..." button and then check the autocreate checkbox. All new integrated patterns will then be automatically saved in this folder with name being the same as the image but different file extension. The integrated pattern can be automatically saved in 4 different formats by checking their respective boxes in the lower right of the Pattern tab:
In addition to file browsing and the "load" button, files can also be loaded by inserting their name and folder in the respective text fields. The upper one is the filename and the lower one is the containing folder. If the file does not exist it the text field will revert to its previous state.
In the overlay control panel you can add, delete or clear overlays and adjust their scaling and offset.
The list of overlays shows several widgets representing the state of each individual overlay. The first checkbox controls if the overlay is visible in the graph. The colored button shows the overlay color. Clicking on it will pop-up a color-chooser dialog where the color for this overlay can be changed. The name of an overlay is by default its filename, but it can be modified by double-clicking the name in the overlay list.
On the right side you can adjust the scale and offset of the overlays by either entering a specific number or using the spin-box controls. The step text fields control the steps of the spin-box.
An overlay can be used as a background for the integrated pattern. In order to to so, you have to activate the "Set as Background" button. This button sets the currently selected overlay as background for the pattern file. It can be seen that an overlay is set as background by the Set as Background button being activated for a specific overlay and by the background overlay name being shown in the lower right of the graphical user interface (right below the graph). The scaling and offset of the overlay/background can still be adjusted by using the respective spin boxes. The background overlay remains active until it is deactivated, therefore the background will be automatically subtracted from each newly integrated image or newly loaded pattern. If autosave for pattern is set, Dioptas will create a bkg_subtracted folder in the autosave folder and automatically save all subtracted patterns.
The Waterfall button will automatically adjust the offset of all loaded overlays to a multiple of the text box to the right of it. This creates a waterfall plot of all overlays. The Reset button resets all overlay offset to zero.
The basic controls for phases are similar to the ones in overlay:
The list of phases shows several widgets representing the state of each individual phase overlay. The first checkbox controls if the phase lines are visible in the graph. The colored button shows the color of the phase lines. Clicking on it will pop-up a color-chooser dialog where the color for this phase can be changed. The name of an phase is by default its filename, but can be changed by double-clicking the name in the phase list. Additionally the pressure and temperature for each phase is shown in the phase list. If for a particular phase thermal expansion is not in the jcpds file it will always display '- K'.
On the right side the pressure and temperatures of the loaded phases can be adjusted. If Apply to all phases is checked the pressure and temperature will be set for all loaded phases. By default the pressure and temperature values will be displayed in the phase legend in the pattern if they differ from ambient conditions. For disabling this feature please uncheck the Show in Pattern checkbox.
In the JCPDS Editor the parameters of the jcps phase can be modified. Every change will be immediately reflected in the position of the lines in the pattern. You can edit the comment, the symmetry, lattice parameter and equation of state parameters. Reflections can be edited in the reflections table. h, k, l and intensities can be modified by double clicking in the table all other parameters are calculated correspondingly. A "0" after a parameter name always means that this is the value at ambient condition and when there is no "0" the value corresponds to the current temperature and pressure conditions modified in the Phase tab. The changes can be saved as a new file by clicking the Save As button. If you want to revert all changes and reload the original files please press the Reload File button. If you like the changes you made you can close the JCPDS editor either by clicking the X button or the OK button on the lower right. The Cancel button will close the JCPDS editor and revert the changes made since the last opening of the JCPDS editor.
In the Cor tab it is possible to enable intensity corrections for cBN seats, diamonds and the scintillator thickness of the detector.
Enabling this option calculates the theoretical transmitted intensity through a diamond and cBN seat based on the parameters entered into the text boxes. Where:
To see the calculated transmitted intensity distribution press the Plot button. This will show the calculated absorption correction in the image view.
Enabling this option will correct the intensity response of the detector for large angles. The intensity is proportional to the path length of the diffracted x-ray beam through the scintillator of the detector. This causes higher intensities at larger angles between the diffracted beam and the normal of the detector plane due to larger path lengths. The correction assumes that the source of the intensity is coming from the calibrated sample position. This correction is not valid if there is additional contribution from air or other background. The background contribution needs to be either removed first or the correction needs to be applied to the sample and the background signal before subtraction.
Parameters:
To see the calculated intensity correction press the Plot button. This will show the calculated absorption correction in the image view.
In the Bkg tab an image can be loaded as background image or we can automatically subtract an estimated background from the integrated pattern.
This image will be subtracted from the original image prior to the integration process. The intensity of the image can scaled or offset by using the corresponding spin boxes. The text fields next to the spin boxes define the individual steps for the spinbox. After each change, loading an image as background, removing it, or change the scale and offset of the background image, the image will be automatically reintegrated.
Activating this, will automatically try to estimate the background in the integrated pattern using a moving average method. The background will then be created by fitting the resulting pattern with a polynomial.
Enabling the pattern background subtraction and also the inspect mode can also be easily done by using the quick actions in the pattern widget (see Fig. %s). The "bg" button on the right side will enable the background subtraction and clicking the "I" button will enable the inspection mode.
The currently available features:
Here you can manually specify the number of integration bins and/or choose to supersample the image. Supersampling an image by a factor of n>1 results in of splitting of each pixel into n^2 pixels with equal distribution of intensities among the splitted pixels. For perfect powder samples this can result in smaller integrated peak widths and more points per peak if the physical pixel width is too high. However, it may result in unreasonable intensity distributions. Please use at your own risk.
The "Image" widget and the "Pattern" widget exhibit several quick actions. Some of them can be context sensitive (e.g. if there is an image background loaded).
The image quick actions are shown in the lower left of the image widget in the integration view.
The pattern widget exhibits several buttons on the top and also on the right (see Fig. %s)
Configuration are used to handle experimental setups with multiple detectors in one Dioptas instance. A configuration contains the calibration information, loaded image, image corrections, mask, integrated pattern and background corrections. Overlays and phases are not handled in configurations and are global. By default the configuration control panel (Fig. %s) is hidden and only one configuration is active (single Detector mode). To enable the panel, please click the C button on the upper left corner of Dioptas. In principle, Dioptas can handle infinite configurations, however, this also means a lot of RAM usage.
A configuration can be added or removed by the + and - buttons. Each added will be subsequently numbered and can be selected by the buttons to the left of the - button. After adding a a new configuration the configuration will be empty and needs to be newly calibrated for the wanted detector geometry.
The File and Folder controls in the middle of the configuration panel enable combined file browsing for all configurations, whereas the Pos textfield defines the position of the number in the string. By using the "<" and ">" buttons the next or previous image in each configuration will be loaded.
This is also true for the similar Folder "<" and ">" buttons. Here Dioptas supposes that the actual filenames stay the same, but the images are saved in subsequently indexed folders, like e.g. "run101", "run102". The MEC checkbox enables a special mode for the matters at extreme conditions beamline at LCLS where both, the folder and the filenames have the run number included.
The Factor Input is an intensity scaling factor for the image in the configuration, so that different configurations can be compared where the detector response is not equal.
The state of Dioptas including the different configurations with image, mask, image corrections, background corrections overlays and phases can be open and saved in projects. This is very useful in case you want to continue working on a project another day. The controls for this are in the upper left of the Dioptas window (see Fig. %s). The Dioptas project files have a *.dio extension and are basically HDF5 under the hood. Thus, can the data can be also opened or edited with any HDF5 viewer. [image]
Opens a file browser where you can select a Dioptas project (*.dio) to open. [image]
Saves the current state of Dioptas into a Dioptas project (*.dio). [image]
Resets the current state of Dioptas. This means all phases, overlays, and configurations will be deleted and you can start from a new fresh Dioptas.
Clemens Prescher
Dioptas - GUI program for fast processing of 2D X-ray diffraction data Principal author: Clemens Prescher (clemens.prescher@gmail.com) Copyright (C) 2014-2019 GSECARS, University of Chicago, USA Copyright (C) 2015-2018 Institute for Geology and Mineralogy, University of Cologne, Germany Copyright (C) 2019 DESY, Hamburg, Germany
January 30, 2023 | 0.4.0 |