A Modern, Cross-Platform DICOM Viewer & Image Analysis Tool
MedImager is a powerful, user-friendly, and research-oriented open-source medical image viewer. It aims to provide smooth image interaction, multi-format support (DICOM, PNG, etc.), and advanced analysis features for academic and clinical workflows.
Create a powerful, user-friendly, and research-oriented open-source medical image viewer. MedImager aims to provide smooth image interaction, multi-format support (DICOM, PNG, etc.), and advanced analysis features for academic and clinical workflows, aspiring to be an open-source alternative to RadiAnt.
- File Handling:
- Open and parse DICOM series from folders.
- Open single image files (PNG, JPG, BMP).
- DICOM tag viewer.
- Image Display:
- Smooth pan and zoom 2D viewer.
- Multi-viewport for image comparison with flexible layouts.
- Display patient info and image overlays (scale, orientation marker).
- Image Interaction Tools:
- Windowing: Interactive adjustment of HU window width/level (WW/WL).
- Measurement Tools:
- Ruler tool for distance measurement.
- Ellipse/rectangle/circle ROI tools.
- ROI Analysis: Calculate statistics within ROI (mean, std, area, max/min HU).
- Advanced Features:
- Multi-Series Management: Load and manage multiple DICOM series simultaneously.
- Series-View Binding: Flexible binding system with auto-assignment and manual control.
- Synchronization: Cross-viewport sync for position, pan, zoom, and window/level.
- Layout System: Grid layouts (1×1 to 3×4) and special layouts (vertical/horizontal split, triple column).
- User Interface:
- Modern multilingual interface (Chinese/English).
- Customizable theme system (light/dark themes) with real-time switching.
- Complete settings system with tool appearance customization.
- Unified toolbar with theme-adaptive icons.
- Dockable panel layout.
- Multi-Planar Reconstruction (MPR): View axial, sagittal, and coronal planes from 3D volume data.
- 3D Volume Rendering: Basic 3D visualization of DICOM series.
- Image Fusion: Overlay two different series (e.g., PET/CT).
- Annotation & Export:
- Save annotation info (ROIs, measurements).
- Export annotated views as PNG/JPG images.
- Plugin System: Allow users to extend features via custom Python scripts for research.
- Language: Python 3.9+
- GUI Framework: PySide6 (LGPL)
- DICOM Parsing: pydicom
- Numerical/Image Processing: NumPy
- 2D/3D Visualization: Qt Graphics View Framework (2D), VTK 9+ (3D)
- Packaging: PyInstaller
- i18n: Qt Linguist (
pylupdate6
,lrelease
)
The project follows an MVC-like pattern to separate data logic, UI, and user interaction.
medimager/
├── main.py # Application entry point
├── icons/ # UI icons and SVG resources
├── translations/ # Translation files (.ts, .qm)
├── themes/ # Theme configuration files
│ ├── ui/ # UI themes (dark.toml, light.toml)
│ ├── roi/ # ROI appearance themes
│ └── measurement/ # Measurement tool themes
│
├── core/ # Core logic, UI-independent (MVC Model)
│ ├── __init__.py
│ ├── dicom_parser.py # DICOM loading/parsing via pydicom
│ ├── image_data_model.py # Data model for single image or DICOM series
│ ├── multi_series_manager.py # Multi-series management and layout control
│ ├── series_view_binding.py # Series-view binding management
│ ├── sync_manager.py # Cross-viewport synchronization
│ ├── roi.py # ROI shapes and logic
│ └── analysis.py # Statistical calculations (HU stats, etc.)
│
├── ui/ # All UI components (MVC View & Controller)
│ ├── __init__.py
│ ├── main_window.py # Main window with multi-series support
│ ├── main_toolbar.py # Unified toolbar management (tools, layout, sync)
│ ├── image_viewer.py # Core 2D image viewer (QGraphicsView)
│ ├── viewport.py # Standalone viewport with image_viewer
│ ├── multi_viewer_grid.py# Multi-viewport grid layout manager
│ ├── panels/ # Dockable panels
│ │ ├── __init__.py
│ │ ├── series_panel.py # Multi-series management panel
│ │ ├── dicom_tag_panel.py # DICOM tag panel
│ │ └── analysis_panel.py # ROI analysis panel
│ ├── tools/ # Interactive tool implementations
│ │ ├── __init__.py
│ │ ├── base_tool.py # Abstract base class for tools
│ │ ├── default_tool.py # Default pointer/pan/zoom/window tool
│ │ ├── roi_tool.py # ROI tools (ellipse, rectangle, circle)
│ │ └── measurement_tool.py # Distance measurement tool
│ ├── dialogs/ # Dialog windows
│ │ ├── custom_wl_dialog.py # Custom window/level dialog
│ │ └── settings_dialog.py # Application settings dialog
│ └── widgets/ # Custom UI widgets
│ ├── __init__.py
│ ├── magnifier.py # Magnifier widget
│ ├── roi_stats_box.py # ROI statistics display
│ └── layout_grid_selector.py # Layout selection widget
│
├── utils/ # General utilities (MVC Model Support)
│ ├── __init__.py
│ ├── logger.py # Global logging configuration
│ ├── settings.py # User settings management
│ ├── theme_manager.py # Theme system with icon management
│ └── i18n.py # Internationalization utilities
│
├── tests/ # Unit/integration tests
│ ├── __init__.py
│ ├── dcm/ # Test DICOM data
│ ├── scripts/ # Test data generation scripts
│ ├── test_dicom_parser.py
│ ├── test_roi.py
│ └── test_multi_series_components.py
│
├── pyproject.toml # Project metadata and dependencies
└── README_zh.md # Chinese documentation
First, ensure you have uv installed. It is an extremely fast Python package installer and resolver.
-
Clone the repo:
git clone https://github.com/1985312383/MedImager.git cd MedImager
-
Setup Environment and Install Dependencies:
# Create a virtual environment and sync dependencies from pyproject.toml uv venv uv sync
-
Run the app:
# `uv run` executes the command within the project's virtual environment, # avoiding the need to activate it in your shell. uv run python medimager/main.py
For developers who prefer an active environment:
# To activate the environment in your current shell: # Windows .venv\\Scripts\\activate # macOS / Linux source .venv/bin/activate # Then you can run commands directly: python medimager/main.py
Contributions are welcome! Whether you're fixing a bug, adding a feature, or improving documentation, your help is appreciated. Please feel free to open an issue or submit a pull request.
This project is licensed under the GNU GENERAL PUBLIC LICENSE. See the LICENSE file for details.