ica_template.hh
Go to the documentation of this file.
/* -*- mia-c++ -*-
*
* This file is part of MIA - a toolbox for medical image analysis
* Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
*
* MIA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef mia_core_ica_template_hh
#define mia_core_ica_template_hh
#include <mia/core/ica.hh>
#include <vector>
#ifndef EXPORT_TDataSeriesICA
#ifdef WIN32
# define EXPORT_TDataSeriesICA __declspec(dllimport)
#else
# ifdef __GNUC__
# define EXPORT_TDataSeriesICA __attribute__((visibility("default")))
# else
# define EXPORT_TDataSeriesICA
# endif
#endif
#endif
NS_MIA_BEGIN
template <class Data>
class EXPORT_TDataSeriesICA TDataSeriesICA
{
public:
typedef CIndepCompAnalysis::IndexSet IndexSet;
typedef typename Data::Pointer PData;
TDataSeriesICA(const CIndepCompAnalysisFactory& icatool, const std::vector<Data>& initializer, bool strip_mean);
bool run(size_t ncomponents, bool strip_mean, bool ica_normalize,
std::vector<std::vector<float>> guess = std::vector<std::vector<float>>());
void normalize();
void normalize_Mix();
Data get_mix(size_t idx) const;
const Data& get_mean_image() const;
Data get_incomplete_mix(size_t idx, const IndexSet& skip) const;
Data get_partial_mix(size_t idx, const IndexSet& comps) const;
CSlopeColumns get_mixing_curves() const;
std::vector<float> get_mixing_curve(unsigned idx) const;
PData get_feature_image(size_t idx) const;
PData get_delta_feature(const IndexSet& plus, const IndexSet& minus)const;
void set_mixing_series(size_t index, const std::vector<float>& series);
void set_max_iterations(int n);
void set_approach(CIndepCompAnalysis::EApproach approach);
~TDataSeriesICA();
private:
PIndepCompAnalysis m_analysis;
typedef typename Data::dimsize_type dimsize_type;
dimsize_type m_size;
Data m_mean;
};
NS_MIA_END
#endif
TDataSeriesICA::get_mix
Data get_mix(size_t idx) const
TDataSeriesICA::get_mixing_curves
CSlopeColumns get_mixing_curves() const
TDataSeriesICA::get_mean_image
const Data & get_mean_image() const
TDataSeriesICA::set_approach
void set_approach(CIndepCompAnalysis::EApproach approach)
TDataSeriesICA::set_mixing_series
void set_mixing_series(size_t index, const std::vector< float > &series)
TDataSeriesICA::set_max_iterations
void set_max_iterations(int n)
TDataSeriesICA::~TDataSeriesICA
~TDataSeriesICA()
TDataSeriesICA::normalize
void normalize()
TDataSeriesICA::get_partial_mix
Data get_partial_mix(size_t idx, const IndexSet &comps) const
TDataSeriesICA::IndexSet
CIndepCompAnalysis::IndexSet IndexSet
Definition ica_template.hh:66
TDataSeriesICA::TDataSeriesICA
TDataSeriesICA(const CIndepCompAnalysisFactory &icatool, const std::vector< Data > &initializer, bool strip_mean)
ICA initialization.
TDataSeriesICA::PData
Data::Pointer PData
Definition ica_template.hh:69
TDataSeriesICA::get_feature_image
PData get_feature_image(size_t idx) const
TDataSeriesICA::get_delta_feature
PData get_delta_feature(const IndexSet &plus, const IndexSet &minus) const
TDataSeriesICA::get_incomplete_mix
Data get_incomplete_mix(size_t idx, const IndexSet &skip) const
TDataSeriesICA::get_mixing_curve
std::vector< float > get_mixing_curve(unsigned idx) const
TDataSeriesICA::normalize_Mix
void normalize_Mix()
Normalizes the Mixing Matrix columns to have zero mean.
TDataSeriesICA::run
bool run(size_t ncomponents, bool strip_mean, bool ica_normalize, std::vector< std::vector< float > > guess=std::vector< std::vector< float > >())
ica.hh
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
CSlopeColumns
std::vector< std::vector< float > > CSlopeColumns
class to store the ICA weight matrix
Definition slopevector.hh:33
EXPORT_TDataSeriesICA
#define EXPORT_TDataSeriesICA
Definition ica_template.hh:33