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: 2006/03/30 15:36:24 $
00007   Version:   $Revision: 1.9 $
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:
00039 
00041   typedef NeighborhoodConnectedImageFilter Self;
00042   typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00043   typedef SmartPointer<Self> Pointer;
00044   typedef SmartPointer<const Self> ConstPointer;
00045 
00047   itkNewMacro(Self);
00048 
00050   itkTypeMacro(NeighborhoodConnectedImageFilter,
00051                ImageToImageFilter);
00052 
00053   typedef TInputImage InputImageType;
00054   typedef typename InputImageType::Pointer InputImagePointer;
00055   typedef typename InputImageType::RegionType InputImageRegionType; 
00056   typedef typename InputImageType::PixelType InputImagePixelType; 
00057   typedef typename InputImageType::IndexType IndexType;
00058   typedef typename InputImageType::SizeType InputImageSizeType;
00059   
00060   typedef TOutputImage OutputImageType;
00061   typedef typename OutputImageType::Pointer OutputImagePointer;
00062   typedef typename OutputImageType::RegionType OutputImageRegionType; 
00063   typedef typename OutputImageType::PixelType OutputImagePixelType; 
00064   
00065   void PrintSelf ( std::ostream& os, Indent indent ) const;
00066 
00068   void ClearSeeds()
00069   {
00070     m_Seeds.clear();
00071     this->Modified();
00072   }
00073 
00075   void SetSeed(const IndexType & seed)
00076   {
00077     this->ClearSeeds();
00078     this->AddSeed ( seed );
00079   }
00080 
00082   void AddSeed ( const IndexType & seed )
00083   {
00084     m_Seeds.push_back ( seed );
00085     this->Modified();
00086   };
00088 
00090   itkSetMacro(Lower, InputImagePixelType);
00091   itkGetMacro(Lower, InputImagePixelType);
00093 
00096   itkSetMacro(Upper, InputImagePixelType);
00097   itkGetMacro(Upper, InputImagePixelType);
00099 
00103   itkSetMacro(ReplaceValue, OutputImagePixelType);
00104   itkGetMacro(ReplaceValue, OutputImagePixelType);
00106 
00108   itkSetMacro(Radius, InputImageSizeType);
00109 
00111   itkGetConstReferenceMacro(Radius, InputImageSizeType);
00112 
00114   itkStaticConstMacro(InputImageDimension, unsigned int,
00115                       TInputImage::ImageDimension);
00116   itkStaticConstMacro(OutputImageDimension, unsigned int,
00117                       TOutputImage::ImageDimension);
00119 
00120 #ifdef ITK_USE_CONCEPT_CHECKING
00121 
00122   itkConceptMacro(InputEqualityComparableCheck,
00123     (Concept::EqualityComparable<InputImagePixelType>));
00124   itkConceptMacro(OutputEqualityComparableCheck,
00125     (Concept::EqualityComparable<OutputImagePixelType>));
00126   itkConceptMacro(SameDimensionCheck,
00127     (Concept::SameDimension<InputImageDimension, OutputImageDimension>));
00128   itkConceptMacro(InputOStreamWritableCheck,
00129     (Concept::OStreamWritable<InputImagePixelType>));
00130   itkConceptMacro(OutputOStreamWritableCheck,
00131     (Concept::OStreamWritable<OutputImagePixelType>));
00132 
00134 #endif
00135 
00136 protected:
00137   NeighborhoodConnectedImageFilter();
00138   ~NeighborhoodConnectedImageFilter(){};
00139   std::vector<IndexType> m_Seeds;
00140   InputImagePixelType m_Lower;
00141   InputImagePixelType m_Upper;
00142   OutputImagePixelType m_ReplaceValue;
00143   InputImageSizeType m_Radius;
00144 
00145   
00146   // Override since the filter needs all the data for the algorithm
00147   void GenerateInputRequestedRegion();
00148 
00149   // Override since the filter produces the entire dataset
00150   void EnlargeOutputRequestedRegion(DataObject *output);
00151   void GenerateData();
00152   
00153 private:
00154   NeighborhoodConnectedImageFilter(const Self&); //purposely not implemented
00155   void operator=(const Self&); //purposely not implemented
00156 
00157 };
00158 
00159 } // end namespace itk
00160 
00161 #ifndef ITK_MANUAL_INSTANTIATION
00162 #include "itkNeighborhoodConnectedImageFilter.txx"
00163 #endif
00164 
00165 #endif
00166 

Generated at Sun Sep 23 13:42:34 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000