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, x, shape=(2, 2), display_options=display_options) vz.add_mark(mx) vz.add_mark(my)
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) vz = fig.add((0, 0), data, mz, y, x, shape=(2, 2), display_options=display_options) vz.add_mark(mx) vz.add_mark(my) act_display_options = {} act_display_options['interpolation'] = 'nearest' act_display_options['cmap'] = pl.cm.autumn if data_act is not None:
# 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: vx.add_mark(m) act_display_options = {} act_display_options['interpolation'] = 'nearest' act_display_options['cmap'] = pl.cm.autumn vx.add_layer(data_act, display_options=act_display_options) for v in slices: v.add_layer(data_act, display_options=act_display_options) pl.show()
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: vx.add_mark(m) act_display_options = {} act_display_options['interpolation'] = 'nearest'