ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkRegistrationParameterScalesEstimator.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 itkRegistrationParameterScalesEstimator_h
19#define itkRegistrationParameterScalesEstimator_h
20
21#include "itkTransform.h"
26
28#include "ITKOptimizersv4Export.h"
29
30namespace itk
31{
53// Define how to print enumeration
54extern ITKOptimizersv4_EXPORT std::ostream &
56
77template <typename TMetric>
78class ITK_TEMPLATE_EXPORT RegistrationParameterScalesEstimator
79 : public OptimizerParameterScalesEstimatorTemplate<typename TMetric::ParametersValueType>
80{
81public:
82 ITK_DISALLOW_COPY_AND_MOVE(RegistrationParameterScalesEstimator);
83
89
91 itkOverrideGetNameOfClassMacro(RegistrationParameterScalesEstimator);
92
94 using typename Superclass::ScalesType;
95
97 using typename Superclass::ParametersType;
98
100 using typename Superclass::FloatType;
101
102 using MetricType = TMetric;
103 using MetricPointer = typename MetricType::Pointer;
104 using MetricConstPointer = typename MetricType::ConstPointer;
105
107 using FixedTransformType = typename MetricType::FixedTransformType;
108 using FixedTransformConstPointer = typename FixedTransformType::ConstPointer;
109
110 using MovingTransformType = typename MetricType::MovingTransformType;
111 using MovingTransformConstPointer = typename MovingTransformType::ConstPointer;
112
114 static constexpr SizeValueType FixedDimension = TMetric::FixedDimension;
115 static constexpr SizeValueType MovingDimension = TMetric::MovingDimension;
116 static constexpr SizeValueType VirtualDimension = TMetric::VirtualDimension;
117
118 using VirtualImageType = typename TMetric::VirtualImageType;
119 using VirtualImageConstPointer = typename TMetric::VirtualImageConstPointer;
120 using VirtualImagePointer = typename TMetric::VirtualImagePointer;
121 using VirtualSpacingType = typename TMetric::VirtualSpacingType;
122 using VirtualRegionType = typename TMetric::VirtualRegionType;
123 using VirtualSizeType = typename TMetric::VirtualSizeType;
124 using VirtualPointType = typename TMetric::VirtualPointType;
125 using VirtualIndexType = typename TMetric::VirtualIndexType;
126
127 using VirtualPointSetType = typename TMetric::VirtualPointSetType;
128 using VirtualPointSetPointer = typename TMetric::VirtualPointSetPointer;
129
132#if !defined(ITK_LEGACY_REMOVE)
133 // We need to expose the enum values at the class level
134 // for backwards compatibility
135 static constexpr SamplingStrategyType FullDomainSampling = SamplingStrategyType::FullDomainSampling;
136 static constexpr SamplingStrategyType CornerSampling = SamplingStrategyType::CornerSampling;
137 static constexpr SamplingStrategyType RandomSampling = SamplingStrategyType::RandomSampling;
138 static constexpr SamplingStrategyType CentralRegionSampling = SamplingStrategyType::CentralRegionSampling;
139 static constexpr SamplingStrategyType VirtualDomainPointSetSampling =
140 SamplingStrategyType::VirtualDomainPointSetSampling;
141#endif
142
143 using SamplePointContainerType = std::vector<VirtualPointType>;
144
146 using JacobianType = typename TMetric::JacobianType;
147
153 itkSetObjectMacro(Metric, MetricType);
154 itkGetConstObjectMacro(Metric, MetricType);
161 itkSetMacro(TransformForward, bool);
162 itkGetConstMacro(TransformForward, bool);
163 itkBooleanMacro(TransformForward);
167#ifndef ITK_FUTURE_LEGACY_REMOVE
168 virtual void
170 {
171 const auto * const constArg = arg;
172 // Call the overload defined by itkSetConstObjectMacro, or an override.
173 this->SetVirtualDomainPointSet(constArg);
174 }
175#endif
176 itkSetConstObjectMacro(VirtualDomainPointSet, VirtualPointSetType);
177 itkGetConstObjectMacro(VirtualDomainPointSet, VirtualPointSetType);
181 itkSetMacro(CentralRegionRadius, IndexValueType);
182 itkGetConstMacro(CentralRegionRadius, IndexValueType);
185 void
186 EstimateScales(ScalesType & scales) override = 0;
187
190 EstimateStepScale(const ParametersType & step) override = 0;
191
193 void
194 EstimateLocalStepScales(const ParametersType & step, ScalesType & localStepScales) override = 0;
195
199
201 virtual void
203
205 virtual void
207
208protected:
211
212 void
213 PrintSelf(std::ostream & os, Indent indent) const override;
214
216 bool
218
220 itkSetMacro(NumberOfRandomSamples, SizeValueType);
221
225
230 bool
232
241 template <typename TTransform>
242 bool
244
250 template <typename TTargetPointType>
251 void
252 TransformPoint(const VirtualPointType & point, TTargetPointType & mappedPoint);
253
255 template <typename TContinuousIndexType>
256 void
257 TransformPointToContinuousIndex(const VirtualPointType & point, TContinuousIndexType & mappedIndex);
258
260 void
262
264 bool
266
268 bool
270
272 bool
274
278
280 void
282
284 virtual void
286
288 void
290
295 void
297
299 void
301
306 void
308
310 void
312
314 void
316
323
327
331
335
339
342
345
348
351
354
355 typename VirtualPointSetType::ConstPointer m_VirtualDomainPointSet{};
356
357 // the threshold to decide if the number of random samples uses logarithm
358 static constexpr SizeValueType SizeOfSmallDomain = 1000;
359
360private:
366
367 // sampling strategy
369
370}; // class RegistrationParameterScalesEstimator
371} // namespace itk
372
373
374#ifndef ITK_MANUAL_INSTANTIATION
375# include "itkRegistrationParameterScalesEstimator.hxx"
376#endif
377
378#endif /* itkRegistrationParameterScalesEstimator_h */
Control indentation during Print() invocation.
Definition itkIndent.h:50
This class contains all the enum classes used by RegistrationParameterScalesEstimator class.
virtual void SetVirtualDomainPointSet(const VirtualPointSetType *_arg)
void UpdateTransformParameters(const ParametersType &deltaParameters)
OptimizerParameterScalesEstimatorTemplate< typename TMetric::ParametersValueType > Superclass
void PrintSelf(std::ostream &os, Indent indent) const override
VirtualRegionType GetVirtualDomainCentralRegion()
const TransformBaseTemplate< typename TMetric::MeasureType > * GetTransform()
void TransformPointToContinuousIndex(const VirtualPointType &point, TContinuousIndexType &mappedIndex)
void ComputeSquaredJacobianNorms(const VirtualPointType &point, ParametersType &squareNorms)
typename MovingTransformType::ConstPointer MovingTransformConstPointer
void SampleVirtualDomainWithRegion(VirtualRegionType region)
FloatType EstimateMaximumStepSize() override
typename TMetric::VirtualPointSetPointer VirtualPointSetPointer
typename FixedTransformType::ConstPointer FixedTransformConstPointer
void EstimateLocalStepScales(const ParametersType &step, ScalesType &localStepScales) override=0
typename TMetric::VirtualImageConstPointer VirtualImageConstPointer
~RegistrationParameterScalesEstimator() override=default
FloatType EstimateStepScale(const ParametersType &step) override=0
void TransformPoint(const VirtualPointType &point, TTargetPointType &mappedPoint)
void EstimateScales(ScalesType &scales) override=0
Implements transparent reference counting.
Generate a unique, increasing time value.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
RegistrationParameterScalesEstimatorEnums::SamplingStrategy SamplingStrategyEnum
unsigned long SizeValueType
Definition itkIntTypes.h:86
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, AnatomicalOrientation::CoordinateEnum value)
long IndexValueType
Definition itkIntTypes.h:93