Public Member Functions | |
Volume () | |
empty constructor | |
~Volume () | |
destructor | |
void | resize (const unsigned int &Nx, const unsigned int &Ny, const unsigned int &Nz) |
resize (fill with zero) | |
unsigned int | size_x () const |
get size_x | |
unsigned int | size_y () const |
get size_y | |
unsigned int | size_z () const |
get size_z | |
double | get_data (const unsigned int &kx, const unsigned int &ky, const unsigned int &kz) const |
get the value at position (kx,ky,kz) | |
void | set_data (const unsigned int &kx, const unsigned int &ky, const unsigned int &kz, const double &value) |
set the value at position (kx,ky,kz) | |
double | operator() (const double &x, const double &y, const double &z) const |
get the value at any position (x,y,z) using intepolation | |
Volume | resampled_square (const unsigned int &N) const |
resample data to fit into a cube of a given size | |
Volume | rotated_z (const double &angle) const |
apply rotation to the data by a fiven angle (radian) around the z direction | |
Volume | smoothed () const |
smoothing | |
std::vector< float > | slice_x (const unsigned &kx) const |
extract a slice of data in plane x=kx. Return a texture of size Ny*Nz (access using slice_x(kx)[ky+Ny*kz]) | |
std::vector< float > | slice_y (const unsigned &ky) const |
extract a slice of data in plane y=ky. Return a texture of size Nx*Nz (access using slice_x(ky)[kx+Nx*kz]) | |
std::vector< float > | slice_z (const unsigned &kz) const |
extract a slice of data in plane z=kz. Return a texture of size Nx*Ny (access using slice_x(kz)[kx+Nx*ky]) | |
std::vector< float > | mip () const |
Apply MIP projection along the x direction (return b&w texture of size Ny*Nz). | |
std::vector< std::vector< float > > | ray_cast () const |
Apply classical ray-casting projection along the x direction (return color texture of size 3*Ny*Nz: access using ray_cast[r=0/g=1/b=2][ky+Ny*kz]). | |
Static Public Member Functions | |
static Volume | load_v4d (const std::string &filename) |
load a .4d volume file | |
Private Member Functions | |
double | linear_interpolation (const double &x, const double &y, const double &z) const |
internal tri-linear interpolation of the value at position (x,y,z). Return 0 if out-of-bounds | |
Private Attributes | |
unsigned int | Nx |
size in x direction | |
unsigned int | Ny |
size in y direction | |
unsigned int | Nz |
size in x direction | |
std::vector< float > | data |
internal data as concatenated vector of float |
Volume::Volume | ( | ) |
empty constructor
Volume::~Volume | ( | ) |
destructor
double Volume::get_data | ( | const unsigned int & | kx, | |
const unsigned int & | ky, | |||
const unsigned int & | kz | |||
) | const |
get the value at position (kx,ky,kz)
References data, Nx, Ny, and Nz.
Referenced by linear_interpolation(), mip(), ray_cast(), slice_x(), slice_y(), slice_z(), and smoothed().
double Volume::linear_interpolation | ( | const double & | x, | |
const double & | y, | |||
const double & | z | |||
) | const [private] |
internal tri-linear interpolation of the value at position (x,y,z). Return 0 if out-of-bounds
References get_data(), size_x(), size_y(), and size_z().
Referenced by operator()().
Volume Volume::load_v4d | ( | const std::string & | filename | ) | [static] |
std::vector< float > Volume::mip | ( | ) | const |
Apply MIP projection along the x direction (return b&w texture of size Ny*Nz).
References get_data(), size_x(), size_y(), and size_z().
Referenced by main().
double Volume::operator() | ( | const double & | x, | |
const double & | y, | |||
const double & | z | |||
) | const |
get the value at any position (x,y,z) using intepolation
References linear_interpolation().
std::vector< std::vector< float > > Volume::ray_cast | ( | ) | const |
Apply classical ray-casting projection along the x direction (return color texture of size 3*Ny*Nz: access using ray_cast[r=0/g=1/b=2][ky+Ny*kz]).
References get_data(), size_x(), size_y(), and size_z().
Referenced by main().
Volume Volume::resampled_square | ( | const unsigned int & | N | ) | const |
void Volume::resize | ( | const unsigned int & | Nx, | |
const unsigned int & | Ny, | |||
const unsigned int & | Nz | |||
) |
resize (fill with zero)
References data, Nx, Ny, and Nz.
Referenced by load_v4d(), resampled_square(), rotated_z(), and smoothed().
Volume Volume::rotated_z | ( | const double & | angle | ) | const |
void Volume::set_data | ( | const unsigned int & | kx, | |
const unsigned int & | ky, | |||
const unsigned int & | kz, | |||
const double & | value | |||
) |
set the value at position (kx,ky,kz)
References data, Nx, Ny, and Nz.
Referenced by load_v4d(), resampled_square(), rotated_z(), and smoothed().
unsigned int Volume::size_x | ( | ) | const |
get size_x
References Nx.
Referenced by linear_interpolation(), main(), mip(), ray_cast(), resampled_square(), rotated_z(), and smoothed().
unsigned int Volume::size_y | ( | ) | const |
get size_y
References Ny.
Referenced by linear_interpolation(), main(), mip(), ray_cast(), resampled_square(), rotated_z(), and smoothed().
unsigned int Volume::size_z | ( | ) | const |
get size_z
References Nz.
Referenced by linear_interpolation(), main(), mip(), ray_cast(), resampled_square(), rotated_z(), and smoothed().
std::vector< float > Volume::slice_x | ( | const unsigned & | kx | ) | const |
extract a slice of data in plane x=kx. Return a texture of size Ny*Nz (access using slice_x(kx)[ky+Ny*kz])
References get_data(), Ny, and Nz.
Referenced by main().
std::vector< float > Volume::slice_y | ( | const unsigned & | ky | ) | const |
extract a slice of data in plane y=ky. Return a texture of size Nx*Nz (access using slice_x(ky)[kx+Nx*kz])
References get_data(), Nx, and Nz.
Referenced by main().
std::vector< float > Volume::slice_z | ( | const unsigned & | kz | ) | const |
extract a slice of data in plane z=kz. Return a texture of size Nx*Ny (access using slice_x(kz)[kx+Nx*ky])
References get_data(), Nx, and Ny.
Referenced by main().
Volume Volume::smoothed | ( | ) | const |
smoothing
References get_data(), resize(), set_data(), size_x(), size_y(), and size_z().
Referenced by main().
std::vector<float> Volume::data [private] |
internal data as concatenated vector of float
Referenced by get_data(), resize(), and set_data().
unsigned int Volume::Nx [private] |
size in x direction
Referenced by get_data(), load_v4d(), resize(), set_data(), size_x(), slice_y(), and slice_z().
unsigned int Volume::Ny [private] |
size in y direction
Referenced by get_data(), load_v4d(), resize(), set_data(), size_y(), slice_x(), and slice_z().
unsigned int Volume::Nz [private] |
size in x direction
Referenced by get_data(), load_v4d(), resize(), set_data(), size_z(), slice_x(), and slice_y().