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: 2009-04-01 14:36:32 $
00007   Version:   $Revision: 1.7 $
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 ) const
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   typedef typename Superclass::DataObjectPointer DataObjectPointer;
00146 
00147 
00149   itkSetMacro( SquaredDistance, bool );
00150 
00152   itkGetConstReferenceMacro( SquaredDistance, bool );
00153 
00155   itkBooleanMacro( SquaredDistance );
00156 
00158   itkSetMacro( UseImageSpacing, bool );
00159 
00161   itkGetConstReferenceMacro( UseImageSpacing, bool );
00162 
00164   itkBooleanMacro( UseImageSpacing );
00165 
00168   itkSetMacro( InsideIsPositive, bool );
00169 
00172   itkGetConstReferenceMacro( InsideIsPositive, bool );
00173 
00177   itkBooleanMacro( InsideIsPositive );
00178 
00184   OutputImageType * GetVoronoiMap(void);
00185 
00194   OutputImageType * GetDistanceMap(void);
00195 
00197   VectorImageType * GetVectorDistanceMap(void);
00198 
00200   virtual DataObjectPointer MakeOutput(unsigned int idx);
00201 
00202 #ifdef ITK_USE_CONCEPT_CHECKING
00203 
00204   itkConceptMacro(IntConvertibleToInputCheck,
00205                   (Concept::Convertible<int, PixelType>));
00206   itkConceptMacro(InputHasNumericTraitsCheck,
00207                   (Concept::HasNumericTraits<PixelType>));
00208 
00210 #endif
00211 
00212 protected:
00213   SignedDanielssonDistanceMapImageFilter();
00214   virtual ~SignedDanielssonDistanceMapImageFilter() {};
00215   void PrintSelf(std::ostream& os, Indent indent) const;
00216 
00218   void GenerateData();  
00219 
00220 private:   
00221   SignedDanielssonDistanceMapImageFilter(const Self&); //purposely not implemented
00222   void operator=(const Self&); //purposely not implemented
00223 
00224   bool                  m_SquaredDistance;
00225   bool                  m_UseImageSpacing;
00226   bool                  m_InsideIsPositive;   // ON is treated as inside pixels
00227 }; // end of SignedDanielssonDistanceMapImageFilter class
00228 
00229 } //end namespace itk
00230 
00231 
00232 #ifndef ITK_MANUAL_INSTANTIATION
00233 #include "itkSignedDanielssonDistanceMapImageFilter.txx"
00234 #endif
00235 
00236 #endif
00237 

Generated at Mon Jul 12 2010 19:53:24 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000