monashmicroimaging / podocytes

GNU General Public License v3.0
2 stars 3 forks source link

Download loci_tools jar and package it with the app #31

Closed jni closed 5 years ago

jni commented 5 years ago

WIP, this isn't yet tested...

pep8speaks commented 5 years ago

Hello @jni! Thanks for updating the PR.

Comment last updated on November 19, 2018 at 04:16 Hours UTC
GenevieveBuckley commented 5 years ago

Closes https://github.com/monashmicroimaging/podocytes/issues/11 'Bundle loci_tools.jar into the app build'

GenevieveBuckley commented 5 years ago

What needs to happen to get this out of WIP and merged into master?

GenevieveBuckley commented 5 years ago

The reason we need to install pims from its master branch in our environment is to prevent an error when running pyinstaller: AttributeError: module 'pims.bioformats' has no attribute '_download_jar'.

For reference, here's the traceback if you've installed pims 0.4.1 instead of master:

$ pyinstaller Podo.spec -w -F -y
129 INFO: PyInstaller: 3.4
129 INFO: Python: 3.6.7
144 INFO: Platform: Darwin-18.2.0-x86_64-i386-64bit
158 INFO: UPX is available.
436 INFO: checking Tree
438 INFO: checking Tree
Traceback (most recent call last):
  File "/anaconda3/envs/podo/bin/pyinstaller", line 11, in <module>
    sys.exit(run())
  File "/anaconda3/envs/podo/lib/python3.6/site-packages/PyInstaller/__main__.py", line 111, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "/anaconda3/envs/podo/lib/python3.6/site-packages/PyInstaller/__main__.py", line 63, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "/anaconda3/envs/podo/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 838, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "/anaconda3/envs/podo/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 784, in build
    exec(text, spec_namespace)
  File "<string>", line 17, in <module>
AttributeError: module 'pims.bioformats' has no attribute '_download_jar'
GenevieveBuckley commented 5 years ago

Also FYI if pims.Bioformats can't open a file it will produce this message about the Java Advanced Imaging (JAI) library. This shouldn't be an issue, the code should just move on to the next image if a corrupt file is encountered.

2018-11-19 15:24:31,958 Exception raised when trying to open /podocytes/test/testdata/corrupt_image.tif
2018-11-19 15:24:31,959 jpype._jexception.loci.formats.MissingLibraryExceptionPyRaisable: loci.formats.MissingLibraryException: Java Advanced Imaging (JAI) is required to read some TIFF files. Please install JAI from https://jai.dev.java.net/
2018-11-19 15:24:31,959 No glomeruli identified in this image.
2018-11-19 15:24:31,959 ValueError: No objects to concatenate

The ValueError is a problem, but is being fixed in another branch.