ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkMinimumProjectionImageFilter.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 itkMinimumProjectionImageFilter_h
19#define itkMinimumProjectionImageFilter_h
20
22#include "itkConceptChecking.h"
23
24namespace itk
25{
44
45namespace Functor
46{
47template <typename TInputPixel>
49{
50public:
53
54 inline void
56 {
57 if constexpr (std::is_same<TInputPixel, typename NumericTraits<TInputPixel>::ValueType>::value)
58 {
60 }
61 else
62 {
63 m_Minimum = TInputPixel();
65 }
66 }
67
68 inline void
69 operator()(const TInputPixel & input)
70 {
71
72 if constexpr (std::is_same<TInputPixel, typename NumericTraits<TInputPixel>::ValueType>::value)
73 {
74 m_Minimum = std::min(m_Minimum, input);
75 }
76 else
77 {
79 {
80 m_Minimum = input;
81 }
82 else
83 {
84 for (unsigned int i = 0; i < itk::NumericTraits<TInputPixel>::GetLength(m_Minimum); ++i)
85 {
86 m_Minimum[i] = std::min(m_Minimum[i], input[i]);
87 }
88 }
89 }
90 }
91
92 inline TInputPixel
94 {
95 return m_Minimum;
96 }
97
98 TInputPixel m_Minimum;
99};
100} // namespace Functor
101
102template <typename TInputImage, typename TOutputImage>
104 : public ProjectionImageFilter<TInputImage,
105 TOutputImage,
106 Functor::MinimumAccumulator<typename TInputImage::PixelType>>
107{
108public:
109 ITK_DISALLOW_COPY_AND_MOVE(MinimumProjectionImageFilter);
110
114
115 using InputImageType = TInputImage;
116 using InputPixelType = typename InputImageType::PixelType;
117
120
122 itkOverrideGetNameOfClassMacro(MinimumProjectionImageFilter);
123
125 itkNewMacro(Self);
126
127 itkConceptMacro(InputPixelTypeGreaterThanComparable,
129 itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<InputPixelType>));
130
131protected:
133 ~MinimumProjectionImageFilter() override = default;
134}; // end
135 // MinimumProjectionImageFilter
136} // end namespace itk
137
138#endif
ProjectionImageFilter< TInputImage, TOutputImage, Functor::MinimumAccumulator< typename TInputImage::PixelType > > Superclass
~MinimumProjectionImageFilter() override=default
typename InputImageType::PixelType InputPixelType
static constexpr T max(const T &)
static unsigned int GetLength(const T &)
Implements transparent reference counting.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition itkIntTypes.h:86