Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in the reference implementation - LolaBunny.cpp and LolaOpenMp.cpp #3

Closed
GoogleCodeExporter opened this issue Apr 20, 2016 · 4 comments

Comments

@GoogleCodeExporter
Copy link

There is an error in the reference implementation of the backprojection 
algorithm in the source files "LolaBunny.cpp" and "LolaOpenMp.cpp". This error 
also affects the reference volumes provided in the data set files 
"rabbitct_512.rctd" and "rabbitct_1024.rctd".

In the function "inline double p_hat_n(double x, double y)",
which performs a bilinear interpolation at position (x, y),
input values in the interval ]-1, 0[ are treated incorrectly:

inline double p_hat_n(double x, double y)
{
    int i = (int)x;
    int j = (int)y;
    double alpha = x - (int)x;
    double beta = y - (int)y;

    ...
}

The integer cast truncates the floating point numbers towards zero,
while the desired functionality is to truncate towards minus infinity.

current: y = -0.5 => j = 0, beta = -0.5, (1 - beta) = 1.5
desired: y = -0.5 => j = -1, beta = 0.5, (1 - beta) = 0.5

In this example, the input coordinates used for interpolation
are 0 and 1, and the weights are -0.5 and 1.5, respectively.
Therefore, the fact that the border of the input images
is set to zero does not prevent the error.

In the geometric configuration of the RabbitCT data set,
the affected voxels lie at large values of the z coordinate.

A correct, but slower version, of the function p_hat_n 
could use the function floor() as follows:

inline double p_hat_n(double x, double y)
{
    int i = static_cast<int>(floor(x));
    int j = static_cast<int>(floor(y));
    double alpha = x - i;
    double beta  = y - j;

    ...
}

What version of the product are you using? On what operating system?

Version: RabbitCT-1.0.3-src.zip
The reported error is independent of the operating system.

Best regards,
Timo

Original issue reported on code.google.com by zinsser...@gmail.com on 22 Sep 2012 at 7:51

@GoogleCodeExporter
Copy link
Author

This issue was closed by revision r41.

Original comment by hannes.h...@informatik.uni-erlangen.de on 16 Oct 2012 at 6:41

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

This issue was closed by revision r42.

Original comment by hannes.h...@informatik.uni-erlangen.de on 16 Oct 2012 at 6:51

@GoogleCodeExporter
Copy link
Author

This issue was closed by revision r43.

Original comment by hannes.h...@informatik.uni-erlangen.de on 16 Oct 2012 at 6:53

@GoogleCodeExporter
Copy link
Author

Hey Timo,

thanks for the bug report. We fixed it in our implementation and are creating 
new reference datasets which will be uploaded to the website later this week.

Best,
Benni & Hannes

Original comment by hannes.h...@informatik.uni-erlangen.de on 16 Oct 2012 at 6:54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant