00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00132 void GenerateInputRequestedRegion();
00133
00134
00135 void EnlargeOutputRequestedRegion(DataObject *data);
00136
00137 private:
00138 MinimumMaximumImageFilter(const Self&);
00139 void operator=(const Self&);
00140
00141 std::vector<PixelType> m_ThreadMin;
00142 std::vector<PixelType> m_ThreadMax;
00143 };
00144
00145 }
00146
00147 #ifndef ITK_MANUAL_INSTANTIATION
00148 #include "itkMinimumMaximumImageFilter.txx"
00149 #endif
00150
00151 #endif
00152