python-bioformats icon indicating copy to clipboard operation
python-bioformats copied to clipboard

Error opening Tif file with bioformats?

Open cudmore opened this issue 5 years ago • 0 comments

I am trying to use python bioformats and can not get started with reading a Tiff file. My ultimate goal is to read Olympus oir files.

My system is macOS Mojave (10.14.3), Python 3.7.2

Here is my code

import javabridge
import bioformats
path='/Volumes/fourt0/Dropbox/olympus/20190401__0005_ch1.tif'
b = bioformats.ImageReader(path)

And here is the error:

AttributeError                            Traceback (most recent call last)
<ipython-input-4-22a5d815dfd0> in <module>
----> 1 b = bioformats.ImageReader(path)

~/Sites/CaImAn/caiman/lib/python3.7/site-packages/bioformats/formatreader.py in __init__(self, path, url, perform_init)
    624         self.stream = jutil.make_instance('loci/common/RandomAccessInputStream',
    625                                           '(Ljava/lang/String;)V',
--> 626                                           self.path)
    627 
    628         self.rdr = None

~/Sites/CaImAn/caiman/lib/python3.7/site-packages/javabridge/jutil.py in make_instance(class_name, sig, *args)
   1710     '''
   1711     args_sig = split_sig(sig[1:sig.find(')')])
-> 1712     klass = get_env().find_class(class_name)
   1713     jexception = get_env().exception_occurred()
   1714     if jexception is not None:

AttributeError: 'NoneType' object has no attribute 'find_class'

Any suggestions? The reason I am doing this is bioformats in Fiji is not opening Olympus oir files correctly and I wanted to have a try in Python? Also tried bio formats command line but can't get started with that either?

cudmore avatar Apr 10 '19 22:04 cudmore