ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkBSplineTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 {
104 template<typename TParametersValueType=double,
105  unsigned int NDimensions = 3,
106  unsigned int VSplineOrder = 3>
107 class ITK_TEMPLATE_EXPORT BSplineTransform :
108  public BSplineBaseTransform<TParametersValueType,NDimensions,VSplineOrder>
109 {
110 public:
111  ITK_DISALLOW_COPY_AND_ASSIGN(BSplineTransform);
112 
118 
120  itkNewMacro( Self );
121 
123  itkTypeMacro( BSplineTransform, BSplineBaseTransform );
124 
126  static constexpr unsigned int SpaceDimension = NDimensions;
127 
129  static constexpr unsigned int SplineOrder = VSplineOrder;
130 
132  using ScalarType = typename Superclass::ScalarType;
133 
135  using ParametersType = typename Superclass::ParametersType;
136  using ParametersValueType = typename Superclass::ParametersValueType;
137  using FixedParametersType = typename Superclass::FixedParametersType;
138  using FixedParametersValueType = typename Superclass::FixedParametersValueType;
139 
141  using JacobianType = typename Superclass::JacobianType;
142  using JacobianPositionType = typename Superclass::JacobianPositionType;
143  using InverseJacobianPositionType = typename Superclass::InverseJacobianPositionType;
144 
146  using NumberOfParametersType = typename Superclass::NumberOfParametersType;
147 
149  using InputVectorType = typename Superclass::InputVectorType;
150  using OutputVectorType = typename Superclass::OutputVectorType;
151 
153  using InputCovariantVectorType = typename Superclass::InputCovariantVectorType;
154  using OutputCovariantVectorType = typename Superclass::OutputCovariantVectorType;
155 
157  using InputVnlVectorType = typename Superclass::InputVnlVectorType;
158  using OutputVnlVectorType = typename Superclass::OutputVnlVectorType;
159 
161  using InputPointType = typename Superclass::InputPointType;
162  using OutputPointType = typename Superclass::OutputPointType;
163 
164 
165  std::string GetTransformTypeAsString() const override;
166 
189  void SetFixedParameters( const FixedParametersType & parameters ) override;
191 
193  using ImageType = typename Superclass::ImageType;
194  using ImagePointer = typename Superclass::ImagePointer;
195  using CoefficientImageArray = typename Superclass::CoefficientImageArray;
196 
208  void SetCoefficientImages( const CoefficientImageArray & images ) override;
209 
212 
214  using SizeType = typename Superclass::SizeType;
215  using SpacingType = typename Superclass::SpacingType;
217  using OriginType = typename Superclass::OriginType;
218 
220  using WeightsFunctionType = typename Superclass::WeightsFunctionType;
221 
222  using WeightsType = typename Superclass::WeightsType;
223  using ContinuousIndexType = typename Superclass::ContinuousIndexType;
224 
226  using ParameterIndexArrayType = typename Superclass::ParameterIndexArrayType;
227 
236  using Superclass::TransformPoint;
237  void TransformPoint( const InputPointType & inputPoint, OutputPointType & outputPoint,
238  WeightsType & weights, ParameterIndexArrayType & indices, bool & inside ) const override;
240 
242  void ComputeJacobianWithRespectToParameters( const InputPointType &, JacobianType & ) const override;
243 
245  NumberOfParametersType GetNumberOfParameters() const override;
246 
248  NumberOfParametersType GetNumberOfParametersPerDimension() const override;
249 
250  using PhysicalDimensionsType = typename Superclass::SpacingType;
251  using PixelType = typename Superclass::PixelType;
252 
253  using MeshSizeType = typename Superclass::MeshSizeType;
254 
256  virtual void SetTransformDomainOrigin( const OriginType & );
257 
259  virtual OriginType GetTransformDomainOrigin( void ) const;
260 
262  virtual void SetTransformDomainPhysicalDimensions( const PhysicalDimensionsType & );
263 
265  virtual PhysicalDimensionsType GetTransformDomainPhysicalDimensions(void) const;
266 
268  virtual void SetTransformDomainDirection( const DirectionType & );
269 
271  virtual DirectionType GetTransformDomainDirection( void ) const;
272 
274  virtual void SetTransformDomainMeshSize( const MeshSizeType & );
275 
277  virtual MeshSizeType GetTransformDomainMeshSize( void ) const;
278 
279 protected:
281  void PrintSelf( std::ostream & os, Indent indent ) const override;
282 
284  ~BSplineTransform() override = default;
285 
286 private:
287 
289  void SetCoefficientImageInformationFromFixedParameters() override;
290 
297 
299  bool InsideValidRegion( ContinuousIndexType & ) const override;
300 
301  void SetFixedParametersFromCoefficientImageInformation();
302 
303  void SetFixedParametersFromTransformDomainInformation( const OriginType &meshOrigin,
304  const PhysicalDimensionsType & meshPhysical,
305  const DirectionType &meshDirection,
306  const MeshSizeType &meshSize);
307 
308 }; // class BSplineTransform
309 } // namespace itk
310 
311 #ifndef ITK_MANUAL_INSTANTIATION
312 #include "itkBSplineTransform.hxx"
313 #endif
314 
315 #endif /* itkBSplineTransform_h */
Array class with size defined at construction time.
Definition: itkArray.h:46
vnl_vector_fixed< TParametersValueType, SpaceDimension > OutputVnlVectorType
Light weight base class for most itk classes.
typename ImageType::PixelType PixelType
virtual void SetFixedParametersGridOriginFromTransformDomainInformation() const override
typename ImageType::SpacingType SpacingType
typename ParametersType::ValueType ParametersValueType
typename Superclass::FixedParametersValueType FixedParametersValueType
Deformable transform using a BSpline representation.
typename Superclass::NumberOfParametersType NumberOfParametersType
virtual void SetFixedParametersGridDirectionFromTransformDomainInformation() const override
typename Superclass::ParametersType ParametersType
An image region represents a structured region of data.
typename Superclass::FixedParametersType FixedParametersType
typename ImageType::DirectionType DirectionType
typename ImageType::SpacingType PhysicalDimensionsType
virtual void SetFixedParametersGridSpacingFromTransformDomainInformation() const override
typename WeightsFunctionType::ContinuousIndexType ContinuousIndexType
typename ImageType::PointType OriginType
typename Superclass::JacobianPositionType JacobianPositionType
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
typename RegionType::IndexType IndexType
virtual void SetFixedParametersGridSizeFromTransformDomainInformation() const override
A base class with common elements of BSplineTransform and BSplineDeformableTransform.
typename WeightsFunctionType::WeightsType WeightsType
typename Superclass::InverseJacobianPositionType InverseJacobianPositionType
typename RegionType::SizeType SizeType
typename Superclass::JacobianType JacobianType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:52
typename Superclass::ScalarType ScalarType
Returns the weights over the support region used for B-spline interpolation/reconstruction.
A templated class holding a n-Dimensional covariant vector.
vnl_vector_fixed< TParametersValueType, SpaceDimension > InputVnlVectorType
Templated n-dimensional image class.
Definition: itkImage.h:75
typename ImageType::Pointer ImagePointer