Skip to main content

Package to create, load, edit, and save files following the NXtomo application definition.

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.

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.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, 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.1.0.dev1.tar.gz (76.4 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.1.0.dev1-py3-none-any.whl (92.8 kB view details)

Uploaded Python 3

File details

Details for the file nxtomo-3.1.0.dev1.tar.gz.

File metadata

  • Download URL: nxtomo-3.1.0.dev1.tar.gz
  • Upload date:
  • Size: 76.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for nxtomo-3.1.0.dev1.tar.gz
Algorithm Hash digest
SHA256 1b048b62d49e96745bced1dab2c38879e9eb9411674bb64acc2f0b04a52eec96
MD5 bf4976da5fa343d7c33034d4b20709f4
BLAKE2b-256 7559f7fb2959de2e91ab1554766045f48e5b5a47db65df4233fbf6fa544afb8a

See more details on using hashes here.

File details

Details for the file nxtomo-3.1.0.dev1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for nxtomo-3.1.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 4ec45358a368b4331da4a64784f5e43925f97de1ce804b53ff90152e8c1c2f39
MD5 2a47c9eff61e27a41ac77a4fd4594a8f
BLAKE2b-256 99d2614521074a97250f31a012b373728433c91e8015db105c8e6eb9588fb443

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