ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkBSplineDeformableTransform.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 __itkBSplineDeformableTransform_h
19 #define __itkBSplineDeformableTransform_h
20 
21 #include "itkConfigure.h" // Needed to determine value of ITKV3_COMPATIBILITY
23 
24 namespace itk
25 {
113 template <typename TScalar = double, unsigned int NDimensions = 3,
114  unsigned int VSplineOrder = 3>
116  public BSplineBaseTransform<TScalar,NDimensions,VSplineOrder>
117 {
118 public:
124 
126  // Explicit New() method, used here because we need to split the itkNewMacro()
127  // in order to overload the CreateAnother() method so that we can copy the m_BulkTransform
128  // explicitly.
129  // TODO: shouldn't it be done with the Clone() method?
130  itkSimpleNewMacro(Self);
131  virtual ::itk::LightObject::Pointer CreateAnother(void) const
132  {
134  Pointer copyPtr = Self::New().GetPointer();
135  //THE FOLLOWING LINE IS DIFFERENT FROM THE DEFAULT MACRO!
136  copyPtr->m_BulkTransform = this->GetBulkTransform();
137  smartPtr = static_cast<Pointer>( copyPtr );
138  return smartPtr;
139  }
141 
144 
147 
149  itkStaticConstMacro( SpaceDimension, unsigned int, NDimensions );
150 
152  itkStaticConstMacro( SplineOrder, unsigned int, VSplineOrder );
153 
156 
159 
162 
165 
169 
173 
177 
182 
183 
200  virtual void SetFixedParameters( const ParametersType & parameters );
202 
208 
220  virtual void SetCoefficientImages( const CoefficientImageArray & images );
221 
222 #ifdef ITKV3_COMPATIBILITY
223  virtual void SetCoefficientImage( const CoefficientImageArray & images )
224  {
225  this->SetCoefficientImages( images );
226  }
227  /* Only for backwards compatibility with ITKv3. */
228  CoefficientImageArray GetCoefficientImage()
229  {
230  return this->GetCoefficientImages();
231  }
232 #endif
233 
236 
238  typedef typename Superclass::SizeType SizeType;
242 
245 
248 
251 
261  virtual void TransformPoint( const InputPointType & inputPoint, OutputPointType & outputPoint,
262  WeightsType & weights, ParameterIndexArrayType & indices, bool & inside ) const;
264 
265  virtual void ComputeJacobianWithRespectToParameters( const InputPointType &, JacobianType & ) const;
266 
269 
272 
275 
277 
279  virtual void SetGridOrigin( const OriginType & );
280 
282  itkGetConstMacro( GridOrigin, OriginType );
283 
285  virtual void SetGridSpacing( const SpacingType & );
286 
288  itkGetConstMacro( GridSpacing, SpacingType );
289 
291  virtual void SetGridDirection( const DirectionType & );
292 
294  itkGetConstMacro( GridDirection, DirectionType );
295 
297  virtual void SetGridRegion( const RegionType & );
298 
300  itkGetConstMacro( GridRegion, RegionType );
301 
302  typedef Transform<ScalarType, itkGetStaticConstMacro(SpaceDimension),
303  itkGetStaticConstMacro(SpaceDimension)> BulkTransformType;
308  itkSetConstObjectMacro(BulkTransform, BulkTransformType);
309  itkGetConstObjectMacro(BulkTransform, BulkTransformType);
311 
313  itkGetConstReferenceMacro(ValidRegion, RegionType);
314 
315 protected:
317  void PrintSelf( std::ostream & os, Indent indent ) const;
318 
320  virtual ~BSplineDeformableTransform();
321 
322 private:
323 
326 
329 
332 
335 
338 
339  BSplineDeformableTransform( const Self & ); // purposely not implemented
340  void operator=( const Self & ); // purposely not implemented
341 
343  virtual bool InsideValidRegion( ContinuousIndexType & ) const;
344 
357 
360 
362 
364  unsigned long m_Offset;
368 
369  void UpdateValidGridRegion();
370 
371 }; // class BSplineDeformableTransform
372 } // namespace itk
373 
374 #ifndef ITK_MANUAL_INSTANTIATION
375 #include "itkBSplineDeformableTransform.hxx"
376 #endif
377 
378 #endif /* __itkBSplineDeformableTransform_h */
virtual void SetCoefficientImageInformationFromFixedParameters()
Light weight base class for most itk classes.
Image< ParametersValueType, itkGetStaticConstMacro(SpaceDimension)> ImageType
virtual void SetGridRegion(const RegionType &)
virtual NumberOfParametersType GetNumberOfParameters() const
Superclass::CoefficientImageArray CoefficientImageArray
NumberOfParametersType GetNumberOfParametersPerDimension() const
virtual void TransformPoint(const InputPointType &inputPoint, OutputPointType &outputPoint, WeightsType &weights, ParameterIndexArrayType &indices, bool &inside) const
virtual void SetFixedParametersGridOriginFromTransformDomainInformation() const
virtual void SetFixedParametersGridDirectionFromTransformDomainInformation() const
BSplineInterpolationWeightFunction< ScalarType, itkGetStaticConstMacro(SpaceDimension), itkGetStaticConstMacro(SplineOrder)> WeightsFunctionType
An image region represents a structured region of data.
WeightsFunctionType::ContinuousIndexType ContinuousIndexType
ObjectType * GetPointer() const
Transform< ScalarType, itkGetStaticConstMacro(SpaceDimension), itkGetStaticConstMacro(SpaceDimension)> BulkTransformType
virtual bool InsideValidRegion(ContinuousIndexType &) const
Superclass::WeightsFunctionType WeightsFunctionType
Superclass::NumberOfParametersType NumberOfParametersType
Superclass::ParameterIndexArrayType ParameterIndexArrayType
Superclass::ParametersType ParametersType
CovariantVector< TScalar, itkGetStaticConstMacro(SpaceDimension)> OutputCovariantVectorType
WeightsFunctionType::WeightsType WeightsType
virtual ::itk::LightObject::Pointer CreateAnother(void) const
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
Superclass::ParametersValueType ParametersValueType
virtual void SetFixedParameters(const ParametersType &parameters)
FixedArray< ImagePointer, NDimensions > CoefficientImageArray
Superclass::NumberOfParametersType NumberOfParametersType
Superclass::InputVnlVectorType InputVnlVectorType
void PrintSelf(std::ostream &os, Indent indent) const
vnl_vector_fixed< TScalar, SpaceDimension > InputVnlVectorType
Superclass::InputCovariantVectorType InputCovariantVectorType
void operator=(const Self &)
A base class with common elements of BSplineTransform and BSplineDeformableTransform.
BSplineBaseTransform< TScalar, NDimensions, VSplineOrder > Superclass
virtual void SetCoefficientImages(const CoefficientImageArray &images)
Superclass::OutputVectorType OutputVectorType
virtual void SetGridOrigin(const OriginType &)
Array< unsigned long > ParameterIndexArrayType
CovariantVector< TScalar, itkGetStaticConstMacro(SpaceDimension)> InputCovariantVectorType
Superclass::OutputCovariantVectorType OutputCovariantVectorType
BulkTransformType::ConstPointer BulkTransformPointer
A templated class holding a point in n-Dimensional image space.
virtual const BulkTransformType * GetBulkTransform() const
ImageRegion< itkGetStaticConstMacro(SpaceDimension)> RegionType
Superclass::ScalarType ScalarType
Vector< TScalar, itkGetStaticConstMacro(SpaceDimension)> OutputVectorType
virtual void SetFixedParametersGridSizeFromTransformDomainInformation() const
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Point< TScalar, itkGetStaticConstMacro(SpaceDimension)> OutputPointType
virtual void SetGridDirection(const DirectionType &)
Superclass::JacobianType JacobianType
virtual void SetGridSpacing(const SpacingType &)
OutputPointType TransformPoint(const InputPointType &point) const
Point< TScalar, itkGetStaticConstMacro(SpaceDimension)> InputPointType
Deformable transform using a BSpline representation.
ParametersType::ValueType ParametersValueType
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:51
const CoefficientImageArray GetCoefficientImages() const
Vector< TScalar, itkGetStaticConstMacro(SpaceDimension)> InputVectorType
ImageType::SpacingType SpacingType
virtual void SetFixedParametersGridSpacingFromTransformDomainInformation() const
vnl_vector_fixed< TScalar, SpaceDimension > OutputVnlVectorType
Superclass::ContinuousIndexType ContinuousIndexType
virtual void ComputeJacobianWithRespectToParameters(const InputPointType &, JacobianType &) const
Superclass::OutputVnlVectorType OutputVnlVectorType