A collection of tools for working with regions of interest (ROI's) in DICOM RT and NIFTI formats. Includes extraction of subvolumes and format interconversion utilities. All tools require Python 3.5+ to run and are tested on 64-bit Linux systems.
Convert a DICOM RT structure set to a set of NIFTI images, each containing individual structure set.
Input: DICOM dirs of a structural MRI and RTSTRUCT
Output: individual subvolumes of all structures (except for Skull) in NIFTI format
usage: dcmrt_to_subvol <structural DICOM dir> <RTSTRUCT DICOM dir> <output_file_name_prefix>
Convert a NIFTI ROI subimage to a reference image space, optionally convert to DICOM RTSTRUCT
Input: subimage, reference image
Output: subimage in reference image space, (optionally) RTSS DICOM file with synthesized contour set.
usage: convert_subvol <NIFTI subimage> <original NIFTI image> [options]
Create RTSTRUCT from a NIFTI binary or multi-organ label-map volume and structural MRI.
Input: reference DICOM directory, NIFTI mask volume
Output: RTSTRUCT with conturs created from this NIFTI mask referencing the reference DICOM series.
usage: nifti2rtss.py [-h] [--structure_labels <label,...>] [--segmentation-intensities <all|int,...>] [--structure-set-label ] [--tolerance ] [--min_poly_pts ] input_nifti input_dicom output_dicom
For a multi-organ label map, structure labels and intensities are ordered lists and must have the same length:
nifti2rtss.py segmentation.nii dicom_dir output.dcm --structure_labels Liver,Spleen --segmentation-intensities 1,2
The default --segmentation-intensities all retains the original single-mask behavior.
For multiple ROIs, the structure-set label defaults to MULTI_ROI; override it with --structure-set-label.
Convert DICOM RT structure images to NIFTI
usage:
Input: DICOM RTSTRUCT file, referenced structural DICOM scan
Output: NIFTI files for structural and mask files and metadata in JSON format.
rtss2nifti.py [-h] [--out_struct ] [--exclude_labels ] [--separate_masks] in_rtss in_struct_dir out_roi_mask
Convert a NIFTI binary mask to a mesh file.
usage: python nifti2mesh.py [--min_mask_value ] [--no_mesh_smoothing] in_nifti_file out_mesh_file
input: 3D binary mask
output: 3D mesh file. Output formats are those supported by meshio
Note: requires ITK