fastica_nonlinearity.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_fastica_nonlinearity_hh
#define mia_core_fastica_nonlinearity_hh
#include <mia/core/gsl_vector.hh>
#include <mia/core/gsl_matrix.hh>
#include <mia/core/factory.hh>
namespace mia
{
class EXPORT_CORE CFastICANonlinearityBase : public CProductBase
{
public:
typedef CFastICANonlinearityBase plugin_data;
static const char *data_descr;
CFastICANonlinearityBase();
void set_signal(const gsl::Matrix *signal);
void set_mu(double m);
protected:
double get_sample_scale() const
{
return m_sample_scale;
}
double get_mu() const
{
return m_mu;
};
const gsl::Matrix& get_signal() const;
private:
virtual void post_set_signal() = 0;
double m_mu;
double m_sample_scale;
const gsl::Matrix *m_signal;
};
class EXPORT_CORE CFastICADeflNonlinearity : public CFastICANonlinearityBase
{
public:
typedef CFastICADeflNonlinearity plugin_type;
static const char *type_descr;
void apply(gsl::Vector& w);
void apply(gsl::Matrix& W);
std::vector<double> get_saddle_test_table(const gsl::Matrix& ics) const;
double get_saddle_test_value(const gsl::Vector& ic) const;
protected:
virtual void post_set_signal();
private:
virtual double get_correction_and_scale(gsl::Vector& XTw, gsl::Vector& correction) = 0;
virtual double do_get_saddle_test_value(const gsl::Vector& ic) const = 0;
void sum_final(gsl::Vector& w, double scale);
void sum_final_stabelized(gsl::Vector& w, double scale);
gsl::Vector m_XTw;
gsl::Vector m_workspace;
};
typedef std::shared_ptr<CFastICADeflNonlinearity> PFastICADeflNonlinearity;
EXPORT_CORE PFastICADeflNonlinearity produce_fastica_nonlinearity(const std::string& descr);
typedef TFactory<CFastICADeflNonlinearity> CFastICADeflNonlinearityPlugin;
typedef THandlerSingleton<TFactoryPluginHandler<CFastICADeflNonlinearityPlugin>> CFastICADeflNonlinearityPluginHandler;
}
#endif
CProductBase
The base class for all plug-in created object.
Definition product_base.hh:41
TFactory
This is tha base of all plugins that create "things", like filters, cost functions time step operator...
Definition factory.hh:51
THandlerSingleton
the singleton that a plug-in handler really is
Definition handler.hh:159
gsl::Matrix
Definition gsl_matrix.hh:172
gsl::Vector
Definition gsl_vector.hh:39
mia::CFastICADeflNonlinearity
This is the base clase for non-linearities used in deflation based ICA.
Definition fastica_nonlinearity.hh:77
mia::CFastICADeflNonlinearity::type_descr
static const char * type_descr
Definition fastica_nonlinearity.hh:83
mia::CFastICADeflNonlinearity::get_saddle_test_table
std::vector< double > get_saddle_test_table(const gsl::Matrix &ics) const
mia::CFastICADeflNonlinearity::apply
void apply(gsl::Matrix &W)
mia::CFastICADeflNonlinearity::get_saddle_test_value
double get_saddle_test_value(const gsl::Vector &ic) const
mia::CFastICADeflNonlinearity::plugin_type
CFastICADeflNonlinearity plugin_type
helper typedef for plugin handling
Definition fastica_nonlinearity.hh:81
mia::CFastICADeflNonlinearity::apply
void apply(gsl::Vector &w)
mia::CFastICADeflNonlinearity::post_set_signal
virtual void post_set_signal()
mia::CFastICANonlinearityBase::data_descr
static const char * data_descr
Definition fastica_nonlinearity.hh:39
mia::CFastICANonlinearityBase::plugin_data
CFastICANonlinearityBase plugin_data
helper typedef for plugin handling
Definition fastica_nonlinearity.hh:37
mia::CFastICANonlinearityBase::get_mu
double get_mu() const
Definition fastica_nonlinearity.hh:51
mia::CFastICANonlinearityBase::set_signal
void set_signal(const gsl::Matrix *signal)
mia::CFastICANonlinearityBase::get_sample_scale
double get_sample_scale() const
Definition fastica_nonlinearity.hh:47
mia::CFastICANonlinearityBase::set_mu
void set_mu(double m)
mia::CFastICANonlinearityBase::CFastICANonlinearityBase
CFastICANonlinearityBase()
mia::CFastICANonlinearityBase::get_signal
const gsl::Matrix & get_signal() const
EXPORT_CORE
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
Definition defines.hh:101
factory.hh
mia::CFastICADeflNonlinearityPluginHandler
THandlerSingleton< TFactoryPluginHandler< CFastICADeflNonlinearityPlugin > > CFastICADeflNonlinearityPluginHandler
Definition fastica_nonlinearity.hh:130
gsl_matrix.hh
gsl_vector.hh
mia
Definition convergence_measure.hh:31
mia::produce_fastica_nonlinearity
EXPORT_CORE PFastICADeflNonlinearity produce_fastica_nonlinearity(const std::string &descr)
mia::PFastICADeflNonlinearity
std::shared_ptr< CFastICADeflNonlinearity > PFastICADeflNonlinearity
Definition fastica_nonlinearity.hh:118
mia::CFastICADeflNonlinearityPlugin
TFactory< CFastICADeflNonlinearity > CFastICADeflNonlinearityPlugin
Definition fastica_nonlinearity.hh:124