Ah, that is interesting. I would not have expected the displayed object to be contained in a list like that. Why are the display objects contained as a list? When would you have more than one object in a Display?
I played around with the io.save() functionality and have run into a new issue. If I run the following script and specify the file path to save to as save.csv in the dialog, I get an error that a compatible output format for csv can’t be found and the file is not saved.
Script
#@ File (style="save") save_path
#@ UIService ui
#@ IOService io
from net.imagej.table import DefaultGenericTable
# Make a DefaultGenericTable using IJ2 things
IJ2_table = DefaultGenericTable()
IJ2_table.appendColumns("The", "struggle")
IJ2_table.appendRow("New Row!")
# Display the DefaultGenericTable
ui.show("DefaultGenericTable", IJ2_table)
io.save(IJ2_table, save_path.getPath())
Error
[ERROR] null
io.scif.FormatException: No compatible output format found for extension: /home/andrew/Documents/CrashPad/Jython-Save/saved.csv
at io.scif.services.DefaultFormatService.getWriterByExtension(DefaultFormatService.java:270)
at io.scif.services.DefaultDatasetIOService.canSave(DefaultDatasetIOService.java:94)
at io.scif.io.DatasetIOPlugin.supportsSave(DatasetIOPlugin.java:69)
at org.scijava.io.IOPlugin.supportsSave(IOPlugin.java:76)
at org.scijava.io.IOService.getSaver(IOService.java:66)
at org.scijava.io.DefaultIOService.save(DefaultIOService.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:188)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:206)
at org.python.core.PyObject.__call__(PyObject.java:515)
at org.python.core.PyObject.__call__(PyObject.java:519)
at org.python.core.PyMethod.__call__(PyMethod.java:156)
at org.python.pycode._pyx7.f$0(New_.py:14)
at org.python.pycode._pyx7.call_function(New_.py)
at org.python.core.PyTableCode.call(PyTableCode.java:171)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1614)
at org.python.core.__builtin__.eval(__builtin__.java:497)
at org.python.core.__builtin__.eval(__builtin__.java:501)
at org.python.util.PythonInterpreter.eval(PythonInterpreter.java:259)
at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:57)
at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:31)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
at org.scijava.script.ScriptModule.run(ScriptModule.java:160)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:238)
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)
I get a similar error on trying to read a csv file using io.open(). The beginning of that error message and the script generating it are below.
Script
#@ File (style="open") open_path
#@ IOService io
opened_table = io.open(open_path.getPath())
Error
io.scif.FormatException: /home/andrew/Documents/CrashPad/Jython-Save/open_test.csv: No supported format found.
at io.scif.services.DefaultFormatService.getFormatList(DefaultFormatService.java:350)
at io.scif.services.DefaultFormatService.getFormat(DefaultFormatService.java:316)
at io.scif.services.DefaultDatasetIOService.canOpen(DefaultDatasetIOService.java:82)
at io.scif.io.DatasetIOPlugin.supportsOpen(DatasetIOPlugin.java:64)
at org.scijava.io.IOService.getOpener(IOService.java:55)
...
In my case I am using Fiji that I freshly updated. It is running on an Ubuntu 18.04 machine. Do you get these errors as well if you run the Jython scripts?
Cheers 