OpenWalnut  1.4.0
Public Types | Static Public Member Functions
wtracking::WTrackingUtility Class Reference

A class that provides untility functions and typedefs for tracking algorithms. More...

#include <WThreadedTrackingFunction.h>

List of all members.

Public Types

typedef std::pair< WVector3d,
WVector3d
JobType
 define a job type for tracking algorithms
typedef WDataSetSingle DataSetType
 the dataset type
typedef boost::shared_ptr
< DataSetType const > 
DataSetPtr
 a pointer to a dataset
typedef boost::function
< WVector3d(DataSetPtr,
JobType const &) > 
DirFunc
 a function that calculates a direction to continue tracking
typedef boost::shared_ptr
< WGridRegular3D
Grid3DPtr
 a pointer to a regular 3d grid

Static Public Member Functions

static bool followToNextVoxel (DataSetPtr dataset, JobType &job, DirFunc const &dirFunc)
 A function that follows a direction until leaving the current voxel.
static bool onBoundary (Grid3DPtr grid, WVector3d const &pos)
 Check if a point is on the boundary of the given grid, where boundary means a distance less then TRACKING_EPS from any plane between voxels.
static double getDistanceToBoundary (Grid3DPtr grid, WVector3d const &pos, WVector3d const &dir)
 Calculate the distance from a given position to the nearest voxel boundary on the ray from the position along the given direction.

Detailed Description

A class that provides untility functions and typedefs for tracking algorithms.

Definition at line 61 of file WThreadedTrackingFunction.h.


Member Typedef Documentation

typedef boost::shared_ptr< DataSetType const > wtracking::WTrackingUtility::DataSetPtr

a pointer to a dataset

Definition at line 71 of file WThreadedTrackingFunction.h.

the dataset type

Definition at line 68 of file WThreadedTrackingFunction.h.

typedef boost::function< WVector3d ( DataSetPtr, JobType const& ) > wtracking::WTrackingUtility::DirFunc

a function that calculates a direction to continue tracking

Definition at line 74 of file WThreadedTrackingFunction.h.

a pointer to a regular 3d grid

Definition at line 78 of file WThreadedTrackingFunction.h.

define a job type for tracking algorithms

Definition at line 65 of file WThreadedTrackingFunction.h.


Member Function Documentation

bool wtracking::WTrackingUtility::followToNextVoxel ( DataSetPtr  dataset,
JobType job,
DirFunc const &  dirFunc 
) [static]

A function that follows a direction until leaving the current voxel.

Parameters:
datasetA pointer to the input dataset.
jobA pair of vectors, the position and the direction of the last integration.
dirFuncA function that computes the next direction.
Returns:
true, iff the calculated point is a valid position inside the grid

Definition at line 34 of file WThreadedTrackingFunction.cpp.

References getDistanceToBoundary(), wlimits::isInf(), wlimits::isNaN(), and onBoundary().

Referenced by WThreadedTrackingFunctionTest::testCompute(), WTrackingUtilityTest::testFollowToNextVoxel(), WThreadedTrackingFunctionTest::testGetJob(), and WThreadedTrackingFunctionTest::testInstantiation().

double wtracking::WTrackingUtility::getDistanceToBoundary ( Grid3DPtr  grid,
WVector3d const &  pos,
WVector3d const &  dir 
) [static]

Calculate the distance from a given position to the nearest voxel boundary on the ray from the position along the given direction.

Parameters:
gridThe grid.
posThe starting position of the ray.
dirThe normalized direction of the ray.
Returns:
The distance to the next voxel boundary.
Notes:
pos + getDistanceToBoundary( grid, pos, dir ) * dir will be a position on a voxel boundary

Definition at line 118 of file WThreadedTrackingFunction.cpp.

References onBoundary().

Referenced by followToNextVoxel(), and WTrackingUtilityTest::testGetDistanceToBoundary().

bool wtracking::WTrackingUtility::onBoundary ( Grid3DPtr  grid,
WVector3d const &  pos 
) [static]

Check if a point is on the boundary of the given grid, where boundary means a distance less then TRACKING_EPS from any plane between voxels.

This does not check if the position is actually inside the grid.

Parameters:
gridThe grid.
posThe position to test.
Returns:
true, iff the position is on any voxel boundary

Definition at line 86 of file WThreadedTrackingFunction.cpp.

Referenced by followToNextVoxel(), getDistanceToBoundary(), WTrackingUtilityTest::testBoundary(), WTrackingUtilityTest::testFollowToNextVoxel(), and WTrackingUtilityTest::testGetDistanceToBoundary().


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