ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkMaximumProjectionImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkMaximumProjectionImageFilter_h
00019 #define __itkMaximumProjectionImageFilter_h
00020 
00021 #include "itkProjectionImageFilter.h"
00022 #include "itkConceptChecking.h"
00023 
00024 namespace itk
00025 {
00046 namespace Functor
00047 {
00048 template< class TInputPixel >
00049 class MaximumAccumulator
00050 {
00051 public:
00052   MaximumAccumulator( SizeValueType ) {}
00053   ~MaximumAccumulator(){}
00054 
00055   inline void Initialize()
00056   {
00057     m_Maximum = NumericTraits< TInputPixel >::NonpositiveMin();
00058   }
00059 
00060   inline void operator()(const TInputPixel & input)
00061   {
00062     m_Maximum = vnl_math_max(m_Maximum, input);
00063   }
00064 
00065   inline TInputPixel GetValue()
00066   {
00067     return m_Maximum;
00068   }
00069 
00070   TInputPixel m_Maximum;
00071 };
00072 } // end namespace Function
00073 
00074 template< class TInputImage, class TOutputImage >
00075 class ITK_EXPORT MaximumProjectionImageFilter:
00076   public ProjectionImageFilter< TInputImage, TOutputImage,
00077                                 Functor::MaximumAccumulator< typename TInputImage::PixelType > >
00078 {
00079 public:
00080   typedef MaximumProjectionImageFilter Self;
00081   typedef ProjectionImageFilter< TInputImage, TOutputImage,
00082                                  Functor::MaximumAccumulator< typename TInputImage::PixelType > > Superclass;
00083 
00084   typedef TInputImage                        InputImageType;
00085   typedef typename InputImageType::PixelType InputPixelType;
00086 
00087   typedef SmartPointer< Self >       Pointer;
00088   typedef SmartPointer< const Self > ConstPointer;
00089 
00091   itkTypeMacro(MaximumProjectionImageFilter, ProjectionImageFilter);
00092 
00094   itkNewMacro(Self);
00095 
00096 #ifdef ITK_USE_CONCEPT_CHECKING
00097 
00098   itkConceptMacro( InputPixelTypeGreaterThanComparable,
00099                    ( Concept::GreaterThanComparable< InputPixelType > ) );
00100   itkConceptMacro( InputHasNumericTraitsCheck,
00101                    ( Concept::HasNumericTraits< InputPixelType > ) );
00102 
00104 #endif
00105 protected:
00106   MaximumProjectionImageFilter() {}
00107   virtual ~MaximumProjectionImageFilter() {}
00108 private:
00109   MaximumProjectionImageFilter(const Self &); //purposely not implemented
00110   void operator=(const Self &);               //purposely not implemented
00111 };                                            // end
00112                                               // MaximumProjectionImageFilter
00113 } //end namespace itk
00115 
00116 #endif
00117