Volume.hpp
Go to the documentation of this file.00001
00002
00003 #include <iostream>
00004 #include <vector>
00005
00006 #ifndef _VOLUME_HPP_
00007 #define _VOLUME_HPP_
00008
00009 class Volume
00010 {
00011 public:
00012
00013
00014
00015
00016
00017
00018
00020 Volume();
00022 ~Volume();
00023
00024
00025
00026
00027
00028
00029
00031 static Volume load_v4d(const std::string& filename);
00032
00033
00034
00035
00036
00037
00038
00039
00041 void resize(const unsigned int& Nx,const unsigned int& Ny,const unsigned int& Nz);
00042
00044 unsigned int size_x() const;
00046 unsigned int size_y() const;
00048 unsigned int size_z() const;
00049
00050
00051
00052
00053
00054
00055
00056
00058 double get_data(const unsigned int& kx,const unsigned int& ky,const unsigned int& kz) const;
00060 void set_data(const unsigned int& kx,const unsigned int& ky,const unsigned int& kz,const double& value);
00061
00063 double operator()(const double& x,const double& y,const double& z) const;
00064
00065
00066
00067
00068
00069
00070
00071
00072
00074 Volume resampled_square(const unsigned int& N) const;
00075
00077 Volume rotated_z(const double& angle) const;
00078
00080 Volume smoothed() const;
00081
00082
00083
00084
00085
00086
00087
00089 std::vector <float> slice_x(const unsigned& kx) const;
00091 std::vector <float> slice_y(const unsigned& ky) const;
00093 std::vector <float> slice_z(const unsigned& kz) const;
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00105 std::vector<float> mip() const;
00107 std::vector<std::vector<float> > ray_cast() const;
00108
00109
00110 private:
00111
00113 double linear_interpolation(const double& x,const double& y,const double& z) const;
00114
00116 unsigned int Nx;
00118 unsigned int Ny;
00120 unsigned int Nz;
00122 std::vector <float> data;
00123 };
00124
00125 #endif