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

itkMinimumMaximumImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMinimumMaximumImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-10-16 19:33:41 $
00007   Version:   $Revision: 1.13 $
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 __itkMinimumMaximumImageFilter_h
00018 #define __itkMinimumMaximumImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkSimpleDataObjectDecorator.h"
00022 
00023 #include <vector>
00024 
00025 #include "itkNumericTraits.h"
00026 
00027 namespace itk
00028 {
00041 template <class TInputImage>
00042 class ITK_EXPORT MinimumMaximumImageFilter :
00043     public ImageToImageFilter< TInputImage, TInputImage>
00044 {
00045 public:
00047   itkStaticConstMacro(InputImageDimension, unsigned int,
00048                       TInputImage::ImageDimension);
00049   itkStaticConstMacro(OutputImageDimension, unsigned int,
00050                       TInputImage::ImageDimension);
00052 
00054   typedef MinimumMaximumImageFilter                     Self;
00055   typedef ImageToImageFilter< TInputImage, TInputImage> Superclass;
00056   typedef SmartPointer<Self>                            Pointer;
00057   typedef SmartPointer<const Self>                      ConstPointer;
00058 
00060   typedef typename TInputImage::Pointer InputImagePointer;
00061 
00062   typedef typename TInputImage::RegionType RegionType;
00063   typedef typename TInputImage::SizeType   SizeType;
00064   typedef typename TInputImage::IndexType  IndexType;
00065   typedef typename TInputImage::PixelType  PixelType;
00066 
00068   typedef typename DataObject::Pointer DataObjectPointer;
00069 
00071   itkNewMacro(Self);
00072 
00074   itkTypeMacro(MinimumMaximumImageFilter, ImageToImageFilter);
00075 
00077   typedef TInputImage InputImageType;
00078 
00080   typedef SimpleDataObjectDecorator<PixelType> PixelObjectType;
00081 
00083   PixelType GetMinimum() const
00084     { return this->GetMinimumOutput()->Get(); }
00085   PixelObjectType* GetMinimumOutput();
00086   const PixelObjectType* GetMinimumOutput() const;
00088 
00090   PixelType GetMaximum() const
00091     { return this->GetMaximumOutput()->Get(); }
00092   PixelObjectType* GetMaximumOutput();
00093   const PixelObjectType* GetMaximumOutput() const;
00095 
00098   virtual DataObjectPointer MakeOutput(unsigned int idx);
00099 
00100 #ifdef ITK_USE_CONCEPT_CHECKING
00101 
00102   itkConceptMacro(LessThanComparableCheck,
00103                   (Concept::LessThanComparable<PixelType>));
00104   itkConceptMacro(GreaterThanComparableCheck,
00105                   (Concept::GreaterThanComparable<PixelType>));
00106   itkConceptMacro(OStreamWritableCheck,
00107                   (Concept::OStreamWritable<PixelType>));
00108 
00110 #endif
00111 
00112 protected:
00113   MinimumMaximumImageFilter();
00114   virtual ~MinimumMaximumImageFilter() {}
00115   void PrintSelf(std::ostream& os, Indent indent) const;
00116 
00118   void AllocateOutputs();
00119 
00121   void BeforeThreadedGenerateData ();
00122 
00124   void AfterThreadedGenerateData ();
00125 
00127   void  ThreadedGenerateData (const RegionType& 
00128                               outputRegionForThread,
00129                               int threadId);
00130 
00131   // Override since the filter needs all the data for the algorithm
00132   void GenerateInputRequestedRegion();
00133 
00134   // Override since the filter produces all of its output
00135   void EnlargeOutputRequestedRegion(DataObject *data);
00136 
00137 private:
00138   MinimumMaximumImageFilter(const Self&); //purposely not implemented
00139   void operator=(const Self&); //purposely not implemented
00140   
00141   std::vector<PixelType> m_ThreadMin;
00142   std::vector<PixelType> m_ThreadMax;
00143 };
00144   
00145 } // end namespace itk
00146 
00147 #ifndef ITK_MANUAL_INSTANTIATION
00148 #include "itkMinimumMaximumImageFilter.txx"
00149 #endif
00150 
00151 #endif
00152 

Generated at Wed Nov 5 22:53:15 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000