OpenWalnut
1.4.0
|
Implements a generalized multithreaded tracking algorithm. More...
#include <WThreadedTrackingFunction.h>
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< IndexType > | m_currentIndex |
the current index/seed position | |
Friends | |
class | ::WThreadedTrackingFunctionTest |
make the test a friend |
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.
typedef WThreadedJobs< DataSetType, JobType > wtracking::WThreadedTrackingFunction::Base [private] |
the base class, a threaded job function
Definition at line 180 of file WThreadedTrackingFunction.h.
typedef WTrackingUtility::DataSetPtr wtracking::WThreadedTrackingFunction::DataSetPtr [private] |
a pointer to a dataset
Definition at line 159 of file WThreadedTrackingFunction.h.
the dataset type
Definition at line 156 of file WThreadedTrackingFunction.h.
typedef WTrackingUtility::DirFunc wtracking::WThreadedTrackingFunction::DirFunc [private] |
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.
typedef WGridRegular3D wtracking::WThreadedTrackingFunction::GridType [private] |
the grid type
Definition at line 162 of file WThreadedTrackingFunction.h.
typedef WTrackingUtility::JobType wtracking::WThreadedTrackingFunction::JobType [private] |
the job type
Reimplemented from WThreadedJobs< WTrackingUtility::DataSetType, WTrackingUtility::JobType >.
Definition at line 153 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.
typedef WThreadedTrackingFunction wtracking::WThreadedTrackingFunction::This [private] |
this type
Definition at line 183 of file WThreadedTrackingFunction.h.
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.
dataset | A pointer to a dataset. |
dirFunc | A direction calculation function. |
nextFunc | A position integration function. |
fiberVst | A visitor for fibers. |
pointVst | A visitor for points. |
seedPositions | The number of seed positions in every direction per voxel. |
seedsPerPos | The number of fibers startet from every seed position. |
v0 | A vector of starting voxel indices for every direction. |
v1 | A 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.
void wtracking::WThreadedTrackingFunction::compute | ( | DataSetPtr | input, |
JobType const & | job | ||
) | [virtual] |
The calculation per job.
input | The input dataset. |
job | The 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().
bool wtracking::WThreadedTrackingFunction::getJob | ( | JobType & | job | ) | [virtual] |
The job generator.
job | The next job (output). |
Definition at line 191 of file WThreadedTrackingFunction.cpp.
References WSharedObject< T >::getWriteTicket(), and m_currentIndex.
Referenced by WThreadedTrackingFunctionTest::testCompute(), and WThreadedTrackingFunctionTest::testGetJob().
friend class ::WThreadedTrackingFunctionTest [friend] |
make the test a friend
Definition at line 150 of file WThreadedTrackingFunction.h.
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().
std::size_t wtracking::WThreadedTrackingFunction::m_maxPoints [private] |
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().