[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
Functions | |
template<... > | |
void | combineThreeMultiArrays (...) |
Combine three multi-dimensional arrays into one using a ternary function or functor. | |
template<... > | |
void | combineTwoMultiArrays (...) |
Combine two multi-dimensional arrays into one using a binary function or functor. | |
template<... > | |
void | copyMultiArray (...) |
Copy a multi-dimensional array. | |
template<... > | |
void | initMultiArray (...) |
Write a value to every pixel in a multi-dimensional array. | |
template<class Iterator , class Diff_type , class Accessor , class VALUETYPE > | |
void | initMultiArrayBorder (Iterator upperleft, Diff_type shape, Accessor a, int border_width, VALUETYPE v) |
Write value to the specified border values in the array. | |
template<... > | |
void | inspectMultiArray (...) |
Call an analyzing functor at every element of a multi-dimensional array. | |
template<... > | |
void | inspectTwoMultiArrays (...) |
Call an analyzing functor at all corresponding elements of two multi-dimensional arrays. | |
template<... > | |
void | tensorDeterminantMultiArray (...) |
Calculate the tensor determinant for every element of a ND tensor array. | |
template<... > | |
void | tensorEigenvaluesMultiArray (...) |
Calculate the tensor eigenvalues for every element of a N-D tensor array. | |
template<... > | |
void | tensorTraceMultiArray (...) |
Calculate the tensor trace for every element of a N-D tensor array. | |
template<... > | |
void | transformMultiArray (...) |
Transform a multi-dimensional array with a unary function or functor. | |
template<... > | |
void | vectorToTensorMultiArray (...) |
Calculate the tensor (outer) product of a N-D vector with itself. |
Copy, transform, and inspect arbitrary dimensional arrays which are represented by iterators compatible to Multi-dimensional Array Iterators. Note that are range is here specified by a pair: an iterator referring to the first point of the array and a shape object specifying the size of the (rectangular) ROI.
#include <vigra/multi_pointoperators.hxx>
void vigra::initMultiArray | ( | ... | ) |
Write a value to every pixel in a multi-dimensional array.
This function can be used to init the array which must be represented by a pair of iterators compatible to vigra::MultiIterator. It uses an accessor to access the data elements. Note that the iterator range must be specified by a shape object, because otherwise we could not control the range simultaneously in all dimensions (this is a necessary consequence of the vigra::MultiIterator design).
The initial value can either be a constant of appropriate type (compatible with the destination's value_type), or a functor with compatible result_type. These two cases are automatically distinguished when FunctorTraits<FUNCTOR>::isInitializer
yields VigraTrueType
. Since the functor is passed by const
reference, its operator()
must be const, and its internal state may need to be mutable
.
Declarations:
pass arguments explicitly:
use argument objects in conjunction with Argument Object Factories :
Usage:
#include <vigra/multi_pointoperators.hxx>
Namespace: vigra
Required Interface:
The function accepts either a value that is copied into every destination element:
or a functor that is called (without argument) at every location, and the result is written into the current element. Internally, functors are recognized by the meta function FunctorTraits<FUNCTOR>::isInitializer
yielding VigraTrueType
. Make sure that your functor correctly defines FunctorTraits
because otherwise the code will not compile.
void vigra::initMultiArrayBorder | ( | Iterator | upperleft, |
Diff_type | shape, | ||
Accessor | a, | ||
int | border_width, | ||
VALUETYPE | v | ||
) |
Write value to the specified border values in the array.
void vigra::copyMultiArray | ( | ... | ) |
Copy a multi-dimensional array.
This function can be applied in two modes:
The arrays must be represented by iterators compatible with vigra::MultiIterator, and the iteration range is specified by means of shape objects. If only the source shape is given the destination array is assumed to have the same shape, and standard mode is applied. If two shapes are given, the size of corresponding dimensions must be either equal (standard copy), or the source length must be 1 (expanding copy). The function uses accessors to access the data elements.
Declarations:
#include <vigra/multi_pointoperators.hxx>
Namespace: vigra
pass arguments explicitly:
use argument objects in conjunction with Argument Object Factories :
Usage - Standard Mode:
Usage - Expanding Mode:
The source array is only 2D (it has depth 1). Thus, the destination will contain 50 identical copies of this image. Note that the destination shape must be passed to the algorithm for the expansion to work, so we use destMultiArrayRange()
rather than destMultiArray()
.
Required Interface:
void vigra::transformMultiArray | ( | ... | ) |
Transform a multi-dimensional array with a unary function or functor.
This function can be applied in three modes:
std::accumulate()
. The arrays must be represented by iterators compatible with vigra::MultiIterator, and the iteration range is specified by means of shape objects. If only the source shape is given the destination array is assumed to have the same shape, and standard mode is applied. If two shapes are given, the size of corresponding dimensions must be either equal (standard copy), or the source length must be 1 (expand mode), or the destination length must be 1 (reduce mode). However, reduction and expansion cannot be executed at the same time, so the latter conditions are mutual exclusive, even if they apply to different dimensions.
The function uses accessors to access the data elements.
Declarations:
#include <vigra/multi_pointoperators.hxx>
Namespace: vigra
pass arguments explicitly:
use argument objects in conjunction with Argument Object Factories :
Usage - Standard Mode:
Source and destination array have the same size.
Usage - Expand Mode:
The source array is only 2D (it has depth 1). Thus, the destination will contain 50 identical copies of the transformed source array. Note that the destination shape must be passed to the algorithm for the expansion to work, so we use destMultiArrayRange()
rather than destMultiArray()
.
Usage - Reduce Mode:
The destination array is only 1D (it's width and height are 1). Thus, it will contain accumulated data for every slice of the source volume (or for every frame, if the source is interpreted as an image sequence). In the example, we use the functor vigra::FindAverage to calculate the average gray value of every slice. Note that the destination shape must also be passed for the reduction to work, so we use destMultiArrayRange()
rather than destMultiArray()
.
Note that the functor must define the appropriate traits described below in order to be recognized as a reduce functor. This is most easily achieved by deriving from UnaryReduceFunctorTag
(see vigra::FunctorTraits).
Required Interface:
In standard and expand mode, the functor must be a model of UnaryFunction (i.e. support function call with one argument and a return value res = functor(arg)
):
In reduce mode, it must be a model of UnaryAnalyser (i.e. support function call with one argument and no return value functor(arg)
) and Initializer (i.e. support function call with no argument, but return value res = functor()
). Internally, such functors are recognized by the meta functions FunctorTraits<FUNCTOR>::isUnaryAnalyser
and FunctorTraits<FUNCTOR>::isInitializer
which must both yield VigraTrueType
. Make sure that your functor correctly defines FunctorTraits
because otherwise reduce mode will not work. This is most easily achieved by deriving the functor from UnaryReduceFunctorTag
(see vigra::FunctorTraits). In addition, the functor must be copy constructible in order to start each reduction with a fresh functor.
void vigra::combineTwoMultiArrays | ( | ... | ) |
Combine two multi-dimensional arrays into one using a binary function or functor.
This function can be applied in three modes:
std::accumulate()
. The arrays must be represented by iterators compatible with vigra::MultiIterator, and the iteration range is specified by means of shape objects. If only a single source shape is given the destination array is assumed to have the same shape, and standard mode is applied. If three shapes are given, the size of corresponding dimensions must be either equal (standard copy), or the length of this dimension must be 1 in one or both source arrays (expand mode), or the destination length must be 1 (reduce mode). However, reduction and expansion cannot be executed at the same time, so the latter conditions are mutual exclusive, even if they apply to different dimensions.
The function uses accessors to access the data elements.
Declarations:
#include <vigra/multi_pointoperators.hxx>
Namespace: vigra
pass arguments explicitly:
use argument objects in conjunction with Argument Object Factories :
Usage - Standard Mode:
Source and destination arrays have the same size.
Usage - Expand Mode:
One source array is only 2D (it has depth 1). This image will be added to every slice of the other source array, and the result if written into the corresponding destination slice. Note that the shapes of all arrays must be passed to the algorithm, so we use srcMultiArrayRange()
and destMultiArrayRange()
rather than srcMultiArray()
and destMultiArray()
.
Usage - Reduce Mode:
The destination array is only 1D (it's width and height are 1). Thus, it will contain accumulated data for every slice of the source volumes (or for every frame, if the sources are interpreted as image sequences). In the example, we use vigra::ReduceFunctor together with a functor expression (see Functor Expressions) to calculate the total absolute difference of the gray values in every pair of source slices. Note that the shapes of all arrays must be passed to the algorithm in order for the reduction to work, so we use srcMultiArrayRange()
and destMultiArrayRange()
rather than srcMultiArray()
and destMultiArray()
.
Note that the functor must define the appropriate traits described below in order to be recognized as a reduce functor. This is most easily achieved by deriving from BinaryReduceFunctorTag
(see vigra::FunctorTraits).
Required Interface:
In standard and expand mode, the functor must be a model of BinaryFunction (i.e. support function call with two arguments and a return value res = functor(arg1, arg2)
):
In reduce mode, it must be a model of BinaryAnalyser (i.e. support function call with two arguments and no return value functor(arg1, arg2)
) and Initializer (i.e. support function call with no argument, but return value res = functor()
). Internally, such functors are recognized by the meta functions FunctorTraits<FUNCTOR>::isBinaryAnalyser
and FunctorTraits<FUNCTOR>::isInitializer
which must both yield VigraTrueType
. Make sure that your functor correctly defines FunctorTraits
because otherwise reduce mode will not work. This is most easily achieved by deriving the functor from BinaryReduceFunctorTag
(see vigra::FunctorTraits). In addition, the functor must be copy constructible in order to start each reduction with a fresh functor.
void vigra::combineThreeMultiArrays | ( | ... | ) |
Combine three multi-dimensional arrays into one using a ternary function or functor.
Except for the fact that it operates on three input arrays, this function is identical to combineTwoMultiArrays().
Declarations:
pass arguments explicitly:
use argument objects in conjunction with Argument Object Factories :
Usage:
#include <vigra/multi_pointoperators.hxx>
Namespace: vigra
void vigra::inspectMultiArray | ( | ... | ) |
Call an analyzing functor at every element of a multi-dimensional array.
This function can be used to collect statistics of the array etc. The results must be stored in the functor, which serves as a return value. The arrays must be represented by iterators compatible with vigra::MultiIterator. The function uses an accessor to access the pixel data. Note that the iterator range must be specified by a shape object, because otherwise we could not control the range simultaneously in all dimensions (this is a necessary consequence of the vigra::MultiIterator design).
Declarations:
pass arguments explicitly:
use argument objects in conjunction with Argument Object Factories :
Usage:
#include <vigra/multi_pointoperators.hxx>
Namespace: vigra
Required Interface:
void vigra::inspectTwoMultiArrays | ( | ... | ) |
Call an analyzing functor at all corresponding elements of two multi-dimensional arrays.
This function can be used to collect statistics of the array etc. The results must be stored in the functor, which serves as a return value. The arrays must be represented by iterators compatible with vigra::MultiIterator. The function uses an accessor to access the pixel data. Note that the iterator range must be specified by a shape object, because otherwise we could not control the range simultaneously in all dimensions (this is a necessary consequence of the vigra::MultiIterator design).
Declarations:
pass arguments explicitly:
use argument objects in conjunction with Argument Object Factories :
Usage:
#include <vigra/multi_pointoperators.hxx>
Namespace: vigra
Required Interface:
void vigra::vectorToTensorMultiArray | ( | ... | ) |
Calculate the tensor (outer) product of a N-D vector with itself.
This function is useful to transform vector arrays into a tensor representation that can be used as input to tensor based processing and analysis functions (e.g. tensor smoothing). When the input array has N dimensions, the input value_type must be a vector of length N, whereas the output value_type mus be vectors of length N*(N-1)/2 which will represent the upper triangular part of the resulting (symmetric) tensor. That is, for 2D arrays the output contains the elements [t11, t12 == t21, t22]
in this order, whereas it contains the elements [t11, t12, t13, t22, t23, t33]
for 3D arrays.
Currently, N <= 3
is required.
Declarations:
pass arguments explicitly:
use argument objects in conjunction with Argument Object Factories :
Usage:
#include <vigra/multi_tensorutilities.hxx>
void vigra::tensorTraceMultiArray | ( | ... | ) |
Calculate the tensor trace for every element of a N-D tensor array.
This function turns a N-D tensor (whose value_type is a vector of length N*(N+1)/2, see vectorToTensorMultiArray()) representing the upper triangular part of a symmetric tensor into a scalar array holding the tensor trace.
Currently, N <= 3
is required.
Declarations:
pass arguments explicitly:
use argument objects in conjunction with Argument Object Factories :
Usage:
#include <vigra/multi_tensorutilities.hxx>
void vigra::tensorEigenvaluesMultiArray | ( | ... | ) |
Calculate the tensor eigenvalues for every element of a N-D tensor array.
This function turns a N-D tensor (whose value_type is a vector of length N*(N+1)/2, see vectorToTensorMultiArray()) representing the upper triangular part of a symmetric tensor into a vector-valued array holding the tensor eigenvalues (thus, the destination value_type must be vectors of length N).
Currently, N <= 3
is required.
Declarations:
pass arguments explicitly:
use argument objects in conjunction with Argument Object Factories :
Usage:
#include <vigra/multi_tensorutilities.hxx>
void vigra::tensorDeterminantMultiArray | ( | ... | ) |
Calculate the tensor determinant for every element of a ND tensor array.
This function turns a N-D tensor (whose value_type is a vector of length N*(N+1)/2, see vectorToTensorMultiArray()) representing the upper triangular part of a symmetric tensor into the a scalar array holding the tensor determinant.
Currently, N <= 3
is required.
Declarations:
pass arguments explicitly:
use argument objects in conjunction with Argument Object Factories :
Usage:
#include <vigra/multi_tensorutilities.hxx>
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|