Personal tools
  • Help

fluctuations:SfimProcessingStream

From NITRC Wiki

Jump to: navigation, search

Running the AFNI resting-state connectivity scripts.

by Sunil Narayan and Daniel Handwerker

--Werker 22:48, 26 November 2008 (UTC)

Please note: We are examining how the order and choice of preprocessing steps along with changes in parameter options will affect the the results of task-independant correlation analyses. Thus, we don't have a single, standard processing stream. This script includes most of the steps we might use and is compressed slightly for simplicity, but please note that our actual processing steps change often. You can use this script as starting point that tells you how to complete all the steps you might want to run using AFNI, but please don't assume that this is our only processing stream. For comparison purposes, we also sometimes subtract the global signal from the mean, but that isn't included in this script. We also might subtract CSF or white matter ROIs, but the methodology to do that isn't included here. If you have a mask of those regions, it shouldn't be hard to add to this script. The script also doesn't bandpass filter the data. We do filter the data and, at some point, we'll post a revised version that includes the filter (the 3dFourier command in AFNI)

To run the AFNI pre-processing training script you are first going to want to download all the scripts and programs needed from: http://www.nitrc.org/frs/?group_id=85 They are listed as the SFIM Processing Script Files

A full list of the types of files needed is in the header of NITRIC_restingstatescript

While other shells might work for most of this, it was all tested on a tcsh shell (type 'tcsh' at the prompt on a unix or linux machine)

1dCRphase.c can be compiled by typing: gcc -g 1dCRphase.c -lm -o 1dCRphase

It's easiest if the shell scripts are in the same folder as the MRI data. The compiled 1dCRphase should be in the executable path or in the same folder. You can add a directory to the path by typing: setenv PATH ~<folder name>/:$PATH

Once 1dCRphase is up to date, type in 1dCRphase and it will instruct you as to the syntax, enter in all the values and press enter and the program make two files which contain the cardiac and respiratory phase plots for each step. A sample input is: 1dCRphase -nslice 27 -NT 150 -tstep 20 -TR 2000 -thresh 300 -resp Resp_epiRT_scan.1D -card ECG_epiRT_scan.1D out This means that the data had 27 slices, 150 time points, the cardiac and respiratory time plots were sampled at 20ms and the fMRI data TR was 2000ms. Assuming 'out' was your output file prefix you should have two files: out_card_phase.1D AND out_resp_phase.1D If you are not sure what threshold to use, x.check.thresh is script that tests many different thresholds. That script might require some editing depending on the specific needs.

To make the RVT calculations you will need to start Matlab Once it is loaded make sure the current path is the folder with all the data, and type: TRresp = RVTcalc(load('Resp_epiRT_scan.1D'), <tstep>, <TR>); After TRresp is returned remove non numbers by typing: TRresp(find(isnan(TRresp)))=0; This is a logical indexing command which selectively replaces all non numbers with a 0. In the workspace check to make sure TRresp is a 1 x number of time pts. size vector. If it isn't feel free to delete one of the leading or trailing 0's to make it appropriately sized. Once that is done save the file by typing: save('RVT_scan.1D', 'TRresp', '-ASCII');


The next step is to run 'NITRIC_restingstatescript' which is pretty straight forward. There is a help menu in that file. That script does: motion correction slice time correction shifts the signal to percent change from the mean RETROICOR (1dCRphase is run within the script, but can also be run seprately and commented out of the script) Motion and the first derivative of the motion parameters are removed from the time series Respiration*Volume/Time correction is applied Correlation to a seed is done. (default set to seedmask+orig.BRIK, but can easily be changed)

The script is heavily commented help with learning data processing and AFNI. Please make sure to go through the script to understand exactly what is happening in each step.

Powered by MediaWiki
  • This page was last modified 22:48, 26 November 2008.
  • This page has been accessed 990 times.
  •