ilastik / ilastik4ij

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

IlastikOptions: load parameters explicitly #32

Closed stelfrich closed 4 years ago

stelfrich commented 4 years ago

The explicit loading of parameters in the accessors is required so that the parameters always reflect the state provided by a PrefService. We will need this for a custom preference pane in the KNIME ilastik integration to work with the plugin.

tischi commented 4 years ago

@wolny Maybe there indeed is an issue with this patch. For example from IntelliJ, the IlastikOptions do not work for me anymore:

The simple code below:

final ImageJ ij = new ImageJ();

final IlastikOptions ilastikOptions = new IlastikOptions();
ilastikOptions.setExecutableFile( new File("") );
final File executableFile = ilastikOptions.getExecutableFile();

Throws

Exception in thread "main" java.lang.NullPointerException
    at org.scijava.command.DynamicCommand.getInfo(DynamicCommand.java:74)
    at org.scijava.options.OptionsPlugin.load(OptionsPlugin.java:94)
    at org.ilastik.ilastik4ij.ui.IlastikOptions.getExecutableFile(IlastikOptions.java:33)

@stelfrich Maybe some SciJava issue?