cgv
|
Public Types | |
typedef float | coord_type |
typedef cgv::math::fvec< int, 3 > | index_type |
typedef cgv::math::fvec< int, 3 > | dimension_type |
typedef cgv::math::fvec< coord_type, 3 > | point_type |
typedef cgv::math::fvec< coord_type, 3 > | extent_type |
typedef cgv::media::axis_aligned_box< coord_type, 3 > | box_type |
Public Member Functions | |
volume () | |
construct empty volume with unit cube as box and "uint8[L]" as component type | |
volume (const volume &V) | |
copy construct volume by allocating a copy of the volume data | |
~volume () | |
destruct | |
bool | empty () const |
return whether volume is empty | |
void | clear () |
deallocate all memory and reset data format to "uint8[L]" | |
const cgv::data::data_format & | get_format () const |
return const reference to data format | |
cgv::data::data_format & | get_format () |
return reference to data format | |
access to voxel format (components and type) | |
cgv::type::info::TypeId | get_component_type () const |
return the component type | |
cgv::data::ComponentFormat | get_component_format () const |
return component format | |
void | set_component_format (cgv::data::ComponentFormat cf) |
set a different component format | |
void | set_component_type (cgv::type::info::TypeId type_id) |
set the value type of the voxel components | |
void | set_component_format (const std::string &format) |
set the component format from a string according to the syntax declared in <cgv/data/component_format.h> | |
unsigned | get_nr_components () const |
return the number of components within a voxel | |
unsigned | get_component_size () const |
return the size of a voxel component in bytes | |
unsigned | get_voxel_size () const |
return the size of a voxel in bytes | |
size_t | get_row_size () const |
return the size of a row within a slice in bytes | |
size_t | get_slice_size () const |
return the size of a slice in bytes | |
size_t | get_size () const |
return size of volume in bytes | |
access to sampling resolution | |
virtual dimension_type | get_dimensions () const |
return the dimensions or (0,0,0) if not available | |
size_t | get_nr_voxels () const |
return the total number of voxels | |
virtual void | resize (const dimension_type &S) |
resize the volume | |
access to extent of volume | |
box_type | get_box () const |
return the bounding box in volume coordinates, which is computed from spacing and dimensions and centered around the origin | |
const extent_type & | get_extent () const |
return const reference to spatial extent | |
extent_type & | ref_extent () |
return reference spacing | |
extent_type | get_spacing () const |
return the voxel spacing, computed by extent/dimensions | |
access to volume data | |
const cgv::data::data_view & | get_data_view () const |
return a const reference to the data view | |
cgv::data::data_view & | get_data_view () |
return a reference to the data view | |
template<typename T > | |
const T * | get_data_ptr () const |
return a const pointer to the data | |
template<typename T > | |
T * | get_data_ptr () |
return a pointer to the data | |
template<typename T > | |
const T * | get_slice_ptr (unsigned k) const |
return a const pointer to the data of the k-th slice | |
template<typename T > | |
T * | get_slice_ptr (unsigned k) |
return a pointer to the data of the k-th slice | |
template<typename T > | |
const T * | get_row_ptr (unsigned j, unsigned k) const |
return a const pointer to the data of the j-th row in the k-th slice | |
template<typename T > | |
T * | get_row_ptr (unsigned j, unsigned k) |
return a pointer to the data of the j-th row in the k-th slice | |
template<typename T > | |
const T * | get_voxel_ptr (unsigned i, unsigned j, unsigned k) const |
return a const pointer to the component data of voxel (i,j,k) | |
template<typename T > | |
T * | get_voxel_ptr (unsigned i, unsigned j, unsigned k) |
return a pointer to the component data of voxel (i,j,k) | |
template<typename T > | |
T | get_voxel_component (unsigned i, unsigned j, unsigned k, unsigned ci=0) |
return a voxel component converted to type T | |
adding and replacing components of volume data | |
bool | add_new_component (data::data_view &component_dv) |
add new component on the end (if result has <=4 components) | |
bool | replace_component (unsigned i, data::data_view &component_dv) |
replace the i-th component in the volume data by the given data | |
Protected Attributes | |
cgv::data::data_format | df |
format description of volume data | |
cgv::data::data_view | dv |
data storage of volume data | |
extent_type | extent |
extent of the volume in each coordinate direction | |
typedef cgv::media::axis_aligned_box<coord_type,3> cgv::media::volume::volume::box_type |
typedef cgv::math::fvec<int,3> cgv::media::volume::volume::dimension_type |
typedef cgv::math::fvec<coord_type,3> cgv::media::volume::volume::extent_type |
typedef cgv::math::fvec<int,3> cgv::media::volume::volume::index_type |
typedef cgv::math::fvec<coord_type,3> cgv::media::volume::volume::point_type |
cgv::media::volume::volume::volume | ( | ) |
construct empty volume with unit cube as box and "uint8[L]" as component type
Definition at line 14 of file volume.cxx.
cgv::media::volume::volume::volume | ( | const volume & | V | ) |
copy construct volume by allocating a copy of the volume data
Definition at line 19 of file volume.cxx.
References df, dv, cgv::data::data_format::get_nr_bytes(), and cgv::data::data_view_impl< D, P >::get_ptr().
bool cgv::media::volume::volume::add_new_component | ( | data::data_view & | component_dv | ) |
add new component on the end (if result has <=4 components)
Definition at line 48 of file volume.cxx.
References cgv::data::CF_RG, cgv::data::CF_RGB, cgv::data::CF_RGBA, dv, cgv::data::data_format::get_component_format(), cgv::data::component_format::get_component_type(), cgv::data::data_format::get_depth(), cgv::data::data_view_base::get_format(), cgv::data::data_format::get_height(), cgv::data::component_format::get_nr_components(), cgv::data::data_format::get_nr_dimensions(), cgv::data::data_format::get_nr_time_steps(), cgv::data::data_view_impl< D, P >::get_ptr(), cgv::type::info::get_type_size(), and cgv::data::data_format::get_width().
|
inline |
|
inline |
volume::box_type cgv::media::volume::volume::get_box | ( | ) | const |
return the bounding box in volume coordinates, which is computed from spacing and dimensions and centered around the origin
Definition at line 35 of file volume.cxx.
References extent.
|
inline |
return component format
Definition at line 51 of file volume.h.
References cgv::data::component_format::get_standard_component_format().
|
inline |
return the size of a voxel component in bytes
Definition at line 61 of file volume.h.
References cgv::type::info::get_type_size().
|
inline |
return the component type
Definition at line 49 of file volume.h.
References cgv::data::component_format::get_component_type().
|
inline |
return a pointer to the data
Definition at line 105 of file volume.h.
References cgv::data::data_view_impl< D, P >::get_ptr().
|
inline |
return a const pointer to the data
Definition at line 102 of file volume.h.
References cgv::data::data_view_impl< D, P >::get_ptr().
|
inline |
|
inline |
|
virtual |
return the dimensions or (0,0,0) if not available
Reimplemented in cgv::media::volume::ooc_sliced_volume.
Definition at line 26 of file volume.cxx.
References df, cgv::data::data_format::get_depth(), cgv::data::data_format::get_height(), cgv::data::data_format::get_nr_dimensions(), and cgv::data::data_format::get_width().
Referenced by get_nr_voxels(), and get_spacing().
|
inline |
|
inline |
|
inline |
|
inline |
return the number of components within a voxel
Definition at line 59 of file volume.h.
References cgv::data::component_format::get_nr_components().
std::size_t cgv::media::volume::volume::get_nr_voxels | ( | ) | const |
return the total number of voxels
Definition at line 212 of file volume.cxx.
References get_dimensions().
|
inline |
return a pointer to the data of the j-th row in the k-th slice
Definition at line 117 of file volume.h.
References cgv::data::data_view_impl< D, P >::get_ptr().
|
inline |
return a const pointer to the data of the j-th row in the k-th slice
Definition at line 114 of file volume.h.
References cgv::data::data_view_impl< D, P >::get_ptr().
|
inline |
return the size of a row within a slice in bytes
Definition at line 65 of file volume.h.
References cgv::data::data_format::get_width().
|
inline |
|
inline |
return a pointer to the data of the k-th slice
Definition at line 111 of file volume.h.
References cgv::data::data_view_impl< D, P >::get_ptr().
|
inline |
return a const pointer to the data of the k-th slice
Definition at line 108 of file volume.h.
References cgv::data::data_view_impl< D, P >::get_ptr().
|
inline |
return the size of a slice in bytes
Definition at line 67 of file volume.h.
References cgv::data::data_format::get_height().
volume::extent_type cgv::media::volume::volume::get_spacing | ( | ) | const |
return the voxel spacing, computed by extent/dimensions
Definition at line 41 of file volume.cxx.
References extent, and get_dimensions().
|
inline |
return a voxel component converted to type T
Definition at line 126 of file volume.h.
References cgv::data::data_view_impl< D, P >::get().
|
inline |
return a pointer to the component data of voxel (i,j,k)
Definition at line 123 of file volume.h.
References cgv::data::data_view_impl< D, P >::get_ptr().
|
inline |
return a const pointer to the component data of voxel (i,j,k)
Definition at line 120 of file volume.h.
References cgv::data::data_view_impl< D, P >::get_ptr().
|
inline |
return the size of a voxel in bytes
Definition at line 63 of file volume.h.
References cgv::data::data_format::get_component_format(), and cgv::data::component_format::get_entry_size().
|
inline |
bool cgv::media::volume::volume::replace_component | ( | unsigned | i, |
data::data_view & | component_dv | ||
) |
replace the i-th component in the volume data by the given data
Definition at line 144 of file volume.cxx.
References dv, cgv::data::data_format::get_component_format(), cgv::data::component_format::get_component_type(), cgv::data::data_format::get_depth(), cgv::data::data_view_base::get_format(), cgv::data::data_format::get_height(), cgv::data::component_format::get_nr_components(), cgv::data::data_format::get_nr_dimensions(), cgv::data::data_format::get_nr_time_steps(), cgv::data::data_view_impl< D, P >::get_ptr(), cgv::type::info::get_type_size(), and cgv::data::data_format::get_width().
|
virtual |
resize the volume
Reimplemented in cgv::media::volume::ooc_sliced_volume.
Definition at line 221 of file volume.cxx.
References df, dv, cgv::data::data_format::set_depth(), cgv::data::data_format::set_height(), and cgv::data::data_format::set_width().
|
inline |
set a different component format
Definition at line 53 of file volume.h.
References cgv::data::component_format::get_component_type(), and cgv::data::data_format::set_component_format().
|
inline |
set the component format from a string according to the syntax declared in <cgv/data/component_format.h>
Definition at line 57 of file volume.h.
References cgv::data::data_format::set_component_format().
|
inline |
set the value type of the voxel components
Definition at line 55 of file volume.h.
References cgv::data::component_format::set_component_type().
|
protected |
format description of volume data
Definition at line 25 of file volume.h.
Referenced by cgv::media::volume::ooc_sliced_volume::get_dimensions(), get_dimensions(), cgv::media::volume::ooc_sliced_volume::open_read(), cgv::media::volume::ooc_sliced_volume::resize(), resize(), and volume().
|
protected |
data storage of volume data
Definition at line 27 of file volume.h.
Referenced by add_new_component(), replace_component(), cgv::media::volume::ooc_sliced_volume::resize(), resize(), volume(), and cgv::media::volume::ooc_sliced_volume::write_slice().
|
protected |
extent of the volume in each coordinate direction
Definition at line 29 of file volume.h.
Referenced by get_box(), get_spacing(), and cgv::media::volume::ooc_sliced_volume::open_read().