mateuszbuda / brain-segmentation-pytorch

U-Net implementation in PyTorch for FLAIR abnormality segmentation in brain MRI
https://mateuszbuda.github.io/2017/12/01/brainseg.html
MIT License
722 stars 187 forks source link

Training on a custom dataset #14

Open Jiyao96 opened 4 years ago

Jiyao96 commented 4 years ago

Hi,

I am trying to train the network on a small dataset of brain MRI images. I have sliced out the images and masks following the format of your dataset. Now I am having an issue during preprocessing train volumes which results in the volumes having shape (1,1,1) as I print from resize_sample function. I am guessing it is a problem caused by my slice dimensions but I didn't figure out how to fix it. It would be really helpful if you could help!

P.S. I can send you some sample slices I used, but cannot share it here due to the file size limit.

mateuszbuda commented 3 years ago

Your volumes (input to resize_sample) are expected to be 4D arrays of shape [n_slices x slice_height x slice_width x n_channels]. Masks should be 3D arrays of shape [n_slices x slice_height x slice_width].