External Email - Use Caution
Dear FreeSurfer experts,
Happy new year! I hope you all are doing well!
I recently wrote the following question to the HCP-User Google Group and was directed to cross-post in the FreeSurfer list server by Dr. Matt Glasser.
I have created individualized rs-fMRI maps as dlabel fsLR 32k space using Kong et al. (2021)https://secure-web.cisco.com/1YPDKOJqHMz1SpGXNYNBBQj7WFDd_y7LiRNZ1juccRfmSknOgVmv0CGead-UEAuClUu9gDWdpD0mO4luV1U9TT82sk3llNNzqN5cQoKQj45bsBjx_MiD7OvSjTHnxJ64b5ESABXaN-1JrWL9dTSnEv723jPEnV8adEwrcWnEdaGgDSTu6sooZ08S_-bqNgbBl3eZWbffiV1qoLZRMe78tLPlOXZRVZVlqTSj_K6lmQDBASf9PX2W16KgxAQPaMcjQJVNkt00spEKtNMAjjy9R4Dhppfsno4vXb4SS4cnnKHjLuQGh-10mu1M4JlNW-SCxZykftCebjBDz_72ZGbjleQ/https%3A%2F%2Fpubmed.ncbi.nlm.nih.gov%2F33942058%2F and I would like to resample them to a FreeSurfer annotation in anatomical space without losing individual parcel assignments. The method below resamples the maps but loses parcel assignments.
echo "running -cifti-seperate" wb_command \ -cifti-separate \ $dlabel_in \ COLUMN \ -label CORTEX_LEFT $dlabel_dir/${dlabel_in_base_name}.L.fsLR_32k.label.gii \ -label CORTEX_RIGHT $dlabel_dir/${dlabel_in_base_name}.R.fsLR_32k.label.gii
for hemi in L R; do
gii_in=$dlabel_dir/${dlabel_in_base_name}.${hemi}.fsLR_32k.label.gii sphere_in=$standard_dir/resample_fsaverage/fs_LR-deformed_to-fsaverage.${hemi}.sphere.32k_fs_LR.surf.gii sphere_out=$standard_dir/resample_fsaverage/fsaverage_std_sphere.${hemi}.164k_fsavg_${hemi}.surf.gii gii_out=$dlabel_dir/${dlabel_in_base_name}.${hemi}.fsaverage_164k.label.gii area_in=$standard_dir/resample_fsaverage/fs_LR.${hemi}.midthickness_va_avg.32k_fs_LR.shape.gii area_out=$standard_dir/resample_fsaverage/fsaverage.${hemi}.midthickness_va_avg.164k_fsavg_${hemi}.shape.gii
echo "running -label-resample for "$hemi"" wb_command \ -label-resample \ $gii_in \ $sphere_in $sphere_out \ ADAP_BARY_AREA \ $gii_out \ -area-metrics \ $area_in $area_out
hemilower=$(echo $hemi | tr '[:upper:]' '[:lower:]') fshemi=${hemilower}h annot_out=${out_dir}/${fshemi}.${dlabel_in_base_name}.fsaverage.annot
echo "running mri_convert for "$fshemi"" mris_convert \ --annot $gii_out \ $FREESURFER_HOME/subjects/fsaverage/surf/${fshemi}.pial \ $annot_out
echo "running mri_surf2surf" mri_surf2surf \ --srcsubject fsaverage \ --trgsubject $sub_id \ --hemi $fshemi \ --sval-annot $annot_out \ --tval $SUBJECTS_DIR/$sub_id/label/${fshemi}.${dlabel_in_base_name}.${sub_id}.annot \ --sd ${SUBJECTS_DIR}
mri_segstats \ --annot $sub_id $fshemi Ind_parcellation_MSHBM_${sub_num}_w20_MRF5.${sub_id} \ --i $SUBJECTS_DIR/$sub_id/surf/${fshemi}.thickness \ --sum ${out_dir}/${fshemi}.Ind_parcellation_MSHBM_${sub_num}_w20_MRF5.${sub_id}.thickness
done
The original dlabel has a parcel label table with the following column names, "KEY" (int, 0-400), "NAME" (string, detailed below), and "RED, "GREEN," "BLUE," "ALPHA" for RGB/1 (image_1).
NAME is <atlas_hemi_network_region_int>, where atlas is always "17networks," hemi is "LH" or "RH," network is one of 17 networks (e.g., "DefaultA"), region is ≥1 unique anatomical region for each network (e.g., "FPole" and "IPL" for "DafaultA"), and int is an integer ID for repeat parcels in the same network and region (e.g., "DefaultA_IPL_1" and "DefaultA_IPL_2").
However, when converted to a FreeSurfer annotation file using the method above, parcels are collapsed across <network> and the name is taken from the first instance (image_2).
For example, I have parcels "17networks_LH_DefaultA_IPL_1" and "17networks_LH_DefaultA_IPL_2" in the dlabel, but only a single label called "17networks_LH_DefaultA_IPL_1" including the two parcels in the annotation file. This is also occurring across hemispheres, where "17networks_RH_DefaultA_IPL_1" and "17networks_RH_DefaultA_IPL_2" (both on the right hemisphere) are both included in a single "17networks_LH_DefaultA_IPL_1" label in the rh.parcellation.annot file.
Notably, the networks assignment appears correct in FreeSurfer native space. However, I would like the networks to remain parcellated for morphometric analyses.
Any help would be greatly appreciated.
Bram
Bram R. Diamond, MS Clinical Psychology Doctoral Candidate Northwestern University Feinberg School of Medicine Mesulam Center for Cognitive Neurology & Alzheimer’s Disease 300 E. Superior Street | Tarry 8 | Chicago, IL 60611 http://secure-web.cisco.com/1hcjqpWwkL0-_XOMzF0mEIJ3Zgf7lJaA2354VSSviOf-Fxmn...http://secure-web.cisco.com/1hcjqpWwkL0-_XOMzF0mEIJ3Zgf7lJaA2354VSSviOf-FxmnXAybLwu1yA1zjNs4QKnut2OuVzTDVQScvxsdiepfASxogMagJwd8_WPPNJcTeU0F5VeTojWmntYwHyry_KNysA-wb3cFltzhqV6X55Z6_9XhG2QUhbrZMkhdR5KjzD1fdG2vLyTAm8pvPG78mS0jVsQIX-BfTnjjmNHkK0l-sGMuUUVG2lQEsb_u3UW8axMWLsvC3b8VItcpnwFLjFrU1A-kTdk5u-xV-RLv3JBpvAGpnFclJLoJwzbifqD7AiFKNpGOkHm6bsjXuCBcwcJ2Qm72yiFrG_6WnUJoZSg/http%3A%2F%2Fwww.brain.northwestern.edu
Freesurfer .annot saves the annotation value at each vertex . The annotation is calculated from RGB in label file. Any labels with same RGB assigned will have the same annotations. They will appear to be the same label in .annot file.
Fix the label table in .gii, re-run mris_convert.
If you are running dev version, you can also fix RGB in separate LUT. Pass it to mris_convert -ctab <lut> to replace the label table in .gii
Best,
Yujing
From: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu On Behalf Of Bram Diamond Sent: Monday, January 15, 2024 5:00 PM To: freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] fsLR label to fsnative annotation
External Email - Use Caution Dear FreeSurfer experts,
Happy new year! I hope you all are doing well!
I recently wrote the following question to the HCP-User Google Group and was directed to cross-post in the FreeSurfer list server by Dr. Matt Glasser.
I have created individualized rs-fMRI maps as dlabel fsLR 32k space using Kong et al. (2021)https://secure-web.cisco.com/1YPDKOJqHMz1SpGXNYNBBQj7WFDd_y7LiRNZ1juccRfmSknOgVmv0CGead-UEAuClUu9gDWdpD0mO4luV1U9TT82sk3llNNzqN5cQoKQj45bsBjx_MiD7OvSjTHnxJ64b5ESABXaN-1JrWL9dTSnEv723jPEnV8adEwrcWnEdaGgDSTu6sooZ08S_-bqNgbBl3eZWbffiV1qoLZRMe78tLPlOXZRVZVlqTSj_K6lmQDBASf9PX2W16KgxAQPaMcjQJVNkt00spEKtNMAjjy9R4Dhppfsno4vXb4SS4cnnKHjLuQGh-10mu1M4JlNW-SCxZykftCebjBDz_72ZGbjleQ/https%3A%2F%2Fpubmed.ncbi.nlm.nih.gov%2F33942058%2F and I would like to resample them to a FreeSurfer annotation in anatomical space without losing individual parcel assignments. The method below resamples the maps but loses parcel assignments.
echo "running -cifti-seperate" wb_command \ -cifti-separate \ $dlabel_in \ COLUMN \ -label CORTEX_LEFT $dlabel_dir/${dlabel_in_base_name}.L.fsLR_32k.label.gii \ -label CORTEX_RIGHT $dlabel_dir/${dlabel_in_base_name}.R.fsLR_32k.label.gii
for hemi in L R; do
gii_in=$dlabel_dir/${dlabel_in_base_name}.${hemi}.fsLR_32k.label.gii sphere_in=$standard_dir/resample_fsaverage/fs_LR-deformed_to-fsaverage.${hemi}.sphere.32k_fs_LR.surf.gii sphere_out=$standard_dir/resample_fsaverage/fsaverage_std_sphere.${hemi}.164k_fsavg_${hemi}.surf.gii gii_out=$dlabel_dir/${dlabel_in_base_name}.${hemi}.fsaverage_164k.label.gii area_in=$standard_dir/resample_fsaverage/fs_LR.${hemi}.midthickness_va_avg.32k_fs_LR.shape.gii area_out=$standard_dir/resample_fsaverage/fsaverage.${hemi}.midthickness_va_avg.164k_fsavg_${hemi}.shape.gii
echo "running -label-resample for "$hemi"" wb_command \ -label-resample \ $gii_in \ $sphere_in $sphere_out \ ADAP_BARY_AREA \ $gii_out \ -area-metrics \ $area_in $area_out
hemilower=$(echo $hemi | tr '[:upper:]' '[:lower:]') fshemi=${hemilower}h annot_out=${out_dir}/${fshemi}.${dlabel_in_base_name}.fsaverage.annot
echo "running mri_convert for "$fshemi"" mris_convert \ --annot $gii_out \ $FREESURFER_HOME/subjects/fsaverage/surf/${fshemi}.pial \ $annot_out
echo "running mri_surf2surf" mri_surf2surf \ --srcsubject fsaverage \ --trgsubject $sub_id \ --hemi $fshemi \ --sval-annot $annot_out \ --tval $SUBJECTS_DIR/$sub_id/label/${fshemi}.${dlabel_in_base_name}.${sub_id}.annot \ --sd ${SUBJECTS_DIR}
mri_segstats \ --annot $sub_id $fshemi Ind_parcellation_MSHBM_${sub_num}_w20_MRF5.${sub_id} \ --i $SUBJECTS_DIR/$sub_id/surf/${fshemi}.thickness \ --sum ${out_dir}/${fshemi}.Ind_parcellation_MSHBM_${sub_num}_w20_MRF5.${sub_id}.thickness
done
The original dlabel has a parcel label table with the following column names, "KEY" (int, 0-400), "NAME" (string, detailed below), and "RED, "GREEN," "BLUE," "ALPHA" for RGB/1 (image_1).
NAME is <atlas_hemi_network_region_int>, where atlas is always "17networks," hemi is "LH" or "RH," network is one of 17 networks (e.g., "DefaultA"), region is ≥1 unique anatomical region for each network (e.g., "FPole" and "IPL" for "DafaultA"), and int is an integer ID for repeat parcels in the same network and region (e.g., "DefaultA_IPL_1" and "DefaultA_IPL_2").
However, when converted to a FreeSurfer annotation file using the method above, parcels are collapsed across <network> and the name is taken from the first instance (image_2).
For example, I have parcels "17networks_LH_DefaultA_IPL_1" and "17networks_LH_DefaultA_IPL_2" in the dlabel, but only a single label called "17networks_LH_DefaultA_IPL_1" including the two parcels in the annotation file. This is also occurring across hemispheres, where "17networks_RH_DefaultA_IPL_1" and "17networks_RH_DefaultA_IPL_2" (both on the right hemisphere) are both included in a single "17networks_LH_DefaultA_IPL_1" label in the rh.parcellation.annot file.
Notably, the networks assignment appears correct in FreeSurfer native space. However, I would like the networks to remain parcellated for morphometric analyses.
Any help would be greatly appreciated.
Bram
Bram R. Diamond, MS Clinical Psychology Doctoral Candidate Northwestern University Feinberg School of Medicine Mesulam Center for Cognitive Neurology & Alzheimer's Disease 300 E. Superior Street | Tarry 8 | Chicago, IL 60611 MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be www.brain.northwestern.eduhttp://secure-web.cisco.com/1hcjqpWwkL0-_XOMzF0mEIJ3Zgf7lJaA2354VSSviOf-FxmnXAybLwu1yA1zjNs4QKnut2OuVzTDVQScvxsdiepfASxogMagJwd8_WPPNJcTeU0F5VeTojWmntYwHyry_KNysA-wb3cFltzhqV6X55Z6_9XhG2QUhbrZMkhdR5KjzD1fdG2vLyTAm8pvPG78mS0jVsQIX-BfTnjjmNHkK0l-sGMuUUVG2lQEsb_u3UW8axMWLsvC3b8VItcpnwFLjFrU1A-kTdk5u-xV-RLv3JBpvAGpnFclJLoJwzbifqD7AiFKNpGOkHm6bsjXuCBcwcJ2Qm72yiFrG_6WnUJoZSg/http%3A%2F%2Fwww.brain.northwestern.edu
freesurfer@nmr.mgh.harvard.edu