from nisl import datasets, utils from pynax import Figure, Mark, create_axes import pylab as pl import numpy as np nyu = datasets.fetch_nyu_rest(n_subjects=1) func = nyu.func[0] niimg = utils.check_niimg(func) fig = Figure((2, 3)) data = niimg.get_data()[..., 0] # Awesome example activation map : take whatever is > .6 max data_act = np.ma.MaskedArray(data, mask=(data < .6 * np.max(data))) display_options = {} display_options['interpolation'] = 'nearest' display_options['cmap'] = pl.cm.gray x, y, z = create_axes(['x', 'y', 'z']) mx = Mark(x, 20) my = Mark(y, 20) mz = Mark(z, 20) vx = fig.add((1, 2), data, mx, z, y, display_options=display_options) vx.add_mark(my) vx.add_mark(mz) vy = fig.add((0, 2), data, my, z, x, display_options=display_options) vy.add_mark(mx) vy.add_mark(mz) vz = fig.add((0, 0), data, mz, y,
if len(sys.argv) > 1: import nibabel as nb f = nb.load(sys.argv[1]) data = f.get_data() data_act = None else: nyu = datasets.fetch_nyu_rest(n_subjects=1) func = nyu.func[0] niimg = utils.check_niimg(func) data = niimg.get_data()[..., 0] # Awesome example activation map : take whatever is > .6 max data_act = np.ma.MaskedArray(data, mask=(data < .6 * np.max(data))) fig = Figure((2, 3)) display_options = {} display_options['interpolation'] = 'nearest' display_options['cmap'] = pl.cm.gray display_options['pynax_colorbar'] = True x, y, z = create_axes(['x', 'y', 'z']) mx = Mark(x, 20) my = Mark(y, 20) mz = Mark(z, 20) vx = fig.add((1, 2), data, mx, z, y, display_options=display_options) vx.add_mark(my) vx.add_mark(mz) vy = fig.add((0, 2), data, my, z, x, display_options=display_options) vy.add_mark(mx) vy.add_mark(mz)
from nisl import datasets, utils from pynax import Figure, Mark, create_axes import pylab as pl import numpy as np nyu = datasets.fetch_nyu_rest(n_subjects=1) func = nyu.func[0] niimg = utils.check_niimg(func) fig = Figure((2, 7)) data = niimg.get_data()[..., 0] # Awesome example activation map : take whatever is > .6 max data_act = np.ma.MaskedArray(data, mask=(data < .6 * np.max(data))) display_options = {} display_options['interpolation'] = 'nearest' display_options['cmap'] = pl.cm.gray x, y, z = create_axes(['x', 'y', 'z']) mx = Mark(x, 20) marks = [] slices = [] for i in range(10): mz = Mark(z, i * 3 + 3) marks.append(mz) slices.append(fig.add((i / 5, i % 5), data, mz, x, y, display_options=display_options)) vx = fig.add((0, 5), data, mx, y, z, shape=(2, 2), display_options=display_options) for m in marks:
from nisl import datasets, utils from pynax import Figure, Mark, create_axes import pylab as pl import numpy as np nyu = datasets.fetch_nyu_rest(n_subjects=1) func = nyu.func[0] niimg = utils.check_niimg(func) fig = Figure((2, 7)) data = niimg.get_data()[..., 0] # Awesome example activation map : take whatever is > .6 max data_act = np.ma.MaskedArray(data, mask=(data < .6 * np.max(data))) display_options = {} display_options['interpolation'] = 'nearest' display_options['cmap'] = pl.cm.gray x, y, z = create_axes(['x', 'y', 'z']) mx = Mark(x, 20) marks = [] slices = [] for i in range(10): mz = Mark(z, i * 3 + 3) marks.append(mz) slices.append( fig.add((i / 5, i % 5), data, mz, x, y,