In [1]:
import nibabel as nib
In [2]:
img = nib.load("Brats17_CBICA_AAB_1_flair.nii.gz")
In [3]:
img
Out[3]:
In [14]:
img.get_data().shape
Out[14]:
In [38]:
img.get_qform()
Out[38]:
In [40]:
img.get_filename()
Out[40]:
In [45]:
img.header.keys() # These are the metadata from the DICOM file
Out[45]:
In [9]:
import matplotlib.pyplot as plt
In [13]:
plt.imshow(img.get_data()[:,:,80], cmap="bone")
Out[13]:
In [15]:
plt.imshow(img.get_data()[:,:,75], cmap="bone")
Out[15]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [18]:
import SimpleITK as sitk
In [19]:
imgS = sitk.ReadImage("Brats17_CBICA_AAB_1_flair.nii.gz")
In [25]:
z = 75
plt.imshow(sitk.GetArrayViewFromImage(imgS)[z,:,:], cmap="bone")
Out[25]:
In [28]:
imgS.GetMetaDataKeys() # These are the meta data from the DICOM file
Out[28]:
In [29]:
imgS.GetMetaData("vox_offset")
Out[29]:
In [34]:
imgS.GetMetaData("srow_x")
Out[34]:
In [ ]: