Abstract
The AutoPipeline feature will improve the accessibility of raw clinical datasets on public archives, such as the Cancer Imaging Archive (TCIA), the largest public repository of cancer imaging, allowing machine learning researchers to process analysis-ready formats without requiring deep domain knowledge.
Introduction
In the field of medical imaging AI, the "data janitor" work—cleaning, organizing, and preprocessing data—often consumes more time and effort than the actual model development. Clinical data is predominantly stored in the Digital Imaging and Communications in Medicine (DICOM) format. While comprehensive, DICOM is notoriously complex; a single 3D scan can be fragmented into hundreds of individual 2D files. Furthermore, associating these images with corresponding radiotherapy contours (RTStructs) or dose maps (RTDose) requires navigating intricate metadata hierarchies.
Existing solutions often rely on graphical user interfaces (GUIs) like 3DSlicer or are restricted to specific imaging modalities, hindering the creation of automated, reproducible pipelines necessary for large-scale AI training. Med-ImageTools was developed to address these challenges, transforming manual, error-prone preprocessing into a streamlined, single-command operation.
Methodology: The AutoPipeline
The core innovation of Med-ImageTools is the AutoPipeline, a native Python framework that automates the "crawl-connect-process" workflow through three distinct stages:
- Crawl: Utilizing the
Pydicomlibrary, the tool recursively indexes every file within a dataset to extract metadata. This results in a structured database identifying unique images and radiotherapy modalities. - Connect: The system employs metadata-driven heuristics to automatically link related files. For instance, it ensures a patient’s CT scan is accurately paired with its specific tumor segmentation (RTStruct).
- Process: Linked groups are converted into standardized 3D volumes (such as NIfTI or Nrrd) using
SimpleITK. This stage includes automated voxel resampling, Hounsfield Unit (HU) windowing, and high-performance parallelization via thejoblibbackend.
As a native Python package, Med-ImageTools integrates seamlessly into modern machine learning workflows and continuous integration/continuous deployment (CI/CD) pipelines.
Experimental Evaluation
The authors validated the package across several diverse datasets to demonstrate its versatility and scalability:
- Pancreatic-CT-CBCT-SEG: A public TCIA dataset featuring 40 patients.
- Liver Metastasis Dataset: A private cohort of 97 patients used for benchmarking manual versus automated processing.
- RADCURE: A large-scale dataset comprising 3,219 head and neck cancer patients.
- NLST (National Lung Screening Trial): A massive dataset of over 26,000 patients used to evaluate metadata crawling performance at scale.
Results and Key Insights
Efficiency and Scalability
Med-ImageTools provides substantial time savings. For the liver metastasis dataset, a manual workflow using 3DSlicer required 7.5 hours, whereas Med-ImageTools completed the task in 2.3 hours. On the RADCURE dataset, the tool processed 3,219 patients in just 40 minutes using 32 cores, demonstrating near-linear speedup and readiness for "Big Data" applications.
The Metadata Bottleneck
A significant finding was that for massive datasets like the NLST, simply crawling metadata to understand file structure can consume over 1,000 core-hours. By sharing "pre-crawled" metadata spreadsheets, researchers can significantly reduce the computational burden for the community. In the pancreatic dataset, using a pre-indexed database reduced total processing time by 18%.
Reproducibility through Standardization
By replacing complex, custom scripts with simple configuration files, Med-ImageTools lowers the barrier for replicating study results. This standardization is crucial for ensuring that data preprocessing is consistent across different research labs.
Limitations and Future Work
While Med-ImageTools automates the technical "plumbing" of data curation, it does not replace the need for clinical oversight. Researchers must still verify the accuracy of the underlying clinical data. Additionally, inconsistent naming conventions for anatomical structures in clinical datasets (e.g., "Heart" vs. "Heart_Obj") remain a challenge; while the tool supports regex filtering, automated semantic matching is a goal for future development. Finally, the authors plan to incorporate native support for the Brain Imaging Data Structure (BIDS) to further broaden the tool's applicability.
Summary updated