@Override public void close(boolean fileOnly) throws IOException { super.close(fileOnly); if (!fileOnly) { pyramidDepth = 1; profileXML = null; } }
/** Populates the metadata hashtable and metadata store. */ protected void initMetadata() throws FormatException, IOException { initStandardMetadata(); initMetadataStore(); }
protected void put(String key, int value) { if (value == -1) return; // indicates missing value addGlobalMeta(key, value); }
@Override protected void initMetadataStore() throws FormatException { super.initMetadataStore(); MetadataStore store = makeFilterMetadata(); if (description != null) { description = description.replaceAll("\n", "; "); store.setImageDescription(description, 0); } populateMetadataStoreImageJ(store); }
@Override protected void initStandardMetadata() throws FormatException, IOException { super.initStandardMetadata();
if (getMetadataOptions().getMetadataLevel() == MetadataLevel.MINIMUM) { return; put("PageName #" + i, ifds.get(i), IFD.PAGE_NAME); put("ImageWidth", firstIFD, IFD.IMAGE_WIDTH); put("ImageLength", firstIFD, IFD.IMAGE_LENGTH); put("BitsPerSample", firstIFD, IFD.BITS_PER_SAMPLE); for (Integer key : exif.keySet()) { int k = key.intValue(); addGlobalMeta(getExifTagName(k), exif.get(key)); put("Compression", comp.getCodecName()); put("PhotometricInterpretation", photoInterp); put("MetaDataPhotometricInterpretation", metaDataPhotoInterp); putInt("CellWidth", firstIFD, IFD.CELL_WIDTH); putInt("CellLength", firstIFD, IFD.CELL_LENGTH); put("ImageWidth", firstIFD, IFD.IMAGE_LENGTH); put("ImageLength", firstIFD, IFD.IMAGE_WIDTH); put("Orientation", orientation); putInt("SamplesPerPixel", firstIFD, IFD.SAMPLES_PER_PIXEL); put("Software", firstIFD, IFD.SOFTWARE); put("Instrument Make", firstIFD, IFD.MAKE);
MetadataStore store = makeFilterMetadata(); String creationDate = getImageCreationDate(); String date = DateTools.formatDate(creationDate, DATE_FORMATS, "."); if (creationDate != null && date == null) { if (getMetadataOptions().getMetadataLevel() != MetadataLevel.MINIMUM) { double pixY = firstIFD.getYResolution(); String unit = getResolutionUnitFromComment(firstIFD); if (exp instanceof TiffRational) { Time exposure = new Time(((TiffRational) exp).doubleValue(), UNITS.SECOND); for (int i=0; i<getImageCount(); i++) { store.setPlaneExposureTime(exposure, 0, i);
@Override protected void initStandardMetadata() throws FormatException, IOException { super.initStandardMetadata(); addGlobalMeta("channels", super.getSizeC()); addGlobalMeta("slices", getSizeT());
@Override public byte[][] get8BitLookupTable() throws FormatException, IOException { FormatTools.assertId(currentId, true, 1); if (readers == null || lastFile < 0 || lastFile >= readers.length || readers[lastFile] == null) { return super.get8BitLookupTable(); } return readers[lastFile].get8BitLookupTable(); }
@Override public short[][] get16BitLookupTable() throws FormatException, IOException { FormatTools.assertId(currentId, true, 1); if (readers == null || lastFile < 0 || lastFile >= readers.length || readers[lastFile] == null) { return super.get16BitLookupTable(); } return readers[lastFile].get16BitLookupTable(); }
@Override protected void initMetadataStore() throws FormatException { super.initMetadataStore(); MetadataStore store = makeFilterMetadata(); if (description != null) { description = description.replaceAll("\n", "; "); store.setImageDescription(description, 0); } populateMetadataStoreImageJ(store); }
@Override protected void initStandardMetadata() throws FormatException, IOException { super.initStandardMetadata();
if (getMetadataOptions().getMetadataLevel() == MetadataLevel.MINIMUM) { return; put("PageName #" + i, ifds.get(i), IFD.PAGE_NAME); put("ImageWidth", firstIFD, IFD.IMAGE_WIDTH); put("ImageLength", firstIFD, IFD.IMAGE_LENGTH); put("BitsPerSample", firstIFD, IFD.BITS_PER_SAMPLE); for (Integer key : exif.keySet()) { int k = key.intValue(); addGlobalMeta(getExifTagName(k), exif.get(key)); put("Compression", comp.getCodecName()); put("PhotometricInterpretation", photoInterp); put("MetaDataPhotometricInterpretation", metaDataPhotoInterp); putInt("CellWidth", firstIFD, IFD.CELL_WIDTH); putInt("CellLength", firstIFD, IFD.CELL_LENGTH); put("ImageWidth", firstIFD, IFD.IMAGE_LENGTH); put("ImageLength", firstIFD, IFD.IMAGE_WIDTH); put("Orientation", orientation); putInt("SamplesPerPixel", firstIFD, IFD.SAMPLES_PER_PIXEL); put("Software", firstIFD, IFD.SOFTWARE); put("Instrument Make", firstIFD, IFD.MAKE);
MetadataStore store = makeFilterMetadata(); String creationDate = getImageCreationDate(); String date = DateTools.formatDate(creationDate, DATE_FORMATS, "."); if (creationDate != null && date == null) { if (getMetadataOptions().getMetadataLevel() != MetadataLevel.MINIMUM) { double pixY = firstIFD.getYResolution(); String unit = getResolutionUnitFromComment(firstIFD); if (exp instanceof TiffRational) { Time exposure = new Time(((TiffRational) exp).doubleValue(), UNITS.SECOND); for (int i=0; i<getImageCount(); i++) { store.setPlaneExposureTime(exposure, 0, i);
@Override public byte[][] get8BitLookupTable() throws FormatException, IOException { FormatTools.assertId(currentId, true, 1); if (readers == null || lastFile < 0 || lastFile >= readers.length || readers[lastFile] == null) { return super.get8BitLookupTable(); } return readers[lastFile].get8BitLookupTable(); }
@Override public short[][] get16BitLookupTable() throws FormatException, IOException { FormatTools.assertId(currentId, true, 1); if (readers == null || lastFile < 0 || lastFile >= readers.length || readers[lastFile] == null) { return super.get16BitLookupTable(); } return readers[lastFile].get16BitLookupTable(); }
@Override public void close(boolean fileOnly) throws IOException { super.close(fileOnly); if (!fileOnly) { imageName = null; channelName = null; cameraName = null; magnification = 0d; physicalSizeX = physicalSizeY = 0d; } }
@Override protected void initMetadataStore() throws FormatException { super.initMetadataStore(); MetadataStore store = makeFilterMetadata(); for (int i=0; i<getSeriesCount(); i++) { store.setImageName("Series " + (i + 1), i); } }
@Override protected void initStandardMetadata() throws FormatException, IOException { super.initStandardMetadata(); String xml = ifds.get(0).getIFDTextValue(NIKON_XML_TAG).trim(); if (xml.length() == 0) { xml = ifds.get(0).getIFDTextValue(NIKON_XML_TAG_2).trim(); } int open = xml.indexOf('<'); if (open >= 0) { xml = xml.substring(open); } xml = "<NIKON>" + xml + "</NIKON>"; xml = XMLTools.sanitizeXML(xml); handler = new ND2Handler(core, false, getImageCount()); try { XMLTools.parseXML(xml, handler); final Map<String, Object> globalMetadata = handler.getMetadata(); for (final Map.Entry<String, Object> entry : globalMetadata.entrySet()) { addGlobalMeta(entry.getKey(), entry.getValue()); } } catch (IOException e) { } }
/** Populates the metadata hashtable and metadata store. */ protected void initMetadata() throws FormatException, IOException { initStandardMetadata(); initMetadataStore(); }