1

I am checking the shape of the MRI data that I downloaded from the ADNI website. it supposes to be a 3D image but this code produces 4 coordinates! I need to know what each coordinate here means. print(img.shape) the output that I got is (170, 256, 256, 1). should it be 3 coordinates since this 3D image?

eso
  • 11
  • 1

1 Answers1

0

The 1 is the grayscale channel. You can “squeeze” that dimension away and you will have a 3D array.

You can use img.squeeze()

And as for which direction each axis corresponds to, I highly recommend plotting different slices of the volume. That way you will know which axes correspond to sagittal, coronal, and axial. You can plot the slices towards the middle of each dimension, so you can see the tissue.

import matplotlib.pyplot as plt
plt.imshow(img[85])
plt.imshow(img[:, 128])
plt.imshow(img[:, :, 128])
jkr
  • 17,119
  • 2
  • 42
  • 68