]> Creatis software - clitk.git/blobdiff - registration/clitkBSplineDeformableTransform.h
itk4 Renaming
[clitk.git] / registration / clitkBSplineDeformableTransform.h
index 2aeaac654ed81c492ead97ece721e911137096fe..bab7f8c78257206b4d060b557211235d89b2217d 100644 (file)
@@ -3,7 +3,7 @@
 
   Authors belong to: 
   - University of LYON              http://www.universite-lyon.fr/
-  - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
+  - Léon Bérard cancer center       http://www.centreleonberard.fr
   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
 
   This software is distributed WITHOUT ANY WARRANTY; without even
@@ -14,7 +14,7 @@
 
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-======================================================================-====*/
+===========================================================================**/
 #ifndef __clitkBSplineDeformableTransform_h
 #define __clitkBSplineDeformableTransform_h
 #include "clitkVectorBSplineResampleImageFunctionWithLUT.h"
@@ -27,6 +27,9 @@
 
 namespace clitk
 {
+  // Forward declaration needed for friendship
+  template <class TCoordRep, unsigned int NInputDimensions, unsigned int NOutputDimensions>
+  class ITK_EXPORT MultipleBSplineDeformableTransform;
 
   template <
     class TCoordRep = double,               // Data type for scalars, coordinate representation,vectors
@@ -186,7 +189,7 @@ namespace clitk
     void SetBulkTransform(BulkTransformPointer b){m_BulkTransform=b;}
     BulkTransformPointer GetBulkTransform(void) {return m_BulkTransform;}
 
-    //Set mask, inside transform applies, outside zero, real pointer
+    // Set mask, inside transform applies, outside zero, real pointer
     void SetMask(MaskPointer m){m_Mask=m;}
     MaskPointer GetMask(void){return m_Mask;}
     // itkSetConstObjectMacro( Mask, MaskType );
@@ -251,7 +254,15 @@ namespace clitk
     } 
     
     /** Compute the Jacobian Matrix of the transformation at one point */
+#if ITK_VERSION_MAJOR >= 4
+    virtual void ComputeJacobianWithRespectToParameters (const InputPointType &p, JacobianType &jacobian) const;
+    virtual void ComputeJacobianWithRespectToPosition (const InputPointType &p, JacobianType &jacobian) const
+    {
+      itkExceptionMacro( "ComputeJacobianWithRespectToPosition not yet implemented for " << this->GetNameOfClass() );
+    }
+#else
     virtual const JacobianType& GetJacobian(const InputPointType  &point ) const;
+#endif
 
     /** Return the number of parameters that completely define the Transfom */
     virtual unsigned int GetNumberOfParameters(void) const;
@@ -338,6 +349,7 @@ namespace clitk
     mutable IteratorType m_Iterator[OutputDimension];
     mutable JacobianPixelType m_ZeroVector;
     mutable ContinuousIndexType m_Index;
+    mutable bool m_NeedResetJacobian;
 
     /** Keep a pointer to the input parameters. */
     const ParametersType *  m_InputParametersPointer;
@@ -351,6 +363,17 @@ namespace clitk
     /** Check if a continuous index is inside the valid region. */
     bool InsideValidRegion( const ContinuousIndexType& index ) const;
 
+    // VD Use external data container for JacobianImage
+    unsigned SetJacobianImageData(JacobianPixelType * jacobianDataPointer, unsigned dim);
+
+    // VD Reset Jacobian
+    void ResetJacobian() const;
+
+    // VD Add MultipleBSplineDeformableTransform as friend to facilitate wrapping
+    friend class MultipleBSplineDeformableTransform<TCoordRep, NInputDimensions, NOutputDimensions>;
+#if ITK_VERSION_MAJOR >= 4
+    mutable JacobianType                            m_SharedDataBSplineJacobian;
+#endif
 
   }; //class BSplineDeformableTransform