Metadata-Version: 2.4
Name: nxtomo
Version: 3.1.2
Summary: Package to create, load, edit, and save files following the NXtomo application definition.
Author-email: Henri Payno <henri.payno@esrf.fr>, Pierre Paleo <pierre.paleo@esrf.fr>, Alessandro Mirone <mirone@esrf.fr>, Jérôme Lesaint <jerome.lesaint@esrf.fr>, Pierre-Olivier Autran <pierre-olivier.autran@esrf.fr>
License-Expression: MIT
Project-URL: Homepage, https://gitlab.esrf.fr/tomotools/nxtomo
Project-URL: Documentation, https://nxtomo.readthedocs.io/en/stable/index.html
Project-URL: Repository, https://gitlab.esrf.fr/tomotools/nxtomo
Project-URL: Issues, https://gitlab.esrf.fr/tomotools/nxtomo/-/work_items
Project-URL: Changelog, https://gitlab.esrf.fr/tomotools/nxtomo/-/blob/main/CHANGELOG.md
Keywords: NXtomo,nexus,tomography,tomotools,esrf
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Environment :: Console
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX
Classifier: Operating System :: Microsoft :: Windows
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: h5py>=3.0
Requires-Dist: silx>=2.0
Requires-Dist: pint
Requires-Dist: packaging
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: black; extra == "test"
Requires-Dist: isort; extra == "test"
Requires-Dist: ruff; extra == "test"
Requires-Dist: tifffile; extra == "test"
Requires-Dist: pynxtools; extra == "test"
Provides-Extra: doc
Requires-Dist: Sphinx; extra == "doc"
Requires-Dist: nbsphinx; extra == "doc"
Requires-Dist: jupyterlab; extra == "doc"
Requires-Dist: ipykernel; extra == "doc"
Requires-Dist: nbconvert; extra == "doc"
Requires-Dist: pandoc; extra == "doc"
Requires-Dist: scikit-image; extra == "doc"
Requires-Dist: h5glance; extra == "doc"
Requires-Dist: jupyter_client; extra == "doc"
Requires-Dist: pydata_sphinx_theme; extra == "doc"
Requires-Dist: sphinx_autodoc_typehints; extra == "doc"
Requires-Dist: myst-parser; extra == "doc"
Requires-Dist: nb_extension_tagstyler; extra == "doc"
Dynamic: license-file

<p align="left">
  <img src="nxtomo/resources/nxtomo.png" alt="nxtomo" width="180">
</p>

The goal of the `nxtomo` project is to provide a powerful and user-friendly API to create, edit or read [NXtomo](https://manual.nexusformat.org/classes/applications/NXtomo.html) application definition files.

```bash
pip install nxtomo
```

Add the optional extras when you need documentation or development tooling:

```bash
pip install nxtomo[doc,test]
```

## Quick Start
Create a minimal NXtomo scan, populate detector data, and save it to disk:

```python
import numpy as np
from pint import get_application_registry

from nxtomo.application.nxtomo import NXtomo
from nxtomo.nxobject.nxdetector import ImageKey

ureg = get_application_registry()

nx = NXtomo()
nx.title = "Demo scan"
nx.instrument.beam.incident_energy = 18 * ureg.keV

n_frames = 180
nx.instrument.detector.data = np.random.rand(n_frames, 64, 64).astype(np.float32)
nx.instrument.detector.image_key_control = np.full(
    n_frames, ImageKey.PROJECTION.value, dtype=np.uint8
)
nx.sample.rotation_angle = (
    np.linspace(0.0, 180.0, n_frames, endpoint=False) * ureg.degree
)

output_file = "demo_scan.nx"
nx.save(output_file, data_path="/entry0000")

loaded = NXtomo().load(output_file, data_path="/entry0000")
print(f"Energy: {loaded.energy}, Rotation angles: {loaded.sample.rotation_angle}")
```

Explore additional workflows in the [tutorials](https://nxtomo.readthedocs.io/en/stable/tutorials/index.html), such as splitting large acquisitions or working with TIFF backends.

## Documentation and Support
- Latest documentation: https://nxtomo.readthedocs.io/en/stable/index.html
- API reference: https://nxtomo.readthedocs.io/en/stable/api.html
- Report issues and follow development on GitLab: https://gitlab.esrf.fr/tomotools/nxtomo

## Contributing
Contributions and feedback are welcome. Please open an issue or submit a merge request on GitLab. See the development guide in `doc/development` for details on setting up a local environment and running the test suite.

## License
nxtomo is released under the MIT License. See `LICENSE` for the full text.
