Differences between revisions 38 and 39
Deletions are marked like this. Additions are marked like this.
Line 67: Line 67:
{{{mkanalysis-sess -analysis fc.lpccseed.surf.lh -surface fsaverage lh -fwhm 5 -notask
   
-taskreg L_Posteriorcingulate.dat 1
   
-nuisreg vcsf.dat 5 -nuisreg wm.dat 5 -mcreg -polyfit 5 -nskip 4
  
-fsd bold -TR <TR> }}}
{{{mkanalysis-sess -analysis fc.lpccseed.surf.lh -surface fsaverage lh -fwhm 5 -notask -taskreg L_Posteriorcingulate.dat 1 -nuisreg vcsf.dat 5 -nuisreg wm.dat 5 -mcreg -polyfit 5 -nskip 4 -fsd bold -TR <TR> }}}
Line 92: Line 89:

About

This page describes how to perform seed-based functional connectivity (FC) analysis in FSFAST. This is an extension of the task-based analysis for which there is much more documentation. It may be worth your time to study some of the preprocessing and task-based analysis as found in FS-FAST powerpoint and the FS-FAST tutorial.

*STEP 1: Unpack Data into the FSFAST Hierarchy using dcmunpack (run with -help for more documentation):

Sample cmd:

dcmunpack -src dicomdir -targ sessionid -fsfast -run 3 bold nii.gz f.nii.gz -run 4 bold nii.gz f.nii.gz

In this sample command...

  • Have all fMRI dicoms for this subject in the dicomdir folder or subfolders under this folder
  • Arguement for "-targ" specifies output directory here called "sessionid". This should be unique to the subject (and visit if longitudinal). This is called the session folder.
  • -run 3 bold nii.gz f.nii.gz will unpack run 3 fmri to sessionid/bold/003/f.nii.gz
  • To get a list of runs, run dcmunpack -src dicomdir/subject/ALLDICOMS
  • Use "-fsfast" to generate fsfast hierarchy shown in the image below
  • The parent folder of the sessionid folder is called the "Project Folder" or "Project Directory". All the commands below should be run from the Project Folder.

fsfast-hierarchy.jpg

*STEP 2: Link to FreeSurfer anatomical analysis. This is done by creating a text file called sessionid/subjectname with the name of the FreeSurfer anatomical folder as created with recon-all and found in $SUBJECTS_DIR.

*STEP 3: Pre-process your bold data using preproc-sess preproc-sess

Sample cmd:

preproc-sess -s sessionid -fwhm 10 -surface fsaverage lhrh

By default this will do motion correction, masking, registration to the anatomical, sampling to the surface, and surface smoothing. The sampling is done onto the surface of the lh and rh hemispheres of fsaverage. Note that eventhough the time series data are sampled onto fsaverage, the FC seeds are derived from the indvidual anatomy as shown below.

*STEP 4:

There are two methods of deriving a seed region:

1) To use a full-size Freesurfer parcellation from aparc+aseg.mgz, continue with STEP 5 on this page.

2) To split the full Freesurfer parcellation into multiple seeds ("split parcellation"), follow the additional steps here - and resume with step 5 on this page...

*STEP 5: Use fcseed-config to configure the parameters you wish to pass to your connectivity analysis.

Sample command: fcseed-config -segid 1010 -fcname mean.L_Posteriorcingulate.dat -fsd bold -mean -cfg mean.L_Posteriorcingulate.config

This example will use the FreeSurfer cortical segmentation for the left posterior cingulate (segID: 1010) as defined for this individual. For seed regions, we recommend generating the mean signal timecourse by using "-mean". Note that this does not perform any analysis, it just creates a text file with the configuration. You can include more -segid flags to include more regions (though it will create only one seed time course). NOTE: Once a config file is created it may be used for multiple sessions.

*STEP 5: Pass the config text file to fcseed-sess to generate time-course information for your chosen seed region (or for nuisance variable signal).

fcseed-sess  -s sessionid -cfg L_Posteriorcingulate.config

This creates a file called L_Posteriorcingulate.dat in each resting state run. This will have a single time course in it

*STEP 6: Create nuisance variables

for white matter:

  • fcseed-config -wm -fcname wm.dat -fsd bold -pca -cfg wm.config
  • fcseed-sess -s sessionid -cfg wm.config

for ventricles + CSF:

  • fcseed-config -vcsf -fcname vcsf.dat -fsd bold -pca -cfg vcsf.config
  • fcseed-sess -s sessionid -cfg vcsf.config

These commands will create wm.dat and vcsf.dat in for each resting state run. These are text files with multiple columns. Each column is a principle component. You will choose the number of components to use below.

*STEP 6: Use mkanalysis-sess to configure an analysis for your FC data. Like the fcseed-config above, this is done once regardless of how many sessionds you have.

mkanalysis-sess -analysis fc.lpccseed.surf.lh -surface fsaverage lh -fwhm 5 -notask -taskreg L_Posteriorcingulate.dat 1 -nuisreg vcsf.dat 5 -nuisreg wm.dat 5  -mcreg -polyfit 5 -nskip 4 -fsd bold -TR  <TR>  

This command does not perform any analysis; it just creates an analysis configuration called "fc.lpccseed.surf.lh". There will be a folder of this name with a text file called analysis.info. The analysis will be run on the left hemisphere of fsaverage smoothed by 5 mm (this was already performed in preprocessing above). The waveform in the file called mean.L_Posteriorcingulate.dat will be used as the "task regressor"; this is just the FC seed. There are five sets of nuisance variables: (1) the CSF from which the top 5 principle components will be used, (2) the white matter from which the top 5 principle components will be used, (3) motion correction parameters (-mcreg), (4) 5th order polynomial, and (5) the first 4 time points will be discarded. If you with to perform global signal regression, add "-nuisreg global.waveform.dat 1". Specify the TR with the -TR flag (eg, TR 2 for 2 seconds).

*STEP 6: Use selxavg3-sess to run the subject-level analysis outlined by the above mkanalysis-sess cmd just as you would with a task-based analysis

selxavg3-sess -s sessionid -a fc.lpccseed.surf.lh

This performs the voxel-wise time series analysis for the given session. This results in several files being generated in the session folder. These include

  • # ces.mgz - contrast effect size (contrast matrix * regression coef) # cesvar.mgz - variance of contrast effect size # sig.mgz - significance map (-log10(p)) # pcc.mgz - partial correlation coefficient map

*STEP 7: Group-level analysiss

As with task-based analysis, you will run isxconcat-sess to create a "stack" of maps from each subject. If you want to use the correlation coefficient instead of the ces, specify -map pcc. Specify the contrast as L_Posteriorcingulate (or just use -all-contrasts). After that, you can perform the standard group FS group analysis.

FsFastFunctionalConnectivityWalkthrough (last edited 2024-01-16 14:11:01 by DougGreve)