@Override public void setSeries(int series) throws FormatException { if (series < 0) throw new FormatException("Series must be > 0."); if (series >= metadataRetrieve.getImageCount()) { throw new FormatException("Series is '" + series + "' but MetadataRetrieve only defines " + metadataRetrieve.getImageCount() + " series."); } this.series = series; resolution = 0; }
@Override public void setSeries(int series) throws FormatException { if (series < 0) throw new FormatException("Series must be > 0."); if (series >= metadataRetrieve.getImageCount()) { throw new FormatException("Series is '" + series + "' but MetadataRetrieve only defines " + metadataRetrieve.getImageCount() + " series."); } this.series = series; resolution = 0; }
/** * Initializes a writer from the input file name. * * Initializes a {@link RandomAccessOutputStream} for the output * file and initializes the metadata for all the series using * {@link #setSeries(int)}. * * @param id a {@link String} specifying the path to the file */ @Override public void setId(String id) throws FormatException, IOException { if (id.equals(currentId)) return; currentId = id; if (out != null) { out.close(); } out = createOutputStream(); MetadataRetrieve r = getMetadataRetrieve(); initialized = new boolean[r.getImageCount()][]; for (int i=0; i<r.getImageCount(); i++) { initialized[i] = new boolean[getPlaneCount(i)]; } resolution = 0; }
/** * Initializes a writer from the input file name. * * Initializes a {@link RandomAccessOutputStream} for the output * file and initializes the metadata for all the series using * {@link #setSeries(int)}. * * @param id a {@link String} specifying the path to the file */ @Override public void setId(String id) throws FormatException, IOException { if (id.equals(currentId)) return; currentId = id; if (out != null) { out.close(); } out = createOutputStream(); MetadataRetrieve r = getMetadataRetrieve(); initialized = new boolean[r.getImageCount()][]; for (int i=0; i<r.getImageCount(); i++) { initialized[i] = new boolean[getPlaneCount(i)]; } resolution = 0; }
@Override public void setId(String id) throws FormatException, IOException { if (id.equals(currentId)) return; super.setId(id); if (imageLocations == null) { MetadataRetrieve r = getMetadataRetrieve(); imageLocations = new String[r.getImageCount()][]; for (int i=0; i<imageLocations.length; i++) { setSeries(i); imageLocations[i] = new String[planeCount()]; } setSeries(0); } }
@Override public void setId(String id) throws FormatException, IOException { if (id.equals(currentId)) return; super.setId(id); if (imageLocations == null) { MetadataRetrieve r = getMetadataRetrieve(); imageLocations = new String[r.getImageCount()][]; for (int i=0; i<imageLocations.length; i++) { setSeries(i); imageLocations[i] = new String[planeCount()]; } setSeries(0); } }
sPlaces = "%0" + String.valueOf(retrieve.getImageCount()).length() + "d";
sPlaces = "%0" + String.valueOf(retrieve.getImageCount()).length() + "d";
@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)); } }
private void checkROIs(MetadataRetrieve m, int nImages, int nRoisPerImage, String shapeType, int nOtherRois) throws Exception { assertTrue(service.validateOMEXML(service.getOMEXML(m))); assertEquals(m.getImageCount(), nImages); assertEquals(m.getROICount(), nImages * nRoisPerImage + nOtherRois); for (int i = 0; i < m.getImageCount(); i++) { assertEquals(m.getImageROIRefCount(0), nRoisPerImage); } for (int i = nOtherRois; i < m.getROICount(); i++) { assertEquals(m.getShapeCount(i), 1); assertEquals(m.getShapeType(i, 0), shapeType); } }
@Override public void setDest(final RandomAccessOutputStream out, final int imageIndex, final SCIFIOConfig config) throws FormatException, IOException { // TODO if already set, return super.setDest(out, imageIndex, config); if (imageLocations == null) { final MetadataRetrieve r = getMetadata().getOmeMeta().getRoot(); imageLocations = new String[r.getImageCount()][]; for (int i = 0; i < imageLocations.length; i++) { imageLocations[i] = new String[planeCount(imageIndex)]; } } }
String id = currentId; MetadataRetrieve r = getMetadataRetrieve(); int[] planeCounts = new int[r.getImageCount()]; int[] resCounts = new int[r.getImageCount()]; for (int i=0; i<planeCounts.length; i++) { planeCounts[i] = getPlaneCount(i); for (int i=0; i<r.getImageCount(); i++) { setSeries(i); int resCount = resCounts[i];
String id = currentId; MetadataRetrieve r = getMetadataRetrieve(); int[] planeCounts = new int[r.getImageCount()]; int[] resCounts = new int[r.getImageCount()]; for (int i=0; i<planeCounts.length; i++) { planeCounts[i] = getPlaneCount(i); for (int i=0; i<r.getImageCount(); i++) { setSeries(i); int resCount = resCounts[i];
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();
boolean lastSeries = getSeries() == retrieve.getImageCount() - 1; boolean lastResolution = getResolution() == getResolutionCount() - 1; tiffSaver.writeImage(tileBuf, ifd, index, type, tileParams.x, tileParams.y, tileParams.width, tileParams.height, boolean lastSeries = getSeries() == retrieve.getImageCount() - 1; boolean lastResolution = getResolution() == getResolutionCount() - 1; tiffSaver.writeImage(buf, ifd, index, type, x, y, w, h,
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();
boolean lastSeries = getSeries() == retrieve.getImageCount() - 1; boolean lastResolution = getResolution() == getResolutionCount() - 1; tiffSaver.writeImage(tileBuf, ifd, index, type, tileParams.x, tileParams.y, tileParams.width, tileParams.height, boolean lastSeries = getSeries() == retrieve.getImageCount() - 1; boolean lastResolution = getResolution() == getResolutionCount() - 1; tiffSaver.writeImage(buf, ifd, index, type, x, y, w, h,
if (!success) msg = TestTools.shortClassName(retrieve); if (reader.getSeriesCount() != retrieve.getImageCount()) { msg = "ImageCount (series=" + reader.getSeriesCount() + ", image=" + retrieve.getImageCount() + ")";