15 #ifndef niftkVTKFunctions_h
16 #define niftkVTKFunctions_h
20 #include <vtkPolyData.h>
21 #include <vtkTransform.h>
22 #include <vtkRandomSequence.h>
23 #include <vtkMinimalStandardRandomSequence.h>
24 #include <vtkCellLocator.h>
25 #include <vtkCamera.h>
26 #include <vtkSmartPointer.h>
27 #include <vtkMatrix4x4.h>
80 double stdDev, vtkRandomSequence * rng);
90 double xerr,
double yerr,
double zerr, vtkRandomSequence * rng);
99 double xerr,
double yerr,
double zerr);
108 (vtkPolyData * polydata, vtkTransform *
transform);
119 double xtrans,
double ytrans,
double ztrans,
double xrot,
double yrot,
double zrot,
120 vtkRandomSequence * rng);
130 double xtrans,
double ytrans,
double ztrans,
double xrot,
double yrot,
double zrot);
221 const int *windowSize,
222 const double *origin,
223 const double *spacing,
226 const double *clippingRange,
227 const bool& flipYAxis,
229 const double& distanceToFocalPoint = -1000
void CopyDoubleVector(int n, const double *a, double *b)
Definition: niftkVTKFunctions.cxx:189
void CalculateUnitVector(const double *a, const double *b, double *output)
Definition: niftkVTKFunctions.cxx:126
double GetEuclideanDistanceBetweenTwo3DPoints(const double *a, const double *b)
Definition: niftkVTKFunctions.cxx:36
double GetBoundingBoxDiagonalLength(const double *boundingBoxVector6)
Definition: niftkVTKFunctions.cxx:177
bool SaveMatrix4x4ToFile(const std::string &fileName, const vtkMatrix4x4 &matrix, const bool &silent)
Save the matrix to a plain text file of 4 rows of 4 space separated numbers.
Definition: niftkVTKFunctions.cxx:494
double AngleBetweenTwoUnitVectors(const double *a, const double *b)
Definition: niftkVTKFunctions.cxx:137
void Normalise3DPoint(const double *a, const double length, double *output)
Definition: niftkVTKFunctions.cxx:92
void PerturbPolyData(vtkPolyData *polydata, double xerr, double yerr, double zerr, vtkRandomSequence *rng)
Perturbs the points in a polydata object by random values, using existing random number generator...
Definition: niftkVTKFunctions.cxx:283
void CrossProductTwo3DVectors(const double *a, const double *b, double *c)
Definition: niftkVTKFunctions.cxx:117
GLuint GLuint GLfloat weight
Definition: glew.h:11786
void AddTwo3DPoints(const double *a, const double *b, double *output)
Definition: niftkVTKFunctions.cxx:82
GLuint GLsizei GLsizei * length
Definition: glew.h:1809
GLdouble GLdouble GLdouble b
Definition: glew.h:7885
GLuint GLenum GLenum transform
Definition: glew.h:12775
std::string WriteMatrix4x4ToString(const vtkMatrix4x4 &matrix)
Writes matrix out as a string, for use in SaveMatrix4x4ToFile.
Definition: niftkVTKFunctions.cxx:479
GLuint64EXT * result
Definition: glew.h:12084
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:8272
double AngleBetweenTwoUnitVectorsInDegrees(const double *a, const double *b)
Definition: niftkVTKFunctions.cxx:146
void InterpolateTransformationMatrix(const vtkMatrix4x4 &before, const vtkMatrix4x4 &after, const double &proportion, vtkMatrix4x4 &interpolated)
Interpolates between two matrices.
Definition: niftkVTKFunctions.cxx:739
void RandomTransform(vtkTransform *transform, double xtrans, double ytrans, double ztrans, double xrot, double yrot, double zrot, vtkRandomSequence *rng)
Creates a randomly determined vtkTransform, using existing random number geneterator.
Definition: niftkVTKFunctions.cxx:199
bool ClipPointToWithinBoundingBox(const double *bounds, double *point)
Definition: niftkVTKFunctions.cxx:154
void MatrixToQuaternion(const vtkMatrix4x4 &matrix, double *quaternion)
Extracts the rotation matrix, and converts to quaternion.
Definition: niftkVTKFunctions.cxx:672
void SubtractTwo3DPoints(const double *a, const double *b, double *output)
Definition: niftkVTKFunctions.cxx:72
GLuint GLenum matrix
Definition: glew.h:12775
double DistanceToSurface(double point[3], vtkPolyData *target)
Returns the euclidean distance (in 3D) between a point and the closest point on a polydata mesh...
Definition: niftkVTKFunctions.cxx:413
bool CropPointsFromPolyData(vtkPolyData *PolyData, int Points)
Randomly removes points from the passed polydata until the passed number of points Any cells or surfa...
Definition: niftkVTKFunctions.cxx:651
void TranslatePolyData(vtkPolyData *polydata, vtkTransform *transform)
Translates a polydata object using a transform.
Definition: niftkVTKFunctions.cxx:227
double GetLength(const double *a)
Definition: niftkVTKFunctions.cxx:49
vtkSmartPointer< vtkMatrix4x4 > LoadMatrix4x4FromFile(const std::string &fileName, const bool &silent)
Loads the matrix from file, or else creates an Identity matrix, and the caller is responsible for dea...
Definition: niftkVTKFunctions.cxx:519
GLclampd n
Definition: glew.h:6789
bool DistancesToColorMap(vtkPolyData *source, vtkPolyData *target)
Measures the euclidean distances between the points in two polydata, and sets the.
Definition: niftkVTKFunctions.cxx:350
void InterpolateRotation(const double *beforeRotation, const double *afterRotation, const double &weight, double *outputRotation, bool adjustSign)
Performs spherical linear interpolation.
Definition: niftkVTKFunctions.cxx:688
void SetCameraParallelTo2DImage(const int *imageSize, const int *windowSize, const double *origin, const double *spacing, const double *xAxis, const double *yAxis, const double *clippingRange, const bool &flipYAxis, vtkCamera &camera, const double &distanceToFocalPoint)
Used to set a vtkCamera to track a 2D image, and sets the camera to parallel projection mode...
Definition: niftkVTKFunctions.cxx:575
Definition: niftkExceptionObject.h:21
bool MatricesAreEqual(const vtkMatrix4x4 &m1, const vtkMatrix4x4 &m2, const double &tolerance)
Checks matrices for equality.
Definition: niftkVTKFunctions.cxx:554
GLsizei const GLcharARB ** string
Definition: glew.h:5194
void NormaliseToUnitLength(const double *a, double *output)
Definition: niftkVTKFunctions.cxx:109
GLsizei GLsizei GLchar * source
Definition: glew.h:1816
void ScaleVector(const double &scaleFactor, const double *a, double *b)
Definition: niftkVTKFunctions.cxx:62
GLenum target
Definition: glew.h:5584
double NormalisedRNG(vtkRandomSequence *rng)
Normalises the values returned by a vtk random sequence to be centred on zero.
Definition: niftkVTKFunctions.cxx:334
GLint GLenum GLsizei GLint GLsizei imageSize
Definition: glew.h:1363
void PerturbPolyDataAlongNormal(vtkPolyData *polydata, double stdDev, vtkRandomSequence *rng)
Definition: niftkVTKFunctions.cxx:245