volmetrics
annotate src/volume.h @ 37:1d935677d3ab
Created new branch non-qt-version
author | Eleni Maria Stea <elene.mst@gmail.com> |
---|---|
date | Mon, 17 Apr 2017 13:26:24 +0000 |
parents | e548d95e0667 |
children |
rev | line source |
---|---|
eleni@0 | 1 #ifndef VOLUME_H_ |
eleni@0 | 2 #define VOLUME_H_ |
eleni@0 | 3 |
elene@3 | 4 #include <vector> |
elene@3 | 5 #include "image.h" |
elene@3 | 6 |
elene@34 | 7 #define HIST_SIZE 256 |
elene@34 | 8 |
elene@9 | 9 class Mesh; |
elene@9 | 10 |
eleni@1 | 11 class Volume { |
eleni@1 | 12 private: |
elene@3 | 13 std::vector<Image> slices; |
elene@6 | 14 |
elene@4 | 15 int width; |
elene@4 | 16 int height; |
elene@5 | 17 float zaspect; |
elene@30 | 18 float x_rot; |
eleni@1 | 19 |
elene@6 | 20 unsigned int vol_tex; |
elene@6 | 21 mutable bool vol_tex_valid; |
elene@6 | 22 |
elene@6 | 23 void create_vol_tex() const; |
elene@6 | 24 |
elene@3 | 25 public: |
elene@34 | 26 int histogram[HIST_SIZE]; |
elene@34 | 27 int max_histogram_value; |
elene@34 | 28 |
elene@34 | 29 public: |
elene@3 | 30 Volume(); |
elene@6 | 31 ~Volume(); |
elene@3 | 32 |
elene@6 | 33 bool load(const char *fname); |
elene@6 | 34 |
elene@4 | 35 bool push_slice(Image &&slice); |
elene@6 | 36 const Image *get_slice(int num_slice) const; |
elene@9 | 37 |
elene@9 | 38 // z must be in [0, 1] |
elene@6 | 39 const Image *get_slice_by_z(float z) const; |
elene@9 | 40 |
elene@6 | 41 int get_slice_count() const; |
elene@6 | 42 |
elene@9 | 43 // z must be in [0, 1] |
elene@6 | 44 int get_slice_idx_by_z(float z) const; |
elene@6 | 45 |
elene@6 | 46 unsigned int get_texture() const; |
elene@3 | 47 |
elene@30 | 48 float get_volume_rotation() const; |
elene@30 | 49 |
elene@12 | 50 void create_mesh(Mesh *mesh, float tmin, float tmax, int xres, int yres, int zres); |
elene@9 | 51 |
elene@34 | 52 void create_histogram(); |
elene@8 | 53 void draw() const; |
eleni@1 | 54 }; |
eleni@1 | 55 |
elene@16 | 56 float transfer_function(float x, float low_thres, float high_thres); |
elene@16 | 57 |
eleni@0 | 58 #endif // VOLUME_H_ |