diff --git a/pretraining_and_finetuning/transforms.py b/pretraining_and_finetuning/transforms.py index 22233b2..4fd1834 100644 --- a/pretraining_and_finetuning/transforms.py +++ b/pretraining_and_finetuning/transforms.py @@ -12,7 +12,7 @@ def train_transforms(crop_size, patch_size, task="pretraining"): transforms.LoadImaged(keys=all_keys, image_only=False), transforms.EnsureChannelFirstd(keys=all_keys), transforms.Orientationd(keys=all_keys, axcodes="RPI"), - transforms.CropForegroundd(keys=all_keys, source_key="label_sc"), # crop everything outside the SC mask + # transforms.CropForegroundd(keys=all_keys, source_key="label_sc"), # crop everything outside the SC mask # NOTE: spine interpolation with order=2 is spline, order=1 is linear transforms.Spacingd(keys=all_keys, pixdim=(0.8, 0.8, 0.8), mode=(2, 1)), transforms.ResizeWithPadOrCropd(keys=all_keys, spatial_size=crop_size), @@ -60,7 +60,7 @@ def train_transforms(crop_size, patch_size, task="pretraining"): transforms.LoadImaged(keys=all_keys), transforms.EnsureChannelFirstd(keys=all_keys), transforms.Orientationd(keys=all_keys, axcodes="RPI"), - transforms.CropForegroundd(keys=all_keys, source_key="label_sc"), # crop everything outside the SC mask + # transforms.CropForegroundd(keys=all_keys, source_key="label_sc"), # crop everything outside the SC mask # NOTE: spine interpolation with order=2 is spline, order=1 is linear transforms.Spacingd(keys=all_keys, pixdim=(0.8, 0.8, 0.8), mode=(2, 1, 1)), transforms.ResizeWithPadOrCropd(keys=all_keys, spatial_size=crop_size), @@ -106,7 +106,7 @@ def val_transforms(crop_size, task="pretraining"): transforms.LoadImaged(keys=all_keys, image_only=False), transforms.EnsureChannelFirstd(keys=all_keys), transforms.Orientationd(keys=all_keys, axcodes="RPI"), - transforms.CropForegroundd(keys=all_keys, source_key="label_sc"), + # transforms.CropForegroundd(keys=all_keys, source_key="label_sc"), transforms.Spacingd(keys=all_keys, pixdim=(0.8, 0.8, 0.8), mode=(2, 1)), transforms.ResizeWithPadOrCropd(keys=all_keys, spatial_size=crop_size), transforms.DivisiblePadd(keys=all_keys, k=2**5), # pad inputs to ensure divisibility by no. of layers nnUNet has (5) @@ -120,7 +120,7 @@ def val_transforms(crop_size, task="pretraining"): transforms.LoadImaged(keys=all_keys, image_only=False), transforms.EnsureChannelFirstd(keys=all_keys), transforms.Orientationd(keys=all_keys, axcodes="RPI"), - transforms.CropForegroundd(keys=all_keys, source_key="label_sc"), + # transforms.CropForegroundd(keys=all_keys, source_key="label_sc"), transforms.Spacingd(keys=all_keys, pixdim=(0.8, 0.8, 0.8), mode=(2, 1, 1)), transforms.ResizeWithPadOrCropd(keys=all_keys, spatial_size=crop_size), transforms.DivisiblePadd(keys=all_keys, k=2**5), # pad inputs to ensure divisibility by no. of layers nnUNet has (5)