ITK  4.4.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 protected:
275  void PrintSelf( std::ostream & os, Indent indent ) const;
276 
278  virtual ~BSplineTransform();
279 
280 private:
281 
283  virtual void SetFixedParametersGridSizeFromTransformDomainInformation() const;
284 
286  virtual void SetFixedParametersGridOriginFromTransformDomainInformation() const;
287 
289  virtual void SetFixedParametersGridSpacingFromTransformDomainInformation() const;
290 
292  virtual void SetFixedParametersGridDirectionFromTransformDomainInformation() const;
293 
295  virtual void SetCoefficientImageInformationFromFixedParameters();
296 
297  BSplineTransform( const Self & ); // purposely not implemented
298  void operator=( const Self & ); // purposely not implemented
299 
301  virtual bool InsideValidRegion( ContinuousIndexType & ) const;
302 
307 
309 }; // class BSplineTransform
310 } // namespace itk
311 
312 #ifndef ITK_MANUAL_INSTANTIATION
313 #include "itkBSplineTransform.hxx"
314 #endif
315 
316 #endif /* __itkBSplineTransform_h */
317