NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 823 - Can't open .tif from script
Can't open .tif from script
Status: ASSIGNED
Product: Fiji
Classification: Unclassified
Component: Plugins
unspecified
PC Linux
: P4 normal
Assigned To: Curtis Rueden
Depends on:
Blocks:
 
Reported: 2014-06-26 11:10 CDT by Kaitlin Snider
Modified: 2014-06-26 15:47 CDT
4 users (show)

See Also:

Description Kaitlin Snider 2014-06-26 11:10:32 CDT
I'm testing a .py script in Linux (currently using the GUI - the goal is to eventually use it in headless mode).  When I try to open a .tif file, nothing happens on the ImageJ side, and I get the following error on the linux command line window:

[WARNING] Ignoring unsupported output: result [org.python.core.PyNone]

This script works correctly on ImageJ when run on my Windows machine.  Here's the lines of the script in question:

from ij import IJ
imp = IJ.openImage("/nfs/17/osu8341/test_pics/CT15_C_G6_1L.tif")

Not sure if this is relevant or not, but I'm also getting log4j errors when opening ImageJ in linux:

log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[ERROR] Skipping unsupported option -port7

Thanks in advance!

Information about your version of Java:

  os.arch => amd64
  os.name => Linux
  os.version => 2.6.18-371.4.1.el5
  java.version => 1.6.0_24
  java.vendor => Sun Microsystems Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_24-b07
  java.vm.name => Java HotSpot(TM) 64-Bit Server VM
  java.vm.version => 19.1-b02
  java.vm.vendor => Sun Microsystems Inc.
  java.vm.info => mixed mode
  java.awt.graphicsenv => sun.awt.X11GraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.6
  sun.cpu.endian => little
  sun.desktop => null
  file.separator => /

The up-to-date check says: REMIND_LATER

Information relevant to JAVA_HOME related problems:

  JAVA_HOME is set to: /nfs/17/osu8341/Fiji.app/java/linux-amd64/jdk1.6.0_24//jre
  imagej.dir => /nfs/17/osu8341/Fiji.app

Information about the version of each plugin:

Activated update sites:
ImageJ: http://update.imagej.net/ (last check:20140623162553)
Fiji: http://fiji.sc/update/ (last check:20140625145538)

Files not up-to-date:
  9638777f (LOCAL_ONLY) 20140626105627 plugins/DRAQ_ROIs.ijm
  9f4f8151 (LOCAL_ONLY) 20140626111650 plugins/jars/jython-2.5.2.jar
  86bf5a23 (LOCAL_ONLY) 20140626103631 plugins/mcib3d-core2.71.jar
  859549db (LOCAL_ONLY) 20140626104128 plugins/mcib3d_plugins2.71.jar
  8cb8d89b (LOCAL_ONLY) 20140626104137 plugins/quickhull3d.jar
Comment 1 Kaitlin Snider 2014-06-26 11:33:58 CDT
I missed a line when I copied the script - the 3rd line should read:

imp.show()

Thanks again :)
Comment 2 Kaitlin Snider 2014-06-26 15:01:10 CDT
Fixed!

As I was running this in a Linux shell through a supercomputer center, I also asked for their assistance, especially for the log4j No Config error.  I received these directions.  I followed them, and while the error messages are still showing (?), the image now opens correctly and I can run my script.  The directions that worked are copied below.

"First, create a new log4j.properties file somewhere. You may want to put it in it's own directory, call the directory "logconfig" or something. Then, open the file in a text editor and paste the following standard properties file into it:

# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=DEBUG, A1

# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender

# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
Then, you will need to add the directory where this properties file is to your CLASSPATH environment variable. To do this, find the full path where the log properties file is (run the pwd command). Let's say you made the "logconfig" directory, then the path to the file may look something like this: /nfs/17/osu8341/logconfig/log4j.properties. Then, to add this to the CLASSPATH variable, you would run this command:

export CLASSPATH=$CLASSPATH:/path_to_directory/logconfig/log4j.properties

(The command's end may change depending on where you put the file)"
Comment 3 Curtis Rueden 2014-06-26 15:04:36 CDT
Thanks for the update, Kaitlin. A couple of comments:

1) While adding a log4j.properties will silence the warnings, it should not affect whether your script actually works or not.

2) It should not be the case that any user of ImageJ needs to perform the steps you mention. ImageJ should be shipping a default log4j configuration already. So I would like to keep this bug report open until we the problem can be addressed.
Comment 4 Johannes Schindelin 2014-06-26 15:27:38 CDT
FWIW I agree with Curtis that we should make it easier for users (after all, computers are good at performing repetitive tasks in place of the users).

Kaitlin, I believe that your information will be invaluable to address this issue!
Comment 5 Kaitlin Snider 2014-06-26 15:47:34 CDT
I've no problem with keeping this open until a broader fix is achieved - thanks again for all of your help!