ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkGreaterEqualValImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 itkGreaterEqualValImageFilter_h
19 #define itkGreaterEqualValImageFilter_h
21 namespace itk
22 {
31 namespace Functor
32 {
33 template< class TInput, class TOutput >
34 class GEConst
35 {
36 public:
37  GEConst() { m_Val = (TInput)0.0; }
38  void SetVal(const TInput i) { m_Val = i; }
39 
40  ~GEConst() {}
41  bool operator!=(const GEConst &) const
42  {
43  return false;
44  }
45 
46  bool operator==(const GEConst & other) const
47  {
48  return !( *this != other );
49  }
50 
51  inline TOutput operator()(const TInput & A)
52  {
53  return static_cast< TOutput >( A >= m_Val );
54  }
55 
56 private:
57  TInput m_Val;
58 };
59 }
60 
61 template< class TInputImage, class TOutputImage >
62 class ITK_EXPORT GreaterEqualValImageFilter:
63  public
64  UnaryFunctorImageFilter< TInputImage, TOutputImage,
65  Functor::GEConst<
66  typename TInputImage::PixelType,
67  typename TOutputImage::PixelType > >
68 {
69 public:
70  ITK_DISALLOW_COPY_AND_ASSIGN(GreaterEqualValImageFilter);
71 
74  using Superclass = UnaryFunctorImageFilter< TInputImage, TOutputImage,
75  Functor::GEConst< typename TInputImage::PixelType,
76  typename TOutputImage::PixelType > >;
79 
81  itkNewMacro(Self);
82 
83  void SetVal(typename TInputImage::PixelType val)
84  {
85  this->GetFunctor().SetVal(val);
86  this->Modified();
87  }
88 
89 #ifdef ITK_USE_CONCEPT_CHECKING
90 
91  itkConceptMacro( InputConvertibleToDoubleCheck,
93  itkConceptMacro( DoubleConvertibleToOutputCheck,
95 
97 #endif
98 protected:
101 };
102 } // end namespace itk
104 
105 #endif
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
Computes the absolute difference between an image and a constant. Can be done with ShiftScale and Abs...
TOutput operator()(const TInput &A)
Implements pixel-wise generic operation on one image.
void SetVal(typename TInputImage::PixelType val)
bool operator!=(const GEConst &) const
#define itkConceptMacro(name, concept)
bool operator==(const GEConst &other) const