[ITK-users] Fwd: Metric Evaluation
Matt McCormick
matt.mccormick at kitware.com
Wed Jan 6 15:45:34 EST 2016
Hi Suneeza,
The code is not correct -- the number of FixedParameters is not the
same as the number of Parameters. For a 3D rigid transform there are
only three FixedParameters -- the x, y, z center of rotation.
It is more convenient to use itk::Transform::Clone(). See here for an example:
http://itk.org/ITKExamples/src/Core/Transform/CopyANonCompositeTransform/Documentation.html
Hope this helps,
Matt
On Wed, Jan 6, 2016 at 11:59 AM, suneeza hanif <suneezahanif02 at gmail.com> wrote:
>
> Hello Matt,
>
> Thank you for your reply.
>
> I am doing like this:
>
> transform->SetParameters(
> registration->GetOutput()->Get()->GetParameters());
> TranslationTransformType::ParametersType
> initialParameters(transform->GetNumberOfParameters() );
> initialParameters[0] = 0;
> initialParameters[1] = FixedCenterX;
> initialParameters[2] = FixedCenterY;
> initialParameters[3] = 0;
> initialParameters[5] = 0;
> transform->SetFixedParameters(initialParameters);
> metric->SetTransform(transform);
> metric->SetFixedImage( fixedImageReader->GetOutput() );
> metric->SetMovingImage(movingImageReader->GetOutput() );
> metric->Initialize();
> metric->GetValue();
>
> But still I get different value for metric.
>
> Best Regards,
> Suneeza
>
>
> On Wed, Jan 6, 2016 at 4:24 AM, Matt McCormick <matt.mccormick at kitware.com>
> wrote:
>>
>> Hi Suneeza,
>>
>> When transferring the parameters to your metric computation, are you
>> also re-using the FixedParameters (center of rotation) in addition to
>> the optimized Parameters (rotation angle and translation)?
>>
>> HTH,
>> Matt
>>
>> On Fri, Jan 1, 2016 at 5:17 PM, suneeza hanif <suneezahanif02 at gmail.com>
>> wrote:
>> > Hello Everyone,
>> >
>> > I need help regarding metric calculation. When I run registration
>> > algorithm
>> > and use final results(e.g. rotation angle and translation) to calculate
>> > metric once again at the end of process I get different value as
>> > compared to
>> > the value of metric evaluated in last iteration. I am using same metric
>> > for
>> > registration and later.
>> >
>> > I also did this after one iteration but i still i get different values.
>> >
>> > Does anyone know how to solve this problem?
>> >
>> > Thanks in advance.
>> >
>> > Best Regards,
>> > Suneeza
>> >
>> > _____________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Kitware offers ITK Training Courses, for more information visit:
>> > http://www.kitware.com/products/protraining.php
>> >
>> > 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://public.kitware.com/mailman/listinfo/insight-users
>> >
>
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> 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://public.kitware.com/mailman/listinfo/insight-users
>
More information about the Insight-users
mailing list