ITK  6.0.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 * 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 itkTernaryFunctorImageFilter_h
19#define itkTernaryFunctorImageFilter_h
20
23
24namespace itk
25{
38template <typename TInputImage1,
39 typename TInputImage2,
40 typename TInputImage3,
41 typename TOutputImage,
42 typename TFunction>
43class ITK_TEMPLATE_EXPORT TernaryFunctorImageFilter : public InPlaceImageFilter<TInputImage1, TOutputImage>
44{
45public:
46 ITK_DISALLOW_COPY_AND_MOVE(TernaryFunctorImageFilter);
47
53
55 itkNewMacro(Self);
56
58 itkOverrideGetNameOfClassMacro(TernaryFunctorImageFilter);
59
61 using FunctorType = TFunction;
62 using Input1ImageType = TInputImage1;
65 using Input1ImagePixelType = typename Input1ImageType::PixelType;
66 using Input2ImageType = TInputImage2;
69 using Input2ImagePixelType = typename Input2ImageType::PixelType;
70 using Input3ImageType = TInputImage3;
73 using Input3ImagePixelType = typename Input3ImageType::PixelType;
74 using OutputImageType = TOutputImage;
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
97 {
98 return m_Functor;
99 }
100
105 const FunctorType &
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 }
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
142protected:
144 ~TernaryFunctorImageFilter() override = default;
145
148 void
150
161 void
162 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
163
164
165private:
166 FunctorType m_Functor{};
167};
168} // end namespace itk
169
170#ifndef ITK_MANUAL_INSTANTIATION
171# include "itkTernaryFunctorImageFilter.hxx"
172#endif
173
174#endif
Base class for all process objects that output image data.
typename OutputImageType::PixelType OutputImagePixelType
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename OutputImageType::Pointer OutputImagePointer
Base class for filters that take an image as input and overwrite that image as the output.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Implements pixel-wise generic operation of three images.
void BeforeThreadedGenerateData() override
void SetInput2(const TInputImage2 *image2)
typename Input1ImageType::PixelType Input1ImagePixelType
typename Input2ImageType::RegionType Input2ImageRegionType
typename Input2ImageType::ConstPointer Input2ImagePointer
void SetInput1(const TInputImage1 *image1)
typename Input1ImageType::ConstPointer Input1ImagePointer
typename Input2ImageType::PixelType Input2ImagePixelType
typename Input1ImageType::RegionType Input1ImageRegionType
typename Input3ImageType::ConstPointer Input3ImagePointer
typename Input3ImageType::PixelType Input3ImagePixelType
void SetFunctor(const FunctorType &functor)
typename Input3ImageType::RegionType Input3ImageRegionType
void SetInput3(const TInputImage3 *image3)
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
~TernaryFunctorImageFilter() override=default
Functor::Add2< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType > FunctorType
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....