ITK  5.3.0
Insight Toolkit
itkNaryMaximumImageFilter.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 itkNaryMaximumImageFilter_h
19 #define itkNaryMaximumImageFilter_h
20 
22 #include "itkNumericTraits.h"
23 
24 namespace itk
25 {
26 namespace Functor
27 {
33 template <typename TInput, typename TOutput>
34 class Maximum1
35 {
36 public:
38  // not sure if this type alias really makes things more clear... could just use
39  // TOutput?
40 
41  Maximum1() = default;
42  ~Maximum1() = default;
43  inline TOutput
44  operator()(const std::vector<TInput> & B) const
45  {
47 
48  for (unsigned int i = 0; i < B.size(); ++i)
49  {
50  if (A < static_cast<OutputValueType>(B[i]))
51  {
52  A = static_cast<OutputValueType>(B[i]);
53  }
54  }
55  return A;
56  }
57 
58  bool
59  operator==(const Maximum1 &) const
60  {
61  return true;
62  }
63 
65 };
66 } // namespace Functor
67 
103 template <typename TInputImage, typename TOutputImage>
105  : public NaryFunctorImageFilter<TInputImage,
106  TOutputImage,
107  Functor::Maximum1<typename TInputImage::PixelType, typename TInputImage::PixelType>>
108 {
109 public:
110  ITK_DISALLOW_COPY_AND_MOVE(NaryMaximumImageFilter);
111 
114  using Superclass =
115  NaryFunctorImageFilter<TInputImage,
116  TOutputImage,
118 
121 
123  itkNewMacro(Self);
124 
127 
128 #ifdef ITK_USE_CONCEPT_CHECKING
129  // Begin concept checking
130  itkConceptMacro(InputConvertibleToOutputCheck,
134  // End concept checking
135 #endif
136 
137 protected:
138  NaryMaximumImageFilter() = default;
139  ~NaryMaximumImageFilter() override = default;
140 };
141 } // end namespace itk
142 
143 #endif
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:714
itk::NumericTraits::ValueType
T ValueType
Definition: itkNumericTraits.h:65
itk::NumericTraits::NonpositiveMin
static constexpr T NonpositiveMin()
Definition: itkNumericTraits.h:97
itk::NaryFunctorImageFilter
Perform a generic pixel-wise operation on N images.
Definition: itkNaryFunctorImageFilter.h:42
itk::NaryMaximumImageFilter::~NaryMaximumImageFilter
~NaryMaximumImageFilter() override=default
itk::Functor::Maximum1::~Maximum1
~Maximum1()=default
itk::SmartPointer< Self >
itk::Functor::Maximum1::Maximum1
Maximum1()=default
itk::NaryMaximumImageFilter
Computes the pixel-wise maximum of several images.
Definition: itkNaryMaximumImageFilter.h:104
itk::NaryMaximumImageFilter::NaryMaximumImageFilter
NaryMaximumImageFilter()=default
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::Functor::Maximum1::ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Maximum1)
itk::Functor::Maximum1
Definition: itkNaryMaximumImageFilter.h:34
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::Maximum1< TInputImage::PixelType, TInputImage::PixelType >::OutputValueType
typename NumericTraits< TInputImage::PixelType >::ValueType OutputValueType
Definition: itkNaryMaximumImageFilter.h:37
itkNumericTraits.h
itkNaryFunctorImageFilter.h
itk::Functor::Maximum1::operator==
bool operator==(const Maximum1 &) const
Definition: itkNaryMaximumImageFilter.h:59
itk::Concept::LessThanComparable
Definition: itkConceptChecking.h:262
itk::Functor::Maximum1::operator()
TOutput operator()(const std::vector< TInput > &B) const
Definition: itkNaryMaximumImageFilter.h:44