00001 #ifndef Volume_H 00002 #define Volume_H 00003 00004 #include <QObject> 00005 #include <QString> 00006 #include <vector> 00007 00008 // Simple linear volume class which supports loading from DAT files 00009 class Volume : public QObject 00010 { 00011 Q_OBJECT 00012 00013 public: 00014 Volume(); 00015 Volume(const std::string &fileName); 00016 ~Volume(void); 00017 const int getWidth() const; 00018 const int getHeight() const; 00019 const int getDepth() const; 00020 const int getSize() const; 00021 const int getDataRange() const; 00022 const unsigned short* getData() const; 00023 const std::vector<unsigned int>* Volume::getHistogramm() const; 00024 void loadDatFile(const std::string &fileName); 00025 const unsigned int getHistHeight() const; 00026 00027 public slots: 00028 void loadDatFile(); 00029 00030 00031 signals: 00032 void loadedDatFile(Volume *volume); 00033 void loadedDatFileName(const QString &name); 00034 00035 private: 00036 std::vector<unsigned short> voxels; 00037 std::vector<unsigned int> histogramm; 00038 unsigned int heightHist; 00039 int width, height, depth; 00040 QString curDir; 00041 }; 00042 00043 #endif // Volume_H