/*========================================================================= Program: Insight Segmentation & Registration Toolkit Module: $RCSfile: itkLocalMaximaImageFilter.h,v $ Language: C++ Date: $Date: 2007-08-31 22:17:25 +0200 (Fri, 31 Aug 2007) $ Version: $Revision: 2 $ 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 __itkLocalMaximaImageFilter_h #define __itkLocalMaximaImageFilter_h #include "itkImageToImageFilter.h" namespace itk { /** \class LocalMaximaImageFilter * \brief Produce a binary image where foreground is the local maxima of the * input image. * * Local maxima are pixels surounded by pixels of equal or lower value. * The minimum value in the image is assumed to be the background and is * not included as a local maxima. * */ template class ITK_EXPORT LocalMaximaImageFilter : public ImageToImageFilter { public: /** Standard class typedefs. */ typedef LocalMaximaImageFilter Self; typedef ImageToImageFilter Superclass; typedef SmartPointer Pointer; typedef SmartPointer ConstPointer; /** Some convenient typedefs. */ typedef TInputImage InputImageType; typedef TOutputImage OutputImageType; typedef typename InputImageType::Pointer InputImagePointer; typedef typename InputImageType::ConstPointer InputImageConstPointer; typedef typename InputImageType::RegionType InputImageRegionType; typedef typename InputImageType::PixelType InputImagePixelType; typedef typename OutputImageType::Pointer OutputImagePointer; typedef typename OutputImageType::ConstPointer OutputImageConstPointer; typedef typename OutputImageType::RegionType OutputImageRegionType; typedef typename OutputImageType::PixelType OutputImagePixelType; /** ImageDimension constants */ itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension); /** Standard New method. */ itkNewMacro(Self); /** Runtime information support. */ itkTypeMacro(LocalMaximaImageFilter, ImageToImageFilter); /** * Set/Get whether the connected components are defined strictly by * face connectivity or by face+edge+vertex connectivity. Default is * FullyConnectedOff. */ itkSetMacro(FullyConnected, bool); itkGetConstReferenceMacro(FullyConnected, bool); itkBooleanMacro(FullyConnected); /** * Set/Get the value in the output image to consider as "foreground". * Defaults to maximum value of PixelType. */ itkSetMacro(ForegroundValue, OutputImagePixelType); itkGetConstMacro(ForegroundValue, OutputImagePixelType); /** * Set/Get the value used as "background" in the output image. * Defaults to NumericTraits::NonpositiveMin(). */ itkSetMacro(BackgroundValue, OutputImagePixelType); itkGetConstMacro(BackgroundValue, OutputImagePixelType); protected: LocalMaximaImageFilter(); ~LocalMaximaImageFilter() {}; void PrintSelf(std::ostream& os, Indent indent) const; /** LocalMaximaImageFilter needs the entire input be * available. Thus, it needs to provide an implementation of * GenerateInputRequestedRegion(). */ void GenerateInputRequestedRegion() ; /** LocalMaximaImageFilter will produce the entire output. */ void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output)); /** Single-threaded version of GenerateData. */ void GenerateData(); private: LocalMaximaImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented bool m_FullyConnected; OutputImagePixelType m_ForegroundValue; OutputImagePixelType m_BackgroundValue; } ; // end of class } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkLocalMaximaImageFilter.txx" #endif #endif