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/10/06 13:01:22 $
00007   Version:   $Revision: 1.8 $
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   itkStaticConstMacro(ImageDimension, unsigned int,
00073                       TOutputImage::ImageDimension);
00074   
00078   typedef TInputImage  InputImageType;
00079   typedef TMaskImage   MaskImageType;
00080   typedef TOutputImage OutputImageType;
00081   typedef   typename TInputImage::IndexType       IndexType;
00082   typedef   typename TInputImage::SizeType        SizeType;
00083   typedef   typename TOutputImage::RegionType     RegionType;
00084   typedef   std::list<IndexType>                  ListType;
00085 
00086   typedef typename MaskImageType::Pointer MaskImagePointer;
00087 
00091   typedef SmartPointer<Self> Pointer;
00092   typedef SmartPointer<const Self>  ConstPointer;
00093   
00097   itkTypeMacro(ConnectedComponentImageFilter, ImageToImageFilter);
00098   
00102   itkNewMacro(Self);
00103 
00110   itkSetMacro(FullyConnected, bool);
00111   itkGetConstReferenceMacro(FullyConnected, bool);
00112   itkBooleanMacro(FullyConnected);
00113 
00114   void SetMaskImage(TMaskImage* mask) {
00115     this->SetNthInput(1, const_cast<TMaskImage *>( mask ));
00116   }
00117 
00118   const TMaskImage* GetMaskImage() const {
00119     return (static_cast<const TMaskImage*>(this->ProcessObject::GetInput(1)));
00120   }
00121   
00122 protected:
00123   ConnectedComponentImageFilter() 
00124     {
00125     m_FullyConnected = false;
00126     }
00127   virtual ~ConnectedComponentImageFilter() {}
00128   ConnectedComponentImageFilter(const Self&) {}
00129 
00130   bool m_FullyConnected;
00131 
00132   void PrintSelf(std::ostream& os, Indent indent) const;
00133 
00137   void GenerateData();
00138 
00142   void GenerateInputRequestedRegion();
00143 
00148   void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
00149   
00150 };
00151   
00152 } // end namespace itk
00153 
00154 #ifndef ITK_MANUAL_INSTANTIATION
00155 #include "itkConnectedComponentImageFilter.txx"
00156 #endif
00157 
00158 #endif

Generated at Wed May 24 22:58:10 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000