OpenWalnut  1.4.0
Public Types | Public Member Functions | Private Types | Private Attributes | Friends
WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs > Class Template Reference

A template that performs an operation on a per voxel basis. More...

#include <WThreadedPerVoxelOperation.h>

+ Inheritance diagram for WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >:

List of all members.

Public Types

typedef WValueSet< Value_T > ValueSetType
 the input valueset's type
typedef WValueSet< Output_T > OutValueSetType
 the output valueset's type
typedef ValueSetType::SubArray
const 
TransmitType
 the input type for the per-voxel operation
typedef boost::array< Output_T,
numOutputs > 
OutTransmitType
 the output type for the per-voxel operation
typedef boost::function
< OutTransmitType const
(TransmitType const &) > 
FunctionType
 the function type

Public Member Functions

 WThreadedPerVoxelOperation (boost::shared_ptr< WDataSetSingle const > dataset, FunctionType func)
 Construct a per-voxel operation.
virtual ~WThreadedPerVoxelOperation ()
 Destructor.
virtual void compute (boost::shared_ptr< ValueSetType const > input, std::size_t voxelNum)
 Perform the computation for a specific voxel.
boost::shared_ptr< WDataSetSinglegetResult ()
 Get the output dataset.

Private Types

typedef WThreadedStripingJobs
< WValueSet< Value_T >
, std::size_t > 
BaseType
 the base class
typedef boost::shared_ptr
< std::vector< Output_T > > 
OutputVectorType
 a threadsafe vector (container)

Private Attributes

OutputVectorType m_output
 stores the output of the per-voxel-operation
FunctionType m_func
 the function applied to every voxel
boost::shared_ptr< WGridm_grid
 store the grid

Friends

class WThreadedPerVoxelOperationTest
 the test is a friend

Detailed Description

template<typename Value_T, std::size_t numValues, typename Output_T, std::size_t numOutputs>
class WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >

A template that performs an operation on a per voxel basis.

This template is intended to be used in combination with

See also:
WThreadedFunction.

The template parameters are the internal datatype of the input datasets valueset, the number of input data elements per voxel, the type of the output data and the number of outputs per voxel.

Example: Suppose one wants to calculate the largest eigenvector of a symmetric tensor of order 2 per voxel, where the input tensors are stored als 6 floats. The output could be 3 double values. The corresponding template parameters would be float, 6, double, 3.

A function that converts the input values to output values needs to be given via a boost::function object. The correct 'signature' is:

boost::array< Output_T, numOutputs > func( WValueSet< Value_T >::SubArray const& );

The subarray will have exactly numInputs entries.

Definition at line 69 of file WThreadedPerVoxelOperation.h.


Member Typedef Documentation

template<typename Value_T , std::size_t numValues, typename Output_T , std::size_t numOutputs>
typedef WThreadedStripingJobs< WValueSet< Value_T >, std::size_t > WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::BaseType [private]

the base class

Definition at line 75 of file WThreadedPerVoxelOperation.h.

template<typename Value_T , std::size_t numValues, typename Output_T , std::size_t numOutputs>
typedef boost::function< OutTransmitType const ( TransmitType const& ) > WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::FunctionType

the function type

Definition at line 91 of file WThreadedPerVoxelOperation.h.

template<typename Value_T , std::size_t numValues, typename Output_T , std::size_t numOutputs>
typedef boost::shared_ptr< std::vector< Output_T > > WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::OutputVectorType [private]

a threadsafe vector (container)

Definition at line 126 of file WThreadedPerVoxelOperation.h.

template<typename Value_T , std::size_t numValues, typename Output_T , std::size_t numOutputs>
typedef boost::array< Output_T, numOutputs > WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::OutTransmitType

the output type for the per-voxel operation

Definition at line 88 of file WThreadedPerVoxelOperation.h.

template<typename Value_T , std::size_t numValues, typename Output_T , std::size_t numOutputs>
typedef WValueSet< Output_T > WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::OutValueSetType

the output valueset's type

Definition at line 82 of file WThreadedPerVoxelOperation.h.

template<typename Value_T , std::size_t numValues, typename Output_T , std::size_t numOutputs>
typedef ValueSetType::SubArray const WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::TransmitType

the input type for the per-voxel operation

Definition at line 85 of file WThreadedPerVoxelOperation.h.

template<typename Value_T , std::size_t numValues, typename Output_T , std::size_t numOutputs>
typedef WValueSet< Value_T > WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::ValueSetType

the input valueset's type

Definition at line 79 of file WThreadedPerVoxelOperation.h.


Constructor & Destructor Documentation

template<typename Value_T , std::size_t numValues, typename Output_T , std::size_t numOutputs>
WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::WThreadedPerVoxelOperation ( boost::shared_ptr< WDataSetSingle const >  dataset,
FunctionType  func 
)
template<typename Value_T , std::size_t numValues, typename Output_T , std::size_t numOutputs>
WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::~WThreadedPerVoxelOperation ( ) [virtual]

Destructor.

Definition at line 184 of file WThreadedPerVoxelOperation.h.


Member Function Documentation

template<typename Value_T , std::size_t numValues, typename Output_T , std::size_t numOutputs>
void WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::compute ( boost::shared_ptr< ValueSetType const >  input,
std::size_t  voxelNum 
) [virtual]

Perform the computation for a specific voxel.

Parameters:
inputThe input dataset.
voxelNumThe voxel number to operate on.

Implements WThreadedStripingJobs< WValueSet< Value_T >, std::size_t >.

Definition at line 189 of file WThreadedPerVoxelOperation.h.

template<typename Value_T , std::size_t numValues, typename Output_T , std::size_t numOutputs>
boost::shared_ptr< WDataSetSingle > WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::getResult ( )

Get the output dataset.

Returns:
The oupput dataset.

Definition at line 201 of file WThreadedPerVoxelOperation.h.


Friends And Related Function Documentation

template<typename Value_T , std::size_t numValues, typename Output_T , std::size_t numOutputs>
friend class WThreadedPerVoxelOperationTest [friend]

the test is a friend

Definition at line 72 of file WThreadedPerVoxelOperation.h.


Member Data Documentation

template<typename Value_T , std::size_t numValues, typename Output_T , std::size_t numOutputs>
FunctionType WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::m_func [private]
template<typename Value_T , std::size_t numValues, typename Output_T , std::size_t numOutputs>
boost::shared_ptr< WGrid > WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::m_grid [private]
template<typename Value_T , std::size_t numValues, typename Output_T , std::size_t numOutputs>
OutputVectorType WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::m_output [private]

stores the output of the per-voxel-operation

Definition at line 129 of file WThreadedPerVoxelOperation.h.

Referenced by WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::WThreadedPerVoxelOperation().


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