[Insight-users] VersorRigid3dTransform

Karthik Krishnan Karthik.Krishnan at kitware.com
Tue Jun 28 09:42:10 EDT 2005


Hi Martin,

Yes the registration will start at different locations if you did and 
didn't specify the center.

So something like

  registration->SetTransform( transform );
  TransformType::CenterType Center;
  transform->SetCenter( Center );
  TransformType::ParametersType initialParams(paramsSize); // fill them 
with the initial params
  transform->SetParameters( initialParams );
  std::cout << "Initial Transform Parameters " << std::endl;
  transform->Print( std::cout );

would start the registration from a different location as opposed to a 
code fragment where you didn't specify the center.

BTW this is exactly what the CenteredTransformInitializer does. Are you 
sure that your registration isn't starting at different locations ? 
Could you post a minimal compiling example to show that it isn't ?

Thanks
regards
karthik


Martin Urschler wrote:

>
> Hi Karthik,
>
> Thanks for your answer.
> There is one minor thing that I still don't understand. Shouldn't the 
> center of rotation have an effect on the translation parameters that 
> are used in a registration? Using the code I posted in my last 
> message, the registration would start at exactly the same point in the 
> metric space in both cases, independent of a specified center of 
> rotation or not, since the 6 parameter values areidentical. IMHO that 
> can't be right. I see now, that the transform has to be treated 
> carefully when putting it into the registration/optimization, however 
> I think one will start at different locations of the metric function 
> with and without rotation center... right?
>
> thanks,
> Martin
>
> Karthik Krishnan wrote:
>
>> Hi Martin,
>>
>> Yes the transforms are indeed different.
>>
>> transform->GetParameters() does not tell you the whole story though. 
>> It prints out the translation components and the versor, but not the 
>> center. You can try transform->Print(std::cout ) to see the center. 
>> In fact, if you place the following line
>>
>>  std::cout << transform->TransformPoint( point ) << std::endl;
>>
>> before and after you set the center, you will see that the 
>> transformed point is indeed different.
>>
>> It does bring up one minor point concerning transforms like the 
>> VersorRigidTransform and other transforms that contain the center 
>> (they derive from the MatrixOffSetTransformBase). If you were to copy 
>> the transform parameters over into another transform, you will also 
>> need to explicitly copy the center otherwise your new transform will 
>> be incorrect.  ie....
>>
>>  TransformType::Pointer finalTransform = TransformType::New();
>>  copiedTransform->SetCenter( originalTransform->GetCenter() );
>>  copiedTransform->SetParameters( originalTransform->GetParameters() );
>>
>> Maybe this info should be put in the Doxygen ...... ? ?
>>
>
>
>


More information about the Insight-users mailing list