Skip to content

Question: Error messages when trying to read and image #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sebi06 opened this issue Mar 17, 2014 · 8 comments
Closed

Question: Error messages when trying to read and image #6

sebi06 opened this issue Mar 17, 2014 · 8 comments

Comments

@sebi06
Copy link

sebi06 commented Mar 17, 2014

Hi guys,

I just tried to test the python-bioformats library and got stuck with I problem. I am not a programmer, so my question might be silly ...
When I open the file inside Fiji using the BioFormats Importer it works fine, so the file itself is ok. And I also managed to read it using: http://www.lfd.uci.edu/~gohlke/pythonlibs/#bioformats

But when I use python-bioformats I get those error messages:

java.lang.IllegalArgumentException: 0.0 must not be null and positive.
at ome.xml.model.primitives.PositiveFloat.(PositiveFloat.java:41)
at loci.formats.in.MRCReader.initFile(MRCReader.java:286)
at loci.formats.FormatReader.setId(FormatReader.java:1072)
java.lang.NoClassDefFoundError: Glacier2/PermissionDeniedException
Caused by: java.lang.ClassNotFoundException: Glacier2.PermissionDeniedException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Traceback (most recent call last):
File "", line 1, in
File "C:\Python27\lib\site-packages\python_bioformats-0.0.0-py2.7.egg\bioformats\formatreader.py", line 908, in load_using_bioformats
with ImageReader(path=path) as rdr:
File "C:\Python27\lib\site-packages\python_bioformats-0.0.0-py2.7.egg\bioformats\formatreader.py", line 634, in init
self.init_reader()
File "C:\Python27\lib\site-packages\python_bioformats-0.0.0-py2.7.egg\bioformats\formatreader.py", line 675, in init_reader
je, "Glacier2/PermissionDeniedException"):
File "C:\Python27\lib\site-packages\javabridge\jutil.py", line 811, in is_instance_of
raise JavaException(jexception)
javabridge.jutil.JavaException: Glacier2/PermissionDeniedException

Thanks for the help,

Sebastian

@sebi06 sebi06 closed this as completed Mar 17, 2014
@sebi06 sebi06 reopened this Mar 17, 2014
@LeeKamentsky
Copy link

Hi Sebi - it looks like there's something wrong with the loci_tools.jar file that you're using. You've obviously used the right class path (e.g. javabridge.start_vm(class_path=bioformats.JARS)). Can you send me or post a link to the image you're trying to load? Also, the code you're running through is for an OMERO url and that's a little strange.

Christoph Gohlke is kindly building bioformats for us, so the packages should be roughly equivalent. Perhaps he's a day or two behind.

You can test whether the Bio-Formats JAR loads your image directly from Java. Navigate to the directory containing the JAR (on my system, c:\Python27\Lib\site-packages\bioformats\jars) and type
java -cp loci_tools.jar loci.formats.tools.ImageInfo <your file name here>

If your file doesn't load, it's probably something we have to figure out with Bio-Formats.

@sebi06
Copy link
Author

sebi06 commented Mar 17, 2014

Hi Lee,

well on my PC I have:

C:\Python27\Lib\site-packages\python_bioformats-0.0.0-py2.7.egg\bioformats\jars\loci_tools.jar

When I try

java -cp loci_tools.jar loci.formats.tools.ImageInfo
C:\Users\M1SRH\Documents\Testdata_Zeiss\Zen_Output\Count_Cells_DAPI_10_Frames_with_Fiji.czi

I get the follwoing error: Error: could not open `C:\Program Files
(x86)\Java\jre7\lib\i386\jvm.cfg', which is clear, since I have only
Java64bit installed. Is this some 32/64bit issue with the loci_tools.jar?

By the way, inside Fiji and ImageJ the loci_tools.far was replaced by the
bio_formats_package.jar. And the loci_tools.jar (5.0.0) is way bigger in
file size than the one located here:
C:\Python27\Lib\site-packages\python_bioformats-0.0.0-py2.7.egg\bioformats\jars\loci_tools.jar

When do:

java -cp loci_tools.jar loci.formats.tools.ImageInfo
C:\Python27\Lib\site-packages\bio_formats\loci_tools.jar

I get the exact same error message...

My JAVA_HOME is C:\Program Files\Java\jdk1.7.0_21

I found one jvm.cfg here: C:\Program
Files\Java\jdk1.7.0_21\jre\lib\amd64\jvm.cfg

and also here: C:\Program Files\Java\jre7\lib\amd64\jvm.cfg

Cheers,

Sebi

2014-03-17 13:29 GMT+01:00 LeeKamentsky notifications@github.com:

Hi Sebi - it looks like there's something wrong with the loci_tools.jar
file that you're using. You've obviously used the right class path (e.g.
javabridge.start_vm(class_path=bioformats.JARS)). Can you send me or post
a link to the image you're trying to load? Also, the code you're running
through is for an OMERO url and that's a little strange.

Christoph Gohlke is kindly building bioformats for us, so the packages
should be roughly equivalent. Perhaps he's a day or two behind.

You can test whether the Bio-Formats JAR loads your image directly from
Java. Navigate to the directory containing the JAR (on my system,
c:\Python27\Lib\site-packages\bioformats\jars) and type
java -cp loci_tools.jar loci.formats.tools.ImageInfo

If your file doesn't load, it's probably something we have to figure out
with Bio-Formats.

Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-37809707
.

Dr. Sebastian Rhode
Grünwalder Straße 103a
81547 München
Tel: +49 89 4703091
Mobil: +49 151 40767993
sebrhode@gmail.com

@LeeKamentsky
Copy link

It sure looks like a 32-bit / 64-bit problem. I'm wondering if CP picked a
32-bit JDK to build against. I'll have more time for this tomorrow.

On Mon, Mar 17, 2014 at 12:45 PM, sebi06 notifications@github.com wrote:

Hi Lee,

well on my PC I have:

C:\Python27\Lib\site-packages\python_bioformats-0.0.0-py2.7.egg\bioformats\jars\loci_tools.jar

When I try

java -cp loci_tools.jar loci.formats.tools.ImageInfo
C:\Users\M1SRH\Documents\Testdata_Zeiss\Zen_Output\Count_Cells_DAPI_10_Frames_with_Fiji.czi

I get the follwoing error: Error: could not open `C:\Program Files
(x86)\Java\jre7\lib\i386\jvm.cfg', which is clear, since I have only
Java64bit installed. Is this some 32/64bit issue with the loci_tools.jar?

By the way, inside Fiji and ImageJ the loci_tools.far was replaced by the
bio_formats_package.jar. And the loci_tools.jar (5.0.0) is way bigger in
file size than the one located here:
C:\Python27\Lib\site-packages\python_bioformats-0.0.0-py2.7.egg\bioformats\jars\loci_tools.jar

When do:

java -cp loci_tools.jar loci.formats.tools.ImageInfo
C:\Python27\Lib\site-packages\bio_formats\loci_tools.jar

I get the exact same error message...

My JAVA_HOME is C:\Program Files\Java\jdk1.7.0_21

I found one jvm.cfg here: C:\Program
Files\Java\jdk1.7.0_21\jre\lib\amd64\jvm.cfg

and also here: C:\Program Files\Java\jre7\lib\amd64\jvm.cfg

Cheers,

Sebi

2014-03-17 13:29 GMT+01:00 LeeKamentsky notifications@github.com:

Hi Sebi - it looks like there's something wrong with the loci_tools.jar
file that you're using. You've obviously used the right class path (e.g.
javabridge.start_vm(class_path=bioformats.JARS)). Can you send me or
post
a link to the image you're trying to load? Also, the code you're running
through is for an OMERO url and that's a little strange.

Christoph Gohlke is kindly building bioformats for us, so the packages
should be roughly equivalent. Perhaps he's a day or two behind.

You can test whether the Bio-Formats JAR loads your image directly from
Java. Navigate to the directory containing the JAR (on my system,
c:\Python27\Lib\site-packages\bioformats\jars) and type
java -cp loci_tools.jar loci.formats.tools.ImageInfo

If your file doesn't load, it's probably something we have to figure out
with Bio-Formats.

Reply to this email directly or view it on GitHub<
https://github.com/CellProfiler/python-bioformats/issues/6#issuecomment-37809707>

.

Dr. Sebastian Rhode
Grünwalder Straße 103a
81547 München
Tel: +49 89 4703091
Mobil: +49 151 40767993
sebrhode@gmail.com

Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-37839067
.

@sebi06
Copy link
Author

sebi06 commented May 14, 2014

Any news on this issue yet?

@LeeKamentsky
Copy link

Sorry to have taken so long, my fault for not remembering to get back to it. We've included an older version of loci_tools.jar which is why it's smaller than Fiji's. I am a bit confused about Error: could not openC:\Program Files (x86)\Java\jre7\lib\i386\jvm.cfg` because you saw that totally outside of Javabridge, using only java. I can't think of why that happened.

Looking at the code and at the loci_tools.jar that's included with Bio-Formats, I am guessing that loci_tools is having some problem opening your file and, in the course of reporting the problem, it tries to use a Java class that's not present in the loci_tools.jar. So what it reports on is not finding the Java class and not on why you couldn't open the file. I'll fix the bug that prevents it from reporting, but I think I still need an example file to determine why we can't open your file.

@sebi06
Copy link
Author

sebi06 commented May 15, 2014

Hi Lee,

my Fiji on a Windows7, 64bit is using BioFormats 5.0.0 (see attached screen shot). The File open without any problems there. You can download it with this link:

https://dl.dropboxusercontent.com/u/623476/Count_Cells_DAPI_10_Frames_with_Fiji.czi

Sebi

2014-05-15 09_17_26-bio-formats plugins for imagej

@LeeKamentsky
Copy link

Hi Sebi,
The file was really instructive - I believe there's a bug in the version of Bio-formats that comes with python-bioformats that keeps it from reading the file. I tried bioformats with both the standard loci_tools and with Bio-Formats 5.0.1 and the former fails while the latter succeeds. I downloaded bioformats_package.jar from here:
http://downloads.openmicroscopy.org/bio-formats/5.0.1/artifacts/bioformats_package.jar

Here's a script that will start bioformats appropriately:

# Substitute "path" with the path to bioformats_package.jar on your own system.
path = r"C:\Users\leek\Downloads\bioformats_package.jar"
import javabridge
import bioformats
jars = javabridge.JARS + [path]
javabridge.start_vm(class_path=jars)

And here's your first image:
image

@sebi06
Copy link
Author

sebi06 commented May 16, 2014

Hi Lee,

thanks a lot. Now it works fine.

Sebi

@sebi06 sebi06 closed this as completed May 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants