Reconstructing raw tomography data
Version 1

Workflow Type: Snakemake

Snakemake workflow: Reconstructing raw tomography data

A Snakemake worfklow for tomographically reconstructing raw data using tomopy.


First download this repo and navigate to it

git clone
cd /path/to/repo

(Optional) Download the example folder with:

wget -m -np

Create a virtual environment and install all necessary packages (requires conda):

conda env create --name reconstr_env --file workflow/envs/reconstr.yml

Activate the new virtual environment:

conda activate reconstr_env


To configure the workflow, adapt the config file found at config/config.yaml . The config looks as follows:

number_of_darks: 50
number_of_flats: 100
number_of_projections: 501
rotation_center: 508.77

In the config, adjust number_of_darks, number_of_flats, number_of_projections and rotation_center to the number of darks, flats, projections and the rotation center of your dataset. The necessary information can usually be found in the .log file of the folder that contains the raw data.

MI04_02: denotes the path to the example folder used for reconstruction and the keyword MI04_02 will be used to name the output (e.g. in this case the output folder will be named recon_dir_MI04_02). Replace the examle path with the path to the dataset you want to reconstruct. Additionally, if you want the name of the output folder to have a different suffix, replace the keyword MI04_02 with a name you prefer.

Run the workflow

If the .tif files contain a numerical prefix that is not separated from the actual image index, it is best to first rename the files. The files will be renamed to 00001.tif, 00002.tif and so on. If the renaming is needed, run:

snakemake --cores 1 'logs/renamefile_MI04_02.log'

If you replaced the keyword MI04_02 in the config file then adjust the command accordingly (e.g. if you replaced the keyword with Tomo_dataset then the command should be snakemake --cores 1 'logs/renamefile_Tomo_dataset.log').

Before trying to compute the reconstructions, make sure you have enough memory available (ideally more than 60 GB). To compute the reconstructions using one core, use the command:

snakemake --cores 1

If you want to use all available cores instead, use:

snakemake --cores all

This creates a folder in results with the reconstructed data.


The example dataset used in this project (MI04_02 evolving magma, Mattia Pistone, University of Georgia) was taken from:

The script used for reconstruction (scripts/ was provided by Alain Studer, PSI.

Version History

main @ e2c4eb6 (earliest) Created 2nd Feb 2023 at 13:46 by Felicita Gernhardt

updated readme

Frozen main e2c4eb6
help Creators and Submitter
Gernhardt, F. (2023). Reconstructing raw tomography data. WorkflowHub.

Views: 797

Created: 2nd Feb 2023 at 13:46

help Attributions


Total size: 17.7 KB
Powered by
Copyright © 2008 - 2023 The University of Manchester and HITS gGmbH