16 #include <itkFixedArray.h>
38 template <
typename ArrayType,
typename TCoordRep,
unsigned int NVectorDimension>
39 void FillArray(itk::FixedArray<TCoordRep, NVectorDimension> &toArray,
const ArrayType &array)
41 for (
unsigned short int var = 0; var < NVectorDimension; ++var)
43 toArray[var] = array[var];
55 template <
typename ArrayType,
typename TCoordRep,
unsigned int NVectorDimension>
56 itk::FixedArray<TCoordRep, NVectorDimension>
FillArray(
const ArrayType &array)
58 itk::FixedArray<TCoordRep, NVectorDimension> vectorOrPoint;
73 template <
typename ArrayType,
typename TCoordRep,
unsigned int NVectorDimension>
74 void ToArray(ArrayType &array,
const itk::FixedArray<TCoordRep, NVectorDimension> &vectorOrPoint)
76 for (
unsigned short int var = 0; var < NVectorDimension; ++var)
78 array[var] = vectorOrPoint[var];
90 template <
typename ArrayType,
typename TCoordRep,
unsigned int NVectorDimension>
91 ArrayType
ToArray(
const itk::FixedArray<TCoordRep, NVectorDimension> &vectorOrPoint)
101 template <
class Tout>
110 template <
class Tout>
132 template <
typename TArrayType1,
typename TArrayType2>
134 TArrayType1 &arrayType1, TArrayType2 &arrayType2,
int size,
ScalarType eps =
mitk::eps,
bool verbose =
false)
137 for (
int var = 0; var < size; ++var)
139 isEqual = isEqual &&
Equal(arrayType1[var], arrayType2[var],
eps);
Find image slices visible on a given plane.
MITKCORE_EXPORT const ScalarType eps
Epsilon value for floating point comparison (vnl_math::eps * 100).
void FillArray(itk::FixedArray< TCoordRep, NVectorDimension > &toArray, const ArrayType &array)
Methods to copy between itk::FixedArray types (like mitk::Vector and mitk::Point) and ArrayTypes.
void ConditionalOutputOfDifference(ElementToOutput1 elem1, ElementToOutput2 elem2, mitk::ScalarType eps, bool verbose, bool isEqual)
Conditionally output the difference between two elements to the log.
bool EqualArray(TArrayType1 &arrayType1, TArrayType2 &arrayType2, int size, ScalarType eps=mitk::eps, bool verbose=false)
Compare two array-like objects element-wise for equality within a tolerance.
void ToArray(ArrayType &array, const itk::FixedArray< TCoordRep, NVectorDimension > &vectorOrPoint)
Copy elements from an itk::FixedArray into an array.
void FillVector3D(Tout &out, mitk::ScalarType x, mitk::ScalarType y, mitk::ScalarType z)
Fill a 3D array/vector with the given x, y, z values.
void FillVector4D(Tout &out, mitk::ScalarType x, mitk::ScalarType y, mitk::ScalarType z, mitk::ScalarType t)
Fill a 4D array/vector with the given x, y, z, t values.
double ScalarType
Scalar type used throughout MITK for geometric computations.
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.