ITK  5.4.0
Insight Toolkit
itkMinimumImageFilter.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 itkMinimumImageFilter_h
19#define itkMinimumImageFilter_h
20
22
23namespace itk
24{
25namespace Functor
26{
32template <typename TInput1, typename TInput2 = TInput1, typename TOutput = TInput1>
34{
35public:
36 bool
37 operator==(const Minimum &) const
38 {
39 return true;
40 }
41
43
44 inline TOutput
45 operator()(const TInput1 & A, const TInput2 & B) const
46 {
47 return static_cast<TOutput>((A < B) ? A : B);
48 }
49};
50} // namespace Functor
51
70template <typename TInputImage1, typename TInputImage2 = TInputImage1, typename TOutputImage = TInputImage1>
71class ITK_TEMPLATE_EXPORT MinimumImageFilter
72 : public BinaryGeneratorImageFilter<TInputImage1, TInputImage2, TOutputImage>
73{
74public:
75 ITK_DISALLOW_COPY_AND_MOVE(MinimumImageFilter);
76
80
83 using FunctorType = Functor::
84 Minimum<typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType>;
85
87 itkNewMacro(Self);
88
90 itkOverrideGetNameOfClassMacro(MinimumImageFilter);
91
92#ifdef ITK_USE_CONCEPT_CHECKING
93 // Begin concept checking
94 itkConceptMacro(Input1ConvertibleToInput2Check,
96 itkConceptMacro(Input2ConvertibleToOutputCheck,
98 itkConceptMacro(Input1LessThanInput2Check,
100 // End concept checking
101#endif
102
103protected:
105 {
106#if !defined(ITK_WRAPPING_PARSER)
107 Superclass::SetFunctor(FunctorType());
108#endif
109 }
110
111 ~MinimumImageFilter() override = default;
112};
113} // end namespace itk
114
115#endif
Implements pixel-wise generic operation of two images, or of an image and a constant.
TOutput operator()(const TInput1 &A, const TInput2 &B) const
bool operator==(const Minimum &) const
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Minimum)
Light weight base class for most itk classes.
Implements a pixel-wise operator Min(a,b) between two images.
~MinimumImageFilter() override=default
Functor::Add2< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType > FunctorType
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....