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: 2005/04/17 23:02:20 $
00007   Version:   $Revision: 1.3 $
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 protected:
00196   SignedDanielssonDistanceMapImageFilter();
00197   virtual ~SignedDanielssonDistanceMapImageFilter() {};
00198   void PrintSelf(std::ostream& os, Indent indent) const;
00199 
00201   void GenerateData();  
00202   
00203 private:   
00204   SignedDanielssonDistanceMapImageFilter(const Self&); //purposely not implemented
00205   void operator=(const Self&); //purposely not implemented
00206 
00207   bool                  m_SquaredDistance;
00208   bool                  m_UseImageSpacing;
00209   bool                  m_InsideIsPositive;   // ON is treated as inside pixels
00210 }; // end of SignedDanielssonDistanceMapImageFilter class
00211 
00212 } //end namespace itk
00213 
00214 
00215 #ifndef ITK_MANUAL_INSTANTIATION
00216 #include "itkSignedDanielssonDistanceMapImageFilter.txx"
00217 #endif
00218 
00219 #endif

Generated at Thu May 25 00:03:47 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000