ITK  5.2.0
Insight Toolkit
itkTernaryFunctorImageFilter.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 itkTernaryFunctorImageFilter_h
19 #define itkTernaryFunctorImageFilter_h
20 
21 #include "itkInPlaceImageFilter.h"
23 
24 namespace itk
25 {
38 template <typename TInputImage1,
39  typename TInputImage2,
40  typename TInputImage3,
41  typename TOutputImage,
42  typename TFunction>
43 class ITK_TEMPLATE_EXPORT TernaryFunctorImageFilter : public InPlaceImageFilter<TInputImage1, TOutputImage>
44 {
45 public:
46  ITK_DISALLOW_COPY_AND_ASSIGN(TernaryFunctorImageFilter);
47 
53 
55  itkNewMacro(Self);
56 
59 
61  using FunctorType = TFunction;
62  using Input1ImageType = TInputImage1;
63  using Input1ImagePointer = typename Input1ImageType::ConstPointer;
65  using Input1ImagePixelType = typename Input1ImageType::PixelType;
66  using Input2ImageType = TInputImage2;
67  using Input2ImagePointer = typename Input2ImageType::ConstPointer;
69  using Input2ImagePixelType = typename Input2ImageType::PixelType;
70  using Input3ImageType = TInputImage3;
71  using Input3ImagePointer = typename Input3ImageType::ConstPointer;
73  using Input3ImagePixelType = typename Input3ImageType::PixelType;
74  using OutputImageType = TOutputImage;
75  using OutputImagePointer = typename OutputImageType::Pointer;
77  using OutputImagePixelType = typename OutputImageType::PixelType;
78 
80  void
81  SetInput1(const TInputImage1 * image1);
82 
84  void
85  SetInput2(const TInputImage2 * image2);
86 
88  void
89  SetInput3(const TInputImage3 * image3);
90 
95  FunctorType &
97  {
98  return m_Functor;
99  }
100 
105  const FunctorType &
106  GetFunctor() const
107  {
108  return m_Functor;
109  }
110 
117  void
118  SetFunctor(const FunctorType & functor)
119  {
120  if (!(functor == m_Functor))
121  {
122  m_Functor = functor;
123  this->Modified();
124  }
125  }
127 
129  static constexpr unsigned int Input1ImageDimension = TInputImage1::ImageDimension;
130  static constexpr unsigned int Input2ImageDimension = TInputImage2::ImageDimension;
131  static constexpr unsigned int Input3ImageDimension = TInputImage3::ImageDimension;
132  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
133 
134 #ifdef ITK_USE_CONCEPT_CHECKING
135  // Begin concept checking
139  // End concept checking
140 #endif
141 
142 protected:
144  ~TernaryFunctorImageFilter() override = default;
145 
148  void
149  BeforeThreadedGenerateData() override;
150 
161  void
162  DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
163 
164 
165 private:
167 };
168 } // end namespace itk
169 
170 #ifndef ITK_MANUAL_INSTANTIATION
171 # include "itkTernaryFunctorImageFilter.hxx"
172 #endif
173 
174 #endif
itk::TernaryFunctorImageFilter::m_Functor
FunctorType m_Functor
Definition: itkTernaryFunctorImageFilter.h:166
itk::TernaryFunctorImageFilter< TMask, TImage, TImage, TImage, Functor::TernaryOperator< TMask::PixelType, TImage::PixelType, TImage::PixelType, TImage::PixelType > >::Input1ImagePixelType
typename Input1ImageType::PixelType Input1ImagePixelType
Definition: itkTernaryFunctorImageFilter.h:65
itk::TernaryFunctorImageFilter< TMask, TImage, TImage, TImage, Functor::TernaryOperator< TMask::PixelType, TImage::PixelType, TImage::PixelType, TImage::PixelType > >::Input2ImagePixelType
typename Input2ImageType::PixelType Input2ImagePixelType
Definition: itkTernaryFunctorImageFilter.h:69
itk::ImageSource< TImage >::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::TernaryFunctorImageFilter< TMask, TImage, TImage, TImage, Functor::TernaryOperator< TMask::PixelType, TImage::PixelType, TImage::PixelType, TImage::PixelType > >::Input2ImageType
TImage Input2ImageType
Definition: itkTernaryFunctorImageFilter.h:66
itk::TernaryFunctorImageFilter< TMask, TImage, TImage, TImage, Functor::TernaryOperator< TMask::PixelType, TImage::PixelType, TImage::PixelType, TImage::PixelType > >::Input2ImageRegionType
typename Input2ImageType::RegionType Input2ImageRegionType
Definition: itkTernaryFunctorImageFilter.h:68
itk::InPlaceImageFilter
Base class for filters that take an image as input and overwrite that image as the output.
Definition: itkInPlaceImageFilter.h:77
itk::TernaryFunctorImageFilter< TMask, TImage, TImage, TImage, Functor::TernaryOperator< TMask::PixelType, TImage::PixelType, TImage::PixelType, TImage::PixelType > >::Input2ImagePointer
typename Input2ImageType::ConstPointer Input2ImagePointer
Definition: itkTernaryFunctorImageFilter.h:67
itk::TernaryFunctorImageFilter::GetFunctor
const FunctorType & GetFunctor() const
Definition: itkTernaryFunctorImageFilter.h:106
itk::TernaryFunctorImageFilter< TMask, TImage, TImage, TImage, Functor::TernaryOperator< TMask::PixelType, TImage::PixelType, TImage::PixelType, TImage::PixelType > >::Input3ImagePixelType
typename Input3ImageType::PixelType Input3ImagePixelType
Definition: itkTernaryFunctorImageFilter.h:73
itk::SmartPointer< Self >
itkImageRegionIteratorWithIndex.h
itk::Concept::SameDimension
Definition: itkConceptChecking.h:692
itk::TernaryFunctorImageFilter< TMask, TImage, TImage, TImage, Functor::TernaryOperator< TMask::PixelType, TImage::PixelType, TImage::PixelType, TImage::PixelType > >::Input3ImageRegionType
typename Input3ImageType::RegionType Input3ImageRegionType
Definition: itkTernaryFunctorImageFilter.h:72
itk::TernaryFunctorImageFilter::GetFunctor
FunctorType & GetFunctor()
Definition: itkTernaryFunctorImageFilter.h:96
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::TernaryFunctorImageFilter< TMask, TImage, TImage, TImage, Functor::TernaryOperator< TMask::PixelType, TImage::PixelType, TImage::PixelType, TImage::PixelType > >::Input1ImageType
TMask Input1ImageType
Definition: itkTernaryFunctorImageFilter.h:62
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::TernaryFunctorImageFilter< TMask, TImage, TImage, TImage, Functor::TernaryOperator< TMask::PixelType, TImage::PixelType, TImage::PixelType, TImage::PixelType > >::Input3ImageType
TImage Input3ImageType
Definition: itkTernaryFunctorImageFilter.h:70
itk::TernaryFunctorImageFilter
Implements pixel-wise generic operation of three images.
Definition: itkTernaryFunctorImageFilter.h:43
itk::TernaryFunctorImageFilter< TMask, TImage, TImage, TImage, Functor::TernaryOperator< TMask::PixelType, TImage::PixelType, TImage::PixelType, TImage::PixelType > >::Input3ImagePointer
typename Input3ImageType::ConstPointer Input3ImagePointer
Definition: itkTernaryFunctorImageFilter.h:71
itk::TernaryFunctorImageFilter< TMask, TImage, TImage, TImage, Functor::TernaryOperator< TMask::PixelType, TImage::PixelType, TImage::PixelType, TImage::PixelType > >::Input1ImagePointer
typename Input1ImageType::ConstPointer Input1ImagePointer
Definition: itkTernaryFunctorImageFilter.h:63
itk::ImageSource< TImage >::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itk::Functor::TernaryOperator< TMask::PixelType, TImage::PixelType, TImage::PixelType, TImage::PixelType >
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:64
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::TernaryFunctorImageFilter::SetFunctor
void SetFunctor(const FunctorType &functor)
Definition: itkTernaryFunctorImageFilter.h:118
itkInPlaceImageFilter.h
itk::ImageSource< TImage >::OutputImagePixelType
typename OutputImageType::PixelType OutputImagePixelType
Definition: itkImageSource.h:93
itk::TernaryFunctorImageFilter< TMask, TImage, TImage, TImage, Functor::TernaryOperator< TMask::PixelType, TImage::PixelType, TImage::PixelType, TImage::PixelType > >::Input1ImageRegionType
typename Input1ImageType::RegionType Input1ImageRegionType
Definition: itkTernaryFunctorImageFilter.h:64
itk::ImageSource< TImage >::OutputImageType
TImage OutputImageType
Definition: itkImageSource.h:90