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
30#include "ITKOptimizersv4Export.h"
31
32namespace itk
33{
55// Define how to print enumeration
56extern ITKOptimizersv4_EXPORT std::ostream &
58
79template <typename TMetric>
80class ITK_TEMPLATE_EXPORT RegistrationParameterScalesEstimator
81 : public OptimizerParameterScalesEstimatorTemplate<typename TMetric::ParametersValueType>
82{
83public:
84 ITK_DISALLOW_COPY_AND_MOVE(RegistrationParameterScalesEstimator);
85
91
93 itkOverrideGetNameOfClassMacro(RegistrationParameterScalesEstimator);
94
96 using typename Superclass::ScalesType;
97
99 using typename Superclass::ParametersType;
100
102 using typename Superclass::FloatType;
103
104 using MetricType = TMetric;
105 using MetricPointer = typename MetricType::Pointer;
106 using MetricConstPointer = typename MetricType::ConstPointer;
107
109 using FixedTransformType = typename MetricType::FixedTransformType;
110 using FixedTransformConstPointer = typename FixedTransformType::ConstPointer;
111
112 using MovingTransformType = typename MetricType::MovingTransformType;
113 using MovingTransformConstPointer = typename MovingTransformType::ConstPointer;
114
116 static constexpr SizeValueType FixedDimension = TMetric::FixedDimension;
117 static constexpr SizeValueType MovingDimension = TMetric::MovingDimension;
118 static constexpr SizeValueType VirtualDimension = TMetric::VirtualDimension;
119
120 using VirtualImageType = typename TMetric::VirtualImageType;
121 using VirtualImageConstPointer = typename TMetric::VirtualImageConstPointer;
122 using VirtualImagePointer = typename TMetric::VirtualImagePointer;
123 using VirtualSpacingType = typename TMetric::VirtualSpacingType;
124 using VirtualRegionType = typename TMetric::VirtualRegionType;
125 using VirtualSizeType = typename TMetric::VirtualSizeType;
126 using VirtualPointType = typename TMetric::VirtualPointType;
127 using VirtualIndexType = typename TMetric::VirtualIndexType;
128
129 using VirtualPointSetType = typename TMetric::VirtualPointSetType;
130 using VirtualPointSetPointer = typename TMetric::VirtualPointSetPointer;
131
134#if !defined(ITK_LEGACY_REMOVE)
135 // We need to expose the enum values at the class level
136 // for backwards compatibility
137 static constexpr SamplingStrategyType FullDomainSampling = SamplingStrategyType::FullDomainSampling;
138 static constexpr SamplingStrategyType CornerSampling = SamplingStrategyType::CornerSampling;
139 static constexpr SamplingStrategyType RandomSampling = SamplingStrategyType::RandomSampling;
140 static constexpr SamplingStrategyType CentralRegionSampling = SamplingStrategyType::CentralRegionSampling;
141 static constexpr SamplingStrategyType VirtualDomainPointSetSampling =
142 SamplingStrategyType::VirtualDomainPointSetSampling;
143#endif
144
145 using SamplePointContainerType = std::vector<VirtualPointType>;
146
148 using JacobianType = typename TMetric::JacobianType;
149
155 itkSetObjectMacro(Metric, MetricType);
156 itkGetConstObjectMacro(Metric, MetricType);
163 itkSetMacro(TransformForward, bool);
164 itkGetConstMacro(TransformForward, bool);
165 itkBooleanMacro(TransformForward);
169#ifndef ITK_FUTURE_LEGACY_REMOVE
170 virtual void
172 {
173 const auto * const constArg = arg;
174 // Call the overload defined by itkSetConstObjectMacro, or an override.
175 this->SetVirtualDomainPointSet(constArg);
176 }
177#endif
178 itkSetConstObjectMacro(VirtualDomainPointSet, VirtualPointSetType);
179 itkGetConstObjectMacro(VirtualDomainPointSet, VirtualPointSetType);
183 itkSetMacro(CentralRegionRadius, IndexValueType);
184 itkGetConstMacro(CentralRegionRadius, IndexValueType);
187 void
188 EstimateScales(ScalesType & scales) override = 0;
189
192 EstimateStepScale(const ParametersType & step) override = 0;
193
195 void
196 EstimateLocalStepScales(const ParametersType & step, ScalesType & localStepScales) override = 0;
197
201
203 virtual void
205
207 virtual void
209
210protected:
213
214 void
215 PrintSelf(std::ostream & os, Indent indent) const override;
216
218 bool
220
222 itkSetMacro(NumberOfRandomSamples, SizeValueType);
223
227
232 bool
234
243 template <typename TTransform>
244 bool
246
252 template <typename TTargetPointType>
253 void
254 TransformPoint(const VirtualPointType & point, TTargetPointType & mappedPoint);
255
257 template <typename TContinuousIndexType>
258 void
259 TransformPointToContinuousIndex(const VirtualPointType & point, TContinuousIndexType & mappedIndex);
260
262 void
264
266 bool
268
270 bool
272
274 bool
276
280
282 void
284
286 virtual void
288
290 void
292
297 void
299
301 void
303
308 void
310
312 void
314
316 void
318
325
329
333
337
341
344
347
350
353
356
357 typename VirtualPointSetType::ConstPointer m_VirtualDomainPointSet{};
358
359 // the threshold to decide if the number of random samples uses logarithm
360 static constexpr SizeValueType SizeOfSmallDomain = 1000;
361
362private:
368
369 // sampling strategy
371
372}; // class RegistrationParameterScalesEstimator
373} // namespace itk
374
375
376#ifndef ITK_MANUAL_INSTANTIATION
377# include "itkRegistrationParameterScalesEstimator.hxx"
378#endif
379
380#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, typename AnatomicalOrientation::CoordinateEnum value)
long IndexValueType
Definition itkIntTypes.h:93