PyMedImage-Core is an object-oriented Python library providing from-scratch implementations of two fundamental medical imaging algorithms:
- CT Reconstruction — Filtered Back-Projection (FBP) with configurable filter kernels (Ram-Lak, Shepp-Logan, Cosine), sinogram processing, and vectorized back-projection.
- 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.
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.
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
- 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)
- 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°]
git clone https://github.com/davidegiamb/PyMedImage-Core.git
cd PyMedImage-Core
pip install -r requirements.txtExplore the demo notebooks:
jupyter notebook notebooks/demo_reconstruction.ipynb
jupyter notebook notebooks/demo_registration.ipynb- Python ≥ 3.10
- NumPy
- SciPy
- Matplotlib
- Scikit-image
- Jupyter
Davide Giambarbara — M.Sc. Neuroengineering and Neurotechnologies, University of Genoa