In [1]:
# Importanto as bibliotecas necessárias:
import DTIlib as DTI
from IPython.display import Image
from IPython.display import display
%matplotlib
import matplotlib.pyplot as plt
import numpy as np
In [2]:
# Loading the data, at this case for subject 01
BASE_PATH = 'subject001'
fa, evl, evt = DTI.load_fa_evl_et(BASE_PATH)
In [7]:
# Printing shapes
#fa.shape
print('FA shape: ' , fa.shape)
print('Evl shape: ', evl.shape)
In [16]:
# Viewing data
%matplotlib inline
from matplotlib.widgets import Slider
# Set up figure
sz, sy, sx = fa.shape
fig = plt.figure(figsize=(15,15))
xy = fig.add_subplot(1,3,1)
plt.title("Axial Slice")
xz = fig.add_subplot(1,3,2)
plt.title("Coronal Slice")
yz = fig.add_subplot(1,3,3)
plt.title("Sagittal Slice")
frame = 0.5
# Normalize the FA values for better visualization
maximo = np.max(np.abs(fa))
minimo = np.min(np.abs(fa))
xy.imshow(fa[np.floor(frame*sz),:,:], origin='lower', interpolation='nearest', cmap="gray",vmin=0, vmax=maximo )
xz.imshow(fa[:,np.floor(frame*sy),:], origin='lower', interpolation='nearest', cmap="gray",vmin=0 , vmax=maximo )
yz.imshow(fa[:,:,np.floor(frame*sx)], origin='lower', interpolation='nearest', cmap="gray",vmin=0 , vmax=maximo )
Out[16]:
In [ ]: