ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkNaryFunctorImageFilter.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 itkNaryFunctorImageFilter_h
19#define itkNaryFunctorImageFilter_h
20
22#include "itkImageIterator.h"
23#include "itkArray.h"
24
25namespace itk
26{
40
41template <typename TInputImage, typename TOutputImage, typename TFunction>
42class ITK_TEMPLATE_EXPORT NaryFunctorImageFilter : public InPlaceImageFilter<TInputImage, TOutputImage>
43{
44public:
45 ITK_DISALLOW_COPY_AND_MOVE(NaryFunctorImageFilter);
46
52
54 itkNewMacro(Self);
55
57 itkOverrideGetNameOfClassMacro(NaryFunctorImageFilter);
58
60 using FunctorType = TFunction;
61 using InputImageType = TInputImage;
62 using InputImagePointer = typename InputImageType::Pointer;
63 using InputImageRegionType = typename InputImageType::RegionType;
64 using InputImagePixelType = typename InputImageType::PixelType;
65 using OutputImageType = TOutputImage;
66 using OutputImagePointer = typename OutputImageType::Pointer;
67 using OutputImageRegionType = typename OutputImageType::RegionType;
68 using OutputImagePixelType = typename OutputImageType::PixelType;
69 using NaryArrayType = std::vector<InputImagePixelType>;
70
77 {
78 return m_Functor;
79 }
80
87 void
89 {
90 if (m_Functor != functor)
91 {
92 m_Functor = functor;
93 this->Modified();
94 }
95 }
96
98 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
99 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
100
103
104protected:
106 ~NaryFunctorImageFilter() override = default;
107
118 void
119 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
120
121
122private:
124};
125} // end namespace itk
126
127#ifndef ITK_MANUAL_INSTANTIATION
128# include "itkNaryFunctorImageFilter.hxx"
129#endif
130
131#endif
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
void SetFunctor(FunctorType &functor)
~NaryFunctorImageFilter() override=default
virtual void Modified() const
Implements transparent reference counting.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....