ITK  4.13.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  BinaryFunctorImageFilter< TInputImage1, TInputImage2, TOutputImage,
45  Functor::Modulus<
46  typename TInputImage1::PixelType,
47  typename TInputImage2::PixelType,
48  typename TOutputImage::PixelType > >
49 {
50 public:
53  typedef BinaryFunctorImageFilter< TInputImage1, TInputImage2, TOutputImage,
55  typename TInputImage1::PixelType,
56  typename TInputImage2::PixelType,
57  typename TOutputImage::PixelType > > Superclass;
58 
61 
62  typedef typename TOutputImage::PixelType OutputPixelType;
63  typedef typename TInputImage1::PixelType InputPixelType;
64 
66  itkNewMacro(Self);
67 
69  itkTypeMacro(ModulusImageFilter,
71 
73  virtual void SetDividend( InputPixelType _arg ) { this->SetConstant2(_arg); }
74  virtual const InputPixelType &GetDividend () const { return this->GetConstant2(); }
76 
77 
78 #ifdef ITK_USE_CONCEPT_CHECKING
79  // Begin concept checking
80  itkConceptMacro( InputHasNumericTraitsCheck,
82  // End concept checking
83 #endif
84 
85 protected:
87  virtual ~ModulusImageFilter() ITK_OVERRIDE {}
88 
89 private:
90  ITK_DISALLOW_COPY_AND_ASSIGN(ModulusImageFilter);
91 
92 };
93 } // end namespace itk
94 
95 #ifndef ITK_MANUAL_INSTANTIATION
96 #include "itkModulusImageFilter.hxx"
97 #endif
98 
99 #endif
Computes the modulus (x % dividend) pixel-wise.
TOutputImage::PixelType OutputPixelType
SmartPointer< Self > Pointer
Base class for all process objects that output image data.
SmartPointer< const Self > ConstPointer
virtual void SetDividend(InputPixelType _arg)
TInputImage1::PixelType InputPixelType
virtual const InputPixelType & GetDividend() const
Implements pixel-wise generic operation on one image.
virtual ~ModulusImageFilter() override
BinaryFunctorImageFilter< TInputImage1, TInputImage2, TOutputImage, Functor::Modulus< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType > > Superclass
#define itkConceptMacro(name, concept)
Implements pixel-wise generic operation of two images, or of an image and a constant.