use of loci.formats.tiff.IFD in project bioformats by openmicroscopy.
the class OperettaReader method isThisType.
/* @see loci.formats.IFormatReader#isThisType(RandomAccessInputStream) */
@Override
public boolean isThisType(RandomAccessInputStream stream) throws IOException {
TiffParser p = new TiffParser(stream);
IFD ifd = p.getFirstIFD();
if (ifd == null)
return false;
Object s = ifd.getIFDValue(XML_TAG);
if (s == null)
return false;
String xml = s instanceof String[] ? ((String[]) s)[0] : s.toString();
return xml.indexOf("Operetta") < 1024;
}
use of loci.formats.tiff.IFD in project bioformats by openmicroscopy.
the class PCIReader method getOptimalTileHeight.
/* @see loci.formats.IFormatReader#getOptimalTileHeight() */
@Override
public int getOptimalTileHeight() {
FormatTools.assertId(currentId, true, 1);
String file = imageFiles.get(0);
try {
if (poi == null) {
initPOIService();
}
RandomAccessInputStream s = poi.getDocumentStream(file);
TiffParser tp = new TiffParser(s);
if (tp.isValidHeader()) {
IFD ifd = tp.getFirstIFD();
s.close();
return (int) ifd.getTileLength();
}
s.close();
} catch (FormatException e) {
LOGGER.debug("Could not retrieve tile height", e);
} catch (IOException e) {
LOGGER.debug("Could not retrieve tile height", e);
}
return super.getOptimalTileHeight();
}
use of loci.formats.tiff.IFD in project bioformats by openmicroscopy.
the class LEOReader method isThisType.
// -- IFormatReader API methods --
/* @see loci.formats.IFormatReader#isThisType(RandomAccessInputStream) */
@Override
public boolean isThisType(RandomAccessInputStream stream) throws IOException {
TiffParser parser = new TiffParser(stream);
parser.setDoCaching(false);
IFD ifd = parser.getFirstIFD();
if (ifd == null)
return false;
return ifd.containsKey(LEO_TAG);
}
use of loci.formats.tiff.IFD in project bioformats by openmicroscopy.
the class MIASReader method isThisType.
/* @see loci.formats.IFormatReader#isThisType(RandomAccessInputStream) */
@Override
public boolean isThisType(RandomAccessInputStream stream) throws IOException {
TiffParser tp = new TiffParser(stream);
IFD ifd = tp.getFirstIFD();
if (ifd == null)
return false;
Object s = ifd.getIFDValue(IFD.SOFTWARE);
if (s == null)
return false;
String software = null;
if (s instanceof String[])
software = ((String[]) s)[0];
else
software = s.toString();
return software.startsWith("eaZYX") || software.startsWith("SCIL_Image") || software.startsWith("IDL");
}
use of loci.formats.tiff.IFD in project bioformats by openmicroscopy.
the class FEITiffReader method isThisType.
// -- IFormatReader API methods --
/* @see loci.formats.IFormatReader#isThisType(RandomAccessInputStream) */
@Override
public boolean isThisType(RandomAccessInputStream stream) throws IOException {
TiffParser tp = new TiffParser(stream);
IFD ifd = tp.getFirstIFD();
if (ifd == null)
return false;
return ifd.containsKey(SFEG_TAG) || ifd.containsKey(HELIOS_TAG) || ifd.containsKey(TITAN_TAG);
}
Aggregations