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

itkSignedDanielssonDistanceMapImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkSignedDanielssonDistanceMapImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2006/03/30 15:36:25 $
00007   Version:   $Revision: 1.4 $
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 #ifndef __itkSignedDanielssonDistanceMapImageFilter_h
00018 #define __itkSignedDanielssonDistanceMapImageFilter_h
00019 
00020 #include <itkImageToImageFilter.h>
00021 #include <itkDanielssonDistanceMapImageFilter.h>
00022 #include "itkSubtractImageFilter.h"
00023 
00024 
00025 //Simple functor to invert an image for Outside Danielsson distance map
00026 namespace itk
00027 {
00028   namespace Functor
00029     {
00030     template <class InputPixelType> class InvertIntensityFunctor
00031     {
00032     public:
00033       InputPixelType operator()( InputPixelType input )
00034         {
00035         if (input)
00036           {
00037           return NumericTraits<InputPixelType>::Zero;
00038           }
00039         else
00040           {
00041           return NumericTraits<InputPixelType>::One;
00042           }
00043         }
00044     };
00045   }
00046 }
00047 
00048 
00049 namespace itk
00050 {
00051 
00088 template <class TInputImage,class TOutputImage>
00089 class ITK_EXPORT SignedDanielssonDistanceMapImageFilter :
00090     public ImageToImageFilter<TInputImage,TOutputImage>
00091 {
00092 public:
00094   typedef SignedDanielssonDistanceMapImageFilter    Self;
00095   typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00096   typedef SmartPointer<Self> Pointer;
00097   typedef SmartPointer<const Self> ConstPointer;
00098 
00100   itkNewMacro(Self);
00101 
00103   itkTypeMacro( SignedDanielssonDistanceMapImageFilter, ImageToImageFilter );
00104 
00106   typedef   TInputImage       InputImageType;
00107 
00110   typedef   TOutputImage      OutputImageType;
00111 
00113   typedef typename InputImageType::RegionType   RegionType;
00114 
00116   typedef typename RegionType::IndexType  IndexType;
00117 
00119   typedef typename InputImageType::OffsetType  OffsetType;
00120 
00122   typedef typename InputImageType::PixelType  PixelType;
00123 
00125   typedef typename RegionType::SizeType   SizeType;
00126 
00128   itkStaticConstMacro(InputImageDimension, unsigned int,
00129                       InputImageType::ImageDimension);
00130 
00132   typedef Image< OffsetType,
00133                  itkGetStaticConstMacro(InputImageDimension)> VectorImageType;
00134 
00136   typedef typename InputImageType::ConstPointer InputImagePointer;
00137 
00139   typedef typename OutputImageType::Pointer OutputImagePointer;
00140 
00142   typedef typename VectorImageType::Pointer VectorImagePointer;
00143 
00145   itkSetMacro( SquaredDistance, bool );
00146 
00148   itkGetConstReferenceMacro( SquaredDistance, bool );
00149 
00151   itkBooleanMacro( SquaredDistance );
00152 
00154   itkSetMacro( UseImageSpacing, bool );
00155 
00157   itkGetConstReferenceMacro( UseImageSpacing, bool );
00158 
00160   itkBooleanMacro( UseImageSpacing );
00161 
00164   itkSetMacro( InsideIsPositive, bool );
00165 
00168   itkGetConstReferenceMacro( InsideIsPositive, bool );
00169 
00173   itkBooleanMacro( InsideIsPositive );
00174 
00180   OutputImageType * GetVoronoiMap(void);
00181 
00190   OutputImageType * GetDistanceMap(void);
00191 
00193   VectorImageType * GetVectorDistanceMap(void);
00194 
00195 #ifdef ITK_USE_CONCEPT_CHECKING
00196 
00197   itkConceptMacro(IntConvertibleToInputCheck,
00198                   (Concept::Convertible<int, PixelType>));
00199   itkConceptMacro(InputHasNumericTraitsCheck,
00200                   (Concept::HasNumericTraits<PixelType>));
00201 
00203 #endif
00204 
00205 protected:
00206   SignedDanielssonDistanceMapImageFilter();
00207   virtual ~SignedDanielssonDistanceMapImageFilter() {};
00208   void PrintSelf(std::ostream& os, Indent indent) const;
00209 
00211   void GenerateData();  
00212 
00213 private:   
00214   SignedDanielssonDistanceMapImageFilter(const Self&); //purposely not implemented
00215   void operator=(const Self&); //purposely not implemented
00216 
00217   bool                  m_SquaredDistance;
00218   bool                  m_UseImageSpacing;
00219   bool                  m_InsideIsPositive;   // ON is treated as inside pixels
00220 }; // end of SignedDanielssonDistanceMapImageFilter class
00221 
00222 } //end namespace itk
00223 
00224 
00225 #ifndef ITK_MANUAL_INSTANTIATION
00226 #include "itkSignedDanielssonDistanceMapImageFilter.txx"
00227 #endif
00228 
00229 #endif
00230 

Generated at Tue Jul 29 22:23:23 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000