In [1]:
from nilearn import plotting
from nilearn.image import resample_img
import nibabel as nib
In [2]:
img = nib.load('/Users/greg/Downloads/gkbrain.nii.gz')
print(img.shape)
dat = img.get_fdata()
dat = dat[0::2, 0::2, 0::2]
aff = img.affine
aff[0:3,0:3] *= 2
img = nib.Nifti1Image(dat, aff, img.header)
print(img.shape)
In [3]:
html_view = plotting.view_img(img, bg_img=False, draw_cross=True, colorbar=False,
symmetric_cmap=False, cmap="twilight_r", black_bg=False,)
html_view
# html_view.save_as_html('gkbrain.html')
Out[3]: