In [2]:
from nifti import NiftiImage
In [17]:
%matplotlib inline
In [13]:
import numpy as np
import matplotlib.pyplot as plt
from scipy import ndimage
In [3]:
# from http://stackoverflow.com/questions/3579568/choosing-a-file-in-python-with-simple-dialog
from Tkinter import Tk
from tkFileDialog import askopenfilename
Tk().withdraw() # we don't want a full GUI, so keep the root window from appearing
filenameo = askopenfilename() # show an "Open" dialog box and return the path to the selected file
print(filenameo)
nim=NiftiImage(filenameo)
global Do
Do=nim.data
In [4]:
Do.shape
Out[4]:
In [7]:
DMapscolor2=np.transpose(Do,(3,2,1,0))
In [8]:
DMapscolor2.shape
Out[8]:
In [20]:
import pylab
In [61]:
pylab.rcParams['figure.figsize'] = (6.5, 15)
In [62]:
L=11
for i in range(L):
plt.subplot(L,2,i+1)
Rotated_Plot = ndimage.rotate(0.02*DMapscolor2[:,:,i], -90)
IM=plt.imshow(Rotated_Plot)
frame1 = plt.gca()
frame1.axes.get_xaxis().set_visible(False)
frame1.axes.get_yaxis().set_visible(False)
plt.tight_layout()
In [55]:
pylab.rcParams['figure.figsize'] = (10, 20)
L=11
for i in range(L):
plt.subplot(L,3,i+1)
Rotated_Plot = ndimage.rotate(0.02*DMapscolor2[:,:,i], -90)
IM=plt.imshow(Rotated_Plot)
frame1 = plt.gca()
frame1.axes.get_xaxis().set_visible(False)
frame1.axes.get_yaxis().set_visible(False)
plt.tight_layout()
In [60]:
%store
In [59]:
pylab.rcParams['figure.figsize'] = (10, 20)
L=11
for i in range(L):
plt.subplot(L,1,i+1)
Rotated_Plot = ndimage.rotate(0.02*DMapscolor2[:,:,i], -90)
IM=plt.imshow(Rotated_Plot)
frame1 = plt.gca()
frame1.axes.get_xaxis().set_visible(False)
frame1.axes.get_yaxis().set_visible(False)
plt.tight_layout()
In [ ]: