diff --git a/pydicer/visualise/data.py b/pydicer/visualise/data.py index 664d6c9..8608ae0 100644 --- a/pydicer/visualise/data.py +++ b/pydicer/visualise/data.py @@ -59,6 +59,7 @@ def visualise( ) visualise_modalities = ["CT", "MR", "RTSTRUCT", "RTDOSE", "PT"] + render_mask_types = [sitk.sitkUInt8, sitk.sitkUInt16, sitk.sitkUInt32, sitk.sitkUInt64] df_process = df_process[df_process.modality.isin(visualise_modalities)] for _, row in get_iterator( @@ -203,6 +204,11 @@ def visualise( for f in struct_dir.glob("*.nii.gz") } + masks = { + k: masks[k] for k in masks + if masks[k].GetPixelID() in render_mask_types + } + if len(masks) == 0: logger.warning( "No contours found in structure directory: %s", {struct_dir} @@ -280,6 +286,10 @@ def visualise( f.name.replace(".nii.gz", ""): sitk.ReadImage(str(f)) for f in struct_dir.glob("*.nii.gz") } + masks = { + k: masks[k] for k in masks + if masks[k].GetPixelID() in render_mask_types + } if len(masks) == 0: logger.warning(