ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkModulusImageFilter.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 itkModulusImageFilter_h
19 #define itkModulusImageFilter_h
20 
23 
24 
25 namespace itk
26 {
27 
41 template< typename TInputImage1, typename TInputImage2 = TInputImage1, typename TOutputImage = TInputImage1 >
42 class ITK_TEMPLATE_EXPORT ModulusImageFilter:
43  public
44  BinaryGeneratorImageFilter< TInputImage1, TInputImage2, TOutputImage >
45 {
46 public:
47  ITK_DISALLOW_COPY_AND_ASSIGN(ModulusImageFilter);
48 
52 
53  using FunctorType = Functor::Modulus< typename TInputImage1::PixelType,
54  typename TInputImage2::PixelType,
55  typename TOutputImage::PixelType >;
56 
59 
60  using OutputPixelType = typename TOutputImage::PixelType;
61  using InputPixelType = typename TInputImage1::PixelType;
62 
64  itkNewMacro(Self);
65 
67  itkTypeMacro(ModulusImageFilter,
69 
71  virtual void SetDividend( InputPixelType _arg ) { this->SetConstant2(_arg); }
72  virtual const InputPixelType &GetDividend () const { return this->GetConstant2(); }
74 
75 
76 #ifdef ITK_USE_CONCEPT_CHECKING
77  // Begin concept checking
78  itkConceptMacro( InputHasNumericTraitsCheck,
80  // End concept checking
81 #endif
82 
83 protected:
85  ~ModulusImageFilter() override = default;
86 
87 };
88 } // end namespace itk
89 
90 #ifndef ITK_MANUAL_INSTANTIATION
91 #include "itkModulusImageFilter.hxx"
92 #endif
93 
94 #endif
Computes the modulus (x % dividend) pixel-wise.
typename TInputImage1::PixelType InputPixelType
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.
Implements pixel-wise generic operation of two images, or of an image and a constant.
virtual void SetDividend(InputPixelType _arg)
typename TOutputImage::PixelType OutputPixelType
virtual const InputPixelType & GetDividend() const
#define itkConceptMacro(name, concept)