elyb01 / grayordinate_tools

Matlab script for regressing nuisance covariates out of fMRI data in CIFTI grayordinate space
2 stars 0 forks source link

Help required for using the code #1

Open shilpitju opened 4 years ago

shilpitju commented 4 years ago

Hi,

I tried using your code to regress out nuissance variables from the cifti dtseries file. My fmri data was preprocessed using fmriprep. Please clarify what it means when you say, "Any filtering/detrending applied to the input CIFTI data should also be applied to the nuisance regressors before running."

Secondly, when I created a .mat file of my normalised regressors and run the code, the obtained denoised file is reduced in size (almost half the original cifti input file). Please guide me where I am going wrong.

Thanks and regards,

Shilpi Modi

elyb01 commented 4 years ago

Hi Shilpi,

Glad to hear you're using these tools!

1) This means any additional denoising you do to your fMRI data should also be done to your nuisance regressors before they are regressed out. The idea is to avoid accidentally re-introducing unwanted variance you've removed from your fMRI data. The main place this has come up for me is removing noise parameters after using multi-run ICA-FIX with movement parameter regression disabled. ICA-FIX involves performing an ICA decomposition of the fMRI data, identifying noise ICs, and regressing them out of the fMRI timeseries. If you then want to perform movement parameter regression, you need to first regress the noise ICs out of the movement parameters before running the cifti_regress_nuisance script using the ICA-FIX denoised movement parameters as nuisance inputs. This generally applies to any other denoising steps you perform; e.g. by default ICA-FIX also performs 2000s high-pass filtering on fMRI data, so the movement parameters should have the same high-pass filter applied. Note that this is only relevant for nuisance regressors derived before cifti_regress_nuisance is run (e.g. movement parameters derived during realignment); if you derive another regressor from your data after using cifti_regress_nuisance (e.g. mean GM signal), variance from earlier regression steps has already been removed. Recent versions of ICA-FIX (after ~2019) included in the HCP Pipelines automatically generate a denoised version of the movement parameters if MP regression during ICA-FIX is disabled; you can feed this directly into cifti_regress_nuisance. I'm not sure if fmriprep outputs something similar, but I recently added a MP_regress_ICAFIX_noise script to the grayordinate_tools package to generate equivalent denoised MPs for use with older versions of ICA-FIX. This should be easy to modify to use on other nuisance regressors you're interested in including. If you have any questions, I'm happy to weigh in!

2) Do you mean the file size is smaller (e.g. 200MB --> 100MB), or the length of the CIFTI timeseries is shorter (e.g. 400 --> 200 volumes)? If it's only the file size, this may be related to the way the data are encoded. I suggest taking a look at the before and after files using wb_command -file-information to see if there are any obvious differences and wb_command -nifti-information -print-header to check if the datatype is the same (this was 16 for a few files I just checked at random).

Hope that helps! Let me know if you have any other issues or suggestions, -Ely

shilpitju commented 4 years ago

Thank you very much for your reply Dr. Ely. As of now I am not using ICA_FIX for nuisance regression. I just want to regress out the effect of motion and other covariates. I will definitely get in touch with you regarding ICA-FIX in future.

Regarding file size reduction yes it's only the file size that is smaller, length is the same. I eventually figured out that it's the way in which a cifti file is written. Whenever MATLAB tools are applied, they are applied on the real data and hence they show a file reduction.

Thank you again.

Regards,

Shilpi

Shilpi Modi, PhD

Postdoctoral Researcher,

Clinical Brain Mapping and Cognitive Neuroscience Laboratory,

Department of Neurology,

Thomas Jefferson University Sidney Kimmel Medical College,

1025 Walnut Street, Rm. 518,

Philadelphia, PA - 19107

(215) 503-8223


From: Benjamin A. Ely notifications@github.com Sent: Monday, October 19, 2020 9:34 PM To: elyb01/grayordinate_tools grayordinate_tools@noreply.github.com Cc: Shilpi Modi Shilpi.Modi@jefferson.edu; Author author@noreply.github.com Subject: Re: [elyb01/grayordinate_tools] Help required for using the code (#1)

WARNING: External Email - This email originated outside of Jefferson. DO NOT CLICK links or attachments unless you recognize the sender and are expecting the email.

Hi Shilpi,

Glad to hear you're using these tools!

  1. This means any additional denoising you do to your fMRI data should also be done to your nuisance regressors before they are regressed out. The idea is to avoid accidentally re-introducing unwanted variance you've removed from your fMRI data. The main place this has come up for me is removing noise parameters after using multi-run ICA-FIX with movement parameter regression disabled. ICA-FIX involves performing an ICA decomposition of the fMRI data, identifying noise ICs, and regressing them out of the fMRI timeseries. If you then want to perform movement parameter regression, you need to first regress the noise ICs out of the movement parameters before running the cifti_regress_nuisance script using the ICA-FIX denoised movement parameters as nuisance inputs. This generally applies to any other denoising steps you perform; e.g. by default ICA-FIX also performs 2000s high-pass filtering on fMRI data, so the movement parameters should have the same high-pass filter applied. Note that this is only relevant for nuisance regressors derived before cifti_regress_nuisance is run (e.g. movement parameters derived during realignment); if you derive another regressor from your data after using cifti_regress_nuisance (e.g. mean GM signal), variance from earlier regression steps has already been removed. Recent versions of ICA-FIX (after ~2019) included in the HCP Pipelines automatically generate a denoised version of the movement parameters if MP regression during ICA-FIX is disabled; you can feed this directly into cifti_regress_nuisance. I'm not sure if fmriprep outputs something similar, but I recently added a MP_regress_ICAFIX_noise script to the grayordinate_tools package to generate equivalent denoised MPs for use with older versions of ICA-FIX. This should be easy to modify to use on other nuisance regressors you're interested in including. If you have any questions, I'm happy to weigh in!

  2. Do you mean the file size is smaller (e.g. 200MB --> 100MB), or the length of the CIFTI timeseries is shorter (e.g. 400 --> 200 volumes)? If it's only the file size, this may be related to the way the data are encoded. I suggest taking a look at the before and after files using wb_command -file-information to see if there are any obvious differences and wb_command -nifti-information -print-header to check if the datatype is the same (this was 16 for a few files I just checked at random).

Hope that helps! Let me know if you have any other issues or suggestions, -Ely

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Felyb01%2Fgrayordinate_tools%2Fissues%2F1%23issuecomment-712532683&data=04%7C01%7Cshilpi.modi%40jefferson.edu%7Cee98e37d136e4f0c702f08d874983c5e%7C55a89906c710436bbc444c590cb67c4a%7C0%7C0%7C637387544482877923%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=wiSD5OtL25fSfwZP%2BvjDrTJt8MMJAnheBbGG1S3RnEE%3D&reserved=0, or unsubscribehttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FANUI7FV37ADTZ72G37EBASLSLTSIZANCNFSM4SGDEKRQ&data=04%7C01%7Cshilpi.modi%40jefferson.edu%7Cee98e37d136e4f0c702f08d874983c5e%7C55a89906c710436bbc444c590cb67c4a%7C0%7C0%7C637387544482887874%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=4twGq1H8%2Few1E7ApVK8jC8mF%2BvNdNwLyZDPNvH9fQ6Y%3D&reserved=0.

The information contained in this transmission contains privileged and confidential information. It is intended only for the use of the person named above. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

CAUTION: Intended recipients should NOT use email communication for emergent or urgent health care matters.