ITK  4.2.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 protected:
72 
75 
81  inline MeasureType MeasureEdge(OutputQEType *iEdge)
82  {
83  OutputMeshPointer output = this->GetOutput();
84 
85  OutputPointIdentifier id_org = iEdge->GetOrigin();
86  OutputPointIdentifier id_dest = iEdge->GetDestination();
87 
88  OutputPointType org = output->GetPoint(id_org);
89  OutputPointType dest = output->GetPoint(id_dest);
90 
91  return static_cast< MeasureType >( org.SquaredEuclideanDistanceTo(dest) );
92  }
93 
98  OutputPointType Relocate(OutputQEType *iEdge);
99 
100 private:
102  void operator=(const Self &);
103 };
104 }
105 
106 #include "itkSquaredEdgeLengthDecimationQuadEdgeMeshFilter.hxx"
107 #endif
108