ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkUnaryFunctorImageFilter.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 itkUnaryFunctorImageFilter_h
19#define itkUnaryFunctorImageFilter_h
20
21#include "itkMath.h"
23
24namespace itk
25{
48template <typename TInputImage, typename TOutputImage, typename TFunction>
49class ITK_TEMPLATE_EXPORT UnaryFunctorImageFilter : public InPlaceImageFilter<TInputImage, TOutputImage>
50{
51public:
52 ITK_DISALLOW_COPY_AND_MOVE(UnaryFunctorImageFilter);
53
59
61 itkNewMacro(Self);
62
64 itkOverrideGetNameOfClassMacro(UnaryFunctorImageFilter);
65
67 using FunctorType = TFunction;
68
69 using InputImageType = TInputImage;
70 using InputImagePointer = typename InputImageType::ConstPointer;
71 using InputImageRegionType = typename InputImageType::RegionType;
72 using InputImagePixelType = typename InputImageType::PixelType;
73
74 using OutputImageType = TOutputImage;
75 using OutputImagePointer = typename OutputImageType::Pointer;
76 using OutputImageRegionType = typename OutputImageType::RegionType;
77 using OutputImagePixelType = typename OutputImageType::PixelType;
78
86 {
87 return m_Functor;
88 }
89 const FunctorType &
90 GetFunctor() const
91 {
92 return m_Functor;
93 }
94
95
102 void
103 SetFunctor(const FunctorType & functor)
104 {
105 if (m_Functor != functor)
106 {
107 m_Functor = functor;
108 this->Modified();
109 }
110 }
111
112protected:
114 ~UnaryFunctorImageFilter() override = default;
115
124 void
126
137 void
138 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
139
140private:
142};
143} // end namespace itk
144
145#ifndef ITK_MANUAL_INSTANTIATION
146# include "itkUnaryFunctorImageFilter.hxx"
147#endif
148
149#endif
virtual void Modified() const
Implements transparent reference counting.
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::ConstPointer InputImagePointer
typename OutputImageType::PixelType OutputImagePixelType
~UnaryFunctorImageFilter() override=default
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
typename OutputImageType::Pointer OutputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
void SetFunctor(const FunctorType &functor)
const FunctorType & GetFunctor() const
void GenerateOutputInformation() override
InPlaceImageFilter< TInputImage, TOutputImage > Superclass
SmartPointer< const Self > ConstPointer
typename InputImageType::RegionType InputImageRegionType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....