Moein Hasani
Moein Hasani

Reputation: 91

How can I reduce the number of channels in an MRI (.nii format) image?

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

Answers (2)

Guang
Guang

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

Zabir Al Nazi Nabil
Zabir Al Nazi Nabil

Reputation: 11218

The obvious approach is definitely:

  1. Find the minimum number of channels in the sample.

  2. 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

Related Questions