Commit 0559d598 authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[ADD] getter functions for number of segments, samples and channels of EEG

parent e5775309
......@@ -29,12 +29,15 @@ WEEG::WEEG( boost::shared_ptr< WMetaInfo > metaInfo, const WEEGSegmentArray& dat
: WRecording( metaInfo )
{
assert( data.size() <= wlimits::MAX_RECORDING_SEGMENTS );
assert( data.size() > 0 ); // ensure that ther is really data
for( WEEGSegmentArray::const_iterator it1 = data.begin(); it1 != data.end(); ++it1 )
{
assert( it1->size() <= wlimits::MAX_RECORDING_CHANNELS );
assert( it1->size() > 0 ); // ensure that ther is really data
for( WEEGSegment::const_iterator it2 = it1->begin(); it2 != it1->end(); ++it2 )
{
assert( it2->size() <= wlimits::MAX_RECORDING_SAMPLES );
assert( it2->size() > 0 ); // ensure that ther is really data
}
}
m_segments = data;
......
......@@ -76,6 +76,30 @@ public:
return m_segments[segment][signal][sample];
}
/**
* Returns number of samples of a given segment.
*/
const size_t getNumberOfSamples( size_t segmentId )
{
return m_segments[segmentId][0].size();
}
/**
* Return the number of channels this EEG has.
*/
const size_t getNumberOfChannels()
{
return m_segments[0].size();
}
/**
* Return the number of segments this EEG consists of.
*/
const size_t getNumberOfSegments()
{
return m_segments.size();
}
protected:
private:
/**
......
......@@ -42,7 +42,6 @@ public:
*/
void testSomething( void )
{
// THIS IS INTENTIONALLY NOT STYLECONFORM AS IT SHOULD NOT BE COMMITED yet
// std::string fileName = "/dargb/bv_data/Medical/MPI-CBS/ASA/A1_alex_Segment_1.edf";
std::string fileName = "/windows/C/Users/wiebel/Documents/ASA/Export/A1_alex_Segment_1.edf";
// std::string fileName = "/home/wiebel/Data/EEG/A1.cnt";
......@@ -51,9 +50,9 @@ public:
boost::shared_ptr< WDataHandler >( new WDataHandler() );
TS_ASSERT_EQUALS( dataHandler->getNumberOfDataSets(), 0 );
WLoaderBiosig biosigLoader( fileName, dataHandler );
boost::thread loaderThread( biosigLoader );
sleep( 3 );
// WLoaderBiosig biosigLoader( fileName, dataHandler );
// boost::thread loaderThread( biosigLoader );
// sleep( 3 );
// TS_FAIL( "Try to test EDF" );
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment