Advanced Multi-Planar Reconstruction System for Medical Imaging
Features • Installation • Usage • Architecture • Screenshots
| Feature | Description |
|---|---|
| 📁 Multi-Format Support | Load DICOM series, NIfTI (.nii, .nii.gz), and NumPy (.npy) volumes |
| 🔄 Multi-Planar Views | Axial, Sagittal, Coronal, and Oblique reconstructions |
| 🎯 Interactive Navigation | Click to recenter, scroll to slice, drag to pan |
| 🔍 Zoom Controls | Ctrl+scroll or buttons for precise zoom |
| 📐 Oblique Slicing | Drag yellow handles to rotate the cutting plane |
| 🤖 AI Organ Detection | TotalSegmentator integration for automatic organ segmentation |
| 📊 Contour Mode | Visualize segmentation contours with label selection |
| 🎬 Cine Playback | Animate through slices in any view |
| 💾 Export Options | Save slices (PNG/NPY) or ROI volumes (NIfTI/NPY) |
| 🌙 Cyberpunk Theme | Modern dark UI with neon accents |
# Required
pip install PyQt5 numpy matplotlib scipy
# Optional (for full functionality)
pip install pydicom # DICOM support
pip install nibabel # NIfTI support
pip install scikit-image # Contour detection
pip install totalsegmentator # AI organ detection (requires GPU)# Clone or download the project
cd d:\study\imaging\tasks\task2
# Run the application
python main.py- DICOM: Click "Load DICOM" → Select folder containing DICOM files
- NIfTI/NumPy: Click "Load NIfTI/NumPy" → Select .nii, .nii.gz, or .npy file
| Action | Control |
|---|---|
| Change slice | Scroll wheel or slider |
| Recenter views | Click on any view |
| Pan | Drag with left mouse button |
| Zoom | Ctrl + scroll wheel |
| Rotate oblique plane | Drag yellow handles on crosshair |
- Detect Organ: Runs TotalSegmentator to identify the main organ
- Run AI: Detects volume orientation (Axial/Sagittal/Coronal)
- Load segmentation file with "Load Seg (Contour)"
- Select label from dropdown
- Click "Enter Contour Mode"
- Navigate through contour slices
MPR-Viewer/
├── main.py # Application entry point
├── config/
│ ├── __init__.py
│ └── theme.py # Dark theme stylesheet & palette
├── core/
│ ├── __init__.py
│ ├── reslice.py # Oblique slice interpolation
│ └── segmentation.py # TotalSegmentator thread
├── ui/
│ ├── __init__.py
│ ├── view_panel.py # Single view panel container
│ ├── info_dialog.py # Startup splash dialog
│ └── main_window.py # Main MPRApp window
└── utils/
├── __init__.py
└── math_utils.py # Rotation matrices & plane calculations
| Module | Purpose |
|---|---|
config.theme |
CSS styling and color palette |
core.reslice |
3D volume oblique resampling |
core.segmentation |
Background AI segmentation |
ui.view_panel |
Matplotlib canvas + slider + crosshair state |
ui.info_dialog |
Animated startup screen |
ui.main_window |
All UI logic, events, and rendering |
utils.math_utils |
3D rotation and plane normal calculations |
The application features a 2×2 grid layout with:
- Top-left: Axial view
- Top-right: Sagittal view
- Bottom-left: Coronal view
- Bottom-right: Oblique view (interactive)
- Dark background (#0a0f1a)
- Neon cyan accents (#00ffcc)
- Terminal-style fonts (Consolas)
- Glowing button effects
- Shape:
(Z, Y, X)or(Slices, Rows, Columns) - Axial:
vol[:, :, z]- horizontal slices - Sagittal:
vol[x, :, :]- left-right slices - Coronal:
vol[:, y, :]- front-back slices
Uses trilinear interpolation via scipy.ndimage.map_coordinates:
- Compute plane normal from crosshair rotation angles
- Build orthonormal basis (u, v, n)
- Sample points on the plane grid
- Interpolate volume values
MIT License - Feel free to use and modify for your projects.
Contributions are welcome! Please feel free to submit issues or pull requests.
Made with ❤️ for Medical Imaging