Error in Opening the File using Beanshell Script

Hi All,
I tried to run a very simple script to open image stack (a number of images in one tif file) using Beanshell script in FIJI, It giving me error. Here is script and error message:

Script:

import ij.IJ;
import ij.ImagePlus;
import trainableSegmentation.WekaSegmentation;
trainInput = IJ.openImage("http://dl.dropboxusercontent.com/u/1958594/cells/images/A9p5d.tif");

Error:

Sourced file: null : Attempt to resolve method: openImage() on undefined variable or class name: IJ : at Line: 2 : in file: <unknown file> : IJ .openImage ( "http://dl.dropboxusercontent.com/u/1958594/cells/images/A9p5d.tif" ) 

at bsh.UtilEvalError.toEvalError(Unknown Source)
at bsh.UtilEvalError.toEvalError(Unknown Source)
at bsh.BSHMethodInvocation.eval(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.BSHAssignment.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at org.scijava.plugins.scripting.beanshell.BeanshellScriptEngine.eval(BeanshellScriptEngine.java:80)
at org.scijava.script.ScriptModule.run(ScriptModule.java:174)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
at org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:191)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

I can’t reproduce the error when activating the BeanShell language in the editor.

However I could open your image link after changing http to https.

1 Like