HITLAB-DeepIGeoS / DeepIGeoS

Pytorch Implementation of DeepIGeoS
30 stars 6 forks source link

train_pnet scripts fails as positional argument "target_shape" in get_transform misses. #16

Closed realptkkit closed 4 months ago

realptkkit commented 2 years ago

Hello,

After downloading the proposed dataset and starting the train_pnet script the Programm holds at following section:

 File ".../DeepIGeoS/data_loaders/transforms.py", line 10, in get_transform
    tio.CropOrPad(mask_name='crop_mask'), # crop only object region
TypeError: __init__() missing 1 required positional argument: 'target_shape'

I did not change the data or the script. What is the required target_shape for this particular dataset?

younnggsuk commented 2 years ago

I think that error occurs when label named crop_mask is not passed to torchio's CropOrPad(). In order to crop only the area excluding the background in the mri image, we passed a mask for the area greater than 0 in the image. (https://github.com/HITLAB-DeepIGeoS/DeepIGeoS/blob/main/data_loaders/brats2021_3d.py#L25-L27)

Therefore, if you do not add a label named crop_mask to the torchio subject, you need to pass the target_shape argument to CropOrPad().