[Insight-users] setting initial transform parameters
Erik Türke
tuerke at cbs.mpg.de
Tue Oct 6 02:14:27 EDT 2009
Darren Weber schrieb:
>
>
> On Wed, Sep 9, 2009 at 6:17 AM, Luis Ibanez <luis.ibanez at kitware.com
> <mailto:luis.ibanez at kitware.com>> wrote:
>
> Hi Erik,
>
> The BSplineTransform can be initilized directly with an
> AffineTransform by simply connecting the AffineTransform
> as its "Bulk" transform.
>
> Please look at the examples:
>
> Insight/Examples/Registration/
> DeformableRegistration14.cxx
> DeformableRegistration15.cxx
> DeformableRegistration8.cxx
>
>
> Look for the lines:
>
> transform->SetBulkTransform( affine_transform );
>
>
>
> In the DeformableRegistration4.cxx, the BSpline transform creation,
> intialization, and hook into the registration method looks something
> like this:
>
> // Create a BSpline transform object.
> typedef itk::BSplineDeformableTransform<
> CoordinateRepType,
> SpaceDimension,
> SplineOrder > bsTransformType;
> bsTransformType::Pointer bsTransform = bsTransformType::New();
>
> // Initialize the BSpline transform parameters.
> typedef bsTransformType::bsParametersType bsParametersType;
> bsParametersType bsParameters( bsTransform->GetNumberOfParameters() );
> bsParameters.Fill( 0.0 );
> bsTransform->SetParameters( bsParameters );
>
> // Pass the bsParameters into the registration method.
> bsRegistration->SetInitialTransformParameters(
> bsTransform->GetParameters() );
>
>
> Given a prior affineTransform that will have a final transform from a
> completed registration, could the above get replaced with:
>
>
> // Create a BSpline transform object.
> typedef itk::BSplineDeformableTransform<
> CoordinateRepType,
> SpaceDimension,
> SplineOrder > bsTransformType;
> bsTransformType::Pointer bsTransform = bsTransformType::New();
>
> // Initialize the BSpline transform parameters.
> bsTransform->SetBulkTransform( affineTransform );
>
> // Pass the bsParameters into the registration method.
> bsRegistration->SetInitialTransformParameters(
> bsTransform->GetParameters() );
>
>
>
> TIA,
> Darren
>
>
>
>
>
> ---
>
> The general problem that you are facing, on the other hand,
> does not have an easy solution. All Transforms have a
> different number of parameters. This is simply because the
> Transform hierarchy is progressively increasing the degrees
> of freedom of the transforms.
>
> You will have to initialize TransformA from TransfromB
> on a case by case basis.
>
>
> Regards,
>
>
> Luis
>
>
>
> ----------------------------------------------------------
>
> On Tue, Sep 8, 2009 at 8:11 AM, Erik Tuerke <tuerke at cbs.mpg.de
> <mailto:tuerke at cbs.mpg.de>> wrote:
>
>
>
> Hello!
>
> I am writing a registration programm based on itk.
>
> I want the program to have the following facility: the user is
> able to set a series of transforms. Considering an affine
> transform following a non-linear transform(e.g. bspline
> transform). What i want to do is to pass only the transform
> gained by the affine transform to the bspline registration
> step (not the resampled image from the affine registration step).
> My problem is, that the regsitration method of the bspline
> registration step expects a lot more parameters than i get by
> the affine registration step. Is there a way to convert the
> affine transform into a, say, bspline transform and pass this
> transform to the SetInitialTransformParameters method of the
> registration method which is responsible for the bspline
> transform?
>
>
> Thanks a lot and best regards!
>
> _____________________________________
> Powered by www.kitware.com <http://www.kitware.com>
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
>
> _____________________________________
> Powered by www.kitware.com <http://www.kitware.com>
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
Hi!
Thanks for your reply to you, Luise and Darren!
For those, who wants to know the solution for passing a linear transform
for initialize purpose to a different linear transform:
transformA->SetTranslation(transformB->GetTranslation);
transformA->SetMatrix(transformB->GetMatrix);
As yet this works fine for me.
Regards, Erik!
More information about the Insight-users
mailing list