[ome-devel] Adding min/max information to PyramidTiffReader

Melissa Linkert melissa at glencoesoftware.com
Fri Jan 8 15:22:53 GMT 2016


Hi Paul,

> But because we do the stitching and creation of the pyramid ourselves,
> we are processing all pixels anyway. It would be possible for us to
> add the min max information to an IFD tag to make it available to the
> PyramidTiffReader. But I've been struggling to create the code to
> perform this. So far I've tried to add the following lines to
> initMetadataStore in PyramidTiffReader.java:
> 
>     if (store instanceof IMinMaxStore) {
>         IMinMaxStore minMaxStore = (IMinMaxStore) store;
>         minMaxStore.setChannelGlobalMinMax(0, min, max, series);
>     }

That is the correct way to set min/max values via MetadataStore.

> However, store is not an instance of IMinMaxStore, and this piece is
> never executed. What would the correct way to solve this?

PyramidTiffReader was intended for a very specific case of pyramided
BigTIFF files, and won't accept all pyramided BigTIFFs by default - see
the last couple of lines in isThisType(RandomAccessInputStream).  Can
you confirm that PyramidTiffReader is being used for these files, and
not the "plain" TiffReader?

Whether store is an instance of IMinMaxStore will depend on the context;
during import into OMERO that should be the case, but if you're testing
with e.g. the showinf command line tool then that won't happen by
default.  I'd certainly expect that importing into OMERO with the above
addition would create the StatsInfo correctly, assuming that StatsInfo
hasn't been disabled during a command line import.

If PyramidTiffReader is definitely being used and the StatsInfo still
doesn't show up in OMERO, then I'd suggest opening a Bio-Formats pull
request with the changes you've made so far, so that we can better see
what the problem might be.

Regards,
-Melissa

On Thu, Jan 07, 2016 at 05:32:55PM +0100, Paul van Schayck wrote:
> Dear list,
> 
> I'm working on the PyramidTiffReader to read pyramided BigTiff files.
> With the changes in OMERO 5.1 there is no min max calculation taking
> place anymore upon import. No StatsInfo is being created anymore for
> any files over the pyramid resolution.
> 
> But because we do the stitching and creation of the pyramid ourselves,
> we are processing all pixels anyway. It would be possible for us to
> add the min max information to an IFD tag to make it available to the
> PyramidTiffReader. But I've been struggling to create the code to
> perform this. So far I've tried to add the following lines to
> initMetadataStore in PyramidTiffReader.java:
> 
>     if (store instanceof IMinMaxStore) {
>         IMinMaxStore minMaxStore = (IMinMaxStore) store;
>         minMaxStore.setChannelGlobalMinMax(0, min, max, series);
>     }
> 
> However, store is not an instance of IMinMaxStore, and this piece is
> never executed. What would the correct way to solve this?
> 
> Cheers,
> 
> Paul
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel


More information about the ome-devel mailing list