imagej-server- with the new Location API, how does one handle an
InputStream? I can't figure out a way to wrap it with a
Location, which I would need to call
datasetIOService.open(..). Differently formulated - how to use SCIFIO to open an image from an
IOService(that only forwards to
DatasetIOServicein case of images)?
Locationbut I would like to (e.g. for the deep learning stuff to read models from URL) so I am somewhat motivated to rather work on understanding and using it than having to spend time to readd deprecated stuff. But I'm not sure how much work it is in total.
IOPlugincan't implement both
HandlerPlugintypes, we have to decide for one main one? Does this have more implications? The only difference I see is that
boolean supports(final String descriptor)is then an
boolean supports(final Location descriptor)would not be one
open(String)method supporting more data types than the
open(Location)method, until all
IOPlugins have adapted to the new API.
IOService.open, that works, but it will not make use of the
locationService.resolvemethod to support Strings which are not local file paths. In order to use this, the method would have to be able to throw an exception.. I think it would be great to add this and finally get a way to catch if saving or loading fails. This is all not backwards compatible though.
IOService.open, but can someone remind me again why it is not throwing exceptions in general so far?
IOPluginto use the location API. I actually did do that work; it's on the sjc3 branch IIRC.
HandlerPlugin<Location>instead, but then also leave the old
String-based methods. It should be both source and binary backward compatible! But we'd need to test it.
[ERROR] Module threw exception java.lang.NullPointerException at io.scif.services.DefaultInitializeService.initializeReader(DefaultInitializeService.java:87) at io.scif.img.ImgOpener.createReader(ImgOpener.java:483) at io.scif.img.ImgOpener.openImgs(ImgOpener.java:242) at io.scif.services.DefaultDatasetIOService.open(DefaultDatasetIOService.java:152) at io.scif.services.DefaultDatasetIOService.open(DefaultDatasetIOService.java:133) at io.scif.services.DefaultDatasetIOService.open(DefaultDatasetIOService.java:138) at io.scif.convert.FileToDatasetConverter.convert(FileToDatasetConverter.java:66) at org.scijava.convert.AbstractConvertService.convert(AbstractConvertService.java:125) at org.scijava.convert.AbstractDelegateConverter.convert(AbstractDelegateConverter.java:53) 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:1257) at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080) 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:154) at org.scijava.module.ModuleRunner.call(ModuleRunner.java:124) 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) at java.lang.Thread.run(Thread.java:748)
Datasetwith the new
StringToDatasetConverterin SCIFIO. Can you try whether scifio/scifio#443 fixes your issue?
FileToDatasetConverteractually, just read the stack trace in more detail)
--ij2 --headless --run. I was not yet able to reproduce using jgo to run the SCIFIO command line tool, not at the most recent release, nor the latest SCIFIO snapshot version. I think I'll start digging a bit in Eclipse. Once I have an idea what might be wrong, I'll update here again.
fiji-2.1.0. Imported into Eclipse. Launched in debug mode. Loaded the MCVE script into the script editor. Back in Eclipse, navigated to
getFormat(Location)method. It's an interface, used ctrl+T to bring up implementations, navigated into
DefaultFormatService, same method. Saw it delegates to another method, hit
F3to jump there, which led me to this code in scifio 0.41.0 (the version associated with fiji 2.1.0). Put a breakpoint there, ran the script in Fiji, and then back in Eclipse, I see that
getFormatListreturns null. Hit F8 to continue, then go back to Fiji and run the script again to trigger the breakpoint again. Rinse and repeat while stepping through the code with F5/F6/F7 to learn more about what's going wrong. I know this is a lot of detail, and that @imagejan probably doesn't need it, but I write it here for anyone wondering how we debug this stuff. The Script Editor + IDE combination is very powerful.
BioFormatsFormatis supposed to be the format handling STK files, so in the formats for loop, I'm digging in to that one first. Fortunately, it's the first one on the list right now. (If it weren't, you could use a conditional breakpoint to step straight to it by pressing F8.)
java.io.FileNotFoundException: .../benchmark_v1_2018_x64y64z1c2s4t11_w1Laser4054BD4BP.stk (Permission denied)