1

I used plot_glass_brain to visualize 3D image (Nifti) with nilearn but it is displayed incorrectly. see code and pictures below

The 2_1_t2.nii file is available on this link : https://drive.google.com/file/d/1_gsg8sO9c7Ws6Xd7xB1uFSW8H31tAHtm/view?usp=sharing

enter image description here

enter image description here

import matplotlib.pyplot as plt
from nilearn.plotting import plot_anat, show
plotting.plot_glass_brain('2_1_t2.nii')
plotting.show()
Hela Yahyaoui
  • 29
  • 1
  • 6
  • can you please provide the `2_1_t2.nii` file along with the code so it turns to be a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). – Bilal Jun 18 '20 at 04:27
  • I added a link to the file `2_1_t2.nii` to my original post above – Hela Yahyaoui Jun 18 '20 at 15:14
  • maybe you have to map fMRI voxels to MNI (Montreal imaging institute) coordinate space. – Bilal Jun 18 '20 at 18:33
  • Indeed - from the `srow_x` etc. values you can see that your image is not aligned to the MNI space, which the glass brain is. You can do this alignment in Python using `dipy`. – alle_meije Aug 16 '21 at 22:45

0 Answers0