Project-MONAI / tutorials

MONAI Tutorials
https://monai.io/started.html
Apache License 2.0
1.85k stars 681 forks source link

How to do not use 'Spacingd' the image size during Monai unetr_btcv_segmentation #811

Closed kimtaeuk-AI closed 2 years ago

kimtaeuk-AI commented 2 years ago

My data image shape [480,480,360] but during training process my data shape transform the [121,121,191].

How to hold my data shape during the training process and test process.

tangy5 commented 2 years ago

Hi kimtaeuk-AI, the transforms can be customized. If you would not like to use Spacingd, you can remove that transform. But the current GPUs are difficult to handle [480, 480, 360] as input size. The tutorial cropped the CT volumes into [96, 96, 96] using the RandCropByNegPosPair. You can customized the crop size as the input shape and modify the model accordingly.

RandCropByPosNegLabeld(
                    keys=["image", "label"],
                    label_key="label",
                    spatial_size=(96, 96, 96),
                    pos=1,
                    neg=1,
                    num_samples=4,
                    image_key="image",
                    image_threshold=0,
                ),

You can try remove the Spacingd, the original data shape will be remained and use the [96,96,96] as the crop size. Thank you.

kimtaeuk-AI commented 2 years ago

Hellow tangy5, :) Thanks to you, the problem was solved. Have a nice day~!