Commit 2113f13f authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[CHANGE #163] fixed name of datasetclass

parent aacf47e5
......@@ -24,17 +24,17 @@
#include <vector>
#include "WDataSetDipole.h"
#include "WDataSetDipoles.h"
// prototype instance as singleton
boost::shared_ptr< WPrototyped > WDataSetDipole::m_prototype = boost::shared_ptr< WPrototyped >();
boost::shared_ptr< WPrototyped > WDataSetDipoles::m_prototype = boost::shared_ptr< WPrototyped >();
WDataSetDipole::WDataSetDipole()
WDataSetDipoles::WDataSetDipoles()
{
}
WDataSetDipole::WDataSetDipole( WPosition dipPos, std::vector<float> mags, std::vector<float> times )
WDataSetDipoles::WDataSetDipoles( WPosition dipPos, std::vector<float> mags, std::vector<float> times )
{
WAssert( mags.size() == times.size(), "There has to be a magnitude for every time and vice versa." );
for( size_t id = 0; id < times.size() - 1; ++id )
......@@ -44,21 +44,21 @@ WDataSetDipole::WDataSetDipole( WPosition dipPos, std::vector<float> mags, std::
addDipole( dipPos, mags, times );
}
WDataSetDipole::~WDataSetDipole()
WDataSetDipoles::~WDataSetDipoles()
{
}
boost::shared_ptr< WPrototyped > WDataSetDipole::getPrototype()
boost::shared_ptr< WPrototyped > WDataSetDipoles::getPrototype()
{
if( !m_prototype )
{
m_prototype = boost::shared_ptr< WPrototyped >( new WDataSetDipole() );
m_prototype = boost::shared_ptr< WPrototyped >( new WDataSetDipoles() );
}
return m_prototype;
}
size_t WDataSetDipole::addDipole( WPosition dipPos, std::vector<float> mags, std::vector<float> times )
size_t WDataSetDipoles::addDipole( WPosition dipPos, std::vector<float> mags, std::vector<float> times )
{
Dipole dipole;
dipole.m_dipolePosition = dipPos;
......@@ -68,17 +68,17 @@ size_t WDataSetDipole::addDipole( WPosition dipPos, std::vector<float> mags, std
return m_dipoles.size() - 1;
}
WPosition WDataSetDipole::getPosition( size_t dipoleId )
WPosition WDataSetDipoles::getPosition( size_t dipoleId )
{
return m_dipoles[dipoleId].m_dipolePosition;
}
size_t WDataSetDipole::getNumberOfDipoles()
size_t WDataSetDipoles::getNumberOfDipoles()
{
return m_dipoles.size();
}
float WDataSetDipole::getMagnitude( float time, size_t dipoleId )
float WDataSetDipoles::getMagnitude( float time, size_t dipoleId )
{
std::vector<float>& times = m_dipoles[dipoleId].m_times;
std::vector<float>& magnitudes = m_dipoles[dipoleId].m_magnitudes;
......
......@@ -22,8 +22,8 @@
//
//---------------------------------------------------------------------------
#ifndef WDATASETDIPOLE_H
#define WDATASETDIPOLE_H
#ifndef WDATASETDIPOLES_H
#define WDATASETDIPOLES_H
#include <vector>
......@@ -34,13 +34,13 @@
/**
* Represents a dipole dataset.
*/
class WDataSetDipole : public WDataSet
class WDataSetDipoles : public WDataSet
{
public:
/**
* Creates a new dipole dataset.
*/
WDataSetDipole();
WDataSetDipoles();
/**
* Creates a new dipole data set containing one dipole
......@@ -50,12 +50,12 @@ public:
* \param mags Magnitudes of dipole over time
* \param times Times for the dipole activity
*/
explicit WDataSetDipole( WPosition dipPos, std::vector<float> mags, std::vector<float> times );
explicit WDataSetDipoles( WPosition dipPos, std::vector<float> mags, std::vector<float> times );
/**
* Destructs this dataset.
*/
~WDataSetDipole();
~WDataSetDipoles();
/**
* Returns a prototype instantiated with the true type of the deriving class.
......@@ -120,4 +120,4 @@ private:
std::vector< Dipole > m_dipoles; //!< List of dipoles representeing this dipoles dataset
};
#endif // WDATASETDIPOLE_H
#endif // WDATASETDIPOLES_H
......@@ -29,7 +29,7 @@
#include <osg/ShapeDrawable>
#include <osgSim/ColorRange>
#include "core/dataHandler/WDataSetDipole.h"
#include "core/dataHandler/WDataSetDipoles.h"
#include "core/dataHandler/WEEG2.h"
#include "core/dataHandler/WEEG2Segment.h"
#include "core/dataHandler/WEEGChannelInfo.h"
......@@ -97,7 +97,7 @@ void WMEEGView::connectors()
shared_from_this(), "EEG recording", "Loaded EEG-dataset." ) );
addConnector( m_input );
m_dipoles = boost::shared_ptr< WModuleInputData< WDataSetDipole > >( new WModuleInputData< WDataSetDipole >(
m_dipoles = boost::shared_ptr< WModuleInputData< WDataSetDipoles > >( new WModuleInputData< WDataSetDipoles >(
shared_from_this(), "Dipoles", "The reconstructed dipoles for the EEG." ) );
addConnector( m_dipoles );
......
......@@ -129,7 +129,7 @@ private:
/**
* Input connector for dipoles of EEG data
*/
boost::shared_ptr< WModuleInputData< WDataSetDipole > > m_dipoles;
boost::shared_ptr< WModuleInputData< WDataSetDipoles > > m_dipoles;
/**
* A condition used to notify about changes in several properties.
......
......@@ -27,7 +27,7 @@
#include <vector>
#include "core/common/WPathHelper.h"
#include "core/dataHandler/WDataSetDipole.h"
#include "core/dataHandler/WDataSetDipoles.h"
#include "core/dataHandler/exceptions/WDHIOFailure.h"
#include "core/kernel/WKernel.h"
#include "modules/readDipoles/WMReadDipoles.xpm"
......@@ -68,7 +68,7 @@ const std::string WMReadDipoles::getDescription() const
void WMReadDipoles::connectors()
{
m_dipoles = boost::shared_ptr< WModuleOutputData< WDataSetDipole > >( new WModuleOutputData< WDataSetDipole >(
m_dipoles = boost::shared_ptr< WModuleOutputData< WDataSetDipoles > >( new WModuleOutputData< WDataSetDipoles >(
shared_from_this(), "Dipoles", "The loaded dipoles reconstructed from EEG." ) );
addConnector( m_dipoles );
......@@ -121,7 +121,7 @@ void WMReadDipoles::moduleMain()
}
boost::shared_ptr< WDataSetDipole > WMReadDipoles::readMetaData( std::string filename )
boost::shared_ptr< WDataSetDipoles > WMReadDipoles::readMetaData( std::string filename )
{
std::vector< std::string > names;
std::ifstream ifs;
......@@ -206,14 +206,14 @@ void WMReadDipoles::readFile( std::string filename, WPosition* pos, std::vector<
ifs.close();
}
boost::shared_ptr< WDataSetDipole > WMReadDipoles::readFiles( std::vector< std::string > filenames )
boost::shared_ptr< WDataSetDipoles > WMReadDipoles::readFiles( std::vector< std::string > filenames )
{
WPosition pos;
std::vector< float > times;
std::vector< float > magnitudes;
readFile( filenames[0], &pos, &times, &magnitudes );
boost::shared_ptr< WDataSetDipole > loadedData( new WDataSetDipole( pos, magnitudes, times ) );
boost::shared_ptr< WDataSetDipoles > loadedData( new WDataSetDipoles( pos, magnitudes, times ) );
for( size_t fileId = 1; fileId < filenames.size(); ++fileId )
{
......
......@@ -34,7 +34,7 @@
#include "core/kernel/WModuleInputData.h"
#include "core/kernel/WModuleOutputData.h"
class WDataSetDipole;
class WDataSetDipoles;
/**
* Someone should add some documentation here.
......@@ -110,12 +110,12 @@ protected:
private:
/**
* Function that composes the data read by readFile() from the different files to one WDataSetDipole
* Function that composes the data read by readFile() from the different files to one WDataSetDipoles
*
* \param filenames Names and locations of files to read.
* \return A pointer to the loaded dataset
*/
boost::shared_ptr< WDataSetDipole > readFiles( std::vector< std::string > filenames );
boost::shared_ptr< WDataSetDipoles > readFiles( std::vector< std::string > filenames );
/**
* Function doing the actual reading from one file
......@@ -137,17 +137,17 @@ private:
* \param filename Name and location of meta file to read.
* \return A pointer to the loaded dataset
*/
boost::shared_ptr< WDataSetDipole > readMetaData( std::string filename );
boost::shared_ptr< WDataSetDipoles > readMetaData( std::string filename );
/**
* Output connector for dipoles of EEG data
*/
boost::shared_ptr< WModuleOutputData< WDataSetDipole > > m_dipoles;
boost::shared_ptr< WModuleOutputData< WDataSetDipoles > > m_dipoles;
/**
* Pointer to the loaded dataset
*/
boost::shared_ptr< WDataSetDipole > m_dataSet;
boost::shared_ptr< WDataSetDipoles > m_dataSet;
boost::shared_ptr< WCondition > m_propCondition; //!< A condition used to notify about changes in several properties.
WPropFilename m_dataFile; //!< The data will be read from this file.
......
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