31 #include <boost/shared_ptr.hpp>
33 #include "../common/exceptions/WOutOfBounds.h"
34 #include "exceptions/WDHException.h"
35 #include "io/WPagerEEG.h"
36 #include "WEEGChannelInfo.h"
37 #include "WEEGPositionsLibrary.h"
38 #include "WEEG2Segment.h"
42 boost::shared_ptr< WPrototyped >
WEEG2::m_prototype = boost::shared_ptr< WPrototyped >();
44 WEEG2::WEEG2( boost::shared_ptr< WPagerEEG > pager, boost::shared_ptr< WEEGPositionsLibrary > positionsLibrary )
48 throw WDHException( std::string(
"Couldn't construct new EEG: pager invalid" ) );
51 if( !positionsLibrary )
53 throw WDHException( std::string(
"Couldn't construct new EEG: positions library invalid" ) );
56 std::size_t nbSegments = pager->getNumberOfSegments();
59 throw WDHException( std::string(
"Couldn't construct new EEG: invalid number of segments" ) );
62 std::size_t nbChannels = pager->getNumberOfChannels();
65 throw WDHException( std::string(
"Couldn't construct new EEG: invalid number of channels" ) );
71 throw WDHException( std::string(
"Couldn't construct new EEG: invalid sampling rate" ) );
77 for( std::size_t segmentID = 0; segmentID < nbSegments; ++segmentID )
83 for( std::size_t channelID = 0; channelID < nbChannels; ++channelID )
112 std::ostringstream stream;
113 stream <<
"The EEG has no segment number " << segmentID;
124 std::ostringstream stream;
125 stream <<
"The EEG has no channel number " << channelID;
139 return "Contains EEG data";
virtual const std::string getDescription() const
Description of dataset.
static boost::shared_ptr< WPrototyped > getPrototype()
Get dataset prototype.
virtual const std::string getName() const
Return the name of the dataset.
static const unsigned int MAX_RECORDING_SEGMENTS
Maximum number of segments of a recording.
General purpose exception and therefore base class for all DataHandler related exceptions.
Class which contains one segment of an EEG recording, read from a WPagerEEG.
WEEG2()
Constructor creating a quite unusable instance.
static const unsigned int MAX_RECORDING_SAMPLING_FREQUENCY
Maximum samplimg frequency of a recording.
Indicates invalid element access of a container.
double m_samplingRate
sampling rate used by the recording
std::vector< boost::shared_ptr< WEEGChannelInfo > > m_channelInfos
list of the information about all channel infos this EEG has
void setFilename(const std::string filename)
Set the name of the file that this data set stems from.
static const unsigned int MAX_RECORDING_CHANNELS
Maximum number of channels for a certain modality.
std::size_t getNumberOfSegments() const
Get the number of segments this EEG consists of.
std::size_t getNumberOfChannels() const
Get the number of channels this EEG has.
Class which contains information about one channel of an EEG recording, read from a WPagerEEG...
boost::shared_ptr< WEEG2Segment > getSegment(std::size_t segmentID) const
Get one segment.
static boost::shared_ptr< WPrototyped > m_prototype
Prototype needed to allow the EEG dataset to be transferred.
std::vector< boost::shared_ptr< WEEG2Segment > > m_segments
list of all segments this EEG consists of
boost::shared_ptr< WEEGChannelInfo > getChannelInfo(std::size_t channelID) const
Get one channel info object.
double getSamplingRate() const
Get the sampling rate used by the recording.