[Insight-users] BSplineDeformableTransform -- Parameters Setting

Bing Jian bjian at cise . ufl . edu
Tue, 9 Dec 2003 17:36:38 -0500 (EST)


Hi,

   Let me continue my questions on BSplineDeformableTransform.

   Suppose we are going to set parameters after setting region.

 In itkBSplineDeformableTranform.h, the comments before the class
definition say

 * TransformType::ParametersType parameters(
transform->GetNumberOfParameters() );
 *
 * // Fill the parameters with values
 *
 * transform->SetParameters( parameters )

  For me, the line // Fill the parameters with values is a little
confusing. It can be interpreted as comment of the single following it
   transform->SetParameters( parameters )

  However, I guess it means we need to give some initial values to
paramters before feeding it to transform according to common sense on
get/set functions. And this intialization part is exactly what I
expect to see from the itkBSplineDeformableTransformTest.cxx. But
actually I cannot find this part in the test file. Let's take a look
at what is happening after we set the region. Starting from line 83
of itkBSplineDeformableTransformTest.cxx, it reads

   /**
   * Allocate memory for the parameters
   */
  unsigned long numberOfParameters =
transform->GetNumberOfParameters();
  ParametersType parameters( numberOfParameters );
and then it defines a CoefficientImage and fill it with the data in
parameters.data_block(). (I didnot fully understand this part, please
correct me if I am missing anything.) But the parameters are NOT
initialized at all, right? After that, we call the member function
SetParameters(parameters). At this step, I'm wondering if the
initialzation work is done by the SetParameters(). First I take a
look at the declaration of SetParameters(), the argument parameters
is a const reference which means it should not modify the parameter.
Then I go ahead into the implementation of Setparameters(), and it
seems it just keeps a reference m_InputParametersPointer to parameter
and then generates an array of m_CoefficientImage. The latter job
is very similar to the job done in Test.cxx before the calling of
SetParameters() where I think calliing of SetCoefficientImage()
is better according to the warning in header file:
  * Warning: use either the SetParameters() or SetCoefficientImage()
 * API. Mixing the two modes may results in unexpected results.
and actually, the TransformPoint() is based on of the data
structure m_CoefficientImage.

   The problem is I still have no idea on setting the one
dimension array parameters. From the test file, I can only figure
out the way to feed the data in one dimension array paramters
to the array of images CoefficientImage. I am expecting to see
the call of class BSplineInterpolationWeightFunction as indicated
from its being included in itkBSplineDeformableTransform.h and
I guess the calculation of parameters should depend on the
weight setting. Am I right?

   Thank you very much for this long reading!



-- 
Best wishes,
Bing Jian
bjian at cise . ufl . edu