Different labels in aparc+seg files in same fmriprep project

Dear fmriprep developers,

I ran fmriprep on a 60+ participants study (using same version 1.1.4 and same command).
The freesurfer parcellation label files seem to vary between participants, where some have the 1000-1035 parcellation for GM and other participants have 11100-11175 parcellations. My understanding from the FS wiki is that those result from different flags when running mri_aparc2aseg.

Is there a way to ensure that all the individuals processed have the same parcellation?
The difference between atlases (and non trivial mapping between atlases) pose challenges for using the label files on the study level (i.e. between participants).

Thanks,
Nir

Hi Nir,

We don’t pass any arguments to recon-all that should affect how mri_aparc2aseg is called. Did you use pre-computed FreeSurfer directories for some subjects and not others? Could you share your commands you used for fMRIPrep?

Thanks,
Chris

Sure.

Here’s and example call (from copied from report)

/usr/local/miniconda/bin/fmriprep /data /out participant --ignore=slicetiming --participant_label sub-drisc26 sub-drisc27 sub-drisc28 sub-drisc30 sub-drisc31 sub-drisc32 sub-drisc33 sub-drisc34 sub-drisc35 -w /scratch

I ran the script for a few participants at a time. The command was always the same (other than participant-labels of course). I started with nothing but my data organized in BIDS format after transforming dicoms. So all FS related directories were created by fmriprep calls.

Additional info that might be useful - from that call, participants 26, 28, 30, 31 had the 10xx parcellation and 27, 32, 33, 34,34, 35 had the 111xx parcellation.

I wonder if FS runs iteratively to the best granularity it can given some estimate of T1 quality. In which case it might call itself with additional flags for some participants and not others.

Could you try grep -rI mri_aparc2aseg /out/freesurfer/sub-*/scripts/? That may help show differences in execution parameters.

Not sure what exactly am I looking for.
It seems that there are multiple executions per participants, some with no arguments and others with --a2009s and others with --annot aparc.DKTatlas --o mri/aparc.DKTatlas+aseg.mgz

The number of commands per participant changes and so is the number of repetitions for the different argument versions.

Will it be helpful to paste some output here?
Also there seem to be lines starting with recon-all.cmd, recon-all.log and recon-all.local-copy. Are the .cmd the most relevant ones?

Perhaps you could link to the FreeSurfer wiki page you were referring to? Do they indicate the different parameters that might produce differing labels? Because we could then look for those parameters in the output.

I realize that my previous grep command was too broad, but I don’t have a FreeSurfer directory to look at myself on my laptop. But from what you say, we can limit ourselves to subjects 26 and 27, as they are representatives of the two groups.

https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/AnatomicalROI/FreeSurferColorLUT
This is basically description of the different possible labels and options.
The --a2009s flag is consistent with the 111xx label set. It seems from the log that we run it for all participants with that flag. Maybe it fails for some and then falls back to the simpler label version which the --a2009s is trying to replace.

/freesurfer/sub-drisc26/scripts/recon-all.cmd : mri_aparc2aseg --s sub-drisc26 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt

/freesurfer/sub-drisc26/scripts/recon-all.cmd : mri_aparc2aseg --s sub-drisc26 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt

/freesurfer/sub-drisc26/scripts/recon-all.cmd : mri_aparc2aseg --s sub-drisc26 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt --a2009s

/freesurfer/sub-drisc26/scripts/recon-all.cmd : mri_aparc2aseg --s sub-drisc26 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt --a2009s

/freesurfer/sub-drisc26/scripts/recon-all.cmd : mri_aparc2aseg --s sub-drisc26 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt --annot aparc.DKTatlas --o mri/aparc.DKTatlas+aseg.mgz

/freesurfer/sub-drisc26/scripts/recon-all.cmd : mri_aparc2aseg --s sub-drisc26 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt --annot aparc.DKTatlas --o mri/aparc.DKTatlas+aseg.mgz

/freesurfer/sub-drisc26/scripts/recon-all.cmd : mri_aparc2aseg --s sub-drisc26 --labelwm --hypo-as-wm --rip-unknown --volmask --o mri/wmparc.mgz --ctxseg aparc+aseg.mgz

/freesurfer/sub-drisc26/scripts/recon-all.cmd : mri_aparc2aseg --s sub-drisc26 --labelwm --hypo-as-wm --rip-unknown --volmask --o mri/wmparc.mgz --ctxseg aparc+aseg.mgz

/freesurfer/sub-drisc26/scripts/recon-all.log : mri_aparc2aseg --s sub-drisc26 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt

/freesurfer/sub-drisc26/scripts/recon-all.log : mri_aparc2aseg --s sub-drisc26 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt

/freesurfer/sub-drisc26/scripts/recon-all.log : mri_aparc2aseg --s sub-drisc26 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt --a2009s

/freesurfer/sub-drisc26/scripts/recon-all.log : mri_aparc2aseg --s sub-drisc26 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt --a2009s

/freesurfer/sub-drisc26/scripts/recon-all.log : mri_aparc2aseg --s sub-drisc26 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt --annot aparc.DKTatlas --o mri/aparc.DKTatlas+aseg.mgz

/freesurfer/sub-drisc26/scripts/recon-all.log : mri_aparc2aseg --s sub-drisc26 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt --annot aparc.DKTatlas --o mri/aparc.DKTatlas+aseg.mgz

/freesurfer/sub-drisc26/scripts/recon-all.log : mri_aparc2aseg --s sub-drisc26 --labelwm --hypo-as-wm --rip-unknown --volmask --o mri/wmparc.mgz --ctxseg aparc+aseg.mgz

/freesurfer/sub-drisc26/scripts/recon-all.log : mri_aparc2aseg --s sub-drisc26 --labelwm --hypo-as-wm --rip-unknown --volmask --o mri/wmparc.mgz --ctxseg aparc+aseg.mgz

/freesurfer/sub-drisc27/scripts/recon-all.local-copy : set xopts = fsr-getxopts **mri_aparc2aseg** $XOptsFile;

/freesurfer/sub-drisc27/scripts/recon-all.local-copy : set cmd = ( mri_aparc2aseg --s $subjid --volmask --aseg aseg.presurf.hypos \

/freesurfer/sub-drisc27/scripts/recon-all.local-copy : set CMDF = mri_aparc2aseg _${parc}.cmd

/freesurfer/sub-drisc27/scripts/recon-all.local-copy : set xopts = fsr-getxopts **mri_aparc2aseg** $XOptsFile;

/freesurfer/sub-drisc27/scripts/recon-all.local-copy : set cmd = ( mri_aparc2aseg --s $subjid --labelwm --hypo-as-wm --rip-unknown \

/freesurfer/sub-drisc27/scripts/recon-all.local-copy : mri_aparc2aseg

/freesurfer/sub-drisc27/scripts/recon-all.cmd : mri_aparc2aseg --s sub-drisc27 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt

/freesurfer/sub-drisc27/scripts/recon-all.cmd : mri_aparc2aseg --s sub-drisc27 --labelwm --hypo-as-wm --rip-unknown --volmask --o mri/wmparc.mgz --ctxseg aparc+aseg.mgz

/freesurfer/sub-drisc27/scripts/recon-all.cmd : mri_aparc2aseg --s sub-drisc27 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt

/freesurfer/sub-drisc27/scripts/recon-all.cmd : mri_aparc2aseg --s sub-drisc27 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt --a2009s

/freesurfer/sub-drisc27/scripts/recon-all.cmd : mri_aparc2aseg --s sub-drisc27 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt --annot aparc.DKTatlas --o mri/aparc.DKTatlas+aseg.mgz

/freesurfer/sub-drisc27/scripts/recon-all.log : mri_aparc2aseg --s sub-drisc27 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt

/freesurfer/sub-drisc27/scripts/recon-all.log : mri_aparc2aseg --s sub-drisc27 --labelwm --hypo-as-wm --rip-unknown --volmask --o mri/wmparc.mgz --ctxseg aparc+aseg.mgz

/freesurfer/sub-drisc27/scripts/recon-all.log : mri_aparc2aseg --s sub-drisc27 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt

/freesurfer/sub-drisc27/scripts/recon-all.log : mri_aparc2aseg --s sub-drisc27 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt --a2009s

/freesurfer/sub-drisc27/scripts/recon-all.log : mri_aparc2aseg --s sub-drisc27 --volmask --aseg aseg.presurf.hypos --relabel mri/norm.mgz mri/transforms/talairach.m3z /opt/freesurfer/average/RB_all_2016-05-10.vc700.gca mri/aseg.auto_noCCseg.label_intensities.txt --annot aparc.DKTatlas --o mri/aparc.DKTatlas+aseg.mgz

Hi Chris,

flagging this thread again. Any insight from the files above?
Is this the expected/desired behavior for the parcellation process?

thanks,
nir

Hi Nir,

Can you verify that in freesurfer/sub-26 and freesurfer/sub-27, all three of the following exist?

  • mri/aparc+aseg.mgz
  • mri/aparc.a2009s+aseg.mgz
  • mri/aparc.DKTatlas+aseg.mgz

I suspect that what’s happening is that when we look for these files, we are not sorting, and therefore sometimes we are selecting the wrong things. If you have some missing, there might be a different problem.

Chris

I can confirm that the 3 files exist for every single subject in the freesurfer folder.

Okay. The problem is almost certainly sorting. I’ll open an issue on fMRIPrep. Would you be interested in contributing a patch?

1 Like