OpenWalnut  1.5.0dev
Public Types | Static Public Member Functions | List of all members
wtracking::WTrackingUtility Class Reference

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

#include <WThreadedTrackingFunction.h>

Public Types

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

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. More...
 
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. More...
 
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. More...
 

Detailed Description

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

Definition at line 60 of file WThreadedTrackingFunction.h.

Member Typedef Documentation

◆ DataSetPtr

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

a pointer to a dataset

Definition at line 70 of file WThreadedTrackingFunction.h.

◆ DataSetType

the dataset type

Definition at line 67 of file WThreadedTrackingFunction.h.

◆ DirFunc

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

a function that calculates a direction to continue tracking

Definition at line 73 of file WThreadedTrackingFunction.h.

◆ Grid3DPtr

a pointer to a regular 3d grid

Definition at line 77 of file WThreadedTrackingFunction.h.

◆ JobType

define a job type for tracking algorithms

Definition at line 64 of file WThreadedTrackingFunction.h.

Member Function Documentation

◆ followToNextVoxel()

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 WMDeterministicFTMori::resetTracking(), WThreadedTrackingFunctionTest::testCompute(), WTrackingUtilityTest::testFollowToNextVoxel(), WThreadedTrackingFunctionTest::testGetJob(), and WThreadedTrackingFunctionTest::testInstantiation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDistanceToBoundary()

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.
Note
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ onBoundary()

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().

+ Here is the caller graph for this function:

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