00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkThresholdImageFilter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2002/04/29 01:13:15 $ 00007 Version: $Revision: 1.16 $ 00008 00009 Copyright (c) 2002 Insight 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 "itkImageToImageFilter.h" 00024 00025 #include "itkConceptChecking.h" 00026 00027 namespace itk 00028 { 00029 00042 template <class TImage> 00043 class ITK_EXPORT ThresholdImageFilter:public ImageToImageFilter<TImage,TImage> 00044 { 00045 public: 00047 typedef ThresholdImageFilter Self; 00048 typedef ImageToImageFilter<TImage,TImage> Superclass; 00049 typedef SmartPointer<Self> Pointer; 00050 typedef SmartPointer<const Self> ConstPointer; 00051 00053 itkNewMacro(Self); 00054 00056 itkTypeMacro(ThresholdImageFilter, ImageToImageFilter); 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 typedef TImage InputImageType; 00082 typedef typename InputImageType::ConstPointer InputImagePointer; 00083 typedef typename InputImageType::RegionType InputImageRegionType; 00084 typedef typename InputImageType::PixelType InputImagePixelType; 00085 00087 typedef TImage OutputImageType; 00088 typedef typename OutputImageType::Pointer OutputImagePointer; 00089 typedef typename OutputImageType::RegionType OutputImageRegionType; 00090 typedef typename OutputImageType::PixelType OutputImagePixelType; 00091 00092 protected: 00093 ThresholdImageFilter(); 00094 ~ThresholdImageFilter() {}; 00095 void PrintSelf(std::ostream& os, Indent indent) const; 00096 00107 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, 00108 int threadId ); 00109 00110 private: 00111 ThresholdImageFilter(const Self&); //purposely not implemented 00112 void operator=(const Self&); //purposely not implemented 00113 00114 PixelType m_OutsideValue; 00115 PixelType m_Lower; 00116 PixelType m_Upper; 00117 }; 00118 00119 00120 } // end namespace itk 00121 00122 #ifndef ITK_MANUAL_INSTANTIATION 00123 #include "itkThresholdImageFilter.txx" 00124 #endif 00125 00126 #endif