final Timestamp ts = retrieve.getImageAcquisitionDate(0); dest.putDescription(retrieve.getImageDescription(0)); if (retrieve.getInstrumentCount() > 0) { dest.putMicroscopeModel(retrieve.getMicroscopeModel(0)); dest.putMicroscopeManufacturer(retrieve.getMicroscopeManufacturer(0)); final Hashtable<Integer, Integer> laserWaves = new Hashtable<>(); for (int i = 0; i < retrieve.getLightSourceCount(0); i++) { retrieve.getLaserWavelength(0, i).value().intValue()); dest.putLaserManufacturer(retrieve.getLaserManufacturer(0, 0)); dest.putLaserModel(retrieve.getLaserModel(0, 0)); dest.putLaserPower(retrieve.getLaserPower(0, 0).value().doubleValue()); retrieve.getLaserRepetitionRate(0, 0).value().doubleValue()); dest.putFilterSetModel(retrieve.getFilterSetModel(0, 0)); dest.putDichroicModel(retrieve.getDichroicModel(0, 0)); dest.putExcitationModel(retrieve.getFilterModel(0, 0)); dest.putEmissionModel(retrieve.getFilterModel(0, 1)); dest.putObjectiveModel(retrieve.getObjectiveModel(0, 0)); dest.putImmersion(retrieve.getObjectiveImmersion(0, 0).getValue()); dest.putLensNA(retrieve.getObjectiveLensNA(0, 0)); retrieve.getObjectiveWorkingDistance(0, 0).value().doubleValue());
if (src.getImageID(n) == null) { throw new FormatException("Image ID #" + n + " is null"); if (src.getPixelsID(n) == null) { throw new FormatException("Pixels ID #" + n + " is null"); for (int i=0; i<src.getChannelCount(n); i++) { if (src.getChannelID(n, i) == null) { throw new FormatException("Channel ID #" + i + " in Image #" + n + " is null"); if (src.getPixelsBigEndian(n) == null) if (src.getPixelsBinDataCount(n) == 0 || src.getPixelsBinDataBigEndian(n, 0) == null) { throw new FormatException("BigEndian #" + n + " is null"); if (src.getPixelsDimensionOrder(n) == null) { throw new FormatException("DimensionOrder #" + n + " is null"); if (src.getPixelsType(n) == null) { throw new FormatException("PixelType #" + n + " is null"); if (src.getPixelsSizeC(n) == null) { throw new FormatException("SizeC #" + n + " is null"); if (src.getPixelsSizeT(n) == null) { throw new FormatException("SizeT #" + n + " is null"); if (src.getPixelsSizeX(n) == null) {
MetadataRetrieve retrieve = getMetadataRetrieve(); long totalBytes = 0; for (int i=0; i<retrieve.getImageCount(); i++) { int sizeX = retrieve.getPixelsSizeX(i).getValue(); int sizeY = retrieve.getPixelsSizeY(i).getValue(); int sizeZ = retrieve.getPixelsSizeZ(i).getValue(); int sizeC = retrieve.getPixelsSizeC(i).getValue(); int sizeT = retrieve.getPixelsSizeT(i).getValue(); int type = FormatTools.pixelTypeFromString( retrieve.getPixelsType(i).toString()); long bpp = FormatTools.getBytesPerPixel(type); totalBytes += (long)sizeX * (long)sizeY * (long)sizeZ * (long)sizeC * (long)sizeT * bpp;
private int planeCount() { MetadataRetrieve r = getMetadataRetrieve(); int z = r.getPixelsSizeZ(series).getValue().intValue(); int t = r.getPixelsSizeT(series).getValue().intValue(); int c = r.getChannelCount(series); String pixelType = r.getPixelsType(series).getValue(); int bytes = FormatTools.getBytesPerPixel(pixelType); if (bytes > 1 && c == 1) { c = r.getChannelSamplesPerPixel(series, 0).getValue(); } return z * c * t; }
/** Retrieve the total number of planes in given series. */ protected int getPlaneCount(int series) { MetadataRetrieve r = getMetadataRetrieve(); int z = r.getPixelsSizeZ(series).getValue().intValue(); int t = r.getPixelsSizeT(series).getValue().intValue(); int c = r.getPixelsSizeC(series).getValue().intValue(); c /= r.getChannelSamplesPerPixel(series, 0).getValue().intValue(); return z * c * t; }
@Override public void populateMetadata(final MetadataRetrieve retrieve, final Metadata meta) { final int numImages = retrieve.getImageCount(); if (numImages > 0) meta.setDatasetName(retrieve.getImageName(0)); meta.createImageMetadata(numImages); for (int i = 0; i < numImages; i++) { populateImageMetadata(retrieve, i, meta.get(i)); } }
final int sizeX = retrieve.getPixelsSizeX(imageIndex).getValue(); final int sizeY = retrieve.getPixelsSizeY(imageIndex).getValue(); final int sizeZ = retrieve.getPixelsSizeZ(imageIndex).getValue(); int sizeC = retrieve.getPixelsSizeC(imageIndex).getValue(); final int sizeT = retrieve.getPixelsSizeT(imageIndex).getValue(); final Length physX = retrieve.getPixelsPhysicalSizeX(imageIndex); final Length physY = retrieve.getPixelsPhysicalSizeY(imageIndex); final Length physZ = retrieve.getPixelsPhysicalSizeZ(imageIndex); final Time physT = retrieve.getPixelsTimeIncrement(imageIndex); final double calX = physX == null ? 1.0 : physX.value().doubleValue(); final double calY = physY == null ? 1.0 : physY.value().doubleValue(); retrieve.getPixelsDimensionOrder(imageIndex).getValue(); final PositiveInteger spp = retrieve.getChannelCount(imageIndex) <= 0 ? // null : retrieve.getChannelSamplesPerPixel(imageIndex, 0); final boolean little = !retrieve.getPixelsBigEndian(imageIndex); final int pType = FormatTools.pixelTypeFromString(// retrieve.getPixelsType(imageIndex).getValue()); final int rgbCCount = spp == null ? 1 : spp.getValue();
int width = meta.getPixelsSizeX(series).getValue().intValue(); int height = meta.getPixelsSizeY(series).getValue().intValue(); String pixelType = meta.getPixelsType(series).toString(); int type = FormatTools.pixelTypeFromString(pixelType); PositiveInteger nChannels = meta.getChannelSamplesPerPixel(series, 0); if (nChannels == null) { LOGGER.warn("SamplesPerPixel is null; it is assumed to be 1."); if (meta.getPixelsBigEndian(series) != null) littleEndian = !meta.getPixelsBigEndian(series).booleanValue(); else if (meta.getPixelsBinDataCount(series) == 0) { littleEndian = !meta.getPixelsBinDataBigEndian(series, 0).booleanValue();
retrieve.getPixelsSizeX(i).getValue().intValue()) { msg = String.format("SizeX (expected %d, actually %d)", reader.getSizeX(), retrieve.getPixelsSizeX(i).getValue().intValue()); retrieve.getPixelsSizeY(i).getValue().intValue()) { msg = String.format("SizeY (expected %d, actually %d)", reader.getSizeY(), retrieve.getPixelsSizeY(i).getValue().intValue()); retrieve.getPixelsSizeZ(i).getValue().intValue()) { msg = String.format("SizeZ (expected %d, actually %d)", reader.getSizeZ(), retrieve.getPixelsSizeZ(i).getValue().intValue()); retrieve.getPixelsSizeC(i).getValue().intValue()) { msg = String.format("SizeC (expected %d, actually %d)", reader.getSizeC(), retrieve.getPixelsSizeC(i).getValue().intValue()); retrieve.getPixelsSizeT(i).getValue().intValue()) { msg = String.format("SizeT (expected %d, actually %d)", reader.getSizeT(), retrieve.getPixelsSizeT(i).getValue().intValue()); if (!(r instanceof OMETiffReader)) { boolean littleEndian = false; if (retrieve.getPixelsBigEndian(i) != null)
stageLabelName = meta.getStageLabelName(0); if((stageLabelName != null) && stageLabelName.equals(wlz.getWlzOrgLabelName())) { final Length stageX = meta.getStageLabelX(0); final Length stageY = meta.getStageLabelY(0); final Length stageZ = meta.getStageLabelZ(0); oX = (int) Math.rint(stageX.value(UNITS.REFERENCEFRAME).doubleValue()); oY = (int) Math.rint(stageY.value(UNITS.REFERENCEFRAME).doubleValue()); oZ = (int) Math.rint(stageZ.value(UNITS.REFERENCEFRAME).doubleValue()); int nX = meta.getPixelsSizeX(series).getValue().intValue(); int nY = meta.getPixelsSizeY(series).getValue().intValue(); int nZ = meta.getPixelsSizeZ(series).getValue().intValue(); int nC = meta.getPixelsSizeC(series).getValue().intValue(); int nT = meta.getPixelsSizeT(series).getValue().intValue(); double vX = 1.0; double vY = 1.0; double vZ = 1.0; if(meta.getPixelsPhysicalSizeX(0) != null) { vX = meta.getPixelsPhysicalSizeX(0).value(UNITS.MICROMETER).doubleValue(); if(meta.getPixelsPhysicalSizeY(0) != null) { vY = meta.getPixelsPhysicalSizeY(0).value(UNITS.MICROMETER).doubleValue(); if(meta.getPixelsPhysicalSizeZ(0) != null) { vZ = meta.getPixelsPhysicalSizeZ(0).value(UNITS.MICROMETER).doubleValue(); meta.getPixelsType(series).toString());
sPlaces = "%0" + String.valueOf(retrieve.getImageCount()).length() + "d"; String imageName = retrieve.getImageName(series); if (imageName == null) imageName = "Series" + series; imageName = imageName.replaceAll("/", "_"); DimensionOrder order = retrieve.getPixelsDimensionOrder(series); int sizeC = retrieve.getChannelCount(series); int sizeT = retrieve.getPixelsSizeT(series).getValue(); int sizeZ = retrieve.getPixelsSizeZ(series).getValue(); int[] coordinates = FormatTools.getZCTCoords(order.getValue(), sizeZ, sizeC, sizeT, sizeZ*sizeC*sizeT, image); filename = filename.replaceAll(CHANNEL_NUM, String.format(cPlaces, coordinates[1])); String channelName = retrieve.getChannelName(series, coordinates[1]); if (channelName == null) channelName = String.valueOf(coordinates[1]); channelName = channelName.replaceAll("/", "_"); Timestamp timestamp = retrieve.getImageAcquisitionDate(series); long stamp = 0; String date = null; if (timestamp != null) { date = timestamp.getValue(); if (retrieve.getPlaneCount(series) > image) { Time deltaT = retrieve.getPlaneDeltaT(series, image); if (deltaT != null) { stamp = (long) (deltaT.value(UNITS.SECOND).doubleValue() * 1000);
MetadataRetrieve retrieve = getMetadataRetrieve(); boolean littleEndian = false; if (retrieve.getPixelsBigEndian(series) != null) { littleEndian = !retrieve.getPixelsBigEndian(series).booleanValue(); else if (retrieve.getPixelsBinDataCount(series) == 0) { littleEndian = !retrieve.getPixelsBinDataBigEndian(series, 0).booleanValue(); retrieve.getPixelsType(series).toString()); int bytesPerPixel = FormatTools.getBytesPerPixel(type); ifd.put(new Integer(IFD.IMAGE_LENGTH), new Long(height)); Length px = retrieve.getPixelsPhysicalSizeX(series); Double physicalSizeX = px == null || px.value(UNITS.MICROMETER) == null ? null : px.value(UNITS.MICROMETER).doubleValue(); if (physicalSizeX == null || physicalSizeX.doubleValue() == 0) { Length py = retrieve.getPixelsPhysicalSizeY(series); Double physicalSizeY = py == null || py.value(UNITS.MICROMETER) == null ? null : py.value(UNITS.MICROMETER).doubleValue(); if (physicalSizeY == null || physicalSizeY.doubleValue() == 0) { ifd.putIFDValue(IFD.SAMPLE_FORMAT, sampleFormat); int channels = retrieve.getPixelsSizeC(series).getValue().intValue(); int z = retrieve.getPixelsSizeZ(series).getValue().intValue(); int t = retrieve.getPixelsSizeT(series).getValue().intValue(); ifd.putIFDValue(IFD.IMAGE_DESCRIPTION, "ImageJ=\nhyperstack=true\nimages=" + (channels * z * t) + "\nchannels=" +
if (!success) msg = TestTools.shortClassName(retrieve); if (reader.getSeriesCount() != retrieve.getImageCount()) { msg = "ImageCount (series=" + reader.getSeriesCount() + ", image=" + retrieve.getImageCount() + ")"; int sizeC = retrieve.getPixelsSizeC(i).getValue().intValue(); int nChannelComponents = retrieve.getChannelCount(i); int samplesPerPixel = retrieve.getChannelSamplesPerPixel(i, 0).getValue(); Integer z = null, c = null, t = null; if (retrieve.getPlaneCount(i) > 0) { deltaT = retrieve.getPlaneDeltaT(i, 0); exposure = retrieve.getPlaneExposureTime(i, 0); z = retrieve.getPlaneTheZ(i, 0).getValue(); c = retrieve.getPlaneTheC(i, 0).getValue(); t = retrieve.getPlaneTheT(i, 0).getValue(); if (retrieve.getImageAcquisitionDate(i) != null) { date = retrieve.getImageAcquisitionDate(i).getValue();
FormatTools.pixelTypeFromString(meta.getPixelsType(series).toString()); if (meta.getPixelsBigEndian(series) != null) { littleEndian = !meta.getPixelsBigEndian(series).booleanValue(); else if (meta.getPixelsBinDataCount(series) == 0) { littleEndian = !meta.getPixelsBinDataBigEndian(series, 0).booleanValue(); Number value = 1.0; if (dim == 'X') { if (meta.getPixelsPhysicalSizeX(0) != null) { value = meta.getPixelsPhysicalSizeX(0).value(UNITS.MICROMETER).doubleValue(); if (meta.getPixelsPhysicalSizeY(0) != null) { value = meta.getPixelsPhysicalSizeY(0).value(UNITS.MICROMETER).doubleValue(); if (meta.getPixelsPhysicalSizeZ(0) != null) { value = meta.getPixelsPhysicalSizeZ(0).value(UNITS.MICROMETER).doubleValue(); Time valueTime = meta.getPixelsTimeIncrement(0); if (valueTime != null) { value = valueTime.value(UNITS.SECOND);
Length f = retrieve.getPixelsPhysicalSizeX( 0 ); if ( f != null ) cal = f.value().floatValue(); f = retrieve.getPixelsPhysicalSizeY( 0 ); if ( f != null ) cal = f.value().floatValue(); f = retrieve.getPixelsPhysicalSizeZ( 0 ); if ( f != null ) cal = f.value().floatValue();
String order = meta.getPixelsDimensionOrder(series).getValue(); int sizeZ = meta.getPixelsSizeZ(series).getValue().intValue(); int sizeC = meta.getChannelCount(series); if (rgbChannels <= sizeC) { sizeC /= rgbChannels; int sizeT = meta.getPixelsSizeT(series).getValue().intValue(); int planes = sizeZ * sizeC * sizeT; int sizeX = meta.getPixelsSizeX(series).getValue().intValue(); int sizeY = meta.getPixelsSizeY(series).getValue().intValue(); int pixelType = FormatTools.pixelTypeFromString(meta.getPixelsType(series).toString()); int bytesPerPixel = FormatTools.getBytesPerPixel(pixelType); long planeSize = sizeX * sizeY * rgbChannels * bytesPerPixel;
int sizeX = retrieve.getPixelsSizeX(0).getValue(); int sizeY = retrieve.getPixelsSizeY(0).getValue(); int sizeZ = retrieve.getPixelsSizeZ(0).getValue(); int sizeC = retrieve.getPixelsSizeC(0).getValue(); int sizeT = retrieve.getPixelsSizeT(0).getValue(); int type = FormatTools.pixelTypeFromString(retrieve.getPixelsType(0).toString()); bpp = FormatTools.getBytesPerPixel(type); int site = 1; if (retrieve.getPlateCount()>0) { plate = retrieve.getPlateName(0); well = retrieve.getWellExternalIdentifier(0, 0); site = retrieve.getWellSampleIndex(0, 0, 0).getValue(); LOGGER.info("CellH5Writer: Found plate information Plate / Well / Site {} / {} / {}", plate, well, site); } else {
MetadataRetrieve r = getMetadataRetrieve(); int sizeX = r.getPixelsSizeX(series).getValue(); int sizeY = r.getPixelsSizeY(series).getValue(); int sizeC = r.getPixelsSizeC(series).getValue(); int sizeT = r.getPixelsSizeT(series).getValue(); int sizeZ = r.getPixelsSizeZ(series).getValue(); DimensionOrder dimo = r.getPixelsDimensionOrder(0); int c, z, t; if (dimo.equals(DimensionOrder.XYCZT)) {
String filename = sliceLabelPattern.replaceAll(FormatTools.SERIES_NUM, String.format("%d", series)); String imageName = retrieve.getImageName(series); if (imageName == null) imageName = "Series" + series; filename = sliceLabelPattern; int channelCount = retrieve.getChannelCount(series); if (coordinates[1] < channelCount) { String channelName = retrieve.getChannelName(series, coordinates[1]); if (channelName == null) channelName = String.valueOf(coordinates[1]); filename = filename.replaceAll(FormatTools.CHANNEL_NAME, channelName); Timestamp timestamp = retrieve.getImageAcquisitionDate(series); long stamp = 0; String date = null; if (timestamp != null) { date = timestamp.getValue(); if (retrieve.getPlaneCount(series) > ndx) { Time deltaT = retrieve.getPlaneDeltaT(series, ndx); if (deltaT != null) { stamp = (long) (deltaT.value(UNITS.SECOND).doubleValue() * 1000);
MetadataRetrieve retrieve = getMetadataRetrieve(); boolean littleEndian = false; if (retrieve.getPixelsBigEndian(series) != null) { littleEndian = !retrieve.getPixelsBigEndian(series).booleanValue(); else if (retrieve.getPixelsBinDataCount(series) == 0) { littleEndian = !retrieve.getPixelsBinDataBigEndian(series, 0).booleanValue(); retrieve.getPixelsType(series).toString())); int nChannels = getSamplesPerPixel();