ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkUnaryFrequencyDomainFilter.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 itkUnaryFrequencyDomainFilter_h
19#define itkUnaryFrequencyDomainFilter_h
20
23
24namespace itk
25{
60template <typename TImageType, typename TFrequencyIterator = FrequencyFFTLayoutImageRegionIteratorWithIndex<TImageType>>
61class ITK_TEMPLATE_EXPORT UnaryFrequencyDomainFilter : public InPlaceImageFilter<TImageType, TImageType>
62{
63public:
64 ITK_DISALLOW_COPY_AND_MOVE(UnaryFrequencyDomainFilter);
65
71
73 itkNewMacro(Self);
74
76 itkOverrideGetNameOfClassMacro(UnaryFrequencyDomainFilter);
77
79 using ImageType = TImageType;
80 using ImagePointer = typename ImageType::Pointer;
81 using ImageConstPointer = typename ImageType::ConstPointer;
82 using IndexType = typename TImageType::IndexType;
83 using PixelType = typename TImageType::PixelType;
84
86 using ImageRegionType = typename TImageType::RegionType;
87
88 static constexpr unsigned int ImageDimension = TImageType::ImageDimension;
89
91
93 using FrequencyIteratorType = TFrequencyIterator;
94 using FrequencyValueType = typename FrequencyIteratorType::FrequencyValueType;
95
101 itkSetMacro(ActualXDimensionIsOdd, bool);
102 itkGetConstReferenceMacro(ActualXDimensionIsOdd, bool);
103 itkBooleanMacro(ActualXDimensionIsOdd);
105
108
111
112#if !defined(ITK_WRAPPING_PARSER)
114 void
115 SetFunctor(const std::function<ConstRefFunctionType> & f)
116 {
117 auto inPlaceFunctor = [f](FrequencyIteratorType & freq) { freq.Value() *= f(freq); };
118
119 m_DynamicThreadedGenerateDataFunction = [this, inPlaceFunctor](const ImageRegionType & outputRegionForThread) {
120 return this->DynamicThreadedGenerateDataWithFunctor(inPlaceFunctor, outputRegionForThread);
121 };
122
123 this->Modified();
124 }
125
127 void
128 SetFunctor(const std::function<ValueFunctionType> & f)
129 {
130 m_DynamicThreadedGenerateDataFunction = [this, f](const ImageRegionType & outputRegionForThread) {
131 return this->DynamicThreadedGenerateDataWithFunctor(f, outputRegionForThread);
132 };
134
135 this->Modified();
136 }
137
138
140 void
142 {
143 auto inPlaceFunctor = [f](FrequencyIteratorType & freq) { freq.Value() *= f(freq); };
144
145 m_DynamicThreadedGenerateDataFunction = [this, inPlaceFunctor](const ImageRegionType & outputRegionForThread) {
146 return this->DynamicThreadedGenerateDataWithFunctor(inPlaceFunctor, outputRegionForThread);
147 };
148
149 this->Modified();
150 }
151
153 void
155 {
156 m_DynamicThreadedGenerateDataFunction = [this, funcPointer](const ImageRegionType & outputRegionForThread) {
157 return this->DynamicThreadedGenerateDataWithFunctor(funcPointer, outputRegionForThread);
158 };
160
161 this->Modified();
162 }
163
164
172 template <typename TFunctor>
173 void
174 SetFunctor(const TFunctor & functor)
175 {
176 m_DynamicThreadedGenerateDataFunction = [this, functor](const ImageRegionType & outputRegionForThread) {
177 return this->DynamicThreadedGenerateDataWithFunctor(functor, outputRegionForThread);
178 };
180
181 this->Modified();
182 }
183#endif // !defined( ITK_WRAPPING_PARSER )
184
185protected:
187 void
188 PrintSelf(std::ostream & os, Indent indent) const override;
189
199 template <typename TFunctor>
200 void
201 DynamicThreadedGenerateDataWithFunctor(const TFunctor &, const ImageRegionType & outputRegionForThread);
202 void
203 DynamicThreadedGenerateData(const ImageRegionType & outputRegionForThread) override;
205
206private:
208
210};
211} // end namespace itk
212
213#ifndef ITK_MANUAL_INSTANTIATION
214# include "itkUnaryFrequencyDomainFilter.hxx"
215#endif
216
217#endif // itkUnaryFrequencyDomainFilter_h
Control indentation during Print() invocation.
Definition itkIndent.h:50
virtual void Modified() const
Implements transparent reference counting.
void DynamicThreadedGenerateDataWithFunctor(const TFunctor &, const ImageRegionType &outputRegionForThread)
void SetFunctor(ValueFunctionType *funcPointer)
void DynamicThreadedGenerateData(const ImageRegionType &outputRegionForThread) override
std::function< void(const ImageRegionType &)> m_DynamicThreadedGenerateDataFunction
void PrintSelf(std::ostream &os, Indent indent) const override
void SetFunctor(const std::function< ValueFunctionType > &f)
void SetFunctor(const std::function< ConstRefFunctionType > &f)
typename FrequencyIteratorType::FrequencyValueType FrequencyValueType
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....