ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkFastMarchingThresholdStoppingCriterion.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 
00019 #ifndef __itkFastMarchingThresholdStoppingCriterion_h
00020 #define __itkFastMarchingThresholdStoppingCriterion_h
00021 
00022 #include "itkFastMarchingStoppingCriterionBase.h"
00023 #include "itkObjectFactory.h"
00024 
00025 namespace itk
00026 {
00034   template< class TInput, class TOutput >
00035   class FastMarchingThresholdStoppingCriterion :
00036       public FastMarchingStoppingCriterionBase< TInput, TOutput >
00037     {
00038   public:
00039     typedef FastMarchingThresholdStoppingCriterion                Self;
00040     typedef FastMarchingStoppingCriterionBase< TInput, TOutput >  Superclass;
00041     typedef SmartPointer< Self >                                  Pointer;
00042     typedef SmartPointer< const Self >                            ConstPointer;
00043 
00045     itkNewMacro(Self);
00046 
00048     itkTypeMacro(FastMarchingThresholdStoppingCriterion,
00049                  FastMarchingStoppingCriterionBase );
00050 
00051     typedef typename Superclass::OutputPixelType  OutputPixelType;
00052     typedef typename Superclass::NodeType         NodeType;
00053 
00055     itkSetMacro( Threshold, OutputPixelType );
00056     itkGetMacro( Threshold, OutputPixelType );
00058 
00059     bool IsSatisfied() const
00060       {
00061       return ( this->m_CurrentValue >= this->m_Threshold );
00062       }
00063 
00064     std::string GetDescription() const
00065       {
00066       return "Current Value >= Threshold";
00067       }
00068 
00069   protected:
00070     FastMarchingThresholdStoppingCriterion() : Superclass(),
00071       m_Threshold( NumericTraits< OutputPixelType >::Zero )
00072     {}
00073 
00074     ~FastMarchingThresholdStoppingCriterion() {}
00075 
00076     OutputPixelType m_Threshold;
00077 
00078     void SetCurrentNode( const NodeType& ) {}
00079 
00080     void Reset() {}
00081 
00082   private:
00083     FastMarchingThresholdStoppingCriterion( const Self& );
00084     void operator = ( const Self& );
00085     };
00086 
00087 }
00088 #endif // __itkFastMarchingThresholdStoppingCriterion_h
00089