ITK  5.2.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  * http://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 
23 namespace itk
24 {
25 namespace Functor
26 {
32 template <typename TInput1, typename TInput2 = TInput1, typename TOutput = TInput1>
33 class Minimum
34 {
35 public:
36  Minimum() = default;
37  ~Minimum() = default;
38  bool
39  operator!=(const Minimum &) const
40  {
41  return false;
42  }
44 
45  bool
46  operator==(const Minimum & other) const
47  {
48  return !(*this != other);
49  }
50 
51  inline TOutput
52  operator()(const TInput1 & A, const TInput2 & B) const
53  {
54  return static_cast<TOutput>((A < B) ? A : B);
55  }
56 };
57 } // namespace Functor
58 
77 template <typename TInputImage1, typename TInputImage2 = TInputImage1, typename TOutputImage = TInputImage1>
78 class MinimumImageFilter : public BinaryGeneratorImageFilter<TInputImage1, TInputImage2, TOutputImage>
79 {
80 public:
81  ITK_DISALLOW_COPY_AND_MOVE(MinimumImageFilter);
82 
86 
89  using FunctorType = Functor::
90  Minimum<typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType>;
91 
93  itkNewMacro(Self);
94 
97 
98 #ifdef ITK_USE_CONCEPT_CHECKING
99  // Begin concept checking
100  itkConceptMacro(Input1ConvertibleToInput2Check,
102  itkConceptMacro(Input2ConvertibleToOutputCheck,
104  itkConceptMacro(Input1LessThanInput2Check,
106  // End concept checking
107 #endif
108 
109 protected:
111  {
112 #if !defined(ITK_WRAPPING_PARSER)
114 #endif
115  }
116 
117  ~MinimumImageFilter() override = default;
118 };
119 } // end namespace itk
120 
121 #endif
itk::Functor::Minimum::~Minimum
~Minimum()=default
itk::Functor::Minimum::Minimum
Minimum()=default
itk::MinimumImageFilter::FunctorType
Functor::Minimum< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType > FunctorType
Definition: itkMinimumImageFilter.h:90
itk::BinaryGeneratorImageFilter
Implements pixel-wise generic operation of two images, or of an image and a constant.
Definition: itkBinaryGeneratorImageFilter.h:56
itk::SmartPointer< Self >
itk::Functor::Minimum::operator==
bool operator==(const Minimum &other) const
Definition: itkMinimumImageFilter.h:46
itkBinaryGeneratorImageFilter.h
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::Functor::Minimum
Definition: itkMinimumImageFilter.h:33
itk::MinimumImageFilter::MinimumImageFilter
MinimumImageFilter()
Definition: itkMinimumImageFilter.h:110
itk::MinimumImageFilter
Implements a pixel-wise operator Min(a,b) between two images.
Definition: itkMinimumImageFilter.h:78
itk::Functor::Minimum::operator!=
bool operator!=(const Minimum &) const
Definition: itkMinimumImageFilter.h:39
itk::MinimumImageFilter::~MinimumImageFilter
~MinimumImageFilter() override=default
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::Concept::Convertible
Definition: itkConceptChecking.h:216
itk::Functor::Minimum::operator()
TOutput operator()(const TInput1 &A, const TInput2 &B) const
Definition: itkMinimumImageFilter.h:52
itk::Concept::LessThanComparable
Definition: itkConceptChecking.h:262
itk::BinaryGeneratorImageFilter::SetFunctor
void SetFunctor(const std::function< ConstRefFunctionType > &f)
Definition: itkBinaryGeneratorImageFilter.h:150