David Kang
David Kang

Reputation: 55

How to use ImageDataGenerator with nii/NIFTI files using ADNI dataset

I'm trying to load my data using keras' ImageDataGenerator class, but I am having trouble since the image files are not a standard jpeg/png image file but rather nii.gz files. I found this github repo https://github.com/sremedios/nifti_image_generator/blob/master/utils/nifti_image.py but the dimensions outputted were not matching up and

train_generator.next()

throws an error of

ValueError: could not broadcast input array from shape (233,189) into shape (197,233,189,1)

Upvotes: 0

Views: 1294

Answers (1)

pathto AI
pathto AI

Reputation: 11

In order to use Nii file which is standard format for medical images like MR , CT etc. You have to use nibabel library to read medical imaging dataset.
Also DLTK library is available from Google for working on medical imaging.

Upvotes: 1

Related Questions