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/01/20 23:50:38 $
00007   Version:   $Revision: 1.2 $
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   template <class InputPixelType> class InvertIntensityFunctor
00029   {
00030   public:
00031     InputPixelType operator()( InputPixelType input )
00032       {
00033         if (input)
00034         {
00035           return NumericTraits<InputPixelType>::Zero;
00036         }
00037         else
00038         {
00039           return NumericTraits<InputPixelType>::One;
00040         }
00041       }
00042   };
00043 }
00044 
00045 
00046 namespace itk
00047 {
00048 
00085 template <class TInputImage,class TOutputImage>
00086 class ITK_EXPORT SignedDanielssonDistanceMapImageFilter :
00087     public ImageToImageFilter<TInputImage,TOutputImage>
00088 {
00089 public:
00091   typedef SignedDanielssonDistanceMapImageFilter    Self;
00092   typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00093   typedef SmartPointer<Self> Pointer;
00094   typedef SmartPointer<const Self> ConstPointer;
00095 
00097   itkNewMacro(Self);
00098 
00100   itkTypeMacro( SignedDanielssonDistanceMapImageFilter, ImageToImageFilter );
00101 
00103   typedef   TInputImage       InputImageType;
00104 
00107   typedef   TOutputImage      OutputImageType;
00108 
00110   typedef typename InputImageType::RegionType   RegionType;
00111 
00113   typedef typename RegionType::IndexType  IndexType;
00114 
00116   typedef typename InputImageType::OffsetType  OffsetType;
00117 
00119   typedef typename InputImageType::PixelType  PixelType;
00120 
00122   typedef typename RegionType::SizeType   SizeType;
00123   
00125   itkStaticConstMacro(InputImageDimension, unsigned int,
00126                       InputImageType::ImageDimension);
00127 
00129   typedef Image< OffsetType,
00130                  itkGetStaticConstMacro(InputImageDimension)> VectorImageType;
00131 
00133   typedef typename InputImageType::ConstPointer InputImagePointer;
00134 
00136   typedef typename OutputImageType::Pointer OutputImagePointer;
00137 
00139   typedef typename VectorImageType::Pointer VectorImagePointer;
00140 
00142   itkSetMacro( SquaredDistance, bool );
00143 
00145   itkGetConstReferenceMacro( SquaredDistance, bool );
00146 
00148   itkBooleanMacro( SquaredDistance );
00149 
00151   itkSetMacro( UseImageSpacing, bool );
00152 
00154   itkGetConstReferenceMacro( UseImageSpacing, bool );
00155 
00157   itkBooleanMacro( UseImageSpacing );
00158 
00161   itkSetMacro( InsideIsPositive, bool );
00162 
00165   itkGetConstReferenceMacro( InsideIsPositive, bool );
00166 
00170   itkBooleanMacro( InsideIsPositive );
00171   
00177   OutputImageType * GetVoronoiMap(void);
00178 
00187   OutputImageType * GetDistanceMap(void);
00188 
00190   VectorImageType * GetVectorDistanceMap(void);
00191 
00192 protected:
00193   SignedDanielssonDistanceMapImageFilter();
00194   virtual ~SignedDanielssonDistanceMapImageFilter() {};
00195   void PrintSelf(std::ostream& os, Indent indent) const;
00196 
00198   void GenerateData();  
00199   
00200 private:   
00201   SignedDanielssonDistanceMapImageFilter(const Self&); //purposely not implemented
00202   void operator=(const Self&); //purposely not implemented
00203 
00204   bool                  m_SquaredDistance;
00205   bool                  m_UseImageSpacing;
00206   bool                  m_InsideIsPositive;   // ON is treated as inside pixels
00207 }; // end of SignedDanielssonDistanceMapImageFilter class
00208 
00209 } //end namespace itk
00210 
00211 
00212 #ifndef ITK_MANUAL_INSTANTIATION
00213 #include "itkSignedDanielssonDistanceMapImageFilter.txx"
00214 #endif
00215 
00216 #endif

Generated at Wed Mar 30 00:11:07 2005 for ITK by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2000