https://github.com/dioptas/dioptas
Python based GUI-Program for integration and exploration of 2D x-ray diffraction images.
https://github.com/dioptas/dioptas
diffraction diffraction-analysis gui python synchrotron x-ray
Last synced: 4 days ago
JSON representation
Python based GUI-Program for integration and exploration of 2D x-ray diffraction images.
- Host: GitHub
- URL: https://github.com/dioptas/dioptas
- Owner: Dioptas
- License: gpl-3.0
- Created: 2015-01-15T18:16:12.000Z (about 11 years ago)
- Default Branch: develop
- Last Pushed: 2025-06-23T07:28:50.000Z (10 months ago)
- Last Synced: 2025-10-21T19:51:41.775Z (6 months ago)
- Topics: diffraction, diffraction-analysis, gui, python, synchrotron, x-ray
- Language: Python
- Homepage:
- Size: 181 MB
- Stars: 63
- Watchers: 10
- Forks: 39
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# 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.
## Maintainer
Clemens Prescher (clemens.prescher@gmail.com)
## Requirements
* python 3.9+
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.gz` archive. Extract it first, then right-click the `.app` folder 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:
```bash
find Dioptas_*.app -exec xattr -c {} \;
```
### Python Package
The easiest way to install the dioptas python package is using pip.
```bash
pip install dioptas
```
and then run Dioptas by typing:
```bash
dioptas
```
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.
```bash
conda config --add channels conda-forge
conda install dioptas
```
## 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:
```bash
git clone https://github.com/Dioptas/Dioptas.git
cd Dioptas
```
Note: This will clone the `develop` branch by default, which contains the latest development version.
If you want to use the latest stable release instead, switch to the `main` branch after cloning:
```bash
git checkout main
```
Install uv and the dependencies by running:
```bash
python -m pip install uv
uv sync
```
This will create a new environment with all the required python packages in `.venv`.
Afterward the program can be started by running:
```bash
uv run dioptas
```
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:
```bash
python run.py
```
## 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 `.dio` project file, then use it in code:
```python
from dioptas.pipeline import Pipeline
# Load full setup (calibration, mask, corrections, etc.) from a project file
p = Pipeline.from_project("experiment.dio")
# Override the mask if needed
p.load_mask("new_beamstop.mask")
# Integrate a single image
pattern = p.integrate("sample_001.tiff")
pattern.save("sample_001.xy")
# Batch integrate with a glob pattern
patterns = p.integrate_batch("data/sample_*.tif")
```
See the [scripting API documentation](docs/source/scripting_api.rst) for the full reference.