glviewvol
diff src/volume.h @ 0:7bdf40403b9c
dicom viewer project underway
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 27 Dec 2014 02:35:58 +0200 |
parents | |
children | cc9e0d8590e2 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/volume.h Sat Dec 27 02:35:58 2014 +0200 1.3 @@ -0,0 +1,37 @@ 1.4 +#ifndef VOLUME_H_ 1.5 +#define VOLUME_H_ 1.6 + 1.7 +#include "image.h" 1.8 + 1.9 +class Volume { 1.10 +public: 1.11 + virtual ~Volume(); 1.12 + 1.13 + // returns -1 if the volume is continuously defined 1.14 + virtual int num_samples(int dim) const; 1.15 + 1.16 + // central differences offset will be delta / num_samples 1.17 + virtual void normalf(float *norm, float x, float y, float z, float delta = 1.0); 1.18 + virtual void normali(float *norm, int x, int y, int z); 1.19 + 1.20 + virtual float valuef(float x, float y, float z) const = 0; 1.21 + virtual float valuei(int x, int y, int z) const = 0; 1.22 +}; 1.23 + 1.24 +class VoxelVolume : public Volume { 1.25 +protected: 1.26 + std::vector<Image> slices; 1.27 + 1.28 +public: 1.29 + VoxelVolume(); 1.30 + ~VoxelVolume(); 1.31 + 1.32 + bool load(const char *fname); 1.33 + 1.34 + int num_samples(int dim) const; 1.35 + 1.36 + float valuef(float x, float y, float z) const; 1.37 + float valuei(int x, int y, int z) const; 1.38 +}; 1.39 + 1.40 +#endif // VOLUME_H_