Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkMinMaxImageFilterWithIndex.h
Go to the documentation of this file.
1 #ifndef MITK_MINMAXIMAGEFILTERWITHINDEX_H
2 #define MITK_MINMAXIMAGEFILTERWITHINDEX_H
3 
5 
6 #include <itkImage.h>
7 #include <itkImageToImageFilter.h>
8 #include <itkImageRegionConstIteratorWithIndex.h>
9 
10 
11 
12 namespace itk
13 {
14 template <typename TInputImage>
15 class MinMaxImageFilterWithIndex: public itk::ImageToImageFilter<TInputImage, TInputImage>
16 {
17 public:
20  typedef ImageToImageFilter< TInputImage, TInputImage > Superclass;
23 
25  itkNewMacro(Self);
26 
28  itkTypeMacro(MinMaxImageFilterWithIndex, ImageToImageFilter);
29 
30  typedef typename TInputImage::RegionType RegionType;
31  typedef typename TInputImage::SizeType SizeType;
32  typedef typename TInputImage::IndexType IndexType;
34  typedef typename NumericTraits< PixelType >::RealType RealType;
35 
36 
37  RealType GetMin() const
38  {
39  return m_Min;
40  }
41 
42  RealType GetMax() const
43  {
44  return m_Max;
45  }
46 
47  IndexType GetMinIndex() const
48  {
49  return m_MinIndex;
50  }
51 
52  IndexType GetMaxIndex() const
53  {
54  return m_MaxIndex;
55  }
56 
57 protected:
58  void AllocateOutputs();
59 
60  void ThreadedGenerateData(const RegionType &
61  outputRegionForThread,
62  ThreadIdType threadId);
63 
65 
67 
68 private:
69  std::vector<PixelType> m_ThreadMin;
70  std::vector<PixelType> m_ThreadMax;
71  std::vector<IndexType> m_ThreadMinIndex;
72  std::vector<IndexType> m_ThreadMaxIndex;
73 
74  PixelType m_Min;
75  PixelType m_Max;
76  IndexType m_MinIndex;
77  IndexType m_MaxIndex;
78 };
79 }
80 
81 #include "mitkMinMaxImageFilterWithIndex.hxx"
82 
83 
84 #endif
NumericTraits< PixelType >::RealType RealType
void ThreadedGenerateData(const RegionType &outputRegionForThread, ThreadIdType threadId)
ImageToImageFilter< TInputImage, TInputImage > Superclass
unsigned short PixelType