ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkCenteredAffineTransform.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkCenteredAffineTransform_h
00019 #define __itkCenteredAffineTransform_h
00020 
00021 #include "itkAffineTransform.h"
00022 
00023 namespace itk
00024 {
00033 template <
00034   class TScalarType = double,      // Data type for scalars
00035   unsigned int NDimensions = 3>
00036 // Number of dimensions in the input space
00037 class ITK_EXPORT CenteredAffineTransform : public AffineTransform<TScalarType,
00038                                                                   NDimensions>
00039 {
00040 public:
00042   typedef CenteredAffineTransform                   Self;
00043   typedef AffineTransform<TScalarType, NDimensions> Superclass;
00044   typedef SmartPointer<Self>                        Pointer;
00045   typedef SmartPointer<const Self>                  ConstPointer;
00046 
00048   itkTypeMacro(CenteredAffineTransform, AffineTransform);
00049 
00051   itkNewMacro(Self);
00052 
00054   itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions);
00055   itkStaticConstMacro( ParametersDimension, unsigned int,
00056                        NDimensions * ( NDimensions + 2 ) );
00058 
00060   typedef typename Superclass::ParametersType      ParametersType;
00061   typedef typename Superclass::ParametersValueType ParametersValueType;
00062   typedef typename Superclass::JacobianType        JacobianType;
00063   typedef typename Superclass::ScalarType          ScalarType;
00064   typedef typename Superclass::InputVectorType     InputVectorType;
00065   typedef typename Superclass::OutputVectorType    OutputVectorType;
00066   typedef typename Superclass::InputCovariantVectorType
00067   InputCovariantVectorType;
00068   typedef typename Superclass::OutputCovariantVectorType
00069   OutputCovariantVectorType;
00070 
00071   typedef typename Superclass::InputVnlVectorType    InputVnlVectorType;
00072   typedef typename Superclass::OutputVnlVectorType   OutputVnlVectorType;
00073   typedef typename Superclass::InputPointType        InputPointType;
00074   typedef typename Superclass::InputPointValueType   InputPointValueType;
00075   typedef typename Superclass::OutputVectorValueType OutputVectorValueType;
00076   typedef typename Superclass::OutputPointType       OutputPointType;
00077   typedef typename Superclass::MatrixType            MatrixType;
00078   typedef typename Superclass::MatrixValueType       MatrixValueType;
00079   typedef typename Superclass::OffsetType            OffsetType;
00080 
00083   typedef typename Superclass::InverseTransformBaseType InverseTransformBaseType;
00084   typedef typename InverseTransformBaseType::Pointer    InverseTransformBasePointer;
00085 
00094   void SetParameters(const ParametersType & parameters);
00095 
00096   const ParametersType & GetParameters(void) const;
00097 
00104   virtual void ComputeJacobianWithRespectToParameters( const InputPointType  & p, JacobianType & jacobian) const;
00105 
00107   bool GetInverse(Self *inverse) const;
00108 
00110   virtual InverseTransformBasePointer GetInverseTransform() const;
00111 
00112 protected:
00114   CenteredAffineTransform();
00115 
00117   virtual ~CenteredAffineTransform();
00118 private:
00119   CenteredAffineTransform(const Self & other);
00120   const Self & operator=(const Self &);
00122 
00123 }; // class CenteredAffineTransform
00124 }  // namespace itk
00125 
00126 // Define instantiation macro for this template.
00127 #define ITK_TEMPLATE_CenteredAffineTransform(_, EXPORT, TypeX, TypeY)                       \
00128   namespace itk                                                                             \
00129   {                                                                                         \
00130   _( 2 ( class EXPORT CenteredAffineTransform<ITK_TEMPLATE_2 TypeX> ) )                   \
00131   namespace Templates                                                                       \
00132   {                                                                                         \
00133   typedef CenteredAffineTransform<ITK_TEMPLATE_2 TypeX> CenteredAffineTransform##TypeY; \
00134   }                                                                                         \
00135   }
00136 
00137 #if ITK_TEMPLATE_EXPLICIT
00138 #include "Templates/itkCenteredAffineTransform+-.h"
00139 #endif
00140 
00141 #if ITK_TEMPLATE_TXX
00142 #include "itkCenteredAffineTransform.hxx"
00143 #endif
00144 
00145 #endif /* __itkCenteredAffineTransform_h */
00146