You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I used the point iterator on line and point ROIs I found that the obtained point coordinates are often wrong. In particular,
the terminal points of lines are not rendered correctly,
some consecutive line points have duplicates with identical positions,
coordinates of points in single and multi-point ROIs are generally off by one pixel.
Test images (containing selected ROIs) can be found here (tried to attach a ZIP file but it was rejected).
In this course I also looked at the behavious of Line.getPixels() and found similar deficiencies. The end point of the line was never included and the resulting array of pixel values also contained duplicates from the same locations (which I believe is not intended). However, even when interpolation is ON, the getPixels() method missed the last point on the line.
The mapping from float or double to int coordinates is apparently flawed in several places. I suggest to use this version to calculate the right offset (which will also work for negative coordinates):
double x, y; // original position
int u = (int) Math.round(x - 0.5);
int v = (int) Math.round(y - 0.5);
Perhaps this should be packed into a single conversion method. There may be related problems in other places.
I have worked out a patch which can be found in this repo. Will send a pull request shortly. Hope this is useful, pls. let me know if anything's unclear.
When I used the point iterator on line and point ROIs I found that the obtained point coordinates are often wrong. In particular,
Test images (containing selected ROIs) can be found here (tried to attach a ZIP file but it was rejected).
In this course I also looked at the behavious of Line.getPixels() and found similar deficiencies. The end point of the line was never included and the resulting array of pixel values also contained duplicates from the same locations (which I believe is not intended). However, even when interpolation is ON, the getPixels() method missed the last point on the line.
The mapping from
float
ordouble
toint
coordinates is apparently flawed in several places. I suggest to use this version to calculate the right offset (which will also work for negative coordinates):Perhaps this should be packed into a single conversion method. There may be related problems in other places.
I have worked out a patch which can be found in this repo. Will send a pull request shortly. Hope this is useful, pls. let me know if anything's unclear.
--Wilhelm
PS: The announced pull request is here.
The text was updated successfully, but these errors were encountered: