diff --git a/detection/generate_transforms.py b/detection/generate_transforms.py index b255532742..5fc9ac91c2 100644 --- a/detection/generate_transforms.py +++ b/detection/generate_transforms.py @@ -78,7 +78,7 @@ def generate_detection_train_transform( train_transforms = Compose( [ - LoadImaged(keys=[image_key], meta_key_postfix="meta_dict"), + LoadImaged(keys=[image_key], image_only=False, meta_key_postfix="meta_dict"), EnsureChannelFirstd(keys=[image_key]), EnsureTyped(keys=[image_key, box_key], dtype=torch.float32), EnsureTyped(keys=[label_key], dtype=torch.long), @@ -224,7 +224,7 @@ def generate_detection_val_transform( val_transforms = Compose( [ - LoadImaged(keys=[image_key], meta_key_postfix="meta_dict"), + LoadImaged(keys=[image_key], image_only=False, meta_key_postfix="meta_dict"), EnsureChannelFirstd(keys=[image_key]), EnsureTyped(keys=[image_key, box_key], dtype=torch.float32), EnsureTyped(keys=[label_key], dtype=torch.long), @@ -280,7 +280,7 @@ def generate_detection_inference_transform( test_transforms = Compose( [ - LoadImaged(keys=[image_key], meta_key_postfix="meta_dict"), + LoadImaged(keys=[image_key], image_only=False, meta_key_postfix="meta_dict"), EnsureChannelFirstd(keys=[image_key]), EnsureTyped(keys=[image_key], dtype=torch.float32), Orientationd(keys=[image_key], axcodes="RAS"), diff --git a/detection/luna16_prepare_images.py b/detection/luna16_prepare_images.py index 0e9047e5ca..ae0f7dc86e 100644 --- a/detection/luna16_prepare_images.py +++ b/detection/luna16_prepare_images.py @@ -61,6 +61,7 @@ def main(): [ LoadImaged( keys=["image"], + image_only=False, meta_key_postfix="meta_dict", reader="itkreader", affine_lps_to_ras=True, diff --git a/detection/luna16_prepare_images_dicom.py b/detection/luna16_prepare_images_dicom.py index 5e8ed782db..165d158b37 100644 --- a/detection/luna16_prepare_images_dicom.py +++ b/detection/luna16_prepare_images_dicom.py @@ -63,6 +63,7 @@ def main(): [ LoadImaged( keys=["image"], + image_only=False, meta_key_postfix="meta_dict", reader="itkreader", affine_lps_to_ras=True, diff --git a/reconstruction/MRI_reconstruction/unet_demo/inference.ipynb b/reconstruction/MRI_reconstruction/unet_demo/inference.ipynb index 301dd9cb2f..8f8e3a6767 100644 --- a/reconstruction/MRI_reconstruction/unet_demo/inference.ipynb +++ b/reconstruction/MRI_reconstruction/unet_demo/inference.ipynb @@ -236,7 +236,7 @@ "\n", "test_transforms = Compose(\n", " [\n", - " LoadImaged(keys=[\"kspace\"], reader=FastMRIReader, dtype=np.complex64),\n", + " LoadImaged(keys=[\"kspace\"], reader=FastMRIReader, image_only=False, dtype=np.complex64),\n", " # user can also add other random transforms\n", " ExtractDataKeyFromMetaKeyd(keys=[\"reconstruction_rss\", \"mask\"], meta_key=\"kspace_meta_dict\"),\n", " MaskTransform,\n", diff --git a/reconstruction/MRI_reconstruction/unet_demo/train.py b/reconstruction/MRI_reconstruction/unet_demo/train.py index b54bd224bf..4286223eaa 100644 --- a/reconstruction/MRI_reconstruction/unet_demo/train.py +++ b/reconstruction/MRI_reconstruction/unet_demo/train.py @@ -97,7 +97,7 @@ def trainer(args): train_transforms = Compose( [ - LoadImaged(keys=["kspace"], reader=FastMRIReader, dtype=np.complex64), + LoadImaged(keys=["kspace"], reader=FastMRIReader, image_only=False, dtype=np.complex64), # user can also add other random transforms ExtractDataKeyFromMetaKeyd(keys=["reconstruction_rss", "mask"], meta_key="kspace_meta_dict"), MaskTransform, diff --git a/reconstruction/MRI_reconstruction/varnet_demo/inference.ipynb b/reconstruction/MRI_reconstruction/varnet_demo/inference.ipynb index 0533fadef1..d858ddd70a 100644 --- a/reconstruction/MRI_reconstruction/varnet_demo/inference.ipynb +++ b/reconstruction/MRI_reconstruction/varnet_demo/inference.ipynb @@ -251,7 +251,7 @@ "\n", "test_transforms = Compose(\n", " [\n", - " LoadImaged(keys=[\"kspace\"], reader=FastMRIReader, dtype=np.complex64),\n", + " LoadImaged(keys=[\"kspace\"], reader=FastMRIReader, image_only=False, dtype=np.complex64),\n", " # user can also add other random transforms\n", " ExtractDataKeyFromMetaKeyd(keys=[\"reconstruction_rss\", \"mask\"], meta_key=\"kspace_meta_dict\"),\n", " MaskTransform,\n", diff --git a/reconstruction/MRI_reconstruction/varnet_demo/train.py b/reconstruction/MRI_reconstruction/varnet_demo/train.py index 6e8c3d3949..969976bf90 100644 --- a/reconstruction/MRI_reconstruction/varnet_demo/train.py +++ b/reconstruction/MRI_reconstruction/varnet_demo/train.py @@ -106,7 +106,7 @@ def trainer(args): train_transforms = Compose( [ - LoadImaged(keys=["kspace"], reader=FastMRIReader, dtype=np.complex64), + LoadImaged(keys=["kspace"], reader=FastMRIReader, image_only=False, dtype=np.complex64), # user can also add other random transforms but remember to disable randomness for val_transforms ExtractDataKeyFromMetaKeyd(keys=["reconstruction_rss", "mask"], meta_key="kspace_meta_dict"), MaskTransform,