00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkConnectedComponentImageFilter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2004/11/04 20:40:37 $ 00007 Version: $Revision: 1.7 $ 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> 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 TOutputImage OutputImageType; 00080 typedef typename TInputImage::IndexType IndexType; 00081 typedef typename TInputImage::SizeType SizeType; 00082 typedef typename TOutputImage::RegionType RegionType; 00083 typedef std::list<IndexType> ListType; 00084 00088 typedef SmartPointer<Self> Pointer; 00089 typedef SmartPointer<const Self> ConstPointer; 00090 00094 itkTypeMacro(ConnectedComponentImageFilter, ImageToImageFilter); 00095 00099 itkNewMacro(Self); 00100 00107 itkSetMacro(FullyConnected, bool); 00108 itkGetConstReferenceMacro(FullyConnected, bool); 00109 itkBooleanMacro(FullyConnected); 00110 00111 protected: 00112 ConnectedComponentImageFilter() 00113 { 00114 m_FullyConnected = false; 00115 } 00116 virtual ~ConnectedComponentImageFilter() {} 00117 ConnectedComponentImageFilter(const Self&) {} 00118 void PrintSelf(std::ostream& os, Indent indent) const; 00119 00123 void GenerateData(); 00124 00128 void GenerateInputRequestedRegion(); 00129 00134 void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output)); 00135 00136 private: 00137 00138 bool m_FullyConnected; 00139 00140 }; 00141 00142 } // end namespace itk 00143 00144 #ifndef ITK_MANUAL_INSTANTIATION 00145 #include "itkConnectedComponentImageFilter.txx" 00146 #endif 00147 00148 #endif