[ome-users] Having trouble opening .nd2 file in Bio-formats cppwrap

Joe Ping-Lin Hsiao phsiao at cs.unc.edu
Mon Aug 17 17:28:55 BST 2015


Hi Curtis,

Thanks for your reply.
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:

bsh-2.0b4.jar
formats-api-5.1.2.jar
formats-bsd-5.1.2.jar
formats-common-5.1.2.jar
guava-17.0.jar
hamcrest-core-1.1.jar
jace-runtime.jar
jai_imageio-5.1.2.jar
jcommander-1.27.jar
jgoodies-common-1.7.0.jar
jgoodies-forms-1.7.2.jar
joda-time-2.2.jar
junit-4.10.jar
kryo-2.24.0.jar
logback-classic-1.1.1.jar
logback-core-1.1.1.jar
lwf-stubs-5.1.2.jar
metadata-extractor-2.6.2.jar
minlog-1.2.jar
mipav-stubs-5.1.2.jar
native-lib-loader-2.0.2.jar
objenesis-2.1.jar
ome-xml-5.1.2.jar
perf4j-0.9.13.jar
serializer-2.7.1.jar
slf4j-api-1.7.6.jar
snakeyaml-1.6.jar
specification-5.1.2.jar
testng-6.8.jar
turbojpeg-5.1.2.jar
xalan-2.7.1.jar
xercesImpl-2.8.1.jar
xml-apis-1.3.04.jar
xmpcore-5.1.2.jar


Joe

On Mon, Aug 17, 2015 at 11:56 AM, Curtis Rueden <ctrueden at wisc.edu> wrote:

> Hi Joe,
>
> > 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.
>
> Yes, that is correct.
>
> 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:
>
> >
> list.push_back(jace::ClassPath("jace-runtime.jar;bioformats_package.jar"));
>
> Right?
>
> Regards,
> Curtis
>
>
> On Mon, Aug 17, 2015 at 10:09 AM, Joe Ping-Lin Hsiao <phsiao at cs.unc.edu>
> wrote:
>
>> Curtis,
>>
>> 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.
>>
>> Thanks,
>> Joe
>>
>> On Thu, Aug 13, 2015 at 10:20 PM, Curtis Rueden <ctrueden at wisc.edu>
>> wrote:
>>
>>> Hi Melissa and Joe,
>>>
>>> > > loci.formats.UnknownFormatException: Unknown file format:
>>> > > /common1/phsiao/build/vst/sample_vid/samplet01xy1.nd2 at
>>> > > loci.formats.ImageReader.getReader(ImageReader.java:190) at
>>> > > loci.formats.ImageReader.setId(ImageReader.java:832)
>>> >
>>> > This is currently expected; at the moment, the cppwrap builds only
>>> > contain BSD-licensed readers.
>>>
>>> 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.
>>>
>>> E.g. on Windows, something like:
>>>
>>>
>>> list.push_back(jace::ClassPath("jace-runtime.jar;bioformats_package.jar"));
>>>
>>> Or the individual list of JARs, if you are using those rather than the
>>> uber-jar.
>>>
>>> Joe: Are you in fact using Bio-Formats from C++ via the C++ bindings? Or
>>> does this problem happen to you in pure Java?
>>>
>>> Regards,
>>> Curtis
>>>
>>> On Thu, Aug 13, 2015 at 3:21 PM, Melissa Linkert <
>>> melissa at glencoesoftware.com> wrote:
>>>
>>>> Hi Joe,
>>>>
>>>> > I am using Bio-formats 5.1.2, and I have trouble opening a .nd2 file
>>>> from
>>>> > my program and from "showinf". The .nd2 file has been uploaded. The
>>>> weird
>>>> > thing is Fiji can open the file fine. The error message I got was:
>>>> >
>>>> > 11:35:54.179 [main] DEBUG loci.common.NIOByteBufferProvider - Using
>>>> mapped
>>>> > byte buffer? false
>>>> > loci.formats.UnknownFormatException: Unknown file format:
>>>> > /common1/phsiao/build/vst/sample_vid/samplet01xy1.nd2
>>>> >     at loci.formats.ImageReader.getReader(ImageReader.java:190)
>>>> >     at loci.formats.ImageReader.setId(ImageReader.java:832)
>>>>
>>>> This is currently expected; at the moment, the cppwrap builds only
>>>> contain
>>>> BSD-licensed readers.  The final column in the list of supported
>>>> formats indicates which formats this includes:
>>>>
>>>>
>>>> http://www.openmicroscopy.org/site/support/bio-formats5.1/supported-formats.html
>>>>
>>>> There is a ticket on our issue tracking system to add all remaining
>>>> readers:
>>>>
>>>> https://trac.openmicroscopy.org/ome/ticket/11896
>>>>
>>>> If you would like to be CC'd on the ticket, please let us know.
>>>>
>>>> Regards,
>>>> -Melissa
>>>>
>>>> On Thu, Aug 13, 2015 at 03:21:24PM -0400, Joe Ping-Lin Hsiao wrote:
>>>> > Hi,
>>>> >
>>>> > I am using Bio-formats 5.1.2, and I have trouble opening a .nd2 file
>>>> from
>>>> > my program and from "showinf". The .nd2 file has been uploaded. The
>>>> weird
>>>> > thing is Fiji can open the file fine. The error message I got was:
>>>> >
>>>> > 11:35:54.179 [main] DEBUG loci.common.NIOByteBufferProvider - Using
>>>> mapped
>>>> > byte buffer? false
>>>> > loci.formats.UnknownFormatException: Unknown file format:
>>>> > /common1/phsiao/build/vst/sample_vid/samplet01xy1.nd2
>>>> >     at loci.formats.ImageReader.getReader(ImageReader.java:190)
>>>> >     at loci.formats.ImageReader.setId(ImageReader.java:832)
>>>>
>>>> > _______________________________________________
>>>> > ome-users mailing list
>>>> > ome-users at lists.openmicroscopy.org.uk
>>>> > http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
>>>>
>>>> _______________________________________________
>>>> ome-users mailing list
>>>> ome-users at lists.openmicroscopy.org.uk
>>>> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-users/attachments/20150817/5d648b90/attachment.html>


More information about the ome-users mailing list