<div dir="ltr">Hi Joe,<div><br></div><div>Right, so I see that the formats-gpl JAR is not on that list. But it needs to be...</div><div><br></div><div>Regards,</div><div>Curtis</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 17, 2015 at 11:28 AM, Joe Ping-Lin Hsiao <span dir="ltr"><<a href="mailto:phsiao@cs.unc.edu" target="_blank">phsiao@cs.unc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Curtis,<br><br>Thanks for your reply.<br>My code doesn't deal with any JAR file at all. The most likely place I found that collects all the JAR files is in JavaTools:createJVM(), and it is the first procedure that I called in my code. By default It puts all the following JAR files within a 'jar' folder into a 'classpath' string:<br><br>bsh-2.0b4.jar<br>formats-api-5.1.2.jar<br>formats-bsd-5.1.2.jar<br>formats-common-5.1.2.jar<br>guava-17.0.jar<br>hamcrest-core-1.1.jar<br>jace-runtime.jar<br>jai_imageio-5.1.2.jar<br>jcommander-1.27.jar<br>jgoodies-common-1.7.0.jar<br>jgoodies-forms-1.7.2.jar<br>joda-time-2.2.jar<br>junit-4.10.jar<br>kryo-2.24.0.jar<br>logback-classic-1.1.1.jar<br>logback-core-1.1.1.jar<br>lwf-stubs-5.1.2.jar<br>metadata-extractor-2.6.2.jar<br>minlog-1.2.jar<br>mipav-stubs-5.1.2.jar<br>native-lib-loader-2.0.2.jar<br>objenesis-2.1.jar<br>ome-xml-5.1.2.jar<br>perf4j-0.9.13.jar<br>serializer-2.7.1.jar<br>slf4j-api-1.7.6.jar<br>snakeyaml-1.6.jar<br>specification-5.1.2.jar<br>testng-6.8.jar<br>turbojpeg-5.1.2.jar<br>xalan-2.7.1.jar<br>xercesImpl-2.8.1.jar<br>xml-apis-1.3.04.jar<br>xmpcore-5.1.2.jar<span class="HOEnZb"><font color="#888888"><br><br><br></font></span></div><span class="HOEnZb"><font color="#888888"><div>Joe<br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 17, 2015 at 11:56 AM, Curtis Rueden <span dir="ltr"><<a href="mailto:ctrueden@wisc.edu" target="_blank">ctrueden@wisc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Joe,<div><br></div><div><span><div>> The reader is an ImageReader object. Just like the 'showinf' program</div><div>> provide from the source, I believe when given a file input, it goes</div><div>> through a .txt file and tries all the file formats listed there.</div><div><br></div></span><div>Yes, that is correct.</div><div><br></div><div>So: in your C++ code, which JAR files are you putting on the classpath? You must have lines of code somewhere that look like this:</div><span><div><br></div><div><div>> list.push_back(jace::ClassPath("jace-runtime.jar;bioformats_package.jar"));</div></div><div><br></div></span><div>Right?</div><div><br></div><div>Regards,</div><div>Curtis</div><div><div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 17, 2015 at 10:09 AM, Joe Ping-Lin Hsiao <span dir="ltr"><<a href="mailto:phsiao@cs.unc.edu" target="_blank">phsiao@cs.unc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Curtis,<div><br></div><div>My code is all written in C++, and I am using the JACE C++ binding method. The reader is an ImageReader object. Just like the 'showinf' program provide from the source, I believe when given a file input, it goes through a .txt file and tries all the file formats listed there.<br></div><div><br></div><div>Thanks,<br></div><div>Joe</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 13, 2015 at 10:20 PM, Curtis Rueden <span dir="ltr"><<a href="mailto:ctrueden@wisc.edu" target="_blank">ctrueden@wisc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Melissa and Joe,<span><div><br></div><div><div>> > loci.formats.UnknownFormatException: Unknown file format:</div><div>> > /common1/phsiao/build/vst/sample_vid/samplet01xy1.nd2 at</div><div>> > loci.formats.ImageReader.getReader(ImageReader.java:190) at</div><div>> > loci.formats.ImageReader.setId(ImageReader.java:832)</div><div>> </div><div>> This is currently expected; at the moment, the cppwrap builds only</div><div>> contain BSD-licensed readers.</div></div><div><br></div></span><div>IIRC, it is not necessary to produce C++ proxies for every single Bio-Formats class, because typical API usage on the C++ side does not involve directly accessing those individual reader classes. All that is necessary is that in the C++ client code, the classpath of the created JVM includes formats-gpl.jar.</div><div><br></div><div>E.g. on Windows, something like:</div><div><br></div><div><div><span style="white-space:pre-wrap">               </span>list.push_back(jace::ClassPath("jace-runtime.jar;bioformats_package.jar"));</div></div><div><br></div><div>Or the individual list of JARs, if you are using those rather than the uber-jar.</div><div><br></div><div>Joe: Are you in fact using Bio-Formats from C++ via the C++ bindings? Or does this problem happen to you in pure Java?</div><div><br></div><div>Regards,</div><div>Curtis</div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 13, 2015 at 3:21 PM, Melissa Linkert <span dir="ltr"><<a href="mailto:melissa@glencoesoftware.com" target="_blank">melissa@glencoesoftware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Joe,<br>
<span><br>
> I am using Bio-formats 5.1.2, and I have trouble opening a .nd2 file from<br>
> my program and from "showinf". The .nd2 file has been uploaded. The weird<br>
> thing is Fiji can open the file fine. The error message I got was:<br>
><br>
> 11:35:54.179 [main] DEBUG loci.common.NIOByteBufferProvider - Using mapped<br>
> byte buffer? false<br>
> loci.formats.UnknownFormatException: Unknown file format:<br>
> /common1/phsiao/build/vst/sample_vid/samplet01xy1.nd2<br>
>     at loci.formats.ImageReader.getReader(ImageReader.java:190)<br>
>     at loci.formats.ImageReader.setId(ImageReader.java:832)<br>
<br>
</span>This is currently expected; at the moment, the cppwrap builds only contain<br>
BSD-licensed readers.  The final column in the list of supported<br>
formats indicates which formats this includes:<br>
<br>
<a href="http://www.openmicroscopy.org/site/support/bio-formats5.1/supported-formats.html" rel="noreferrer" target="_blank">http://www.openmicroscopy.org/site/support/bio-formats5.1/supported-formats.html</a><br>
<br>
There is a ticket on our issue tracking system to add all remaining<br>
readers:<br>
<br>
<a href="https://trac.openmicroscopy.org/ome/ticket/11896" rel="noreferrer" target="_blank">https://trac.openmicroscopy.org/ome/ticket/11896</a><br>
<br>
If you would like to be CC'd on the ticket, please let us know.<br>
<br>
Regards,<br>
-Melissa<br>
<div><div><br>
On Thu, Aug 13, 2015 at 03:21:24PM -0400, Joe Ping-Lin Hsiao wrote:<br>
> Hi,<br>
><br>
> I am using Bio-formats 5.1.2, and I have trouble opening a .nd2 file from<br>
> my program and from "showinf". The .nd2 file has been uploaded. The weird<br>
> thing is Fiji can open the file fine. The error message I got was:<br>
><br>
> 11:35:54.179 [main] DEBUG loci.common.NIOByteBufferProvider - Using mapped<br>
> byte buffer? false<br>
> loci.formats.UnknownFormatException: Unknown file format:<br>
> /common1/phsiao/build/vst/sample_vid/samplet01xy1.nd2<br>
>     at loci.formats.ImageReader.getReader(ImageReader.java:190)<br>
>     at loci.formats.ImageReader.setId(ImageReader.java:832)<br>
<br>
</div></div>> _______________________________________________<br>
> ome-users mailing list<br>
> <a href="mailto:ome-users@lists.openmicroscopy.org.uk" target="_blank">ome-users@lists.openmicroscopy.org.uk</a><br>
> <a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users" rel="noreferrer" target="_blank">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users</a><br>
<br>
_______________________________________________<br>
ome-users mailing list<br>
<a href="mailto:ome-users@lists.openmicroscopy.org.uk" target="_blank">ome-users@lists.openmicroscopy.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users" rel="noreferrer" target="_blank">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users</a><br>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>