"java.lang.NullPointerException" during Trainable WEKA segmentation scripting

Hello everybody,
I’m currently trying to segment a 767 .tif-stack (8bit greyscale, about 1.9 MB each) with fiji’s Trainable WEKA segmentation v3.2.32 plugin. Training a classifier on the stack and applying it afterwards is apparently too much for my system to carry out, so I tried loading already trained classifiers via the macro tools (also crashing the program).

Since it does not work so far for me and since I’m fairly new to image analysis (feeling utterly helpless right now), I tried different things suggested in this forum already, that were offered when outofmemory-errors occured.

I have set the maximum memory slightly below the 64GB RAM available on my computer.
I took care of having my classifier model also be trained on 8bit greyscale file types.
For my input/output options I checked the “use JFileChooser to open/save”
I updated fiji.

I have tried the beanshell script for applying classifier to all images by tiles as suggest here (https://imagej.net/Scripting_the_Trainable_Weka_Segmentation#Example:_apply_classifier_to_all_images_in_folder_by_tiles),

But then the following error occurs (see below).
I tried inserting a " wait ( 3000 ) " before starting time, giving the plugin time to load, but this does not work either, as there is no CPU activity then.

When trying to apply the classfier via macro to smaller stacks (20 images) of which the results might be put together lateron, the message “could not apply classifier” pops up 20 times.

Does anybody have any suggestions what I might do?
Kind regards

Stella

Started New_.bsh at Wed Mar 20 14:04:09 CET 2019
Sourced file: inline evaluation of: import trainableSegmentation.WekaSegmentation; import trainableSegment . . . '' : Object constructor : at Line: 55 : in file: inline evaluation of: import trainableSegmentation.WekaSegmentation; import trainableSegment . . . ‘’ : new FileSaver ( result )

Target exception: java.lang.NullPointerException

at bsh.BSHAllocationExpression.constructObject(BSHAllocationExpression.java:126)
at bsh.BSHAllocationExpression.objectAllocation(BSHAllocationExpression.java:108)
at bsh.BSHAllocationExpression.eval(BSHAllocationExpression.java:56)
at bsh.BSHPrimarySuffix.doSuffix(BSHPrimarySuffix.java:97)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:74)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:41)
at bsh.BSHBlock.evalBlock(BSHBlock.java:125)
at bsh.BSHBlock.eval(BSHBlock.java:75)
at bsh.BSHBlock.eval(BSHBlock.java:41)
at bsh.BSHIfStatement.eval(BSHIfStatement.java:42)
at bsh.BSHBlock.evalBlock(BSHBlock.java:125)
at bsh.BSHBlock.eval(BSHBlock.java:75)
at bsh.BSHBlock.eval(BSHBlock.java:41)
at bsh.BSHIfStatement.eval(BSHIfStatement.java:42)
at bsh.BSHBlock.evalBlock(BSHBlock.java:125)
at bsh.BSHBlock.eval(BSHBlock.java:75)
at bsh.BSHBlock.eval(BSHBlock.java:41)
at bsh.BSHForStatement.eval(BSHForStatement.java:105)
at bsh.Interpreter.eval(Interpreter.java:659)
at bsh.Interpreter.eval(Interpreter.java:750)
at bsh.Interpreter.eval(Interpreter.java:739)
at org.scijava.plugins.scripting.beanshell.BeanshellScriptEngine.eval(BeanshellScriptEngine.java:68)
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)

Caused by: java.lang.NullPointerException
at ij.io.FileSaver.(FileSaver.java:35)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at bsh.Reflect.constructObject(Reflect.java:621)
at bsh.BSHAllocationExpression.constructObject(BSHAllocationExpression.java:117)
… 30 more