The h5tonx script converts data collected at various synchrotron beamlines to data in .nx format, which is compatible with ESRF's tomography reconstruction software Tomwer (https://tomotools.gitlab-pages.esrf.fr/tomwer).
The created .nx output file follows structure guidelines described here: https://tomotools.gitlab-pages.esrf.fr/nxtomo/tutorials/create_from_scratch.html
Currently the script supports conversion of data either from Bessy's BAMline (pre and post 2022) or Sesame's BEATS beamline.
The script includes the option to bin the data - average every certain number of projections. For no binning, set number of projections to average = 1 when prompted.
It can be run on minimal Linux or Windows systems.
It requires Python, and has been tested using Python 3.12 and 3.13.
File conversion requires
-
$x, y$ = slice dimensions in pixels -
$b$ = bit depth (8, 16, or 32) -
$n_{bin}$ = binning factor (number of projections averaged)
- Download the h5tonx.py and requirements.txt file, to a path of your choice and navigate to this path.
- Install required packages: pip install -r requirements.txt or conda install -r requirements.txt. It is strongly recommended to set up and execute within a conda environment.
- Execute the python script: python h5tonx.py
- Download h5tonx.py, requirements.txt, and run_h5tonx.bat to the same path of your choice.
- Run (double click) the run_h5tonx.bat file. This will automatically check if python is installed, if needed install packages listed in requirements.txt, and run h5tonx.py.
Note: It is possible to set a proxy in the .bat file if needed.
First developed in 06.08.2025 by Isabela Vitienes, in the Zaslansky lab of the Department of Operative, Preventive and Pediatric Dentistry at Charité – Universitätsmedizin Berlin, with funding from the DFG (FOR5657).
Last updated: 13.03.2026