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
44{
45public:
46 ITK_DISALLOW_COPY_AND_MOVE(NaryFunctorImageFilter);
47
53
55 itkNewMacro(Self);
56
58 itkOverrideGetNameOfClassMacro(NaryFunctorImageFilter);
59
61 using FunctorType = TFunction;
62 using InputImageType = TInputImage;
63 using InputImagePointer = typename InputImageType::Pointer;
64 using InputImageRegionType = typename InputImageType::RegionType;
65 using InputImagePixelType = typename InputImageType::PixelType;
66 using OutputImageType = TOutputImage;
67 using OutputImagePointer = typename OutputImageType::Pointer;
68 using OutputImageRegionType = typename OutputImageType::RegionType;
69 using OutputImagePixelType = typename OutputImageType::PixelType;
70 using NaryArrayType = std::vector<InputImagePixelType>;
71
78 {
79 return m_Functor;
80 }
81
88 void
90 {
91 if (m_Functor != functor)
92 {
93 m_Functor = functor;
94 this->Modified();
95 }
96 }
97
98
100 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
101 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
102
105
106protected:
108 ~NaryFunctorImageFilter() override = default;
109
120 void
121 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
122
123
124private:
126};
127} // end namespace itk
128
129#ifndef ITK_MANUAL_INSTANTIATION
130# include "itkNaryFunctorImageFilter.hxx"
131#endif
132
133#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....