pycortex
pycortex copied to clipboard
DOC: Make an identity transform example
Anatomical data can be viewed using the built-in identity
transform in pycortex:
import cortex
nifti = cortex.db.get_anat('S1')
arr = nifti.get_data().T
vol = cortex.Volume(arr, 'S1', 'identity')
cortex.webgl.show(vol)
Just stumbled on this, so will add my two cents.
The use of nifti.get_data()
is deprecated, and nifti.get_fdata()
is preferred. Another alternative to achieve the same thing with an identity transform:
import cortex
import numpy as np
vol = cortex.Volume.empty('S1', 'identity', np.nan)
cortex.webgl.show(vol)