PointDataFilter.h
1 /*
2  * Medical Image Registration ToolKit (MIRTK)
3  *
4  * Copyright 2016 Imperial College London
5  * Copyright 2016 Andreas Schuh
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 #ifndef MIRTK_PointDataFilter_H
21 #define MIRTK_PointDataFilter_H
22 
23 #include "mirtk/MeshFilter.h"
24 
25 #include "mirtk/Memory.h"
26 #include "mirtk/EdgeConnectivity.h"
27 
28 #include "vtkSmartPointer.h"
29 #include "vtkDataArray.h"
30 #include "vtkPointData.h"
31 
32 
33 namespace mirtk {
34 
35 
36 /**
37  * Filter for mesh node data
38  */
40 {
41  mirtkAbstractMacro(PointDataFilter);
42 
43  // ---------------------------------------------------------------------------
44  // Attributes
45 
46  /// Maximum edge-connectivity of neighboring nodes
47  ///
48  /// Used instead of _Radius attribute when radius is non-positive value.
49  /// Ignored when pre-computed _Neighbors edge-connectivity set.
50  mirtkPublicAttributeMacro(int, Connectivity);
51 
52  /// Maximum point distance of neighboring points
53  ///
54  /// Used instead of _Connectivity attribute when set to positive value.
55  /// Ignored when pre-computed _Neighbors edge-connectivity set.
56  mirtkPublicAttributeMacro(double, Radius);
57 
58  /// Set of considered neighboring nodes for each mesh node
59  ///
60  /// Computed based on either _Connectivity or _Radius when no pre-computed
61  /// edge-connectivity is specified before the filter is executed.
62  mirtkPublicAttributeMacro(SharedPtr<EdgeConnectivity>, Neighbors);
63 
64  /// Name of (input and) output point data array
65  ///
66  /// When an input _DataArray is given, this name is assigned to the respective
67  /// output point data array. Otherwise, the name of the input data array must
68  /// be set and is used also for the output data array. When no input _DataArray
69  /// is given, the name of the point data array of the input mesh must be set.
70  mirtkPublicAttributeMacro(string, DataName);
71 
72  /// Input point data array
73  mirtkPublicAttributeMacro(vtkSmartPointer<vtkDataArray>, InputData);
74 
75  /// Output point data array
76  mirtkPublicAttributeMacro(vtkSmartPointer<vtkDataArray>, OutputData);
77 
78  /// Copy attributes of this filter from another instance
79  void CopyAttributes(const PointDataFilter &);
80 
81  // ---------------------------------------------------------------------------
82  // Construction/Destruction
83 
84 protected:
85 
86  /// Default constructor
88 
89  /// Copy constructor
91 
92  /// Assignment operator
94 
95  /// Destructor
96  virtual ~PointDataFilter();
97 
98  // ---------------------------------------------------------------------------
99  // Execution
100 
101 protected:
102 
103  /// Initialize filter after input and parameters are set
104  virtual void Initialize();
105 
106 };
107 
108 
109 } // namespace mirtk
110 
111 #endif // MIRTK_PointDataFilter_H
PointDataFilter()
Default constructor.
virtual ~PointDataFilter()
Destructor.
Definition: IOConfig.h:41
PointDataFilter & operator=(const PointDataFilter &)
Assignment operator.
virtual void Initialize()
Initialize filter after input and parameters are set.