Misalignment Issues with mcribs-Generated Surfaces in nibabies

Hi Neurostars,

I’m using nibabies with the mcribs flag to process an edited aseg file. mcribs generates surface files based on the aseg provided, and the results look better than those from infant surfer. Recently, I am trying to map a volume file in native space (.nii.gz) to a surface (fsaverage), but I’ve encountered a strange misalignment issue with the surface directions. Here’s what I tried:

Approach 1:

  1. I used mris_convert to convert surface into .surf.gii files. For example: mris_convert rh.midthickness rh.midthickness.surf.gii
  2. wb_command -volume-to-surface-mapping src.nii.gz lh.midthickness.surf.gii out_lh.func.gii -ribbon-constrained lh.white.surf.gii lh.pial.surf.gii (and the same for right hemisphere)
  3. looks like mcribs generate more nodes that infant freesurfer, so need to resample (mcribs provided a reg2.gii):
wb_command -metric-resample out_lh.func.gii \
    lh.sphere.reg2.gii \
    Fsaverage.L.sphere.32k_fs_LR.surf.gii \
    BARYCENTRIC \
    out_lh.32k_fs_LR.func.gii
  1. wb_command -cifti-create-dense-from-template Fsaverage.MyelinMap_BC.32k_fs_LR.dscalar.nii out_combined.32k_fs_LR.dscalar.nii -metric CORTEX_LEFT out_lh.32k_fs_LR.func.gii -metric CORTEX_RIGHT out_rh.32k_fs_LR.func.gii

This approach got wrong from the first step, for example, rh.midthickness to rh.midthickness.surf.gii. This generated a surface with incorrect directiona (see below), this only happens with surfaces generated by mcribs and regular infant freesurfer surface files have no issues. As a result, sampling the .nii.gz (volume) will be incorrect due to the wrong surface.

Approach 2 (using mri_vol2surf):

  1. mri_vol2surf --src src.nii.gz --out out_lh.mgh --regheader sub-1053 --projfrac 0.5 --hemi lh
  2. mri_convert out_lh.mgh out.func.gii
  3. the following is similar to approach 1 (resampling and combine left and right hemisphere)
    This approach got wrong in the step2 (mri_convert out_lh.mgh out.func.gii), I got the out.func.gii in wrong direction as well.

I’m wondering if anyone can help with these questions:

  1. Why do mcribs-generated surfaces look fine with freesurfer, but show directional issues when converted to gifti file?
  2. Is there a solution to resolve this misalignment issue? do I miss something and did something wrong?
  3. Does nibabies, when using the mcribs flag, use these surfaces generated by mcribs to map functional files (e.g., resting state data) into fsLR_den-91k_bold.dtseries.nii, similar to fmriprep? If so, how does nibabies avoid this problem?

I’d appreciate any insights or advice on resolving this issue. Thanks in advance!