Freesurfer overlapping label files

Hi all,

I am having trouble running mris_label2annot

Currently I have extracted individually estimated .mgh overlay files from Li 2019 et a., Performing group-level functional image analyses based on homologous functional regions mapped in individuals, software suite in matlab. These individual .mgh files are for every ROI from every one of Yeo 2011’s 17 network parcellation scheme.

I then take the .mgh files and convert them into label files with the following script.

if [[ $# -lt 1 ]]; then
cat <<USAGE
$0 <inDir> <subjects> <SUBJECTS_DIR>
inDir - input directory --path to matchrate folder from li 2019
subjects - list of subjects to run
SUBJECTS_DIR - Freesurfer SUBJECTS_DIR
USAGE
exit 1
fi

# echo inputs
echo "input 1 is ${1}"
echo "input 2 is ${2}"
echo "input 3 is ${3}"

# parse inputs
inDir=$1
subjects=$2
subDir=$3

networks='Net_10 Net_11 Net_12 Net_13 Net_14 Net_15 Net_16 Net_17 Net_18 Net_19
Net_2 Net_3 Net_4 Net_5 Net_6 Net_7 Net_8 Net_9'

export SUBJECTS_DIR=${subDir} # gather the freesurfer subjects directory

# loop over subjects
for sub in ${subjects}; do
for net in ${networks}; do

# extract networks masks
masks=$(find ${inDir}/Indi_Matched_ROIs/${net}/${sub} -iname '*Net_*.mgh')


# loop over masks
for mask in ${masks}; do
netMaskName=$(basename ${mask} .mgh) # gather mask name by network number (Yeo 2011)
hemi=$(echo ${mask} | grep -Eo '[lr]h') # designate the hemisphere

# resample to native
mri_surf2surf --srcsubject fsaverage4 \
--srcsurfval ${mask} \
--trgsubject ${sub} \
--trgsurfval ${inDir}/Indi_Matched_ROIs/${net}/${sub}/${netMaskName}.mgh \
--hemi ${hemi} \
--cortex

mri_vol2label --i ${inDir}/Indi_Matched_ROIs/${net}/${sub}/${netMaskName}.mgh \
--id 1 \
--l ${inDir}/Indi_Matched_ROIs/${net}/${sub}/${netMaskName}.label \
--surf ${sub} ${hemi} white

echo
echo --------------------------------------------
echo -- START: creating label files ${sub} --
echo --------------------------------------------
echo

mri_label2label --srclabel ${inDir}/Indi_Matched_ROIs/${net}/${sub}/${netMaskName}.label \
--s ${sub} \
--hemi ${hemi} \
--trglabel ${subDir}/${sub}/label/${sub}_${netMaskName}_dil2.label \
--regmethod surface

done
done
done

After this script runs to completion, I then run mris_label2annot with the following command

mris_label2annot --s sub-DAEK --hemi rh \
--ctab /mnt/c/Users/Ben/Documents/GitHub/parcellationPipeline/li2019_to_dti/yeo2011nodesLUT.txt \
--a yeo2011nodes \
--surf orig \
--maxstatwinner \
--l Net_10_ROIs_1_rh.label --l Net_11_ROIs_1_rh.label --l Net_12_ROIs_1_rh.label --l Net_12_ROIs_2_rh.label \
--l Net_13_ROIs_1_rh.label --l Net_13_ROIs_2_rh.label --l Net_13_ROIs_3_rh.label --l Net_13_ROIs_4_rh.label \
--l Net_14_ROIs_1_rh.label --l Net_14_ROIs_2_rh.label --l Net_14_ROIs_3_rh.label --l Net_14_ROIs_4_rh.label \
--l Net_14_ROIs_5_rh.label --l Net_15_ROIs_1_rh.label --l Net_16_ROIs_1_rh.label --l Net_16_ROIs_2_rh.label \
--l Net_16_ROIs_3_rh.label --l Net_17_ROIs_1_rh.label --l Net_17_ROIs_2_rh.label --l Net_17_ROIs_3_rh.label \
--l Net_17_ROIs_4_rh.label --l Net_18_ROIs_1_rh.label --l Net_18_ROIs_2_rh.label \
--l Net_18_ROIs_3_rh.label --l Net_18_ROIs_4_rh.label --l Net_19_ROIs_1_rh.label --l Net_2_ROIs_1_rh.label \
--l Net_2_ROIs_2_rh.label --l Net_3_ROIs_1_rh.label --l Net_3_ROIs_2_rh.label --l Net_3_ROIs_3_rh.label \
--l Net_4_ROIs_1_rh.label --l Net_5_ROIs_1_rh.label --l Net_5_ROIs_2_rh.label --l Net_6_ROIs_1_rh.label \
--l Net_6_ROIs_2_rh.label --l Net_6_ROIs_3_rh.label --l Net_7_ROIs_1_rh.label --l Net_7_ROIs_2_rh.label \
--l Net_8_ROIs_1_rh.label --l Net_8_ROIs_2_rh.label --l Net_8_ROIs_3_rh.label --l Net_8_ROIs_4_rh.label \
--l Net_8_ROIs_5_rh.label --l Net_8_ROIs_6_rh.label --l Net_9_ROIs_1_rh.label --l Net_9_ROIs_2_rh.label \
--l Net_9_ROIs_2_rh.label --l Net_9_ROIs_3_rh.label --l Net_9_ROIs_4_rh.label --l Net_9_ROIs_5_rh.label \
--l Net_9_ROIs_6_rh.label --l Net_7_ROIs_3_rh.label

However, the label files are overlapping. Is there a way to fix this by thresholding???

Thanks,

Ben