[ome-devel] NDPISReader.isThisType

Lee Kamentsky leek at broadinstitute.org
Thu Oct 23 21:27:20 BST 2014


On Thu, Oct 23, 2014 at 4:19 PM, Sebastien Besson <s.besson at dundee.ac.uk>
wrote:

>  Hi Lee,
>
>  You are right that this method always return true irrespective of the
> file contents for a few
> reader (like NPISReaderr). While seeking the adapted reader,
> isThisType(RandomAccessInputStream)
> is really called as part of isThisType(String name, boolean open). And
> these readers typically
> correspond to file formats where we have no proper way to know whether the
> reader should be used
> apart from the file extension.
>
>  Is there a reason not to call directly setId() which iterates through
> all readers. Catching a
> loci.formats.UnknownFormatException exception would allow you to handle
> the case where no
> suitable reader was found.
>

There was a point in Bio-Formats development when it would reopen the file
for every format it tried. I have some old code which calls isThisType with
a single RandomAccessInputStream for every reader in the class list in
order to keep from doing this. I've forgotten many of the details, but at
one point, I believe it was necessary to do it this way to keep from
stat'ing large directories (> 10K files) many times.

>
>  Best,
> Sebastien
>
>  On 22 Oct 2014, at 16:53, Lee Kamentsky <leek at broadinstitute.org> wrote:
>
>  Hi all,
> I have some code that iterates through the Bio-Formats format readers,
> calling isThisType(RandomAccessInputStream) (as a last resort) to find a
> reader capable of reading a file format. The NDPISReader returns true
> irrespective of the file contents. Is this correct? How can I determine
> which readers are the indiscriminately omnivorous ones?
>
>  Thanks,
> Lee
>  _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
>
>
>
>
>   Dr Sébastien Besson
> Open Microscopy Environment / Harvard Medical School
> Wellcome Trust Centre for Gene Regulation and Expression,
> College of Life Sciences, University of Dundee, Dow Street,
> Dundee DD1 5EH Scotland UK   Tel: (01382) 386364
>
>
> The University of Dundee is a registered Scottish Charity, No: SC015096
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20141023/a792b36b/attachment.html>


More information about the ome-devel mailing list