go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkWeightedCombinationTransform.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 itkWeightedCombinationTransform_h
19#define itkWeightedCombinationTransform_h
20
22
23namespace itk
24{
25
41template <class TScalarType, unsigned int NInputDimensions = 3, unsigned int NOutputDimensions = 3>
42class ITK_TEMPLATE_EXPORT WeightedCombinationTransform
43 : public AdvancedTransform<TScalarType, NInputDimensions, NOutputDimensions>
44{
45public:
47
51 using Pointer = SmartPointer<Self>;
52 using ConstPointer = SmartPointer<const Self>;
53
55 itkNewMacro(Self);
56
59
61 itkStaticConstMacro(InputSpaceDimension, unsigned int, NInputDimensions);
62 itkStaticConstMacro(OutputSpaceDimension, unsigned int, NOutputDimensions);
63
65 using typename Superclass::ScalarType;
66 using typename Superclass::ParametersType;
67 using typename Superclass::NumberOfParametersType;
68 using typename Superclass::JacobianType;
69 using typename Superclass::InputVectorType;
70 using typename Superclass::OutputVectorType;
71 using typename Superclass::InputCovariantVectorType;
72 using typename Superclass::OutputCovariantVectorType;
73 using typename Superclass::InputVnlVectorType;
74 using typename Superclass::OutputVnlVectorType;
75 using typename Superclass::InputPointType;
76 using typename Superclass::OutputPointType;
80 using typename Superclass::SpatialHessianType;
82
84 using TransformType = Transform<TScalarType, NInputDimensions, NOutputDimensions>;
86 using TransformPointer = typename TransformType::Pointer;
87 using TransformContainerType = std::vector<TransformPointer>;
88
90 OutputPointType
91 TransformPoint(const InputPointType & inputPoint) const override;
92
94 OutputVectorType
95 TransformVector(const InputVectorType &) const override
96 {
97 itkExceptionMacro("TransformVector(const InputVectorType &) is not implemented for WeightedCombinationTransform");
98 }
99
100
101 OutputVnlVectorType
102 TransformVector(const InputVnlVectorType &) const override
103 {
104 itkExceptionMacro(
105 "TransformVector(const InputVnlVectorType &) is not implemented for WeightedCombinationTransform");
106 }
107
108
109 OutputCovariantVectorType
110 TransformCovariantVector(const InputCovariantVectorType &) const override
111 {
112 itkExceptionMacro("TransformCovariantVector(const InputCovariantVectorType &) is not implemented for "
113 "WeightedCombinationTransform");
114 }
115
116
122 void
123 GetJacobian(const InputPointType & inputPoint, JacobianType & jac, NonZeroJacobianIndicesType & nzji) const override;
124
128 void
129 SetParameters(const ParametersType & param) override;
130
132 void
133 SetFixedParameters(const ParametersType &) override
134 {
135 // \todo: to be implemented by Stefan
136 }
137
138
140 const ParametersType &
141 GetFixedParameters() const override
142 {
143 // \todo: to be implemented by Stefan: check this:
144 return this->m_FixedParameters;
145 }
146
147
149 NumberOfParametersType
150 GetNumberOfParameters() const override
151 {
152 return this->m_TransformContainer.size();
153 }
154
155
158 itkSetMacro(NormalizeWeights, bool);
159 itkGetConstMacro(NormalizeWeights, bool);
160
162 virtual void
164 {
165 this->m_TransformContainer = transformContainer;
166 this->Modified();
167 }
168
169
179 const TransformContainerType &
181 {
182 return this->m_TransformContainer;
183 }
184
185
187 void
188 GetSpatialJacobian(const InputPointType &, SpatialJacobianType &) const override
189 {
190 itkExceptionMacro("Not implemented for WeightedCombinationTransform");
191 }
192
193
194 void
195 GetSpatialHessian(const InputPointType &, SpatialHessianType &) const override
196 {
197 itkExceptionMacro("Not implemented for WeightedCombinationTransform");
198 }
199
200
201 void
202 GetJacobianOfSpatialJacobian(const InputPointType &,
204 NonZeroJacobianIndicesType &) const override
205 {
206 itkExceptionMacro("Not implemented for WeightedCombinationTransform");
207 }
208
209
210 void
211 GetJacobianOfSpatialJacobian(const InputPointType &,
214 NonZeroJacobianIndicesType &) const override
215 {
216 itkExceptionMacro("Not implemented for WeightedCombinationTransform");
217 }
218
219
220 void
221 GetJacobianOfSpatialHessian(const InputPointType &,
223 NonZeroJacobianIndicesType &) const override
224 {
225 itkExceptionMacro("Not implemented for WeightedCombinationTransform");
226 }
227
228
229 void
230 GetJacobianOfSpatialHessian(const InputPointType &,
233 NonZeroJacobianIndicesType &) const override
234 {
235 itkExceptionMacro("Not implemented for WeightedCombinationTransform");
236 }
237
238
239protected:
241 ~WeightedCombinationTransform() override = default;
242
243 TransformContainerType m_TransformContainer{};
244 double m_SumOfWeights{};
245
247 NonZeroJacobianIndicesType m_NonZeroJacobianIndices{};
248
249private:
250 // Private using-declarations, to avoid `-Woverloaded-virtual` warnings from GCC (GCC 11.4).
251 using Superclass::TransformCovariantVector;
252 using Superclass::TransformVector;
253
254 bool m_NormalizeWeights{};
255};
256
257} // end namespace itk
258
259#ifndef ITK_MANUAL_INSTANTIATION
260# include "itkWeightedCombinationTransform.hxx"
261#endif
262
263#endif
Transform maps points, vectors and covariant vectors from an input space to an output space.
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
Implements a weighted linear combination of multiple transforms.
Transform< TScalarType, NInputDimensions, NOutputDimensions > TransformType
void GetJacobianOfSpatialHessian(const InputPointType &, SpatialHessianType &, JacobianOfSpatialHessianType &, NonZeroJacobianIndicesType &) const override
virtual void SetTransformContainer(const TransformContainerType &transformContainer)
void SetFixedParameters(const ParametersType &) override
void GetSpatialHessian(const InputPointType &, SpatialHessianType &) const override
void GetJacobian(const InputPointType &inputPoint, JacobianType &jac, NonZeroJacobianIndicesType &nzji) const override
itkStaticConstMacro(OutputSpaceDimension, unsigned int, NOutputDimensions)
itkStaticConstMacro(InputSpaceDimension, unsigned int, NInputDimensions)
ITK_DISALLOW_COPY_AND_MOVE(WeightedCombinationTransform)
const ParametersType & GetFixedParameters() const override
std::vector< TransformPointer > TransformContainerType
OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &) const override
OutputVnlVectorType TransformVector(const InputVnlVectorType &) const override
void SetParameters(const ParametersType &param) override
void GetJacobianOfSpatialHessian(const InputPointType &, JacobianOfSpatialHessianType &, NonZeroJacobianIndicesType &) const override
const TransformContainerType & GetTransformContainer() const
void GetSpatialJacobian(const InputPointType &, SpatialJacobianType &) const override
OutputVectorType TransformVector(const InputVectorType &) const override
void GetJacobianOfSpatialJacobian(const InputPointType &, JacobianOfSpatialJacobianType &, NonZeroJacobianIndicesType &) const override
OutputPointType TransformPoint(const InputPointType &inputPoint) const override
NumberOfParametersType GetNumberOfParameters() const override
typename TransformType::Pointer TransformPointer
~WeightedCombinationTransform() override=default
void GetJacobianOfSpatialJacobian(const InputPointType &, SpatialJacobianType &, JacobianOfSpatialJacobianType &, NonZeroJacobianIndicesType &) const override


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