knime-ip / knip-ilastik

KNIP / Ilastik Integration (BETA)
5 stars 1 forks source link

ArrayIndexOutOfBoundsException when running ilastik on cropped segment #18

Closed imagejan closed 7 years ago

imagejan commented 7 years ago

When trying to run an Ilastik Headless node after a Segment Cropper, an ArrayIndexOutOfBoundsException is thrown (workflow attached below):

2017-01-27 10:32:45,637 : DEBUG : KNIME-Worker-150 : ImgWriter2 : Ilastik Headless (Pixel classification) : 4:6 : File: E:\temp/ilastik/4b911079-b5e5-4707-9a5c-8273e52e4786/file0.tif 
 Type:UnsignedShortTypeformat: Tagged Image File Format
2017-01-27 10:32:45,638 : DEBUG : KNIME-Worker-151 : KNIPLogService : Ilastik Headless (Pixel classification) : 4:6 : publish(
    context = org.scijava.Context@3a1b44d3
    consumed = false
    progress = -1
    maximum = -1
    status = Initializing Segment: 0
    warning = false,null,null), called from non-EDT Thread:null
2017-01-27 10:32:45,639 : DEBUG : KNIME-Worker-150 : KNIPLogService : Ilastik Headless (Pixel classification) : 4:6 : getHandle(id = E:\temp/ilastik/4b911079-b5e5-4707-9a5c-8273e52e4786/file0.tif, writable = true)
2017-01-27 10:32:45,639 : DEBUG : KNIME-Worker-150 : KNIPLogService : Ilastik Headless (Pixel classification) : 4:6 : no handle was mapped for this ID
2017-01-27 10:32:45,639 : DEBUG : KNIME-Worker-150 : KNIPLogService : Ilastik Headless (Pixel classification) : 4:6 : NIO: allocate: mapped=false, start=0, size=0
2017-01-27 10:32:45,639 : DEBUG : KNIME-Worker-150 : KNIPLogService : Ilastik Headless (Pixel classification) : 4:6 : Location.getHandle: E:\temp/ilastik/4b911079-b5e5-4707-9a5c-8273e52e4786/file0.tif -> io.scif.io.NIOFileHandle@b0a0abd
2017-01-27 10:32:45,640 : DEBUG : KNIME-Worker-150 : Ilastik Headless (Pixel classification) : Ilastik Headless (Pixel classification) : 4:6 : reset
2017-01-27 10:32:45,640 : DEBUG : KNIME-Worker-152 : KNIPLogService : Ilastik Headless (Pixel classification) : 4:6 : publish(
    context = org.scijava.Context@3a1b44d3
    consumed = false
    progress = 0
    maximum = 101
    status = Saving plane 1/101
    warning = false,null,null), called from non-EDT Thread:null
2017-01-27 10:32:45,640 : ERROR : KNIME-Worker-150 : Ilastik Headless (Pixel classification) : Ilastik Headless (Pixel classification) : 4:6 : Execute failed: ("ArrayIndexOutOfBoundsException"): null
2017-01-27 10:32:45,640 : DEBUG : KNIME-Worker-150 : Ilastik Headless (Pixel classification) : Ilastik Headless (Pixel classification) : 4:6 : Execute failed: ("ArrayIndexOutOfBoundsException"): null
java.lang.ArrayIndexOutOfBoundsException
2017-01-27 10:32:45,640 : DEBUG : KNIME-Worker-150 : WorkflowManager : Ilastik Headless (Pixel classification) : 4:6 : Ilastik Headless (Pixel classification) 4:6 doBeforePostExecution
2017-01-27 10:32:45,640 : DEBUG : KNIME-Worker-150 : NodeContainer : Ilastik Headless (Pixel classification) : 4:6 : Ilastik Headless (Pixel classification) 4:6 has new state: POSTEXECUTE
2017-01-27 10:32:45,640 : DEBUG : KNIME-Worker-150 : WorkflowManager : Ilastik Headless (Pixel classification) : 4:6 : Ilastik Headless (Pixel classification) 4:6 doAfterExecute - failure
2017-01-27 10:32:45,640 : DEBUG : KNIME-Worker-150 : Ilastik Headless (Pixel classification) : Ilastik Headless (Pixel classification) : 4:6 : reset
2017-01-27 10:32:45,640 : DEBUG : KNIME-Worker-150 : Ilastik Headless (Pixel classification) : Ilastik Headless (Pixel classification) : 4:6 : clean output ports.
2017-01-27 10:32:45,640 : DEBUG : KNIME-Worker-150 : WorkflowFileStoreHandlerRepository : Ilastik Headless (Pixel classification) : 4:6 : Removing handler 91b9f206-3864-4972-a74a-34c292962ab1 (Ilastik Headless (Pixel classification) 4:6: <no directory>) - 7 remaining
2017-01-27 10:32:45,640 : DEBUG : KNIME-Worker-150 : NodeContainer : Ilastik Headless (Pixel classification) : 4:6 : Ilastik Headless (Pixel classification) 4:6 has new state: IDLE
2017-01-27 10:32:45,640 : DEBUG : KNIME-Worker-150 : Ilastik Headless (Pixel classification) : Ilastik Headless (Pixel classification) : 4:6 : Configure succeeded. (Ilastik Headless (Pixel classification))
2017-01-27 10:32:45,640 : DEBUG : KNIME-Worker-150 : NodeContainer : Ilastik Headless (Pixel classification) : 4:6 : Ilastik Headless (Pixel classification) 4:6 has new state: CONFIGURED
2017-01-27 10:32:45,641 : DEBUG : KNIME-Worker-150 : Image Viewer : Image Viewer : 4:7 : Configure succeeded. (Image Viewer)
2017-01-27 10:32:45,641 : DEBUG : KNIME-Worker-150 : NodeContainer : Ilastik Headless (Pixel classification) : 4:6 : Ilastik Tests 4 has new state: CONFIGURED
2017-01-27 10:32:45,641 : DEBUG : KNIME-WFM-Parent-Notifier : NodeContainer :  :  : ROOT  has new state: IDLE

Ilastik Tests.zip (the upper Ilastik node runs fine, the lower one produces the issue)

The problem might also be in the Segment Cropper though...

Tested with the latest nightly builds of knip and knip-ilastik (and ilastik 1.2.0 from 2016-12-21)

imagejan commented 7 years ago

Update: now I got a more informative error log after running the above workflow in a freshly started KNIME instance:

java.lang.ArrayIndexOutOfBoundsException: -59
    at net.imglib2.img.basictypeaccess.array.ShortArray.getValue(ShortArray.java:61)
    at net.imglib2.type.numeric.integer.GenericShortType.getValue(GenericShortType.java:100)
    at net.imglib2.type.numeric.integer.UnsignedShortType.get(UnsignedShortType.java:168)
    at net.imglib2.type.numeric.integer.UnsignedShortType.getIntegerLong(UnsignedShortType.java:185)
    at net.imglib2.type.numeric.integer.AbstractIntegerType.getRealDouble(AbstractIntegerType.java:62)
    at io.scif.img.ImgSaver.getPlaneArray(ImgSaver.java:854)
    at io.scif.img.ImgSaver.writePlanes(ImgSaver.java:626)
    at io.scif.img.ImgSaver.writeImg(ImgSaver.java:542)
    at io.scif.img.ImgSaver.writeImg(ImgSaver.java:528)
    at io.scif.img.ImgSaver.writeImg(ImgSaver.java:497)
    at io.scif.img.ImgSaver.writeImg(ImgSaver.java:459)
    at io.scif.img.ImgSaver.saveImg(ImgSaver.java:174)
    at io.scif.img.ImgSaver.saveImg(ImgSaver.java:158)
    at org.knime.knip.io.nodes.imgwriter2.ImgWriter2.writeImage(ImgWriter2.java:340)
    at org.knime.knip.io.nodes.imgwriter2.ImgWriter2.writeImage(ImgWriter2.java:231)
    at org.knime.knip.ilastik.nodes.headless.IlastikHeadlessNodeModel.execute(IlastikHeadlessNodeModel.java:302)
    at org.knime.core.node.NodeModel.execute(NodeModel.java:732)
    at org.knime.core.node.NodeModel.executeModel(NodeModel.java:566)
    at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1128)
    at org.knime.core.node.Node.execute(Node.java:915)
    at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:561)
    at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
    at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:179)
    at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:110)
    at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:328)
    at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:204)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
    at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)

Is anyone able to reproduce this?

dietzc commented 7 years ago

fixed with: https://github.com/knime-ip/knip/commit/1f54de63edba767e5601b204103dc9484e8cb9dd. Problem is in ImgSaver of scifio. I worked around it, but I will also fix it in scifio.

dietzc commented 7 years ago

ah: thanks for reporting. this was a perfect workflow :-)

imagejan commented 7 years ago

Thanks for fixing it! I guess the automated nightly build didn't pick this up yet, I'm not seeing a new version on the update site. I'll check again and test tomorrow.

dietzc commented 7 years ago

nightly build is currently failing for other reasons, therefore it's not built at the moment. needs 1 or 2 more days. sorry for the trouble.

dietzc commented 7 years ago

build should be available in 2h.