Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
Class to calculate covariance and correlation. More...
#include <mitkCorrelationCalculator.h>
Public Types | |
enum | ParcelMode { UseAverageTimeSeries, UseMaximumCorrelation, UseAverageCorrelation } |
The ParcelMode enum defines how to define the correlation between two parcels. More... | |
Public Member Functions | |
mitkClassMacroItkParent (CorrelationCalculator, itk::Object) | |
Pointer | Clone () const |
std::vector< double > | ExtractAverageTimeSeriesOfParcel (int parcelValue) |
Extracts the average time series from a roi defined by the parcellation image. More... | |
void | DoWholeCorrelation () |
Create a #voxel x #voxel correlation matrix. More... | |
void | DoParcelCorrelation (ParcelMode mode=UseAverageTimeSeries) |
Create a #parcel x #parcel correlation matrix. More... | |
virtual void | Modified () |
Marks average time series as invalid and calls superclass modified. More... | |
const vnl_matrix< double > * | GetCorrelationMatrix () const |
const std::map< unsigned int, int > * | GetLabelOrderMap () const |
mitk::ConnectomicsNetwork::Pointer | GetConnectomicsNetwork () |
virtual void | SetParcellationImage (mitk::Image::Pointer _arg) |
virtual void | SetTimeSeriesImage (mitk::Image::Pointer _arg) |
Static Public Member Functions | |
static Pointer | New () |
static double | CalculatePearsonCorrelationCoefficient (const std::vector< T > &one, const std::vector< T > &two) |
Calculate and return the pearson correlation coefficient for two vectors of data. More... | |
static double | CalculateCovariance (const std::vector< T > &one, const std::vector< T > &two) |
Calculates the covariance of two vectors of data. More... | |
Protected Member Functions | |
virtual void | Modified () const override |
CorrelationCalculator () | |
virtual | ~CorrelationCalculator () |
template<typename TPixel , unsigned int VImageDimension> | |
void | ExtractAllAverageTimeSeries (itk::Image< TPixel, VImageDimension > *itkTimeSeriesImage) |
void | ExtractCenterOfMassForParcels () |
double | GetParcelCorrelation (const int &parcelA, const int &parcelB, ParcelMode &mode) const |
Protected Attributes | |
bool | m_InvalidTimeSeries |
mitk::Image::Pointer | m_ParcellationImage |
mitk::Image::Pointer | m_TimeSeriesImage |
std::map< int, std::vector< double > > | m_AverageTimeSeries |
std::map< int, std::vector< std::vector< T > > > | m_ParcelTimeSeries |
std::map< int, mitk::Point3D > | m_ParcelCenterOfMass |
vnl_matrix< double > | m_CorrelationMatrix |
std::map< unsigned int, int > | m_LabelOrderMap |
Class to calculate covariance and correlation.
In addition to static functions to calculate covariance and correlation, this class offers capability to set a time series image and optionally a parcellation image and calculate a correlation matrix.
Whole correlation only needs a time series image and will return a #voxel x #voxel matrix where each voxel's time series is correlated against the time series of each other voxel.
Parcel correlation will compute an average time series for each parcel of a parcellation image and create a #parcel x #parcel correlation matrix.
Please note that time series images are assumed to be 4D and parcellation images integer valued and 3D.
Definition at line 48 of file mitkCorrelationCalculator.h.
enum mitk::CorrelationCalculator::ParcelMode |
The ParcelMode enum defines how to define the correlation between two parcels.
Available choices are:
Enumerator | |
---|---|
UseAverageTimeSeries | |
UseMaximumCorrelation | |
UseAverageCorrelation |
Definition at line 68 of file mitkCorrelationCalculator.h.
|
protected |
|
protectedvirtual |
|
static |
Calculates the covariance of two vectors of data.
Expects two vectors of the same length and data type and returns the covariance of the two. Variance can be calculated by providing the same data vector twice.
one | first data vector |
two | second data vector |
|
static |
Calculate and return the pearson correlation coefficient for two vectors of data.
This function expects two vectors of the same length and data type and calculates the pearson correlation coefficient.
one | first data vector |
two | second data vector |
Pointer mitk::CorrelationCalculator< T >::Clone | ( | ) | const |
void mitk::CorrelationCalculator< T >::DoParcelCorrelation | ( | ParcelMode | mode = UseAverageTimeSeries | ) |
Create a #parcel x #parcel correlation matrix.
void mitk::CorrelationCalculator< T >::DoWholeCorrelation | ( | ) |
Create a #voxel x #voxel correlation matrix.
|
protected |
std::vector< double > mitk::CorrelationCalculator< T >::ExtractAverageTimeSeriesOfParcel | ( | int | parcelValue | ) |
Extracts the average time series from a roi defined by the parcellation image.
This function requires a parcellation image and a time series image to be set and registered to each other. For each voxel in the time series image it will check whether it is inside the specified parcel of the parcellation image. All inside voxels will be averaged for all time steps and an average time series is returned.
Calculates and saves the averages for all parcellations, to speed up consecutive calls.
parcelValue | the voxel value of the roi in the parcellation image. |
|
protected |
mitk::ConnectomicsNetwork::Pointer mitk::CorrelationCalculator< T >::GetConnectomicsNetwork | ( | ) |
const vnl_matrix< double >* mitk::CorrelationCalculator< T >::GetCorrelationMatrix | ( | ) | const |
const std::map< unsigned int, int >* mitk::CorrelationCalculator< T >::GetLabelOrderMap | ( | ) | const |
|
protected |
mitk::CorrelationCalculator< T >::mitkClassMacroItkParent | ( | CorrelationCalculator< T > | , |
itk::Object | |||
) |
|
virtual |
Marks average time series as invalid and calls superclass modified.
|
overrideprotectedvirtual |
|
static |
|
virtual |
|
virtual |
|
protected |
Definition at line 159 of file mitkCorrelationCalculator.h.
|
protected |
Definition at line 164 of file mitkCorrelationCalculator.h.
|
protected |
Definition at line 154 of file mitkCorrelationCalculator.h.
|
protected |
Definition at line 166 of file mitkCorrelationCalculator.h.
|
protected |
Definition at line 162 of file mitkCorrelationCalculator.h.
|
protected |
Definition at line 156 of file mitkCorrelationCalculator.h.
|
protected |
Definition at line 160 of file mitkCorrelationCalculator.h.
|
protected |
Definition at line 157 of file mitkCorrelationCalculator.h.