Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
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 // Export
29 #include "vtkSlicerMarkupsModuleMRMLExport.h"
30 
31 class vtkCallbackCommand;
32 
34 class VTK_SLICER_MARKUPS_MODULE_MRML_EXPORT vtkCurveMeasurementsCalculator : public vtkPolyDataAlgorithm
35 {
36 public:
37  vtkTypeMacro(vtkCurveMeasurementsCalculator, vtkPolyDataAlgorithm);
38  static vtkCurveMeasurementsCalculator* New();
39 
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
43  void SetMeasurements(vtkCollection* measurements);
46  vtkCollection* GetMeasurements();
48 
50  vtkSetMacro(CurveIsClosed, bool);
53  vtkGetMacro(CurveIsClosed, bool);
54  vtkBooleanMacro(CurveIsClosed, bool);
56 
58  vtkSetMacro(CalculateCurvature, bool);
60  vtkGetMacro(CalculateCurvature, bool);
61  vtkBooleanMacro(CalculateCurvature, bool);
63 
65  static const char* GetMeanCurvatureName() { return "curvature mean"; };
67  static const char* GetMaxCurvatureName() { return "curvature max"; };
68 
69  vtkMTimeType GetMTime() override;
70 
71 protected:
72  bool CalculatePolyDataCurvature(vtkPolyData* polyData);
73  bool InterpolateControlPointMeasurementToPolyData(vtkPolyData* outputPolyData);
74 
77  static void OnControlPointArrayModified(vtkObject* caller, unsigned long eid, void* clientData, void* callData);
78 
79 protected:
81  vtkWeakPointer<vtkCollection> Measurements;
82 
84  bool CurveIsClosed{false};
85 
87  bool CalculateCurvature{false};
88 
93 
94 protected:
95  int FillInputPortInformation(int port, vtkInformation* info) override;
96  int RequestData(vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector) override;
97 
98 protected:
100  ~vtkCurveMeasurementsCalculator() override;
102  void operator=(const vtkCurveMeasurementsCalculator&) = delete;
103 };
104 
105 #endif
static const char * GetMaxCurvatureName()
Get name of max curvature measurement.
Filter that generates curves between points of an input polydata.
static const char * GetMeanCurvatureName()
Get name of mean curvature measurement.
vtkCallbackCommand * ControlPointArrayModifiedCallbackCommand
Command handling data array modified events.
vtkWeakPointer< vtkCollection > Measurements
Measurement list from the markups node for derived measurements (such as interpolation) ...
vtkCollection * ObservedControlPointArrays
List of observed control point arrays (for removal of observations)