help > Extracting aCompCor parameters for use in SPM
Showing 1-6 of 6 posts
Display:
Results per page:
Feb 12, 2020  08:02 PM | Yann Quide
Extracting aCompCor parameters for use in SPM
Hi Alfonso,

Is there a simple way to extract the aCompCor parameters, along with the ART parameters, through CONN? I would like to use these parameters (1 file? 2 files?) as regressors to include to create a new SPM 1st level model (outside of CONN)?

I selected the 'create confound-corrected time series' option in the Setup->Options tab, but can't seem to find these files. unless I am not looking for the good file?


Thanks for your time,

Yann
Feb 12, 2020  10:02 PM | Alfonso Nieto-Castanon - Boston University
RE: Extracting aCompCor parameters for use in SPM
Hi Yann,

Sure, there are several ways to do this. One simple way (using the latest release, and assuming that you already have preprocessed your data in CONN) would be using the syntax:

conn_batch( 'Setup.preprocessing.steps', 'functional_regression',...
                   'Setup.preprocessing.reg_names', {'realignment','scrubbing','White Matter','CSF'}, ...
                  'Setup.preprocessing.reg_dimensions',[inf, inf, 5, 5], ...
                  'Setup.preprocessing.reg_skip', 1, ...
                  'Setup.preprocessing.reg_deriv', [1, 0, 0, 0]);


That will create a new file named dp_*.txt for each subject and for each session containing all CompCor and ART regressors, which you could then directly import in SPM as regressors of no interest for your first-level model. 

Also, in case you are interested, we also added in the latest release several functionality intended mainly for those who want to use CONN just for preprocessing/denoising their data, and then using that data in SPM or any other software package. That is all packed through the "conn_module" function (see doc conn_module and/or the "how-to" sections in https://www.conn-toolbox.org/fmri-method... for more details). 

Best
Alfonso

 
Originally posted by Yann Quide:
Hi Alfonso,

Is there a simple way to extract the aCompCor parameters, along with the ART parameters, through CONN? I would like to use these parameters (1 file? 2 files?) as regressors to include to create a new SPM 1st level model (outside of CONN)?

I selected the 'create confound-corrected time series' option in the Setup->Options tab, but can't seem to find these files. unless I am not looking for the good file?


Thanks for your time,

Yann
Feb 12, 2020  11:02 PM | Yann Quide
RE: Extracting aCompCor parameters for use in SPM
Thanks Alfonso.

What if the data were processed outside of CONN (in SPM8), and then imported just for denoising? For this particular analysis, I would appreciate not to reprocess my data... So far, I imported my smoothed images as functional, the WM and CSF masks as ROI, and the ART regressors as 1st level covariate. 

Also, thanks for the new version!

Cheers,

Yann


Originally posted by Alfonso Nieto-Castanon:
Hi Yann,

Sure, there are several ways to do this. One simple way (using the latest release, and assuming that you already have preprocessed your data in CONN) would be using the syntax:

conn_batch( 'Setup.preprocessing.steps', 'functional_regression',...
                   'Setup.preprocessing.reg_names', {'realignment','scrubbing','White Matter','CSF'}, ...
                  'Setup.preprocessing.reg_dimensions',[inf, inf, 5, 5], ...
                  'Setup.preprocessing.reg_skip', 1, ...
                  'Setup.preprocessing.reg_deriv', [1, 0, 0, 0]);


That will create a new file named dp_*.txt for each subject and for each session containing all CompCor and ART regressors, which you could then directly import in SPM as regressors of no interest for your first-level model. 

Also, in case you are interested, we also added in the latest release several functionality intended mainly for those who want to use CONN just for preprocessing/denoising their data, and then using that data in SPM or any other software package. That is all packed through the "conn_module" function (see doc conn_module and/or the "how-to" sections in https://www.conn-toolbox.org/fmri-method... for more details). 

Best
Alfonso

 
Originally posted by Yann Quide:
Hi Alfonso,

Is there a simple way to extract the aCompCor parameters, along with the ART parameters, through CONN? I would like to use these parameters (1 file? 2 files?) as regressors to include to create a new SPM 1st level model (outside of CONN)?

I selected the 'create confound-corrected time series' option in the Setup->Options tab, but can't seem to find these files. unless I am not looking for the good file?


Thanks for your time,

Yann
Feb 13, 2020  01:02 PM | Alfonso Nieto-Castanon - Boston University
RE: Extracting aCompCor parameters for use in SPM
Hi Yann,

Sure, that would be perfectly fine, simply make sure to:

1) also include the realignment parameters (e.g. rp_*.txt files produced during functional realignment) as first-level covariates in CONN

2) name/rename the first-level covariate with motion parameters "realignment", and the first-level covariate with ART outliers "scrubbing"

When doing this, the conn_batch('Setup.preprocessing.steps','functional_regression',...) syntax should work just the same as if you had run your preprocessing steps using CONN

Best
Alfonso
Originally posted by Yann Quide:
Thanks Alfonso.

What if the data were processed outside of CONN (in SPM8), and then imported just for denoising? For this particular analysis, I would appreciate not to reprocess my data... So far, I imported my smoothed images as functional, the WM and CSF masks as ROI, and the ART regressors as 1st level covariate. 

Also, thanks for the new version!

Cheers,

Yann


Originally posted by Alfonso Nieto-Castanon:
Hi Yann,

Sure, there are several ways to do this. One simple way (using the latest release, and assuming that you already have preprocessed your data in CONN) would be using the syntax:

conn_batch( 'Setup.preprocessing.steps', 'functional_regression',...
                   'Setup.preprocessing.reg_names', {'realignment','scrubbing','White Matter','CSF'}, ...
                  'Setup.preprocessing.reg_dimensions',[inf, inf, 5, 5], ...
                  'Setup.preprocessing.reg_skip', 1, ...
                  'Setup.preprocessing.reg_deriv', [1, 0, 0, 0]);


That will create a new file named dp_*.txt for each subject and for each session containing all CompCor and ART regressors, which you could then directly import in SPM as regressors of no interest for your first-level model. 

Also, in case you are interested, we also added in the latest release several functionality intended mainly for those who want to use CONN just for preprocessing/denoising their data, and then using that data in SPM or any other software package. That is all packed through the "conn_module" function (see doc conn_module and/or the "how-to" sections in https://www.conn-toolbox.org/fmri-method... for more details). 

Best
Alfonso

 
Originally posted by Yann Quide:
Hi Alfonso,

Is there a simple way to extract the aCompCor parameters, along with the ART parameters, through CONN? I would like to use these parameters (1 file? 2 files?) as regressors to include to create a new SPM 1st level model (outside of CONN)?

I selected the 'create confound-corrected time series' option in the Setup->Options tab, but can't seem to find these files. unless I am not looking for the good file?


Thanks for your time,

Yann
Feb 19, 2020  02:02 AM | Yann Quide
RE: Extracting aCompCor parameters for use in SPM
Hi Alfonso,

Many thanks for that, it worked perfectly!

Few follow-up questions:

1) In that dp_*.txt file, there is a column of 1s only. Is it meant to represent the session? When using it, SPM tells me that this factor is not uniquely specified in the design matrix. Should I ignore this?

2) If I were to export CONN preprocessed files to SPM to build 1st level models and then do my activation analyses, am I right to think that I should use the dswu*.nii files? Can I assume they represent the denoised files? That is, using these files, do I still need to add any other covariates (eg movements, scrubbing, aCompCor etc) to build my models?

If I misunderstood, could you direct me on to the correct files to use to build my 1st level models in SPM?

Thanks again for your time, it is really appreciated.

Yann

Originally posted by Alfonso Nieto-Castanon:
Hi Yann,

Sure, that would be perfectly fine, simply make sure to:

1) also include the realignment parameters (e.g. rp_*.txt files produced during functional realignment) as first-level covariates in CONN

2) name/rename the first-level covariate with motion parameters "realignment", and the first-level covariate with ART outliers "scrubbing"

When doing this, the conn_batch('Setup.preprocessing.steps','functional_regression',...) syntax should work just the same as if you had run your preprocessing steps using CONN

Best
Alfonso
Originally posted by Yann Quide:
Thanks Alfonso.

What if the data were processed outside of CONN (in SPM8), and then imported just for denoising? For this particular analysis, I would appreciate not to reprocess my data... So far, I imported my smoothed images as functional, the WM and CSF masks as ROI, and the ART regressors as 1st level covariate. 

Also, thanks for the new version!

Cheers,

Yann


Originally posted by Alfonso Nieto-Castanon:
Hi Yann,

Sure, there are several ways to do this. One simple way (using the latest release, and assuming that you already have preprocessed your data in CONN) would be using the syntax:

conn_batch( 'Setup.preprocessing.steps', 'functional_regression',...
                   'Setup.preprocessing.reg_names', {'realignment','scrubbing','White Matter','CSF'}, ...
                  'Setup.preprocessing.reg_dimensions',[inf, inf, 5, 5], ...
                  'Setup.preprocessing.reg_skip', 1, ...
                  'Setup.preprocessing.reg_deriv', [1, 0, 0, 0]);


That will create a new file named dp_*.txt for each subject and for each session containing all CompCor and ART regressors, which you could then directly import in SPM as regressors of no interest for your first-level model. 

Also, in case you are interested, we also added in the latest release several functionality intended mainly for those who want to use CONN just for preprocessing/denoising their data, and then using that data in SPM or any other software package. That is all packed through the "conn_module" function (see doc conn_module and/or the "how-to" sections in https://www.conn-toolbox.org/fmri-method... for more details). 

Best
Alfonso

 
Originally posted by Yann Quide:
Hi Alfonso,

Is there a simple way to extract the aCompCor parameters, along with the ART parameters, through CONN? I would like to use these parameters (1 file? 2 files?) as regressors to include to create a new SPM 1st level model (outside of CONN)?

I selected the 'create confound-corrected time series' option in the Setup->Options tab, but can't seem to find these files. unless I am not looking for the good file?


Thanks for your time,

Yann
Feb 19, 2020  08:02 PM | Alfonso Nieto-Castanon - Boston University
RE: Extracting aCompCor parameters for use in SPM
Hi Yann,

Regarding (1), yes, that is perfectly fine, SPM always explicitly adds to the design matrix a column of all 1's per session/run in order to control for main session effects, so this message is simply telling you that this modeled effect is redundant given that the same regressor exists within the dp_*.txt file. That said, SPM will not have any trouble handling this redundancy in the design matrix, so feel free to ignore this message. 

Regarding (2), this may be open-to-debate but my recommendation is that, if you are planning to run first-level analyses in SPM, then use the original data (e.g. swu*.nii files) but enter explicitly in SPM's design matrix as additional regressors the dp_*.txt covariates. That should handle potential covariation between noise- and task- effects better than simply entering the denoised data into your first-level analyses. On the other hand, if you are planning to run analyses outside of SPM (e.g. ICA or any other set of analyses which do not explicitly consider/model temporal regressors) then simply use the denoised data (dswu*.ni files) instead of the original data (swu*.nii files)

Hope this helps
Alfonso


Originally posted by Yann Quide:
Hi Alfonso,

Many thanks for that, it worked perfectly!

Few follow-up questions:

1) In that dp_*.txt file, there is a column of 1s only. Is it meant to represent the session? When using it, SPM tells me that this factor is not uniquely specified in the design matrix. Should I ignore this?

2) If I were to export CONN preprocessed files to SPM to build 1st level models and then do my activation analyses, am I right to think that I should use the dswu*.nii files? Can I assume they represent the denoised files? That is, using these files, do I still need to add any other covariates (eg movements, scrubbing, aCompCor etc) to build my models?

If I misunderstood, could you direct me on to the correct files to use to build my 1st level models in SPM?

Thanks again for your time, it is really appreciated.

Yann

Originally posted by Alfonso Nieto-Castanon:
Hi Yann,

Sure, that would be perfectly fine, simply make sure to:

1) also include the realignment parameters (e.g. rp_*.txt files produced during functional realignment) as first-level covariates in CONN

2) name/rename the first-level covariate with motion parameters "realignment", and the first-level covariate with ART outliers "scrubbing"

When doing this, the conn_batch('Setup.preprocessing.steps','functional_regression',...) syntax should work just the same as if you had run your preprocessing steps using CONN

Best
Alfonso
Originally posted by Yann Quide:
Thanks Alfonso.

What if the data were processed outside of CONN (in SPM8), and then imported just for denoising? For this particular analysis, I would appreciate not to reprocess my data... So far, I imported my smoothed images as functional, the WM and CSF masks as ROI, and the ART regressors as 1st level covariate. 

Also, thanks for the new version!

Cheers,

Yann


Originally posted by Alfonso Nieto-Castanon:
Hi Yann,

Sure, there are several ways to do this. One simple way (using the latest release, and assuming that you already have preprocessed your data in CONN) would be using the syntax:

conn_batch( 'Setup.preprocessing.steps', 'functional_regression',...
                   'Setup.preprocessing.reg_names', {'realignment','scrubbing','White Matter','CSF'}, ...
                  'Setup.preprocessing.reg_dimensions',[inf, inf, 5, 5], ...
                  'Setup.preprocessing.reg_skip', 1, ...
                  'Setup.preprocessing.reg_deriv', [1, 0, 0, 0]);


That will create a new file named dp_*.txt for each subject and for each session containing all CompCor and ART regressors, which you could then directly import in SPM as regressors of no interest for your first-level model. 

Also, in case you are interested, we also added in the latest release several functionality intended mainly for those who want to use CONN just for preprocessing/denoising their data, and then using that data in SPM or any other software package. That is all packed through the "conn_module" function (see doc conn_module and/or the "how-to" sections in https://www.conn-toolbox.org/fmri-method... for more details). 

Best
Alfonso

 
Originally posted by Yann Quide:
Hi Alfonso,

Is there a simple way to extract the aCompCor parameters, along with the ART parameters, through CONN? I would like to use these parameters (1 file? 2 files?) as regressors to include to create a new SPM 1st level model (outside of CONN)?

I selected the 'create confound-corrected time series' option in the Setup->Options tab, but can't seem to find these files. unless I am not looking for the good file?


Thanks for your time,

Yann