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

itkNeighborhoodConnectedImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkNeighborhoodConnectedImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-10-16 19:33:44 $
00007   Version:   $Revision: 1.11 $
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 __itkNeighborhoodConnectedImageFilter_h
00018 #define __itkNeighborhoodConnectedImageFilter_h
00019 
00020 #include "itkImage.h"
00021 #include "itkImageToImageFilter.h"
00022 
00023 namespace itk {
00024 
00034 template <class TInputImage, class TOutputImage>
00035 class ITK_EXPORT NeighborhoodConnectedImageFilter:
00036     public ImageToImageFilter<TInputImage,TOutputImage>
00037 {
00038 public:
00040   typedef NeighborhoodConnectedImageFilter             Self;
00041   typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00042   typedef SmartPointer<Self>                           Pointer;
00043   typedef SmartPointer<const Self>                     ConstPointer;
00044 
00046   itkNewMacro(Self);
00047 
00049   itkTypeMacro(NeighborhoodConnectedImageFilter,
00050                ImageToImageFilter);
00051 
00052   typedef TInputImage                         InputImageType;
00053   typedef typename InputImageType::Pointer    InputImagePointer;
00054   typedef typename InputImageType::RegionType InputImageRegionType; 
00055   typedef typename InputImageType::PixelType  InputImagePixelType; 
00056   typedef typename InputImageType::IndexType  IndexType;
00057   typedef typename InputImageType::SizeType   InputImageSizeType;
00058   
00059   typedef TOutputImage                         OutputImageType;
00060   typedef typename OutputImageType::Pointer    OutputImagePointer;
00061   typedef typename OutputImageType::RegionType OutputImageRegionType; 
00062   typedef typename OutputImageType::PixelType  OutputImagePixelType; 
00063   
00064   void PrintSelf ( std::ostream& os, Indent indent ) const;
00065 
00067   void ClearSeeds()
00068     {
00069     m_Seeds.clear();
00070     this->Modified();
00071     }
00072 
00074   void SetSeed(const IndexType & seed)
00075     {
00076     this->ClearSeeds();
00077     this->AddSeed ( seed );
00078     }
00079 
00081   void AddSeed ( const IndexType & seed )
00082     {
00083     m_Seeds.push_back ( seed );
00084     this->Modified();
00085     }
00087 
00089   itkSetMacro(Lower, InputImagePixelType);
00090   itkGetMacro(Lower, InputImagePixelType);
00092 
00095   itkSetMacro(Upper, InputImagePixelType);
00096   itkGetMacro(Upper, InputImagePixelType);
00098 
00102   itkSetMacro(ReplaceValue, OutputImagePixelType);
00103   itkGetMacro(ReplaceValue, OutputImagePixelType);
00105 
00107   itkSetMacro(Radius, InputImageSizeType);
00108 
00110   itkGetConstReferenceMacro(Radius, InputImageSizeType);
00111 
00113   itkStaticConstMacro(InputImageDimension, unsigned int,
00114                       TInputImage::ImageDimension);
00115   itkStaticConstMacro(OutputImageDimension, unsigned int,
00116                       TOutputImage::ImageDimension);
00118 
00119 #ifdef ITK_USE_CONCEPT_CHECKING
00120 
00121   itkConceptMacro(InputEqualityComparableCheck,
00122     (Concept::EqualityComparable<InputImagePixelType>));
00123   itkConceptMacro(OutputEqualityComparableCheck,
00124     (Concept::EqualityComparable<OutputImagePixelType>));
00125   itkConceptMacro(SameDimensionCheck,
00126     (Concept::SameDimension<InputImageDimension, OutputImageDimension>));
00127   itkConceptMacro(InputOStreamWritableCheck,
00128     (Concept::OStreamWritable<InputImagePixelType>));
00129   itkConceptMacro(OutputOStreamWritableCheck,
00130     (Concept::OStreamWritable<OutputImagePixelType>));
00131 
00133 #endif
00134 
00135 protected:
00136   NeighborhoodConnectedImageFilter();
00137   ~NeighborhoodConnectedImageFilter(){};
00138   std::vector<IndexType> m_Seeds;
00139   InputImagePixelType    m_Lower;
00140   InputImagePixelType    m_Upper;
00141   OutputImagePixelType   m_ReplaceValue;
00142   InputImageSizeType     m_Radius;
00143 
00144   
00145   // Override since the filter needs all the data for the algorithm
00146   void GenerateInputRequestedRegion();
00147 
00148   // Override since the filter produces the entire dataset
00149   void EnlargeOutputRequestedRegion(DataObject *output);
00150   void GenerateData();
00151   
00152 private:
00153   NeighborhoodConnectedImageFilter(const Self&); //purposely not implemented
00154   void operator=(const Self&); //purposely not implemented
00155 
00156 };
00157 
00158 } // end namespace itk
00159 
00160 #ifndef ITK_MANUAL_INSTANTIATION
00161 #include "itkNeighborhoodConnectedImageFilter.txx"
00162 #endif
00163 
00164 #endif
00165 

Generated at Wed Nov 5 23:10:14 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000