Data correction because of physiological noise via linear regression possible?

 Dear rest-fmri team,
 I am wondering if it is possible with REST to correct my functional mri data first against noise-prone regions before I calculate the correlation map in the  "functional connectivity" setup.
 Such noise prone regions are for example white matter, ventricular time courses and the cerebrospinal fluid.

 So I would like to to something like: 

Y corrected = Y - X*b,

whereas Y is the measured data, X the design matrix (containing all the noise prone region time courses as regressors), and b the estimated parameter.

As far as I could see in the REST code, Y contains just the standard-preprocessed (SPM) data, whereas X contains just the whole global signal of the brain.

So my question is if it is necessary to do additional coding being able to achieve this or if REST already can provide a functionality for this (that I did not realize).

Besides the REST toolbox is a great piece of work,
any help greatly appreciated!

marcus

 REST could regress some covariables out before calculating correlation. You could define your covariables (such as you mentioned noise: white matter's, ventricular's and the cerebrospinal fluid's averaged time course) at first. You may also add global signal as one covariable.
Detailed computation process could be consulted by fc.m.
By the way, the formula I used is: Ycorrected =( E - X * inv(X'X) * X') * Y, where X should be the covariables matrix.

Please refer to http://restfmri.net/forum/node/81 to get the program you wanted.
We are planning to add this module into REST’s utilities in the next release.

I would like to extract and regress out signal from CSF and white matter.  I have downloaded the files rest_Y_ExtractROITC.m, rest_Y_RegressOutCoveraibles.m as instructed by YAN Chao-Gan, but I'm not sure how to use this function.  Do these programs provide additional functionality thru the GUI, or must I use Matlab command line?  If not usable thru the GUI, could you  please provide some concrete information on what to do.

Thank you for this very useful program,
Carlos

I am sorry that the function can not be implemented in the GUI currently, we will include this function in the future release.
You can use these programs in the matlab command line.
1. You need to extract your CSF or WM time course. You can use the GUI to extract the time course:
          Functional Connectivity->ROI wise->Add ROI;   Then click Misc->Retrieve average time course from selected ROI definition
          Or you can use rest_Y_ExtractROITC.m
% FORMAT [] = rest_Y_ExtractROITC(ADataDir, AROIDef)
% Input:
%   ADataDir - where the 3d+time dataset stay, and there should be 3d EPI functional image files. It must not contain / or \ at the end.
%   AROIDef - A cell of the mask list , ROI list definition. AROIDef would be    treated as a mask in which time courses would be averaged to produce a new time course representing the ROI area
%             e.g. {'ROI Center(mm)=(0, 0, 0); Radius=6.00 mm.';'ROI Center(mm)=(5, 9, 20); Radius=6.00 mm.';'D:\Data\ROI.img'}
% Output:
%   *.mat - The extracted time courses and Pierson's correlations would be saved as .mat files in the current directory of MATLAB.

           Then please arrange the time courses in a text file.
2. Regress out the covariables
    Please call the rest_Y_RegressOutCovariables.m
   
% FORMAT rest_Y_RegressOutCovariables(ADataDir,ACovariablesDef,APostfix)
% Input:
%   ADataDir - where the 3d+time dataset stay, and there should be 3d EPI functional image files. It must not contain / or \ at the end.
%   ACovariablesDef - A struct which defines the coviarbles.
%                 ACovariablesDef.polort - The order of the polynomial which adding to baseline model according to 3dfim+.pdf. Recommend: 1.
%                 ACovariablesDef.ort_file - The filename of the text file which contains the covaribles.
%   APostfix - Post fix of the resulting data directory. e.g. '_Covremoved'
% Output:
%   *.img/hdr - data removed the effect of covariables.

Good luck!

Dear Carlos,
If you want to extract and regress out signal from CSF and white matter. Now you can try DPARSF, I think it may help you. Just click on check box "Regress out nuisance covariates", you will get information for how to use it.
Hope it works.
Best regards,
Chao-Gan

Thanks.  I will try it out.  Looks like it will be a lot of help.
One question though, How does it take the avg signal from CSF or white matter if it does not ask for coordinates or a mask of these things?  What is the default?

Sincerely,

Carlos

When you click on the "Regress out nuisance covariates" checkbox, DPARSF will give you a tips:
   'Linear regression was performed to remove the effects of the nuisance covariates:';...
        '1. Six head motion parameters: estimated by SPM5''s realign step. If you do not want to use SPM5'' realign, please arrange each subject''s rp*.txt file in one directory (named as same as its functional image directory) , and then put them in "RealignParameter" directory under the working directory. i.e.:';...
        '{Working Directory}\RealignParameter\Subject001\rpxxxxx.txt';...
        '...';...
        '{Working Directory}\RealignParameter\Subject002\rpxxxxx.txt';...
        '...';...
        '2. Global mean signal: mask created by setting a threshold at 50% on SPM5''s apriori mask (brainmask.nii).';...
        '3. White matter signal: mask created by setting a threshold at 90% on SPM5''s apriori mask (white.nii).';...
        '4. Cerebrospinal fluid signal: mask created by setting a threshold at 70% on SPM5''s apriori mask (csf.nii).';...
        '';...
        'The regression was based on data after filter, if you want to regress another kind of data, please arrange each subject''s NIFTI images in one directory, and then put them in "FunImgNormalizedSmoothedDetrendedFiltered" (or "FunImgNormalizedDetrendedFiltered") directory under the working directory. i.e.:';...
        '{Working Directory}\FunImgNormalizedSmoothedDetrendedFiltered\Subject001\xxx001.img';...
        '{Working Directory}\FunImgNormalizedSmoothedDetrendedFiltered\Subject001\xxx002.img';...
        '...';...
        '{Working Directory}\FunImgNormalizedSmoothedDetrendedFiltered\Subject002\xxx001.img';...
        '{Working Directory}\FunImgNormalizedSmoothedDetrendedFiltered\Subject002\xxx002.img';...
        '...';...
        '';...

If you want to regress out other kind of covariates, DPARSF need covariates stored as Realign Parameters. You can save you covariates as rp*.txt, and stored in a directory follow DPARSF's instructions to cheat DPARSF as it is Realign Parameters.

DPARSF will prompt msgbox to tell you what you need to do when you click important checkboxs or buttons, please read the information carefully when you use DPARSF the first time.

Obviously, my intentions are to use a properly fitted CSF mask to regress out signal in CSF using DPARSF.  While I noticed the resolution for the default SPM5 gm, wm, csf masks match that of my epi images (i.e., 2x2x2), the size of these masks are 91, 109, 91 and my epi images are 75, 95, 69.  Does REST or SPM have mask that fit my epi images or must I resample and coregister my images to fit the mask?  or resample the masks to fit my epi images?  Alternatively, can I create better fitting masks somehow and change the default masks to the customized mask.

I appreciate your assistance,
Carlos

If you use DPARSF to preprocess your data, you will get data in 61*73*61 (voxel size: 3*3*3) if you use DPARSF's default normalize parameters.
You also can resample your own wm and csf mask to your EPI resolution, according to http://restfmri.net/forum/node/88 .
If you want to use your own wm and csf masks, then you need to do the following steps.
1. Click "Extract ROI time courses" checkbox.
2. Click "Define ROI" button, and define you ROI to your resampled wm or csf mask images.
3. Arrange your filtered data according to the prompt msgbox: Please arrange each subject's NIFTI images in one directory, and then put them in "FunImgNormalizedSmoothedDetrendedFilteredCovremoved" directory (or "FunImgNormalizedDetrendedFilteredCovremoved", if you choose "Data without smooth" checkbox) under the working directory!
4. Click "Run".
5. Rename extracted ROI time course file "Sub_001_ROITimeCourses.txt" under "FunImgNormalizedDetrendedFilteredCovremoved_RESTdefinedROITC" directory as "rpxxxxxx.txt", and copy it into a directory named the same as the Subject ID, and put this directory to "RealignParameter" directory under the working directory.
6. Click "Regress out nuisance covariates" checkbox, and select "6 head motion parameters" (do not select the Global mean signal, White matter signal and Cerebrolspinal fluid signal checkbox).
7. Arrange your filtered data according to the prompt msgbox: Please arrange each subject's NIFTI images in one directory, and then put them in "FunImgNormalizedSmoothedDetrendedFiltered" directory (or "FunImgNormalizedDetrendedFiltered", if you choose "Data without smooth" checkbox) under the working directory!
8. Click "Run".

Enjoy it!

... very much for your fast and helpful reply,
and sorry for my late!

all the best!
marcus 

dear rest team,
I understand the procedure and the workflow to regress out covariables from one subjects functional data.
How is it if I have more subjects (e.g. 20)? Is there already a solution for automatisation (batch...) existing, so that all 20 subjects are taken into account to extract the different time courses from? (of course with the same ROI definitions...)

Thank you very much for your reply, and any hint!

marcus

1. Click "Extract ROI time courses" checkbox.
2. Click "Define ROI" button, and define you ROI to your resampled ROI definition files.
3. Arrange your filtered data according to the prompt msgbox: Please arrange each subject's NIFTI images in one directory, and then put them in "FunImgNormalizedSmoothedDetrendedFilteredCovremoved" directory (or "FunImgNormalizedDetrendedFilteredCovremoved", if you choose "Data without smooth" checkbox) under the working directory!
4. Click "Run".
5. Rename extracted ROI time course file "Sub_001_ROITimeCourses.txt" under "FunImgNormalizedDetrendedFilteredCovremoved_RESTdefinedROITC" directory as "rpxxxxxx.txt", and copy it into a directory named the same as the Subject ID, and put this directory to "RealignParameter" directory under the working directory.
6. Click "Regress out nuisance covariates" checkbox, and select "6 head motion parameters" (do not select the Global mean signal, White matter signal and Cerebrolspinal fluid signal checkbox).
7. Arrange your filtered data according to the prompt msgbox: Please arrange each subject's NIFTI images in one directory, and then put them in "FunImgNormalizedSmoothedDetrendedFiltered" directory (or "FunImgNormalizedDetrendedFiltered", if you choose "Data without smooth" checkbox) under the working directory!
8. Click "Run".

Error | Forum of resting-state fMRI

Error

The website encountered an unexpected error. Please try again later.