fix: Spot Mask UnboundLocalError when smoothing with empty user mask
_smooth_mask defined
reachonly when bothgap is not NoneAND np.any(gap), but later readreachwhenevergap is not None. With an empty user mask (all-zero existing_mask is always passed in by MaskPluginManager), the second branch raised UnboundLocalError and MaskPluginManager disabled the plugin.Fix: gate both code paths on a single
gap_activeflag so the cleanup only runs when there is actually a gap to clean up.Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
Dioptas
A GUI program for fast analysis of powder X-ray diffraction Images. It provides the capability of calibrating, creating masks, having pattern overlays and showing phase lines.
Documentation
The full user manual is hosted on Read the Docs:
https://dioptas.readthedocs.io/
Maintainer
Clemens Prescher (clemens.prescher@gmail.com)
Requirements
It is known to run on Windows, Mac and Linux. For optimal usage on a Windows machine it should be run with 64 bit python.
Installation
Executables
Executable versions for Windows, Mac OsX and Linux (all 64bit) can be downloaded from:
https://github.com/Dioptas/Dioptas/releases
The executable versions are self-contained folders, which do not need any python installation. Under Windows and Linux the program can be started by running the executable (e.g. Dioptas.exe or Dioptas). Under MacOS X the download will contain a
.tar.gzarchive. Extract it first, then right-click the.appfolder and select “Open” to start the program.If macOS shows a warning that the app “cannot be verified”, you need to remove the quarantine attribute by running the following command in the Terminal:
Python Package
The easiest way to install the dioptas python package is using pip.
and then run Dioptas by typing:
in the commandline.
We also maintain a conda-forge version of dioptas. You can add the conda-forge channel to your conda distribution and then install dioptas via conda should be working correctly.
Running the Program from source
In order to run the program from source, the easiest way is to use the uv package manager. Clone the repository from github and navigate to the repository:
Note: This will clone the
developbranch by default, which contains the latest development version. If you want to use the latest stable release instead, switch to themainbranch after cloning:Install uv and the dependencies by running:
This will create a new environment with all the required python packages in
.venv.Afterward the program can be started by running:
In order to run the program without uv, you need to install the required packages yourself. The packages are listed in the file
pyproject.toml. The program can then be started by running:Scripting API
Dioptas can also be used as a Python library for headless integration from scripts and Jupyter notebooks. Set up your experiment in the GUI, save a
.dioproject file, then use it in code:See the scripting API documentation for the full reference.