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
707 stars 186 forks source link

A puzzle about the code #21

Open Agito555 opened 3 years ago

Agito555 commented 3 years ago

Thanks for ur sharing and ur work is really cool! I have a puzzle about ur code in dataset.py , what is ur point in linë 48 and linë 49? volumes[patient_id] = np.array(image_slices[1:-1]) masks[patient_id] = np.array(mask_slices[1:-1])

if u want to store the all corresponding data in the dictionary ,why not implement like this, say ,
volumes[patient_id] = np.array(image_slices) i mean ,if the code is implemented as u do, dosen't it miss the data about image_slice[0] and image_slice[-1]

mateuszbuda commented 3 years ago

This removes the first and the last slice from each volume. This is done because they are often corrupted and never contain brain tissue.