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

itkSignedMaurerDistanceMapImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkSignedMaurerDistanceMapImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-06-14 12:30:08 $
00007   Version:   $Revision: 1.8 $
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 __itkSignedMaurerDistanceMapImageFilter_h
00018 #define __itkSignedMaurerDistanceMapImageFilter_h
00019 
00020 #include "itkImage.h"
00021 #include "itkImageToImageFilter.h"
00022 
00023 namespace itk
00024 {
00025 
00062 template <class TInputImage, class TOutputImage>
00063 class ITK_EXPORT SignedMaurerDistanceMapImageFilter :
00064     public ImageToImageFilter< TInputImage, TOutputImage >
00065 {
00066 public:
00067 
00069   itkStaticConstMacro(InputImageDimension, unsigned int,
00070                       TInputImage::ImageDimension);
00071   itkStaticConstMacro(OutputImageDimension, unsigned int,
00072                       TOutputImage::ImageDimension);
00073   itkStaticConstMacro(ImageDimension, unsigned int,
00074                       TOutputImage::ImageDimension);
00076 
00077 
00079   typedef TInputImage    InputImageType;
00080   typedef TOutputImage   OutputImageType;
00081 
00083   typedef SignedMaurerDistanceMapImageFilter   Self;
00084   typedef ImageToImageFilter<
00085                        InputImageType, 
00086                        OutputImageType>        Superclass;
00087 
00088   typedef SmartPointer<Self>                   Pointer;
00089   typedef SmartPointer<const Self>             ConstPointer;
00090 
00092   itkNewMacro(Self);
00093 
00095   itkTypeMacro(SignedMaurerDistanceMapImageFilter, 
00096                ImageToImageFilter);
00097 
00099   typedef typename InputImageType::PixelType   InputPixelType;
00100   typedef typename OutputImageType::PixelType  OutputPixelType;
00101 
00102   typedef typename InputImageType::SizeType    InputSizeType;
00103   typedef typename OutputImageType::SizeType   OutputSizeType;
00104 
00105   typedef typename InputImageType::IndexType   InputIndexType;
00106   typedef typename OutputImageType::IndexType  OutputIndexType;
00107 
00108   typedef typename InputImageType::SpacingType  InputSpacingType;
00109   typedef typename OutputImageType::SpacingType OutputSpacingType;
00110   typedef typename OutputImageType::RegionType  OutputImageRegionType;
00111   
00113   itkSetMacro(SquaredDistance, bool);
00114 
00116   itkGetConstReferenceMacro(SquaredDistance, bool);
00117 
00119   itkBooleanMacro(SquaredDistance);
00120 
00123   itkSetMacro(InsideIsPositive, bool);
00124 
00127   itkGetConstReferenceMacro(InsideIsPositive, bool);
00128 
00132   itkBooleanMacro(InsideIsPositive);
00133 
00135   itkSetMacro(UseImageSpacing, bool);
00136 
00138   itkGetConstReferenceMacro(UseImageSpacing, bool);
00139 
00141   itkBooleanMacro(UseImageSpacing);
00142 
00147   itkSetMacro(BackgroundValue, InputPixelType);
00148   itkGetConstReferenceMacro(BackgroundValue, InputPixelType);
00150 
00151 protected:
00152 
00153   SignedMaurerDistanceMapImageFilter();
00154 
00155   virtual ~SignedMaurerDistanceMapImageFilter();
00156   
00157   void PrintSelf(std::ostream& os, Indent indent) const;
00158 
00159   void GenerateData();
00160 
00161   int SplitRequestedRegion(int i, int num, OutputImageRegionType& splitRegion);
00162 
00163   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId );
00164 
00165   
00166 private:
00167 
00168   SignedMaurerDistanceMapImageFilter(const Self&); //purposely not implemented
00169   void operator=(const Self&); //purposely not implemented
00170   
00171   void Voronoi( unsigned int, OutputIndexType );
00172   bool Remove( OutputPixelType, OutputPixelType, OutputPixelType, 
00173                OutputPixelType, OutputPixelType, OutputPixelType );
00174   
00175   InputPixelType         m_BackgroundValue;  
00176   InputSpacingType       m_Spacing;
00177 
00178   bool                   m_InsideIsPositive;
00179   bool                   m_UseImageSpacing;
00180   bool                   m_SquaredDistance;
00181   
00182   unsigned int           m_CurrentDimension;
00183 
00184 };
00185 
00186 } // end namespace itk
00187 
00188 #ifndef ITK_MANUAL_INSTANTIATION
00189 #include "itkSignedMaurerDistanceMapImageFilter.txx"
00190 #endif
00191 
00192 #endif
00193 

Generated at Tue Sep 15 04:58:04 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000