ToMoDL Reconstruction

A plugin for optical projection tomography reconstruction with model-based neural networks.

  • Marcos Antonio Obando, Minh Nhat Trinh, David Palecek, Germán Mato, Teresa Correia

License MIT PyPI Python Version

codecov napari hub

A plugin for optical projection tomography reconstruction with model-based neural networks.


This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.

🔬 Introduction

napari-tomodl is a napari plugin that enables users to easily reconstruct tomography images directly from raw projection data. Simply load an ordered stack of projection files into the napari viewer, and the plugin takes care of reconstructing the corresponding tomographic volume.

🚀 Usage

  1. Load ordered stack
    plot

    Go to File → Open Files as Stack... and load the angular projections for parallel beam optical tomography reconstruction.

  2. Select image layer
    plot

    In the dropdown menu, click Select image layer and choose the loaded volume.

From here you can choose between two reconstruction modes: Basic and Advanced.

🔹 Basic Mode

plot

  1. Half-rotation

    • Click Half rotation if your projection data was acquired from 0° to 180°.
    • Leave it unchecked if data was acquired from 0° to 360°.
  2. Automatic axis alignment
    If the rotation axis is not correctly aligned during acquisition, enable Automatic axis alignment. This aligns the sinogram to the detector center using the Wall-method.

  3. Compression
    Projection images are assumed to have shape (Theta, Detector size, Z) in vertical axis mode.
    You can compress along the Z-axis:

    • HIGH → resize Z to 100
    • MEDIUM → resize Z to 256
    • LOW → resize Z to 512
    • NO → no compression
  4. Reconstruction method

    • FBP CPU / FBP GPU → from the QBI_radon library
    • TOMODL CPU / TOMODL GPU / UNET CPU / UNET GPU → proposed in our ToMoDL-paper
  5. Smoothing level
    Select smoothing strength (only applies to TOMODL methods). Can be adjusted in the Advanced mode.

    • LOW → 2
    • MEDIUM → 4
    • HIGH → 6
  6. Rotation axis

    • Vertical → for data shape (Theta, Detector size, Z)
    • Horizontal → for data shape (Theta, Z, Detector size)

🔹 Advanced Mode

plot

  1. Manual axis alignment
    Shift the object along the detector axis (Z-axis).

    • Negative values → shift left
    • Positive values → shift right
  2. Reshape volume
    Select a reconstruction size (alternative to compression levels from Basic mode).

  3. Flat-field correction
    Apply flat-field correction to projection data before reconstruction.

  4. Clip to circle
    Constrain the reconstructed object inside a circular region.

  5. Filter (FBP only)
    Choose the filter to apply when using FBP methods.

  6. Reconstruct full volume

    • Enabled → reconstruct the whole volume.
    • Disabled → reconstruct only a subset of slices along the detector axis (faster for testing).
  7. Batch size
    Number of slices processed simultaneously:

    • Higher values → faster reconstruction but greater GPU memory usage.
    • On CPU → limited to processing 1 slice at a time.
  8. Reconstruct only slices

    • Enabled → reconstruct only a single slice at the specified index.
    • Disabled → reconstruct from index 0 up to the chosen slice index in the # of slices to reconstruct field.
  9. Invert colors
    Invert grayscale values in the reconstructed volume.

  10. 16-bit conversion
    Convert the reconstructed volume to 16-bit for faster 3D rendering.
    Leave unchecked to keep 32-bit float output.


  1. Reconstruct!

plot

A new layer will appear on top of the projections stack with the reconstructed volume.

💻 Installation

This package requires QBI_radon for optimized GPU tomographic reconstruction:

pip install QBI-radon

You can install napari-tomodl via pip:

pip install napari-tomodl

🤝 Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

📜 License

Distributed under the terms of the MIT license, "napari-tomodl" is free and open source software

🐛Issues

If you encounter any problems, please [file an issue] along with a detailed description.

Version:

  • 0.2.1

Last updated:

  • 2025-10-14

First released:

  • 2023-03-15

License:

  • MIT

Supported data:

  • Information not submitted

Plugin type:

Open extension:

Save extension:

Python versions supported:

Operating system:

  • Information not submitted

Requirements:

  • magicgui
  • qtpy
  • napari
  • pyqt5
  • phantominator
  • opencv-python
  • scikit-image
  • torch
  • QBI-radon
  • tox; extra == "testing"
  • pytest; extra == "testing"
  • pytest-cov; extra == "testing"
  • pytest-qt; extra == "testing"
  • napari; extra == "testing"
  • pyqt5; extra == "testing"
Website by the napari team, original design by CZI. Go to napari main website.