OpenWalnut  1.4.0
Classes | Public Member Functions | Private Types | Private Attributes | Friends
wtracking::WThreadedTrackingFunction Class Reference

Implements a generalized multithreaded tracking algorithm. More...

#include <WThreadedTrackingFunction.h>

+ Inheritance diagram for wtracking::WThreadedTrackingFunction:

List of all members.

Classes

class  IndexType
 An index for seed positions. More...

Public Member Functions

 WThreadedTrackingFunction (DataSetPtr dataset, DirFunc dirFunc, NextPositionFunc nextFunc, FiberVisitorFunc fiberVst, PointVisitorFunc pointVst, std::size_t seedPositions=1, std::size_t seedsPerPos=1, std::vector< int > v0=std::vector< int >(), std::vector< int > v1=std::vector< int >())
 Constructor.
virtual ~WThreadedTrackingFunction ()
 Destructor.
virtual bool getJob (JobType &job)
 The job generator.
virtual void compute (DataSetPtr input, JobType const &job)
 The calculation per job.

Private Types

typedef WTrackingUtility::JobType JobType
 the job type
typedef
WTrackingUtility::DataSetType 
DataSetType
 the dataset type
typedef
WTrackingUtility::DataSetPtr 
DataSetPtr
 a pointer to a dataset
typedef WGridRegular3D GridType
 the grid type
typedef boost::shared_ptr
< GridType
GridPtr
 a pointer to the grid
typedef WTrackingUtility::DirFunc DirFunc
 the direction calculation function
typedef boost::function< bool(DataSetPtr,
JobType &, DirFunc const &) > 
NextPositionFunc
 the path integration function
typedef boost::function< void(std::vector
< WVector3d > const &) > 
FiberVisitorFunc
 a visitor function for fibers
typedef boost::function< void(WVector3d
const &) > 
PointVisitorFunc
 a visitor function type for points
typedef WThreadedJobs
< DataSetType, JobType
Base
 the base class, a threaded job function
typedef WThreadedTrackingFunction This
 this type

Private Attributes

GridPtr m_grid
 a pointer to the grid
DirFunc m_directionFunc
 a function that returns the next direction
NextPositionFunc m_nextPosFunc
 a function that calculates the next position
FiberVisitorFunc m_fiberVisitor
 the fiber visitor
PointVisitorFunc m_pointVisitor
 the point visitor
std::size_t m_maxPoints
 the maximum number of points per forward/backward integration of a fiber
WSharedObject< IndexTypem_currentIndex
 the current index/seed position

Friends

class ::WThreadedTrackingFunctionTest
 make the test a friend

Detailed Description

Implements a generalized multithreaded tracking algorithm.

A function that calculates the direction and a function that calculates a new position have to be provided.

Output values can be retrieved via two visitor functions that get called per fiber tracked and per point calculated respectively.

There are a certain number n of seeds per direction, this meens n*n*n seeds per voxel. For every seed, m fibers get integrated. These two parameters are the seedPositions and seedsPerVoxel parameters of the constructor, respectively.

A 'cubic' region of the grid can be chosen for seeding. The v0 and v1 parameters of the constructor are the starting/target voxel coords. Example:

v0: 1, 1, 1 v1: 4, 5, 3

In this case, only voxels between coords 1 to 3 in the x-direction, the voxels 1 to 4 in y- and the voxels 1 to 2 in z-direction are used for seeding.

Note that voxels at the first (0) and last (grid->getNbCoords*()) position in any direction are invalid seeding voxels as they are partially outside of the grid.

Definition at line 147 of file WThreadedTrackingFunction.h.


Member Typedef Documentation

the base class, a threaded job function

Definition at line 180 of file WThreadedTrackingFunction.h.

a pointer to a dataset

Definition at line 159 of file WThreadedTrackingFunction.h.

the dataset type

Definition at line 156 of file WThreadedTrackingFunction.h.

the direction calculation function

Definition at line 168 of file WThreadedTrackingFunction.h.

typedef boost::function< void ( std::vector< WVector3d > const& ) > wtracking::WThreadedTrackingFunction::FiberVisitorFunc [private]

a visitor function for fibers

Definition at line 174 of file WThreadedTrackingFunction.h.

typedef boost::shared_ptr< GridType > wtracking::WThreadedTrackingFunction::GridPtr [private]

a pointer to the grid

Definition at line 165 of file WThreadedTrackingFunction.h.

the grid type

Definition at line 162 of file WThreadedTrackingFunction.h.

typedef boost::function< bool ( DataSetPtr, JobType&, DirFunc const& ) > wtracking::WThreadedTrackingFunction::NextPositionFunc [private]

the path integration function

Definition at line 171 of file WThreadedTrackingFunction.h.

typedef boost::function< void ( WVector3d const& ) > wtracking::WThreadedTrackingFunction::PointVisitorFunc [private]

a visitor function type for points

Definition at line 177 of file WThreadedTrackingFunction.h.

this type

Definition at line 183 of file WThreadedTrackingFunction.h.


Constructor & Destructor Documentation

wtracking::WThreadedTrackingFunction::WThreadedTrackingFunction ( DataSetPtr  dataset,
DirFunc  dirFunc,
NextPositionFunc  nextFunc,
FiberVisitorFunc  fiberVst,
PointVisitorFunc  pointVst,
std::size_t  seedPositions = 1,
std::size_t  seedsPerPos = 1,
std::vector< int >  v0 = std::vector< int >(),
std::vector< int >  v1 = std::vector< int >() 
)

Constructor.

Parameters:
datasetA pointer to a dataset.
dirFuncA direction calculation function.
nextFuncA position integration function.
fiberVstA visitor for fibers.
pointVstA visitor for points.
seedPositionsThe number of seed positions in every direction per voxel.
seedsPerPosThe number of fibers startet from every seed position.
v0A vector of starting voxel indices for every direction.
v1A vector of target voxel indices for every direction.

Definition at line 162 of file WThreadedTrackingFunction.cpp.

References WSharedObject< T >::getWriteTicket(), m_currentIndex, m_grid, and m_maxPoints.

Destructor.

Definition at line 187 of file WThreadedTrackingFunction.cpp.


Member Function Documentation

void wtracking::WThreadedTrackingFunction::compute ( DataSetPtr  input,
JobType const &  job 
) [virtual]

The calculation per job.

Parameters:
inputThe input dataset.
jobThe job.

Definition at line 206 of file WThreadedTrackingFunction.cpp.

References m_directionFunc, m_fiberVisitor, m_maxPoints, m_nextPosFunc, and m_pointVisitor.

Referenced by WThreadedTrackingFunctionTest::testCompute().

The job generator.

Parameters:
jobThe next job (output).
Returns:
false, iff there are no more jobs.

Definition at line 191 of file WThreadedTrackingFunction.cpp.

References WSharedObject< T >::getWriteTicket(), and m_currentIndex.

Referenced by WThreadedTrackingFunctionTest::testCompute(), and WThreadedTrackingFunctionTest::testGetJob().


Friends And Related Function Documentation

friend class ::WThreadedTrackingFunctionTest [friend]

make the test a friend

Definition at line 150 of file WThreadedTrackingFunction.h.


Member Data Documentation

the current index/seed position

Definition at line 315 of file WThreadedTrackingFunction.h.

Referenced by getJob(), and WThreadedTrackingFunction().

a function that returns the next direction

Definition at line 300 of file WThreadedTrackingFunction.h.

Referenced by compute().

the fiber visitor

Definition at line 306 of file WThreadedTrackingFunction.h.

Referenced by compute().

a pointer to the grid

Definition at line 297 of file WThreadedTrackingFunction.h.

Referenced by wtracking::WThreadedTrackingFunction::IndexType::job(), and WThreadedTrackingFunction().

the maximum number of points per forward/backward integration of a fiber

Definition at line 312 of file WThreadedTrackingFunction.h.

Referenced by compute(), and WThreadedTrackingFunction().

a function that calculates the next position

Definition at line 303 of file WThreadedTrackingFunction.h.

Referenced by compute().

the point visitor

Definition at line 309 of file WThreadedTrackingFunction.h.

Referenced by compute().


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