Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH]: Support parcel aggregation with eigenvariate #285

Open
1 task done
tomug opened this issue Dec 14, 2023 · 0 comments
Open
1 task done

[ENH]: Support parcel aggregation with eigenvariate #285

tomug opened this issue Dec 14, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request triage New issues waiting to be reviewed

Comments

@tomug
Copy link
Contributor

tomug commented Dec 14, 2023

Are you requiring a new dataset or marker?

  • I understand this is not a marker or dataset request

Which feature do you want to include?

Parcellation is usually done by aggregating into mean time series per parcel.

SPM provides an option to aggregate using the first eigenvariate time series per parcel as briefly mentioned in the following publication: https://doi.org/10.1016/j.neuroimage.2005.08.012

"Generally, the best (minimum variance) unbiased estimate of the fROI response would involve spatially whitening the data, accounting for spatial correlations and inhomogeneity in both signal and noise.[...] We generally deal with this by taking the first eigenvariate of an fROI, which uses the temporal covariance of voxels in the fROI to find coherent spatial modes of activity (see spm_regions at http://www.fil.ion.ucl.ac.uk/spm). The principal eigenvariate is, like the average, simply a summary of the responses within an fROI. Unlike the average, it does not assume homogenous responses within the fROI."

SPM's MATLAB implementation of the first eigenvariate:
https://github.com/spm/spm12/blob/3085dac00ac804adb190a7e82c6ef11866c8af02/spm_regions.m#L179

The Python implementation I used so far:
https://github.com/weidongcai/GeneralScripts/blob/0a0253346acffc21849c1f66f4fb2bf7ac79e8de/Python3.5/fMRIAnalysisModule/ROIAnalysisModule.py#L17

SPM suggests pre-whitening the data before extraction: https://en.wikibooks.org/wiki/SPM/Timeseries_extraction

"More specifically, it is the first principal component or eigenvariate of the pre-whitened, high-pass filtered and confounded-corrected timeseries in the selected region."

Pre-whitening by SPM is supposedly done in this function:
https://github.com/spm/spm12/blob/3085dac00ac804adb190a7e82c6ef11866c8af02/spm_filter.m

But I couldn't figure it out so I defaulted to demeaning the time series before generating parcels using scipy's signal class: 'voxel_ts_demean = scisig.detrend(voxel_ts_raw, type='constant')'

How do you imagine this integrated in junifer?

extend get_aggfunc_by_name function with an "eigenvariate" option

Do you have a sample code that implements this outside of junifer?

No response

Anything else to say?

No response

@tomug tomug added enhancement New feature or request triage New issues waiting to be reviewed labels Dec 14, 2023
@tomug tomug changed the title [ENH]: Provide parcel aggregation with eigenvariate [ENH]: Support parcel aggregation with eigenvariate Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage New issues waiting to be reviewed
Projects
None yet
Development

No branches or pull requests

3 participants