21 #ifndef mia_core_ica_hh
22 #define mia_core_ica_hh
28 #include <itpp/signal/fastica.h>
29 #include <boost/concept/requires.hpp>
30 #include <boost/concept_check.hpp>
49 CICAAnalysis(
const itpp::mat& ic,
const itpp::mat& mix,
const std::vector<float>& mean );
72 template <
class Iterator>
73 BOOST_CONCEPT_REQUIRES(((::boost::ForwardIterator<Iterator>)),
75 set_row(
size_t row, Iterator begin, Iterator end);
84 bool run(
size_t nica, std::vector<std::vector<
float> > guess);
93 void run_auto(
int max_ica,
int min_ica,
float corr_thresh=0.9);
97 std::vector<
float> get_feature_row(
size_t row)const;
100 std::vector<
float> get_mix_series(
size_t row)const;
103 std::vector<
float> get_mix(
size_t idx)const;
111 std::vector<
float> get_incomplete_mix(
size_t idx, const
IndexSet& skip)const;
119 std::vector<
float> get_partial_mix(
size_t idx, const
IndexSet& use)const;
126 std::vector<
float> get_delta_feature(const
IndexSet& plus, const
IndexSet& minus)const;
133 void set_mixing_series(
size_t index, const std::vector<
float>& series);
144 void normalize_ICs();
151 std::vector<
float> normalize_Mix();
155 size_t get_ncomponents() const;
161 void set_max_iterations(
int n);
167 void set_approach(
int approach);
169 void set_row(
int row, const
itppvector& buffer,
double mean);
171 struct CICAAnalysisImpl *impl;
176 template <class Iterator>
177 BOOST_CONCEPT_REQUIRES(((::boost::ForwardIterator<Iterator>)),
179 CICAAnalysis::set_row(
size_t row, Iterator begin, Iterator end)
181 const size_t length = std::distance(begin, end);
187 mean += (buffer[idx++] = *begin++);
189 for(
size_t i = 0; i < length; ++i)
191 set_row(row, buffer, mean);