Jupyter notebook examples
Import
nifti-snapshot
If
nifti-snapshothad been installed throughgithub clone, add thenifti-snapshot/nifti_snapshotto the path either byexportorsys.path.append
[ ]:
import nifti_snapshot
Simple visualization of a map
[103]:
img_loc = '101_diff_map.nii.gz'
[112]:
fig = nifti_snapshot.SimpleFigure(
image_files = [img_loc],
title = 'Difference map between GAD-T1w and T1w',
vmin_list = [-100],
vmax_list = [100],
make_transparent_zero = True,
cbar_width = 0.5,
cbar_title = 'GAD T1w - T1w intensity'
)
image_files : ['101_diff_map.nii.gz']
title : Difference map between GAD-T1w and T1w
vmin_list : [-100]
vmax_list : [100]
make_transparent_zero : True
cbar_width : 0.5
cbar_title : GAD T1w - T1w intensity
Control size of the boxes and number of axes
[116]:
fig = nifti_snapshot.SimpleFigure(
ncols=3, nrows=3, slice_gap=2,
image_files = [img_loc],
box_x = [80, 180],
box_y = [80, 160],
box_z = [40, 150],
slice_num_lowest = 35,
slice_num_highest = 59,
title = 'Difference map between GAD-T1w and T1w',
vmin_list = [-100],
vmax_list = [100],
make_transparent_zero = True,
cbar_width = 0.5,
hspace = 0.02,
wspace = 0.02,
cbar_title = 'GAD T1w - T1w intensity'
)
ncols : 3
nrows : 3
slice_gap : 2
image_files : ['101_diff_map.nii.gz']
box_x : [80, 180]
box_y : [80, 160]
box_z : [40, 150]
slice_num_lowest : 35
slice_num_highest : 59
title : Difference map between GAD-T1w and T1w
vmin_list : [-100]
vmax_list : [100]
make_transparent_zero : True
cbar_width : 0.5
hspace : 0.02
wspace : 0.02
cbar_title : GAD T1w - T1w intensity
Control maximum and minimum intensity by vmin_list and vmax_list
[117]:
fig = nifti_snapshot.SimpleFigure(
ncols=3, nrows=3, slice_gap=2,
image_files = [img_loc],
box_x = [80, 180],
box_y = [80, 160],
box_z = [40, 150],
slice_num_lowest = 35,
slice_num_highest = 59,
title = 'Difference map between GAD-T1w and T1w',
vmin_list = [-1000],
vmax_list = [1000],
make_transparent_zero = True,
cbar_width = 0.5,
hspace = 0.02,
wspace = 0.02,
cbar_title = 'GAD T1w - T1w intensity'
)
ncols : 3
nrows : 3
slice_gap : 2
image_files : ['101_diff_map.nii.gz']
box_x : [80, 180]
box_y : [80, 160]
box_z : [40, 150]
slice_num_lowest : 35
slice_num_highest : 59
title : Difference map between GAD-T1w and T1w
vmin_list : [-1000]
vmax_list : [1000]
make_transparent_zero : True
cbar_width : 0.5
hspace : 0.02
wspace : 0.02
cbar_title : GAD T1w - T1w intensity
[119]:
fig = nifti_snapshot.SimpleFigure(
ncols=3, nrows=3, slice_gap=2,
image_files = [img_loc],
box_x = [80, 180],
box_y = [80, 160],
box_z = [40, 150],
slice_num_lowest = 35,
slice_num_highest = 59,
title = 'Difference map between GAD-T1w and T1w',
vmin_list = [1],
vmax_list = [300],
make_transparent_zero = True,
cbar_width = 0.5,
hspace = 0.02,
wspace = 0.02,
cbar_title = 'GAD T1w - T1w intensity'
)
ncols : 3
nrows : 3
slice_gap : 2
image_files : ['101_diff_map.nii.gz']
box_x : [80, 180]
box_y : [80, 160]
box_z : [40, 150]
slice_num_lowest : 35
slice_num_highest : 59
title : Difference map between GAD-T1w and T1w
vmin_list : [1]
vmax_list : [300]
make_transparent_zero : True
cbar_width : 0.5
hspace : 0.02
wspace : 0.02
cbar_title : GAD T1w - T1w intensity
[120]:
fig = nifti_snapshot.SimpleFigure(
ncols=3, nrows=3, slice_gap=2,
image_files = [img_loc],
box_x = [80, 180],
box_y = [80, 160],
box_z = [40, 150],
slice_num_lowest = 35,
slice_num_highest = 59,
title = 'Difference map between GAD-T1w and T1w',
vmin_list = [1],
vmax_list = [1000],
make_transparent_zero = True,
cbar_width = 0.5,
hspace = 0.02,
wspace = 0.02,
cbar_title = 'GAD T1w - T1w intensity'
)
ncols : 3
nrows : 3
slice_gap : 2
image_files : ['101_diff_map.nii.gz']
box_x : [80, 180]
box_y : [80, 160]
box_z : [40, 150]
slice_num_lowest : 35
slice_num_highest : 59
title : Difference map between GAD-T1w and T1w
vmin_list : [1]
vmax_list : [1000]
make_transparent_zero : True
cbar_width : 0.5
hspace : 0.02
wspace : 0.02
cbar_title : GAD T1w - T1w intensity
[121]:
fig = nifti_snapshot.SimpleFigure(
ncols=3, nrows=3, slice_gap=2,
image_files = [img_loc],
box_x = [80, 180],
box_y = [80, 160],
box_z = [40, 150],
slice_num_lowest = 35,
slice_num_highest = 59,
title = 'Difference map between GAD-T1w and T1w',
vmin_list = [1],
vmax_list = [1500],
make_transparent_zero = True,
cbar_width = 0.5,
hspace = 0.02,
wspace = 0.02,
cbar_title = 'GAD T1w - T1w intensity'
)
ncols : 3
nrows : 3
slice_gap : 2
image_files : ['101_diff_map.nii.gz']
box_x : [80, 180]
box_y : [80, 160]
box_z : [40, 150]
slice_num_lowest : 35
slice_num_highest : 59
title : Difference map between GAD-T1w and T1w
vmin_list : [1]
vmax_list : [1500]
make_transparent_zero : True
cbar_width : 0.5
hspace : 0.02
wspace : 0.02
cbar_title : GAD T1w - T1w intensity
Simple histogram
[123]:
fig = nifti_snapshot.SimpleHistogram(
ncols=3, nrows=3, slice_gap=2,
image_files = [img_loc],
box_x = [80, 180],
box_y = [80, 160],
box_z = [40, 150],
slice_num_lowest = 35,
slice_num_highest = 59,
title = 'Difference map between GAD-T1w and T1w',
title_font_size = 20,
vmin_list = [400],
vmax_list = [1500],
make_transparent_zero = True,
cbar_width = 0.5,
hspace = 0.1,
wspace = 0.1,
top = 0.85,
cbar_title = 'GAD T1w - T1w intensity'
)
ncols : 3
nrows : 3
slice_gap : 2
image_files : ['101_diff_map.nii.gz']
box_x : [80, 180]
box_y : [80, 160]
box_z : [40, 150]
slice_num_lowest : 35
slice_num_highest : 59
title : Difference map between GAD-T1w and T1w
title_font_size : 20
vmin_list : [400]
vmax_list : [1500]
make_transparent_zero : True
cbar_width : 0.5
hspace : 0.1
wspace : 0.1
top : 0.85
cbar_title : GAD T1w - T1w intensity
/Users/kangik/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.
warnings.warn("The 'normed' kwarg is deprecated, and has been "