[Insight-users] Round-off Errors
Luis Ibanez
luis.ibanez at kitware.com
Mon Aug 16 22:24:25 EDT 2004
Hi Invisible Human,
Could you please make visible for us
the declaration of your transform ?
ITK transforms have a second template parameter
that defines the precision with which the internal
computations are going to be performed.
It may seem that you are setting it to "float"
instead of "double".
Please post the typedef where you instantiated
the type of your transform.
You may want to post also the result of the
command:
transform->Print( std::cout );
This will show us the internal state of your
transform.
Thanks
Luis
-----------------------
Invisible Human wrote:
>
> Hi,
>
> In trying to get sagittal slices from an RGB volume i
> am getting some data corruption which i believe is
> because of round-off errors.
>
> Simply put, my code does this:
>
>
> rot[0] = 0.0; rot[1] = 1.0; rot[2] = 0.0;
> transform->Rotate3D(rot,90*atan(1.0)/45.0);
>
> rot[1]= 0 ; rot[0] = 1; rot[2]= 0;
> transform->Rotate3D(rot,90*atan(1.0)/45.0,false);
>
> filter->SetTransform(transform);
>
>
> I expect this transform to map the output point
> [1,0,0] to the input point [0,1,0]
>
> However this line:
>
> inputPoint = m_Transform->TransformPoint(outputPoint);
>
> Yield the following value in the input point:
>
> [0] 2.2204460492503131e-016 double
> [1] 1.0000000000000000 double
> [2] -2.2204460492503131e-016 double
>
> As a result,
>
> m_Interpolator->IsInsideBuffer(inputPoint)
>
> fails and results in a garbled image.
>
> Should this be filed as a bug to ITK?
>
> Yasser
>
>
>
More information about the Insight-users
mailing list