Computer Vision News - December 2021

23 Using Jupyter Notebooks import os import nibabel import numpy as np import matplotlib.pyplot as plt AnatomicalMRI image (3-DNIfTI image) First, we are going to see an anatomical MRI image. # Load an anatomical MRI image (3-D NIfTI image) img_t1 = nibabel.load('data/sub-01_ses-anatomy_T1w .nii.gz ') # Extract the image as an array data_t1 = np.asanyarray(img_t1.dataobj) data_t1.shape The loaded image should have shape of (256, 256, 208). You can check the spatial direction of each dimension of the image array by the following code. nibabel.aff2axcodes(img_t1.affine) N-th letter represents the incremental direction of N-th dimention of the image array. • A / P : Anterior/Posterior • S / I : Superior/Inferior • L / R : Left/Right See also: Anatomical terms of location - Wikipedia Thus, the dimension-direction correspondense of the loaded image is: • 1st dim: anterior to posterior • 2nd dim: superior to inferior • 3rd dim: right to left Terminology on brain anatomy • Anterior vs posterior • Superior vs inferior • Dorsal vs ventral Image from "Neuroscience, 4th ed." Sinauer, 2007 You can check the size of each voxel (each element of anMRI image) by the following code (unit: mm). img_t1.header.get_zooms() Now, let's visualize a sagital slice of the loaded MRI image by display the slice at the center of the left/right axis.

RkJQdWJsaXNoZXIy NTc3NzU=