ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkNMinimaMaximaImageCalculator.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 itkNMinimaMaximaImageCalculator_h
19#define itkNMinimaMaximaImageCalculator_h
20
21#include "itkMacro.h"
22#include "itkObject.h"
23#include "itkObjectFactory.h"
24#include <mutex>
25#include <vector>
26
27namespace itk
28{
40template <typename TInputImage>
41class ITK_TEMPLATE_EXPORT NMinimaMaximaImageCalculator : public Object
42{
43public:
44 ITK_DISALLOW_COPY_AND_MOVE(NMinimaMaximaImageCalculator);
45
51
53 itkNewMacro(Self);
54
56 itkOverrideGetNameOfClassMacro(NMinimaMaximaImageCalculator);
57
59 using ImageType = TInputImage;
60
62 using ImagePointer = typename TInputImage::Pointer;
63
65 using ImageConstPointer = typename TInputImage::ConstPointer;
66
68 using PixelType = typename TInputImage::PixelType;
69
71 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
72 // constexpr unsigned ImageDimension = TInputImage::VImageDimension;
73
75 using IndexType = typename TInputImage::IndexType;
76
78 using RegionType = typename TInputImage::RegionType;
79
81 using ValueVector = std::vector<PixelType>;
82
84 using IndexVector = std::vector<IndexType>;
85
86
88 itkSetConstObjectMacro(Image, ImageType);
89
91 void
93
95 void
97
99 void
101
103 itkGetConstReferenceMacro(Minima, ValueVector);
104
106 itkGetConstReferenceMacro(Maxima, ValueVector);
107
109 itkGetConstReferenceMacro(IndicesOfMinima, IndexVector);
110
112 itkGetConstReferenceMacro(IndicesOfMaxima, IndexVector);
113
115 void
116 SetRegion(const RegionType & region);
117
119 itkGetConstMacro(N, SizeValueType);
121
122protected:
124 ~NMinimaMaximaImageCalculator() override = default;
125 void
126 PrintSelf(std::ostream & os, Indent indent) const override;
127
128 template <typename TComparator = std::less<PixelType>>
129 void
131 IndexVector & indices,
132 const PixelType & val,
133 const IndexType & ind,
134 TComparator comp = TComparator());
135 void
137
138private:
145
147 bool m_RegionSetByUser{ false };
148 bool m_ComputeMaxima{ true };
149 bool m_ComputeMinima{ true };
150 std::mutex m_Mutex;
151};
152} // end namespace itk
153
154#ifndef ITK_MANUAL_INSTANTIATION
155# include "itkNMinimaMaximaImageCalculator.hxx"
156#endif
157
158#endif /* itkNMinimaMaximaImageCalculator_h */
Templated n-dimensional image class.
Definition itkImage.h:89
Control indentation during Print() invocation.
Definition itkIndent.h:53
typename TInputImage::ConstPointer ImageConstPointer
void SortedInsert(ValueVector &vals, IndexVector &indices, const PixelType &val, const IndexType &ind, TComparator comp=TComparator())
void SetRegion(const RegionType &region)
typename TInputImage::RegionType RegionType
~NMinimaMaximaImageCalculator() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition itkIntTypes.h:82
#define itkSetMacro(name, type)