00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkMaximumProjectionImageFilter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2009-01-28 18:14:36 $ 00007 Version: $Revision: 1.2 $ 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 __itkMaximumProjectionImageFilter_h 00018 #define __itkMaximumProjectionImageFilter_h 00019 00020 #include "itkProjectionImageFilter.h" 00021 #include "itkNumericTraits.h" 00022 #include "itkConceptChecking.h" 00023 00024 namespace itk { 00045 namespace Function { 00046 template <class TInputPixel> 00047 class MaximumAccumulator 00048 { 00049 public: 00050 MaximumAccumulator( unsigned long ) {} 00051 ~MaximumAccumulator(){} 00052 00053 inline void Initialize() 00054 { 00055 m_Maximum = NumericTraits< TInputPixel >::NonpositiveMin(); 00056 } 00057 00058 inline void operator()( const TInputPixel &input ) 00059 { 00060 m_Maximum = vnl_math_max( m_Maximum, input ); 00061 } 00062 00063 inline TInputPixel GetValue() 00064 { 00065 return m_Maximum; 00066 } 00067 00068 TInputPixel m_Maximum; 00069 }; 00070 } // end namespace Function 00071 00072 00073 template <class TInputImage, class TOutputImage> 00074 class ITK_EXPORT MaximumProjectionImageFilter : 00075 public ProjectionImageFilter<TInputImage, TOutputImage, 00076 Function::MaximumAccumulator< typename TInputImage::PixelType > > 00077 { 00078 public: 00079 typedef MaximumProjectionImageFilter Self; 00080 typedef ProjectionImageFilter<TInputImage, TOutputImage, 00081 Function::MaximumAccumulator< typename TInputImage::PixelType > > Superclass; 00082 00083 typedef TInputImage InputImageType; 00084 typedef typename InputImageType::PixelType InputPixelType; 00085 00086 typedef SmartPointer<Self> Pointer; 00087 typedef SmartPointer<const Self> ConstPointer; 00088 00090 itkTypeMacro(MaximumProjectionImageFilter, ProjectionImageFilter); 00091 00093 itkNewMacro(Self); 00094 00095 #ifdef ITK_USE_CONCEPT_CHECKING 00096 00097 itkConceptMacro(InputPixelTypeGreaterThanComparable, 00098 (Concept::GreaterThanComparable<InputPixelType>)); 00099 itkConceptMacro(InputHasNumericTraitsCheck, 00100 (Concept::HasNumericTraits<InputPixelType>)); 00101 00103 #endif 00104 00105 00106 protected: 00107 MaximumProjectionImageFilter() {} 00108 virtual ~MaximumProjectionImageFilter() {} 00109 00110 private: 00111 MaximumProjectionImageFilter(const Self&); //purposely not implemented 00112 void operator=(const Self&); //purposely not implemented 00113 00114 00115 }; // end MaximumProjectionImageFilter 00116 00117 } //end namespace itk 00118 00119 #endif 00120