OpenWalnut
1.4.0
|
00001 //--------------------------------------------------------------------------- 00002 // 00003 // Project: OpenWalnut ( http://www.openwalnut.org ) 00004 // 00005 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS 00006 // For more information see http://www.openwalnut.org/copying 00007 // 00008 // This file is part of OpenWalnut. 00009 // 00010 // OpenWalnut is free software: you can redistribute it and/or modify 00011 // it under the terms of the GNU Lesser General Public License as published by 00012 // the Free Software Foundation, either version 3 of the License, or 00013 // (at your option) any later version. 00014 // 00015 // OpenWalnut is distributed in the hope that it will be useful, 00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 // GNU Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public License 00021 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>. 00022 // 00023 //--------------------------------------------------------------------------- 00024 00025 #ifndef WPAGEREEG_H 00026 #define WPAGEREEG_H 00027 00028 #include <cstddef> 00029 00030 #include <string> 00031 00032 #include <boost/shared_ptr.hpp> 00033 00034 #include "../WEEGValueMatrix.h" 00035 #include "../../common/WDefines.h" 00036 00037 /** 00038 * Abstract class to load an EEG file and keep it open to support paging. 00039 * \ingroup dataHandler 00040 */ 00041 class WPagerEEG // NOLINT 00042 { 00043 public: 00044 /** 00045 * Virtual destructor 00046 */ 00047 virtual ~WPagerEEG(); 00048 00049 /** 00050 * Get the name of the loaded file. 00051 * 00052 * \return name of file 00053 */ 00054 std::string getFilename() const; 00055 00056 /** 00057 * Get the name of the loaded file. 00058 * 00059 * \return name of file 00060 * \deprecated use getFilename instead 00061 */ 00062 OW_API_DEPRECATED std::string getFileName() const; 00063 00064 /** 00065 * Get the number of segments this EEG consists of. 00066 * 00067 * \return number of segments 00068 */ 00069 virtual std::size_t getNumberOfSegments() const = 0; 00070 00071 /** 00072 * Get the number of channels this EEG has. 00073 * 00074 * \return number of channels 00075 */ 00076 virtual std::size_t getNumberOfChannels() const = 0; 00077 00078 /** 00079 * Get the number of samples of a given segment. 00080 * 00081 * \param segmentID segment number being inspected 00082 * \return number of samples 00083 */ 00084 virtual std::size_t getNumberOfSamples( std::size_t segmentID ) const = 0; 00085 00086 /** 00087 * Get the values of all channels for a given sample range. 00088 * 00089 * \param segmentID segment number to read the values from 00090 * \param start start sample of the sample range 00091 * \param length length of the sample range 00092 * \return matrix of values 00093 */ 00094 virtual boost::shared_ptr< WEEGValueMatrix > getValues( std::size_t segmentID, std::size_t start, std::size_t length ) const = 0; 00095 00096 /** 00097 * Get the sampling rate used by the recording. 00098 * 00099 * \return sampling rate 00100 */ 00101 virtual double getSamplingRate() const = 0; 00102 00103 /** 00104 * Get the unit used by the recording of a given channel. 00105 * 00106 * \param channelID channel number 00107 * \return unit as string 00108 */ 00109 virtual std::string getChannelUnit( std::size_t channelID ) const = 0; 00110 00111 /** 00112 * Get the label of a given channel. 00113 * 00114 * \param channelID channel number 00115 * \return label as string 00116 */ 00117 virtual std::string getChannelLabel( std::size_t channelID ) const = 0; 00118 00119 protected: 00120 /** 00121 * Constructor 00122 * 00123 * \param filename path and filename to the file to load 00124 */ 00125 explicit WPagerEEG( std::string filename ); 00126 private: 00127 std::string m_filename; //!< name of the loaded file 00128 }; 00129 00130 #endif // WPAGEREEG_H