Skip to main content

module to create / edit NXtomo application

Project description

nxtomo

The goal of the nxtomo project is to provide a powerful and user-friendly API to create, edit or read NXtomo application definition files.

Please find at https://tomotools.gitlab-pages.esrf.fr/nxtomo the latest documentation

pip install nxtomo

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

pip install nxtomo[doc,test]

Quick Start

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

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.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, such as splitting large acquisitions or working with TIFF backends.

Documentation and Support

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.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nxtomo-3.0.4.tar.gz (74.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nxtomo-3.0.4-py3-none-any.whl (89.0 kB view details)

Uploaded Python 3

File details

Details for the file nxtomo-3.0.4.tar.gz.

File metadata

  • Download URL: nxtomo-3.0.4.tar.gz
  • Upload date:
  • Size: 74.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for nxtomo-3.0.4.tar.gz
Algorithm Hash digest
SHA256 10f76d93b216b4ad6963ade87c90e4c44024dfa1f415f17d577c6223fac47f48
MD5 ba5f24dd2f1cab11a98c413474dde87b
BLAKE2b-256 d035f1abb4728edbe7675668e54b1c7466e9e61e4cbff87035bcbfbaa1a71094

See more details on using hashes here.

File details

Details for the file nxtomo-3.0.4-py3-none-any.whl.

File metadata

  • Download URL: nxtomo-3.0.4-py3-none-any.whl
  • Upload date:
  • Size: 89.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for nxtomo-3.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5c92c76e8643f05adafa43c8b67a9090c8308b6431fb6be9ca6c83780e8272a0
MD5 3afd47d1a4890c9c6afca5643fa135b7
BLAKE2b-256 dd0fd688b895d527b0e0b8709a1843338948c6eb301cf2a88cd514b3c0d811da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page