00001 #ifndef VOLUME_H_
00002 #define VOLUME_H_
00003 #include <iostream>
00004 #include <stdlib.h>
00005 #include <GL/glew.h>
00006 #include <GL/gl.h>
00007 #include <GL/glext.h>
00008 #include <QPainter>
00009 #include <QPixmap>
00010
00011 using namespace std;
00012
00016 class Volume
00017 {
00018 public:
00019 Volume(const std::string &strFilename);
00020 ~Volume();
00021 int* getSize();
00025 int getMinDensity() const { return minDensity; }
00029 int getMaxDensity() const { return maxDensity; }
00033 GLuint getTexture() const { return textureId; }
00037 QPixmap* getHistogramPtr() const { return histogram; }
00038
00039 private:
00040 void load(const std::string &strFilename);
00041 void createTexture();
00042 void createHistogram();
00043
00044 unsigned short *densities;
00045 unsigned short *densdata;
00046 short *data;
00047 unsigned short sizeX, sizeY, sizeZ;
00048 int sizeSlice, sizeVolume;
00049 int minDensity, maxDensity;
00050 QPixmap *histogram;
00051 GLuint textureId;
00052 size_t result;
00053 };
00054
00055 #endif
00056