[med-svn] [SCM] aghermann branch, master, updated. f0d4c0fd35bf09e7dff56ddb9a2d798ae916c2ef
Andrei Zavada
johnhommer at gmail.com
Sun Feb 3 12:53:04 UTC 2013
The following commit has been merged in the master branch:
commit 11b1f9c7bc8b6b5a268fa0708e607daccb7c2be6
Author: Andrei Zavada <johnhommer at gmail.com>
Date: Wed Jan 30 02:48:45 2013 +0200
new functions: CSource::get_real_original_signal_range and co.
diff --git a/src/libsigfile/edf.hh b/src/libsigfile/edf.hh
index f983a9c..a8f0cdd 100644
--- a/src/libsigfile/edf.hh
+++ b/src/libsigfile/edf.hh
@@ -386,6 +386,55 @@ class CEDFFile
return put_signal_( h, src);
}
+ // signal data info
+ pair<TFloat, TFloat>
+ get_real_original_signal_range( const char* h) const
+ {
+ return get_real_original_signal_range( channel_id(h));
+ }
+ pair<TFloat, TFloat>
+ get_real_original_signal_range( int h) const
+ {
+ auto x = get_signal_original( h);
+ return {x.min(), x.max()};
+ }
+
+ pair<TFloat, TFloat>
+ get_max_original_signal_range( const char* h) const
+ {
+ return get_max_original_signal_range( channel_id(h));
+ }
+ pair<TFloat, TFloat>
+ get_max_original_signal_range( int h) const
+ {
+ return {(TFloat)channels[h].digital_min, (TFloat)channels[h].digital_max};
+ }
+
+
+ pair<TFloat, TFloat>
+ get_real_filtered_signal_range( const char* h) const
+ {
+ return get_real_filtered_signal_range( channel_id(h));
+ }
+ pair<TFloat, TFloat>
+ get_real_filtered_signal_range( int h) const
+ {
+ auto x = get_signal_filtered( h);
+ return {x.min(), x.max()};
+ }
+
+ pair<TFloat, TFloat>
+ get_max_filtered_signal_range( const char* h) const
+ {
+ return get_max_filtered_signal_range( channel_id(h));
+ }
+ pair<TFloat, TFloat>
+ get_max_filtered_signal_range( int h) const
+ {
+ auto x = get_signal_filtered( h);
+ return {x.min(), x.max()}; // an approximate
+ }
+
// adjust capacity
size_t
resize( size_t new_records);
@@ -576,6 +625,8 @@ class CEDFFile
};
+
+
#include "edf.ii"
} // namespace sigfile
diff --git a/src/libsigfile/source-base.hh b/src/libsigfile/source-base.hh
index 5fa0619..a20f73e 100644
--- a/src/libsigfile/source-base.hh
+++ b/src/libsigfile/source-base.hh
@@ -354,6 +354,39 @@ class CSource_base {
return put_region( h, src, 0);
}
+ // signal data info
+ template <typename T>
+ pair<TFloat, TFloat>
+ get_real_original_signal_range( T h) const;
+ virtual pair<TFloat, TFloat>
+ get_real_original_signal_range( int) const = 0;
+ virtual pair<TFloat, TFloat>
+ get_real_original_signal_range( const char*) const = 0;
+
+ template <typename T>
+ pair<TFloat, TFloat>
+ get_max_original_signal_range( T h) const;
+ virtual pair<TFloat, TFloat>
+ get_max_original_signal_range( int) const = 0;
+ virtual pair<TFloat, TFloat>
+ get_max_original_signal_range( const char*) const = 0;
+
+ template <typename T>
+ pair<TFloat, TFloat>
+ get_real_filtered_signal_range( T h) const;
+ virtual pair<TFloat, TFloat>
+ get_real_filtered_signal_range( int) const = 0;
+ virtual pair<TFloat, TFloat>
+ get_real_filtered_signal_range( const char*) const = 0;
+
+ template <typename T>
+ pair<TFloat, TFloat>
+ get_max_filtered_signal_range( T h) const;
+ virtual pair<TFloat, TFloat>
+ get_max_filtered_signal_range( int) const = 0;
+ virtual pair<TFloat, TFloat>
+ get_max_filtered_signal_range( const char*) const = 0;
+
// export
virtual int
export_original( int, const char* fname) const = 0;
diff --git a/src/libsigfile/source.hh b/src/libsigfile/source.hh
index 3dab3eb..73e67b1 100644
--- a/src/libsigfile/source.hh
+++ b/src/libsigfile/source.hh
@@ -254,6 +254,21 @@ class CSource
return _obj->put_region( h, src, (size_t)0);
}
+ // signal data info
+ template <typename T>
+ pair<TFloat, TFloat>
+ get_real_original_signal_range( T h) const
+ {
+ return _obj->get_real_original_signal_range( h);
+ }
+
+ template <typename T>
+ pair<TFloat, TFloat>
+ get_max_original_signal_range( T h) const
+ {
+ return _obj->get_max_original_signal_range( h);
+ }
+
// export
template <class Th>
int
--
Sleep experiment manager
More information about the debian-med-commit
mailing list