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

itkRelabelComponentImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkRelabelComponentImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2004/11/04 20:40:39 $
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 __itkRelabelComponentImageFilter_h
00018 #define __itkRelabelComponentImageFilter_h
00019 
00020 #include "itkInPlaceImageFilter.h"
00021 #include "itkImage.h"
00022 #include <vector>
00023 
00024 namespace itk
00025 {
00026 
00065 template <class TInputImage, class TOutputImage>
00066 class ITK_EXPORT RelabelComponentImageFilter : 
00067     public InPlaceImageFilter< TInputImage, TOutputImage > 
00068 {
00069 public:
00073   typedef RelabelComponentImageFilter Self;
00074   typedef InPlaceImageFilter< TInputImage, TOutputImage > Superclass;
00075 
00079   typedef typename Superclass::InputImagePointer InputImagePointer;
00080 
00085   typedef typename TOutputImage::PixelType OutputPixelType;
00086   typedef typename TOutputImage::InternalPixelType OutputInternalPixelType;
00087   typedef typename TInputImage::PixelType InputPixelType;
00088   typedef typename TInputImage::InternalPixelType InputInternalPixelType;
00089   itkStaticConstMacro(ImageDimension, unsigned int,
00090                       TOutputImage::ImageDimension);
00091   
00095   typedef TInputImage  InputImageType;
00096   typedef TOutputImage OutputImageType;
00097   typedef   typename TInputImage::IndexType       IndexType;
00098   typedef   typename TInputImage::SizeType        SizeType;
00099   typedef   typename TOutputImage::RegionType     RegionType;
00100 
00104   typedef SmartPointer<Self> Pointer;
00105   typedef SmartPointer<const Self>  ConstPointer;
00106   
00110   itkTypeMacro(RelabelComponentImageFilter, ImageToImageFilter);
00111   
00115   itkNewMacro(Self);
00116 
00119   itkGetMacro(NumberOfObjects, unsigned long);
00120 
00123   itkSetMacro(NumberOfObjectsToPrint, unsigned long);
00124   itkGetConstReferenceMacro(NumberOfObjectsToPrint, unsigned long);
00125   
00131   const std::vector<unsigned long>& GetSizeOfObjectsInPixels() const
00132     { return m_SizeOfObjectsInPixels; }
00133 
00139   const std::vector<float>& GetSizeOfObjectsInPhysicalUnits() const
00140     { return m_SizeOfObjectsInPhysicalUnits; }
00141 
00145   unsigned long GetSizeOfObjectInPixels(unsigned long obj) const
00146     {
00147       if (obj > 0 && obj <= m_NumberOfObjects)
00148         {
00149         return m_SizeOfObjectsInPixels[obj-1];
00150         }
00151       else
00152         {
00153         return 0;
00154         }
00155     }
00156 
00160   float GetSizeOfObjectInPhysicalUnits(unsigned long obj) const
00161     { 
00162       if (obj > 0 && obj <= m_NumberOfObjects)
00163         {
00164         return m_SizeOfObjectsInPhysicalUnits[obj-1];
00165         }
00166       else
00167         {
00168         return 0;
00169         }
00170     }  
00171 
00172   
00173 protected:
00174   RelabelComponentImageFilter()
00175     : m_NumberOfObjects(0), m_NumberOfObjectsToPrint(10)
00176     { this->InPlaceOff(); }
00177   virtual ~RelabelComponentImageFilter() {}
00178   RelabelComponentImageFilter(const Self&) {}
00179 
00183   void GenerateData();
00184 
00188   void GenerateInputRequestedRegion();
00189 
00191   void PrintSelf(std::ostream& os, Indent indent) const;
00192 
00193 private:
00194   unsigned long m_NumberOfObjects;
00195   unsigned long m_NumberOfObjectsToPrint;
00196   std::vector<unsigned long> m_SizeOfObjectsInPixels;
00197   std::vector<float> m_SizeOfObjectsInPhysicalUnits;
00198 
00199 };
00200   
00201 } // end namespace itk
00202 
00203 #ifndef ITK_MANUAL_INSTANTIATION
00204 #include "itkRelabelComponentImageFilter.txx"
00205 #endif
00206 
00207 #endif

Generated at Wed Mar 30 00:09:00 2005 for ITK by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2000