示例#1
0
def test_2D():
    d1 = cortex.Volume.random(subj, xfmname)
    d2 = cortex.Volume.random(subj, xfmname).masked['thick']
    twod = cortex.Volume2D(d1, d2)
    cortex.Volume2D(d1.data, d2.data, subject=subj, xfmname=xfmname, vmin=0, vmax=2, vmin2=1)
    twod.to_json()
    return twod
示例#2
0
def test_vmin_none_in_dataview2d():
    data = np.arange(np.product(volshape)).reshape(volshape, order='C')
    view = cortex.Volume2D(data, data + 1, subject=subj, xfmname=xfmname)
    cortex.quickshow(view)

    data = np.arange(nverts)
    view = cortex.Vertex2D(data, data + 1, subject=subj)
    cortex.quickshow(view)
示例#3
0
def test_dataset_save():
    tf = tempfile.NamedTemporaryFile(suffix=".hdf")
    mrand = np.random.randn(2, *volshape)
    rand = np.random.randn(*volshape)
    ds = cortex.Dataset(test=(mrand, subj, xfmname))
    ds.append(twod=cortex.Volume2D(rand, rand, subj, xfmname))
    ds.append(rgb=cortex.VolumeRGB(rand, rand, rand, subj, xfmname))
    ds.append(vert=cortex.Vertex.random(subj))
    ds.save(tf.name)

    ds = cortex.load(tf.name)
    assert isinstance(ds.test, cortex.Volume)
    assert ds.test.data.shape == mrand.shape
    assert isinstance(ds.twod, cortex.Volume2D)
    assert ds.twod.dim1.data.shape == rand.shape
    assert ds.twod.dim2.data.shape == rand.shape
    assert ds.rgb.volume.shape == tuple([1] + list(volshape) + [4])
    assert isinstance(ds.vert, cortex.Vertex)
示例#4
0
    alpha[alpha_mask] = 0

    rgb = colors.hsv_to_rgb(hsv)

    # use the above calculations to create pycortex representations
    vrgba = cortex.VolumeRGB(red=rgb[..., 0].T,
                             green=rgb[..., 1].T,
                             blue=rgb[..., 2].T,
                             subject='sub-{subject}'.format(subject=subject),
                             alpha=alpha,
                             xfmname='fmriprep_T1')
    vecc = cortex.Volume2D(eccentricity.T,
                           rsq.T,
                           'sub-{subject}'.format(subject=subject),
                           'fmriprep_T1',
                           vmin=0,
                           vmax=10,
                           vmin2=settings['rsq_threshold'],
                           vmax2=1.0,
                           cmap='BROYG_2D')
    vsize = cortex.Volume2D(size.T,
                            rsq.T,
                            'sub-{subject}'.format(subject=subject),
                            'fmriprep_T1',
                            vmin=0,
                            vmax=10,
                            vmin2=settings['rsq_threshold'],
                            vmax2=1.0,
                            cmap='BROYG_2D')
    vbeta = cortex.Volume2D(beta.T,
                            rsq.T,
示例#5
0
def main(sourcedata, derivatives, subject='tk', dataset='odc'):

    pc_subject = '{}.{}'.format(dataset, subject)
    template = '{derivatives}/modelfitting/glm7/sub-{subject}/ses-{session}/func/sub-{subject}_ses-{session}_left_over_right_zmap.nii.gz'

    session = 'odc2'
    zmap1 = template.format(**locals())

    session = 'odc3'
    zmap2 = template.format(**locals())

    session = 'cas'
    zmap3 = template.format(**locals())

    t1w = get_bids_file(derivatives, 'averaged_mp2rages', 'anat', subject,
                        'T1w', 'anat', 'average')

    zmap1 = image.resample_to_img(zmap1, t1w, interpolation='nearest')
    zmap2 = image.resample_to_img(zmap2, t1w, interpolation='nearest')
    zmap3 = image.resample_to_img(zmap3, t1w, interpolation='nearest')

    transform = cortex.xfm.Transform(np.identity(4), t1w)
    #transform.save(pc_subject, 'identity.t1w', 'magnet')

    mask1 = image.math_img('np.abs(zmap)', zmap=zmap1).get_data().T
    mask2 = image.math_img('np.abs(zmap)', zmap=zmap2).get_data().T
    mask3 = image.math_img('np.abs(zmap) > 2', zmap=zmap3).get_data().T

    print(mask3.sum())

    mask3 = ndimage.binary_closing(mask3, iterations=2)
    print(mask3.sum())

    prf_pars = np.load(
        op.join(derivatives,
                'prf/vertices/sub-{subject}_desc-test2_prf_optim.npz').format(
                    **locals()))

    r2 = prf_pars['r2']
    mask = r2 < 0.1

    angle = prf_pars['angle']
    #angle[mask] = np.nan

    ecc = prf_pars['ecc']
    ecc[mask] = np.nan

    size = prf_pars['size']
    size[mask] = np.nan

    r2_max = np.max(r2)
    r2_max = 0.3
    r2_min = 0.15

    hsv_angle = np.ones((len(r2), 3))
    hsv_angle[:, 0] = angle
    hsv_angle[:, 1] = np.clip(r2 / r2_max * 2, 0, 1)
    hsv_angle[:, 2] = r2 > r2_min

    left_index = cortex.db.get_surfinfo(pc_subject).left.shape[0]
    angle_ = hsv_angle[:left_index, 0]
    hsv_angle[:left_index, 0] = np.clip(
        ((angle_ + np.pi) - 0.25 * np.pi) / (1.5 * np.pi), 0, 1)
    angle_ = -hsv_angle[left_index:, 0].copy()
    angle_[hsv_angle[left_index:, 0] > 0] += 2 * np.pi
    angle_ = np.clip((angle_ - 0.25 * np.pi) / 1.5 / np.pi, 0, 1)
    hsv_angle[left_index:, 0] = angle_

    rgb_angle = colors.hsv_to_rgb(hsv_angle)

    #alpha_angle = np.clip(r2 / r2_max * 2, r2_min/r2_max, 1)
    #alpha_angle[alpha_angle < r2_min/r2_max] = 0
    alpha_angle = hsv_angle[:, 2]

    images = {}
    zmap1 = zmap1.get_data().T
    zmap1[zmap1 == 0] = np.nan

    zmap2 = zmap2.get_data().T
    zmap2[zmap2 == 0] = np.nan

    zmap3 = zmap3.get_data().T
    zmap3[zmap3 == 0] = np.nan

    images['PRF polar angle'] = cortex.VertexRGB(rgb_angle[:, 0],
                                                 rgb_angle[:, 1],
                                                 rgb_angle[:, 2],
                                                 alpha=alpha_angle,
                                                 subject=pc_subject)

    #images['zmap_ses-odc2'] = cortex.Volume2D(zmap1,
    #mask,
    #pc_subject,
    #'identity.t1w', vmin=-3, vmax=3, vmin2=0, vmax2=3,
    #cmap='BuBkRd_alpha_2D')

    #images['zmap_ses-odc3'] = cortex.Volume2D(zmap2,
    #mask,
    #pc_subject,
    #'identity.t1w', vmin=-3, vmax=3, vmin2=0, vmax2=3,
    #cmap='BuBkRd_alpha_2D')

    images['ODCs Amsterdam 1'] = cortex.Volume2D(zmap1,
                                                 mask3,
                                                 pc_subject,
                                                 'identity.t1w',
                                                 vmin=-3,
                                                 vmax=3,
                                                 vmin2=0,
                                                 vmax2=3,
                                                 cmap='BuBkRd_alpha_2D')

    images['ODCs Amsterdam 2'] = cortex.Volume2D(zmap2,
                                                 mask3,
                                                 pc_subject,
                                                 'identity.t1w',
                                                 vmin=-3,
                                                 vmax=3,
                                                 vmin2=0,
                                                 vmax2=3,
                                                 cmap='BuBkRd_alpha_2D')

    images['ODCs Beijing'] = cortex.Volume2D(zmap3,
                                             mask3,
                                             pc_subject,
                                             'identity.t1w',
                                             vmin=-3,
                                             vmax=3,
                                             vmin2=0,
                                             vmax2=3,
                                             cmap='BuBkRd_alpha_2D')

    ds = cortex.Dataset(**images)

    cortex.webgl.make_static(outpath=op.join(derivatives, 'pycortex', subject),
                             data=ds)
    cortex.webshow(ds)
示例#6
0
def main(sourcedata, derivatives, subject, session, cache=True, dataset='odc'):

    if subject in []:
        trans_str = '_trans'
    else:
        trans_str = ''

    pc_subject = '{}.{}'.format(dataset, subject)

    zmap = '{derivatives}/modelfitting/glm7/sub-{subject}/ses-{session}/func/sub-{subject}_ses-{session}_left_over_right_zmap{trans_str}.nii.gz'.format(
        **locals())

    #zmap2 = '{derivatives}/modelfitting/glm8/sub-{subject}/ses-{session}/func/sub-{subject}_ses-{session}_left_over_right_zmap{trans_str}.nii.gz'.format(**locals())

    #zmap_task = '{derivatives}/modelfitting/glm7/sub-{subject}/ses-{session}/sub-{subject}_ses-{session}_left_over_right_task_zmap.nii.gz'.format(**locals())

    if subject == '01':
        mean_epi = '{derivatives}/spynoza/sub-{subject}/ses-{session}/func/sub-{subject}_ses-{session}_task-checkerboard_acq-07_run-03_reference{trans_str}.nii.gz'.format(
            **locals())
    else:
        mean_epi = '{derivatives}/spynoza/sub-{subject}/ses-{session}/func/sub-{subject}_ses-{session}_task-fixation_acq-07_run-03_reference{trans_str}.nii.gz'.format(
            **locals())

    #psc = '{derivatives}/modelfitting/glm7/sub-{subject}/ses-{session}/sub-{subject}_ses-{session}_left_over_right_effect_size.nii.gz'.format(**locals())

    abs_zmap_l = op.join(
        derivatives, 'sampled_giis', f'sub-{subject}', f'ses-{session}',
        'func',
        f'sub-{subject}_ses-{session}_left_over_right_desc-abszmap-depth-all_hemi-lh_smoothed.gii'
    )
    abs_zmap_r = op.join(
        derivatives, 'sampled_giis', f'sub-{subject}', f'ses-{session}',
        'func',
        f'sub-{subject}_ses-{session}_left_over_right_desc-abszmap-depth-all_hemi-rh_smoothed.gii'
    )

    images = {}

    if op.exists(abs_zmap_l):
        abs_zmap = np.hstack((surface.load_surf_data(abs_zmap_l),
                              surface.load_surf_data(abs_zmap_r)))

        images['abs_zmap'] = cortex.Vertex(abs_zmap,
                                           pc_subject,
                                           vmin=.5,
                                           vmax=2.3)

    t1w = cortex.db.get_anat(pc_subject)

    zmap = image.resample_to_img(zmap, t1w)

    transform = cortex.xfm.Transform(np.identity(4), t1w)

    mask = image.math_img('np.abs(zmap)', zmap=zmap)

    zmap = zmap.get_data().T
    zmap[zmap == 0] = np.nan

    #zmap2 = zmap2.get_data().T
    #zmap2[zmap2 == 0] = np.nan

    mask = mask.get_data().T
    images['zmap'] = cortex.Volume2D(zmap,
                                     mask,
                                     pc_subject,
                                     'identity',
                                     vmin=-3.5,
                                     vmax=3.5,
                                     vmin2=0,
                                     vmax2=3,
                                     cmap='BuBkRd_alpha_2D')
    #images['zmap2'] = cortex.Volume2D(zmap2,
    #mask,
    #pc_subject,
    #'identity.t1w', vmin=-3, vmax=3, vmin2=0, vmax2=3,
    #cmap='BuBkRd_alpha_2D')
    #images['abs_zmap'] = cortex.Volume(np.abs(zmap),
    #pc_subject,
    #'identity.t1w', vmin=-3, vmax=3, vmin2=0, vmax2=3)
    ##cmap='BuBkRd_alpha_2D')
    #zmap_task = zmap_task.get_data().T
    #zmap_task[zmap_task == 0] = np.nan
    #images['zmap_task'] = cortex.Volume2D(zmap_task,
    #mask,
    #pc_subject,
    #'identity.t1w', vmin=-3, vmax=3, vmin2=0, vmax2=3,
    #cmap='BuBkRd_alpha_2D')

    #images['mean_epi'] = cortex.Volume(mean_epi.get_data().T,
    #pc_subject,
    #'identity.t1w')

    # PRFs
    prf_pars = np.load(
        op.join(derivatives,
                'prf/vertices/sub-{subject}_desc-test2_prf_optim.npz').format(
                    **locals()))

    r2 = prf_pars['r2']
    mask = r2 < 0.1

    angle = prf_pars['angle']
    #angle[mask] = np.nan

    ecc = prf_pars['ecc']
    ecc[mask] = np.nan

    size = prf_pars['size']
    size[mask] = np.nan

    r2_max = np.max(r2)
    r2_max = 0.3
    r2_min = 0.15

    hsv_angle = np.ones((len(r2), 3))
    hsv_angle[:, 0] = angle
    hsv_angle[:, 1] = np.clip(r2 / r2_max * 2, 0, 1)
    hsv_angle[:, 2] = r2 > r2_min

    left_index = cortex.db.get_surfinfo(pc_subject).left.shape[0]
    angle_ = hsv_angle[:left_index, 0]
    hsv_angle[:left_index, 0] = np.clip(
        ((angle_ + np.pi) - 0.25 * np.pi) / (1.5 * np.pi), 0, 1)
    angle_ = -hsv_angle[left_index:, 0].copy()
    angle_[hsv_angle[left_index:, 0] > 0] += 2 * np.pi
    angle_ = np.clip((angle_ - 0.25 * np.pi) / 1.5 / np.pi, 0, 1)
    hsv_angle[left_index:, 0] = angle_

    rgb_angle = colors.hsv_to_rgb(hsv_angle)

    #alpha_angle = np.clip(r2 / r2_max * 2, r2_min/r2_max, 1)
    #alpha_angle[alpha_angle < r2_min/r2_max] = 0
    alpha_angle = hsv_angle[:, 2]

    images['angle'] = cortex.VertexRGB(
        rgb_angle[:, 0],
        rgb_angle[:, 1],
        rgb_angle[:, 2],
        #alpha=np.ones(len(rgb_angle)),
        alpha=alpha_angle,
        subject=pc_subject)
    #images['r2'] = cortex.Vertex(prf_pars['r2'], pc_subject, cmap='inferno')
    images['ecc'] = cortex.Vertex(ecc,
                                  pc_subject,
                                  vmin=0,
                                  vmax=15,
                                  cmap='inferno')
    #images['angle_1d'] = cortex.Vertex(angle, pc_subject, vmin=-3.14, vmax=3.14, cmap='hsv')
    #images['size'] = cortex.Vertex(size, pc_subject, vmin=0, vmax=10)

    # VEIN MASK
    layout = BIDSLayout(op.join(derivatives, 'veins_mask'), validate=False)

    veins = layout.get(subject=subject,
                       session=session,
                       suffix='veins',
                       return_type='file')

    if len(veins) == 1:
        veins = veins[0]
        t1w = cortex.db.get_anat(pc_subject, 'raw')
        veins = image.resample_to_img(veins, t1w)
        veins = veins.get_data().T
        veins[veins == 0] = np.nan
        images['veins'] = cortex.Volume(veins,
                                        subject=pc_subject,
                                        xfmname='identity',
                                        vmin=0,
                                        vmax=2)

    veins_surf_l = op.join(
        derivatives, 'tsnr', f'sub-{subject}', f'ses-{session}', 'func',
        f'sub-{subject}_ses-{session}_desc-depth.all_hemi-lh_invtsnr.gii')
    veins_surf_r = op.join(
        derivatives, 'tsnr', f'sub-{subject}', f'ses-{session}', 'func',
        f'sub-{subject}_ses-{session}_desc-depth.all_hemi-rh_invtsnr.gii')
    veins_d = np.hstack((surface.load_surf_data(veins_surf_l),
                         surface.load_surf_data(veins_surf_r)))
    veins_d[np.isinf(veins_d)] = np.nan
    images['veins_surf'] = cortex.Vertex(veins_d, pc_subject)

    ds = cortex.Dataset(**images)

    # cortex.webgl.make_static(outpath=op.join(derivatives, 'pycortex', subject),
    # data=ds)
    cortex.webgl.make_static(outpath=op.join(derivatives, 'pycortex',
                                             f'{subject}.{session}', 'light'),
                             data={
                                 'ODCs': images['zmap'],
                                 'PRF polar angle': images['angle']
                             },
                             anonymize=False,
                             sampler='trilinear')
new_shape = np.array(zmap.shape)
new_shape[1] *= 5
new_shape[0] *= 1.1
zmap = image.resample_img(zmap, zmap.affine, new_shape, fill_value=np.nan)
zmap.to_filename('/tmp/zmap.nii.gz')
transform = cortex.xfm.Transform(np.identity(4), zmap.get_filename())
transform.save(pc_subject, 'identity.zmap.extended')

mask = image.math_img('np.abs(zmap)', zmap=zmap)
mask = mask.get_data().T

zmap_vox = cortex.Volume2D(zmap.get_data().T,
                           mask,
                           pc_subject,
                           'identity.zmap.extended',
                           vmin=-3.5,
                           vmax=3.5,
                           vmin2=0,
                           vmax2=3,
                           cmap='BuBkRd_alpha_2D')
cds_vox = cortex.Volume(coordinates, pc_subject, 'identity.zmap.extended')

curvature_v = cortex.db.get_surfinfo(pc_subject)

random_data = np.random.rand(*curvature_v.data.shape)
random_data_v = cortex.Vertex(random_data, pc_subject)

ds = cortex.Dataset(zmap=zmap_vox,
                    voxels=cds_vox,
                    curvature=curvature_v,
                    random_data=random_data_v)
示例#8
0
def main(derivatives, subject, session):

    pc_subject = 'odc.{}'.format(subject)

    left, right = cortex.db.get_surf('odc.{}'.format(subject), 'fiducial')
    left_surface = cortex.polyutils.Surface(left[0], left[1])
    right_surface = cortex.polyutils.Surface(right[0], right[1])

    max_wavelengths = {}
    max_orientations = {}
    zmaps = {}

    for hemi, surf in zip(['lh', 'rh'], [left_surface, right_surface]):
        energies = op.join(
            derivatives, 'zmap_spatfreq', 'sub-{subject}', 'ses-{session}',
            'func',
            'sub-{subject}_ses-{session}_hemi-{hemi}_energies.pkl').format(
                subject=subject, session=session, hemi=hemi)
        xy = pd.read_pickle(
            op.join(derivatives, 'coordinate_patches', 'sub-{subject}', 'anat',
                    'sub-{subject}_hemi-{hemi}_coordinatepatch.pkl').format(
                        **locals()))

        energies = pd.read_pickle(energies)
        energies = energies.loc[:, ~energies.isnull().any(0)]

        max_frequency = energies.groupby(['depth', 'frequency']).sum().groupby(
            'depth', as_index=True).apply(
                lambda d: d.reset_index('depth', drop=True).idxmax())

        max_wavelengths[hemi] = 1. / max_frequency

        max_orientations[hemi] = []

        zmaps[hemi] = []

        for depth, d in energies.groupby('depth'):
            tmp = d.loc[(depth, max_frequency.loc[depth]), :].idxmax()
            tmp = tmp.apply(lambda x: x[2] if not x is np.nan else None)
            tmp = pd.DataFrame(tmp, columns=pd.Index([depth], name='depth')).T
            tmp.columns = energies.columns
            max_orientations[hemi].append(tmp)

            zmap = op.join(derivatives, 'sampled_giis', 'sub-{subject}', 'ses-{session}',
                           'func', 'sub-{subject}_ses-{session}_left_over_right_desc-zmap-depth-{depth}_hemi-{hemi}.gii'). \
                format(**locals())
            zmaps[hemi].append(surface.load_surf_data(zmap))

        zmaps[hemi] = np.array(zmaps[hemi])
        max_orientations[hemi] = pd.concat(max_orientations[hemi])

        ss = pd.DataFrame([], columns=np.arange(surf.pts.shape[0]))
        max_wavelengths[hemi] = pd.concat((ss, max_wavelengths[hemi])).values
        max_orientations[hemi] = pd.concat((ss, max_orientations[hemi])).values

    print(max_wavelengths['lh'].shape, max_wavelengths['rh'].shape)
    max_wavelengths = np.concatenate(
        [max_wavelengths['lh'], max_wavelengths['rh']], axis=-1)
    max_orientations = np.concatenate(
        [max_orientations['lh'], max_orientations['rh']], axis=-1)

    print(zmaps['lh'].shape, zmaps['rh'].shape)
    zmaps = np.concatenate([zmaps['lh'], zmaps['rh']], axis=-1)

    images = {}
    images['wavelength'] = cortex.Vertex(max_wavelengths,
                                         'odc.{}'.format(subject),
                                         vmin=0,
                                         vmax=10)
    images['orientation'] = cortex.Vertex(max_orientations,
                                          'odc.{}'.format(subject),
                                          vmin=0,
                                          vmax=np.pi,
                                          cmap='hsv')

    images['zmap'] = cortex.Vertex(zmaps,
                                   'odc.{}'.format(subject),
                                   vmin=-3,
                                   vmax=3)

    layout = BIDSLayout(op.join(derivatives, 'tsnr'), validate=False)
    veins = layout.get(subject=subject,
                       session=session,
                       suffix='invtsnr',
                       extension='nii.gz',
                       return_type='file')
    veins = image.mean_img(veins)

    t1w = cortex.db.get_anat(pc_subject, 'raw')
    veins = image.resample_to_img(veins, t1w)

    images['veins'] = cortex.Volume(veins.get_data().T,
                                    subject=pc_subject,
                                    xfmname='identity',
                                    vmin=0,
                                    vmax=2)

    zmap = '{derivatives}/modelfitting/glm7/sub-{subject}/ses-{session}/func/sub-{subject}_ses-{session}_left_over_right_zmap.nii.gz'.format(
        **locals())

    t1w = get_bids_file(derivatives, 'averaged_mp2rages', 'anat', subject,
                        'T1w', 'anat', 'average')

    zmap = image.resample_to_img(zmap, t1w)

    transform = cortex.xfm.Transform(np.identity(4), t1w)

    if not np.in1d(subject, ['01', '06']):
        transform.save(pc_subject, 'identity.t1w', 'magnet')

    mask = image.math_img('np.abs(zmap)', zmap=zmap)

    zmap = zmap.get_data().T
    zmap[zmap == 0] = np.nan
    mask = mask.get_data().T
    images['zmap'] = cortex.Volume2D(zmap,
                                     mask,
                                     pc_subject,
                                     'identity.t1w',
                                     vmin=-3,
                                     vmax=3,
                                     vmin2=0,
                                     vmax2=3,
                                     cmap='BuBkRd_alpha_2D')
    ds = cortex.Dataset(**images)

    cortex.webshow(ds)
示例#9
0
import numpy as np
import matplotlib.pyplot as plt

subject = "S1"
xfm = "fullhead"

# Creating two different test datasets that are both the same shape as this
# transform with one entry for each voxel
# The matrices have just been reordered in different ways so that they make
# gradients across the brain in different directions
test_data1 = np.arange(31 * 100 * 100).reshape((31, 100, 100), order='C')
test_data2 = np.arange(31 * 100 * 100).reshape((31, 100, 100), order='F')

# This creates a 2D Volume object for both of our test datasets for the given
# subject and transform
vol_data = cortex.Volume2D(test_data1, test_data2, subject, xfm)
cortex.quickshow(vol_data, with_colorbar=False)
plt.show()

# You can alter the minimum and maximum values shown on the colorbar and this
# can be done separately for the two different datasets
vol_data = cortex.Volume2D(test_data1,
                           test_data2,
                           subject,
                           xfm,
                           vmin=np.mean(test_data1),
                           vmax=np.max(test_data1),
                           vmin2=np.min(test_data2),
                           vmax2=np.mean(test_data2))
cortex.quickshow(vol_data, with_colorbar=False)
plt.show()
示例#10
0
#contains RGBA colors for each voxel in a volumetric dataset
# volume for polar angles
vrgba = cortex.VolumeRGB(red=rgb[..., 0].T,
                         green=rgb[..., 1].T,
                         blue=rgb[..., 2].T,
                         subject='sub-' + sub_num,
                         alpha=alpha,
                         xfmname='fmriprep_T1')

# volume for ecc
vecc = cortex.Volume2D(eccentricity.T,
                       rsq.T,
                       'sub-' + sub_num,
                       'fmriprep_T1',
                       vmin=0,
                       vmax=10,
                       vmin2=rsq_threshold,
                       vmax2=1.0,
                       cmap='BROYG_2D')

# volume for size
vsize = cortex.Volume2D(size.T,
                        rsq.T,
                        'sub-' + sub_num,
                        'fmriprep_T1',
                        vmin=0,
                        vmax=10,
                        vmin2=rsq_threshold,
                        vmax2=1.0,
                        cmap='BROYG_2D')
示例#11
0
#contains RGBA colors for each voxel in a volumetric dataset
# volume for polar angles
vrgba = cortex.VolumeRGB(red=rgb[..., 0].T,
                         green=rgb[..., 1].T,
                         blue=rgb[..., 2].T,
                         subject='sub-' + sub_num,
                         alpha=alpha,
                         xfmname='fmriprep_T1')

# volume for ecc
vecc = cortex.Volume2D(eccentricity.T,
                       rsq.T,
                       'sub-' + sub_num,
                       'fmriprep_T1',
                       vmin=0,
                       vmax=10,
                       vmin2=rsq_threshold,
                       vmax2=1.0,
                       cmap='BROYG_2D')

# volume for size
vsize = cortex.Volume2D(size.T,
                        rsq.T,
                        'sub-' + sub_num,
                        'fmriprep_T1',
                        vmin=0,
                        vmax=10,
                        vmin2=rsq_threshold,
                        vmax2=1.0,
                        cmap='BROYG_2D')