ilastik / ilastik4ij

ImageJ plugins to run ilastik workflows
MIT License
20 stars 17 forks source link

Object classification problems with plugin version ilastik4ij-1.8.3-SNAPSHOT.jar #101

Closed k-dominik closed 1 year ago

k-dominik commented 1 year ago

Currently I cannot run the object classification bit of the plugin (on osx) but get the following error (this is before the dialog to choose images and stuff even shows up):

traceback ``` (Fiji Is Just) ImageJ 2.9.0/1.53t; Java 1.8.0_322 [64-bit]; Mac OS X 10.16; 54MB of 12407MB (<1%) java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Module threw exception at net.imagej.legacy.LegacyService.runLegacyCompatibleCommand(LegacyService.java:308) at net.imagej.legacy.DefaultLegacyHooks.interceptRunPlugIn(DefaultLegacyHooks.java:166) at ij.IJ.runPlugIn(IJ.java) at ij.Executer.runCommand(Executer.java:152) at ij.Executer.run(Executer.java:70) at java.lang.Thread.run(Thread.java:750) Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Module threw exception at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at net.imagej.legacy.LegacyService.runLegacyCompatibleCommand(LegacyService.java:304) ... 5 more Caused by: java.lang.RuntimeException: Module threw exception at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127) at org.scijava.module.ModuleRunner.call(ModuleRunner.java:63) at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:225) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ... 1 more Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Stack argument out of range: 1 at net.imglib2.img.VirtualStackAdapter$ImagePlusLoader.get(VirtualStackAdapter.java:194) at net.imglib2.img.VirtualStackAdapter$ImagePlusLoader.get(VirtualStackAdapter.java:170) at net.imglib2.img.planar.PlanarImg.update(PlanarImg.java:118) at net.imglib2.img.planar.PlanarImg.update(PlanarImg.java:66) at net.imglib2.type.numeric.integer.GenericByteType.updateContainer(GenericByteType.java:100) at net.imglib2.img.planar.PlanarCursor.reset(PlanarCursor.java:167) at net.imglib2.img.planar.PlanarCursor.(PlanarCursor.java:95) at net.imglib2.img.planar.PlanarCursor2D.(PlanarCursor2D.java:50) at net.imglib2.img.planar.PlanarImg.cursor(PlanarImg.java:217) at net.imglib2.img.planar.PlanarImg.cursor(PlanarImg.java:66) at net.imglib2.img.AbstractImg.firstElement(AbstractImg.java:81) at net.imagej.ImgPlus.firstElement(ImgPlus.java:274) at net.imagej.DefaultDatasetService.create(DefaultDatasetService.java:206) at net.imagej.legacy.translate.DisplayCreator.makeDataset(DisplayCreator.java:139) at net.imagej.legacy.translate.DisplayCreator.getDataset(DisplayCreator.java:101) at net.imagej.legacy.translate.DisplayCreator.makeDisplay(DisplayCreator.java:179) at net.imagej.legacy.translate.DisplayCreator.createDisplay(DisplayCreator.java:93) at net.imagej.legacy.translate.ImageTranslator.createDisplay(ImageTranslator.java:64) at net.imagej.legacy.LegacyImageMap.registerLegacyImage(LegacyImageMap.java:288) at net.imagej.legacy.convert.ImagePlusToDatasetConverter.convert(ImagePlusToDatasetConverter.java:80) at org.scijava.convert.AbstractConvertService.convert(AbstractConvertService.java:125) at org.ilastik.ilastik4ij.util.StringToDatasetConverter.convert(StringToDatasetConverter.java:42) at org.scijava.convert.AbstractConvertService.convert(AbstractConvertService.java:125) at org.scijava.module.DefaultModuleService.load(DefaultModuleService.java:316) at org.scijava.module.DefaultModuleService.loadInput(DefaultModuleService.java:544) at org.scijava.module.DefaultModuleService.lambda$loadInputs$1(DefaultModuleService.java:346) at java.util.ArrayList.forEach(ArrayList.java:1259) at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1082) at org.scijava.module.DefaultModuleService.loadInputs(DefaultModuleService.java:346) at org.scijava.module.process.LoadInputsPreprocessor.process(LoadInputsPreprocessor.java:58) at org.scijava.module.ModuleRunner.preProcess(ModuleRunner.java:102) at org.scijava.module.ModuleRunner.run(ModuleRunner.java:152) at org.scijava.module.ModuleRunner.call(ModuleRunner.java:124) ... 6 more Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Stack argument out of range: 1 at net.imglib2.cache.ref.SoftRefLoaderCache.get(SoftRefLoaderCache.java:145) at net.imglib2.cache.util.LoaderCacheAsCacheAdapter.get(LoaderCacheAsCacheAdapter.java:76) at net.imglib2.img.VirtualStackAdapter$ImagePlusLoader.get(VirtualStackAdapter.java:190) ... 38 more Caused by: java.lang.IllegalArgumentException: Stack argument out of range: 1 at ij.ImageStack.getPixels(ImageStack.java:216) at net.imglib2.img.VirtualStackAdapter$ImagePlusLoader.load(VirtualStackAdapter.java:200) at net.imglib2.cache.ref.SoftRefLoaderCache.get(SoftRefLoaderCache.java:135) ... 40 more ```
imagesc-bot commented 1 year ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/ilastik4ij-plugin-only-imports-back-object-predictions/82359/2

emilmelnikov commented 1 year ago

https://github.com/imagej/imagej-legacy/issues/246 was closed about a year ago, so we probably can remove our own converter and let ImageJ handle the conversion.

k-dominik commented 1 year ago

Hi @emilmelnikov, thank you for looking into this! Would you mind removing the converter?

emilmelnikov commented 1 year ago

I tried to run an Object Classification Workflow, both manually by clicking through the dialog, and by executing a macro, and it worked for me. This is the macro I've used:

run("Run Object Classification Prediction", "projectfilename=/Users/em/MyProject.ilp inputimage=blobs.gif inputproborsegimage=blobs.gif secondinputtype=Probabilities");

I ran ImageJ from within the project:

ImageJ ij = new ImageJ();
ij.ui().showUI();
k-dominik commented 1 year ago

hm that's sorta good, and also bad news ;). Did you run it from the source here? Then doing a new release might fix it. I'm just wondering if you build here, if the scijava version that is being pulled i is to slow. I'll check #99 and merge it once tests are fixed.

emilmelnikov commented 1 year ago

Did you run it from the source here?

Yes, from the current main, but I used just a simple cube.gif image, both as the input data and "probabilities". I've also just tried the same procedure on the "Organ of Corti" sample dataset because it is a 4D stack: it also works.