ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkMinimumMaximumImageCalculator.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 __itkMinimumMaximumImageCalculator_h
00019 #define __itkMinimumMaximumImageCalculator_h
00020 
00021 #include "itkObject.h"
00022 #include "itkObjectFactory.h"
00023 
00024 namespace itk
00025 {
00043 template< class TInputImage >
00044 class ITK_EXPORT MinimumMaximumImageCalculator:public Object
00045 {
00046 public:
00048   typedef MinimumMaximumImageCalculator Self;
00049   typedef Object                        Superclass;
00050   typedef SmartPointer< Self >          Pointer;
00051   typedef SmartPointer< const Self >    ConstPointer;
00052 
00054   itkNewMacro(Self);
00055 
00057   itkTypeMacro(MinimumMaximumImageCalculator, Object);
00058 
00060   typedef TInputImage ImageType;
00061 
00063   typedef typename TInputImage::Pointer ImagePointer;
00064 
00066   typedef typename TInputImage::ConstPointer ImageConstPointer;
00067 
00069   typedef typename TInputImage::PixelType PixelType;
00070 
00072   typedef typename TInputImage::IndexType IndexType;
00073 
00075   typedef typename TInputImage::RegionType RegionType;
00076 
00078   itkSetConstObjectMacro(Image, ImageType);
00079 
00081   void ComputeMinimum(void);
00082 
00084   void ComputeMaximum(void);
00085 
00087   void Compute(void);
00088 
00090   itkGetConstMacro(Minimum, PixelType);
00091 
00093   itkGetConstMacro(Maximum, PixelType);
00094 
00096   itkGetConstReferenceMacro(IndexOfMinimum, IndexType);
00097 
00099   itkGetConstReferenceMacro(IndexOfMaximum, IndexType);
00100 
00102   void SetRegion(const RegionType & region);
00103 
00104 protected:
00105   MinimumMaximumImageCalculator();
00106   virtual ~MinimumMaximumImageCalculator() {}
00107   void PrintSelf(std::ostream & os, Indent indent) const;
00108 
00109 private:
00110   MinimumMaximumImageCalculator(const Self &); //purposely not implemented
00111   void operator=(const Self &);                //purposely not implemented
00112 
00113   PixelType         m_Minimum;
00114   PixelType         m_Maximum;
00115   ImageConstPointer m_Image;
00116 
00117   IndexType m_IndexOfMinimum;
00118   IndexType m_IndexOfMaximum;
00119 
00120   RegionType m_Region;
00121   bool       m_RegionSetByUser;
00122 };
00123 } // end namespace itk
00124 
00125 #ifndef ITK_MANUAL_INSTANTIATION
00126 #include "itkMinimumMaximumImageCalculator.hxx"
00127 #endif
00128 
00129 #endif /* __itkMinimumMaximumImageCalculator_h */
00130