ITK  4.2.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 {
108 template <class TScalarType = double, unsigned int NDimensions = 3,
109  unsigned int VSplineOrder = 3>
110 class ITK_EXPORT BSplineTransform :
111  public BSplineBaseTransform<TScalarType,NDimensions,VSplineOrder>
112 {
113 public:
119 
121  itkNewMacro( Self );
122 
124  itkTypeMacro( BSplineTransform, BSplineBaseTransform );
125 
127  itkStaticConstMacro( SpaceDimension, unsigned int, NDimensions );
128 
130  itkStaticConstMacro( SplineOrder, unsigned int, VSplineOrder );
131 
133  typedef typename Superclass::ScalarType ScalarType;
134 
136  typedef typename Superclass::ParametersType ParametersType;
137 
139  typedef typename Superclass::JacobianType JacobianType;
140 
142  typedef typename Superclass::NumberOfParametersType NumberOfParametersType;
143 
145  typedef typename Superclass::InputVectorType InputVectorType;
146  typedef typename Superclass::OutputVectorType OutputVectorType;
147 
149  typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
150  typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
151 
153  typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
154  typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
155 
157  typedef typename Superclass::InputPointType InputPointType;
158  typedef typename Superclass::OutputPointType OutputPointType;
159 
160 
183  virtual void SetFixedParameters( const ParametersType & parameters );
185 
187  typedef typename Superclass::ParametersValueType ParametersValueType;
188  typedef typename Superclass::ImageType ImageType;
189  typedef typename Superclass::ImagePointer ImagePointer;
190  typedef typename Superclass::CoefficientImageArray CoefficientImageArray;
191 
203  virtual void SetCoefficientImages( const CoefficientImageArray & images );
204 
206  typedef typename Superclass::RegionType RegionType;
207 
208  typedef typename Superclass::IndexType IndexType;
209  typedef typename Superclass::SizeType SizeType;
211  typedef typename Superclass::DirectionType DirectionType;
212  typedef typename Superclass::OriginType OriginType;
213 
215  typedef typename Superclass::WeightsFunctionType WeightsFunctionType;
216 
217  typedef typename Superclass::WeightsType WeightsType;
218  typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
219 
221  typedef typename Superclass::ParameterIndexArrayType ParameterIndexArrayType;
222 
231  using Superclass::TransformPoint;
232  virtual void TransformPoint( const InputPointType & inputPoint, OutputPointType & outputPoint,
233  WeightsType & weights, ParameterIndexArrayType & indices, bool & inside ) const;
235 
236  virtual void ComputeJacobianWithRespectToParameters( const InputPointType &, JacobianType & ) const;
237 
239  virtual NumberOfParametersType GetNumberOfParameters() const;
240 
242  NumberOfParametersType GetNumberOfParametersPerDimension() const;
243 
245  typedef typename Superclass::PixelType PixelType;
246 
247  typedef typename Superclass::MeshSizeType MeshSizeType;
248 
250  virtual void SetTransformDomainOrigin( const OriginType & );
251 
253  itkGetConstMacro( TransformDomainOrigin, OriginType );
254 
256  virtual void SetTransformDomainPhysicalDimensions( const PhysicalDimensionsType & );
257 
259  itkGetConstMacro( TransformDomainPhysicalDimensions, PhysicalDimensionsType );
260 
262  virtual void SetTransformDomainDirection( const DirectionType & );
263 
265  itkGetConstMacro( TransformDomainDirection, DirectionType );
266 
268  virtual void SetTransformDomainMeshSize( const MeshSizeType & );
269 
271  itkGetConstMacro( TransformDomainMeshSize, MeshSizeType );
272 
273  virtual bool HasLocalSupport() const
274  {
275  return false;
276  }
277 
278 protected:
280  void PrintSelf( std::ostream & os, Indent indent ) const;
281 
283  virtual ~BSplineTransform();
284 
285 private:
286 
288  virtual void SetFixedParametersGridSizeFromTransformDomainInformation() const;
289 
291  virtual void SetFixedParametersGridOriginFromTransformDomainInformation() const;
292 
294  virtual void SetFixedParametersGridSpacingFromTransformDomainInformation() const;
295 
297  virtual void SetFixedParametersGridDirectionFromTransformDomainInformation() const;
298 
300  virtual void SetCoefficientImageInformationFromFixedParameters();
301 
302  BSplineTransform( const Self & ); // purposely not implemented
303  void operator=( const Self & ); // purposely not implemented
304 
306  virtual bool InsideValidRegion( ContinuousIndexType & ) const;
307 
312 
314 }; // class BSplineTransform
315 } // namespace itk
316 
317 // Define instantiation macro for this template.
318 #define ITK_TEMPLATE_BSplineTransform(_, EXPORT, TypeX, TypeY) \
319  namespace itk \
320  { \
321  _( 3 ( class EXPORT BSplineTransform<ITK_TEMPLATE_3 TypeX> ) ) \
322  namespace Templates \
323  { \
324  typedef BSplineTransform<ITK_TEMPLATE_3 TypeX> \
325  BSplineTransform##TypeY; \
326  } \
327  }
328 
329 #if ITK_TEMPLATE_EXPLICIT
330 // template < class TScalarType, unsigned int NDimensions, unsigned int
331 // VSplineOrder >
332 // const unsigned int itk::BSplineTransform<TScalarType,
333 // NDimensions, VSplineOrder >::SpaceDimension;
334 // template < class TScalarType, unsigned int NDimensions, unsigned int
335 // VSplineOrder >
336 // const unsigned int itk::BSplineTransform<TScalarType,
337 // NDimensions, VSplineOrder >::SplineOrder;
338 #include "Templates/itkBSplineTransform+-.h"
339 #endif
340 
341 #if ITK_TEMPLATE_TXX
342 #include "itkBSplineTransform.hxx"
343 #endif
344 
345 #endif /* __itkBSplineTransform_h */
346