Public Types | Public Member Functions
CICAAnalysis Class Reference

class for ICA analysis and use of such data. This class implements basic operations for of ICA. It makes use of the ITPP implementation of FastICA. More...

#include <mia/core/ica.hh>

Public Types

typedef std::set< size_t > IndexSet
 defines a set of indices used for mixing More...
 
typedef itpp::Vec
< itpp::mat::value_type > 
itppvector
 The type of a vector as used by IT++. More...
 

Public Member Functions

 CICAAnalysis (const itpp::mat &ic, const itpp::mat &mix, const std::vector< float > &mean)
 
 CICAAnalysis (size_t series_length, size_t slice_size)
 
std::vector< float > get_delta_feature (const IndexSet &plus, const IndexSet &minus) const
 
std::vector< float > get_feature_row (size_t row) const
 
std::vector< float > get_incomplete_mix (size_t idx, const IndexSet &skip) const
 
std::vector< float > get_mix (size_t idx) const
 
std::vector< float > get_mix_series (size_t row) const
 
CSlopeColumns get_mixing_curves () const
 
size_t get_ncomponents () const
 
std::vector< float > get_partial_mix (size_t idx, const IndexSet &use) const
 
void normalize_ICs ()
 
std::vector< float > normalize_Mix ()
 
bool run (size_t nica, std::vector< std::vector< float > > guess)
 
void run_auto (int max_ica, int min_ica, float corr_thresh=0.9)
 
void set_approach (int approach)
 
void set_max_iterations (int n)
 
void set_mixing_series (size_t index, const std::vector< float > &series)
 
template<class Iterator >
void set_row (size_t row, Iterator begin, Iterator end)
 
 ~CICAAnalysis ()
 

Detailed Description

class for ICA analysis and use of such data. This class implements basic operations for of ICA. It makes use of the ITPP implementation of FastICA.

Definition at line 41 of file core/ica.hh.

Member Typedef Documentation

typedef std::set<size_t> CICAAnalysis::IndexSet

defines a set of indices used for mixing

Definition at line 63 of file core/ica.hh.

typedef itpp::Vec<itpp::mat::value_type> CICAAnalysis::itppvector

The type of a vector as used by IT++.

Definition at line 45 of file core/ica.hh.

Constructor & Destructor Documentation

CICAAnalysis::CICAAnalysis ( const itpp::mat &  ic,
const itpp::mat &  mix,
const std::vector< float > &  mean 
)

Initialize an ICA based of predefined data - this is unly used for test cases.

CICAAnalysis::CICAAnalysis ( size_t  series_length,
size_t  slice_size 
)

Main constructor of the ICA, i.e. you want to use this.

Parameters
series_lengthnumber of data sets that will be provided
slice_sizenumber of elements each set containes
CICAAnalysis::~CICAAnalysis ( )

Member Function Documentation

std::vector<float> CICAAnalysis::get_delta_feature ( const IndexSet plus,
const IndexSet minus 
) const

Evaluate a mix of the feature signals by adding and subtractig individual features.

Parameters
plusfeatures o be added
minusfeatures to be subtracted
Returns
the feature mix
std::vector<float> CICAAnalysis::get_feature_row ( size_t  row) const
Returns
the feature vector of row
std::vector<float> CICAAnalysis::get_incomplete_mix ( size_t  idx,
const IndexSet skip 
) const

Evaluate an incomplete mixed signal. Here the features are given that are not to be used.

See Also
get_partial_mix
Parameters
idxseries index
skipa set of feature indices that will be skipped when evaluating the mix
Returns
the mixed signal
std::vector<float> CICAAnalysis::get_mix ( size_t  idx) const
Returns
the complete mixed signal at series index idx
std::vector<float> CICAAnalysis::get_mix_series ( size_t  row) const
Returns
the mixing signal curve of the feature row
CSlopeColumns CICAAnalysis::get_mixing_curves ( ) const
Returns
a vector containing all mixing curves
size_t CICAAnalysis::get_ncomponents ( ) const
Returns
the number of actual ICs
std::vector<float> CICAAnalysis::get_partial_mix ( size_t  idx,
const IndexSet use 
) const

Evaluate an incomplete mixed signal. Here the features are given that are used to create the mix.

See Also
get_incomplete_mix
Parameters
idxseries index
usethe set of feature indices that will be used to evaluate the mix
Returns
an incolmplete mixed signal.
void CICAAnalysis::normalize_ICs ( )

Normalize the ICs in the following manner: Scale and shift the range of the ICs to [-1, 1] Scale the mixing curved to compensate for the required scaling move the means of the time points to compensate for the shifting.

std::vector<float> CICAAnalysis::normalize_Mix ( )

Normalize the mixing curves to have a zero mean. As a result a mean image is created that containes the sum of the ICs weighted by the required mean shift.

bool CICAAnalysis::run ( size_t  nica,
std::vector< std::vector< float > >  guess 
)

Run the independed component analysis using the given numbers of components

Parameters
nicanumber of indentepended components
guessinitial guess for the ICA, pass an empty vector of you don't want to use this feature
void CICAAnalysis::run_auto ( int  max_ica,
int  min_ica,
float  corr_thresh = 0.9 
)

Run the independed component analysis with an estimation of the optimal number of components. (experimental)

Parameters
max_icamaximum number of independend components
min_icaminimum number of independend components
corr_threshminimum absolute correation of the mixing signals to joins two components
void CICAAnalysis::set_approach ( int  approach)

Set the ICA approach to either FICA_APPROACH_DEFL(default) or FICA_APPROACH_SYMM.

Parameters
approach
void CICAAnalysis::set_max_iterations ( int  n)

sets the number of iterations in the ICA

Parameters
n
void CICAAnalysis::set_mixing_series ( size_t  index,
const std::vector< float > &  series 
)

Replace a mixing signal curve

Parameters
indexof the curve to be replaced
seriesnew data for mixing curve
template<class Iterator >
void CICAAnalysis::set_row ( size_t  row,
Iterator  begin,
Iterator  end 
)

Set on row of input data

Template Parameters
Iteratorinput data iterator, must follow the model of a forward iterator
Parameters
rowindex of the input slice
beginstart iterator of input data
endend iterator of input data

The documentation for this class was generated from the following file: