/*========================================================================= Program: Insight Segmentation & Registration Toolkit Module: $RCSfile: itkCountImageFilter.h,v $ Language: C++ Date: $Date: 2006/03/29 14:53:40 $ Version: $Revision: 1.5 $ Copyright (c) Insight Software Consortium. All rights reserved. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef __itkLocalDistanceMapImageFilter_h #define __itkLocalDistanceMapImageFilter_h #include "itkImageToImageFilter.h" #include "itkImage.h" #include "itkNumericTraits.h" namespace itk { /** \class LocalDistanceMapImageFilter * \brief computes a Hausdorff based Local Distance Map * * Computes an image where a given pixel is the Hausdorff distance of the * the corresponding pixels in an input edge image. * * \ingroup IntensityImageFilters */ template class ITK_EXPORT LocalDistanceMapImageFilter : public ImageToImageFilter { public: /** Extract dimension from input and output image. */ itkStaticConstMacro(Distance1Dimension, unsigned int, TDistance1::ImageDimension); itkStaticConstMacro(Distance2Dimension, unsigned int, TDistance2::ImageDimension); itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension); /** Convenient typedefs for simplifying declarations. */ typedef TDistance1 Distance1Type; typedef TDistance2 Distance2Type; typedef TOutputImage OutputImageType; /** Standard class typedefs. */ typedef LocalDistanceMapImageFilter Self; typedef ImageToImageFilter< Distance1Type, OutputImageType> Superclass; typedef SmartPointer Pointer; typedef SmartPointer ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(CountImageFilter, ImageToImageFilter); /** Image typedef support. */ typedef typename Distance1Type::PixelType Distance1PixelType; typedef typename Distance2Type::PixelType Distance2PixelType; typedef typename OutputImageType::PixelType OutputPixelType; typedef typename Distance1Type::RegionType Distance1RegionType; typedef typename Distance2Type::RegionType Distance2RegionType; typedef typename OutputImageType::RegionType OutputImageRegionType; /** Set the input files */ void SetInput1(const TDistance1 * distance1); void SetInput2(const TDistance2 * distance2); const Distance1Type * GetInput1(void); const Distance2Type * GetInput2(void); protected: LocalDistanceMapImageFilter(); virtual ~LocalDistanceMapImageFilter() {} void PrintSelf(std::ostream& os, Indent indent) const; /** LocalDistanceMapImageFilter can be implemented as a multithreaded filter. * Therefore, this implementation provides a ThreadedGenerateData() * routine which is called for each processing thread. The output * image data is allocated automatically by the superclass prior to * calling ThreadedGenerateData(). ThreadedGenerateData can only * write to the portion of the output image specified by the * parameter "outputRegionForThread" * */ void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ); private: LocalDistanceMapImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkLocalDistanceMapImageFilter.txx" #endif #endif