Commit 78b9e9e5 authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[CHANGE] Made the biosig loader really store the data in a WEEG object

parent 5cfb3725
......@@ -90,6 +90,7 @@ private:
* Description of electrodes
*/
std::map< std::string, size_t > m_electrodeDescriptions;
#warning no docu
std::vector< WEEGElectrodeObject > m_electrodeLibrary;
/**
......
......@@ -30,20 +30,33 @@
#include "WLoaderBiosig.h"
#include "biosig/biosig.h"
#include "../WDataHandler.h"
#include "../WMetaInfo.h"
#include "../WEEG.h"
typedef std::vector< double > WEEGElectrode;
typedef std::vector< WEEGElectrode > WEEGSegment;
typedef std::vector< WEEGSegment > WEEGSegmentArray; // kann ich das auch irgendwie aus WEEG.h bekommen?
WLoaderBiosig::WLoaderBiosig( std::string fileName, boost::shared_ptr< WDataHandler > dataHandler )
: WLoader( fileName ),
m_dataHandler( dataHandler )
m_dataHandler( dataHandler ),
m_columns( 0 ),
m_rows( 0 )
{
}
void fillSegment( std::vector<std::vector<double> > segment, biosig_data_type* data, size_t nbSamples )
void WLoaderBiosig::fillSegment( std::vector<std::vector<double> >* segment, biosig_data_type* data, size_t nbSamples )
{
// for
for( unsigned int i = 0; i < m_rows; ++i )
{
WEEGElectrode channel( 0 );
for( unsigned int j = 0; j < m_columns; ++j )
{
channel.push_back( data[i*m_columns+j] );
}
segment->push_back( channel );
}
}
void WLoaderBiosig::biosigLoader()
{
......@@ -71,30 +84,20 @@ void WLoaderBiosig::biosigLoader()
#warning least is not intended to be completely in the main memory.
size_t alex = sread( DATA, 0, LEN, hd );
size_t nbSamples = LEN*hd->SPR*hd->NS;
size_t columns = hd->data.size[0];
size_t rows = hd->data.size[1];
std::cout << "BIOSIG data.size[0] : " << columns << std::endl;
std::cout << "BIOSIG data.size[1] : " << rows << std::endl;
m_columns = hd->data.size[0];
m_rows = hd->data.size[1];
std::cout << "BIOSIG data.size[0] : " << m_columns << std::endl;
std::cout << "BIOSIG data.size[1] : " << m_rows << std::endl;
std::cout << "BIOSIG data.block[0]: " << hd->data.block[0] << std::endl;
std::cout << "BIOSIG DataSize : " << alex << std::endl;
std::cout << alex << std::endl;
std::cout << "BIOSIGLOADER_some_data" << std::endl;
for( unsigned int i = 0; i < rows; ++i )
{
std::cout << hd->CHANNEL[i].Label << std::endl;
for( unsigned int j = 0; j < columns; ++j )
{
std::cout << hd->data.block[i*columns+j] << std::endl;
}
}
typedef std::vector< double > WEEGElectrode;
typedef std::vector< WEEGElectrode > WEEGSegment;
typedef std::vector< WEEGSegment > WEEGSegmentArray; // kann ich das auch irgendwie aus WEEG.h bekommen?
// WEEGSegmentArray segments;
std::vector<std::vector<double> > segment;
fillSegment( segment, hd->data.block, nbSamples );
fillSegment( &segment, hd->data.block, nbSamples );
std::vector<std::vector<std::vector<double> > > segments( 0 );
segments.push_back( segment );
......
......@@ -25,9 +25,11 @@
#define WLOADERBIOSIG_H
#include <string>
#include <vector>
#include <boost/shared_ptr.hpp>
#include "../WLoader.h"
#include "biosig/biosig.h"
class WDataHandler;
......@@ -53,7 +55,11 @@ public:
protected:
private:
void biosigLoader();
void fillSegment( std::vector<std::vector<double> >* segment, biosig_data_type* data, size_t nbSamples );
boost::shared_ptr< WDataHandler > m_dataHandler;
size_t m_columns;
size_t m_rows;
};
#endif // WLOADERBIOSIG_H
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