예제 #1
0
 /* @see loci.formats.IFormatReader#getOptimalTileHeight() */
 public int getOptimalTileHeight() {
   FormatTools.assertId(currentId, true, 1);
   if (tiffReader.getCurrentFile() == null) {
     setupReader();
   }
   return tiffReader.getOptimalTileHeight();
 }
예제 #2
0
 /* @see loci.formats.IFormatReader#getOptimalTileHeight() */
 public int getOptimalTileHeight() {
   FormatTools.assertId(currentId, true, 1);
   try {
     return (int) ifds.get(getSeries()).getTileLength();
   } catch (FormatException e) {
     LOGGER.debug("", e);
   }
   return super.getOptimalTileHeight();
 }
예제 #3
0
  /* @see loci.formats.IFormatReader#getSeriesUsedFiles(boolean) */
  public String[] getSeriesUsedFiles(boolean noPixels) {
    FormatTools.assertId(currentId, true, 1);

    if (noPixels) {
      return files.toArray(new String[files.size()]);
    }
    String[] allFiles = new String[files.size() + 1];
    files.toArray(allFiles);
    allFiles[allFiles.length - 1] = currentId;
    return allFiles;
  }
예제 #4
0
 /* @see loci.formats.IFormatReader#getOptimalTileHeight() */
 public int getOptimalTileHeight() {
   FormatTools.assertId(currentId, true, 1);
   if (getCoreIndex() < core.length - ifds.size()) {
     return tileY[getCoreIndex()];
   }
   int ifdIndex = getCoreIndex() - (usedFiles.length - 1);
   try {
     return (int) ifds.get(ifdIndex).getTileLength();
   } catch (FormatException e) {
     LOGGER.debug("Could not retrieve tile height", e);
   }
   return super.getOptimalTileHeight();
 }
예제 #5
0
 public void populateMetadataStore(String[] jsonData) throws FormatException, IOException {
   FormatTools.assertId(currentId, false, 1);
   currentId = "in-memory-json";
   core = new CoreMetadata[jsonData.length];
   positions = new Vector<Position>();
   for (int pos = 0; pos < jsonData.length; pos++) {
     core[pos] = new CoreMetadata();
     Position p = new Position();
     p.metadataFile = "Position #" + (pos + 1);
     positions.add(p);
     setSeries(pos);
     parsePosition(jsonData[pos], pos);
   }
   setSeries(0);
   populateMetadata();
 }
예제 #6
0
  /* @see loci.formats.IFormatReader#getSeriesUsedFiles(boolean) */
  public String[] getSeriesUsedFiles(boolean noPixels) {
    FormatTools.assertId(currentId, true, 1);

    Vector<String> files = new Vector<String>();
    for (String file : metadataFiles) {
      if (file != null) files.add(file);
    }

    if (!noPixels && tiffs != null) {
      int well = getSeries() / (fieldRows * fieldCols);
      for (int i = 0; i < tiffs[well].length; i++) {
        files.add(tiffs[well][i]);
      }
    }

    return files.toArray(new String[files.size()]);
  }
예제 #7
0
 /* @see loci.formats.IFormatReader#getSeriesUsedFiles(boolean) */
 public String[] getSeriesUsedFiles(boolean noPixels) {
   FormatTools.assertId(currentId, true, 1);
   Vector<String> files = new Vector<String>();
   for (Position pos : positions) {
     files.add(pos.metadataFile);
     if (pos.xmlFile != null) {
       files.add(pos.xmlFile);
     }
     if (!noPixels) {
       for (String tiff : pos.tiffs) {
         if (new Location(tiff).exists()) {
           files.add(tiff);
         }
       }
     }
   }
   return files.toArray(new String[files.size()]);
 }
예제 #8
0
  /* @see loci.formats.IFormatHandler#openThumbBytes(int) */
  public byte[] openThumbBytes(int no) throws FormatException, IOException {
    FormatTools.assertId(currentId, true, 1);

    int currentSeries = getSeries();
    int thumbSize =
        getThumbSizeX()
            * getThumbSizeY()
            * FormatTools.getBytesPerPixel(getPixelType())
            * getRGBChannelCount();

    if (getCoreIndex() >= usedFiles.length - 1 || usedFiles.length >= core.length) {
      return super.openThumbBytes(no);
    }

    setSeries(usedFiles.length);
    byte[] thumb = FormatTools.openThumbBytes(this, 0);
    setSeries(currentSeries);
    if (thumb.length == thumbSize) {
      return thumb;
    }
    return super.openThumbBytes(no);
  }
예제 #9
0
  @Override
  public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h)
      throws FormatException, IOException {
    FormatTools.assertId(currentId, true, 1);
    FormatTools.checkPlaneNumber(this, no);
    FormatTools.checkBufferSize(this, buf.length, w, h);

    final int[] zct = FormatTools.getZCTCoords(this, no);

    final byte[] plane;
    try {
      plane = store.getPlane(zct[0], zct[1], zct[2]);
    } catch (ServerError e) {
      throw new FormatException(e);
    }

    RandomAccessInputStream s = new RandomAccessInputStream(plane);
    readPlane(s, x, y, w, h, buf);
    s.close();

    return buf;
  }
예제 #10
0
  /* @see loci.formats.IFormatReader#getSeriesUsedFiles(boolean) */
  public String[] getSeriesUsedFiles(boolean noPixels) {
    FormatTools.assertId(currentId, true, 1);

    return usedFiles;
  }
 /* @see loci.formats.IFormatReader#getDomains() */
 public String[] getDomains() {
   FormatTools.assertId(currentId, true, 1);
   String[] domain = new String[1];
   domain[0] = files.length == 1 ? FormatTools.LM_DOMAIN : FormatTools.HCS_DOMAIN;
   return domain;
 }
 /* @see loci.formats.IFormatReader#getSeriesUsedFiles(boolean) */
 public String[] getUsedFiles(boolean noPixels) {
   FormatTools.assertId(currentId, true, 1);
   return noPixels ? new String[0] : files;
 }
예제 #13
0
 /* @see loci.formats.IFormatReader#getOptimalTileHeight() */
 public int getOptimalTileHeight() {
   FormatTools.assertId(currentId, true, 1);
   return reader.getOptimalTileHeight();
 }
예제 #14
0
 /* @see loci.formats.IFormatReader#getDomains() */
 public String[] getDomains() {
   FormatTools.assertId(currentId, true, 1);
   return hasSPW ? new String[] {FormatTools.HCS_DOMAIN} : FormatTools.NON_SPECIAL_DOMAINS;
 }