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";