Project-MONAI / research-contributions

Implementations of recent research prototypes/demonstrations using MONAI.
https://monai.io/
Apache License 2.0
1.02k stars 334 forks source link

UNETR for 2D Segmentation #127

Closed kabbas570 closed 2 years ago

kabbas570 commented 2 years ago

Hi, thanks for the contributions to the scientific community. Can we use UNETR for 2D images? I am trying to put the last channel = 1, but I think all the conv filters at the backend are 3D.

Do you have any implementation for 2D ?

Thanks

wyli commented 2 years ago

yes, you can set spatial_dims=2..

kabbas570 commented 2 years ago

Thanks, its also has issue for self.patch_size = (16, 16, 16).

img_size[2] // self.patch_size[2],

IndexError: tuple index out of range

wyli commented 2 years ago

I see, you can use the version in monai: https://github.com/Project-MONAI/MONAI/blob/1.0.0/monai/networks/nets/unetr.py

kabbas570 commented 2 years ago

Thanks, @wyli , yes, it's working for the 2D case.