Skip to content

davidegiamb/PyMedImage-Core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyMedImage-Core

CT Image Reconstruction & Multi-Modal Registration from Scratch

Python NumPy SciPy Status

Overview

PyMedImage-Core is an object-oriented Python library providing from-scratch implementations of two fundamental medical imaging algorithms:

  1. CT Reconstruction — Filtered Back-Projection (FBP) with configurable filter kernels (Ram-Lak, Shepp-Logan, Cosine), sinogram processing, and vectorized back-projection.
  2. Multi-Modal Image Registration — Rigid alignment (rotation + translation) via maximization of Mutual Information, using bounded derivative-free optimization.

No black-box calls — the goal is full transparency over every mathematical step, from the Radon transform to the entropy computation.

Mathematical Foundation

Both modules address instances of the same class of problem: recovering hidden information from indirect measurements.

The CT reconstruction pipeline solves a linear inverse problem — estimating an internal attenuation distribution from a set of line-integral projections acquired at the boundary. This involves forward modeling (Radon transform), frequency-domain regularization (ramp filtering), and inversion (back-projection).

The registration module solves an optimization problem over a transformation space, using an information-theoretic similarity metric (Mutual Information) that is robust to non-linear intensity differences across imaging modalities.

This mathematical framework — estimating internal source distributions from boundary measurements, and aligning heterogeneous spatial data via statistical dependence — is foundational across medical imaging and biomedical signal processing, from tomographic reconstruction to source localization in electrophysiology.

Repository Structure

PyMedImage-Core/
├── src/
│   ├── __init__.py
│   ├── reconstruction.py      # FBP engine (filtering, back-projection)
│   └── registration.py        # Rigid registration (Mutual Information)
├── notebooks/
│   ├── demo_reconstruction.ipynb   # CT pipeline walkthrough
│   └── demo_registration.ipynb     # Registration with synthetic phantoms
├── requirements.txt
└── README.md

Key Features

Filtered Back-Projection (FBP)

  • Sinogram generation and zero-padding for alias reduction
  • Configurable frequency-domain filters: Ram-Lak, Shepp-Logan, Cosine
  • Vectorized back-projection with linear interpolation
  • Full pipeline visualization (phantom → sinogram → reconstruction)

Multi-Modal Image Registration

  • Rigid body transformations (3 DOF: rotation + 2D translation)
  • Shannon's Mutual Information as similarity metric
  • Bounded Powell optimization to prevent angular ambiguity
  • Angle normalization to the canonical range (−180°, 180°]

Quick Start

git clone https://github.com/davidegiamb/PyMedImage-Core.git
cd PyMedImage-Core
pip install -r requirements.txt

Explore the demo notebooks:

jupyter notebook notebooks/demo_reconstruction.ipynb
jupyter notebook notebooks/demo_registration.ipynb

Dependencies

  • Python ≥ 3.10
  • NumPy
  • SciPy
  • Matplotlib
  • Scikit-image
  • Jupyter

Author

Davide Giambarbara — M.Sc. Neuroengineering and Neurotechnologies, University of Genoa

About

From-scratch Python library for CT image reconstruction (Filtered Back-Projection) and multi-modal rigid registration (Mutual Information). No black-box calls — full transparency over the inverse problem pipeline.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors