ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkBlockMatchingMultiResolutionSimilarityFunctionSearchRegionImageSource.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 itkBlockMatchingMultiResolutionSimilarityFunctionSearchRegionImageSource_h
19#define itkBlockMatchingMultiResolutionSimilarityFunctionSearchRegionImageSource_h
20
21#include "itkArray.h"
23#include "itkVector.h"
24
27
29
30namespace itk
31{
32namespace BlockMatching
33{
34
65template <class TFixedImage,
66 class TMovingImage,
67 class TMetricImage,
68 class TDisplacementImage,
69 class TFunctor,
70 class TInterpolatorPrecisionType = double>
72 : public MultiResolutionSearchRegionImageSource<TFixedImage, TMovingImage, TDisplacementImage>
73 , public MetricImageToDisplacementCalculator<TMetricImage, TDisplacementImage>
74{
75public:
80
83
85 static constexpr unsigned int ImageDimension = TMovingImage::ImageDimension;
86
88 using FixedImageType = TFixedImage;
89 using FixedRegionType = typename FixedImageType::RegionType;
90
92 using RadiusType = typename FixedImageType::SizeType;
93
95 using MovingImageType = TMovingImage;
96 using MovingRegionType = typename MovingImageType::RegionType;
97
99 using MetricImageType = TMetricImage;
100
104
108
111 using OutputRegionType = typename OutputImageType::RegionType;
116
119
122
124 using DisplacementImageType = TDisplacementImage;
125
127 using FunctorType = TFunctor;
128
131 using DisplacementResamplerPointer = typename DisplacementResamplerType::Pointer;
132
136
139
142
145 static Pointer
146 New(void)
147 {
149
150 if (smartPtr.GetPointer() == nullptr)
151 {
152 smartPtr = new Self;
153 }
154 smartPtr->UnRegister();
155 return smartPtr;
156 }
157
158 // virtual LightObject::Pointer CreateAnother(void) const
159 // {
160 // LightObject::Pointer smartPtr;
161 // // @todo fix me -- itk::LightObject ambiguity somewhere in the following
162 // line
163 // smartPtr = Self::New().GetPointer();
164 // return smartPtr;
165 // }
166
168 virtual void
170 {
171 m_TopLevelRadius = radius;
173 this->Modified();
174 }
175
178 virtual void
184 virtual void
186 {
187 RadiusFactorType rf(factor);
189 }
190 itkGetConstReferenceMacro(MinimumSearchRegionRadiusFactor, RadiusFactorType);
191
193 virtual void
195
197 virtual void
198 SetMetricImagePixel(const PointType & point, const IndexType & index, MetricImageType * image);
199
200 virtual void
202
205 virtual void
206 Register() const
207 {
209 }
210
211 virtual void
213 {
215 }
216
217 virtual void
218 Modified() const
219 {
221 }
222
223 bool
224 GetDebug() const
225 {
226 return Superclass::GetDebug();
227 }
228
232 itkSetObjectMacro(DisplacementCalculator, DisplacementCalculatorSuperclass);
233 itkGetConstObjectMacro(DisplacementCalculator, DisplacementCalculatorSuperclass);
234
241 itkSetObjectMacro(Interpolator, InterpolatorType);
242
244 itkGetConstObjectMacro(Interpolator, InterpolatorType);
245
250 const FunctorType &
252 {
253 return m_Functor;
254 }
255
262 void
263 SetFunctor(const FunctorType & functor)
264 {
265 if (m_Functor != functor)
266 {
267 m_Functor = functor;
268 this->Modified();
269 }
270 }
271
272protected:
274
275 virtual void
277
278 virtual void
279 ThreadedGenerateData(const OutputRegionType & outputRegion, ThreadIdType threadID);
280
283
285
288
290
292 // metric interpolation
294
295private:
297 void
298 operator=(const Self &);
299};
300
301} // end namespace BlockMatching
302} // end namespace itk
303
304#ifndef ITK_MANUAL_INSTANTIATION
305# include "itkBlockMatchingMultiResolutionSimilarityFunctionSearchRegionImageSource.hxx"
306#endif
307
308#endif
ResampleImageFilter< DisplacementImageType, DisplacementImageType > DisplacementResamplerType
Image< typename itk::Vector< typename RadiusType::SizeValueType, ImageDimension >, ImageDimension > SearchRegionRadiusImageType
virtual void ThreadedGenerateData(const OutputRegionType &outputRegion, ThreadIdType threadID)
virtual void SetMetricImagePixel(const PointType &point, const IndexType &index, MetricImageType *image)
Simulate a standard C array with copy semantics.
Templated n-dimensional image class.
Definition itkImage.h:89
Base class for all image interpolators.
virtual void UnRegister() const noexcept
virtual void Register() const
static T::Pointer Create()
virtual void Modified() const
bool GetDebug() const
Resample an image via a coordinate transform.
Implements transparent reference counting.
ObjectType * GetPointer() const noexcept
void UnRegister() noexcept
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int ThreadIdType
Definition itkIntTypes.h:98