OpenWalnut
1.5.0dev
|
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. More... | |
virtual | ~WThreadedTrackingFunction () |
Destructor. More... | |
virtual bool | getJob (JobType &job) |
The job generator. More... | |
virtual void | compute (DataSetPtr input, JobType const &job) |
The calculation per job. More... | |
Public Member Functions inherited from WThreadedJobs< WTrackingUtility::DataSetType, WTrackingUtility::JobType > | |
WThreadedJobs (std::shared_ptr< InputType const > input) | |
Constructor. More... | |
virtual | ~WThreadedJobs () |
Destructor. More... | |
void | operator() (std::size_t id, std::size_t numThreads, WBoolFlag const &shutdown) |
The threaded function operation. More... | |
virtual bool | getJob (JobType &job)=0 |
Abstract function for the job aquisition. More... | |
virtual void | compute (std::shared_ptr< InputType const > input, JobType const &job)=0 |
Abstract function that performs the actual computation per job. More... | |
Private Types | |
typedef WTrackingUtility::JobType | JobType |
the job type More... | |
typedef WTrackingUtility::DataSetType | DataSetType |
the dataset type More... | |
typedef WTrackingUtility::DataSetPtr | DataSetPtr |
a pointer to a dataset More... | |
typedef WGridRegular3D | GridType |
the grid type More... | |
typedef std::shared_ptr< GridType > | GridPtr |
a pointer to the grid More... | |
typedef WTrackingUtility::DirFunc | DirFunc |
the direction calculation function More... | |
typedef boost::function< bool(DataSetPtr, JobType &, DirFunc const &) > | NextPositionFunc |
the path integration function More... | |
typedef boost::function< void(std::vector< WVector3d > const &) > | FiberVisitorFunc |
a visitor function for fibers More... | |
typedef boost::function< void(WVector3d const &) > | PointVisitorFunc |
a visitor function type for points More... | |
typedef WThreadedJobs< DataSetType, JobType > | Base |
the base class, a threaded job function More... | |
typedef WThreadedTrackingFunction | This |
this type More... | |
Private Attributes | |
GridPtr | m_grid |
a pointer to the grid More... | |
DirFunc | m_directionFunc |
a function that returns the next direction More... | |
NextPositionFunc | m_nextPosFunc |
a function that calculates the next position More... | |
FiberVisitorFunc | m_fiberVisitor |
the fiber visitor More... | |
PointVisitorFunc | m_pointVisitor |
the point visitor More... | |
std::size_t | m_maxPoints |
the maximum number of points per forward/backward integration of a fiber More... | |
WSharedObject< IndexType > | m_currentIndex |
the current index/seed position More... | |
Friends | |
class | ::WThreadedTrackingFunctionTest |
make the test a friend More... | |
Additional Inherited Members | |
Public Types inherited from WThreadedJobs< WTrackingUtility::DataSetType, WTrackingUtility::JobType > | |
typedef WTrackingUtility::DataSetType | InputType |
the input type More... | |
typedef WTrackingUtility::JobType | JobType |
the job type More... | |
Protected Attributes inherited from WThreadedJobs< WTrackingUtility::DataSetType, WTrackingUtility::JobType > | |
std::shared_ptr< InputType const > | m_input |
the input More... | |
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 146 of file WThreadedTrackingFunction.h.
|
private |
the base class, a threaded job function
Definition at line 179 of file WThreadedTrackingFunction.h.
a pointer to a dataset
Definition at line 158 of file WThreadedTrackingFunction.h.
the dataset type
Definition at line 155 of file WThreadedTrackingFunction.h.
the direction calculation function
Definition at line 167 of file WThreadedTrackingFunction.h.
|
private |
a visitor function for fibers
Definition at line 173 of file WThreadedTrackingFunction.h.
|
private |
a pointer to the grid
Definition at line 164 of file WThreadedTrackingFunction.h.
|
private |
the grid type
Definition at line 161 of file WThreadedTrackingFunction.h.
the job type
Definition at line 152 of file WThreadedTrackingFunction.h.
|
private |
the path integration function
Definition at line 170 of file WThreadedTrackingFunction.h.
|
private |
a visitor function type for points
Definition at line 176 of file WThreadedTrackingFunction.h.
|
private |
this type
Definition at line 182 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 m_currentIndex, m_grid, and m_maxPoints.
|
virtual |
Destructor.
Definition at line 187 of file WThreadedTrackingFunction.cpp.
|
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().
|
virtual |
The job generator.
job | The next job (output). |
Definition at line 191 of file WThreadedTrackingFunction.cpp.
References m_currentIndex.
Referenced by WThreadedTrackingFunctionTest::testCompute(), and WThreadedTrackingFunctionTest::testGetJob().
|
friend |
make the test a friend
Definition at line 149 of file WThreadedTrackingFunction.h.
|
private |
the current index/seed position
Definition at line 314 of file WThreadedTrackingFunction.h.
Referenced by getJob(), and WThreadedTrackingFunction().
|
private |
a function that returns the next direction
Definition at line 299 of file WThreadedTrackingFunction.h.
Referenced by compute().
|
private |
the fiber visitor
Definition at line 305 of file WThreadedTrackingFunction.h.
Referenced by compute().
|
private |
a pointer to the grid
Definition at line 296 of file WThreadedTrackingFunction.h.
Referenced by wtracking::WThreadedTrackingFunction::IndexType::job(), and WThreadedTrackingFunction().
|
private |
the maximum number of points per forward/backward integration of a fiber
Definition at line 311 of file WThreadedTrackingFunction.h.
Referenced by compute(), and WThreadedTrackingFunction().
|
private |
a function that calculates the next position
Definition at line 302 of file WThreadedTrackingFunction.h.
Referenced by compute().
|
private |
the point visitor
Definition at line 308 of file WThreadedTrackingFunction.h.
Referenced by compute().