pySimpleMask is a graphical user interface (GUI) tool designed for creating masks and Q-partition maps for scattering patterns, specifically facilitating SAXS, WAXS, and XPCS data reduction.
- Versatile Data Support: Load scattering data from various formats including HDF5, IMM, TIFF, and binary files.
- Interactive Masking:
- Drawing Tools: Create masks using polygons, circles, rectangles, and lines.
- Thresholding: Automatically mask pixels based on intensity limits (low/high).
- Blemish Maps: Apply pre-existing blemish (bad pixel) files.
- Outlier Removal: Automatically detect and mask outliers using SAXS 1D azimuthal average comparisons.
- Manual Selection: Click to mask specific pixels or regions.
- Partition Generation:
- Compute Q-Phi partitions (Dynamic/Static).
- Generate X-Y partitions.
- Support for custom mapping modes.
- Visualization: Real-time visualization of scattering patterns, masks, and SAXS 1D profiles.
- Output:
- Save generated masks as TIFF files.
- Save full partition maps and metadata in Nexus-compatible HDF5/XPCS formats.
pip install pysimplemask- Clone the repository:
git clone https://github.com/AdvancedPhotonSource/pySimpleMask.git cd pysimplemask - Install the package:
pip install .
To launch the GUI, simply run the following command in your terminal:
pysimplemaskYou can also specify a starting path for data loading:
pysimplemask --path /path/to/your/data- Load Data: Click "Select Raw" or "Load" to open your scattering data file.
- Define Mask:
- Use the "Mask" tabs to apply different masking techniques (Draw, Threshold, Blemish, etc.).
- Combine multiple masking methods as needed.
- Use "Evaluate" to preview the mask and "Apply" to finalize it.
- Compute Partition:
- Go to the "Partition" tab.
- Select the desired mode (e.g., Q-Phi) and configure parameters (number of bins, symmetry).
- Click "Compute Partition" to generate the maps.
- Save Results:
- Click "Save" to export the mask (TIFF) or the full partition data (HDF5).
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
- Author: Miaoqi Chu (mqichu@anl.gov)
- License: BSD 3-Clause license