Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkQuadEdgeMeshDiscreteMeanCurvatureEstimator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkQuadEdgeMeshDiscreteMeanCurvatureEstimator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-10-01 22:00:55 $
00007   Version:   $Revision: 1.2 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 
00018 #ifndef __itkQuadEdgeMeshDiscreteMeanCurvatureEstimator_h
00019 #define __itkQuadEdgeMeshDiscreteMeanCurvatureEstimator_h
00020 
00021 #include "itkQuadEdgeMeshDiscreteCurvatureEstimator.h"
00022 #include "itkQuadEdgeMeshParamMatrixCoefficients.h"
00023 
00024 namespace itk
00025 {
00035 template< class TInputMesh, class TOutputMesh >
00036 class QuadEdgeMeshDiscreteMeanCurvatureEstimator :
00037   public QuadEdgeMeshDiscreteCurvatureEstimator< TInputMesh, TOutputMesh >
00038 {
00039 public:
00040   typedef QuadEdgeMeshDiscreteMeanCurvatureEstimator                          Self;
00041   typedef SmartPointer< Self >                                                Pointer;
00042   typedef SmartPointer< const Self >                                          ConstPointer;
00043   typedef QuadEdgeMeshDiscreteCurvatureEstimator< TInputMesh, TOutputMesh >   Superclass;
00044 
00045   typedef typename Superclass::InputMeshType                                  InputMeshType;
00046   typedef typename Superclass::InputMeshPointer                               InputMeshPointer;
00047 
00048   typedef typename Superclass::OutputMeshType                                 OutputMeshType;
00049   typedef typename Superclass::OutputMeshPointer                              OutputMeshPointer;
00050   typedef typename Superclass::OutputPointsContainerPointer                   OutputPointsContainerPointer;
00051   typedef typename Superclass::OutputPointsContainerIterator                  OutputPointsContainerIterator;
00052   typedef typename Superclass::OutputPointType                                OutputPointType;
00053   typedef typename Superclass::OutputVectorType                               OutputVectorType;
00054   typedef typename Superclass::OutputCoordType                                OutputCoordType;
00055   typedef typename Superclass::OutputPointIdentifier                          OutputPointIdentifier;
00056   typedef typename Superclass::OutputCellIdentifier                           OutputCellIdentifier;
00057   typedef typename Superclass::OutputQEType                                   OutputQEType;
00058   typedef typename Superclass::OutputMeshTraits                               OutputMeshTraits;
00059   typedef typename Superclass::OutputCurvatureType                            OutputCurvatureType;
00060   
00061   typedef typename Superclass::TriangleType                                   TriangleType;
00062 
00064   itkTypeMacro( QuadEdgeMeshDiscreteMeanCurvatureEstimator, QuadEdgeMeshDiscreteCurvatureEstimator );
00065 
00067   itkNewMacro( Self );
00068 
00069   typedef ConformalMatrixCoefficients< OutputMeshType > CoefficientType;
00070 
00071 protected:
00072   QuadEdgeMeshDiscreteMeanCurvatureEstimator() {}
00073   ~QuadEdgeMeshDiscreteMeanCurvatureEstimator() {}
00074 
00075   virtual OutputCurvatureType EstimateCurvature( const OutputPointType& iP )
00076     {
00077     OutputMeshPointer output = this->GetOutput();
00078 
00079     OutputQEType* qe = iP.GetEdge( );
00080 
00081     OutputCurvatureType oH( 0. );
00082     OutputVectorType Laplace;
00083     Laplace.Fill( 0. );
00084     
00085     if( qe != 0 )
00086       {
00087       CoefficientType coefficent;
00088 
00089       OutputQEType* qe_it = qe;
00090       OutputQEType* qe_it2;
00091       OutputCurvatureType area( 0. );
00092       OutputPointType q0, q1;
00093       OutputVectorType u;
00094 
00095       if( qe_it != qe_it->GetOnext() )
00096         {
00097         qe_it = qe;
00098         do
00099           {
00100           qe_it2 = qe_it->GetOnext();
00101           q0 = output->GetPoint( qe_it->GetDestination() );
00102           Laplace += coefficent( output, qe_it ) * ( iP - q0 );
00103           area += ComputeMixedArea( qe_it, qe_it2 );
00104           qe_it = qe_it2;
00105           } while( qe_it != qe );
00106         Laplace *= ( area > 1e-6 ? 0.25 /area : 0. );
00107         oH = Laplace.GetNorm();
00108         }
00109       }
00110     return oH;
00111     }
00112 
00113 private:
00114   QuadEdgeMeshDiscreteMeanCurvatureEstimator( const Self& ); // purposely not implemented 
00115   void operator = ( const Self& ); // purposely not implemented 
00116 
00117 };
00118 
00119 }
00120 #endif
00121 

Generated at Wed Nov 5 23:39:41 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000