[SCIFIO] reuse reader for files of same format

Mark Hiner hinerm at gmail.com
Mon Aug 26 08:02:51 CDT 2013


See Issue 57 <https://github.com/scifio/scifio/issues/57>


On Mon, Aug 26, 2013 at 7:53 AM, Mark Hiner <hinerm at gmail.com> wrote:

> Hi Michael,
>
>   This definitely should work. The Metadata attached to a Reader should
> determine the image dimensionality, and the Metadata should be re-parsed
> automatically when setting the source.
>
>  Oh.. but looking at the source, the PNG reader has state (it remembers
> the last plane it read. So if the reader was stateless (which it's supposed
> to be) it should work. I'll just have to make a pass through the formats
> and remove any state from the readers, or if that's not possible I'll make
> sure they reset properly when calling setSource.
>
> Thanks for pointing this out,
> Mark
>
>
> On Mon, Aug 26, 2013 at 7:13 AM, Michael Zinsmaier <
> michael.zinsmaier at gmx.de> wrote:
>
>> Hi together,
>>
>> is it possible to use the same reader for multiple files of the same
>> format?
>> I want to read e.g. 10  .png files that may differ in their
>> dimensionality but use all the same format and encoding can I reuse a
>> reader instead of doing the potentially expensive format tests for each
>> file. We tried it naively with reader.setSource which somehow works but
>> dimensionality and size data is not rediscovered => the reader tries to
>> load all images with the same size.
>>
>> Is their a better way to do this?
>> (We still want to use the format discovery for the first image but assume
>> for all others that they have the same format.)
>>
>> Best Regards Michael
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://scif.io/pipermail/scifio/attachments/20130826/42b9a031/attachment-0002.html>


More information about the SCIFIO mailing list