]> Creatis software - clitk.git/blobdiff - registration/clitkMultipleBSplineDeformableTransform.txx
Debug RTStruct conversion with empty struc
[clitk.git] / registration / clitkMultipleBSplineDeformableTransform.txx
index 0ec20aa2bdf29398a97a267b81cf21d6dd800f46..ebcfae976bd89ac3a5e28bbb37e5807f8bfede47 100644 (file)
@@ -28,8 +28,7 @@ namespace clitk
 {
   // Constructor with default arguments
   template<class TCoordRep, unsigned int NInputDimensions, unsigned int NOutputDimensions>
-  MultipleBSplineDeformableTransform<TCoordRep, NInputDimensions, NOutputDimensions>
-  ::MultipleBSplineDeformableTransform() : Superclass(OutputDimension, 0)
+  MultipleBSplineDeformableTransform<TCoordRep, NInputDimensions, NOutputDimensions>::MultipleBSplineDeformableTransform() : Superclass(0)
   {
     m_nLabels = 1;
     m_labels = 0;
@@ -325,7 +324,7 @@ namespace clitk
 #undef LOOP_ON_LABELS
 
   template<class TCoordRep, unsigned int NInputDimensions, unsigned int NOutputDimensions>
-  inline unsigned int
+  inline typename MultipleBSplineDeformableTransform<TCoordRep, NInputDimensions, NOutputDimensions>::NumberOfParametersType
   MultipleBSplineDeformableTransform<TCoordRep, NInputDimensions, NOutputDimensions>
   ::GetNumberOfParameters(void) const
   {
@@ -426,14 +425,10 @@ namespace clitk
   }
 
   template<class TCoordRep, unsigned int NInputDimensions, unsigned int NOutputDimensions>
-  inline const typename MultipleBSplineDeformableTransform<TCoordRep, NInputDimensions, NOutputDimensions>::JacobianType &
+  inline void
   MultipleBSplineDeformableTransform<TCoordRep, NInputDimensions, NOutputDimensions>
-  ::GetJacobian( const InputPointType & point ) const
+  ::ComputeJacobianWithRespectToParameters (const InputPointType &point, JacobianType &jacobian) const
   {
-    /*
-    for (unsigned i = 0; i < m_nLabels; ++i)
-      m_trans[i]->ResetJacobian();
-      */
     if (m_LastJacobian != -1)
       m_trans[m_LastJacobian]->ResetJacobian();
 
@@ -443,15 +438,18 @@ namespace clitk
     if (lidx == -1)
     {
       m_LastJacobian = lidx;
-      return this->m_Jacobian;
+      jacobian = this->m_SharedDataBSplineJacobian;
+      return;
     }
 
-    m_trans[lidx]->GetJacobian(point);
+    JacobianType unused;
+    m_trans[lidx]->ComputeJacobianWithRespectToParameters(point, unused);
     m_LastJacobian = lidx;
 
-    return this->m_Jacobian;
+    jacobian = this->m_SharedDataBSplineJacobian;
   }
 
+
   template<class TCoordRep, unsigned int NInputDimensions, unsigned int NOutputDimensions>
   inline void
   MultipleBSplineDeformableTransform<TCoordRep, NInputDimensions,NOutputDimensions>
@@ -465,8 +463,8 @@ namespace clitk
   MultipleBSplineDeformableTransform<TCoordRep, NInputDimensions,NOutputDimensions>::InitJacobian()
   {
     unsigned numberOfParameters = this->GetNumberOfParameters();
-    this->m_Jacobian.set_size(OutputDimension, numberOfParameters);
-    JacobianPixelType * jacobianDataPointer = reinterpret_cast<JacobianPixelType *>(this->m_Jacobian.data_block());
+    this->m_SharedDataBSplineJacobian.set_size(OutputDimension, numberOfParameters);
+    JacobianPixelType * jacobianDataPointer = reinterpret_cast<JacobianPixelType *>(this->m_SharedDataBSplineJacobian.data_block());
     memset(jacobianDataPointer, 0,  numberOfParameters * sizeof (JacobianPixelType));
 
     unsigned tot = 0;