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

itkThresholdImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkThresholdImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-04-25 12:28:11 $
00007   Version:   $Revision: 1.24 $
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   Portions of this code are covered under the VTK copyright.
00013   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
00014 
00015      This software is distributed WITHOUT ANY WARRANTY; without even 
00016      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00017      PURPOSE.  See the above copyright notices for more information.
00018 
00019 =========================================================================*/
00020 #ifndef __itkThresholdImageFilter_h
00021 #define __itkThresholdImageFilter_h
00022 
00023 #include "itkInPlaceImageFilter.h"
00024 
00025 #include "itkConceptChecking.h"
00026 
00027 namespace itk
00028 {
00029 
00042 template <class TImage>
00043 class ITK_EXPORT ThresholdImageFilter : public InPlaceImageFilter<TImage,TImage>
00044 {
00045 public:
00047   typedef ThresholdImageFilter               Self;
00048   typedef InPlaceImageFilter<TImage,TImage>  Superclass;
00049   typedef SmartPointer<Self>                 Pointer;
00050   typedef SmartPointer<const Self>           ConstPointer;
00051 
00053   itkNewMacro(Self);  
00054 
00056   itkTypeMacro(ThresholdImageFilter, InPlaceImageFilter);
00057 
00059   typedef typename TImage::PixelType PixelType;
00060 
00062 #ifdef ITK_USE_CONCEPT_CHECKING
00063 
00065   itkConceptMacro(PixelTypeComparableCheck,
00066                   (Concept::Comparable<PixelType>));
00067   itkConceptMacro(PixelTypeOStreamWritableCheck,
00068                   (Concept::OStreamWritable<PixelType>));
00069 
00071 #endif
00072 
00075   itkSetMacro(OutsideValue,PixelType);
00076 
00078   itkGetConstMacro(OutsideValue,PixelType);
00079 
00081   void ThresholdAbove(const PixelType &thresh);
00082 
00084   void ThresholdBelow(const PixelType &thresh);
00085 
00087   void ThresholdOutside(const PixelType &lower, const PixelType &upper);
00088 
00090   itkSetMacro(Lower, PixelType);
00091   itkGetConstMacro(Lower, PixelType);
00093 
00095   itkSetMacro(Upper, PixelType);
00096   itkGetConstMacro(Upper, PixelType);
00098 
00100   typedef TImage                                InputImageType;
00101   typedef typename InputImageType::ConstPointer InputImagePointer;
00102   typedef typename InputImageType::RegionType   InputImageRegionType;
00103   typedef typename InputImageType::PixelType    InputImagePixelType;
00104 
00106   typedef TImage                                OutputImageType;
00107   typedef typename OutputImageType::Pointer     OutputImagePointer;
00108   typedef typename OutputImageType::RegionType  OutputImageRegionType;
00109   typedef typename OutputImageType::PixelType   OutputImagePixelType;
00110 
00111 protected:
00112   ThresholdImageFilter();
00113   ~ThresholdImageFilter() {};
00114   void PrintSelf(std::ostream& os, Indent indent) const;
00115 
00126   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00127                             int threadId );
00128 
00129 private:
00130   ThresholdImageFilter(const Self&); //purposely not implemented
00131   void operator=(const Self&); //purposely not implemented
00132 
00133   PixelType m_OutsideValue;
00134   PixelType m_Lower;
00135   PixelType m_Upper;
00136 };
00137 
00138   
00139 } // end namespace itk
00140   
00141 #ifndef ITK_MANUAL_INSTANTIATION
00142 #include "itkThresholdImageFilter.txx"
00143 #endif
00144   
00145 #endif
00146 

Generated at Tue Sep 15 05:08:27 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000