DeepGrow transforms FindAllValidSlicesd label shape #3664
Replies: 5 comments
-
@SachidanandAlle could you please help here? |
Beta Was this translation helpful? Give feedback.
-
Hi @pritesh-mehta , In the DeepGrow tutorial you can see we prepare the dataset first: https://github.com/Project-MONAI/tutorials/blob/master/deepgrow/ignite/prepare_dataset.py And there we have use the function "_save_data_3d": https://github.com/Project-MONAI/MONAI/blob/dev/monai/apps/deepgrow/dataset.py#L213 In line 223 you can see we move the "slice" axis to the very front. So, if an image is [512, 512, 90]. Then in the train.py in the tutorial, we load it and add channel and run this transform. So slice would be getting from 90. Another hint here is the transform's docstring. The D here means the depth/z-dimension which means the slice. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Can you explain why change from HWD to DHW in line 223? Would it not be more natural to keep HWD throughout? |
Beta Was this translation helpful? Give feedback.
-
Hi @pritesh-mehta, One major reason of that is because we can reuse the same transform https://github.com/Project-MONAI/MONAI/blob/dev/monai/apps/deepgrow/transforms.py for 2D and 3D since they both ends in [H, W] |
Beta Was this translation helpful? Give feedback.
-
The transform assumes label is a 4D volume with shape CDHW. I'm wondering if this is right? I'm working with the MSD spleen dataset currently. spleen_2.nii.gz is axial with shape 512x512x90 and resolution 0.79x0.79x5. The image shape once loaded in using the LoadImaged transform is (512, 512, 90), and following the AddChannel1d transform, the shape is (1, 512, 512, 90). I believe that we would describe spleen_2 as having 90 slices.
The link below shows label.shape[1] (=512), being used to find valid slices:
MONAI/monai/apps/deepgrow/transforms.py
Line 45 in aa5fa1d
Should we not be looking in label.shape[-1] (=90) for valid slices? If yes, further changes will be needed in the FindAllValidSlicesd transform and the AddInitialSeedPointd transform.
Beta Was this translation helpful? Give feedback.
All reactions