|
Size: 2931
Comment:
|
Size: 5642
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| === work in progress... === | |
| Line 3: | Line 3: |
| Walkthrough: How to use FsFast and [[http://surfer.nmr.mgh.harvard.edu/fswiki/fcseed-sess|fcseed-sess]] for functional connectivity analysis including example commands. | 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 [[http://surfer.nmr.mgh.harvard.edu/pub/docs/freesurfer.fsfast.ppt|FS-FAST powerpoint]] |
| Line 5: | Line 5: |
| For general tips on using FsFast, download this powerpoint: | *STEP 1: Unpack Data into the FSFAST Hierarchy using dcmunpack (run with -help for more documentation): |
| Line 7: | Line 7: |
| [[http://surfer.nmr.mgh.harvard.edu/pub/docs/freesurfer.fsfast.ppt|Using FS-FAST]] | Sample cmd: |
| Line 9: | Line 9: |
| *STEP 1: Unpack Data into the FSFAST Hierarchy using "unpackscmdir" | dcmunpack -src dicomdir/subject/ALLDICOMS -targ fcMRI_dir/subject -fsfast -run 3 bold nii.gz f.nii.gz -run 4 bold nii.gz f.nii.gz |
| Line 11: | Line 11: |
| [[https://surfer.nmr.mgh.harvard.edu/fswiki/unpacksdcmdir|unpacksdcmdir]] | In this sample command... |
| Line 13: | Line 13: |
| 1.QA Check after unpacking: | * Have all fMRI dicoms linked into "ALLDICOMS" directory * Arguement for "-targ" specifies output directory * -run 3 bold nii.gz f.nii.gz will unpack run 3 fmri to fcMRI_dir/subject/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 |
| Line 15: | Line 19: |
| * A - Check unpacked data (time points, # of slices ..etc) * B - Check FSFAST hierarchy in session folder |
{{attachment:fsfast-hierarchy.jpg}} |
| Line 18: | Line 21: |
| *STEP 2: Reconstruction Anatomical data using "recon-al -all" | *STEP 2: Link to FreeSurfer anatomical analysis: Create "subjectname" text file in the session directory. Write in it the subject's recon directory name (as labeld in $SUBJECTS_DIR). |
| Line 20: | Line 23: |
| 1.Set SUBJECTS_DIR | C. Create a sessid file (text file with list of your sessions) in your Study DIR (optional) |
| Line 22: | Line 25: |
| 2.QA Check: | *STEP 3: Pre-process your bold data using preproc-sess [[http://surfer.nmr.mgh.harvard.edu/fswiki/preproc-sess|preproc-sess]] |
| Line 24: | Line 27: |
| * A - Check talairach transformation * B - Check skull strip, white matter & pial surface * C - Re-run "recon-all" if edits are made * D - Check hierarchy of reconstructed anatomical data [[https://surfer.nmr.mgh.harvard.edu/fswiki/recon-all| recon-all]] |
Sample cmd: |
| Line 29: | Line 29: |
| 1.Make FSFAST basic hierarchy (only if data are not unpacked in FSFAST hierarchy) | preproc-sess -s <subjid> -fwhm <#> |
| Line 31: | Line 31: |
| 2.Link to FreeSurfer anatomical analysis | A. By default this will do motion correction, smoothing & brain masking |
| Line 33: | Line 33: |
| A - Make subjectname file in the session directory to link a subject's functional & structural data | B. Quality Check (plot-twf-sess) |
| Line 35: | Line 35: |
| 3.Create a sessid file (text file with list of your sessions)in your Study DIR. | C.Examine additions to FSFAST hierarchy (in each run of bold dir): |
| Line 37: | Line 37: |
| 4.Create a Stimulus Schedule (Paradigm file) in bold folder (A "paradigm" file is a record of which stimulus was presented when & for how long. | ||f.nii ||(Raw fMRI data) || ||fmc.nii ||(Motion corrected-MC) || ||fmcsm5.nii ||(MC & smoothed) || ||fmc.mcdat ||(Text file with the MC parameters (AFNI)) || ||brain.mgz ||(Binary mask of the brain) || |
| Line 39: | Line 43: |
| Each paradigm file has four columns: | |
| Line 41: | Line 44: |
| A - Stimulus onset time (sec) | |
| Line 43: | Line 45: |
| B - Condition ID code (0, 1, 2, ...) | NOTE: you ''may'' need to convert the file "fmcpr.mgz" to fmcpr.nii using [[http://surfer.nmr.mgh.harvard.edu/fswiki/mri_convert|mri_convert]] |
| Line 45: | Line 47: |
| C - Stimulus Duration (sec) | Found in each bold scan dir. Sample cmd: |
| Line 47: | Line 49: |
| D - Stimulus Weight (usually 1) | mri_convert session/bold/002/fmcpr.mgz session/bold/002/fmcpr.nii |
| Line 49: | Line 51: |
| *STEP 3: Pre-process your bold data using preproc-sess [[http://surfer.nmr.mgh.harvard.edu/fswiki/preproc-sess| preproc-sess]] # Preprocessing of fMRI Data () preproc-sess -s <subjid> -fwhm <#> 1.By default this will do motion correction, smoothing & brain masking 2.Quality Check (plot-twf-sess) 3.Examine additions to FSFAST hierarchy (in each run of bold dir): f.nii (the raw data) fmc.nii (motion corrected-MC) fmcsm5.nii (MC & smoothed) fmc.mcdat - text file with the MC parameters (AFNI) mcextreg.bhdr - binary mask of the brain |
mri_convert session/bold/003/fmcpr.mgz session/bold/003/fmcpr.nii |
| Line 61: | Line 53: |
| # Function-Structure Registration View unregistered tkregister-sess -s <subjid> -regheader) Run automatic registration spmregister-sess -s <subjid> Check automatic registration tkregister-sess -s <subjid> |
|
| Line 66: | Line 54: |
| A - Make edits if needed using scale as the last resort Check talairach registration tkregister2 --s <subjid> --fstal --surf | |
| Line 68: | Line 55: |
| *STEP 4: Use fcseed-sess to generate time-course information for your chosen seed region (as well as nuisance variable signal). | Next, I'll outline two methods of deriving a seed region: |
| Line 70: | Line 57: |
| *STEP 5: Use mkanalysis-sess to setup an analysis for your FC data | 1) To use a full-size Freesurfer parcellation from aparc+aseg.mgz, continue with STEP 4 on this page. |
| Line 72: | Line 59: |
| *STEP 6: Use selxavg3-sess to run the subject-level analysis | 2) To split the full Freesurfer parcellation into multiple seeds ("split parcellation"), follow the [[FsFastFunctionalConnectivityWalkthroughSplittingSeeds |additional steps here]] - and resume with step 5 on this page... |
| Line 74: | Line 61: |
| *STEP 7: Use mri_glmfit or selxavg3-sess to run a group-level analysis | *STEP 4: Use fcseed-config to record 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). For seed regions, we recommend generating the mean signal timecourse by using "-mean" *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). Sample cmd (mean seed region timecourse): fcseed-sess -s <session> -cfg mean.L_Posteriorcingulate.config Sample cmd (mean waveforms for nuisance regressors, but PCA also possible with -pca): for white matter: . fcseed-config -wm -fcname wm.dat -fsd bold -cfg wm.config . fcseed-sess -s <session> -cfg wm.config for ventricles + CSF: . fcseed-config -vcsf -fcname vcsf.dat -fsd bold -mean -cfg vcsf.config . fcseed-sess -s <session> -cfg vcsf.config *NOTE: Once a config file is created it may be used for multiple sessions *STEP 5: Use [[http://surfer.nmr.mgh.harvard.edu/fswiki/mkanalysis-sess|mkanalysis-sess]] to setup an analysis for your FC data Sample cmd: mkanalysis-sess -a <analysisname> . -surface fsaverage <hemi> -notask -taskreg mean.L_Posteriorcingulate.dat 1 -nuisreg vcsfreg.dat 1 -nuisreg wmreg.dat 1 -nuisreg global.waveform.dat 1 -fwhm 5 -fsd bold -TR <TR> -mcextreg -polyfit 5 -nskip 4 Note: if you do not want to regress out the global signal, then do not include it in the mkanalysis-sess command. *STEP 6: Use [[http://surfer.nmr.mgh.harvard.edu/fswiki/selxavg3-sess|selxavg3-sess]] to run the subject-level analysis outlined by the above mkanalysis-sess cmd. . selxavg3-sess -s <session> -a <analysisname> *STEP 7: Choose the contrast file (generated in each session's contrast directory) that you wish to analyze on a group level: # 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 8: To continue with a group-level analysis, try one of the methods below: Method 1: *create fsgd file containing all sessions of interest *Concatenate contrast files using [[http://www.freesurfer.net/fswiki/mri_concat|mri_concat]] *Run group analysis using [[http://www.freesurfer.net/fswiki/mri_concat|mri_glmfit]] Should also be possible with: Method 2: *[[http://www.freesurfer.net/fswiki/Qdec|Qdec]] Should also be possible with: Method 3: *Concatenate with [[http://www.freesurfer.net/fswiki/isxconcat-sess|isxconcat-sess]] *Run group analysis using [[http://www.freesurfer.net/fswiki/mri_concat|mri_glmfit]] |
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
*STEP 1: Unpack Data into the FSFAST Hierarchy using dcmunpack (run with -help for more documentation):
Sample cmd:
dcmunpack -src dicomdir/subject/ALLDICOMS -targ fcMRI_dir/subject -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 linked into "ALLDICOMS" directory
- Arguement for "-targ" specifies output directory
- -run 3 bold nii.gz f.nii.gz will unpack run 3 fmri to fcMRI_dir/subject/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
*STEP 2: Link to FreeSurfer anatomical analysis: Create "subjectname" text file in the session directory. Write in it the subject's recon directory name (as labeld in $SUBJECTS_DIR).
C. Create a sessid file (text file with list of your sessions) in your Study DIR (optional)
*STEP 3: Pre-process your bold data using preproc-sess preproc-sess
Sample cmd:
preproc-sess -s <subjid> -fwhm <#>
A. By default this will do motion correction, smoothing & brain masking
B. Quality Check (plot-twf-sess)
C.Examine additions to FSFAST hierarchy (in each run of bold dir):
f.nii
(Raw fMRI data)
fmc.nii
(Motion corrected-MC)
fmcsm5.nii
(MC & smoothed)
fmc.mcdat
(Text file with the MC parameters (AFNI))
brain.mgz
(Binary mask of the brain)
NOTE: you may need to convert the file "fmcpr.mgz" to fmcpr.nii using mri_convert
Found in each bold scan dir. Sample cmd:
mri_convert session/bold/002/fmcpr.mgz session/bold/002/fmcpr.nii
mri_convert session/bold/003/fmcpr.mgz session/bold/003/fmcpr.nii
Next, I'll outline two methods of deriving a seed region:
1) To use a full-size Freesurfer parcellation from aparc+aseg.mgz, continue with STEP 4 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 4: Use fcseed-config to record 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). For seed regions, we recommend generating the mean signal timecourse by using "-mean"
*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).
Sample cmd (mean seed region timecourse):
fcseed-sess -s <session> -cfg mean.L_Posteriorcingulate.config
Sample cmd (mean waveforms for nuisance regressors, but PCA also possible with -pca):
for white matter:
- fcseed-config -wm -fcname wm.dat -fsd bold -cfg wm.config
fcseed-sess -s <session> -cfg wm.config
for ventricles + CSF:
- fcseed-config -vcsf -fcname vcsf.dat -fsd bold -mean -cfg vcsf.config
fcseed-sess -s <session> -cfg vcsf.config
- NOTE: Once a config file is created it may be used for multiple sessions
*STEP 5: Use mkanalysis-sess to setup an analysis for your FC data
Sample cmd:
mkanalysis-sess -a <analysisname>
-surface fsaverage <hemi> -notask -taskreg mean.L_Posteriorcingulate.dat 1 -nuisreg vcsfreg.dat 1 -nuisreg wmreg.dat 1 -nuisreg global.waveform.dat 1 -fwhm 5 -fsd bold -TR <TR> -mcextreg -polyfit 5 -nskip 4
Note: if you do not want to regress out the global signal, then do not include it in the mkanalysis-sess command.
*STEP 6: Use selxavg3-sess to run the subject-level analysis outlined by the above mkanalysis-sess cmd.
selxavg3-sess -s <session> -a <analysisname>
*STEP 7: Choose the contrast file (generated in each session's contrast directory) that you wish to analyze on a group level:
- # 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 8: To continue with a group-level analysis, try one of the methods below:
- Method 1:
- create fsgd file containing all sessions of interest
Concatenate contrast files using mri_concat
Run group analysis using mri_glmfit
Concatenate with isxconcat-sess
Run group analysis using mri_glmfit
