Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

realvox Namespace Reference


Detailed Description

RealVoxel functions and operations.


Typedefs

typedef int typedef_Vec3Array
typedef int typedef_RetinaPts

Functions

template<class T>
RealVoxel< PixRGB< T > > convertToReal (const VirtualVoxel< PixRGB< T > > &vvox, const PixRGB< T > &filler)
 Convert a VirtualVoxel image to a RealVoxel image.
template<class T>
VirtualVoxel< PixRGB< T > > convertToVirtual (const RealVoxel< PixRGB< T > > &rvox)
 Convert a RealVoxel image to a VirtualVoxel image.
template<class T>
void normalize (RealVoxel< PixRGB< T > > &rvox, const T lowBound, const T upperBound)
 Normalize a voxel image between the range lowBound and upperBound.
template<class T>
void normalize (RealVoxel< PixHyper< T, 4 > > &rvox, const T lowBound, const T upperBound)
 Normalize a voxel image between the range lowBound and upperBound.
template<class T>
void normalize (RealVoxel< T > &rvox, const T lowBound, const T upperBound)
 Normalize a voxel image between the range lowBound and upperBound.
template<class T>
void normalize (RealVoxel< PixRGB< T > > &rvox, const PixRGB< T > lowBound, const PixRGB< T > upperBound)
 Normalize a voxel image between the range lowBound and upperBound.
template<class T>
void normalize (RealVoxel< PixHyper< T, 4 > > &rvox, const PixHyper< T, 4 > lowBound, const PixHyper< T, 4 > upperBound)
 Normalize a voxel image between the range lowBound and upperBound.
template<class T>
void normalize (RealVoxel< PixRGB< T > > &out_rvox, const RealVoxel< PixRGB< T > > &in_rvox, const T lowBound, const T upperBound)
 Normalize a voxel image between the range lowBound and upperBound.
template<class T>
void normalize (RealVoxel< PixHyper< T, 4 > > &out_rvox, const RealVoxel< PixHyper< T, 4 > > &in_rvox, const T lowBound, const T upperBound)
 Normalize a voxel image between the range lowBound and upperBound.
template<class T>
void normalize (RealVoxel< T > &out_rvox, const RealVoxel< T > &in_rvox, const T lowBound, const T upperBound)
 Normalize a voxel image between the range lowBound and upperBound.
template<class T>
void normalize (RealVoxel< PixRGB< T > > &out_rvox, const RealVoxel< PixRGB< T > > &in_rvox, const PixRGB< T > &lowBound, const PixRGB< T > &upperBound)
 Normalize a voxel image between the range lowBound and upperBound.
template<class T>
void normalize (RealVoxel< PixHyper< T, 4 > > &out_rvox, const RealVoxel< PixHyper< T, 4 > > &in_rvox, const PixHyper< T, 4 > &lowBound, const PixHyper< T, 4 > &upperBound)
 Normalize a voxel image between the range lowBound and upperBound.
template<class T>
void getMinMax (T &min, T &max, const RealVoxel< T > &rvox)
 Get the min and max value in this RealVoxel image.
template<class T>
void getMinMax (PixRGB< T > &min, PixRGB< T > &max, const RealVoxel< PixRGB< T > > &rvox)
 Get the min and max values for each Pixel value in this RealVoxel image.
template<class T>
void getMinMax (PixHyper< T, 4 > &min, PixHyper< T, 4 > &max, const RealVoxel< PixHyper< T, 4 > > &rvox)
 Get the min and max values for each Pixel value in this RealVoxel image.
template<class T>
void ripSlicesToFile (const RealVoxel< PixRGB< T > > &rvox, const std::string &fname, const imgvox::axis axis)
 Call to raster and rip all the images slices to file along axis.
template<class T>
void initIfNeeded (RealVoxel< T > &out_rvox, const RealVoxel< T > &in_rvox)
 if out image is not initialized, init to size of in image
template<class T>
void initIfNeeded (RealVoxel< PixRGB< T > > &out_rvox, const RealVoxel< PixRGB< T > > &in_rvox)
 if out image is not initialized, init to size of in image
template<class T>
void initIfNeeded (RealVoxel< PixHyper< T, 4 > > &out_rvox, const RealVoxel< PixHyper< T, 4 > > &in_rvox)
 if out image is not initialized, init to size of in image
template<class T>
RealVoxel< PixRGB< T > > importOSGPointCloud (const typedef_RetinaPts &pts, const PixRGB< T > &filler)
 Convert a set of Open Scene Graph points to a RealVoxel image.
template<class T>
typedef_RetinaPts exportOSGPointCloud (const RealVoxel< PixRGB< T > > &ivox)
 Convert a RealVoxel image to a set of Open Scene Graph points.
template<class T>
RealVoxel< PixRGB< T > > importOSGPointCloud (const typedef_RetinaPts &pts, const Point< int, 3 > &newSize, const PixRGB< T > &filler)
 Convert a set of Open Scene Graph points to a RealVoxel image with resize.
VoxRange computeOSGPointRange (const typedef_Vec3Array vecV)
 Compute the range of coordinates in the point cloud.


Function Documentation

VoxRange realvox::computeOSGPointRange const typedef_Vec3Array  vecV  ) 
 

Compute the range of coordinates in the point cloud.

in order to create a RealVoxel from a point cloud, it is conveniant to get the true size of the point cloud and normalize the RealVoxel image size accordinaly. Note that a point cloud may contain negative numbers. The range is thus also used to align the Point Cloud into the positive unsigned coordinate space of the RealVoxel image.

Parameters:
vecV this is of type osg::ref_ptr<osg::Vec3Array>

Definition at line 654 of file RealVoxelOps.C.

References OSGUtil::computeRange().

Referenced by importOSGPointCloud().

template<class T>
RealVoxel< PixRGB< T > > realvox::convertToReal const VirtualVoxel< PixRGB< T > > &  vvox,
const PixRGB< T > &  filler
 

Convert a VirtualVoxel image to a RealVoxel image.

Since VirtualVoxel is a sparse image, there will likely be blank image points where data has not been mapped to the RealVoxel image. You must determine how to treat this empty space. All empty voxels will be set to the value in filler.

Definition at line 50 of file RealVoxelOps.C.

References RealVoxel< T >::clear(), pos, RealVoxel< T >::resize(), w, x, and y.

template<class T>
VirtualVoxel< PixRGB< T > > realvox::convertToVirtual const RealVoxel< PixRGB< T > > &  rvox  ) 
 

Convert a RealVoxel image to a VirtualVoxel image.

Definition at line 97 of file RealVoxelOps.C.

References VirtualVoxel< T >::get(), pos, VirtualVoxel< T >::set(), w, x, and y.

template<class T>
typedef_RetinaPts realvox::exportOSGPointCloud const RealVoxel< PixRGB< T > > &  ivox  ) 
 

Convert a RealVoxel image to a set of Open Scene Graph points.

Definition at line 492 of file RealVoxelOps.C.

References RealVoxel< T >::end(), h, w, x, y, and z.

template<class T>
void realvox::getMinMax PixHyper< T, 4 > &  min,
PixHyper< T, 4 > &  max,
const RealVoxel< PixHyper< T, 4 > > &  rvox
 

Get the min and max values for each Pixel value in this RealVoxel image.

This one operates on 4D pixels

Definition at line 319 of file RealVoxelOps.C.

References RealVoxel< T >::end(), and Pixels< T, dim >::p.

template<class T>
void realvox::getMinMax PixRGB< T > &  min,
PixRGB< T > &  max,
const RealVoxel< PixRGB< T > > &  rvox
 

Get the min and max values for each Pixel value in this RealVoxel image.

This one operates on PixRGB

Definition at line 298 of file RealVoxelOps.C.

References RealVoxel< T >::end(), and Pixels< T, 3 >::p.

template<class T>
void realvox::getMinMax T &  min,
T &  max,
const RealVoxel< T > &  rvox
 

Get the min and max value in this RealVoxel image.

This one operates on Gray scale images

Definition at line 284 of file RealVoxelOps.C.

References RealVoxel< T >::begin(), and RealVoxel< T >::end().

Referenced by normalize().

template<class T>
RealVoxel< PixRGB< T > > realvox::importOSGPointCloud const typedef_RetinaPts pts,
const Point< int, 3 > &  newSize,
const PixRGB< T > &  filler
 

Convert a set of Open Scene Graph points to a RealVoxel image with resize.

Resize will attempt to squash a point cloud by binning the points and avaraging the bins. This method is supplied so that point clouds can be shrunk before the creation of the RealVoxel image in order to save RAM. As such it only supports size reduction. This is also why there is no resize for the exportOSGPointCloud method.

Since the Point Cloud from Open Scene Graph is a sparse image, there will likely be blank image points where data has not been mapped to the RealVoxel image. You must determine how to treat this empty space. All empty voxels will be set to the value in filler.

NOTE: Open Scene Graph and OpenGL both consider color as a floating point between 0 and 1. As such, the color of the RealVoxel should be normalized if possible.

NOTE 2: The OpenGL / OSG coordinates are inverted from the INVT image coordinates so if you inspect the voxel image it will look upside down.

Parameters:
pts This is of type OSGRetinaPts

Definition at line 545 of file RealVoxelOps.C.

References RealVoxel< T >::begin(), tcl::list::begin(), RealVoxel< T >::beginw(), RealVoxel< T >::clear(), computeOSGPointRange(), RealVoxel< T >::endw(), VoxRange::maxRange, VoxRange::minX, VoxRange::minY, VoxRange::minZ, Point< T, DIMS >::P, Pixels< T, 3 >::p, Pixels< T, dim >::p, and Dlist::range().

template<class T>
RealVoxel< PixRGB< T > > realvox::importOSGPointCloud const typedef_RetinaPts pts,
const PixRGB< T > &  filler
 

Convert a set of Open Scene Graph points to a RealVoxel image.

Since the Point Cloud from Open Scene Graph is a sparse image, there will likely be blank image points where data has not been mapped to the RealVoxel image. You must determine how to treat this empty space. All empty voxels will be set to the value in filler.

NOTE: Open Scene Graph and OpenGL both consider color as a floating point between 0 and 1. As such, the color of the RealVoxel should be normalized if possible.

NOTE 2: The OpenGL / OSG coordinates are inverted from the INVT image coordinates so if you inspect the voxel image it will look upside down.

Parameters:
pts This is of type OSGRetinaPts

Definition at line 447 of file RealVoxelOps.C.

References RealVoxel< T >::clear(), computeOSGPointRange(), VoxRange::minX, VoxRange::minY, VoxRange::minZ, pix, Dlist::range(), VoxRange::rangeX, VoxRange::rangeY, VoxRange::rangeZ, and RealVoxel< T >::resize().

template<class T>
void realvox::initIfNeeded RealVoxel< PixHyper< T, 4 > > &  out_rvox,
const RealVoxel< PixHyper< T, 4 > > &  in_rvox
 

if out image is not initialized, init to size of in image

Definition at line 429 of file RealVoxelOps.C.

References ASSERT.

template<class T>
void realvox::initIfNeeded RealVoxel< PixRGB< T > > &  out_rvox,
const RealVoxel< PixRGB< T > > &  in_rvox
 

if out image is not initialized, init to size of in image

Definition at line 414 of file RealVoxelOps.C.

References ASSERT.

template<class T>
void realvox::initIfNeeded RealVoxel< T > &  out_rvox,
const RealVoxel< T > &  in_rvox
 

if out image is not initialized, init to size of in image

Definition at line 399 of file RealVoxelOps.C.

References ASSERT, RealVoxel< T >::getDepth(), RealVoxel< T >::getHeight(), RealVoxel< T >::getWidth(), RealVoxel< T >::initialized(), and RealVoxel< T >::resize().

Referenced by normalize().

template<class T>
void realvox::normalize RealVoxel< PixHyper< T, 4 > > &  out_rvox,
const RealVoxel< PixHyper< T, 4 > > &  in_rvox,
const PixHyper< T, 4 > &  lowBound,
const PixHyper< T, 4 > &  upperBound
 

Normalize a voxel image between the range lowBound and upperBound.

This one operates on 4D pixels. Place the results in out_rvox.

Definition at line 252 of file RealVoxelOps.C.

References ASSERT, RealVoxel< T >::end(), getMinMax(), initIfNeeded(), rutz::max(), rutz::min(), Pixels< T, dim >::p, and Dlist::range().

template<class T>
void realvox::normalize RealVoxel< PixRGB< T > > &  out_rvox,
const RealVoxel< PixRGB< T > > &  in_rvox,
const PixRGB< T > &  lowBound,
const PixRGB< T > &  upperBound
 

Normalize a voxel image between the range lowBound and upperBound.

This one operates on PixRGB. Place the results in out_rvox.

Definition at line 226 of file RealVoxelOps.C.

References ASSERT, RealVoxel< T >::end(), getMinMax(), initIfNeeded(), rutz::max(), rutz::min(), Pixels< T, 3 >::p, and Dlist::range().

template<class T>
void realvox::normalize RealVoxel< T > &  out_rvox,
const RealVoxel< T > &  in_rvox,
const T  lowBound,
const T  upperBound
 

Normalize a voxel image between the range lowBound and upperBound.

This one operates on Gray scale images. Place the results in out_rvox.

Definition at line 203 of file RealVoxelOps.C.

References ASSERT, RealVoxel< T >::begin(), RealVoxel< T >::beginw(), RealVoxel< T >::end(), getMinMax(), initIfNeeded(), rutz::max(), rutz::min(), and Dlist::range().

template<class T>
void realvox::normalize RealVoxel< PixHyper< T, 4 > > &  out_rvox,
const RealVoxel< PixHyper< T, 4 > > &  in_rvox,
const T  lowBound,
const T  upperBound
 

Normalize a voxel image between the range lowBound and upperBound.

This one operates on 4D pixels. Place the results in out_rvox.

Definition at line 187 of file RealVoxelOps.C.

References normalize(), and Pixels< T, dim >::p.

template<class T>
void realvox::normalize RealVoxel< PixRGB< T > > &  out_rvox,
const RealVoxel< PixRGB< T > > &  in_rvox,
const T  lowBound,
const T  upperBound
 

Normalize a voxel image between the range lowBound and upperBound.

This one operates on PixRGB. Place the results in out_rvox.

Definition at line 173 of file RealVoxelOps.C.

References normalize(), and Pixels< T, 3 >::p.

template<class T>
void realvox::normalize RealVoxel< PixHyper< T, 4 > > &  rvox,
const PixHyper< T, 4 >  lowBound,
const PixHyper< T, 4 >  upperBound
 

Normalize a voxel image between the range lowBound and upperBound.

This one operates on 4D pixels

Definition at line 167 of file RealVoxelOps.C.

References normalize().

template<class T>
void realvox::normalize RealVoxel< PixRGB< T > > &  rvox,
const PixRGB< T >  lowBound,
const PixRGB< T >  upperBound
 

Normalize a voxel image between the range lowBound and upperBound.

This one operates on PixRGB

Definition at line 161 of file RealVoxelOps.C.

References normalize().

template<class T>
void realvox::normalize RealVoxel< T > &  rvox,
const T  lowBound,
const T  upperBound
 

Normalize a voxel image between the range lowBound and upperBound.

This one operates on Gray scale images

Definition at line 156 of file RealVoxelOps.C.

References normalize().

template<class T>
void realvox::normalize RealVoxel< PixHyper< T, 4 > > &  rvox,
const T  lowBound,
const T  upperBound
 

Normalize a voxel image between the range lowBound and upperBound.

This one operates on 4D pixels

Definition at line 150 of file RealVoxelOps.C.

References normalize().

template<class T>
void realvox::normalize RealVoxel< PixRGB< T > > &  rvox,
const T  lowBound,
const T  upperBound
 

Normalize a voxel image between the range lowBound and upperBound.

This one operates on PixRGB

Definition at line 144 of file RealVoxelOps.C.

Referenced by normalize().

template<class T>
void realvox::ripSlicesToFile const RealVoxel< PixRGB< T > > &  rvox,
const std::string fname,
const imgvox::axis  axis
 

Call to raster and rip all the images slices to file along axis.

When called this will rip all the image slices from the RealVoxel image using a standard call to Raster in order to save each slice. It will append the slice number to each file name.

This method is not intended for saving your voxel image for later reload. This is more of a helper tool to allow you visualize your voxel image in its 2D slices.

NOTE: Due to the nature of the voxel image, ripping along the Z axis is the fastest, Y is the next fastest and X is the slowest. If one has the choice, then rip along the Z axis if possible. To see how axis are ripped, see RealVoxel::getSlice(...)

Parameters:
rvox Your RealVoxel image
fname This is the filename. This method will save as a PNG so don't append a file name affix.
axis This is an enum X_AXIS, Y_AXIS or Z_AXIS

Definition at line 346 of file RealVoxelOps.C.

References filename, i, LFATAL, name, s, and Raster::WriteRGB().


Generated on Sun Nov 22 13:51:39 2009 for iLab Neuromorphic Vision Toolkit by  doxygen 1.4.4