volmetrics

annotate src/volume.h @ 32:6d637706cfaf

foo
author Eleni Maria Stea <elene.mst@gmail.com>
date Thu, 01 May 2014 19:05:07 +0300
parents add30e2d5253
children eb87d4a12bd3
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@9 7 class Mesh;
elene@9 8
eleni@1 9 class Volume {
eleni@1 10 private:
elene@3 11 std::vector<Image> slices;
elene@6 12
elene@4 13 int width;
elene@4 14 int height;
elene@5 15 float zaspect;
elene@30 16 float x_rot;
eleni@1 17
elene@6 18 unsigned int vol_tex;
elene@6 19 mutable bool vol_tex_valid;
elene@6 20
elene@6 21 void create_vol_tex() const;
elene@6 22
elene@3 23 public:
elene@3 24 Volume();
elene@6 25 ~Volume();
elene@3 26
elene@6 27 bool load(const char *fname);
elene@6 28
elene@4 29 bool push_slice(Image &&slice);
elene@6 30 const Image *get_slice(int num_slice) const;
elene@9 31
elene@9 32 // z must be in [0, 1]
elene@6 33 const Image *get_slice_by_z(float z) const;
elene@9 34
elene@6 35 int get_slice_count() const;
elene@6 36
elene@9 37 // z must be in [0, 1]
elene@6 38 int get_slice_idx_by_z(float z) const;
elene@6 39
elene@6 40 unsigned int get_texture() const;
elene@3 41
elene@30 42 float get_volume_rotation() const;
elene@30 43
elene@12 44 void create_mesh(Mesh *mesh, float tmin, float tmax, int xres, int yres, int zres);
elene@9 45
elene@8 46 void draw() const;
eleni@1 47 };
eleni@1 48
elene@16 49 float transfer_function(float x, float low_thres, float high_thres);
elene@16 50
eleni@0 51 #endif // VOLUME_H_