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: 2006/03/24 16:03:17 $
00007   Version:   $Revision: 1.17 $
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 #include "itkSimpleDataObjectDecorator.h"
00023 
00024 namespace itk{
00025 
00035 template <class TInputImage, class TOutputImage>
00036 class ITK_EXPORT ConnectedThresholdImageFilter:
00037     public ImageToImageFilter<TInputImage,TOutputImage>
00038 {
00039 public:
00040 
00042   typedef ConnectedThresholdImageFilter Self;
00043   typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00044   typedef SmartPointer<Self> Pointer;
00045   typedef SmartPointer<const Self> ConstPointer;
00046 
00048   itkNewMacro(Self);
00049 
00051   itkTypeMacro(ConnectedThresholdImageFilter,
00052                ImageToImageFilter);
00053 
00054   typedef TInputImage InputImageType;
00055   typedef typename InputImageType::Pointer InputImagePointer;
00056   typedef typename InputImageType::ConstPointer InputImageConstPointer;
00057   typedef typename InputImageType::RegionType InputImageRegionType; 
00058   typedef typename InputImageType::PixelType InputImagePixelType; 
00059   typedef typename InputImageType::IndexType IndexType;
00060   typedef typename InputImageType::SizeType SizeType;
00061   
00062   typedef TOutputImage OutputImageType;
00063   typedef typename OutputImageType::Pointer OutputImagePointer;
00064   typedef typename OutputImageType::RegionType OutputImageRegionType; 
00065   typedef typename OutputImageType::PixelType OutputImagePixelType; 
00066   
00067   void PrintSelf ( std::ostream& os, Indent indent ) const;
00068 
00069   
00071   void SetSeed ( const IndexType & seed )
00072   {
00073     this->ClearSeeds();
00074     this->AddSeed ( seed );
00075   }
00076   void AddSeed(const IndexType & seed)
00077   {
00078     m_SeedList.push_back ( seed );
00079     this->Modified();
00080   };
00082 
00084   void ClearSeeds ()
00085   {
00086     if (m_SeedList.size() > 0)
00087       {
00088       m_SeedList.clear();
00089       this->Modified();
00090       }
00091   };
00093 
00094   
00098   itkSetMacro(ReplaceValue, OutputImagePixelType);
00099   itkGetMacro(ReplaceValue, OutputImagePixelType);
00101 
00103   typedef SimpleDataObjectDecorator<InputImagePixelType> InputPixelObjectType;
00104 
00106   virtual void SetUpper( InputImagePixelType );
00107   virtual void SetLower( InputImagePixelType );
00109 
00111   virtual void SetUpperInput( const InputPixelObjectType *);
00112   virtual void SetLowerInput( const InputPixelObjectType *);
00114 
00116   virtual InputImagePixelType GetUpper() const;
00117   virtual InputImagePixelType GetLower() const;
00119 
00121   virtual InputPixelObjectType * GetUpperInput();
00122   virtual InputPixelObjectType * GetLowerInput();
00124 
00126   itkStaticConstMacro(InputImageDimension, unsigned int,
00127                       TInputImage::ImageDimension);
00128   itkStaticConstMacro(OutputImageDimension, unsigned int,
00129                       TOutputImage::ImageDimension);
00131 
00132 #ifdef ITK_USE_CONCEPT_CHECKING
00133 
00134   itkConceptMacro(OutputEqualityComparableCheck,
00135     (Concept::EqualityComparable<OutputImagePixelType>));
00136   itkConceptMacro(InputEqualityComparableCheck,
00137     (Concept::EqualityComparable<InputImagePixelType>));
00138   itkConceptMacro(InputConvertibleToOutputCheck,
00139     (Concept::Convertible<InputImagePixelType, OutputImagePixelType>));
00140   itkConceptMacro(SameDimensionCheck,
00141     (Concept::SameDimension<InputImageDimension, OutputImageDimension>));
00142   itkConceptMacro(IntConvertibleToInputCheck,
00143     (Concept::Convertible<int, InputImagePixelType>));
00144   itkConceptMacro(OutputOStreamWritableCheck,
00145     (Concept::OStreamWritable<OutputImagePixelType>));
00146 
00148 #endif
00149 
00150 protected:
00151   ConnectedThresholdImageFilter();
00152   ~ConnectedThresholdImageFilter(){};
00153   std::vector<IndexType> m_SeedList;
00154   InputImagePixelType m_Lower;
00155   InputImagePixelType m_Upper;
00156   OutputImagePixelType m_ReplaceValue;
00157   
00158   // Override since the filter needs all the data for the algorithm
00159   void GenerateInputRequestedRegion();
00160 
00161   // Override since the filter produces the entire dataset
00162   void EnlargeOutputRequestedRegion(DataObject *output);
00163 
00164   void GenerateData();
00165   
00166 private:
00167   ConnectedThresholdImageFilter(const Self&); //purposely not implemented
00168   void operator=(const Self&); //purposely not implemented
00169 
00170 };
00171 
00172 } // end namespace itk
00173 
00174 #ifndef ITK_MANUAL_INSTANTIATION
00175 #include "itkConnectedThresholdImageFilter.txx"
00176 #endif
00177 
00178 #endif
00179 

Generated at Sun Mar 11 23:55:01 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000