Created
September 13, 2017 11:07
-
-
Save r03ert0/524df008c1d242538661aadd765a099f 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
def plot_anat(img,output_file=None,vmax=None): | |
sh=img.get_data().shape | |
midvox=[sh[0]/2,sh[1]/2,sh[2]/2,1] | |
worldmidvox=img.affine.dot(midvox) | |
if vmax is None: | |
data=img.get_data().ravel() | |
data=data[data>data.max()*0.2] | |
vmax=data[range(0,len(data),len(data)/1000)].max() | |
plotting.plot_anat(img,vmax=vmax,cut_coords=worldmidvox[:3],output_file=output_file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment