ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkGreaterEqualValImageFilter.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 itkGreaterEqualValImageFilter_h
19#define itkGreaterEqualValImageFilter_h
21namespace itk
22{
30
31namespace Functor
32{
33template <typename TInput, typename TOutput>
35{
36public:
37 GEConst() { m_Val = (TInput)0.0; }
38 void
39 SetVal(const TInput i)
40 {
41 m_Val = i;
42 }
43
44 ~GEConst() = default;
45 bool
46 operator!=(const GEConst &) const
47 {
48 return false;
49 }
50
51 bool
52 operator==(const GEConst & other) const
53 {
54 return !(*this != other);
55 }
56
57 TOutput
58 operator()(const TInput & A)
59 {
60 return static_cast<TOutput>(A >= m_Val);
61 }
62
63private:
64 TInput m_Val;
65};
66} // namespace Functor
67
68template <typename TInputImage, typename TOutputImage>
69class ITK_TEMPLATE_EXPORT GreaterEqualValImageFilter
70 : public UnaryFunctorImageFilter<TInputImage,
71 TOutputImage,
72 Functor::GEConst<typename TInputImage::PixelType, typename TOutputImage::PixelType>>
73{
74public:
75 ITK_DISALLOW_COPY_AND_MOVE(GreaterEqualValImageFilter);
76
79 using Superclass =
80 UnaryFunctorImageFilter<TInputImage,
81 TOutputImage,
85
87 itkNewMacro(Self);
88
89 void
90 SetVal(typename TInputImage::PixelType val)
91 {
92 this->GetFunctor().SetVal(val);
93 this->Modified();
94 }
95
98
99protected:
101 ~GreaterEqualValImageFilter() override = default;
102};
103} // end namespace itk
104
105#endif
bool operator==(const GEConst &other) const
bool operator!=(const GEConst &) const
TOutput operator()(const TInput &A)
~GreaterEqualValImageFilter() override=default
UnaryFunctorImageFilter< TInputImage, TOutputImage, Functor::GEConst< typename TInputImage::PixelType, typename TOutputImage::PixelType > > Superclass
void SetVal(typename TInputImage::PixelType val)
virtual void Modified() const
Implements transparent reference counting.
#define itkConceptMacro(name, conceptType)
Compile-time check that a template argument satisfies an itk::Concept.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....