ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkSquaredEdgeLengthDecimationQuadEdgeMeshFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkSquaredEdgeLengthDecimationQuadEdgeMeshFilter_h
19 #define __itkSquaredEdgeLengthDecimationQuadEdgeMeshFilter_h
20 
22 
23 namespace itk
24 {
30 template< class TInput, class TOutput, class TCriterion >
32  public EdgeDecimationQuadEdgeMeshFilter< TInput, TOutput, TCriterion >
33 {
34 public:
39  TInput, TOutput, TCriterion > Superclass;
40 
43 
45  itkNewMacro(Self);
46 
47  typedef TInput InputMeshType;
48  typedef typename InputMeshType::Pointer InputMeshPointer;
49 
50  typedef TOutput OutputMeshType;
51  typedef typename OutputMeshType::Pointer OutputMeshPointer;
52  typedef typename OutputMeshType::PointIdentifier OutputPointIdentifier;
53  typedef typename OutputMeshType::PointType OutputPointType;
54  typedef typename OutputMeshType::QEType OutputQEType;
55  typedef typename OutputMeshType::EdgeCellType OutputEdgeCellType;
56  typedef typename OutputMeshType::CellsContainerIterator OutputCellsContainerIterator;
57 
58  typedef TCriterion CriterionType;
59  typedef typename CriterionType::MeasureType MeasureType;
60 
61  typedef typename Superclass::PriorityType PriorityType;
62  typedef typename Superclass::PriorityQueueItemType PriorityQueueItemType;
63  typedef typename Superclass::PriorityQueueType PriorityQueueType;
64  typedef typename Superclass::PriorityQueuePointer PriorityQueuePointer;
65 
66  typedef typename Superclass::QueueMapType QueueMapType;
67  typedef typename Superclass::QueueMapIterator QueueMapIterator;
68 
69  typedef typename Superclass::OperatorType OperatorType;
70  typedef typename Superclass::OperatorPointer OperatorPointer;
71 
72 protected:
75 
81  inline MeasureType MeasureEdge(OutputQEType *iEdge)
82  {
83  OutputPointIdentifier id_org = iEdge->GetOrigin();
84  OutputPointIdentifier id_dest = iEdge->GetDestination();
86 
87  OutputPointType org = this->m_OutputMesh->GetPoint(id_org);
88  OutputPointType dest = this->m_OutputMesh->GetPoint(id_dest);
89 
90  return static_cast< MeasureType >( org.SquaredEuclideanDistanceTo(dest) );
91  }
92 
99  OutputPointType Relocate(OutputQEType *iEdge);
100 
101 private:
102  SquaredEdgeLengthDecimationQuadEdgeMeshFilter(const Self &); // purposely not implemented
103  void operator=(const Self &); // purposely not implemented
104 
105 };
106 }
107 
108 #include "itkSquaredEdgeLengthDecimationQuadEdgeMeshFilter.hxx"
109 #endif
110