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: 2005/10/14 15:36:51 $
00007   Version:   $Revision: 1.19 $
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   itkConceptMacro(PixelTypeComparable, (Concept::Comparable<PixelType>));
00063   
00066   itkSetMacro(OutsideValue,PixelType);
00067   
00069   itkGetMacro(OutsideValue,PixelType);
00070                  
00072   void ThresholdAbove(const PixelType &thresh);
00073   
00075   void ThresholdBelow(const PixelType &thresh);
00076 
00078   void ThresholdOutside(const PixelType &lower, const PixelType &upper);
00079   
00081   itkSetMacro(Lower, PixelType);
00082   itkGetMacro(Lower, PixelType);
00083 
00085   itkSetMacro(Upper, PixelType);
00086   itkGetMacro(Upper, PixelType);
00087 
00089   typedef TImage InputImageType;
00090   typedef typename InputImageType::ConstPointer InputImagePointer;
00091   typedef typename InputImageType::RegionType   InputImageRegionType;
00092   typedef typename InputImageType::PixelType    InputImagePixelType;
00093 
00095   typedef TImage OutputImageType;
00096   typedef typename OutputImageType::Pointer OutputImagePointer;
00097   typedef typename OutputImageType::RegionType OutputImageRegionType;
00098   typedef typename OutputImageType::PixelType OutputImagePixelType;
00099 
00100 protected:
00101   ThresholdImageFilter();
00102   ~ThresholdImageFilter() {};
00103   void PrintSelf(std::ostream& os, Indent indent) const;
00104 
00115   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00116                             int threadId );
00117 
00118 private:
00119   ThresholdImageFilter(const Self&); //purposely not implemented
00120   void operator=(const Self&); //purposely not implemented
00121 
00122   PixelType m_OutsideValue;
00123   PixelType m_Lower;
00124   PixelType m_Upper;
00125 };
00126 
00127   
00128 } // end namespace itk
00129   
00130 #ifndef ITK_MANUAL_INSTANTIATION
00131 #include "itkThresholdImageFilter.txx"
00132 #endif
00133   
00134 #endif

Generated at Thu May 25 00:08:33 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000