-
Notifications
You must be signed in to change notification settings - Fork 218
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
Patch: Problem with rasterization of line and point ROIs (issue #30) #31
Conversation
…tPolygon subdivision. It uses the same algorithm as the ImageProcessor.getLine(double, double, double, double) method for calculating integer-position line points but was fixed to properly include endpoints and to eliminate duplicate points.
…backed default point iterator. The iterator() method is overridden in subclass 'Line', which returns a specific point iterator for thin lines but falls back on the mask-backed default iterator for thick lines.
…rator of 'Line' for the case that 'interpolate" == false. If 'interpolate' is true, interpolated pixel values are extracted at regularly-spaced continuous positions between the two line endpoints (by the new method getLineInterpolated()). This method uses the original algorithm but was fixed to properly include the line's endpoints.
These fixes are in the latest ImageJ daily build (1.51m28). |
The modified ImageProcess.getLine() method is not in the released version of ImageJ 1.51m. It does not behave the same way as the original version, potentially causing compatibility problems. |
I understand, compatibility is important. Though I guess it is the very idea of a bug fix to change behavior... |
The modified version of getLine() did not always behave as expected. For example, it returned a 3 element array for lines 1.1 pixels long. Here is some JavaScript code that demonstrates this behavior: ip = new ByteProcessor(100,100); |
I will look into this problem asap. A possible deeper problem is that there are two different interpretations of floating-point coordinates in ImageJ:
Thus there is a systematic offset of (0.5, 0.5) between these two coordinate systems, and I am not sure if currently this is properly addressed. Assuming that related operations should share a common semantics, the question is where to correct for this offset. I suppose it should happen consistently in the ROI context and coordinates should refer to the sample raster everywhere else. Any better options? --Wilhelm |
This is a proposed patch for issue #30.