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

itkConnectedComponentImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkConnectedComponentImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/12/13 16:59:38 $
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 __itkConnectedComponentImageFilter_h
00018 #define __itkConnectedComponentImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkImage.h"
00022 
00023 namespace itk
00024 {
00025 
00048 template <class TInputImage, class TOutputImage, class TMaskImage=TInputImage>
00049 class ITK_EXPORT ConnectedComponentImageFilter : 
00050     public ImageToImageFilter< TInputImage, TOutputImage > 
00051 {
00052 public:
00056   typedef ConnectedComponentImageFilter Self;
00057   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00058 
00062   typedef typename Superclass::InputImagePointer InputImagePointer;
00063 
00068   typedef typename TOutputImage::PixelType OutputPixelType;
00069   typedef typename TOutputImage::InternalPixelType OutputInternalPixelType;
00070   typedef typename TInputImage::PixelType InputPixelType;
00071   typedef typename TInputImage::InternalPixelType InputInternalPixelType;
00072   typedef typename TMaskImage::PixelType MaskPixelType;
00073   itkStaticConstMacro(ImageDimension, unsigned int,
00074                       TOutputImage::ImageDimension);
00075 
00079   typedef TInputImage  InputImageType;
00080   typedef TMaskImage   MaskImageType;
00081   typedef TOutputImage OutputImageType;
00082   typedef   typename TInputImage::IndexType       IndexType;
00083   typedef   typename TInputImage::SizeType        SizeType;
00084   typedef   typename TOutputImage::RegionType     RegionType;
00085   typedef   std::list<IndexType>                  ListType;
00086 
00087   typedef typename MaskImageType::Pointer MaskImagePointer;
00088 
00092   typedef SmartPointer<Self> Pointer;
00093   typedef SmartPointer<const Self>  ConstPointer;
00094 
00098   itkTypeMacro(ConnectedComponentImageFilter, ImageToImageFilter);
00099 
00103   itkNewMacro(Self);
00104 
00111   itkSetMacro(FullyConnected, bool);
00112   itkGetConstReferenceMacro(FullyConnected, bool);
00113   itkBooleanMacro(FullyConnected);
00115 
00116   void SetMaskImage(TMaskImage* mask) {
00117     this->SetNthInput(1, const_cast<TMaskImage *>( mask ));
00118   }
00119 
00120   const TMaskImage* GetMaskImage() const {
00121     return (static_cast<const TMaskImage*>(this->ProcessObject::GetInput(1)));
00122   }
00123   
00124 protected:
00125   ConnectedComponentImageFilter() 
00126     {
00127     m_FullyConnected = false;
00128     }
00129   virtual ~ConnectedComponentImageFilter() {}
00130   ConnectedComponentImageFilter(const Self&) {}
00131 
00132   bool m_FullyConnected;
00133 
00134   void PrintSelf(std::ostream& os, Indent indent) const;
00135 
00139   void GenerateData();
00140 
00144   void GenerateInputRequestedRegion();
00145 
00150   void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
00151 
00152 };
00153   
00154 } // end namespace itk
00155 
00156 #ifndef ITK_MANUAL_INSTANTIATION
00157 #include "itkConnectedComponentImageFilter.txx"
00158 #endif
00159 
00160 #endif
00161 

Generated at Sat Sep 2 20:16:57 2006 for ITK by doxygen 1.4.7 written by Dimitri van Heesch, © 1997-2000