ITK  6.0.0
Insight Toolkit
itkMinimumMaximumImageCalculator.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * https://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkMinimumMaximumImageCalculator_h
19 #define itkMinimumMaximumImageCalculator_h
20 
21 #include "itkNumericTraits.h"
22 #include "itkObject.h"
23 #include "itkObjectFactory.h"
24 
25 namespace itk
26 {
44 template <typename TInputImage>
45 class ITK_TEMPLATE_EXPORT MinimumMaximumImageCalculator : public Object
46 {
47 public:
48  ITK_DISALLOW_COPY_AND_MOVE(MinimumMaximumImageCalculator);
49 
52  using Superclass = Object;
55 
57  itkNewMacro(Self);
58 
60  itkOverrideGetNameOfClassMacro(MinimumMaximumImageCalculator);
61 
63  using ImageType = TInputImage;
64 
67 
70 
72  using PixelType = typename TInputImage::PixelType;
73 
76 
79 
81  itkSetConstObjectMacro(Image, ImageType);
82 
84  void
85  ComputeMinimum();
86 
88  void
89  ComputeMaximum();
90 
92  void
93  Compute();
94 
96  itkGetConstMacro(Minimum, PixelType);
97 
99  itkGetConstMacro(Maximum, PixelType);
100 
102  itkGetConstReferenceMacro(IndexOfMinimum, IndexType);
103 
105  itkGetConstReferenceMacro(IndexOfMaximum, IndexType);
106 
108  void
109  SetRegion(const RegionType & region);
110 
111 protected:
112  MinimumMaximumImageCalculator() = default;
113  ~MinimumMaximumImageCalculator() override = default;
114  void
115  PrintSelf(std::ostream & os, Indent indent) const override;
116 
117 private:
121 
122  IndexType m_IndexOfMinimum{};
123  IndexType m_IndexOfMaximum{};
124 
125  RegionType m_Region{};
126  bool m_RegionSetByUser{};
127 };
128 } // end namespace itk
129 
130 #ifndef ITK_MANUAL_INSTANTIATION
131 # include "itkMinimumMaximumImageCalculator.hxx"
132 #endif
133 
134 #endif /* itkMinimumMaximumImageCalculator_h */
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itkObjectFactory.h
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::MinimumMaximumImageCalculator
Computes the minimum and the maximum intensity values of an image.
Definition: itkMinimumMaximumImageCalculator.h:45
itk::NumericTraits::NonpositiveMin
static constexpr T NonpositiveMin()
Definition: itkNumericTraits.h:99
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::MinimumMaximumImageCalculator::ImageConstPointer
typename TInputImage::ConstPointer ImageConstPointer
Definition: itkMinimumMaximumImageCalculator.h:69
itk::MinimumMaximumImageCalculator::ImageType
TInputImage ImageType
Definition: itkMinimumMaximumImageCalculator.h:63
itk::NumericTraits::max
static constexpr T max(const T &)
Definition: itkNumericTraits.h:169
itkObject.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::MinimumMaximumImageCalculator::ImagePointer
typename TInputImage::Pointer ImagePointer
Definition: itkMinimumMaximumImageCalculator.h:66
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:61
itkNumericTraits.h
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
New
static Pointer New()
itk::MinimumMaximumImageCalculator::PixelType
typename TInputImage::PixelType PixelType
Definition: itkMinimumMaximumImageCalculator.h:72
itk::MinimumMaximumImageCalculator::RegionType
typename TInputImage::RegionType RegionType
Definition: itkMinimumMaximumImageCalculator.h:78
itk::MinimumMaximumImageCalculator::IndexType
typename TInputImage::IndexType IndexType
Definition: itkMinimumMaximumImageCalculator.h:75