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

itkConnectedThresholdImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkConnectedThresholdImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/09/26 19:03:02 $
00007   Version:   $Revision: 1.13 $
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 __itkConnectedThresholdImageFilter_h
00018 #define __itkConnectedThresholdImageFilter_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 ConnectedThresholdImageFilter:
00036     public ImageToImageFilter<TInputImage,TOutputImage>
00037 {
00038 public:
00040   typedef ConnectedThresholdImageFilter Self;
00041   typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00042   typedef SmartPointer<Self> Pointer;
00043   typedef SmartPointer<const Self> ConstPointer;
00044 
00046   itkNewMacro(Self);
00047 
00049   itkTypeMacro(ConnectedThresholdImageFilter,
00050                ImageToImageFilter);
00051 
00052   typedef TInputImage InputImageType;
00053   typedef typename InputImageType::Pointer InputImagePointer;
00054   typedef typename InputImageType::ConstPointer InputImageConstPointer;
00055   typedef typename InputImageType::RegionType InputImageRegionType; 
00056   typedef typename InputImageType::PixelType InputImagePixelType; 
00057   typedef typename InputImageType::IndexType IndexType;
00058   typedef typename InputImageType::SizeType SizeType;
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 
00067   
00069   void SetSeed ( const IndexType & seed )
00070   {
00071     this->ClearSeeds();
00072     this->AddSeed ( seed );
00073   }
00074   void AddSeed(const IndexType & seed)
00075   {
00076     m_SeedList.push_back ( seed );
00077     this->Modified();
00078   };
00079 
00081   void ClearSeeds ()
00082   {
00083     if (m_SeedList.size() > 0)
00084       {
00085       m_SeedList.clear();
00086       this->Modified();
00087       }
00088   };
00089 
00091   itkSetMacro(Lower, InputImagePixelType);
00092   itkGetMacro(Lower, InputImagePixelType);
00093 
00096   itkSetMacro(Upper, InputImagePixelType);
00097   itkGetMacro(Upper, InputImagePixelType);
00098   
00102   itkSetMacro(ReplaceValue, OutputImagePixelType);
00103   itkGetMacro(ReplaceValue, OutputImagePixelType);
00104 
00105 protected:
00106   ConnectedThresholdImageFilter();
00107   ~ConnectedThresholdImageFilter(){};
00108   std::vector<IndexType> m_SeedList;
00109   InputImagePixelType m_Lower;
00110   InputImagePixelType m_Upper;
00111   OutputImagePixelType m_ReplaceValue;
00112   
00113   // Override since the filter needs all the data for the algorithm
00114   void GenerateInputRequestedRegion();
00115 
00116   // Override since the filter produces the entire dataset
00117   void EnlargeOutputRequestedRegion(DataObject *output);
00118 
00119   void GenerateData();
00120   
00121 private:
00122   ConnectedThresholdImageFilter(const Self&); //purposely not implemented
00123   void operator=(const Self&); //purposely not implemented
00124 
00125 };
00126 
00127 } // end namespace itk
00128 
00129 #ifndef ITK_MANUAL_INSTANTIATION
00130 #include "itkConnectedThresholdImageFilter.txx"
00131 #endif
00132 
00133 #endif

Generated at Tue Mar 29 23:49:00 2005 for ITK by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2000