ellisdg / 3DUnetCNN

Pytorch 3D U-Net Convolution Neural Network (CNN) designed for medical image segmentation
MIT License
1.94k stars 651 forks source link

Why you get a common foreground mask in advance in preprocessing? #38

Closed namco1992 closed 7 years ago

namco1992 commented 7 years ago

Hi @ellisdg , Based on your explanation in issue #15 , you first get a common foreground mask and then crop images with that mask. I guess the purpose of having a global foreground mask is that you wanna make sure all the cropped images have the same size, but you will have the same size images after the resize anyway, so what could be the consideration of having a prepared foreground mask?

Please right me if I am wrong about this, thanks.

ellisdg commented 7 years ago

Hi @namco1992! Good question. My goal was to keep the spacing of the images identical to each other. So I cropped all of the images down to the smallest size that included all the foreground pixels from all of the images. I then resized the images identically so that they would all be the same size with the same image spacing.

Honestly, I don't know if this is beneficial. If a model is trained with a large amount of data and with sufficient data augmentation, the image spacing might not make even a small difference. An alternative would be to crop each image individually and then resize to the input size for the model. This results in differing image spacing between the input images.

namco1992 commented 7 years ago

Hi @ellisdg , Thanks for your response, I didn't consider about the spacing before, but I think it's better to keep the identical spacing.

I have another question, I noticed that you only choose T1, T1c and flair as training modalities, is it only because you would like to save some memory space?

ellisdg commented 7 years ago

Actually, I use T1, T1c and flair because those are the modalities present in a private dataset in which I am trying to detect brain tumors.

poornasandur commented 7 years ago

HI @ellisdg Did you classify all the sub tumor classes(edema,necrotic,enh,non-enh) or you classified tumor as a whole??

ellisdg commented 7 years ago

So far, I have only done tumor as a whole. The sub classes are not important to me at this time.

poornasandur commented 7 years ago

@ellisdg Ok.. thank you for making ur code online... there is a lot of information to learn from it.. I really learnt something by working on your code..

namco1992 commented 7 years ago

Hi @ellisdg , Thank you, I also get so much help here just like @poornasandur . All the best.