ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkRegionalMaximaImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkRegionalMaximaImageFilter_h
00019 #define __itkRegionalMaximaImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 
00023 namespace itk
00024 {
00053 template< class TInputImage, class TOutputImage >
00054 class ITK_EXPORT RegionalMaximaImageFilter:
00055   public ImageToImageFilter< TInputImage, TOutputImage >
00056 {
00057 public:
00059   typedef RegionalMaximaImageFilter Self;
00060 
00061   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00062 
00063   typedef SmartPointer< Self >       Pointer;
00064   typedef SmartPointer< const Self > ConstPointer;
00065 
00067   typedef TInputImage                            InputImageType;
00068   typedef TOutputImage                           OutputImageType;
00069   typedef typename InputImageType::Pointer       InputImagePointer;
00070   typedef typename InputImageType::ConstPointer  InputImageConstPointer;
00071   typedef typename InputImageType::RegionType    InputImageRegionType;
00072   typedef typename InputImageType::PixelType     InputImagePixelType;
00073   typedef typename OutputImageType::Pointer      OutputImagePointer;
00074   typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
00075   typedef typename OutputImageType::RegionType   OutputImageRegionType;
00076   typedef typename OutputImageType::PixelType    OutputImagePixelType;
00077 
00079   itkStaticConstMacro(InputImageDimension, unsigned int,
00080                       TInputImage::ImageDimension);
00081   itkStaticConstMacro(OutputImageDimension, unsigned int,
00082                       TOutputImage::ImageDimension);
00084 
00086   itkNewMacro(Self);
00087 
00089   itkTypeMacro(RegionalMaximaImageFilter, ImageToImageFilter);
00090 
00097   itkSetMacro(FullyConnected, bool);
00098   itkGetConstMacro(FullyConnected, bool);
00099   itkBooleanMacro(FullyConnected);
00101 
00106   itkSetMacro(ForegroundValue, OutputImagePixelType);
00107   itkGetConstMacro(ForegroundValue, OutputImagePixelType);
00109 
00114   itkSetMacro(BackgroundValue, OutputImagePixelType);
00115   itkGetConstMacro(BackgroundValue, OutputImagePixelType);
00117 
00122   itkSetMacro(FlatIsMaxima, bool);
00123   itkGetConstMacro(FlatIsMaxima, bool);
00124   itkBooleanMacro(FlatIsMaxima);
00126 
00127 #ifdef ITK_USE_CONCEPT_CHECKING
00128 
00129   itkConceptMacro( InputHasPixelTraitsCheck,
00130                    ( Concept::HasPixelTraits< InputImagePixelType > ) );
00131   itkConceptMacro( InputHasNumericTraitsCheck,
00132                    ( Concept::HasNumericTraits< InputImagePixelType > ) );
00133 
00135 #endif
00136 protected:
00137   RegionalMaximaImageFilter();
00138   ~RegionalMaximaImageFilter() {}
00139   void PrintSelf(std::ostream & os, Indent indent) const;
00141 
00145   void GenerateInputRequestedRegion();
00146 
00148   void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) );
00149 
00152   void GenerateData();
00153 
00154 private:
00155   RegionalMaximaImageFilter(const Self &); //purposely not implemented
00156   void operator=(const Self &);            //purposely not implemented
00157 
00158   bool                 m_FullyConnected;
00159   bool                 m_FlatIsMaxima;
00160   OutputImagePixelType m_ForegroundValue;
00161   OutputImagePixelType m_BackgroundValue;
00162 }; // end of class
00163 } // end namespace itk
00164 
00165 #ifndef ITK_MANUAL_INSTANTIATION
00166 #include "itkRegionalMaximaImageFilter.hxx"
00167 #endif
00168 
00169 #endif
00170