IsoEx
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
Classes | Public Types | Public Member Functions | List of all members
IsoEx::VolumeImageT< Scalar > Class Template Reference
Inheritance diagram for IsoEx::VolumeImageT< Scalar >:
IsoEx::ScalarGridT< Scalar > IsoEx::RegularGrid< Vec3 > IsoEx::Grid< Vec3 >

Classes

struct  Dimension
 
struct  Neighbor
 

Public Types

enum  Formats {
  VI_UCHAR, VI_USHORT, VI_HALF, VI_FLOAT,
  VI_LOGBYTE
}
 Determines data type of stored image. More...
 
typedef VectorFieldT< Scalar, 3 > VectorField
 
typedef VectorField::Vector Vec3
 
typedef std::vector< NeighborGaussKernel
 
typedef enum
IsoEx::VolumeImageT::Formats 
VolumeImageMode
 Determines data type of stored image.
 
- Public Types inherited from IsoEx::ScalarGridT< Scalar >
typedef std::vector< Scalar > Values
 
- Public Types inherited from IsoEx::RegularGrid< Vec3 >
typedef ACG::Matrix4x4T
< typename Vec3::value_type > 
Matrix
 
typedef Vec3::value_type real
 
typedef Grid< Vec3 >::CubeIdx CubeIdx
 CubeIdx can be used to refer to cubes.
 
typedef Grid< Vec3 >::PointIdx PointIdx
 The grid points can be referred to by PointIdx.
 
- Public Types inherited from IsoEx::Grid< Vec3 >
typedef Vec3 Vec3
 
typedef Vec3::value_type real
 
typedef unsigned int CubeIdx
 CubeIdx can be used to refer to cubes.
 
typedef unsigned int PointIdx
 The grid points can be referred to by PointIdx.
 

Public Member Functions

 VolumeImageT (const Vec3 &_origin=Vec3(0, 0, 0), const Vec3 &_x_axis=Vec3(1, 0, 0), const Vec3 &_y_axis=Vec3(0, 1, 0), const Vec3 &_z_axis=Vec3(0, 0, 1), unsigned int _x_res=10, unsigned int _y_res=10, unsigned int _z_res=10)
 Default constructor.
 
virtual ~VolumeImageT ()
 Destructor.
 
void init (const Vec3 &_origin, const Vec3 &_x_axis, const Vec3 &_y_axis, const Vec3 &_z_axis, unsigned int _x_res, unsigned int _y_res, unsigned int _z_res)
 
virtual bool read (const char *_fname)
 load and save
 
virtual bool write (const char *_filename, VolumeImageMode _mode)
 
void getByteData (std::vector< unsigned char > &_result) const
 Returns an array of bytes. More...
 
void getByteDataGradient (std::vector< unsigned char > &_result) const
 
void getData (std::vector< float > &_result) const
 
void getDataGradient (std::vector< float > &_result) const
 
void update_min_max ()
 min/max scalar value
 
Scalar max_value ()
 
Scalar min_value ()
 
void bilateral_filter (Scalar _hs, Scalar _hr, int _iterations)
 Filter.
 
void bilateral_filter_simple (Scalar _sigma_s, Scalar _sigma_r, int _iterations)
 
void normalize ()
 normalization and clamping
 
void normalize (double _min, double _max)
 
void clamp (double _min, double _max)
 
void normalize_with_histogram (Scalar _max, Scalar _percent, int _n_bins=1000)
 
void histogram (const int _n_bins, std::vector< unsigned int > &_bins, Scalar &_size, bool _to_image=false)
 
void set_border ()
 
void assign_gradients ()
 Gradient calculation.
 
void normalize_gradients ()
 
Vec3 calcGradient (const unsigned int &_x, const unsigned int &_y, const unsigned int &_z)
 
VectorFieldgrad_field ()
 access to gradient field
 
- Public Member Functions inherited from IsoEx::ScalarGridT< Scalar >
 ScalarGridT (const Vec3 &_origin=Vec3(0, 0, 0), const Vec3 &_x_axis=Vec3(1, 0, 0), const Vec3 &_y_axis=Vec3(0, 1, 0), const Vec3 &_z_axis=Vec3(0, 0, 1), unsigned int _x_res=1, unsigned int _y_res=1, unsigned int _z_res=1)
 Default constructor.
 
virtual ~ScalarGridT ()
 Destructor.
 
void initialize (const Vec3 &_origin, const Vec3 &_x_axis, const Vec3 &_y_axis, const Vec3 &_z_axis, unsigned int _x_res, unsigned int _y_res, unsigned int _z_res)
 function to initialize the grid
 
virtual real scalar_distance (PointIdx _pidx) const
 
virtual bool is_inside (PointIdx _pidx) const
 
virtual bool directed_distance (const Vec3 &, const Vec3 &, Vec3 &, Vec3 &, real &) const
 See IsoEx::Implicit::directed_distance()
 
void sample (const Implicit &_implicit)
 
virtual bool write (const char *_filename)
 
virtual bool read (FILE *_in)
 
virtual bool write (FILE *_out)
 
Scalar & operator() (unsigned int x, unsigned int y, unsigned int z)
 data access
 
Scalar operator() (unsigned int x, unsigned int y, unsigned int z) const
 
Scalar & value (unsigned int x, unsigned int y, unsigned int z)
 
Scalar value (unsigned int x, unsigned int y, unsigned int z) const
 
Scalar value_range (int x, int y, int z) const
 get scalar value, returns 0.0 if position is not in range
 
Scalar lerp_local (Scalar _x, Scalar _y, Scalar _z)
 function to lineary interpolate a scalar value at a local point
 
Scalar lerp_world (Scalar _x, Scalar _y, Scalar _z)
 funciton to lineary interploate a scalar value at a world point
 
void get_isosurface_intersections_local (const Vec3 &_o, const Vec3 &_d, Scalar _iso, std::vector< Vec3 > &_intersections)
 get intersections with isosurface in local coordinates
 
void get_isosurface_intersections_world (const Vec3 &_o, const Vec3 &_d, Scalar _iso, std::vector< Vec3 > &_intersections)
 get intersections with isosurface in world coordinates
 
- Public Member Functions inherited from IsoEx::RegularGrid< Vec3 >
 RegularGrid (const Vec3 &_origin=Vec3(0, 0, 0), const Vec3 &_x_axis=Vec3(1, 0, 0), const Vec3 &_y_axis=Vec3(0, 1, 0), const Vec3 &_z_axis=Vec3(0, 0, 1), unsigned int _x_res=1, unsigned int _y_res=1, unsigned int _z_res=1)
 
void initialize (const Vec3 &_origin, const Vec3 &_x_axis, const Vec3 &_y_axis, const Vec3 &_z_axis, unsigned int _x_res, unsigned int _y_res, unsigned int _z_res)
 function to initialize the grid
 
unsigned int n_cubes () const
 Return number of cubes.
 
unsigned int n_points () const
 Return number of points.
 
PointIdx point_idx (CubeIdx _idx, unsigned char _corner) const
 Return the PointIdx of the _corners'th corner of the cube _idx.
 
Vec3 point (PointIdx _idx) const
 Return the 3D point refered to by _idx.
 
Vec3 point (int x, int y, int z) const
 Return the 3D point refered to by x,y,z.
 
PointIdx nearest_point (const Vec3 &_p)
 Return the nearest grid point.
 
const Vec3 & origin () const
 
const Vec3 & x_axis () const
 
const Vec3 & y_axis () const
 
const Vec3 & z_axis () const
 
const Vec3 & dx () const
 
const Vec3 & dy () const
 
const Vec3 & dz () const
 
unsigned int x_resolution () const
 
unsigned int y_resolution () const
 
unsigned int z_resolution () const
 
Vec3 to_local (const Vec3 &_pw)
 transforms a point to local cube coordinates
 
Vec3 to_world (const Vec3 &_pl)
 transforms a point for local cube coordinates to world coordinates
 
bool ray_intersect_local (const Vec3 &_o, const Vec3 &_d, Vec3 &_entry, Vec3 &_exit)
 function to intersect a Ray with the cube ( local coordinates )
 
real volume ()
 returns the volume of the grid
 
virtual real outer_surface ()
 returns the outer surface of the grid
 
- Public Member Functions inherited from IsoEx::Grid< Vec3 >
 Grid ()
 Default constructor.
 
virtual ~Grid ()
 Destructor.
 
CubeIterator begin () const
 Returns begin iterator for the grid's cubes.
 
CubeIterator end () const
 Returns end iterator for the grid's cubes.
 
virtual PointIdx point_idx (CubeIdx _idx, unsigned char _corner) const =0
 Return the PointIdx of the _corners'th corner of the cube _idx.
 
virtual Vec3 point (PointIdx _idx) const =0
 Return the 3D point refered to by _idx.
 
virtual bool is_inside (PointIdx _pidx) const =0
 See IsoEx::Implicit::is_inside()
 
virtual real scalar_distance (PointIdx _pidx) const =0
 See IsoEx::Implicit::scalar_distance()
 

Additional Inherited Members

- Protected Attributes inherited from IsoEx::ScalarGridT< Scalar >
Values values_
 
- Protected Attributes inherited from IsoEx::RegularGrid< Vec3 >
Matrix to_local_
 
Matrix to_world_
 
Vec3 origin_
 
Vec3 x_axis_
 
Vec3 y_axis_
 
Vec3 z_axis_
 
Vec3 dx_
 
Vec3 dy_
 
Vec3 dz_
 
unsigned int x_res_
 
unsigned int y_res_
 
unsigned int z_res_
 
unsigned int n_cubes_
 
unsigned int n_points_
 
CubeIdx offsets_ [8]
 

Member Enumeration Documentation

template<class Scalar>
enum IsoEx::VolumeImageT::Formats

Determines data type of stored image.

Enumerator
VI_UCHAR 

Image will use bytes.

VI_USHORT 

Image will use 16 bit integers.

VI_HALF 

Image will use 16 bit Scalars.

VI_FLOAT 

Image will use 32 bit Scalars.

VI_LOGBYTE 

Image will use logarithmic byte encoding.

Member Function Documentation

template<class Scalar >
void IsoEx::VolumeImageT< Scalar >::getByteData ( std::vector< unsigned char > &  _result) const

Returns an array of bytes.

Returns the volume data converted into bytes, e.g. for usage as a 3D texture. The range 0.0 - 1.0 is converted to 0 - 255. Values that are out of these bounds are clipped to the nearest bound.

template<class Scalar>
void IsoEx::VolumeImageT< Scalar >::histogram ( const int  _n_bins,
std::vector< unsigned int > &  _bins,
Scalar &  _size,
bool  _to_image = false 
)

Image of Histogram


The documentation for this class was generated from the following files: