My Project
ica_template.hh
Go to the documentation of this file.
1/* -*- mia-c++ -*-
2 *
3 * This file is part of MIA - a toolbox for medical image analysis
4 * Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
5 *
6 * MIA is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with MIA; if not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#ifndef mia_core_ica_template_hh
22#define mia_core_ica_template_hh
23
24#include <mia/core/ica.hh>
25#include <vector>
26
27
28#ifndef EXPORT_TDataSeriesICA
29#ifdef WIN32
30# define EXPORT_TDataSeriesICA __declspec(dllimport)
31#else
32# ifdef __GNUC__
33# define EXPORT_TDataSeriesICA __attribute__((visibility("default")))
34# else
35# define EXPORT_TDataSeriesICA
36# endif
37#endif
38#endif
39
41
60template <class Data>
62{
63public:
66 typedef CIndepCompAnalysis::IndexSet IndexSet;
67
69 typedef typename Data::Pointer PData;
70
81 TDataSeriesICA(const CIndepCompAnalysisFactory& icatool, const std::vector<Data>& initializer, bool strip_mean);
82
89 bool run(size_t ncomponents, bool strip_mean, bool ica_normalize,
90 std::vector<std::vector<float>> guess = std::vector<std::vector<float>>());
91
92
93
97 void normalize();
98
101
102
106 Data get_mix(size_t idx) const;
107
109 const Data& get_mean_image() const;
110
117 Data get_incomplete_mix(size_t idx, const IndexSet& skip) const;
118
125 Data get_partial_mix(size_t idx, const IndexSet& comps) const;
126
129
136 std::vector<float> get_mixing_curve(unsigned idx) const;
137
139 PData get_feature_image(size_t idx) const;
140
147 PData get_delta_feature(const IndexSet& plus, const IndexSet& minus)const;
148
154 void set_mixing_series(size_t index, const std::vector<float>& series);
155
156
162
167 void set_approach(CIndepCompAnalysis::EApproach approach);
168
169
171private:
172 PIndepCompAnalysis m_analysis;
173 typedef typename Data::dimsize_type dimsize_type;
174 dimsize_type m_size;
175 Data m_mean;
176
177};
178
180
181#endif
Templated representation of a ICA series analyis.
Data get_mix(size_t idx) const
CSlopeColumns get_mixing_curves() const
const Data & get_mean_image() const
void set_approach(CIndepCompAnalysis::EApproach approach)
void set_mixing_series(size_t index, const std::vector< float > &series)
void set_max_iterations(int n)
Data get_partial_mix(size_t idx, const IndexSet &comps) const
CIndepCompAnalysis::IndexSet IndexSet
TDataSeriesICA(const CIndepCompAnalysisFactory &icatool, const std::vector< Data > &initializer, bool strip_mean)
ICA initialization.
Data::Pointer PData
PData get_feature_image(size_t idx) const
PData get_delta_feature(const IndexSet &plus, const IndexSet &minus) const
Data get_incomplete_mix(size_t idx, const IndexSet &skip) const
std::vector< float > get_mixing_curve(unsigned idx) const
void normalize_Mix()
Normalizes the Mixing Matrix columns to have zero mean.
bool run(size_t ncomponents, bool strip_mean, bool ica_normalize, std::vector< std::vector< float > > guess=std::vector< std::vector< float > >())
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
std::vector< std::vector< float > > CSlopeColumns
class to store the ICA weight matrix
#define EXPORT_TDataSeriesICA