biac:analysis:resting_pipeline
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
biac:analysis:resting_pipeline [2012/05/31 16:15] – [Python/FSL Resting State Pipeline] admin | biac:analysis:resting_pipeline [2013/09/17 13:58] – [Python/FSL Resting State Pipeline] admin | ||
---|---|---|---|
Line 8: | Line 8: | ||
Usage: | Usage: | ||
resting_pipeline.py --func / | resting_pipeline.py --func / | ||
- | |||
Program to run through Nan-kuei Chen's resting state analysis pipeline: | Program to run through Nan-kuei Chen's resting state analysis pipeline: | ||
Line 18: | Line 17: | ||
4 - normalize data | 4 - normalize data | ||
5 - regress out WM/CSF | 5 - regress out WM/CSF | ||
- | 6 - bandpass | + | 6 - lowpass |
- | 7 - produce correlation matrix from label file | + | 7 - do parcellation and produce correlation matrix from label file |
+ | * or split it up: | ||
+ | 7a - do parcellation from label file | ||
+ | 7b - produce correlation matrix [--func option is ignored if step 7b | ||
+ | is run by itself unless --dvarsthreshold is specified, and | ||
+ | --corrts overrides default location for input parcellation | ||
+ | results (outputpath/ | ||
+ | 8 - functional connectivity density mapping | ||
Line 28: | Line 35: | ||
--throwaway=4 | --throwaway=4 | ||
run | run | ||
+ | --t1=/ | ||
-p func, --prefix=func | -p func, --prefix=func | ||
prefix for all resulting images, defaults to name of | prefix for all resulting images, defaults to name of | ||
Line 48: | Line 56: | ||
standard brain | standard brain | ||
--refcsf=FILE | --refcsf=FILE | ||
+ | standard brain | ||
+ | --refgm=FILE | ||
+ | standard brain | ||
+ | --refbrainmask=FILE | ||
standard brain | standard brain | ||
--refacpoint=45, | --refacpoint=45, | ||
AC point of reference image if not using standard MNI | AC point of reference image if not using standard MNI | ||
- | brain | + | brain |
- | --betfval=0.5 f value to use while skull stripping. default is 0.5 | + | --betfval=0.4 f value to use while skull stripping. default is 0.4 |
+ | --anatbetfval=0.5 | ||
+ | | ||
--lpfreq=0.08 | --lpfreq=0.08 | ||
- | is .08hz | + | is .08hz. highpass is fixed at .001hz. |
--corrlabel=FILE | --corrlabel=FILE | ||
correlation search. default is the 116 region AAL | correlation search. default is the 116 region AAL | ||
Line 61: | Line 75: | ||
for the correlation search. default is the 116 region | for the correlation search. default is the 116 region | ||
AAL label txt file | AAL label txt file | ||
+ | --corrts=FILE | ||
+ | parcellation output (default is to use | ||
+ | OUTPATH/ | ||
+ | to the correlation. | ||
+ | --dvarsthreshold=THRESH | ||
+ | If specified, this reprsents a DVARS threshold either | ||
+ | in BOLD units, or if ending in a ' | ||
+ | percentage of mean global signal intensity (over the | ||
+ | brain mask). | ||
+ | greater than this threshold will be excluded | ||
+ | (" | ||
+ | calculation is performed on the results of the last | ||
+ | pre-processing step, and is calculated as described by | ||
+ | Power, J.D., et al., " | ||
+ | correlations in functional connectivity MRI networks | ||
+ | arise from subject motion", | ||
+ | data is only excluded during the final correlation, | ||
+ | and so will never affect any operations that require | ||
+ | the full signal, like regression, etc. | ||
+ | --dvarsnumneighbors=NUMNEIGHBORS | ||
+ | If --dvarsthreshold is specified, then | ||
+ | --dvarsnumnumneighbors specifies how many neighboring | ||
+ | volumes, before and after the initially excluded | ||
+ | volumes, should also be excluded. | ||
+ | --fdthreshold=THRESH | ||
+ | Any volume contributing to a FD value greater than | ||
+ | this threshold will be excluded (" | ||
+ | (final) correlation step. FD calculation is performed | ||
+ | on the results of the last pre-processing step, and is | ||
+ | calculated as described by Power, J.D., et al., | ||
+ | " | ||
+ | connectivity MRI networks arise from subject motion", | ||
+ | NeuroImage(2011). | ||
+ | the final correlation, | ||
+ | operations that require the full signal, like | ||
+ | regression, etc. | ||
+ | --fdnumneighbors=NUMNEIGHBORS | ||
+ | If --fdthreshold is specified, then | ||
+ | --fdnumnumneighbors specifies how many neighboring | ||
+ | volumes, before and after the initially excluded | ||
+ | volumes, should also be excluded. | ||
+ | --motionthreshold=THRESH | ||
+ | If specified, any volume whose motion parameters | ||
+ | indicate a movement greater than this threshold (in | ||
+ | mm) will be excluded (" | ||
+ | correlation step. Volume-to-volume movement is | ||
+ | calculated per pair of neighboring volumes from the | ||
+ | three rotational and three translational parameters | ||
+ | generated by mcflirt. | ||
+ | neighboring volumes is calculated as the maximum | ||
+ | displacement (due to the combined rotation and | ||
+ | translation) of any voxel on the 50mm-radius sphere | ||
+ | surrounding the center of rotation. | ||
+ | only excluded during the final correlation, | ||
+ | will never affect any operations that require the full | ||
+ | signal, like regression, etc. | ||
+ | --motionnumneighbors=NUMNEIGHBORS | ||
+ | If --motionthreshold is specified, then | ||
+ | --motionnumnumneighbors specifies how many neighboring | ||
+ | volumes, before and after the initially excluded | ||
+ | volumes, should also be excluded. | ||
+ | --motionpar=FILE.par | ||
+ | specifies the .par file from which the motion | ||
+ | parameters are extracted. | ||
+ | perform motion correction, then this option is | ||
+ | ignored. | ||
+ | --scrubop=SCRUBOP | ||
+ | --fdthreshold are specified, then --scrubop specifies | ||
+ | the aggregation operator used to determine the final | ||
+ | list of excluded volumes. | ||
+ | means a volume will be excluded if *any* of its | ||
+ | thresholds are exceeded, whereas ' | ||
+ | thresholds must be exceeded to be excluded. | ||
+ | --powerscrub | ||
+ | --fdnumneighbors=0 --dvarsthreshold=0.5% | ||
+ | --dvarsnumneigbhors=0 --scrubop=' | ||
+ | method used in the Power et al. article. | ||
+ | conflicting options specified before or after this | ||
+ | will override these. | ||
+ | --scrubkeepminvols=NUMVOLS | ||
+ | If --motionthreshold, | ||
+ | --fdthreshold are specified, then --scrubminvols | ||
+ | specifies the minimum number of volumes that should | ||
+ | pass the threshold before doing any correlation. | ||
+ | the minimum is not met, then the script exits with an | ||
+ | error. | ||
+ | --fcdmthresh=THRESH | ||
+ | connectivity density mapping ( step8 ). Default is set | ||
+ | to 0.6. Algorithm from Tomasi et al, PNAS(2010), vol. | ||
+ | 107, no. 21. Calculates the fcdm of functional data | ||
+ | from last completed step, inside a dilated gray matter | ||
+ | mask | ||
--cleanup | --cleanup | ||
</ | </ | ||
Line 89: | Line 194: | ||
* the functional run is meaned across time with fslmaths, then bet is applied. | * the functional run is meaned across time with fslmaths, then bet is applied. | ||
* if you find that bet is doing a poor job finding the edges you can adjust the intensity threshold with **--betfval** | * if you find that bet is doing a poor job finding the edges you can adjust the intensity threshold with **--betfval** | ||
- | * this is equivalent of **-f** when actually running bet. the default is 0.5, but smaller values will be more conservative in finding the edges of the brain ( ie: larger mask ) | + | * this is equivalent of **-f** when actually running bet. the default is 0.4 (same as feat), but smaller values will be more conservative in finding the edges of the brain ( ie: larger mask ) |
+ | * if provided T1 anatomical is skull stripped. **--anatbetfval** is used to control intensity threshold, the default is 0.5 (same as feat) | ||
==== Step 4 ==== | ==== Step 4 ==== | ||
* normalize the data using flirt | * normalize the data using flirt | ||
Line 97: | Line 202: | ||
* if your subject has already been normalized during standard pre-processing of other runs, please provide the flirt matrix from pre-stats with **--flirtmat** ( most likely example_func2standard.mat) | * if your subject has already been normalized during standard pre-processing of other runs, please provide the flirt matrix from pre-stats with **--flirtmat** ( most likely example_func2standard.mat) | ||
* this will apply the previously determined flirt matrix to your functional data instead of trying to calculate a new matrix based on the functionals. | * this will apply the previously determined flirt matrix to your functional data instead of trying to calculate a new matrix based on the functionals. | ||
+ | * if you've provided at T1 anatomical image then this sequence is followed: | ||
+ | * func-2-t1 | ||
+ | * t1-2-standard | ||
+ | * flirt matrices are concatenated to create func-2-standard | ||
+ | * if no T1 is provided, then the functional is used for the flirt normalization | ||
==== Step 5 ==== | ==== Step 5 ==== | ||
Line 105: | Line 215: | ||
==== Step 6 ==== | ==== Step 6 ==== | ||
- | * this step will low-pass filter data to remove high-frequency noise using custom python code | + | * this step will band-pass filter data to remove high-frequency noise using custom python code |
* the default is 0.08 HZ | * the default is 0.08 HZ | ||
* if you'd like to chose a different frequency, please use ** --lpfreq ** | * if you'd like to chose a different frequency, please use ** --lpfreq ** | ||
==== Step 7 ==== | ==== Step 7 ==== | ||
* if defaults are used, then the aal_MNI_V4 label file is used to extract the average timeseries for each of the 116 regions | * if defaults are used, then the aal_MNI_V4 label file is used to extract the average timeseries for each of the 116 regions | ||
+ | * if --dvarsthreshold or --motionthreshold are specified, then the ROI-averaged timeseries are further filtered (" | ||
* cross correlation coefficients are found for the entire matrix of 116x116 regions | * cross correlation coefficients are found for the entire matrix of 116x116 regions | ||
* this step produces 4 files: | * this step produces 4 files: | ||
Line 132: | Line 243: | ||
* that is the zr_values from the subject.graphml displayed in matplotlib. | * that is the zr_values from the subject.graphml displayed in matplotlib. | ||
- | For a beta version of the viewer: | + | For the rs-pipeline |
< | < | ||
- | / | + | / |
Usage: | Usage: | ||
- | beta_viewer.py --graphml / | + | rspipe_viewer.py --graphml / |
Program to display graphml output from resting_pipeline | Program to display graphml output from resting_pipeline | ||
Line 153: | Line 264: | ||
</ | </ | ||
+ | |||
+ | ==== Step 8 ==== | ||
+ | * Functional connectivity density mapping | ||
+ | * Takes functional data from last step and calculates how connected they are to the voxels around them | ||
+ | * uses ( --fcdmthresh and --refgm ) as the pearson r-value and gray matter mask | ||
+ | * if defaults are used, then a dilated gray matter mask is used from FAST segmentation of MNI brain and a pearson r value of 0.6 | ||
+ | * Iteratively goes to all neighboring voxels and counts the number that have correlated signal until they are under the r threshold | ||
+ | * adapted from Dardo Tomasi, PNAS(2010), vol. 107, no. 21. 9885–9890 | ||
+ | * resulting file with be " | ||
+ | |||
+ | {{: | ||
===== Things to consider ===== | ===== Things to consider ===== | ||
* this was designed to be modular, so that you only need to run the steps you need | * this was designed to be modular, so that you only need to run the steps you need |
biac/analysis/resting_pipeline.txt · Last modified: 2024/06/21 15:44 by 127.0.0.1