PennLINC / xcpEngine

Official public repository for the XCP Engine. This tool is deprecated in favor of XCP-D and ASLPrep.
MIT License
66 stars 42 forks source link

Differences between scrubbing methods in volume and surface space. #464

Closed YukiSakai1209 closed 2 years ago

YukiSakai1209 commented 2 years ago

This is quite a simple question.

I conducted the confounds regression of fmriprep using 36p_scrub.dsn. Although the number of volumes of sub-{}_residualised.nii.gz was (total number of volumes - nVolumesCensored), the number of volumes of sub-{}_residualised_space-fsLR_den-91k_bold.dtseries.nii was equal to the total number of volumes.

Since the sub-{}_confmat.1D included the scrubbed volumes as regressors, I think that scrubbing was conducted as follows:

In my understanding, these methods are equivalent. Is my understanding correct?

YukiSakai1209 commented 2 years ago

@a3sha2 I checked the codes. ${out[sub]}/confound2/${prefix}_confmat.1D (NOT ${out[sub]}/regress/${prefix}_confmat.1D) is used in regress module for the surface processing ( 475-485 lines in https://github.com/PennLINC/xcpEngine/blob/master/modules/regress/regress.mod ). Therefore, in my understanding, sub-{}_residualised_space-fsLR_den-91k_bold.dtseries.nii is the output without the scrubbing (only regressing out 36p confounds) even if we used the 36p_scrub.dsn.

Is my understanding correct?

a3sha2 commented 2 years ago

Hi @YukiSakai1209

You are right.

  1. xcp do not include censored volumes in the regression. The regression is done on the good volumes, the interpolation done over censored volumes to replace it. for nifti volumes, there is uncensored volumes in the regresse folder that consist all the volumes after interpolation similar to sub-{}_residualised_space-fsLR_den-91k_bold.dtseries.nii
  2. if you want to removed the censored volumes from sub-{}_residualised_space-fsLR_den-91k_bold.dtseries.nii for further analyses, there is sub-{}_nflag*txt file that revealed which volume is censored(1) and which volume is not(0). I believe you can used that to remove censored volume sfrom sub-{}_residualised_space-fsLR_den-91k_bold.dtseries.nii
  3. We are working on python packages that process both nifti and cifti, it will be available soon.
YukiSakai1209 commented 2 years ago

@a3sha2 Thank you very much!

The regression is done on the good volumes, the interpolation done over censored volumes to replace it. for nifti volumes, there is uncensored volumes in the regresse folder that consist all the volumes after interpolation similar to sub-{}_residualised_space-fsLR_den-91k_bold.dtseries.nii

Let me confirm. Does the interpolation mean the replace process to remove censored volumes (e.g., linear interpolation using the pre- and post-censored volumes)? If it is correct, uncensored volumes and sub-{}_residualised_space-fsLR_den-91k_bold.dtseries.nii are also scrubbed using interpolation?? In my understanding, I believed that uncensored volumes are pre-censoring residuals. Maybe, I’m confusing.

If so, which part of the code work for interpolation of the surface signals. I cannot find it.

YukiSakai1209 commented 2 years ago

@a3sha2 I checked the output of one subject of my data, processed using 36p_scrub.

I plot signals of this subject in ROIs Time manner (attached). As you suggested, in uncensored * volumes, the flagged volumes seem to be interpolated (very low signals mentioned in https://github.com/PennLINC/xcpEngine/issues/212 ). However, in sub-{}_residualised_space-fsLR_den-91k_bold.dtseries.nii, interpolation seems not to be conducted.

Therefore, it seems that

As you suggested, I can remove censored volume from sub-{}_residualised_space-fsLR_den-91k_bold.dtseries.nii. However, different from the volume space process, spike regressors are not added at all into the model (in the volume space process, spike regressors are added to ensure that the model fit ignores high-motion volumes). Is it OK that I simply remove the flagged volumes from sub-{}_residualised_space-fsLR_den-91k_bold.dtseries.nii to get the scrubbed signals from CIFTI outputs? fig_code_03_check_how_scrubbing_works

a3sha2 commented 2 years ago

hi @YukiSakai1209

Sorry for late response. scrubbing was not applied to surface processing, it was only applied to volume. I would suggest you convert nifti files to dtseries.

YukiSakai1209 commented 2 years ago

@a3sha2 I understand. It is quite confusing that sub-{}_residualised_space-fsLR_den-91k_bold.dtseries.nii was not scrubbed even if we use the 36p_scrub.dsn. It might be better to add some explanation about it.