The following are instructions to use MSM transformations to resample labels and fields between BigBrain from/to the CIVET MNI152 surface template, hereafter designated as MNI152.

MNI152 TO BIGBRAIN

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.

MSM spheres needed for resampling

$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

Invert $outmeshMSM

wb_command -surface-sphere-project-unproject $refmesh $outmeshMSM $inmesh $outmeshMSM_inverted

Input: CIVET labels (example: AAL, color map conversions pre-scripted in this example / are not trivial)

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

Transform labels from MNI152 to BigBrain surface

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>

Convert output to .txt

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

Convert output to FS .annot

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

Visualize

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

BIGBRAIN TO MNI152

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.

Transform metric map from BigBrain to MNI152 (example: lh.curv)

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

Visualize

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