MedVision Reconstructor is a Python application designed for reconstructing medical images via Radon Transform, Filtered Back-Projection (FBP), and Simultaneous Algebraic Reconstruction Technique (SART). The project includes a user-friendly interface built with PySide6 that lets you load medical images, select reconstruction parameters (angle range, filters), and visualize both the sinogram and reconstructed images.
-
Interactive GUI (PySide6)
- Intuitive interface for loading images and setting reconstruction parameters.
- Real-time visualization of sinograms and reconstruction outputs.
-
Multiple Reconstruction Methods
- Filtered Back-Projection (FBP) with multiple filters:
ramp
,shepp-logan
,cosine
,hamming
,hann
- SART (Simultaneous Algebraic Reconstruction Technique)
- Filtered Back-Projection (FBP) with multiple filters:
-
Radon Transform & Sinogram Generation
- Leverages scikit-image for computing radon transforms.
-
Animation of Incremental Reconstruction
- Enables an angle-by-angle view of how reconstruction quality evolves.
-
Test Script
- A standalone script (
test.py
) that demonstrates sinogram creation and reconstruction with FBP or SART.
- A standalone script (
Below is the directory structure for MedVision-Reconstructor:
MedVision-Reconstructor/
├── images/ # Folder containing sample medical images
├── medical_env/ # (Optional) Virtual environment folder
├── src/
│ ├── main.py # Main GUI application (PySide6)
│ ├── MI.py # Reconstruction class (Radon, FBP, SART)
│ └── test.py # Test script for demonstration
├── .gitignore
├── LICENSE
├── README.md
└── requirements.txt
-
Clone the Repository
git clone https://github.com/elifpulukcu/MedVision-Reconstructor.git cd MedVision-Reconstructor
-
(Optional) Create & Activate a Virtual Environment
python -m venv medical_env source medical_env/bin/activate # On Unix / Mac # or medical_env\Scripts\activate # On Windows
-
Install Dependencies
pip install --upgrade pip pip install -r requirements.txt
If no
requirements.txt
exists, install the main libraries manually:pip install PySide6 matplotlib scikit-image numpy
Run the main application to open the GUI:
cd src
python main.py
Key Interface Elements:
- Load Image
- Select
.png
,.jpg
,.jpeg
, or.bmp
images from your filesystem.
- Select
- Maximum Angle
- Enter the maximum angle (e.g.,
180
) for radon transform sampling.
- Enter the maximum angle (e.g.,
- Reconstruction Method
- Choose among the following filters for FBP:
ramp
,shepp-logan
,cosine
,hamming
,hann
- Or select SART for algebraic reconstruction.
- Choose among the following filters for FBP:
- Calculate
- Computes the sinogram and reconstructs the image based on the selected method.
- Displays the sinogram and reconstructed image.
- Show Animation
- Iterates through angles in steps (from 10° up to the specified angle) to visualize progressive reconstruction.
A separate test script (test.py
) demonstrates the reconstruction steps in a non-GUI fashion:
cd src
python test.py
This script will:
- Load a specified image from the
images/
directory (you can change the path in the code). - Generate a sinogram using the Radon Transform.
- Perform Filtered Back-Projection (FBP) and SART reconstructions.
- Display the original image, the sinogram, and reconstruction results side by side.
- Class
MI
- Constructor: Accepts
image
,maxAngle
, andfilterName
. Converts RGB to grayscale if necessary. processImage
: Rescales the image (default scale factor of0.4
) and prepares angles for radon transform.radonTransform
: Performs the Radon Transform (scikit-image.transform.radon
).filteredBackProjection
: Uses iradon with the specified filter to reconstruct the image from its sinogram.sart
: Applies iradon_sart for algebraic reconstruction.
- Constructor: Accepts
- PySide6 Window
- Load Image button uses a
QFileDialog
to select and display an image. - Calculate calls either
filteredBackProjection
orsart
, then renders the sinogram and reconstruction withmatplotlib
. - Show Animation demonstrates incremental reconstruction from small angles up to the user-specified maximum.
- Load Image button uses a
- Command-Line Runner
- Reads an image from
images/
. - Generates sinogram and performs both FBP and SART reconstructions.
- Displays comparative results via
matplotlib
.
- Reads an image from
-
Algorithmic Expansion
- Investigate other iterative methods like ART, TV-based methods, or deep-learning approaches.
-
Performance Optimization
- Potential GPU acceleration using CuPy or PyTorch for large-scale reconstructions.
-
Dataset & Demo
- Include more diverse images in
images/
to showcase various organ/tissue reconstructions.
- Include more diverse images in
-
Parameter Tuning
- User-adjustable SART parameters (relaxation, iterations) through the GUI.
-
CLI Extension
- Offer a robust command-line interface for batch processing or pipeline integration.
Distributed under the MIT License. Feel free to use, modify, and distribute this code for personal or commercial projects, subject to the terms of the license.
This repository is intended for educational and research purposes. The authors do not guarantee the suitability of this software for clinical or diagnostic use.
Developed by Elif Pulukçu.
Contributions and pull requests are welcome—please open an issue or submit a PR for improvements.