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

itkIsolatedConnectedImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkIsolatedConnectedImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-04-21 12:29:36 $
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 __itkIsolatedConnectedImageFilter_h
00018 #define __itkIsolatedConnectedImageFilter_h
00019 
00020 #include "itkImage.h"
00021 #include "itkImageToImageFilter.h"
00022 
00023 namespace itk {
00024 
00069 template <class TInputImage, class TOutputImage>
00070 class ITK_EXPORT IsolatedConnectedImageFilter:
00071     public ImageToImageFilter<TInputImage,TOutputImage>
00072 {
00073 public:
00075   typedef IsolatedConnectedImageFilter                 Self;
00076   typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00077   typedef SmartPointer<Self>                           Pointer;
00078   typedef SmartPointer<const Self>                     ConstPointer;
00079 
00081   itkNewMacro(Self);
00082 
00084   itkTypeMacro(IsolatedConnectedImageFilter,
00085                ImageToImageFilter);
00086 
00087   typedef TInputImage                           InputImageType;
00088   typedef typename InputImageType::Pointer      InputImagePointer;
00089   typedef typename InputImageType::ConstPointer InputImageConstPointer;
00090   typedef typename InputImageType::RegionType   InputImageRegionType; 
00091   typedef typename InputImageType::PixelType    InputImagePixelType; 
00092   typedef typename InputImageType::IndexType    IndexType;
00093   typedef typename InputImageType::SizeType     SizeType;
00094   
00095   typedef TOutputImage                          OutputImageType;
00096   typedef typename OutputImageType::Pointer     OutputImagePointer;
00097   typedef typename OutputImageType::RegionType  OutputImageRegionType; 
00098   typedef typename OutputImageType::PixelType   OutputImagePixelType; 
00099 
00100   typedef std::vector< IndexType > SeedsContainerType;
00101 
00102   typedef typename NumericTraits< 
00103                 InputImagePixelType >::RealType InputRealType;
00104   
00105 
00106   void PrintSelf ( std::ostream& os, Indent indent ) const;
00107 
00111   void SetSeed1(const IndexType & seed);
00112 
00114   void ClearSeeds1();
00115 
00117   void AddSeed1(const IndexType & seed);
00118 
00121   void SetSeed2(const IndexType & seed);
00122 
00124   void ClearSeeds2();
00125 
00127   void AddSeed2(const IndexType & seed);
00128 
00131   itkSetMacro(Lower, InputImagePixelType);
00132   itkGetConstReferenceMacro(Lower, InputImagePixelType);
00134 
00137   itkSetMacro(Upper, InputImagePixelType);
00138   itkGetConstReferenceMacro(Upper, InputImagePixelType);
00140 
00144   void SetUpperValueLimit( InputImagePixelType upperValue)
00145     {
00146     this->SetUpper( upperValue );
00147     }
00148   InputImagePixelType GetUpperValueLimit()
00149     {
00150     return this->GetUpper();
00151     }
00153 
00156   itkSetMacro(IsolatedValueTolerance, InputImagePixelType);
00157   itkGetConstReferenceMacro(IsolatedValueTolerance, InputImagePixelType);
00159 
00163   itkSetMacro(ReplaceValue, OutputImagePixelType);
00164   itkGetConstReferenceMacro(ReplaceValue, OutputImagePixelType);
00166 
00168   itkGetConstReferenceMacro(IsolatedValue, InputImagePixelType);
00169 
00172   itkSetMacro(FindUpperThreshold,bool);
00173   itkBooleanMacro(FindUpperThreshold);
00174   itkGetConstReferenceMacro(FindUpperThreshold,bool);
00176 
00179   itkGetConstReferenceMacro(ThresholdingFailed, bool);
00180 
00181 #ifdef ITK_USE_CONCEPT_CHECKING
00182 
00183   itkConceptMacro(InputHasNumericTraitsCheck,
00184                   (Concept::HasNumericTraits<InputImagePixelType>));
00185 
00187 #endif
00188 
00189 protected:
00190   IsolatedConnectedImageFilter();
00191   ~IsolatedConnectedImageFilter(){};
00192   SeedsContainerType   m_Seeds1;
00193   SeedsContainerType   m_Seeds2;
00194   InputImagePixelType  m_Lower;
00195   InputImagePixelType  m_Upper;
00196   OutputImagePixelType m_ReplaceValue;
00197   InputImagePixelType  m_IsolatedValue;
00198   InputImagePixelType  m_IsolatedValueTolerance;
00199   bool                 m_FindUpperThreshold;
00200   bool                 m_ThresholdingFailed;
00201   
00202   // Override since the filter needs all the data for the algorithm
00203   void GenerateInputRequestedRegion();
00204 
00205   // Override since the filter produces the entire dataset
00206   void EnlargeOutputRequestedRegion(DataObject *output);
00207 
00208   void GenerateData();
00209   
00210 private:
00211   IsolatedConnectedImageFilter(const Self&); //purposely not implemented
00212   void operator=(const Self&); //purposely not implemented
00213 
00214 };
00215 
00216 } // end namespace itk
00217 
00218 #ifndef ITK_MANUAL_INSTANTIATION
00219 #include "itkIsolatedConnectedImageFilter.txx"
00220 #endif
00221 
00222 #endif
00223 

Generated at Fri Apr 16 18:47:47 2010 for ITK by doxygen 1.6.1 written by Dimitri van Heesch, © 1997-2000