ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkBinaryImageToLevelSetImageAdaptorBase.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 __itkBinaryImageToLevelSetImageAdaptorBase_h
00020 #define __itkBinaryImageToLevelSetImageAdaptorBase_h
00021 
00022 #include "itkImage.h"
00023 #include "itkObject.h"
00024 
00025 namespace itk
00026 {
00030 template< class TInputImage, class TLevelSet >
00031 class BinaryImageToLevelSetImageAdaptorBase : public Object
00032 {
00033 public:
00034   typedef BinaryImageToLevelSetImageAdaptorBase Self;
00035   typedef SmartPointer< Self >                  Pointer;
00036   typedef SmartPointer< const Self >            ConstPointer;
00037   typedef Object                                Superclass;
00038 
00040   itkTypeMacro( BinaryImageToLevelSetImageAdaptorBase, Object );
00041 
00042   typedef TInputImage                           InputImageType;
00043   typedef typename InputImageType::PixelType    InputImagePixelType;
00044   typedef typename InputImageType::IndexType    InputImageIndexType;
00045   typedef typename InputImageType::Pointer      InputImagePointer;
00046   typedef typename InputImageType::RegionType   InputImageRegionType;
00047   typedef typename NumericTraits< InputImagePixelType >::RealType
00048                                                 InputPixelRealType;
00049 
00050   itkStaticConstMacro ( ImageDimension, unsigned int,
00051                        InputImageType::ImageDimension );
00052 
00053   typedef TLevelSet                       LevelSetType;
00054   typedef typename LevelSetType::Pointer  LevelSetPointer;
00055 
00059   virtual void Initialize() = 0;
00060 
00062   itkGetObjectMacro( LevelSet, LevelSetType );
00063 
00065   itkSetObjectMacro( InputImage, InputImageType );
00066   itkGetObjectMacro( InputImage, InputImageType );
00068 
00069 protected:
00071   BinaryImageToLevelSetImageAdaptorBase()
00072     {
00073     this->m_LevelSet = LevelSetType::New();
00074     }
00075 
00077   virtual ~BinaryImageToLevelSetImageAdaptorBase() {}
00078 
00079   InputImagePointer       m_InputImage;
00080   LevelSetPointer         m_LevelSet;
00081 
00082 private:
00083   BinaryImageToLevelSetImageAdaptorBase( const Self& ); // purposely not implemented
00084   void operator = ( const Self& ); // purposely not implemented
00085 
00086 };
00087 }
00088 
00089 #endif // __itkBinaryImageToLevelSetImageAdaptorBase_h
00090