A comprehensive Multi-Planar Reconstruction (MPR) medical imaging viewer with AI-powered organ and orientation detection. Features real-time interactive crosshair navigation, oblique plane cutting, ROI tools, and advanced visualization capabilities for DICOM, NIfTI, and MHD medical image formats.
- Overview
- Features
- Demo
- Architecture
- Requirements
- Installation
- Usage
- Interactive Controls
- Supported Formats
- Color Coding
- License
- Contributing
- Contact
This project implements an advanced Multi-Planar Reconstruction (MPR) viewer that enables radiologists, researchers, and medical professionals to visualize and analyze medical imaging data across multiple anatomical planes. The system integrates AI-powered detection capabilities to automatically identify organs and anatomical orientations.
- Multi-Planar Reconstruction (MPR): Simultaneous visualization of Axial, Coronal, and Sagittal views
- Interactive Crosshairs: Click and drag reference lines to navigate through slices
- Synchronized Navigation: All views update together for coordinated examination
- Zoom & Pan: Ctrl+Scroll to zoom, Right-click to pan across images
- Slice Scrolling: Mouse wheel to navigate through slices
- Fourth View Modes:
- Contour View: Real-time edge detection and contour extraction from any plane
- Oblique Plane: Draw a cutting line to create custom oblique slices through the volume
- Organ Detection: Automatic identification of anatomical regions (Brain, Chest/Heart, Abdomen/Liver, Pelvis, Spine, Extremities)
- Orientation Detection: Per-plane orientation analysis with confidence scores
- Dual AI Approach:
- ResNet18-based deep learning features (when PyTorch available)
- Enhanced heuristic algorithms with statistical analysis
- Visual ROI Drawing: Click and drag to define regions of interest
- Manual ROI Input: Precise numerical specification of ROI bounds
- ROI Cropping: Apply ROI to zoom and focus on specific areas
- ROI Persistence: Save and load ROI definitions as JSON files
- DICOM Series: Load entire folders of DICOM slices
- NIfTI: Support for .nii and .nii.gz formats
- MetaImage: Support for .mhd/.raw format
- Modern dark theme with color-coded reference lines
- Real-time voxel spacing and position information
- Responsive controls with visual feedback
- Comprehensive keyboard and mouse shortcuts
Real-time edge detection and contour extraction from any plane
CONTOUR.mp4
Custom oblique plane visualization with drawn cutting line
OBLIQUE.mp4
Interactive ROI selection with visual overlay
ROI.mp4
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Medical Image Input (DICOM/NIfTI/MHD) โ
โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโ
โ Image Loading โ
โ - DICOM Series โ
โ - NIfTI Files โ
โ - MHD/RAW Files โ
โโโโโโโโโโโโฌโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ AI Detection Engine โ
โ - ResNet18 โ
โ - Heuristic Analysisโ
โ - Orientation Check โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโดโโโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
โ MPR Rendering โ โ Interactive Tools โ
โ - Axial View โ โ - Crosshair Control โ
โ - Coronal View โ โ - ROI Drawing โ
โ - Sagittal View โ โ - Oblique Cutting โ
โ - Special View โ โ - Zoom/Pan โ
โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โโโโโโโโโโโโโฌโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโ
โ Output & Export โ
โ - Visualizations โ
โ - ROI Data (JSON) โ
โ - Measurements โ
โโโโโโโโโโโโโโโโโโโโโโ
- Mouse or trackpad for navigation and interaction
- 4GB+ RAM (8GB+ recommended)
- CUDA-compatible GPU (optional, for AI detection)
- 2GB+ free disk space
- Python 3.8 or higher
- Operating System: Windows, macOS, or Linux
- Required libraries:
- PyQt5
- NumPy
- pydicom
- nibabel (for NIfTI support)
- scipy & scikit-image (for contour/oblique views)
- torch & torchvision (optional, for AI detection)
- Clone the repository
git clone https://github.com/yourusername/MPR-Viewer.git- Navigate to the project directory
cd MPR-Viewer- Install core dependencies
pip install -r requirements.txt- Install optional dependencies (for full features)
# For NIfTI file support
pip install nibabel
# For contour and oblique views
pip install scipy scikit-image
# For AI-enhanced detection
pip install torch torchvisionpython MPR_Viewer.py- Click "๐ Load Files"
- Choose loading method:
- DICOM Folder: Select folder containing DICOM series
- Single File: Load NIfTI (.nii, .nii.gz) or MHD (.mhd) files
Mouse Controls:
- Left Click + Drag Line: Move single crosshair line
- Right Click + Drag: Move both crosshair lines simultaneously
- Ctrl + Right Click + Drag: Pan view
- Scroll Wheel: Navigate through slices
- Ctrl + Scroll Wheel: Zoom in/out
View Selection:
- Use dropdown menus to change 4th view mode (Contour/Oblique)
- Select source plane for contour or oblique views
-
Draw ROI:
- Click "โฌ Draw ROI" button
- Click and drag on any view to define rectangle
- Release to confirm selection
-
Manual ROI Entry:
- Click "๐ Manual ROI"
- Enter precise Z, Y, X start/end values
- Click OK to apply
-
Apply ROI:
- Click "๐ Apply ROI" to crop volume to selected region
-
Save/Load ROI:
- Save current ROI: "๐พ Save ROI" โ Choose location
- Load saved ROI: "๐ Load ROI" โ Select JSON file
-
Switch to Oblique Mode:
- Select "Oblique Plane" from 4th view dropdown
-
Choose Source Plane:
- Select Axial, Coronal, or Sagittal from oblique dropdown
-
Draw Cutting Line:
- Click "โ๏ธ Draw Cutting Line"
- Click and drag on source plane to define cutting angle
- Oblique view updates in real-time
-
View Results:
- See angle measurement in button label
- Observe oblique slice in 4th panel
The application automatically analyzes loaded volumes:
- Displays detected organ type with confidence
- Shows orientation analysis for each plane
- Uses ResNet18 + heuristics (if PyTorch available) or enhanced heuristics alone
- Results shown in blue info banner at top
- Brain: High contrast, complex edge structures
- Chest/Heart: Medium intensity, characteristic shape
- Abdomen/Liver: Moderate intensity, homogeneous regions
- Pelvis: High bone intensity, specific anatomical markers
- Spine: Very high bone intensity, elongated structure
- Extremities: Variable intensity, elongated proportions
Per-plane analysis provides:
- Confidence Scores: 70-95% range
- Anatomical Labels: Axial, Coronal, Sagittal
- Volume Analysis: Overall orientation assessment
Click "๐ Reset" to restore original volume and clear all modifications
| Action | Shortcut |
|---|---|
| Pan View | Ctrl + Right Click + Drag |
| Zoom | Ctrl + Scroll Wheel |
| Next Slice | Scroll Up |
| Previous Slice | Scroll Down |
| Action | Control |
|---|---|
| Drag Single Line | Left Click + Drag (on line) |
| Drag Both Lines | Right Click + Drag |
| Draw ROI | Left Click + Drag (in ROI mode) |
| Draw Oblique Line | Left Click + Drag (in oblique mode) |
| Pan View | Ctrl + Right Click + Drag |
| Zoom | Ctrl + Scroll Wheel |
| Change Slice | Scroll Wheel |
- Each view has a slider for precise slice navigation
- Slider values sync with mouse wheel scrolling
- Direct slider manipulation updates all views
- Full DICOM series support
- Automatic slice ordering by position/instance number
- Voxel spacing extraction from metadata
- Multi-file series loading
- Compressed and uncompressed formats
- Automatic orientation handling
- Header metadata extraction
- 3D and 4D volume support (uses first timepoint)
- Header + raw data pair
- Multiple data types (short, ushort, float, uchar, etc.)
- Spacing and dimension metadata
- Compressed (.zraw) support
- Yellow Lines: Coronal reference plane
- Magenta Lines: Sagittal reference plane
- Cyan Lines: Axial reference plane
- Green Box: ROI boundary
- Green Line: Oblique cutting line
This project is provided as-is for educational and research purposes. Not intended for clinical diagnostic use.
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Commit your changes
git commit -m 'Add amazing feature' - Push to the branch
git push origin feature/amazing-feature
- Open a Pull Request
Project Contributer: Radwa Hamdy
Project Contributer: Maryam Moustafa
Project Contributer: Nour Ahmed
Project Contributer: Aya Sayed
- Email: aya.sayed14827@gmail.com
- GitHub