ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkBlockMatchingDisplacementPipeline.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 itkBlockMatchingDisplacementPipeline_h
19#define itkBlockMatchingDisplacementPipeline_h
20
21#include "itkAmoebaOptimizer.h"
23#include "itkImage.h"
25#include "itkVector.h"
28
44
49
50
51namespace itk
52{
53namespace BlockMatching
54{
55
62template <typename TFixedPixel = signed short,
63 typename TMovingPixel = TFixedPixel,
64 typename TMetricPixel = double,
65 typename TCoordRep = double,
66 unsigned int VImageDimension = 2>
67class ITK_TEMPLATE_EXPORT DisplacementPipeline
68 : public ImageToImageFilter<Image<TFixedPixel, VImageDimension>,
69 Image<Vector<TMetricPixel, VImageDimension>, VImageDimension>>
70{
71public:
72 ITK_DISALLOW_COPY_AND_MOVE(DisplacementPipeline);
73
75 static constexpr unsigned int ImageDimension = VImageDimension;
76
77 using FixedPixelType = TFixedPixel;
80
81 using MovingPixelType = TMovingPixel;
83
84 using MetricPixelType = TMetricPixel;
86
90
96
98 itkOverrideGetNameOfClassMacro(DisplacementPipeline);
99
101 itkNewMacro(Self);
102
103 using CoordRepType = TCoordRep;
104
107
108 static const unsigned int RESAMPLE_RADIUS = 4;
122
125
129
131 using LevelRegistrationMethodType = BlockMatching::
132 ImageRegistrationMethod<FixedImageType, MovingImageType, MetricImageType, DisplacementImageType, CoordRepType>;
133
141 static const unsigned int OPTIMIZING_INTERPOLATOR_RADIUS = 4;
150
159
161 using MetricImageFilterType = BlockMatching::
162 NormalizedCrossCorrelationNeighborhoodIteratorMetricImageFilter<FixedImageType, MovingImageType, MetricImageType>;
163
166 BlockAffineTransformMetricImageFilter<FixedImageType, MovingImageType, MetricImageType, MetricPixelType>;
171
175
182
186
190
192
194
196
198
200 void
202 {
203 this->SetNthInput(0, fixed);
204 }
205 const FixedImageType *
207 {
208 return static_cast<const FixedImageType *>(this->ProcessObject::GetInput(0));
209 }
210
212 void
214 {
215 this->SetNthInput(1, moving);
216 }
217 const MovingImageType *
219 {
220 return static_cast<const MovingImageType *>(this->ProcessObject::GetInput(1));
221 }
222
225 itkSetMacro(MaximumAbsStrainAllowed, double);
226 itkGetConstMacro(MaximumAbsStrainAllowed, double);
227
230 itkSetMacro(LevelRegistrationMethodTextProgressBar, bool);
231 itkGetConstMacro(LevelRegistrationMethodTextProgressBar, bool);
232
235 itkGetConstReferenceMacro(UpsamplingRatio, UpsamplingRatioType);
236
237
239 itkSetMacro(TopBlockRadius, BlockRadiusType);
240 itkGetConstReferenceMacro(TopBlockRadius, BlockRadiusType);
241
243 itkSetMacro(BottomBlockRadius, BlockRadiusType);
244 itkGetConstReferenceMacro(BottomBlockRadius, BlockRadiusType);
245
247 itkSetMacro(BlockOverlap, double);
248 itkGetConstMacro(BlockOverlap, double);
249
252 itkSetMacro(ScaleBlockByStrain, bool);
253 itkGetConstMacro(ScaleBlockByStrain, bool);
254
255
259 itkSetMacro(SearchRegionTopFactor, SearchRegionFactorType);
260 itkGetConstReferenceMacro(SearchRegionTopFactor, SearchRegionFactorType);
261
263 itkSetMacro(SearchRegionBottomFactor, SearchRegionFactorType);
264 itkGetConstReferenceMacro(SearchRegionBottomFactor, SearchRegionFactorType);
265
266
268 itkSetMacro(Direction, unsigned int);
269 itkGetConstMacro(Direction, unsigned int);
270
271
273 itkSetMacro(RegularizationStrainSigma, RegularizationStrainSigmaType);
274 itkGetConstReferenceMacro(RegularizationStrainSigma, RegularizationStrainSigmaType);
275
277 itkSetMacro(RegularizationMaximumNumberOfIterations, unsigned int);
278 itkGetConstMacro(RegularizationMaximumNumberOfIterations, unsigned int);
279
281 itkGetModifiableObjectMacro(MultiResolutionRegistrationMethod, RegistrationMethodType);
282
283protected:
285
286 void
288
289 virtual void
291
293 void
294 GenerateData() override;
295
296
297private:
302
304
306
307 typename LevelRegistrationMethodType::Pointer m_LevelRegistrationMethod;
310
316
321
322 typename MetricImageFilterType::Pointer m_MetricImageFilter;
323
324 typename BlockTransformMetricImageFilterType::Pointer m_BlockTransformMetricImageFilter;
326
328
331
333
336
339
340 unsigned int m_Direction;
344
347};
348
349} // end namespace BlockMatching
350} // namespace itk
351
352#ifndef ITK_MANUAL_INSTANTIATION
353# include "itkBlockMatchingDisplacementPipeline.hxx"
354#endif
355
356#endif
Wrap of the vnl_amoeba algorithm.
SmartPointer< Self > Pointer
The metric image is regularized by neighboring metric images according to a Bayesian model before dis...
StrainWindowStrainFilterType::Pointer m_StrainWindowStrainFilter
BlockMatching:: ImageRegistrationMethod< FixedImageType, MovingImageType, MetricImageType, DisplacementImageType, CoordRepType > LevelRegistrationMethodType
Image< MovingPixelType, ImageDimension > MovingImageType
ImageToImageFilter< FixedImageType, DisplacementImageType > Superclass
BlockMatching:: BlockAffineTransformMetricImageFilter< FixedImageType, MovingImageType, MetricImageType, MetricPixelType > BlockTransformMetricImageFilterType
FixedArray< SizeValueType, ImageDimension > BlockRadiusType
Function::WelchWindowFunction< OPTIMIZING_INTERPOLATOR_RADIUS > WindowType
StrainImageFilter< DisplacementImageType, MetricPixelType, MetricPixelType > StrainWindowStrainFilterType
Function::WelchWindowFunction< RESAMPLE_RADIUS > ResampleWindowType
BlockMatching::StrainWindowBlockAffineTransformCommand< StrainWindowDisplacementCalculatorType, BlockTransformMetricImageFilterType, StrainWindowStrainFilterType > BlockTransformCommandType
WindowedSincInterpolateImageFunction< MovingImageType, RESAMPLE_RADIUS, ResampleWindowType, MovingBoundaryConditionType, CoordRepType > MovingResamplerInterpolatorType
BlockMatching:: NormalizedCrossCorrelationNeighborhoodIteratorMetricImageFilter< FixedImageType, MovingImageType, MetricImageType > MetricImageFilterType
ZeroFluxNeumannBoundaryCondition< MovingImageType > MovingBoundaryConditionType
HigherOrderAccurateGradientFilterType::Pointer m_HigherOrderAccurateGradientFilter
typename StrainFilterType::OutputImageType TensorImageType
BlockMatching::StrainWindowDisplacementCalculator< MetricImageType, DisplacementImageType, MetricPixelType > StrainWindowDisplacementCalculatorType
ZeroFluxNeumannBoundaryCondition< MetricImageType > ResampleBoundaryConditionType
ResampleImageFilter< FixedImageType, FixedImageType, CoordRepType > FixedResamplerType
WindowedSincInterpolateImageFunction< FixedImageType, RESAMPLE_RADIUS, ResampleWindowType, FixedBoundaryConditionType, CoordRepType > FixedResamplerInterpolatorType
FixedResamplerInterpolatorType::Pointer m_FixedResamplerInterpolator
typename MetricImageType::SpacingType RegularizationStrainSigmaType
LinearLeastSquaresGradientFilterType::Pointer m_LinearLeastSquaresGradientFilter
HigherOrderAccurateGradientImageFilter< MetricImageType, MetricPixelType, MetricPixelType > HigherOrderAccurateGradientFilterType
BlockMatching::MultiResolutionIterationDisplacementCalculatorCommand< RegistrationMethodType > DisplacementCalculatorCommandType
BlockMatching::BayesianRegularizationDisplacementCalculator< MetricImageType, DisplacementImageType > DisplacmentRegularizerType
ZeroFluxNeumannBoundaryCondition< FixedImageType > FixedBoundaryConditionType
BlockMatching::MultiResolutionMinMaxSearchRegionImageSource< FixedImageType, MovingImageType, DisplacementImageType > SearchRegionImageSourceType
MovingResamplerInterpolatorType::Pointer m_MovingResamplerInterpolator
LinearLeastSquaresGradientImageFilter< MetricImageType, MetricPixelType, MetricPixelType > LinearLeastSquaresGradientFilterType
BlockMatching::MultiResolutionImageRegistrationMethod< FixedImageType, MovingImageType, MetricImageType, DisplacementImageType, CoordRepType > RegistrationMethodType
DisplacementCalculatorCommandType::Pointer m_DisplacementCalculatorCommand
SearchRegionImageSourceType::Pointer m_SearchRegionImageSource
StrainWindowDisplacementCalculatorType::Pointer m_StrainWindower
Image< MetricPixelType, ImageDimension > MetricImageType
BlockMatching::MultiResolutionMinMaxBlockRadiusCalculator< FixedImageType > BlockRadiusCalculatorType
BlockMatching::ParabolicInterpolationDisplacementCalculator< MetricImageType, DisplacementImageType > ParabolicInterpolatorType
WindowedSincInterpolateImageFunction< MetricImageType, OPTIMIZING_INTERPOLATOR_RADIUS, WindowType, ResampleBoundaryConditionType, CoordRepType > SubsampleInterpolatorType
StrainImageFilter< DisplacementImageType, MetricPixelType, MetricPixelType > StrainFilterType
BlockMatching::MaximumPixelDisplacementCalculator< MetricImageType, DisplacementImageType > MaximumPixelDisplacementCalculatorType
BlockMatching::OptimizingInterpolationDisplacementCalculator< MetricImageType, DisplacementImageType > FinalInterpolatorType
BlockTransformMetricImageFilterType::Pointer m_BlockTransformMetricImageFilter
LevelRegistrationMethodType::Pointer m_LevelRegistrationMethod
ResampleImageFilter< MovingImageType, MovingImageType, CoordRepType > MovingResamplerType
typename SearchRegionImageSourceType::FactorType SearchRegionFactorType
Vector< MetricPixelType, ImageDimension > VectorType
MaximumPixelDisplacementCalculatorType::Pointer m_MaximumPixelInterpolator
The displacement is taken to be the pixel with the maximum metric value.
Base class for multi-resolution image registration methods in the BlockMatching set of tools.
Change the displacement calculator and regulator iterations depending on the level in the pyramid.
The radius varies linearly from a minimum at the lowest level to a maximum at the highest level.
The displacement around the maximum pixel is interpolated with an interpolator and the maximizer is s...
The displacement around the maximum pixel is interpolated by a parabola in each direction and the pea...
Use the strain image calculated in the StrainWindowDisplacementCalculator as the deforming strain ima...
Displacements outside a strain window are interpolated by surrounding displacements.
Simulate a standard C array with copy semantics.
Calculate the image gradient from a higher order accurate central-difference derivative kernel.
Templated n-dimensional image class.
Definition itkImage.h:89
Vector< SpacingValueType, VImageDimension > SpacingType
Calculate the gradient using a linear least squares fit to values in the neighborhood slice.
virtual void SetNthInput(DataObjectPointerArraySizeType idx, DataObject *input)
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
Resample an image via a coordinate transform.
Implements transparent reference counting.
Generate a strain field image from a displacement field image.
A templated class holding a n-Dimensional vector.
Definition itkVector.h:63
A function object that determines a neighborhood of values at an image boundary according to a Neuman...
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
#define itkSetMacro(name, type)