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

Cast to double may be needed #4225

Open
scuniff opened this issue Aug 25, 2024 · 1 comment
Open

Cast to double may be needed #4225

scuniff opened this issue Aug 25, 2024 · 1 comment

Comments

@scuniff
Copy link

scuniff commented Aug 25, 2024

double rx = width / 2;
double ry = shapeType == CIRCLE ? rx : height / 2;

Since width and height are ints, the equation is done with Integer accuracy and not Double accuracy.

To get Double accuracy from the equations, a double cast is needed

Maybe
double rx = (double) width / 2;
double ry = shapeType == CIRCLE ? rx : (double) height / 2;

@sbesson
Copy link
Member

sbesson commented Aug 26, 2024

Thanks @scuniff and agreed that the width and the height should be casted to double to handle all scenarios. In practice, all the FV1000 samples in the OME curated data repository have even values for their width and height so this rounding issue never came up as part of the testing.

Feel free to open a Pull Request with your proposed changes and we can check it using the nightly CI builds. As a bonus, if you happen to have a sample FV1000 dataset allowing to test this condition, feel free to upload it to https://zenodo.org/

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

No branches or pull requests

2 participants