ITK  5.4.0
Insight Toolkit
itkBSplineDeformableTransform.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 itkBSplineDeformableTransform_h
19#define itkBSplineDeformableTransform_h
20
22
23namespace itk
24{
112template <typename TParametersValueType = double, unsigned int VDimension = 3, unsigned int VSplineOrder = 3>
113class ITK_TEMPLATE_EXPORT BSplineDeformableTransform
114 : public BSplineBaseTransform<TParametersValueType, VDimension, VSplineOrder>
115{
116public:
117 ITK_DISALLOW_COPY_AND_MOVE(BSplineDeformableTransform);
118
124
126 // Explicit New() method, used here because we need to split the itkNewMacro()
127 // in order to overload the CreateAnother() method so that we can copy the m_BulkTransform
128 // explicitly.
129 // TODO: shouldn't it be done with the Clone() method?
130 itkSimpleNewMacro(Self);
132 CreateAnother() const override
133 {
135 Pointer copyPtr = Self::New().GetPointer();
136 // THE FOLLOWING LINE IS DIFFERENT FROM THE DEFAULT MACRO!
137 copyPtr->m_BulkTransform = this->GetBulkTransform();
138 smartPtr = static_cast<Pointer>(copyPtr);
139 return smartPtr;
140 }
145
147 itkOverrideGetNameOfClassMacro(BSplineDeformableTransform);
148
150 static constexpr unsigned int SpaceDimension = VDimension;
151
153 static constexpr unsigned int SplineOrder = VSplineOrder;
154
156 using ScalarType = TParametersValueType;
157
159 using typename Superclass::ParametersType;
160 using typename Superclass::ParametersValueType;
161 using typename Superclass::FixedParametersType;
162 using typename Superclass::FixedParametersValueType;
163
165 using typename Superclass::JacobianType;
166 using typename Superclass::JacobianPositionType;
167 using typename Superclass::InverseJacobianPositionType;
168
170 using typename Superclass::NumberOfParametersType;
171
173 using typename Superclass::InputVectorType;
174 using typename Superclass::OutputVectorType;
175
177 using typename Superclass::InputCovariantVectorType;
178 using typename Superclass::OutputCovariantVectorType;
179
181 using typename Superclass::InputVnlVectorType;
182 using typename Superclass::OutputVnlVectorType;
183
187
188
205 void
206 SetFixedParameters(const FixedParametersType & passedParameters) override;
210 using typename Superclass::ImageType;
211 using typename Superclass::ImagePointer;
212 using typename Superclass::CoefficientImageArray;
213
225 void
227
229 using typename Superclass::RegionType;
230
231 using typename Superclass::IndexType;
232 using typename Superclass::SizeType;
233 using typename Superclass::SpacingType;
234 using typename Superclass::DirectionType;
235 using typename Superclass::OriginType;
236
238 using typename Superclass::WeightsFunctionType;
239
240 using typename Superclass::WeightsType;
241 using typename Superclass::ContinuousIndexType;
242
244 using typename Superclass::ParameterIndexArrayType;
245
254 using Superclass::TransformPoint;
255 void
256 TransformPoint(const InputPointType & inputPoint,
257 OutputPointType & outputPoint,
258 WeightsType & weights,
259 ParameterIndexArrayType & indices,
260 bool & inside) const override;
263 void
265
268 GetNumberOfParameters() const override;
269
273
274 using PhysicalDimensionsType = typename Superclass::SpacingType;
275 using typename Superclass::PixelType;
276
277 using typename Superclass::MeshSizeType;
278
280 virtual void
282
284 itkGetConstMacro(GridOrigin, OriginType);
285
287 virtual void
289
291 itkGetConstMacro(GridSpacing, SpacingType);
292
294 virtual void
296
298 itkGetConstMacro(GridDirection, DirectionType);
299
301 virtual void
303
305 itkGetConstMacro(GridRegion, RegionType);
306
312 itkSetConstObjectMacro(BulkTransform, BulkTransformType);
313 itkGetConstObjectMacro(BulkTransform, BulkTransformType);
317 itkGetConstReferenceMacro(ValidRegion, RegionType);
318
319protected:
321 void
322 PrintSelf(std::ostream & os, Indent indent) const override;
323
325 ~BSplineDeformableTransform() override = default;
326
327private:
329 void
331
333 void
335
337 void
339
341 void
343
345 void
347
349 bool
351
360 const RegionType & m_GridRegion{};
361 const OriginType & m_GridOrigin{};
362 const SpacingType & m_GridSpacing{};
364
366 BulkTransformPointer m_BulkTransform{};
367
368 RegionType m_ValidRegion{};
369
371 unsigned long m_Offset{};
372 bool m_SplineOrderOdd{};
373 IndexType m_ValidRegionLast{};
374 IndexType m_ValidRegionFirst{};
375
376 void
378
379}; // class BSplineDeformableTransform
380} // namespace itk
381
382#ifndef ITK_MANUAL_INSTANTIATION
383# include "itkBSplineDeformableTransform.hxx"
384#endif
385
386#endif /* itkBSplineDeformableTransform_h */
Array2D class representing a 2D array.
Definition: itkArray2D.h:43
A base class with common elements of BSplineTransform and BSplineDeformableTransform.
typename WeightsFunctionType::ContinuousIndexType ContinuousIndexType
typename WeightsFunctionType::WeightsType WeightsType
typename ImageType::DirectionType DirectionType
Deformable transform using a BSpline representation.
void SetCoefficientImages(const CoefficientImageArray &images) override
typename Superclass::SpacingType PhysicalDimensionsType
void SetFixedParametersGridSizeFromTransformDomainInformation() const override
void ComputeJacobianWithRespectToParameters(const InputPointType &, JacobianType &) const override
void TransformPoint(const InputPointType &inputPoint, OutputPointType &outputPoint, WeightsType &weights, ParameterIndexArrayType &indices, bool &inside) const override
virtual void SetGridSpacing(const SpacingType &)
NumberOfParametersType GetNumberOfParameters() const override
itk::LightObject::Pointer CreateAnother() const override
virtual void SetGridDirection(const DirectionType &)
void SetFixedParameters(const FixedParametersType &passedParameters) override
void PrintSelf(std::ostream &os, Indent indent) const override
void SetFixedParametersGridDirectionFromTransformDomainInformation() const override
typename BulkTransformType::ConstPointer BulkTransformPointer
bool InsideValidRegion(ContinuousIndexType &) const override
void SetCoefficientImageInformationFromFixedParameters() override
virtual void SetGridOrigin(const OriginType &)
~BSplineDeformableTransform() override=default
virtual void SetGridRegion(const RegionType &)
void SetFixedParametersGridSpacingFromTransformDomainInformation() const override
NumberOfParametersType GetNumberOfParametersPerDimension() const override
void SetFixedParametersGridOriginFromTransformDomainInformation() const override
An image region represents a structured region of data.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Class to hold and manage different parameter types used during optimization.
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:54
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:84
SmartPointer< const Self > ConstPointer
static Pointer New()
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
*par Constraints *The filter image with at least two dimensions and a vector *length of at least The theory supports extension to scalar images