Reputation: 91
I have been trying to feed a dataset of brain MRI images (IXI dataset) to a ConvNet, however, some of the images have 140 channels some others 150 channels. How can I make all the images have the same number of channels so that I won't run into trouble with a fixed CNN input shape? I am using nibabel lib for reading the .nii files.
I don't have much knowledge about MRI images, what channels should be discarded?
Upvotes: 3
Views: 390
Reputation: 395
I assume by "channels" you mean number of slices, am I right? Then another approach is to duplicate some of the images to make all of them have 150 channels. If you think about data augmentation, duplicating (and probably make minor alterations) might be a good idea. Of course, depends on the actual content of your images, this may or may not be applicable.
Upvotes: 1
Reputation: 11218
The obvious approach is definitely:
Find the minimum number of channels in the sample.
Discard all the other channels for any sample.
Now, the discarding can happen from the middle of the slice which will probably contain better details. But this is based on the specific domain.
Or, 2. you can select a mean from the number of channels. and try to discard for the images with higher number of channels and add a black slice for images with lower number of channels.
Upvotes: 1