Skip to content

Reorganize DICOM files following a hierarchy based on meta-data fields

License

Notifications You must be signed in to change notification settings

HBPMedical/hierarchizer

 
 

Repository files navigation

CHUV License DockerHub Codacy Badge CircleCI

Hierarchizer

Introduction

Docker container containing Python scripts that reorganize DICOM files creating a folder hierarchy using meta-data found in DICOM files and/or external meta-data files (e.g. XML files from PPMI).

Usage

Run: docker run --rm -v <input_folder>:/input_folder -v <output_folder>:/output_folder -v <meta_output_folder>:/meta_output_folder hbpmip/hierarchizer:1.3.8 <incoming_dataset> [options]

where:

  • <input_folder> is the folder containing the input DICOM/NIFTI files
  • <output_folder> is the folder that will contain the hierarchized DICOM/NIFTI files
  • <meta_output_folder> is the folder that will contain the metadata files
  • <incoming_dataset> is the dataset name (e.g. CLM, EDSD, PPMI, ADNI)
  • options:
    • -h, --help : show help
    • --type TYPE : Type of image files (DICOM, NIFTI)
    • --output_folder_organisation OUTPUT_FOLDER_ORGANISATION : String containing DICOM fields to use to create the output folder hierarchy (default='#PatientID/#StudyID/#SeriesDescription/#SeriesNumber')
    • --unknown_value UNKNOWN_VALUE : value to use if a field cannot be found (default="unknown")
    • --ppmi_xml_extension : try to use meta-data from PPMI XML files if a field cannot be found in the DICOM files
    • --excluded_fields EXCLUDED_FIELDS [EXCLUDED_FIELDS ...]
    • --allowed_field_values FIELD=VALUE1,VALUE2,VALUE3 [FIELD=VALUE1,VALUE2 ...] : ignore input files containing values outside of the range of allowed field values.

Example:

  docker run --rm \
    -v $(pwd)/original:/input_folder
    -v $(pwd)/hierarchized:/output_folder \
    -v $(pwd)/hierarchized/meta:/meta_output_folder \
    hbpmip/hierarchizer:1.3.8 MyDataset --type DICOM

Build

Run: ./build.sh

Publish

Run: ./publish.sh

NOTE

Any '*' symbol in the output path is replaced by an '_' symbol.

Acknowledgements

This work has been funded by the European Union Seventh Framework Program (FP7/2007­2013) under grant agreement no. 604102 (HBP)

This work is part of SP8 of the Human Brain Project (SGA1).

About

Reorganize DICOM files following a hierarchy based on meta-data fields

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 79.0%
  • Shell 16.1%
  • Dockerfile 4.9%