ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkSquaredEdgeLengthDecimationQuadEdgeMeshFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkSquaredEdgeLengthDecimationQuadEdgeMeshFilter_h
00019 #define __itkSquaredEdgeLengthDecimationQuadEdgeMeshFilter_h
00020 
00021 #include "itkEdgeDecimationQuadEdgeMeshFilter.h"
00022 
00023 namespace itk
00024 {
00030 template< class TInput, class TOutput, class TCriterion >
00031 class ITK_EXPORT SquaredEdgeLengthDecimationQuadEdgeMeshFilter:
00032   public EdgeDecimationQuadEdgeMeshFilter< TInput, TOutput, TCriterion >
00033 {
00034 public:
00035   typedef SquaredEdgeLengthDecimationQuadEdgeMeshFilter Self;
00036   typedef SmartPointer< Self >                          Pointer;
00037   typedef SmartPointer< const Self >                    ConstPointer;
00038   typedef EdgeDecimationQuadEdgeMeshFilter<
00039     TInput, TOutput, TCriterion >                       Superclass;
00040 
00042   itkTypeMacro(SquaredEdgeLengthDecimationQuadEdgeMeshFilter, EdgeDecimationQuadEdgeMeshFilter);
00043 
00045   itkNewMacro(Self);
00046 
00047   typedef TInput                          InputMeshType;
00048   typedef typename InputMeshType::Pointer InputMeshPointer;
00049 
00050   typedef TOutput                                         OutputMeshType;
00051   typedef typename OutputMeshType::Pointer                OutputMeshPointer;
00052   typedef typename OutputMeshType::PointIdentifier        OutputPointIdentifier;
00053   typedef typename OutputMeshType::PointType              OutputPointType;
00054   typedef typename OutputMeshType::QEType                 OutputQEType;
00055   typedef typename OutputMeshType::EdgeCellType           OutputEdgeCellType;
00056   typedef typename OutputMeshType::CellsContainerIterator OutputCellsContainerIterator;
00057 
00058   typedef TCriterion                          CriterionType;
00059   typedef typename CriterionType::MeasureType MeasureType;
00060 
00061   typedef typename Superclass::PriorityType          PriorityType;
00062   typedef typename Superclass::PriorityQueueItemType PriorityQueueItemType;
00063   typedef typename Superclass::PriorityQueueType     PriorityQueueType;
00064   typedef typename Superclass::PriorityQueuePointer  PriorityQueuePointer;
00065 
00066   typedef typename Superclass::QueueMapType     QueueMapType;
00067   typedef typename Superclass::QueueMapIterator QueueMapIterator;
00068 
00069   typedef typename Superclass::OperatorType    OperatorType;
00070   typedef typename Superclass::OperatorPointer OperatorPointer;
00071 protected:
00072 
00073   SquaredEdgeLengthDecimationQuadEdgeMeshFilter();
00074   virtual ~SquaredEdgeLengthDecimationQuadEdgeMeshFilter();
00075 
00081   inline MeasureType MeasureEdge(OutputQEType *iEdge)
00082   {
00083     OutputMeshPointer output = this->GetOutput();
00084 
00085     OutputPointIdentifier id_org = iEdge->GetOrigin();
00086     OutputPointIdentifier id_dest = iEdge->GetDestination();
00087 
00088     OutputPointType org = output->GetPoint(id_org);
00089     OutputPointType dest = output->GetPoint(id_dest);
00090 
00091     return static_cast< MeasureType >( org.SquaredEuclideanDistanceTo(dest) );
00092   }
00093 
00098   OutputPointType Relocate(OutputQEType *iEdge);
00099 
00100 private:
00101   SquaredEdgeLengthDecimationQuadEdgeMeshFilter(const Self &);
00102   void operator=(const Self &);
00103 };
00104 }
00105 
00106 #include "itkSquaredEdgeLengthDecimationQuadEdgeMeshFilter.hxx"
00107 #endif
00108