-
Notifications
You must be signed in to change notification settings - Fork 224
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
Fixed getLine() in ImageProcessor.java, added test plugin (plugins/wi… #34
Conversation
…lbur/GetLine_Test.java)
Note that there are a large number of unit tests for ImageJ 1.x in the imagej/ij1-tests repository. Perhaps this test could be added there as a unit test. |
Thanks for fixing this problem. However, I will probably continue to use the existing version of getLine() because there my be other compatibility problems and because, for non-interpolated lines, the new version is three times slower. |
@rasband: The additional execution time (for non-interpolated lines) is probably caused by autoboxing the float values for insertion into the list. One could try to run the iterator twice, once to determine the number of line pixels and once to fill the final I understand the problem that modified code may behave differently, but (as noted in #30) the current @ctrueden: Thanks for pointing this out, I was not aware of this test repo. I suppose the existing tests for line drawing should be revised (they probably still test for the old behavior). Related to this: What is the recommended IDE setup for building/debugging ImageJ1? I am used to Eclipse, but the IJ1 repo contains an |
I came across the wrong systematic offset issue when converting SNT traces to line ROIs. I too think it would be important to have this addressed. I would favor to have @imagingbook fix implemented, but if backwards compatibility is really an issue, can we at least get to a compromise? E.g., by renaming the new methods to |
Great, I love |
@tferr, do you have a small script, or plugin, that reproduces the wrong offset issue with the getLine() method? |
@tferr, I can reproduce the wrong offset problem with non-interpolated lines, so no need for a test script or plugin. |
In the latest ImageJ daily build (1.51o1), I modified getLine() to use the offset fix that's in the Line PointIterator. I did not include the PointIterator's duplicate point fix because that would cause the profile plotter to fail. The profile plotter assumes the length of the line is equal to the length of the array (minus one) returned by getLine(). |
Thanks. Alternatively, one could modify |
Hello Wayne,
I made a minor modification to the getLineMethod() in ImageProcessor to fix the problem you mentioned (#30). Things should work now as expected, in particular, the test case
now returns a sequence of proper length 2. I also added a Java plugin for testing this behavior.
Thanks,
Wilhelm