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

crash with metadata #28

Open
RainerHeintzmann opened this issue Apr 18, 2024 · 2 comments
Open

crash with metadata #28

RainerHeintzmann opened this issue Apr 18, 2024 · 2 comments

Comments

@RainerHeintzmann
Copy link
Contributor

If metadata is present as a filed called "metadata.txt", it is somehow read and this seems to cause a crash preventing any data to read.
Here is an example metadata.txt file causing such a crash:
metadata.txt
(just place it into a folder with a .tif file to load and load the .tif file)
Not sure if the error is caused inside the Java part or, see below, only a wrong way to call a java method by "BioformatsLoader.jl":

Exception in thread "main" java.lang.IllegalArgumentException: 0 must be non-null and strictly positive.
        at ome.xml.model.primitives.PositiveInteger.<init>(PositiveInteger.java:48)
        at loci.formats.MetadataTools.populatePixelsOnly(MetadataTools.java:314)
        at loci.formats.MetadataTools.populateMetadata(MetadataTools.java:262)
        at loci.formats.MetadataTools.populatePixels(MetadataTools.java:151)
        at loci.formats.MetadataTools.populatePixels(MetadataTools.java:116)
        at loci.formats.in.MicromanagerReader.populateMetadata(MicromanagerReader.java:339)
        at loci.formats.in.MicromanagerReader.initFile(MicromanagerReader.java:334)
        at loci.formats.FormatReader.setId(FormatReader.java:1392)
        at loci.formats.ImageReader.setId(ImageReader.java:849)
ERROR: JavaCall.JavaCallError("Error calling Java: java.lang.IllegalArgumentException: 0 must be non-null and strictly positive.")
Stacktrace:
  [1] geterror()
 @ JavaCall C:\Users\pi96doc\.julia\packages\JavaCall\IAoV2\src\core.jl:544
  [2] _jcall(obj::JavaCall.JavaObject{…}, jmethodId::Ptr{…}, rettype::Type{…}, argtypes::Tuple{…}, args::String; callmethod::typeof(JavaCall.JNI.CallVoidMethodA))
@ahnlabb
Copy link
Owner

ahnlabb commented Apr 19, 2024

Thank you @RainerHeintzmann. Seems like it's due to bioformats but we could perhaps mitigate it from BioformatsLoader. The MicromanagerReader in bioformats matches whenever there is a metadata.txt file in the folder and then reads the image files based on the metadata in this file. Maybe those files are missing here. Either way this seems like strange behavior to me and I'll see if we can work around it in a sensible way.

@RainerHeintzmann
Copy link
Contributor Author

That would be great. In the worst case a try catch statement may prevent a total crash. But it also looked from the error message like there is a wrong Javacall statement somewhere in which case it can possibly be fixed.

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