Resample labels from MNI152 surface to BIGBRAIN surface using spherical maps from MSM. This is useful to transfer labels defining a surface parcellation on MNI152 to an individual brain like BIGBRAIN.
$BBhome = BigBrainRelease.2015/BigBrainWarp_Support (defines your base directory)
$inmesh = $BBhome/BigBrain_to_MNI152/spheres/lh.BigBrain.rot.fsavg.sphere.surf.gii
$refmesh = $BBhome/BigBrain_to_MNI152/spheres/lh.MNI152.rot.fsavg.sphere.surf.gii
$outmeshMSM = $BBhome/BigBrain_to_MNI152/spheres/lh.sphere_MNI152_rsled_like_BigBrain.sphere.reg.surf.gii
$outmeshMSM_inverted = $BBhome/BigBrain_to_MNI152/spheres/lh.sphere_BigBrain_rsled_like_MNI152.sphere.reg.surf.gii
wb_command -surface-sphere-project-unproject $refmesh $outmeshMSM $inmesh $outmeshMSM_inverted
cd $BBhome/BigBrain_to_MNI152/inmap_MNI152_outmap_BigBrain/input
wb_command -cifti-convert -from-text icbm_avg_mid_mc_AAL_left.txt lh.AAL.template.dlabel.nii lh.AAL.dlabel.nii
wb_command -cifti-separate lh.AAL.dlabel.nii COLUMN -label CORTEX_LEFT lh.AAL.label.gii
cd $BBhome/BigBrain_to_MNI152/inmap_MNI152_outmap_BigBrain
wb_command -label-resample input/lh.AAL.label.gii $outmeshMSM_inverted $inmesh BARYCENTRIC output/lh.AAL.label.gii
wb_command -set-structure output/lh.AAL.label.gii CORTEX_LEFT
Sometimes you need to view / edit .label.gii and swap for better midline visibility, replace Label 0 row with:
    <Label Key="0" Red="0" Green="0" Blue="0" Alpha="0"><![CDATA[Unknown]]></Label>
cd $BBhome/BigBrain_to_MNI152/inmap_MNI152_outmap_BigBrain/output
wb_command -cifti-create-label -left-label lh.AAL.label.gii lh.AAL.dlabel.nii
wb_command -cifti-convert -to-text lh.AAL.dlabel.nii lh.AAL.txt
cd $BBhome/BigBrain_to_MNI152/inmap_MNI152_outmap_BigBrain/output
mris_convert --annot lh.AAL.label.gii $BBhome/white_surfaces/lh.BigBrain.white.surf.gii ./lh.AAL.annot
cd $BBhome/BigBrain_to_MNI152/inmap_MNI152_outmap_BigBrain/output
freeview -f $BBhome/white_surfaces/lh.BigBrain.white.surf.gii:annot=lh.AAL.annot
brain-view $BBhome/white_surfaces/lh.BigBrain.white.surf.obj lh.AAL.txt
Resample a surface field defined on BIGBRAIN surface to the MNI152 surface using spherical maps from MSM. This is useful to resample surface fields on an individual brain like BIGBRAIN to a common template like MNI152 for group comparisons.
cd $BBhome/BigBrain_to_MNI152/inmap_BigBrain_outmap_MNI152
mris_convert -c input/lh.BigBrain.curv $BBhome/white_surfaces/lh.BigBrain.white.surf.gii input/lh.BigBrain.curv.shape.gii
wb_command -metric-resample input/lh.BigBrain.curv.shape.gii $outmeshMSM $refmesh BARYCENTRIC output/lh.BigBrain.curv_rsled_to_MNI152.shape.gii
wb_command -set-structure output/lh.BigBrain.curv_rsled_to_MNI152.shape.gii CORTEX_LEFT
wb_command -cifti-create-dense-scalar -left-metric output/lh.BigBrain.curv_rsled_to_MNI152.shape.gii output/lh.BigBrain.curv_rsled_to_MNI152.dscalar.nii
wb_command -cifti-convert -to-text output/lh.BigBrain.curv_rsled_to_MNI152.dscalar.nii output/lh.BigBrain.curv_rsled_to_MNI152.txt
cd $BBhome/BigBrain_to_MNI152/inmap_BigBrain_outmap_MNI152/output
brain-view $BBhome/white_surfaces/lh.MNI152.white.surf.obj lh.BigBrain.curv_rsled_to_MNI152.txt