Skip to content

[ENH]: Support parcel aggregation with eigenvariate  #285

@tomug

Description

@tomug

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

Metadata

Metadata

Labels

enhancementNew feature or requesttriageNew issues waiting to be reviewed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions