Use BioFormat in java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Use BioFormat in java

CARL Philippe (LBP)
Dear all,

I’m using the last version of ImageJ (1.51r) running under Java 1.6.0_24
(64-bit) and using the Bio-formats 5.1.10 (which seems to be the last
version running with java < 1.7).

With this configuration, I tried to write a java code that would retrieve
the X and Y calibration values and symbols from a stack of pictures.

Thus I started with something quite easy at the beginning, by trying to make
run the code found under the following link (which should actually be
formatted for the version 5.1.10 of the Bio-formats):

https://github.com/openmicroscopy/bioformats/blob/v5.1.10/components/bio-for
mats-plugins/utils/Simple_Read.java

But this code is already not compiling as soon as it finds either one of the
two Bio-formats imports, i.e.:

import loci.formats.FormatException;

or

import loci.plugins.BF;

For trying to solve this issue, I moved the "bioformats_package.jar" file
from the "plugins" into the "plugins/jars" folder, but this had no effect.

What am I doing wrong?

Also I have the impression that it is quite easy to use the bio-formats
within a macro code, but once moving to java there are way more issues which
are as well connected with the library version. Am I right with this?

I thank you very much in advance for your answers and help.

My best regards,

Philippe

 

Philippe CARL

Laboratoire de Biophotonique et Pharmacologie

UMR 7213 CNRS - Université de Strasbourg

Faculté de Pharmacie

74 route du Rhin

67401 ILLKIRCH

Tel : +33(0)3 68 85 41 84

 


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Use BioFormat in java

ctrueden
Hi Philippe,

> this code is already not compiling as soon as it finds either one of
> the two Bio-formats imports

I have created and pushed a repository with a sample Maven project that
uses Bio-Formats 5.1.0 + ImageJ 1.x + Java 6:
    https://github.com/imagej/example-bio-formats-legacy-plugin

> I tried to write a java code that would retrieve the X and Y
> calibration values and symbols from a stack of pictures.

Is there some reason you need Bio-Formats specifically, rather than
examining the Calibration of the ImagePlus?

Regards,
Curtis

--
Curtis Rueden
LOCI software architect - https://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden
Did you know ImageJ has a forum? http://forum.imagej.net/


On Tue, Oct 17, 2017 at 8:09 AM, Philippe CARL <[hidden email]>
wrote:

> Dear all,
>
> I’m using the last version of ImageJ (1.51r) running under Java 1.6.0_24
> (64-bit) and using the Bio-formats 5.1.10 (which seems to be the last
> version running with java < 1.7).
>
> With this configuration, I tried to write a java code that would retrieve
> the X and Y calibration values and symbols from a stack of pictures.
>
> Thus I started with something quite easy at the beginning, by trying to
> make
> run the code found under the following link (which should actually be
> formatted for the version 5.1.10 of the Bio-formats):
>
> https://github.com/openmicroscopy/bioformats/blob/v5.1.10/
> components/bio-for
> mats-plugins/utils/Simple_Read.java
> <https://github.com/openmicroscopy/bioformats/blob/v5.1.10/components/bio-formats-plugins/utils/Simple_Read.java>
>
> But this code is already not compiling as soon as it finds either one of
> the
> two Bio-formats imports, i.e.:
>
> import loci.formats.FormatException;
>
> or
>
> import loci.plugins.BF;
>
> For trying to solve this issue, I moved the "bioformats_package.jar" file
> from the "plugins" into the "plugins/jars" folder, but this had no effect.
>
> What am I doing wrong?
>
> Also I have the impression that it is quite easy to use the bio-formats
> within a macro code, but once moving to java there are way more issues
> which
> are as well connected with the library version. Am I right with this?
>
> I thank you very much in advance for your answers and help.
>
> My best regards,
>
> Philippe
>
>
>
> Philippe CARL
>
> Laboratoire de Biophotonique et Pharmacologie
>
> UMR 7213 CNRS - Université de Strasbourg
>
> Faculté de Pharmacie
>
> 74 route du Rhin
>
> 67401 ILLKIRCH
>
> Tel : +33(0)3 68 85 41 84
>
>
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Use BioFormat in java

CARL Philippe (LBP)
Dear Curtis,
Thanks a lot or your answer and suggestions.
Actually no, there is absolutelly no reason to not use the Calibration features of the ImagePlus class.
But given that I was always using the Bio-Formats when I needed some more advanced reading features, I simply didn't think about already having this one in the native ImagePlus class.
And to complete your answer, the use of the the Calibration features of the ImagePlus class has already been answered here:
http://imagej.1557.x6.nabble.com/Getting-the-scale-td3686642.html
My best regards,
Philippe

Le Mardi 17 Octobre 2017 17:18 CEST, Curtis Rueden <[hidden email]> a écrit:

> Hi Philippe,
>
> > this code is already not compiling as soon as it finds either one of
> > the two Bio-formats imports
>
> I have created and pushed a repository with a sample Maven project that
> uses Bio-Formats 5.1.0 + ImageJ 1.x + Java 6:
>     https://github.com/imagej/example-bio-formats-legacy-plugin
>
> > I tried to write a java code that would retrieve the X and Y
> > calibration values and symbols from a stack of pictures.
>
> Is there some reason you need Bio-Formats specifically, rather than
> examining the Calibration of the ImagePlus?
>
> Regards,
> Curtis
>
> --
> Curtis Rueden
> LOCI software architect - https://loci.wisc.edu/software
> ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden
> Did you know ImageJ has a forum? http://forum.imagej.net/
>
>
> On Tue, Oct 17, 2017 at 8:09 AM, Philippe CARL <[hidden email]>
> wrote:
>
> > Dear all,
> >
> > I’m using the last version of ImageJ (1.51r) running under Java 1.6.0_24
> > (64-bit) and using the Bio-formats 5.1.10 (which seems to be the last
> > version running with java < 1.7).
> >
> > With this configuration, I tried to write a java code that would retrieve
> > the X and Y calibration values and symbols from a stack of pictures.
> >
> > Thus I started with something quite easy at the beginning, by trying to
> > make
> > run the code found under the following link (which should actually be
> > formatted for the version 5.1.10 of the Bio-formats):
> >
> > https://github.com/openmicroscopy/bioformats/blob/v5.1.10/
> > components/bio-for
> > mats-plugins/utils/Simple_Read.java
> > <https://github.com/openmicroscopy/bioformats/blob/v5.1.10/components/bio-formats-plugins/utils/Simple_Read.java>
> >
> > But this code is already not compiling as soon as it finds either one of
> > the
> > two Bio-formats imports, i.e.:
> >
> > import loci.formats.FormatException;
> >
> > or
> >
> > import loci.plugins.BF;
> >
> > For trying to solve this issue, I moved the "bioformats_package.jar" file
> > from the "plugins" into the "plugins/jars" folder, but this had no effect.
> >
> > What am I doing wrong?
> >
> > Also I have the impression that it is quite easy to use the bio-formats
> > within a macro code, but once moving to java there are way more issues
> > which
> > are as well connected with the library version. Am I right with this?
> >
> > I thank you very much in advance for your answers and help.
> >
> > My best regards,
> >
> > Philippe
> >
> >
> >
> > Philippe CARL
> >
> > Laboratoire de Biophotonique et Pharmacologie
> >
> > UMR 7213 CNRS - Université de Strasbourg
> >
> > Faculté de Pharmacie
> >
> > 74 route du Rhin
> >
> > 67401 ILLKIRCH
> >
> > Tel : +33(0)3 68 85 41 84
> >
> >
> >
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html





--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html