[ImageJ-devel] Scifion Img Opener some question

Mark Hiner hiner at wisc.edu
Mon Jul 8 09:22:57 CDT 2013


Hi Michael,

-  the scifio ImgOpener's openImg method has the parameters Reader, type,
> factory and options
>         - What is the relationship between Reader and IFormatReader (we
> used previously the openImg(IFormatReader ...) method)
>         - can we retriev the type from a Reader (IFormatReader x;
> ImgIOUtils.makeType(x.getPixelType())
>

 An IFormatReader<https://github.com/openmicroscopy/bioformats/blob/develop/components/scifio/src/loci/formats/IFormatReader.java>is
the loci.formats base reader interface that performs all the metadata
parsing and pixel reading in Bio-Formats. In SCIFIO, the process is split
into components such as a
Parser<https://github.com/scifio/scifio/blob/master/scifio/src/main/java/io/scif/Parser.java>or
Reader<https://github.com/scifio/scifio/blob/master/scifio/src/main/java/io/scif/Reader.java>.
So the io.scif Reader API is a subset of the IFormatReader, specifically
for opening pixels.

The pixel type (and all other metadata) is now stored in the i
o.scif.Metadata<https://github.com/scifio/scifio/blob/master/scifio/src/main/java/io/scif/Metadata.java>class,
which gets attached to the Reader.
Reader#getMetadata()<https://github.com/scifio/scifio/blob/master/scifio/src/main/java/io/scif/Reader.java#L171>will
get the current Metadata object, and
Metadata#getPixelType(int)<https://github.com/scifio/scifio/blob/master/scifio/src/main/java/io/scif/Metadata.java#L154>gets
the pixel type for a specified image index (the Metadata class is at
the dataset level; if you have a single image in your dataset, you can just
get getPixelType(0) ).

Note that the entry point for all these classes is the
Format<https://github.com/scifio/scifio/blob/master/scifio/src/main/java/io/scif/Format.java>.
Also, there is a series of
tutorials<https://github.com/scifio/scifio/tree/master/tutorials>introducing
the SCIFIO API, with a specific focus on transitioning from the
loci.formats API.

- the imglib2.io ImgOpener has some static methods like
>         - public static AxisType[] getDimTypes(final IFormatReader r)
>         - public static double[] getCalibration(final IFormatReader r)
>
    how can I retriev such data using the scifio ImgOpener?
>

 The io.scif.Metadata class uses the imglib AxisTypes natively to manage
dimensions. So if you have an io.scif.Reader, you can get its Metadata (as
above) and call
Metadata#getAxes(int)<https://github.com/scifio/scifio/blob/master/scifio/src/main/java/io/scif/Metadata.java#L268>for
the desired image index within the dataset.

Unfortunately the calibration data is more complicated right now. In the
loci.formats API, all the calibration information was tracked as physical
pixel sizes in the MetadataStore. So in the io.scif API, that metadata only
exists in the OMEMetadata<https://github.com/scifio/bioformats/blob/scifio/components/ome-xml/src/ome/xml/meta/OMEMetadata.java>class,
which requires our fork of Bio-Formats on the classpath, and then
requires Translation<https://github.com/scifio/scifio/blob/master/scifio/src/main/java/io/scif/services/TranslatorService.java>.
Our intention is to make calibration information a fundamental part of the
axes representation, but I'm not sure if this will be at the ImgLib or
SCIFIO level.

One way or another, it will eventually be part of the io.scif.Metadata API.

- ImgOptions supports the selection of an interval (thanks for that). But
> for our implementation we would need a multiple interval selection (e.g.
> the first 10 frames of a video and the last 10). Is it possible to change
> the implementation such that ImgOption accepts an array of intervals?
>

Yes, this is a very good idea and I'm sorry it wasn't available from the
beginning. I've added an issue to track
it<https://github.com/scifio/scifio/issues/14>and will get it into the
next SCIFIO release.

Thanks for the feedback and let me know if you have any more questions.

- Mark

P.S. there is now a SCIFIO mailing list (scifio at scif.io, copied) for
scifio-specific issues


On Fri, Jul 5, 2013 at 5:35 AM, Michael Zinsmaier
<michael.zinsmaier at gmx.de>wrote:

> Hi together, hi Mark,
>
> I just started to convert the Knime Image Processing "Image Reader" code
> to the new implementation of ImgOpener (scifio). However I am a bit stuck
> could you help me with a few questions regarding the code changes?
>
> - the imglib2.io ImgOpener has some static methods like
>         - public static AxisType[] getDimTypes(final IFormatReader r)
>         - public static double[] getCalibration(final IFormatReader r)
>
>     how can I retriev such data using the scifio ImgOpener?
>
> -  the scifio ImgOpener's openImg method has the parameters Reader, type,
> factory and options
>         - What is the relationship between Reader and IFormatReader (we
> used previously the openImg(IFormatReader ...) method)
>         - can we retriev the type from a Reader (IFormatReader x;
> ImgIOUtils.makeType(x.**getPixelType())
>
> - ImgOptions supports the selection of an interval (thanks for that). But
> for our implementation we would need a multiple interval selection (e.g.
> the first 10 frames of a video and the last 10). Is it possible to change
> the implementation such that ImgOption accepts an array of intervals?
>
> Thanks in advance
> best regards,
> Michael
>
> ______________________________**_________________
> ImageJ-devel mailing list
> ImageJ-devel at imagej.net
> http://imagej.net/mailman/**listinfo/imagej-devel<http://imagej.net/mailman/listinfo/imagej-devel>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20130708/7b2182cc/attachment.html>


More information about the ImageJ-devel mailing list