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
java.lang.NullPointerException
at net.imagej.convert.ConvertIntArrayToFinalInterval.convert(ConvertIntArrayToFinalInterval.java:53)
at org.scijava.convert.AbstractConvertService.convert(AbstractConvertService.java:62)
at org.scijava.script.ScriptModule.run(ScriptModule.java:196)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
at org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:181)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at net.imagej.ui.swing.script.TextEditor.evalScript(TextEditor.java:2476)
at net.imagej.ui.swing.script.TextEditor.access$400(TextEditor.java:158)
at net.imagej.ui.swing.script.TextEditor$Tab$6.execute(TextEditor.java:1488)
at net.imagej.ui.swing.script.TextEditor$Executer$1.run(TextEditor.java:1977)
Caused by: java.lang.NullPointerException
at net.imagej.convert.ConvertIntArrayToFinalInterval.convert(ConvertIntArrayToFinalInterval.java:53)
at org.scijava.convert.AbstractConvertService.convert(AbstractConvertService.java:62)
at org.scijava.script.ScriptModule.run(ScriptModule.java:196)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
at org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:181)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
And here's the script that caused it:
# @DatasetService data# @DisplayService display# @OpService ops# @net.imagej.Dataset inputDatafromnet.imglib2.metaimportImgPlusfromnet.imglib2.img.display.imagejimportImageJFunctionsfromjarrayimportarrayfromijimportIJ# create a log kernellogKernel=ops.logKernel(2, 1.0)
# convolve with log kernellogFiltered=ops.convolve(inputData, logKernel)
# display log filter resultdisplay.createDisplay("log", ImgPlus(logFiltered))
# otsu threshold and displaythresholded=ops.run("otsu", logFiltered)
display.createDisplay("thresholded", ImgPlus(thresholded))
# convert to imagej1 imageplus so we can run analyze particlesimpThresholded=ImageJFunctions.wrap(thresholded, "wrapped")
# convert to mask and analyze particlesIJ.run(impThresholded, "Convert to Mask", "")
IJ.run(impThresholded, "Analyze Particles...", "display add")
IJ.run("Close")
@hinerm Can you take a look? On cursory inspection it seems that AbstractConverter accepts null sources in canConvert now (maybe due to my recent changes to ConversionUtils?), but downstream converters are not expecting this and their convert method blows up in that scenario. We'll need to be more consistent about this...
The text was updated successfully, but these errors were encountered:
The default converter contract is that inputs can not be null, with the
intent that individual converters can otherwise override this behavior.
This contract is now consistent between all canConvert signatures, and
has been clarified in the javadoc.
See imagej/imagej-common#52
@ctrueden yep you were right, there was an inconsistency. scijava/scijava-common@d5575ac fixes the NPE in your example and I believe is correct for the current state of affairs - twisted as it may be..
And here's the script that caused it:
@hinerm Can you take a look? On cursory inspection it seems that
AbstractConverter
accepts null sources incanConvert
now (maybe due to my recent changes toConversionUtils
?), but downstream converters are not expecting this and theirconvert
method blows up in that scenario. We'll need to be more consistent about this...The text was updated successfully, but these errors were encountered: