The following commit has been merged in the master branch:
commit 308ad1e746190ed04e58835c13c8fef87b2ded4f
Author: Andrei Zavada <[email protected]>
Date:   Mon Oct 15 11:31:05 2012 +0300

    WIP

diff --git a/src/ica/ica.hh b/src/ica/ica.hh
index 740bfc8..aaac937 100644
--- a/src/ica/ica.hh
+++ b/src/ica/ica.hh
@@ -102,23 +102,14 @@ class CFastICA {
                        itpp::make_mat_from_vecva<double, T>( _source_mat, 
source);
                        _obj = new itpp::Fast_ICA (_source_mat);
                }
-       CFastICA (const vector<function<valarray<double>()> >& source, size_t 
cols)
-       // avoid creating a third temporary, specially for use with 
agh::CEDFFile::get_signal
-               {
-                       itpp::Mat<double>
-                               _source_mat (source.size(), cols);
-                       for ( size_t r = 0; r < source.size(); ++r ) {
-                               _source_mat.set_row( r, itpp::Vec<double> 
(&source[r]()[0], cols));
-                       }
-                       _obj = new itpp::Fast_ICA (_source_mat);
-               }
-       CFastICA (const vector<function<valarray<float>()> >& source, size_t 
cols)
+       CFastICA (const vector<function<valarray<TFloat>()>>& source, size_t 
cols)
        // avoid creating a third temporary, specially for use with 
agh::CEDFFile::get_signal
                {
                        itpp::Mat<double>
                                _source_mat (source.size(), cols);
                        for ( int r = 0; r < (int)source.size(); ++r ) {
                                auto tmp = source[r]();
+                               tmp -= tmp.sum() / tmp.size();
                                for ( int c = 0; c < cols; ++c )
                                        _source_mat( r, c) = tmp[c];
                        }
diff --git a/src/ui/expdesign-construct.cc b/src/ui/expdesign-construct.cc
index 361e560..542d9a3 100644
--- a/src/ui/expdesign-construct.cc
+++ b/src/ui/expdesign-construct.cc
@@ -51,6 +51,8 @@ SExpDesignUIWidgets ()
                                    G_TYPE_STRING, // channel
                                    G_TYPE_STRING, // label
                                    G_TYPE_BOOLEAN, G_TYPE_POINTER);
+       mGlobalArtifactDetectionProfiles =
+               gtk_list_store_new( 1, G_TYPE_STRING);
        mSimulations =
                gtk_tree_store_new( 16,
                                    G_TYPE_STRING,      // group, subject, 
channel, from-upto
@@ -197,6 +199,22 @@ SExpDesignUIWidgets ()
        gtk_tree_view_append_column( tvGlobalAnnotations,
                                     gtk_tree_view_column_new());
 
+       // artifact detection profiles
+       gtk_combo_box_set_model( e,
+                                (GtkTreeModel*)mSessions);
+       gtk_combo_box_set_id_column( eMsmtSession, 0);
+
+       eMsmtSession_changed_cb_handler_id =
+               g_signal_connect( eMsmtSession, "changed",
+                                 (GCallback)eMsmtSession_changed_cb,
+                                 this);
+       renderer = gtk_cell_renderer_text_new();
+       gtk_cell_layout_pack_start( (GtkCellLayout*)eMsmtSession, renderer, 
FALSE);
+       gtk_cell_layout_set_attributes( (GtkCellLayout*)eMsmtSession, renderer,
+                                       "text", 0,
+                                       NULL);
+       
+
      // --------- tabs
        if ( !AGH_GBGETOBJ (GtkNotebook,        tTaskSelector) ||
             !AGH_GBGETOBJ (GtkNotebook,        tDesign) ||
@@ -755,6 +773,7 @@ aghui::SExpDesignUIWidgets::
        g_object_unref( (GObject*)mAllChannels);
        g_object_unref( (GObject*)mSessions);
        g_object_unref( (GObject*)mGlobalAnnotations);
+       g_object_unref( (GObject*)mGlobalArtifactDetectionProfiles);
        g_object_unref( (GObject*)mSimulations);
 
        g_object_unref( (GObject*)mScoringPageSize);
diff --git a/src/ui/expdesign-widgets.hh b/src/ui/expdesign-widgets.hh
index daa1c0a..8d1a54c 100644
--- a/src/ui/expdesign-widgets.hh
+++ b/src/ui/expdesign-widgets.hh
@@ -47,6 +47,7 @@ struct SExpDesignUIWidgets {
                *mAllChannels;
        GtkTreeStore
                *mGlobalAnnotations,
+               *mGlobalArtifactDetectionProfiles,
                *mSimulations;
 
        gulong  wMainWindow_delete_event_cb_handler_id,
diff --git a/src/ui/expdesign.hh b/src/ui/expdesign.hh
index 153686a..96f4dba 100644
--- a/src/ui/expdesign.hh
+++ b/src/ui/expdesign.hh
@@ -211,6 +211,30 @@ class SExpDesignUI
        aghui::SScoringFacility
                *close_this_SF_now;
 
+       // common artifact detection profiles
+       struct SDetectArtifactsParamPack {
+               double  scope,
+                       upper_thr, lower_thr,
+                       f0, fc, bandwidth,
+                       mc_gain, iir_backpolate;
+               double  E, dmin, dmax;
+               size_t  sssu_hist_size,
+                       smooth_side;
+               bool    estimate_e,
+                       use_range;
+               SDetectArtifactsParamPack ()
+                       : scope (4.),
+                         upper_thr (9.), lower_thr (-9.),
+                         f0 (1.), fc (1.8), bandwidth (1.5),
+                         mc_gain (10.), iir_backpolate (.5),
+                         E (4.), dmin (-10), dmax (20),
+                         sssu_hist_size (100), smooth_side (0),
+                         estimate_e (true), use_range (false)
+                       {}
+       };
+       map<string, SDetectArtifactsParamPack>
+               artifact_detection_profiles;
+
       // own variables aka saved settings
        sigfile::TMetricType
                display_profile_type;
diff --git a/src/ui/scoring-facility-channel.cc 
b/src/ui/scoring-facility-channel.cc
index a01e9ed..4a9e1c6 100644
--- a/src/ui/scoring-facility-channel.cc
+++ b/src/ui/scoring-facility-channel.cc
@@ -340,7 +340,7 @@ calculate_dirty_percent()
 
 void
 aghui::SScoringFacility::SChannel::
-detect_artifacts( SDetectArtifactsParamPack P)
+detect_artifacts( const aghui::SExpDesignUI::SDetectArtifactsParamPack& P)
 {
        auto    sssu =
                sigfile::CBinnedMC::do_sssu_reduction(
diff --git a/src/ui/scoring-facility.hh b/src/ui/scoring-facility.hh
index e90f421..adc5549 100644
--- a/src/ui/scoring-facility.hh
+++ b/src/ui/scoring-facility.hh
@@ -105,27 +105,7 @@ class SScoringFacility
              // artifacts
                float calculate_dirty_percent();
                float   percent_dirty;
-               struct SDetectArtifactsParamPack {
-                       double  scope,
-                               upper_thr, lower_thr,
-                               f0, fc, bandwidth,
-                               mc_gain, iir_backpolate;
-                       double  E, dmin, dmax;
-                       size_t  sssu_hist_size,
-                               smooth_side;
-                       bool    estimate_e,
-                               use_range;
-                       SDetectArtifactsParamPack ()
-                             : scope (4.),
-                               upper_thr (9.), lower_thr (-9.),
-                               f0 (1.), fc (1.8), bandwidth (1.5),
-                               mc_gain (10.), iir_backpolate (.5),
-                               E (4.), dmin (-10), dmax (20),
-                               sssu_hist_size (100), smooth_side (0),
-                               estimate_e (true), use_range (false)
-                               {}
-               };
-               void detect_artifacts( SDetectArtifactsParamPack);
+               void detect_artifacts( const 
SExpDesignUI::SDetectArtifactsParamPack&);
 
              // annotations
                list<sigfile::SAnnotation*>

-- 
Sleep experiment manager

_______________________________________________
debian-med-commit mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to