OpenWalnut 1.2.5
WPagerEEG.h
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 "../WExportDataHandler.h"
00036 
00037 
00038 /**
00039  * Abstract class to load an EEG file and keep it open to support paging.
00040  * \ingroup dataHandler
00041  */
00042 class OWDATAHANDLER_EXPORT WPagerEEG // NOLINT
00043 {
00044 public:
00045     /**
00046      * Virtual destructor
00047      */
00048     virtual ~WPagerEEG();
00049 
00050     /**
00051      * Get the name of the loaded file.
00052      *
00053      * \return name of file
00054      */
00055     std::string getFileName() const;
00056 
00057     /**
00058      * Get the number of segments this EEG consists of.
00059      *
00060      * \return number of segments
00061      */
00062     virtual std::size_t getNumberOfSegments() const = 0;
00063 
00064     /**
00065      * Get the number of channels this EEG has.
00066      *
00067      * \return number of channels
00068      */
00069     virtual std::size_t getNumberOfChannels() const = 0;
00070 
00071     /**
00072      * Get the number of samples of a given segment.
00073      *
00074      * \param segmentID segment number being inspected
00075      * \return number of samples
00076      */
00077     virtual std::size_t getNumberOfSamples( std::size_t segmentID ) const = 0;
00078 
00079     /**
00080      * Get the values of all channels for a given sample range.
00081      *
00082      * \param segmentID segment number to read the values from
00083      * \param start start sample of the sample range
00084      * \param length length of the sample range
00085      * \return matrix of values
00086      */
00087     virtual boost::shared_ptr< WEEGValueMatrix > getValues( std::size_t segmentID, std::size_t start, std::size_t length ) const = 0;
00088 
00089     /**
00090      * Get the sampling rate used by the recording.
00091      *
00092      * \return sampling rate
00093      */
00094     virtual double getSamplingRate() const = 0;
00095 
00096     /**
00097      * Get the unit used by the recording of a given channel.
00098      *
00099      * \param channelID channel number
00100      * \return unit as string
00101      */
00102     virtual std::string getChannelUnit( std::size_t channelID ) const = 0;
00103 
00104     /**
00105      * Get the label of a given channel.
00106      *
00107      * \param channelID channel number
00108      * \return label as string
00109      */
00110     virtual std::string getChannelLabel( std::size_t channelID ) const = 0;
00111 
00112 protected:
00113     /**
00114      * Constructor
00115      *
00116      * \param fileName path and filename to the file to load
00117      */
00118     explicit WPagerEEG( std::string fileName );
00119 
00120     std::string m_fileName; //!< name of the loaded file
00121 
00122 private:
00123 };
00124 
00125 #endif  // WPAGEREEG_H
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends