ITK  5.2.0
Insight Toolkit
itkBSplineTransform.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  * 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 itkBSplineTransform_h
19 #define itkBSplineTransform_h
20 
22 
23 namespace itk
24 {
102 template <typename TParametersValueType = double, unsigned int NDimensions = 3, unsigned int VSplineOrder = 3>
103 class ITK_TEMPLATE_EXPORT BSplineTransform
104  : public BSplineBaseTransform<TParametersValueType, NDimensions, VSplineOrder>
105 {
106 public:
107  ITK_DISALLOW_COPY_AND_MOVE(BSplineTransform);
108 
114 
116  itkNewMacro(Self);
117 
119  itkTypeMacro(BSplineTransform, BSplineBaseTransform);
120 
122  static constexpr unsigned int SpaceDimension = NDimensions;
123 
125  static constexpr unsigned int SplineOrder = VSplineOrder;
126 
128  using ScalarType = typename Superclass::ScalarType;
129 
131  using ParametersType = typename Superclass::ParametersType;
132  using ParametersValueType = typename Superclass::ParametersValueType;
133  using FixedParametersType = typename Superclass::FixedParametersType;
134  using FixedParametersValueType = typename Superclass::FixedParametersValueType;
135 
137  using JacobianType = typename Superclass::JacobianType;
138  using JacobianPositionType = typename Superclass::JacobianPositionType;
139  using InverseJacobianPositionType = typename Superclass::InverseJacobianPositionType;
140 
142  using NumberOfParametersType = typename Superclass::NumberOfParametersType;
143 
145  using InputVectorType = typename Superclass::InputVectorType;
146  using OutputVectorType = typename Superclass::OutputVectorType;
147 
149  using InputCovariantVectorType = typename Superclass::InputCovariantVectorType;
150  using OutputCovariantVectorType = typename Superclass::OutputCovariantVectorType;
151 
153  using InputVnlVectorType = typename Superclass::InputVnlVectorType;
154  using OutputVnlVectorType = typename Superclass::OutputVnlVectorType;
155 
157  using InputPointType = typename Superclass::InputPointType;
158  using OutputPointType = typename Superclass::OutputPointType;
159 
160 
161  std::string
162  GetTransformTypeAsString() const override;
163 
186  void
187  SetFixedParameters(const FixedParametersType & parameters) override;
189 
191  using ImageType = typename Superclass::ImageType;
192  using ImagePointer = typename Superclass::ImagePointer;
193  using CoefficientImageArray = typename Superclass::CoefficientImageArray;
194 
206  void
207  SetCoefficientImages(const CoefficientImageArray & images) override;
208 
211 
213  using SizeType = typename Superclass::SizeType;
214  using SpacingType = typename Superclass::SpacingType;
216  using OriginType = typename Superclass::OriginType;
217 
219  using WeightsFunctionType = typename Superclass::WeightsFunctionType;
220 
221  using WeightsType = typename Superclass::WeightsType;
222  using ContinuousIndexType = typename Superclass::ContinuousIndexType;
223 
225  using ParameterIndexArrayType = typename Superclass::ParameterIndexArrayType;
226 
235  using Superclass::TransformPoint;
236  void
237  TransformPoint(const InputPointType & inputPoint,
238  OutputPointType & outputPoint,
239  WeightsType & weights,
240  ParameterIndexArrayType & indices,
241  bool & inside) const override;
243 
245  void
246  ComputeJacobianWithRespectToParameters(const InputPointType &, JacobianType &) const override;
247 
250  GetNumberOfParameters() const override;
251 
254  GetNumberOfParametersPerDimension() const override;
255 
256  using PhysicalDimensionsType = typename Superclass::SpacingType;
257  using PixelType = typename Superclass::PixelType;
258 
259  using MeshSizeType = typename Superclass::MeshSizeType;
260 
262  virtual void
263  SetTransformDomainOrigin(const OriginType &);
264 
266  virtual OriginType
267  GetTransformDomainOrigin() const;
268 
270  virtual void
271  SetTransformDomainPhysicalDimensions(const PhysicalDimensionsType &);
272 
274  virtual PhysicalDimensionsType
275  GetTransformDomainPhysicalDimensions() const;
276 
278  virtual void
279  SetTransformDomainDirection(const DirectionType &);
280 
282  virtual DirectionType
283  GetTransformDomainDirection() const;
284 
286  virtual void
287  SetTransformDomainMeshSize(const MeshSizeType &);
288 
290  virtual MeshSizeType
291  GetTransformDomainMeshSize() const;
292 
293 protected:
295  void
296  PrintSelf(std::ostream & os, Indent indent) const override;
297 
299  ~BSplineTransform() override = default;
300 
301 private:
303  void
304  SetCoefficientImageInformationFromFixedParameters() override;
305 
307  void
309  void
311  void
313  {}
314  void
317 
319  bool
320  InsideValidRegion(ContinuousIndexType &) const override;
321 
322  void
323  SetFixedParametersFromCoefficientImageInformation();
324 
325  void
326  SetFixedParametersFromTransformDomainInformation(const OriginType & meshOrigin,
327  const PhysicalDimensionsType & meshPhysical,
328  const DirectionType & meshDirection,
329  const MeshSizeType & meshSize);
330 
331 }; // class BSplineTransform
332 } // namespace itk
333 
334 #ifndef ITK_MANUAL_INSTANTIATION
335 # include "itkBSplineTransform.hxx"
336 #endif
337 
338 #endif /* itkBSplineTransform_h */
itk::BSplineInterpolationWeightFunction
Returns the weights over the support region used for B-spline interpolation/reconstruction.
Definition: itkBSplineInterpolationWeightFunction.h:47
itk::BSplineBaseTransform::ImagePointer
typename ImageType::Pointer ImagePointer
Definition: itkBSplineBaseTransform.h:180
itk::BSplineTransform::SetFixedParametersGridSpacingFromTransformDomainInformation
void SetFixedParametersGridSpacingFromTransformDomainInformation() const override
Definition: itkBSplineTransform.h:312
itk::BSplineBaseTransform::OutputVnlVectorType
vnl_vector_fixed< TParametersValueType, SpaceDimension > OutputVnlVectorType
Definition: itkBSplineBaseTransform.h:85
itk::GTest::TypedefsAndConstructors::Dimension2::DirectionType
ImageBaseType::DirectionType DirectionType
Definition: itkGTestTypedefsAndConstructors.h:52
itk::BSplineBaseTransform::NumberOfParametersType
typename Superclass::NumberOfParametersType NumberOfParametersType
Definition: itkBSplineBaseTransform.h:73
itk::BSplineBaseTransform::InverseJacobianPositionType
typename Superclass::InverseJacobianPositionType InverseJacobianPositionType
Definition: itkBSplineBaseTransform.h:67
itk::BSplineBaseTransform::IndexType
typename RegionType::IndexType IndexType
Definition: itkBSplineBaseTransform.h:222
itk::BSplineBaseTransform::OriginType
typename ImageType::PointType OriginType
Definition: itkBSplineBaseTransform.h:226
itk::BSplineBaseTransform::FixedParametersType
typename Superclass::FixedParametersType FixedParametersType
Definition: itkBSplineBaseTransform.h:61
itk::BSplineTransform::SetFixedParametersGridSizeFromTransformDomainInformation
void SetFixedParametersGridSizeFromTransformDomainInformation() const override
Definition: itkBSplineTransform.h:308
itk::ImageRegion
An image region represents a structured region of data.
Definition: itkImageRegion.h:69
itk::BSplineBaseTransform::WeightsType
typename WeightsFunctionType::WeightsType WeightsType
Definition: itkBSplineBaseTransform.h:235
itk::BSplineBaseTransform::JacobianPositionType
typename Superclass::JacobianPositionType JacobianPositionType
Definition: itkBSplineBaseTransform.h:66
itk::Vector
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::BSplineBaseTransform::DirectionType
typename ImageType::DirectionType DirectionType
Definition: itkBSplineBaseTransform.h:225
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::BSplineTransform::SetFixedParametersGridOriginFromTransformDomainInformation
void SetFixedParametersGridOriginFromTransformDomainInformation() const override
Definition: itkBSplineTransform.h:310
itk::BSplineBaseTransform::InputVnlVectorType
vnl_vector_fixed< TParametersValueType, SpaceDimension > InputVnlVectorType
Definition: itkBSplineBaseTransform.h:84
itk::BSplineTransform::SetFixedParametersGridDirectionFromTransformDomainInformation
void SetFixedParametersGridDirectionFromTransformDomainInformation() const override
Definition: itkBSplineTransform.h:315
itk::BSplineTransform
Deformable transform using a BSpline representation.
Definition: itkBSplineTransform.h:103
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::BSplineBaseTransform::PixelType
typename ImageType::PixelType PixelType
Definition: itkBSplineBaseTransform.h:327
itk::BSplineBaseTransform::ScalarType
typename Superclass::ScalarType ScalarType
Definition: itkBSplineBaseTransform.h:58
itk::BSplineBaseTransform::MeshSizeType
SizeType MeshSizeType
Definition: itkBSplineBaseTransform.h:329
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::BSplineBaseTransform::SizeType
typename RegionType::SizeType SizeType
Definition: itkBSplineBaseTransform.h:223
itk::BSplineBaseTransform::ContinuousIndexType
typename WeightsFunctionType::ContinuousIndexType ContinuousIndexType
Definition: itkBSplineBaseTransform.h:236
itk::BSplineBaseTransform::SpacingType
typename ImageType::SpacingType SpacingType
Definition: itkBSplineBaseTransform.h:224
itk::FixedArray< ImagePointer, NDimensions >
itk::BSplineBaseTransform::ParametersValueType
typename ParametersType::ValueType ParametersValueType
Definition: itkBSplineBaseTransform.h:178
itk::CovariantVector
A templated class holding a n-Dimensional covariant vector.
Definition: itkCovariantVector.h:70
itk::BSplineTransform::FixedParametersValueType
typename Superclass::FixedParametersValueType FixedParametersValueType
Definition: itkBSplineTransform.h:134
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itkBSplineBaseTransform.h
itk::BSplineBaseTransform
A base class with common elements of BSplineTransform and BSplineDeformableTransform.
Definition: itkBSplineBaseTransform.h:34
itk::Array
Array class with size defined at construction time.
Definition: itkArray.h:47
itk::BSplineBaseTransform::ParametersType
typename Superclass::ParametersType ParametersType
Definition: itkBSplineBaseTransform.h:62
itk::Point
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:53
itk::BSplineBaseTransform::PhysicalDimensionsType
typename ImageType::SpacingType PhysicalDimensionsType
Definition: itkBSplineBaseTransform.h:326
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::BSplineBaseTransform::JacobianType
typename Superclass::JacobianType JacobianType
Definition: itkBSplineBaseTransform.h:65