Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
vtkCurveMeasurementsCalculator.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Portions (c) Copyright Brigham and Women's Hospital (BWH) All Rights Reserved.
6
7 See COPYRIGHT.txt
8 or http://www.slicer.org/copyright/copyright.txt for details.
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16==============================================================================*/
17
18#ifndef __vtkCurveMeasurementsCalculator_h
19#define __vtkCurveMeasurementsCalculator_h
20
21// VTK includes
22#include <vtkCollection.h>
23#include <vtkPolyData.h>
24#include <vtkPolyDataAlgorithm.h>
25#include <vtkSetGet.h>
26#include <vtkWeakPointer.h>
27
28// Markups MRML includes
29#include <vtkMRMLMarkupsNode.h>
30
31// Export
32#include "vtkMRMLExport.h"
33
34class vtkCallbackCommand;
35
40class VTK_MRML_EXPORT vtkCurveMeasurementsCalculator : public vtkPolyDataAlgorithm
41{
42public:
43 vtkTypeMacro(vtkCurveMeasurementsCalculator, vtkPolyDataAlgorithm);
45
46 void PrintSelf(ostream& os, vtkIndent indent) override;
47
49
54
56
58 vtkSetMacro(CurveIsClosed, bool);
59 vtkGetMacro(CurveIsClosed, bool);
60 vtkBooleanMacro(CurveIsClosed, bool);
62
64
65 vtkSetMacro(CalculateCurvature, bool);
66 vtkGetMacro(CalculateCurvature, bool);
67 vtkBooleanMacro(CalculateCurvature, bool);
69
71 static const char* GetMeanCurvatureName() { return "curvature mean"; };
73 static const char* GetMaxCurvatureName() { return "curvature max"; };
75 static const char* GetCurvatureArrayName() { return "Curvature"; };
76
77 vtkGetMacro(CurvatureUnits, std::string);
78 vtkSetMacro(CurvatureUnits, std::string);
79
81
82 vtkSetMacro(CalculateTorsion, bool);
83 vtkGetMacro(CalculateTorsion, bool);
84 vtkBooleanMacro(CalculateTorsion, bool);
86
88 static const char* GetMeanTorsionName() { return "torsion mean"; };
90 static const char* GetMaxTorsionName() { return "torsion max"; };
92 static const char* GetTorsionArrayName() { return "Torsion"; };
93
94 vtkGetMacro(TorsionUnits, std::string);
95 vtkSetMacro(TorsionUnits, std::string);
96
97 vtkMTimeType GetMTime() override;
98
103 static bool InterpolateArray(vtkDoubleArray* inputValues, bool closedCurve, vtkDoubleArray* interpolatedValues,
104 vtkDoubleArray* pedigreeIdsArray, double pedigreeIdsValueScale=1.0);
105
106protected:
107 bool CalculatePolyDataCurvature(vtkPolyData* polyData);
108 bool CalculatePolyDataTorsion(vtkPolyData* polyData);
109 bool InterpolateControlPointMeasurementToPolyData(vtkPolyData* outputPolyData);
110
113 static void OnControlPointArrayModified(vtkObject* caller, unsigned long eid, void* clientData, void* callData);
114
115protected:
117 vtkWeakPointer<vtkMRMLMarkupsNode> InputMarkupsMRMLNode;
118
120 bool CurveIsClosed{false};
121
124
126 bool CalculateTorsion{false};
127
132
133 std::string CurvatureUnits{"mm-1"};
134 std::string TorsionUnits{"mm-1"};
135
136protected:
137 int FillInputPortInformation(int port, vtkInformation* info) override;
138 int RequestData(vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector) override;
139
140protected:
145};
146
147#endif
vtkCollection * ObservedControlPointArrays
List of observed control point arrays (for removal of observations)
void SetInputMarkupsMRMLNode(vtkMRMLMarkupsNode *node)
vtkCurveMeasurementsCalculator(const vtkCurveMeasurementsCalculator &)=delete
void operator=(const vtkCurveMeasurementsCalculator &)=delete
vtkMTimeType GetMTime() override
static const char * GetMeanCurvatureName()
Get name of mean curvature measurement.
bool CalculatePolyDataTorsion(vtkPolyData *polyData)
int FillInputPortInformation(int port, vtkInformation *info) override
static const char * GetMeanTorsionName()
Get name of mean torsion measurement.
static bool InterpolateArray(vtkDoubleArray *inputValues, bool closedCurve, vtkDoubleArray *interpolatedValues, vtkDoubleArray *pedigreeIdsArray, double pedigreeIdsValueScale=1.0)
vtkWeakPointer< vtkMRMLMarkupsNode > InputMarkupsMRMLNode
Input markups node containing the measurement list for derived measurements (such as interpolation)
static void OnControlPointArrayModified(vtkObject *caller, unsigned long eid, void *clientData, void *callData)
bool CalculateTorsion
Flag determining whether the filter should calculate torsion.
bool CalculateCurvature
Flag determining whether the filter should calculate curvature.
bool CurveIsClosed
Flag indicating whether the current curve is closed.
static const char * GetTorsionArrayName()
Get name of torsion array (on the curve points)
void PrintSelf(ostream &os, vtkIndent indent) override
static const char * GetMaxTorsionName()
Get name of max torsion measurement.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
vtkMRMLMarkupsNode * GetInputMarkupsMRMLNode()
~vtkCurveMeasurementsCalculator() override
bool InterpolateControlPointMeasurementToPolyData(vtkPolyData *outputPolyData)
static const char * GetCurvatureArrayName()
Get name of curvature values array (on the curve points)
static vtkCurveMeasurementsCalculator * New()
static const char * GetMaxCurvatureName()
Get name of max curvature measurement.
bool CalculatePolyDataCurvature(vtkPolyData *polyData)
vtkCallbackCommand * ControlPointArrayModifiedCallbackCommand
Command handling data array modified events.