Skip to content
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

Saving multi-channel TIF results in java.lang.ArrayIndexOutOfBoundsException #9

Open
bjtho08 opened this issue Oct 26, 2018 · 9 comments

Comments

@bjtho08
Copy link

bjtho08 commented Oct 26, 2018

I have not been able to do any debugging myself (I'm very new to programming and I mainly work with Python), so I don't know what exactly is causing this error. I'm running all the latest updates on an ubuntu 16.04 machine. Please let me know any necessary info I have left out.

@imagejan
Copy link
Member

imagejan commented Nov 7, 2018

Hi @bjtho08, could you please post the exact steps you followed to get this exception? Also, the complete stack trace would surely be helpful to track this issue down. See bug reporting best practices.

@bjtho08
Copy link
Author

bjtho08 commented Nov 7, 2018

Hi @bjtho08, could you please post the exact steps you followed to get this exception? Also, the complete stack trace would surely be helpful to track this issue down. See bug reporting best practices.

Hi @imagejan, thanks for replying!
Steps to reproduce error:

  1. On Ubuntu 16.04 open FIJI with HDF5 plugin installed
  2. Install any updates and restart FIJI
  3. Create a new multi-channel hyperstack
  4. Open File menu -> Save As -> HDF5 (new or replace) ...
  5. Choose default settings and click Save
    This results in
Error while saving '/path/to/file.h5':
java.lang.ArrayIndexOutOfBoundsException

I have attached the dump stack from the moment of the error message on screen.

It works just fine on Windows 10, btw.
fiji dump stack.txt

@bjtho08
Copy link
Author

bjtho08 commented Nov 29, 2018

Update: It turns out that it does not work on my windows 10, either. unless it is a newly created empty multi-channel image. Trying to save an existing multi-channel image results in the above error.

@rejsmont
Copy link
Collaborator

Hi @bjtho08,

I could not reproduce your issue. Could you please provide the exact parameters of the image you are trying to save (x, y, z, c, t dimensions), axis order of your hyperstack, as well as options that you have selected for saving? Could you please also provide Fiji info?

Plugins -> Debug -> System information

Thanks!

Radek

@rejsmont
Copy link
Collaborator

Also, you seem to call HDF5 saver from within a script. Could we please take a look at your code?

@bjtho08
Copy link
Author

bjtho08 commented Nov 29, 2018

So, I tested in on my co-worker's computer and his is working fine. So at the moment the error is on two different computers with different OS'es, but apparently it is very localized.

For the new hyperstack image, the parameters are as follows:
(400, 300, 1, 3, 1) 8-bit
For some unknown reason, it works on my windows 10 machine if I create it as 32-bit, but 8-bit fails consistently.
When saving I use no compression and the preset named Standard (no time).
The output log contains the following two lines after it failed:
source level = 0 stackIndex = 1
I am not calling it from a script right now, so I don't have any code to show.
ij-info.txt

@rejsmont
Copy link
Collaborator

rejsmont commented Dec 1, 2018

Hi @bjtho08,

Could you please check what java versions you have on machines where it works vs those where it does not?

Thanks

@bjtho08
Copy link
Author

bjtho08 commented Dec 1, 2018

@rejsmont shouldn't that be whatever version that is packaged along with FIJI? I didn't think it would make a difference if I had another java version installed on my machine. It appears that I am running build 1.8.0_191-b12 on the windows machine. On Ubuntu, I get the following output from java -showversion:

openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-0ubuntu0.16.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

I don't have access to my coworkers computer before monday, so I hope this will be useful in the meantime.

@bjtho08
Copy link
Author

bjtho08 commented Mar 7, 2019

The problem turned out to be because I was using the HDF5 update site which took priority over the version from java-8. Now, however, I have another problem. When I save a file as HDF5, I am unable to open it again. I get the following error log:

loci.formats.UnknownFormatException: Unknown file format: C:\Users\bjarnet\Pictures\test.h5
	at loci.formats.ImageReader.getReader(ImageReader.java:197)
	at loci.plugins.in.ImportProcess.createBaseReader(ImportProcess.java:620)
	at loci.plugins.in.ImportProcess.initializeReader(ImportProcess.java:485)
	at loci.plugins.in.ImportProcess.execute(ImportProcess.java:138)
	at loci.plugins.in.Importer.showDialogs(Importer.java:140)
	at loci.plugins.in.Importer.run(Importer.java:76)
	at loci.plugins.LociImporter.run(LociImporter.java:78)
	at ij.IJ.runUserPlugIn(IJ.java:228)
	at ij.IJ.runPlugIn(IJ.java:192)
	at ij.Executer.runCommand(Executer.java:137)
	at ij.Executer.run(Executer.java:66)
	at java.lang.Thread.run(Thread.java:748)

This is a standard 3-channel TIF image saved in HDF5 and then I attempt to open the newly created .h5 file. Is there some obvious solution or should I submit a new issue?

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

3 participants