BoundaryToPolygonMapper.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_BoundaryToPolygonMapper_H
21 #define MIRTK_BoundaryToPolygonMapper_H
22 
23 #include "mirtk/BoundarySegmentMapper.h"
24 
25 
26 namespace mirtk {
27 
28 
29 /**
30  * Map corners of surface boundary to circumcircle of polygon
31  * and other points to the edges of the polygon
32  */
34 {
35  mirtkObjectMacro(BoundaryToPolygonMapper);
36 
37  // ---------------------------------------------------------------------------
38  // Attributes
39 
40  /// Radius of the circumcircle
41  mirtkPublicAttributeMacro(double, Radius);
42 
43  /// Copy attributes of this class from another instance
44  void CopyAttributes(const BoundaryToPolygonMapper &);
45 
46  // ---------------------------------------------------------------------------
47  // Construction/Destruction
48 
49 public:
50 
51  /// Default constructor
53 
54  /// Copy constructor
56 
57  /// Assignment operator
59 
60  /// Destructor
61  virtual ~BoundaryToPolygonMapper();
62 
63  /// Create new copy of this instance
64  virtual BoundaryMapper *NewCopy() const;
65 
66  // ---------------------------------------------------------------------------
67  // Execution
68 
69  /// Initialize filter after input and parameters are set
70  virtual void Initialize();
71 
72 protected:
73 
74  /// Map boundary segment
75  ///
76  /// \param[in] n Index of boundary segment.
77  /// \param[in] indices Indices of boundary points forming a closed line strip
78  /// that discretizes the current surface boundary segment.
79  /// \param[in] tvalues Curve parameter in [0, 1) for each boundary segment point,
80  /// where the first point has value t=0 and the parameter value
81  /// for consecutive points is proportional to the distance of
82  /// the point from the first point along the boundary curve.
83  /// \param[in] selection Indices in \p i and \p t arrays corresponding to
84  /// selected boundary points.
85  virtual void MapBoundarySegment(int n, const Array<int> &indices,
86  const Array<double> &tvalues,
87  const Array<int> &selection);
88 
89 };
90 
91 
92 } // namespace mirtk
93 
94 #endif // MIRTK_BoundaryToPolygonMapper_H
BoundaryToPolygonMapper()
Default constructor.
Definition: IOConfig.h:41
BoundaryToPolygonMapper & operator=(const BoundaryToPolygonMapper &)
Assignment operator.
virtual BoundaryMapper * NewCopy() const
Create new copy of this instance.
virtual void Initialize()
Initialize filter after input and parameters are set.
virtual void MapBoundarySegment(int n, const Array< int > &indices, const Array< double > &tvalues, const Array< int > &selection)
virtual ~BoundaryToPolygonMapper()
Destructor.