AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
November 13, 2019 04:26PM
Hello,

I am trying to convert a publicly-available surface parcellation to standard mesh in order to extract mean timeseries for connectivity analysis. My current method does not work as expected (explained below), but I'm also wondering if there is a more straight forward implementation.

I am using 3dROIstats to extract the timeseries, but the number of columns in the resulting files (~30) does not equal the number of regions that should be there (~200). Also, the indices of the columns look weird (eg Mean_-31930). Like, how is there a negative index?

So I am confused and wondering how 3dROIstats labels the regions from a dataset derived using FSread_annot. It seems like the .cmap may give me some pointers, but the label numbers are huge and make no sense to me. In the .cmap generated from FSread_annot, the comment line has (surf annotation), but none of those numbers are negative.

Sorry for the wall of text below, but I wanted to also see if someone can see a simpler solution or catch a mistake I made.

Thanks!

Dustin

The parcellation can be found here.
Specifically, I'm interested in using /Parcellations/Freesurfer5.3/fsaverage6//label/?h.Schaefer2018_400Parcels_17Networks_order.annot.

As input into this workflow, I have:
1) resting state data preprocessed in the volume
2) freesurfer data on each subject
3) a freesurfer distribution
4) the .annot files from the above repo

I specify the freesurfer distribution as different from the .annot files because @SUMA_Make_Spec_FS will not work solely on the fsaverage6 directory in the parcellation distribution (because only the surf and label directories are supplied). The parcellation was derived on fsaversage6, so I'm starting there.

Here is my workflow:

1) Generate SUMA-readable mesh from the fsaverage6 directory supplied in the freesurfer distribution, specifying only -ld 60 because that's all I need.
dir=~
cd ${dir}/fsaverage6
@SUMA_Make_Spec_FS -sid fsaverage6 -ld 60 -NIFTI

2) Convert the .annot files in the parcellation to SUMA-readable formats, then resample to std.60 mesh.
cd SUMA
dset=Schaefer2018_400Parcels_17Networks_order
for hh in "lh" "rh"
do
	# convert the .annot to SUMA
	FSread_annot \
		-input $dir/Parcellations/FreeSurfer5.3/fsaverage6/label/${hh}.${dset}.annot \
		-hemi ${hh} \
		-FScmap $dir/Parcellations/roject_to_individual/${dset}_LUT.txt \
		-col_1D ./${dset}.${hh}.col \
		-roi_1D ./${dset}.${hh}.roi \
		-cmap_1D ./${dset}.${hh}.cmap \
		-dset ./${dset}.${hh}.niml.dset

	# resample the SUMAarized .annot to std.60
	SurfToSurf \
		-i_gii std.60.${hh}.smoothwm.gii \
		-i_gii ${hh}.smoothwm.gii \
		-prefix std.60.${hh} \
		-mapfile std.60.fsaverage6_${hh}.niml.M2M \
		-dset ${dset}.${hh}.niml.dset \
		-output_params NearestNode
done
Among the intermediary files, these steps result in std.60.?h.Schaefer2018_400Parcels_17Networks_order.?h.niml.dset, which I can open in SUMA and they look reasonable.
Side note: I couldn't get SurfToSurf to work without having to have filenames that specify the hemisphere twice. One I add manually using -prefix, and another the program adds. The SurfToSurf help file says that only .1D outputs are available, but this method gives me .niml.dsets as well.

3) Generate SUMA-readable mesh for each subject
cd $dir/sub-01
@SUMA_Make_Spec_FS -sid sub-01 -ld 60 -NIFTI

4) Project the functional data to the surface
for hh in "lh" "rh"
do
	3dvol2surf \
		-spec ./SUMA/std.60.sub-01_${hh}.spec \
		-surf_A smoothwm \
		-surf_B pial \
		-sv ./SUMA/sub-01_SurfVol.nii \
		-grid_parent ./func/filtered_func_data.nii.gz \
		-map_func ave \
		-f_steps 15 \
		-f_index nodes \
		-outcols_NSD_format \
		-out_niml ./func/vol2surf_func.${hh}.niml.dset
done

5. Extract the mean timeseries from the parcellation
for hh in "lh" "rh"
do
	3dROIstats \
		-nobriklab \
		-1DRformat \
		-mask ./SUMA/std.60.${hh}.Schaefer2018_400Parcels_17Networks_order.${hh}.niml.dset \
		./func/vol2surf_func.${hh}.niml.dset > ./func/Schaefer2018_400Parcels.ts.${hh}.1D
done
Subject Author Posted

Surface parcellation in SUMA

dmoracze November 13, 2019 04:26PM

Re: Surface parcellation in SUMA Attachments

dmoracze November 13, 2019 05:14PM

Re: Surface parcellation in SUMA

dmoracze November 18, 2019 11:40AM

Re: Surface parcellation in SUMA

dmoracze November 20, 2019 10:55AM

Re: Surface parcellation in SUMA

dmoracze March 05, 2020 01:59PM

Re: Surface parcellation in SUMA

anthonystevendick April 20, 2020 02:00PM

Re: Surface parcellation in SUMA

Daniel Glen April 20, 2020 06:04PM