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: 2009-06-05 16:06:22 $
00007   Version:   $Revision: 1.22 $
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:
00041   typedef ConnectedThresholdImageFilter                Self;
00042   typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00043   typedef SmartPointer<Self>                           Pointer;
00044   typedef SmartPointer<const Self>                     ConstPointer;
00045 
00047   itkNewMacro(Self);
00048 
00050   itkTypeMacro(ConnectedThresholdImageFilter,
00051                ImageToImageFilter);
00052 
00053   typedef TInputImage                           InputImageType;
00054   typedef typename InputImageType::Pointer      InputImagePointer;
00055   typedef typename InputImageType::ConstPointer InputImageConstPointer;
00056   typedef typename InputImageType::RegionType   InputImageRegionType; 
00057   typedef typename InputImageType::PixelType    InputImagePixelType; 
00058   typedef typename InputImageType::IndexType    IndexType;
00059   typedef typename InputImageType::SizeType     SizeType;
00060   
00061   typedef TOutputImage                          OutputImageType;
00062   typedef typename OutputImageType::Pointer     OutputImagePointer;
00063   typedef typename OutputImageType::RegionType  OutputImageRegionType; 
00064   typedef typename OutputImageType::PixelType   OutputImagePixelType; 
00065   
00066   void PrintSelf ( std::ostream& os, Indent indent ) const;
00067 
00068   
00070   void SetSeed ( const IndexType & seed );
00071   void AddSeed(const IndexType & seed);
00073 
00075   void ClearSeeds ();
00076 
00080   itkSetMacro(ReplaceValue, OutputImagePixelType);
00081   itkGetConstMacro(ReplaceValue, OutputImagePixelType);
00083 
00085   typedef SimpleDataObjectDecorator<InputImagePixelType> InputPixelObjectType;
00086 
00088   virtual void SetUpper( InputImagePixelType );
00089   virtual void SetLower( InputImagePixelType );
00091 
00093   virtual void SetUpperInput( const InputPixelObjectType *);
00094   virtual void SetLowerInput( const InputPixelObjectType *);
00096 
00098   virtual InputImagePixelType GetUpper() const;
00099   virtual InputImagePixelType GetLower() const;
00101 
00103   virtual InputPixelObjectType * GetUpperInput();
00104   virtual InputPixelObjectType * GetLowerInput();
00106 
00108   itkStaticConstMacro(InputImageDimension, unsigned int,
00109                       TInputImage::ImageDimension);
00110   itkStaticConstMacro(OutputImageDimension, unsigned int,
00111                       TOutputImage::ImageDimension);
00113 
00114 #ifdef ITK_USE_CONCEPT_CHECKING
00115 
00116   itkConceptMacro(OutputEqualityComparableCheck,
00117     (Concept::EqualityComparable<OutputImagePixelType>));
00118   itkConceptMacro(InputEqualityComparableCheck,
00119     (Concept::EqualityComparable<InputImagePixelType>));
00120   itkConceptMacro(InputConvertibleToOutputCheck,
00121     (Concept::Convertible<InputImagePixelType, OutputImagePixelType>));
00122   itkConceptMacro(SameDimensionCheck,
00123     (Concept::SameDimension<InputImageDimension, OutputImageDimension>));
00124   itkConceptMacro(IntConvertibleToInputCheck,
00125     (Concept::Convertible<int, InputImagePixelType>));
00126   itkConceptMacro(OutputOStreamWritableCheck,
00127     (Concept::OStreamWritable<OutputImagePixelType>));
00128 
00130 #endif
00131 
00135   typedef enum { FaceConnectivity, FullConnectivity } ConnectivityEnumType;
00136 
00137 #ifdef ITK_USE_REVIEW
00138 
00140   itkSetEnumMacro( Connectivity, ConnectivityEnumType );
00141   itkGetEnumMacro( Connectivity, ConnectivityEnumType );
00142 #endif
00143 
00144 
00145 protected:
00146   ConnectedThresholdImageFilter();
00147   ~ConnectedThresholdImageFilter(){};
00148   std::vector<IndexType> m_SeedList;
00149   InputImagePixelType    m_Lower;
00150   InputImagePixelType    m_Upper;
00151   OutputImagePixelType   m_ReplaceValue;
00152   
00153   // Override since the filter needs all the data for the algorithm
00154   void GenerateInputRequestedRegion();
00155 
00156   // Override since the filter produces the entire dataset
00157   void EnlargeOutputRequestedRegion(DataObject *output);
00158 
00159   void GenerateData();
00160 
00161   // Type of connectivity to use.
00162   ConnectivityEnumType m_Connectivity;
00163   
00164 private:
00165   ConnectedThresholdImageFilter(const Self&); //purposely not implemented
00166   void operator=(const Self&); //purposely not implemented
00167 
00168 };
00169 
00170 } // end namespace itk
00171 
00172 #ifndef ITK_MANUAL_INSTANTIATION
00173 #include "itkConnectedThresholdImageFilter.txx"
00174 #endif
00175 
00176 #endif
00177 

Generated at Tue Sep 15 02:38:30 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000