go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkComputeJacobianTerms.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
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 * http://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 itkComputeJacobianTerms_h
19#define itkComputeJacobianTerms_h
20
21#include "itkImageGridSampler.h"
25
26namespace itk
27{
36template <class TFixedImage, class TTransform>
37class ITK_TEMPLATE_EXPORT ComputeJacobianTerms : public Object
38{
39public:
41
44 using Superclass = Object;
45 using Pointer = SmartPointer<Self>;
46 using ConstPointer = SmartPointer<const Self>;
47
49 itkNewMacro(Self);
50
52 itkTypeMacro(ComputeJacobianTerms, Object);
53
55 using FixedImageType = TFixedImage;
56 using TransformType = TTransform;
57 using TransformPointer = typename TransformType::Pointer;
58 using FixedImageRegionType = typename FixedImageType::RegionType;
59
63 itkStaticConstMacro(FixedImageDimension, unsigned int, TFixedImage::ImageDimension);
64 using FixedImageMaskType = ImageMaskSpatialObject<Self::FixedImageDimension>;
65 using FixedImageMaskPointer = typename FixedImageMaskType::Pointer;
66 using FixedImageMaskConstPointer = typename FixedImageMaskType::ConstPointer;
67
69 using ScaledCostFunctionPointer = typename ScaledSingleValuedNonLinearOptimizerType ::ScaledCostFunctionPointer;
71 using NonZeroJacobianIndicesType = typename TransformType::NonZeroJacobianIndicesType;
72
74 itkSetConstObjectMacro(FixedImage, FixedImageType);
75
77 itkSetObjectMacro(Transform, TransformType);
78
80 itkSetObjectMacro(FixedImageMask, FixedImageMaskType);
81 itkSetConstObjectMacro(FixedImageMask, FixedImageMaskType);
82 itkGetConstObjectMacro(FixedImageMask, FixedImageMaskType);
83
85 itkSetMacro(Scales, ScalesType);
86 itkSetMacro(UseScales, bool);
87 itkSetMacro(MaxBandCovSize, unsigned int);
88 itkSetMacro(NumberOfBandStructureSamples, unsigned int);
89 itkSetMacro(NumberOfJacobianMeasurements, SizeValueType);
90
92 void
94 {
95 if (region != this->m_FixedImageRegion)
96 {
97 this->m_FixedImageRegion = region;
98 }
99 }
100
101
103 itkGetConstReferenceMacro(FixedImageRegion, FixedImageRegionType);
104
106 virtual void
107 Compute(double & TrC, double & TrCC, double & maxJJ, double & maxJCJ);
108
109protected:
111 ~ComputeJacobianTerms() override = default;
112
113 typename FixedImageType::ConstPointer m_FixedImage{ nullptr };
114 FixedImageRegionType m_FixedImageRegion{};
115 FixedImageMaskConstPointer m_FixedImageMask{ nullptr };
116 TransformPointer m_Transform{ nullptr };
117 ScalesType m_Scales{};
118 bool m_UseScales{ false };
119
120 unsigned int m_MaxBandCovSize{ 0 };
121 unsigned int m_NumberOfBandStructureSamples{ 0 };
122 SizeValueType m_NumberOfJacobianMeasurements{ 0 };
123
124 using FixedImageIndexType = typename FixedImageType::IndexType;
125 using FixedImagePointType = typename FixedImageType::PointType;
126 using JacobianType = typename TransformType::JacobianType;
127 using JacobianValueType = typename JacobianType::ValueType;
128
134
137 using ImageSampleContainerType = typename ImageGridSamplerType ::ImageSampleContainerType;
138 using ImageSampleContainerPointer = typename ImageSampleContainerType::Pointer;
139
142 using CoordinateRepresentationType = typename TransformType::ScalarType;
143 using NumberOfParametersType = typename TransformType::NumberOfParametersType;
144
146 // \todo: note that this is an exact copy of itk::ComputeDisplacementDistribution
147 // in the future it would be better to refactoring this part of the code.
148 virtual void
150};
151
152} // end namespace itk
153
154#ifndef ITK_MANUAL_INSTANTIATION
155# include "itkComputeJacobianTerms.hxx"
156#endif
157
158#endif // end #ifndef itkComputeJacobianTerms_h
This is a helper class for the automatic parameter estimation of the ASGD optimizer.
typename TransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
typename ImageGridSamplerType ::ImageSampleContainerType ImageSampleContainerType
typename ImageSamplerBaseType::Pointer ImageSamplerBasePointer
ITK_DISALLOW_COPY_AND_MOVE(ComputeJacobianTerms)
typename ScaledSingleValuedNonLinearOptimizerType::ScalesType ScalesType
typename TransformType::ScalarType CoordinateRepresentationType
virtual void SampleFixedImageForJacobianTerms(ImageSampleContainerPointer &sampleContainer)
typename ImageSampleContainerType::Pointer ImageSampleContainerPointer
~ComputeJacobianTerms() override=default
typename FixedImageType::PointType FixedImagePointType
typename FixedImageType::IndexType FixedImageIndexType
typename FixedImageMaskType::Pointer FixedImageMaskPointer
void SetFixedImageRegion(const FixedImageRegionType &region)
typename TransformType::Pointer TransformPointer
typename JacobianType::ValueType JacobianValueType
itkStaticConstMacro(FixedImageDimension, unsigned int, TFixedImage::ImageDimension)
typename ImageGridSamplerType::Pointer ImageGridSamplerPointer
virtual void Compute(double &TrC, double &TrCC, double &maxJJ, double &maxJCJ)
ImageMaskSpatialObject< Self::FixedImageDimension > FixedImageMaskType
typename TransformType::NumberOfParametersType NumberOfParametersType
typename TransformType::JacobianType JacobianType
typename FixedImageType::RegionType FixedImageRegionType
typename FixedImageMaskType::ConstPointer FixedImageMaskConstPointer
typename ImageRandomSamplerBaseType::Pointer ImageRandomSamplerBasePointer
SmartPointer< const Self > ConstPointer
typename ScaledSingleValuedNonLinearOptimizerType ::ScaledCostFunctionPointer ScaledCostFunctionPointer
Samples image voxels on a regular grid.
This class is a base class for any image sampler that randomly picks samples.
This class is a base class for any image sampler.


Generated on 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo