Skip to content

AustenMan/MedicalDataHandler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MedicalDataHandler_Logo

MedicalDataHandler

A Research-Oriented GUI for DICOM Data Management

πŸ”— Only looking for the latest EXE? Click here!

πŸ”— We're published in the Medical Physics journal!


Contributors:
Austen Maniscalco, Yang Park, Andrew Godley, Mu-Han Lin, Steve Jiang, and Dan Nguyen

Affiliation:
Medical Artificial Intelligence and Automation Laboratory, Department of Radiation Oncology, University of Texas Southwestern Medical Center, Dallas, TX, 75390, USA

Contact:
Austen Maniscalco ([email protected])


πŸ“Œ Overview

What is MedicalDataHandler?

MedicalDataHandler is a graphical user interface (GUI) tool built with Dear PyGUI for DICOM data processing, validation, and transformation. It enables users to:

  • Manage DICOM data effortlessly without coding.
  • Automatically detect and organize DICOM files into structured datasets.
  • Inspect and visualize patient data with real-time rendering.
  • Export data in NRRD format for seamless integration in downstream pipelines (e.g., AI model training).

Brief Demo
Figure 1: A brief animation to demonstrate basic functionality in MedicalDataHandler.


Why was this created?

  • βœ… Standardize DICOM data processing for researchers, students, and trainees without requiring programming skills.
  • βœ… Offer an intuitive, modern GUI for flexible, codeless data visualization and processing.
  • βœ… Minimize opportunity for user error with features such as:
    • Automated DICOM file identification and organization, eliminating manual organization of DICOM files across numerous folders.
    • Structured tables displaying patient data and organized by relational DICOM UIDs.
    • Automated Structure Name Matching & Renaming following TG-263.
  • βœ… Provide research-focused validation tools to analyze DICOM metadata and catch errors before they propagate in downstream applications.
  • βœ… Enable specialized post-processing, including:
    • CT HU-to-RED conversion (Hounsfield Units β†’ Relative Electron Density)
      • Sample values are provided for convenience, however, it is STRONGLY ADVISED to update these values in the configuration files to align with your institutional data
        • ct_HU_map_vals.json and ct_RED_map_vals.json in the config_files folder
    • Region-specific RED overrides for segmented structures.
    • Dose Summation across multiple dose distributions.

πŸš€ Installation

Option 1: Download Prebuilt EXE (Recommended)

πŸ”— Download the latest release

Option 2: Run from Source

Prerequisites

  • Python 3.11+
  • Install dependencies:
    pip install -r requirements.txt
    

System Requirements

  • Recommended specs:
    • OS: Windows
    • CPU: Any modern multi-core processor (tested with i7-12700)
    • RAM: 32+ GB (tested with 32 GB)
    • GPU: Optional (GUI is GPU-accelerated via Dear PyGUI)

πŸ“‚ Features

πŸ“Š DICOM Data Management & Processing

  • βœ” Automated DICOM file discovery in user-specified directories.

    DICOM Search
    Figure 2: Users can select "Add New Data", and then "Choose a DICOM Directory" to search for DICOM files.

  • βœ” SQL database indexing via SQLite and SQLAlchemy for persistent storage and efficient querying of DICOM metadata.

  • βœ” Patient Data Table for structured display of accessible patient data.

    Data Table Patients
    Figure 4: The patient table supports filtering by MRN, name, processing status, or site-specific metadata.

  • βœ” Patient Object Inspection for backend storage analysis.

    Inspection Patient Object
    Figure 4: Clicking "Inspect" in the patient table displays the patient database record and relationships, including associated files.

  • βœ” Automated File Grouping for convenient organization of patient-specific data.

    Data Table Load
    Figure 5: After patient selection, the table shows data grouped by relational DICOM UID values. Metadata columns show labels, names, descriptions, and timestamps for each file.

  • βœ” DICOM metadata inspection using Pydicom, with collapsible trees and filters.

    Inspection DICOM Metadata
    Figure 6: The DICOM metadata inspection panel enables structured viewing and filtering of attributes for individual files.

πŸ–ΌοΈ Interactive 2D Visualization

  • βœ… Data visualization by converting DICOM data to SimpleITK Images and NumPy arrays.

  • βœ… Customizable display toggles for flexible visualization of any loaded images, dose distributions, and/or structures.

    DICOM Data Loaded
    Figure 7: A fully loaded dataset displayed with interactive visualization controls and toggle options for images, dose distributions, and structures.

  • βœ… Three-pane view support for axial, sagittal and coronal planes with the ability to:

    • Zoom: CTRL + Mouse Scroll
    • Pan: Middle Mouse Drag
    • Scroll through slices: Mouse Scroll
    • Move Crosshairs (Synchronizes all viewing planes): Right Mouse Click
    • Inspect Voxels: Right Mouse Click on a view to display a hovered voxel's:
      • Image values
      • Dose values
      • Segmentations present
    • Move viewing planes to center of any ROI.
    • Rename, recolor, or remove segmentations.

    Three Views
    Figure 8: Three-pane visualization of axial, sagittal, and coronal views, with voxel-level information displayed at the mouse cursor.

  • βœ… Concise beam summary for each RT Plan to inform users about essential treatment planning details.

    Inspection Loaded Data
    Figure 9: The beam summary panel includes the treatment machine name, radiation type, angles, and more as extracted from the DICOM metadata.

  • βœ… Inspection of loaded data to view or modify metadata fields.

    Inspection Loaded Data
    Figure 10: The inspection panel for loaded data allows viewing and/or modifying specific metadata fields, depending on the data type.

πŸ”„ DICOM-to-NRRD Conversion

  • βœ” NRRD export for each 3D volume while retaining DICOM metadata, and optionally retaining custom modifications.

  • βœ” Customizable post-processing tools and flexible file naming options.

  • βœ” Supports both partial (single-item) and batch data saving.

    Save
    Figure 12: The save window enables exporting selected data to NRRD format with customizable options.

πŸ›  Additional Features

  • βœ” Integrated logging window for debugging.

  • βœ” Take screenshots by pressing Ctrl+S or the Print Screen key. Saves to a screenshot folder.

  • βœ” Optimized performance with multiprocessing and multithreading and a GPU-accelerated GUI.

  • βœ” Settings window with options such as:

    • GUI resizing
    • Crosshair & orientation label adjustments
    • Data rotation or flips

    Settings
    Figure 11: The settings panel provides controls for GUI customization, data rotation/flips, etc.


πŸ”„ Future Development

πŸ›  Planned Features

  • βœ” Direct DICOM import from DAEMON Server.
  • βœ” Dose-Volume Histogram (DVH) visualization.
  • βœ” Basic image processing tools (e.g., applying filters).
  • βœ” Oblique plane visualization support (e.g., beams' eye view).
  • βœ” 3D RTPLAN beam data representation and beam visualization.
  • βœ” Direct NRRD imports and writing back to DICOM format.
  • βœ” Support for rigid image registration and persistent registration storage.
  • βœ” Support for data anonymization.
  • βœ” Potential C# re-write for possible integration with ESAPI.

⚠️ Disclaimers

I am relatively new to computer science and software development; I learned as I built this software, and I aim to continually improve this code.

A large language model (LLM) was used to assist with code review, writing docstrings, and formatting this README.


πŸ”— Contributing

Interested in contributing? Fork the repository, make changes, and submit a pull request.


πŸ“œ Licensing

This software is licensed under a custom academic license from The University of Texas Southwestern Medical Center. It is available exclusively for academic research use under specific conditions. See LICENSE.txt for details.
Additionally, see the notices folder for third-party open-source software acknowledgments.


πŸ“’ Acknowledgments

This work was supported by:

  • NIH grants R01CA237269, R01CA254377, and R01CA258987.

About

MedicalDataHandler: A Research-Oriented Graphical User Interface for DICOM Processing, Image Analysis, and Data Management

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages