Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitkMinMaxImageFilterWithIndex.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkMinMaxImageFilterWithIndex_h
14 #define mitkMinMaxImageFilterWithIndex_h
15 
17 
18 #include <itkImage.h>
19 #include <itkImageToImageFilter.h>
20 #include <itkImageRegionConstIteratorWithIndex.h>
21 
22 
23 
24 namespace itk
25 {
26 template <typename TInputImage>
27 class MinMaxImageFilterWithIndex: public itk::ImageToImageFilter<TInputImage, TInputImage>
28 {
29 public:
32  typedef ImageToImageFilter< TInputImage, TInputImage > Superclass;
35 
37  itkNewMacro(Self);
38 
40  itkTypeMacro(MinMaxImageFilterWithIndex, ImageToImageFilter);
41 
42  typedef typename TInputImage::RegionType RegionType;
43  typedef typename TInputImage::SizeType SizeType;
44  typedef typename TInputImage::IndexType IndexType;
45  typedef typename TInputImage::PixelType PixelType;
46  typedef typename NumericTraits< PixelType >::RealType RealType;
47 
48 
49  RealType GetMin() const
50  {
51  return m_Min;
52  }
53 
54  RealType GetMax() const
55  {
56  return m_Max;
57  }
58 
60  {
61  return m_MinIndex;
62  }
63 
65  {
66  return m_MaxIndex;
67  }
68 
69 protected:
71  {
72  this->DynamicMultiThreadingOff();
73  }
74 
75  void AllocateOutputs() override;
76 
77  void ThreadedGenerateData(const RegionType &
78  outputRegionForThread,
79  ThreadIdType threadId) override;
80 
81  void BeforeThreadedGenerateData() override;
82 
83  void AfterThreadedGenerateData() override;
84 
85 private:
86  std::vector<PixelType> m_ThreadMin;
87  std::vector<PixelType> m_ThreadMax;
88  std::vector<IndexType> m_ThreadMinIndex;
89  std::vector<IndexType> m_ThreadMaxIndex;
90 
91  PixelType m_Min;
92  PixelType m_Max;
93  IndexType m_MinIndex;
94  IndexType m_MaxIndex;
95 };
96 }
97 
98 #include "mitkMinMaxImageFilterWithIndex.hxx"
99 
100 
101 #endif
itk::MinMaxImageFilterWithIndex::ThreadedGenerateData
void ThreadedGenerateData(const RegionType &outputRegionForThread, ThreadIdType threadId) override
itk::MinMaxImageFilterWithIndex::RealType
NumericTraits< PixelType >::RealType RealType
Definition: mitkMinMaxImageFilterWithIndex.h:46
itk::MinMaxImageFilterWithIndex::GetMin
RealType GetMin() const
Definition: mitkMinMaxImageFilterWithIndex.h:49
itk::MinMaxImageFilterWithIndex::Self
MinMaxImageFilterWithIndex Self
Definition: mitkMinMaxImageFilterWithIndex.h:31
itk::MinMaxImageFilterWithIndex::GetMinIndex
IndexType GetMinIndex() const
Definition: mitkMinMaxImageFilterWithIndex.h:59
itk::MinMaxImageFilterWithIndex::AfterThreadedGenerateData
void AfterThreadedGenerateData() override
itk::MinMaxImageFilterWithIndex
Definition: mitkMinMaxImageFilterWithIndex.h:27
itk::MinMaxImageFilterWithIndex::AllocateOutputs
void AllocateOutputs() override
itk::MinMaxImageFilterWithIndex::SizeType
TInputImage::SizeType SizeType
Definition: mitkMinMaxImageFilterWithIndex.h:43
itk::SmartPointer< Self >
itk::MinMaxImageFilterWithIndex::PixelType
TInputImage::PixelType PixelType
Definition: mitkMinMaxImageFilterWithIndex.h:45
itk::MinMaxImageFilterWithIndex::GetMaxIndex
IndexType GetMaxIndex() const
Definition: mitkMinMaxImageFilterWithIndex.h:64
itk::MinMaxImageFilterWithIndex::Pointer
SmartPointer< Self > Pointer
Definition: mitkMinMaxImageFilterWithIndex.h:33
itk::MinMaxImageFilterWithIndex::Superclass
ImageToImageFilter< TInputImage, TInputImage > Superclass
Definition: mitkMinMaxImageFilterWithIndex.h:32
itk::MinMaxImageFilterWithIndex::IndexType
TInputImage::IndexType IndexType
Definition: mitkMinMaxImageFilterWithIndex.h:44
itk::MinMaxImageFilterWithIndex::MinMaxImageFilterWithIndex
MinMaxImageFilterWithIndex()
Definition: mitkMinMaxImageFilterWithIndex.h:70
itk::MinMaxImageFilterWithIndex::GetMax
RealType GetMax() const
Definition: mitkMinMaxImageFilterWithIndex.h:54
itk
SET FUNCTIONS.
Definition: itkIntelligentBinaryClosingFilter.h:30
itk::MinMaxImageFilterWithIndex::RegionType
TInputImage::RegionType RegionType
Definition: mitkMinMaxImageFilterWithIndex.h:40
MitkImageStatisticsExports.h
itk::MinMaxImageFilterWithIndex::ConstPointer
SmartPointer< const Self > ConstPointer
Definition: mitkMinMaxImageFilterWithIndex.h:34
itk::MinMaxImageFilterWithIndex::BeforeThreadedGenerateData
void BeforeThreadedGenerateData() override