Last active
July 22, 2020 12:42
-
-
Save McSpooder/ad67958f0a24a3f66f62de80e3142e1a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import nibabel as nib | |
def show_image(image): | |
plt.imshow(image) | |
fig = plt.figure() | |
mri = nib.load("path_to_mri_scan\\mri_volume.nii").get_fdata() | |
mri.shape | |
for i in range(0, 2): | |
for j in range(1, 5): | |
index = i*4 | |
ax = plt.subplot(3, 4, index + j) | |
plt.tight_layout() | |
ax.set_title('slice #{}'.format(index + j)) | |
ax.axis('off') | |
show_image(mri[50 + (index+j)*2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment