My Project
fastica_nonlinearity.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_fastica_nonlinearity_hh
22#define mia_core_fastica_nonlinearity_hh
23
26
27#include <mia/core/factory.hh>
28namespace mia
29{
30
31
33{
34public:
35
38
39 static const char *data_descr;
40
42
43 void set_signal(const gsl::Matrix *signal);
44 void set_mu(double m);
45
46protected:
47 double get_sample_scale() const
48 {
49 return m_sample_scale;
50 }
51 double get_mu() const
52 {
53 return m_mu;
54 };
55 const gsl::Matrix& get_signal() const;
56
57private:
58 virtual void post_set_signal() = 0;
59 double m_mu;
60 double m_sample_scale;
61 const gsl::Matrix *m_signal;
62};
63
77{
78public:
79
82
83 static const char *type_descr;
84
85
88
89 std::vector<double> get_saddle_test_table(const gsl::Matrix& ics) const;
90 double get_saddle_test_value(const gsl::Vector& ic) const;
91
92protected:
93 virtual void post_set_signal();
94private:
103 virtual double get_correction_and_scale(gsl::Vector& XTw, gsl::Vector& correction) = 0;
104
109 virtual double do_get_saddle_test_value(const gsl::Vector& ic) const = 0;
110 void sum_final(gsl::Vector& w, double scale);
111 void sum_final_stabelized(gsl::Vector& w, double scale);
112
113 gsl::Vector m_XTw;
114 gsl::Vector m_workspace;
115};
116
117
118typedef std::shared_ptr<CFastICADeflNonlinearity> PFastICADeflNonlinearity;
119
120
122
123
125
131
132}
133
134#endif
The base class for all plug-in created object.
This is tha base of all plugins that create "things", like filters, cost functions time step operator...
Definition factory.hh:51
the singleton that a plug-in handler really is
Definition handler.hh:159
This is the base clase for non-linearities used in deflation based ICA.
std::vector< double > get_saddle_test_table(const gsl::Matrix &ics) const
void apply(gsl::Matrix &W)
double get_saddle_test_value(const gsl::Vector &ic) const
CFastICADeflNonlinearity plugin_type
helper typedef for plugin handling
void apply(gsl::Vector &w)
CFastICANonlinearityBase plugin_data
helper typedef for plugin handling
void set_signal(const gsl::Matrix *signal)
const gsl::Matrix & get_signal() const
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
Definition defines.hh:101
THandlerSingleton< TFactoryPluginHandler< CFastICADeflNonlinearityPlugin > > CFastICADeflNonlinearityPluginHandler
EXPORT_CORE PFastICADeflNonlinearity produce_fastica_nonlinearity(const std::string &descr)
std::shared_ptr< CFastICADeflNonlinearity > PFastICADeflNonlinearity
TFactory< CFastICADeflNonlinearity > CFastICADeflNonlinearityPlugin