ITK  5.3.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 typename Superclass::ScalarType;
129 
131  using typename Superclass::ParametersType;
132  using typename Superclass::ParametersValueType;
133  using typename Superclass::FixedParametersType;
134  using typename Superclass::FixedParametersValueType;
135 
137  using typename Superclass::JacobianType;
138  using typename Superclass::JacobianPositionType;
139  using typename Superclass::InverseJacobianPositionType;
140 
142  using typename Superclass::NumberOfParametersType;
143 
145  using typename Superclass::InputVectorType;
146  using typename Superclass::OutputVectorType;
147 
149  using typename Superclass::InputCovariantVectorType;
150  using typename Superclass::OutputCovariantVectorType;
151 
153  using typename Superclass::InputVnlVectorType;
154  using typename Superclass::OutputVnlVectorType;
155 
157  using typename Superclass::InputPointType;
158  using typename Superclass::OutputPointType;
159 
160 
161  std::string
162  GetTransformTypeAsString() const override;
163 
186  void
187  SetFixedParameters(const FixedParametersType & passedParameters) override;
189 
191  using typename Superclass::ImageType;
192  using typename Superclass::ImagePointer;
193  using typename Superclass::CoefficientImageArray;
194 
206  void
207  SetCoefficientImages(const CoefficientImageArray & images) override;
208 
210  using typename Superclass::RegionType;
211 
212  using typename Superclass::IndexType;
213  using typename Superclass::SizeType;
214  using typename Superclass::SpacingType;
215  using typename Superclass::DirectionType;
216  using typename Superclass::OriginType;
217 
219  using typename Superclass::WeightsFunctionType;
220 
221  using typename Superclass::WeightsType;
222  using typename Superclass::ContinuousIndexType;
223 
225  using typename Superclass::ParameterIndexArrayType;
226 
235  using Superclass::TransformPoint;
236  void
237  TransformPoint(const InputPointType & point,
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 typename Superclass::PixelType;
258 
259  using 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::OptimizerParameters
Class to hold and manage different parameter types used during optimization.
Definition: itkOptimizerParameters.h:36
itk::BSplineTransform::SetFixedParametersGridSpacingFromTransformDomainInformation
void SetFixedParametersGridSpacingFromTransformDomainInformation() const override
Definition: itkBSplineTransform.h:312
itk::GTest::TypedefsAndConstructors::Dimension2::DirectionType
ImageBaseType::DirectionType DirectionType
Definition: itkGTestTypedefsAndConstructors.h:52
itk::BSplineBaseTransform::OriginType
typename ImageType::PointType OriginType
Definition: itkBSplineBaseTransform.h:226
itk::BSplineTransform::SetFixedParametersGridSizeFromTransformDomainInformation
void SetFixedParametersGridSizeFromTransformDomainInformation() const override
Definition: itkBSplineTransform.h:308
itk::BSplineBaseTransform::WeightsType
typename WeightsFunctionType::WeightsType WeightsType
Definition: itkBSplineBaseTransform.h:235
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::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::MeshSizeType
SizeType MeshSizeType
Definition: itkBSplineBaseTransform.h:330
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::FixedArray< ImagePointer, NDimensions >
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::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:327
itk::TransformBaseTemplate::NumberOfParametersType
IdentifierType NumberOfParametersType
Definition: itkTransformBase.h:91
itk::Array2D
Array2D class representing a 2D array with size defined at construction time.
Definition: itkArray2D.h:45