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

itkDanielssonDistanceMapImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkDanielssonDistanceMapImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-10-14 19:20:32 $
00007   Version:   $Revision: 1.31 $
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 __itkDanielssonDistanceMapImageFilter_h
00018 #define __itkDanielssonDistanceMapImageFilter_h
00019 
00020 #include <itkImageToImageFilter.h>
00021 #include <itkImageRegionIteratorWithIndex.h>
00022 
00023 namespace itk
00024 {
00025 
00058 template <class TInputImage,class TOutputImage>
00059 class ITK_EXPORT DanielssonDistanceMapImageFilter :
00060     public ImageToImageFilter<TInputImage,TOutputImage>
00061 {
00062 public:
00064   typedef DanielssonDistanceMapImageFilter             Self;
00065   typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00066   typedef SmartPointer<Self>                           Pointer;
00067   typedef SmartPointer<const Self>                     ConstPointer;
00068 
00070   itkNewMacro(Self);
00071 
00073   itkTypeMacro( DanielssonDistanceMapImageFilter, ImageToImageFilter );
00074 
00076   typedef   TInputImage       InputImageType;
00077 
00080   typedef   TOutputImage      OutputImageType;
00081 
00083   typedef typename InputImageType::RegionType   RegionType;
00084 
00086   typedef typename RegionType::IndexType  IndexType;
00087 
00089   typedef typename InputImageType::OffsetType  OffsetType;
00090 
00092   typedef typename RegionType::SizeType   SizeType;
00093 
00095   itkStaticConstMacro(InputImageDimension, unsigned int,
00096                       InputImageType::ImageDimension);
00097   itkStaticConstMacro(OutputImageDimension, unsigned int,
00098                       TOutputImage::ImageDimension);
00100 
00102   typedef Image< OffsetType,
00103                  itkGetStaticConstMacro(InputImageDimension)> VectorImageType;
00104 
00106   typedef typename InputImageType::ConstPointer InputImagePointer;
00107 
00109   typedef typename OutputImageType::Pointer OutputImagePointer;
00110 
00112   typedef typename VectorImageType::Pointer VectorImagePointer;
00113 
00115   itkSetMacro( SquaredDistance, bool );
00116 
00118   itkGetConstReferenceMacro( SquaredDistance, bool );
00119 
00121   itkBooleanMacro( SquaredDistance );
00122 
00128   itkSetMacro( InputIsBinary, bool );
00129 
00131   itkGetConstReferenceMacro( InputIsBinary, bool );
00132 
00134   itkBooleanMacro( InputIsBinary );
00135 
00137   itkSetMacro( UseImageSpacing, bool );
00138 
00140   itkGetConstReferenceMacro( UseImageSpacing, bool );
00141 
00143   itkBooleanMacro( UseImageSpacing );
00144 
00150   OutputImageType * GetVoronoiMap(void);
00151 
00160   OutputImageType * GetDistanceMap(void);
00161 
00163   VectorImageType * GetVectorDistanceMap(void);
00164 
00165 #ifdef ITK_USE_CONCEPT_CHECKING
00166 
00167   itkConceptMacro(SameDimensionCheck,
00168     (Concept::SameDimension<InputImageDimension, OutputImageDimension>));
00169   itkConceptMacro(UnsignedIntConvertibleToOutputCheck,
00170     (Concept::Convertible<unsigned int, typename TOutputImage::PixelType>));
00171   itkConceptMacro(IntConvertibleToOutputCheck,
00172     (Concept::Convertible<int, typename TOutputImage::PixelType>));
00173   itkConceptMacro(DoubleConvertibleToOutputCheck,
00174     (Concept::Convertible<double, typename TOutputImage::PixelType>));
00175   itkConceptMacro(InputConvertibleToOutputCheck,
00176     (Concept::Convertible<typename TInputImage::PixelType,
00177                           typename TOutputImage::PixelType>));
00178 
00180 #endif
00181 
00182 protected:
00183   DanielssonDistanceMapImageFilter();
00184   virtual ~DanielssonDistanceMapImageFilter() {};
00185   void PrintSelf(std::ostream& os, Indent indent) const;
00186 
00188   void GenerateData();  
00189 
00191   void PrepareData();  
00192 
00194   void ComputeVoronoiMap();  
00195 
00197   void UpdateLocalDistance(VectorImageType*,
00198                            const IndexType&,
00199                            const OffsetType&);
00200 
00201 private:   
00202   DanielssonDistanceMapImageFilter(const Self&); //purposely not implemented
00203   void operator=(const Self&); //purposely not implemented
00204 
00205   bool                  m_SquaredDistance;
00206   bool                  m_InputIsBinary;
00207   bool                  m_UseImageSpacing;
00208 
00209 }; // end of DanielssonDistanceMapImageFilter class
00210 
00211 } //end namespace itk
00212 
00213 
00214 #ifndef ITK_MANUAL_INSTANTIATION
00215 #include "itkDanielssonDistanceMapImageFilter.txx"
00216 #endif
00217 
00218 #endif
00219 

Generated at Mon Jul 12 2010 18:11:46 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000