-
Notifications
You must be signed in to change notification settings - Fork 17
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
Tubeness Op throws NullPointerException #173
Comments
Thanks for the report! @carshadi, do you have time to look into it? |
@gselzer, actually I don't understand why this happens. Also, BTW, this op (written by @carshadi) improves the original tubeness Op, by allowing multiple scales (as in the Frangi op). At the time we did not submit it to net.imagej.ops because we had not done enough testing, but now we can confirm that it works great, so maybe now that is the time!? |
According to this stack overflow post https://stackoverflow.com/a/18024061 , this can happen if the class doesn't have a default (empty) constructor. |
Wow. That seems to fix it! I had never seen this before! |
So adding a dummy constructor works: public Tubeness() {
// do nothing
} However, setting it to private does not work. It needs to be public. But now if someone tries to use that constructor, the computation will fail because the
But above all, why does this happen? Funny enough the IDE suggests removing the empty constructor as it does nothing :) |
For 1) I'm not sure there will be sensible defaults since getting a decent result requires knowing the voxel size of the image. 2) makes more sense to me. I am also not too familiar with how Op parameters are populated. Does running it in this way call the empty constructor and populate the
|
OK. I think the empty constructor is needed earlier on by the OpService, when looking up which Ops are available. The fix is now in place with 47a319d |
Describe the bug
Running the Tubeness Op throws a
NullPointerException
when run withops.run
. I originally saw this running in napari-imagejTo Reproduce
Neuroanatomy
is enabled within FijiRun
Note that when I run in napari-imagej, I actually see a more detailed error:
Expected behavior
The Op should run without error
Screenshots
Additional context
Fiji details:
(Output too long, can provide via Gist if it would be helpful)
Running Fiji 2.9.0/1.53t, Java 1.8.0_322
The text was updated successfully, but these errors were encountered: