Multi-Planar Reconstruction Viewer for Medical Imaging
MPR (Multi-Planar Reconstruction) Viewer is a comprehensive medical imaging application built with PyQt5 that enables visualization and manipulation of 3D medical imaging data.
The application supports both NIfTI and DICOM file formats, offering advanced viewing capabilities including:
- Multi-planar reconstruction (MPR)
- Segmentation overlay with memory-efficient management
- Oblique slicing with interactive rotation
- Curved MPR for vessel analysis
- AI-powered orientation detection
- Advanced 3D visualization with PyVista
- Interactive blood flow simulation
- Vessel flythrough navigation
- Theme switching (Dark/Light modes)
This tool is designed for medical professionals, researchers, and students working with volumetric medical imaging data, providing intuitive controls and powerful visualization features for comprehensive data analysis.
- File Support
NIfTI Format: Load and visualize .nii and.nii.gz files
DICOM Format: Import entire .DICOM series from folders
Export Capabilities: Export processed volumes to both NIfTI and DICOM formats with full metadata preservation
Viewing Modes
2D MPR Views:
-
3 Main Views: Simultaneous axial, coronal, and sagittal plane visualization
-
Oblique View: Custom oblique plane slicing with interactive rotation controls
-
Segmentation View: Dedicated view for segmentation visualization with plane selection
-
Curved View: Advanced curved MPR for vessel straightening and analysis
3D Visualization:
-
Surface Mode: High-quality 3D surface rendering of segmented structures
-
Planes Mode: Interactive slice planes in 3D space
-
atomical System Organization: Structures automatically categorized by system (Cardiovascular, Skeletal, Muscular, etc.)
-
Smart Caching: Mesh and volume caching for faster repeated loads
Interactive Tools
Advanced Features
Segmentation Management:
- Load multiple segmentation files with memory-efficient lazy loading
- Edge detection with red outline visualization
- Merged volume view for comprehensive segmentation analysis
- Smart caching for improved performance
3D Advanced Features:
- Blood Flow Visualization: Animated blood flow simulation in vessels with adjustable heart rate
- Vessel Centerline Extraction: Automatic centerline computation for tubular structures
- Flythrough Navigation: Interactive camera paths through vessels and spinal canal
- Focus Navigation: Right-click to isolate and examine individual structures
- Anatomical Categorization: Automatic organization by body systems
- Opacity Control: Per-system opacity adjustment
UI/UX Enhancements:
- Theme Switching: Toggle between dark and light modes with animated switch
- Custom Title Bar: Modern, frameless window design with drag, minimize, maximize, and restore
- Tabbed Interface: Seamless switching between 2D MPR and 3D views
- Progress Indicators: Background loading with cancellable progress dialogs
- Coordinated Zoom: Uniform scaling across all views maintaining spatial relationships
pip install -r requirements.txt
1) Load Medical Data
Click "Open NIfTI File" or "Open DICOM Folder" to import your medical imaging data.
The application automatically:
- Detects orientation (for DICOM files)
- Calculates optimal window/level settings
- Applies aspect ratio correction
- Organizes segmentations by anatomical system
2) Navigate and Explore
Use intuitive controls to explore your data:
- Mouse wheel: Scroll through slices
- Click and drag: Move crosshair to specific locations
- Double-click: Maximize any view for detailed inspection
- Tab switching: Toggle between 2D MPR and 3D views
3) Adjust Visualization Fine-tune the display for optimal visualization:
- Contrast Mode: Drag to adjust window/level
- Zoom/Pan Mode: Wheel to zoom, drag to pan
- Reset: Restore original settings anytime
- Theme Switch: Toggle between dark and light modes
4) Work with Segmentations Load and visualize segmentation masks:
- Click "Load Segmentation" to add masks
- Switch to "Segmentation View" for dedicated visualization
- Overlays appear as red outlines in all views
- View merged segmentations in dedicated panel
- Background loading with progress tracking
Show Image
5) Use Oblique Slicing Create custom viewing angles:
- Switch to "Oblique View" mode
- Enable "Rotate Mode"
- Drag the yellow axis handle to adjust angle
- Oblique view updates in real-time
6) Curved MPR for Vessels
Straighten curved vessels for better analysis:
- Switch to "Curved View" mode
- Enable "Curved MPR" tool
- Left-click: Add control points along vessel
- Right-click: Remove last point
- Double-click: Confirm curve and generate straightened view
- View frontal projection of curved structure
7) 3D Visualization
Explore data in three dimensions:
- Switch to "3D" tab
- Choose Surface Mode for 3D structure rendering
- Choose Planes Mode for interactive slice visualization
- Toggle visibility by anatomical system
- Adjust opacity per system
- Use smart loading - structures load on-demand
8) Advanced 3D Features
Blood Flow Visualization:
- Set desired heart rate (BPM)
- Click "Start Blood Flow"
- Watch animated blood flow through vessels
- Pulsatile flow in arteries, steady flow in veins
Vessel Flythrough:
- Select a vessel or "Spine" from dropdown
- Click "Play" to start automatic flythrough
- Adjust velocity with slider
- Scrub through path with progress slider
- Camera follows vessel centerline automatically
Focus Navigation:
- Enable "Focus Navigation" tool
- Right-click on any structure to isolate it
- Right-click again to restore all structures
- Perfect for examining specific anatomy
9) Crop and Export Process and export your data:
- Click the Crop tool to select slice range
- Choose export format (NIfTI or DICOM)
- All metadata and modifications are preserved
- Prof. Tamer Basha
- Eng. Alaa Tarek

















