示例#1
0
            center_anchor = 1

            if subject_id == 'lausanne125':
                parc_file = os.path.join(
                    '/Applications/freesurfer/subjects/', subject_id, 'label',
                    hemi + '.myaparc_' + str(parc_scale) + '.annot')
            elif subject_id == 'fsaverage':
                parc_file = os.path.join(
                    '/Users/lindenmp/Google-Drive-Penn/work/research_projects/normative_neurodev_cs_t1/figs_support/Parcellations/FreeSurfer5.3/fsaverage/label/',
                    hemi + '.Schaefer2018_' + str(parc_scale) +
                    'Parcels_17Networks_order.annot')

            brain_plot(roi_data,
                       parcel_names,
                       parc_file,
                       fig_str,
                       subject_id=subject_id,
                       hemi=hemi,
                       color='coolwarm',
                       center_anchor=center_anchor)

# # Figures

# In[18]:

f, ax = plt.subplots(1)
f.set_figwidth(1)
f.set_figheight(1)

limit = 3
sns.heatmap(np.zeros((1, 1)),
            annot=False,
示例#2
0
for pc in np.arange(0,n_components):
    roi_data = pca.components_[pc,:]
    for hemi in ('lh', 'rh'):
        fig_str = hemi + '_' + metric + '_pc_' + str(pc)
        figs_to_delete.append('ventral_'+fig_str)
        figs_to_delete.append('med_'+fig_str)
        figs_to_delete.append('lat_'+fig_str)

        if subject_id == 'lausanne125':
            parc_file = os.path.join('/Applications/freesurfer/subjects/', subject_id, 'label', hemi + '.myaparc_' + str(parc_scale) + '.annot')
        elif subject_id == 'fsaverage':
            parc_file = os.path.join('/Users/lindenmp/Google-Drive-Penn/work/research_projects/normative_neurodev_cs_t1/figs_support/Parcellations/FreeSurfer5.3/fsaverage/label/',
                                     hemi + '.Schaefer2018_' + str(parc_scale) + 'Parcels_17Networks_order.annot')

        # project subject's data to vertices
        brain_plot(roi_data, parcel_names, parc_file, fig_str, subject_id = subject_id, hemi = hemi, surf = 'inflated', showcolorbar = False)


# In[21]:


for pc in np.arange(0,n_components):
    f, axes = plt.subplots(2, 2)
    f.set_figwidth(3)
    f.set_figheight(4)
    plt.subplots_adjust(wspace=0, hspace=-0.465)

    print(metric, pc)
    # column 0:
    fig_str = 'lh_'+metric+'_pc_'+str(pc)+'.png'
    try:
        if subject_id == 'lausanne125':
            parc_file = os.path.join(
                '/Applications/freesurfer/subjects/', subject_id, 'label',
                hemi + '.myaparc_' + str(parc_scale) + '.annot')
        elif subject_id == 'fsaverage':
            parc_file = os.path.join(
                '/Users/lindenmp/Dropbox/Work/ResProjects/NormativeNeuroDev_CrossSec_T1/figs_support/Parcellations/FreeSurfer5.3/fsaverage/label/',
                hemi + '.Schaefer2018_' + str(parc_scale) +
                'Parcels_17Networks_order.annot')

        # project subject's data to vertices
        brain_plot(roi_data,
                   parcel_names,
                   parc_file,
                   fig_str,
                   subject_id=subject_id,
                   hemi=hemi,
                   surf='inflated',
                   center_anchor=1,
                   color='hot')

# In[37]:

for pheno in phenos:
    for metric in metrics:
        for hemi in ('lh', 'rh'):
            print(pheno, metric)
            # Plots of univariate pheno correlation
            fig_str = hemi + '_' + pheno + '_' + metric + '_z'
            roi_data = df_pheno_z.loc[pheno].filter(regex=metric,
                                                    axis=0)['coef'].values