ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkAntiAliasBinaryImageFilter.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 __itkAntiAliasBinaryImageFilter_h
00019 #define __itkAntiAliasBinaryImageFilter_h
00020 #include "itkSparseFieldLevelSetImageFilter.h"
00021 #include "itkCurvatureFlowFunction.h"
00022 
00023 namespace itk
00024 {
00106 template< class TInputImage, class TOutputImage >
00107 class ITK_EXPORT AntiAliasBinaryImageFilter:
00108   public SparseFieldLevelSetImageFilter< TInputImage, TOutputImage >
00109 {
00110 public:
00111 
00113   typedef AntiAliasBinaryImageFilter                                  Self;
00114   typedef SparseFieldLevelSetImageFilter< TInputImage, TOutputImage > Superclass;
00115   typedef SmartPointer< Self >                                        Pointer;
00116   typedef SmartPointer< const Self >                                  ConstPointer;
00117 
00119   typedef typename Superclass::ValueType       ValueType;
00120   typedef typename Superclass::IndexType       IndexType;
00121   typedef typename Superclass::TimeStepType    TimeStepType;
00122   typedef typename Superclass::OutputImageType OutputImageType;
00123   typedef typename Superclass::InputImageType  InputImageType;
00124 
00126   typedef CurvatureFlowFunction< OutputImageType > CurvatureFunctionType;
00127 
00129   typedef typename TInputImage::ValueType BinaryValueType;
00130 
00132   itkNewMacro(Self);
00133 
00135   itkTypeMacro(AntiAliasBinaryImageFilter, SparseFieldLevelSetImageFilter);
00136 
00138   itkGetConstMacro(UpperBinaryValue, BinaryValueType);
00139   itkGetConstMacro(LowerBinaryValue, BinaryValueType);
00141 
00144   void SetMaximumIterations(unsigned int i)
00145   {
00146     itkWarningMacro("SetMaximumIterations is deprecated.  Please use SetNumberOfIterations instead.");
00147     this->SetNumberOfIterations(i);
00148   }
00150 
00151   unsigned int GetMaximumIterations()
00152   {
00153     itkWarningMacro("GetMaximumIterations is deprecated. Please use GetNumberOfIterations instead.");
00154     return this->GetNumberOfIterations();
00155   }
00156 
00157 #ifdef ITK_USE_CONCEPT_CHECKING
00158 
00159   itkConceptMacro( DoubleConvertibleToOutputCheck,
00160                    ( Concept::Convertible< double, typename TOutputImage::PixelType > ) );
00161   itkConceptMacro( InputOStreamWritableCheck,
00162                    ( Concept::OStreamWritable< typename TInputImage::PixelType > ) );
00163 
00165 #endif
00166 protected:
00167   AntiAliasBinaryImageFilter();
00168   ~AntiAliasBinaryImageFilter() {}
00169   virtual void PrintSelf(std::ostream & os, Indent indent) const;
00171 
00174   inline virtual ValueType CalculateUpdateValue(const IndexType & idx,
00175                                                 const TimeStepType & dt,
00176                                                 const ValueType & value,
00177                                                 const ValueType & change);
00178 
00181   void GenerateData();
00182 
00183 private:
00184   AntiAliasBinaryImageFilter(const Self &); //purposely not implemented
00185   void operator=(const Self &);             //purposely not implemented
00186 
00187   BinaryValueType m_UpperBinaryValue;
00188   BinaryValueType m_LowerBinaryValue;
00189 
00190   typename CurvatureFunctionType::Pointer m_CurvatureFunction;
00191 
00192   const TInputImage *m_InputImage;
00193 };
00194 } // end namespace itk
00195 
00196 #ifndef ITK_MANUAL_INSTANTIATION
00197 #include "itkAntiAliasBinaryImageFilter.hxx"
00198 #endif
00199 
00200 #endif
00201