15 #ifndef niftkPointUtils_h
16 #define niftkPointUtils_h
18 #include "niftkCoreExports.h"
19 #include <mitkVector.h>
20 #include <mitkPointSet.h>
21 #include <vtkMatrix4x4.h>
38 NIFTKCORE_EXPORT
bool AreDifferent(
const mitk::Point3D&
a,
const mitk::Point3D&
b);
52 const mitk::PointSet& fixed,
53 const mitk::PointSet& moving,
54 const CoordinateAxesData *
const transform = NULL);
59 NIFTKCORE_EXPORT
void GetDifference(
const mitk::Point3D&
a,
const mitk::Point3D&
b, mitk::Point3D& output);
64 NIFTKCORE_EXPORT
double Length(mitk::Point3D& vector);
69 NIFTKCORE_EXPORT
void Normalise(mitk::Point3D& vector);
74 NIFTKCORE_EXPORT
void CopyValues(
const mitk::Point3D&
a, mitk::Point3D&
b);
79 NIFTKCORE_EXPORT
void CrossProduct(
const mitk::Point3D&
a,
const mitk::Point3D&
b, mitk::Point3D&
c);
84 NIFTKCORE_EXPORT
void ComputeNormalFromPoints(
const mitk::Point3D&
a,
const mitk::Point3D&
b,
const mitk::Point3D&
c, mitk::Point3D& output);
94 NIFTKCORE_EXPORT
int CopyPointSets(
const mitk::PointSet&
input, mitk::PointSet& output);
99 NIFTKCORE_EXPORT
void ScalePointSets(
const mitk::PointSet&
input, mitk::PointSet& output,
double scaleFactor);
107 const mitk::PointSet& fixedPointsIn,
108 const mitk::PointSet& movingPointsIn,
109 mitk::PointSet& fixedPointsOut,
110 mitk::PointSet& movingPointsOut
119 const mitk::PointSet& pointsIn,
120 mitk::PointSet& pointsOut
128 const mitk::PointSet::PointType& point);
136 const vtkMatrix4x4*
matrix,
137 const bool& isNormal,
138 mitk::Point3D& pointOrNormal
145 const mitk::PointSet&
input,
146 const vtkMatrix4x4&
matrix,
147 mitk::PointSet& output
154 const mitk::PointSet&
input
void TransformPointsByVtkMatrix(const mitk::PointSet &input, const vtkMatrix4x4 &matrix, mitk::PointSet &output)
Multiplies one point set by a matrix.
Definition: niftkPointUtils.cxx:300
const GLfloat * c
Definition: glew.h:14144
GLenum GLenum GLenum input
Definition: glew.h:12016
void CrossProduct(const mitk::Point3D &a, const mitk::Point3D &b, mitk::Point3D &c)
Computes c = a x b, and will normalise a and b to unit length first.
Definition: niftkPointUtils.cxx:236
void GetDifference(const mitk::Point3D &a, const mitk::Point3D &b, mitk::Point3D &output)
Returns as output the vector difference of a-b.
Definition: niftkPointUtils.cxx:123
void Normalise(mitk::Point3D &vector)
Given a vector, will normalise it to unit length.
Definition: niftkPointUtils.cxx:149
int FilterMatchingPoints(const mitk::PointSet &fixedPointsIn, const mitk::PointSet &movingPointsIn, mitk::PointSet &fixedPointsOut, mitk::PointSet &movingPointsOut)
Takes fixed and moving points, and scans for matching ID's and returns 2 point sets with ordered and ...
Definition: niftkPointUtils.cxx:325
double Length(mitk::Point3D &vector)
Given a vector, will calculate the length.
Definition: niftkPointUtils.cxx:133
double CalculateStepSize(double *spacing)
Given a double[3] of x,y,z voxel spacing, calculates a step size along a ray, as 1/3 of the smallest ...
Definition: niftkPointUtils.cxx:24
double FindLargestDistanceBetweenTwoPoints(const mitk::PointSet &input)
Computes the largest Euclidean Distance between any two points.
Definition: niftkPointUtils.cxx:163
void ComputeNormalFromPoints(const mitk::Point3D &a, const mitk::Point3D &b, const mitk::Point3D &c, mitk::Point3D &output)
Computes the normal by calculating cross product of (a-b) and (c-b).
Definition: niftkPointUtils.cxx:252
GLdouble GLdouble GLdouble b
Definition: glew.h:7885
GLuint GLenum GLenum transform
Definition: glew.h:12775
double GetRMSErrorBetweenPoints(const mitk::PointSet &fixedPoints, const mitk::PointSet &movingPoints, const CoordinateAxesData *const transform)
Gets the RMS error between fixed point set and a moving point set, with optional transform specified...
Definition: niftkPointUtils.cxx:74
void ScalePointSets(const mitk::PointSet &input, mitk::PointSet &output, double scaleFactor)
Copies input to output, i.e. the output is erased, and re-populated, multiplying by a scale factor...
Definition: niftkPointUtils.cxx:204
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:8272
int RemoveNaNPoints(const mitk::PointSet &pointsIn, mitk::PointSet &pointsOut)
Takes a point set and scans for matching NaN's and returns a point set with the offending points remo...
Definition: niftkPointUtils.cxx:371
mitk::Point3D ComputeCentroid(const mitk::PointSet &input)
Computes the mean/centroid of an mitk::PointSet.
Definition: niftkPointUtils.cxx:418
bool CheckForNaNPoint(const mitk::PointSet::PointType &point)
Checks if the point contains a NaN value.
Definition: niftkPointUtils.cxx:407
GLuint GLenum matrix
Definition: glew.h:12775
bool AreDifferent(const mitk::Point3D &a, const mitk::Point3D &b)
Returns true if a and b are different (up to a given tolerance, currently 0.01), and false otherwise...
Definition: niftkPointUtils.cxx:42
void CopyValues(const mitk::Point3D &a, mitk::Point3D &b)
Copies a into b.
Definition: niftkPointUtils.cxx:226
int CopyPointSets(const mitk::PointSet &input, mitk::PointSet &output)
Copies input to output, i.e. the output is erased, and re-populated.
Definition: niftkPointUtils.cxx:188
void TransformPointByVtkMatrix(const vtkMatrix4x4 *matrix, const bool &isNormal, mitk::Point3D &point)
Simple method to multiply a mitk::Point3D by a vtkMatrix, if the matrix is not NULL, and otherwise if matrix is NULL, will simply leave the point un-altered.
Definition: niftkPointUtils.cxx:264
Definition: niftkExceptionObject.h:21
double GetSquaredDistanceBetweenPoints(const mitk::Point3D &a, const mitk::Point3D &b)
Returns the squared Euclidean distance between a and b.
Definition: niftkPointUtils.cxx:60