Time Series Analysis: Difference between revisions
(7 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
If the intention is to explore correlations among regional time series or a functional connectivity analysis, you should additionally consider preprocessing the data to remove some artefacts that may influence your results, and could cause problems down the road that might necessitate a complete re-analysis. | If the intention is to explore correlations among regional time series or a functional connectivity analysis, you should additionally consider preprocessing the data to remove some artefacts that may influence your results, and could cause problems down the road that might necessitate a complete re-analysis. | ||
=== | === [[Detrending FreeSurfer Data|Detrending]] === | ||
The | The second step is to ''detrend'' your functional data, which is to remove a linear signal drift from your data. | ||
Over the course of a run, there can be a linear drift in the signal in different regions of the brain. There are many possible causes for this that have nothing to do with any interesting aspect of your data -- in other words, this linear drift is a nuisance artifact because it introduces spurious correlations between two unrelated time series. | |||
You can see this for yourself in a quick experiment you could whip up in Excel: take two vectors of 100 randomly generated numbers (e.g., <code>randbetween(1,99))</code>. They should be uncorrelated. Now add 1, 2, 3, ... , 99, 100 to the values in each vector. This simulates a linear trend in the data. You shouldn't be surprised to find that the two vectors are now highly and positively correlated! | |||
=== Parcellation Using Anatomical and Functional Regions === | |||
The second precondition for these analyses in surface space is that the anatomical data must be processed in [[FreeSurfer#Structural_Preprocessing | FreeSurfer]], and a [[FreeSurfer#Functional_Analysis | functional analysis]] must be run on the BOLD data. These data are stored in voxel-space .mgz files. Rather than explore the time-series of activations for each voxel individually (there are many thousands of them), we will instead be aggregating over groups of voxels in [[:Category:ROI|regions of interest]]. | |||
==== Anatomical (Atlas-Based) Parcellation ==== | ==== Anatomical (Atlas-Based) Parcellation ==== | ||
Line 16: | Line 23: | ||
Significant activation clusters are also a good choice for time series analysis, as they allow analyses of time series that are restricted to those brain regions that are reliably associated with a task or experimental condition. Care must be taken in the selection of an appropriate contrast to avoid biasing the data (a.k.a. cherry-picking), making your results a foregone conclusion. For example, if you used significant clusters in an A>B contrast as ROIs, you shouldn't be surprised to find that the time series data extracted from these regions has a greater mean signal during blocks of Condition A than during blocks of Condition B. In general, the functional contrast used to generate ROIs should be orthogonal or equally weighted with respect to the conditions you wish to discriminate between in your time series analysis. For example, if your experimental task has 2 conditions, A and B, a good choice for a functional ROI might be task vs. baseline. | Significant activation clusters are also a good choice for time series analysis, as they allow analyses of time series that are restricted to those brain regions that are reliably associated with a task or experimental condition. Care must be taken in the selection of an appropriate contrast to avoid biasing the data (a.k.a. cherry-picking), making your results a foregone conclusion. For example, if you used significant clusters in an A>B contrast as ROIs, you shouldn't be surprised to find that the time series data extracted from these regions has a greater mean signal during blocks of Condition A than during blocks of Condition B. In general, the functional contrast used to generate ROIs should be orthogonal or equally weighted with respect to the conditions you wish to discriminate between in your time series analysis. For example, if your experimental task has 2 conditions, A and B, a good choice for a functional ROI might be task vs. baseline. | ||
===== Fine Tuning Parcellations ===== | |||
Regions can be generated from significant clusters identified in group-level contrasts. Oftentimes, these clusters will have a range of cortical extents (i.e., big and small clusters). Likewise, many anatomical region definitions vary in size. We typically subdivide regions so that they are of more comparable size. We have developed tools to work with surface ROI definitions, described in more detail in the [[Freesurfer Subparcellation]] page. | |||
=== [[Time Series Data in Surface Space | Extract Timecourse Data to Text File]] === | === [[Time Series Data in Surface Space | Extract Timecourse Data to Text File]] === | ||
Line 44: | Line 42: | ||
===Functional Connectivity Overview of Steps=== | ===Functional Connectivity Overview of Steps=== | ||
#Import detrended time series | #Import detrended time series | ||
#Normalize time series | #Optional data transformation | ||
#Binarize/Scale time series | ##Normalize time series (required for scaling/binarizing) | ||
#Compute | ##Binarize/Scale time series (required for autoencoder connectivity) | ||
#Compute 1 or more of the following connectivity metrics between regions: | |||
#*Correlation | |||
#*R<sup>2</sup> (all connections are positive) | |||
#*Mutual Information (all connections are positive; sensitive to nonlinear relationships) | |||
#*Autoencoder weight matrix (extremely flexible using different architectures) | |||
#Run analyses on connectivity matrices | #Run analyses on connectivity matrices | ||
[[Category: Time Series]] | [[Category: Time Series]] |
Latest revision as of 11:51, 28 June 2022
Inferences about functional connectivity can be made from analyses of time series data. The underlying assumption is that correlations between brain activity in different brain regions indexes connectivity between them. These correlations are calculated over vectors of activation values across a period of time.
When doing these analyses on MRI data, we must define the regions from which these time series will be drawn, and then extract the time series for each region that will be entered into the analysis. The time series vectors are saved into a flexibly interpretable file (e.g., plaintext) that can be read into some other software suitable for operating over sets of numbers (e.g., R, MATLAB, Excel).
FreeSurfer
Preprocessing for Connectivity Analyses
If the intention is to explore correlations among regional time series or a functional connectivity analysis, you should additionally consider preprocessing the data to remove some artefacts that may influence your results, and could cause problems down the road that might necessitate a complete re-analysis.
Detrending
The second step is to detrend your functional data, which is to remove a linear signal drift from your data.
Over the course of a run, there can be a linear drift in the signal in different regions of the brain. There are many possible causes for this that have nothing to do with any interesting aspect of your data -- in other words, this linear drift is a nuisance artifact because it introduces spurious correlations between two unrelated time series.
You can see this for yourself in a quick experiment you could whip up in Excel: take two vectors of 100 randomly generated numbers (e.g., randbetween(1,99))
. They should be uncorrelated. Now add 1, 2, 3, ... , 99, 100 to the values in each vector. This simulates a linear trend in the data. You shouldn't be surprised to find that the two vectors are now highly and positively correlated!
Parcellation Using Anatomical and Functional Regions
The second precondition for these analyses in surface space is that the anatomical data must be processed in FreeSurfer, and a functional analysis must be run on the BOLD data. These data are stored in voxel-space .mgz files. Rather than explore the time-series of activations for each voxel individually (there are many thousands of them), we will instead be aggregating over groups of voxels in regions of interest.
Anatomical (Atlas-Based) Parcellation
The brain regions from which the time series are drawn can be defined any number of ways. One way of defining these regions has been to use anatomical region definitions. Because different anatomical regions vary greatly in size, we have been using the Lausanne 2008 parcellation scheme to divide the cortex into roughly 1000 regions of comparable size. The second precondition for this analysis is to define your regions of interest. Any definition method that has been documented is allowable, though at this point, instructions exist on this wiki for the Lausanne 2008 parcellation scheme.
Functional Parcellation
Significant activation clusters are also a good choice for time series analysis, as they allow analyses of time series that are restricted to those brain regions that are reliably associated with a task or experimental condition. Care must be taken in the selection of an appropriate contrast to avoid biasing the data (a.k.a. cherry-picking), making your results a foregone conclusion. For example, if you used significant clusters in an A>B contrast as ROIs, you shouldn't be surprised to find that the time series data extracted from these regions has a greater mean signal during blocks of Condition A than during blocks of Condition B. In general, the functional contrast used to generate ROIs should be orthogonal or equally weighted with respect to the conditions you wish to discriminate between in your time series analysis. For example, if your experimental task has 2 conditions, A and B, a good choice for a functional ROI might be task vs. baseline.
Fine Tuning Parcellations
Regions can be generated from significant clusters identified in group-level contrasts. Oftentimes, these clusters will have a range of cortical extents (i.e., big and small clusters). Likewise, many anatomical region definitions vary in size. We typically subdivide regions so that they are of more comparable size. We have developed tools to work with surface ROI definitions, described in more detail in the Freesurfer Subparcellation page.
Extract Timecourse Data to Text File
The third step is to extract the timeseries data from the brain regions that you wish to include in your network.
Until recently, this lab has focused on functional networks across cortical regions in surface space (i.e., ignoring subcortical regions), but we have recently started working with time series data in voxel space.
SPM
Steps for SPM data have not been implemented yet.
MANOVA Analyses of Time Series
This page wasn't originally written with these sorts of analyses in mind, but I just now analyzed a time series of computational model performance, and this seemed like a good place to put a hook for this sort of analysis.
Functional Connectivity
One application of time series analysis is to generate functional connectivity matrices. Our lab explores different approaches of producing, analyzing and using these matrices, but a (relatively) quick and dirty way of producing a connectivity matrix is to calculate the cross-correlation between each pair of regions in the data. A simple Pearson correlation is a special case of the more general cross-correlation, with a lag of 0. Another approach we are investigating uses artificial neural networks to learn correlations among node activations.
Functional Connectivity Overview of Steps
- Import detrended time series
- Optional data transformation
- Normalize time series (required for scaling/binarizing)
- Binarize/Scale time series (required for autoencoder connectivity)
- Compute 1 or more of the following connectivity metrics between regions:
- Correlation
- R2 (all connections are positive)
- Mutual Information (all connections are positive; sensitive to nonlinear relationships)
- Autoencoder weight matrix (extremely flexible using different architectures)
- Run analyses on connectivity matrices