src/neuroscopexmlreader.h

00001 /***************************************************************************
00002                           neuroscopexmlreader.h  -  description
00003                              -------------------
00004     begin                : Tue Mar 2 2004
00005     copyright            : (C) 2004 by Lynn Hazan
00006     email                : lynn.hazan.myrealbox.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef NEUROSCOPEXMLREADER_H
00019 #define NEUROSCOPEXMLREADER_H
00020 
00021 // include files for KDE
00022 #include <kurl.h>
00023 
00024 //Libxml2 include files.
00025 #include <stdlib.h>
00026 #include <stdio.h>
00027 #include <libxml/tree.h>
00028 #include <libxml/parser.h>
00029 #include <libxml/xpath.h>
00030 #include <libxml/xpathInternals.h>
00031 
00032 //include files for QT
00033 #include <qvaluelist.h> 
00034 
00035 //Application specific includes
00036 #include "sessionInformation.h"
00037 
00043 class NeuroscopeXmlReader {
00044 public:
00045 
00047   enum fileType{PARAMETER=0,SESSION=1};
00048 
00049      NeuroscopeXmlReader();
00050      ~NeuroscopeXmlReader();
00051 
00057   bool parseFile(const KURL& url,fileType type);
00058 
00060   void closeFile();
00061 
00066   int getResolution()const;
00067 
00072   int getNbChannels()const;
00073 
00078   double getSamplingRate()const;
00079 
00084   double getUpsamplingRate()const;
00085   
00090   double getLfpInformation()const;
00091   
00092 
00097   float getScreenGain() const;
00098 
00103   int getVoltageRange() const;
00104 
00109   int getAmplification() const;
00110   
00111 
00116   int getOffset()const;
00117 
00121   QValueList<ChannelDescription> getChannelDescription();
00122   
00126   void getChannelDefaultOffset(QMap<int,int>& channelDefaultOffsets);
00127   
00135   void getAnatomicalDescription(int nbChannels,QMap<int,int>& displayChannelsGroups,QMap<int, QValueList<int> >& displayGroupsChannels,
00136                                QMap<int,bool>& skipStatus);
00137   
00144   void getSpikeDescription(int nbChannels,QMap<int,int>& spikeChannelsGroups,QMap<int, QValueList<int> >& spikeGroupsChannels);
00145 
00150   int getNbSamples()const;
00151 
00156   float getWaveformLength()const;
00157   
00162   int getPeakSampleIndex()const;
00163  
00168   float getPeakSampleLength()const;
00169 
00170  
00174   QValueList<SessionFile> getFilesToLoad();
00175 
00179   QValueList<DisplayInformation> getDisplayInformation();
00180   
00181 
00188   QMap<QString,double> getSampleRateByExtension();
00189 
00193   int getVideoWidth()const;
00194 
00198   int getVideoHeight()const;
00199 
00203   int getRotation()const;
00204   
00208   int getFlip()const;
00209       
00214   int getTrajectory()const;
00215   
00219   QString getBackgroundImage()const;
00220   
00224   QString getTraceBackgroundImage()const;
00225   
00229   inline QString getVersion()const{return readVersion;};  
00230  
00234   inline NeuroscopeXmlReader::fileType getType()const{return type;};  
00235      
00236 private:
00237  xmlDocPtr doc;  
00238  fileType type;
00239  xmlXPathContextPtr xpathContex;
00240  QString readVersion;
00241 };
00242 
00243 #endif

Generated on Mon Sep 17 20:47:31 2007 for NeuroScope by  doxygen 1.5.1