/** * Constructor. * @param path The root of the ROMIO proprietary pixels store. (usually * <code>/OMERO/Pixels</code>). */ public PixelsService(String path) { this(path, null, new SimpleBackOff(), new ConfiguredTileSizes(), null); }
/** * Implemented as specified by {@link PixelBuffer} I/F. * @see PixelBuffer#getTimepoint(Integer) */ public PixelData getTimepoint(Integer t) throws IOException, DimensionsOutOfBoundsException { Long offset = getTimepointOffset(t); Integer size = safeLongToInteger(getTimepointSize()); return getRegion(size, offset); }
/** * Helper method to properlty create a RomioPixelBuffer. * * @param pixelsFilePath * @param pixels * @param allowModification */ protected PixelBuffer createRomioPixelBuffer(String pixelsFilePath, Pixels pixels, boolean allowModification) { return new RomioPixelBuffer(pixelsFilePath, pixels, allowModification); }
/** * Returns FileBuffer based on OriginalFile path * * @param file * @return FileBuffer */ public FileBuffer getFileBuffer(OriginalFile file, String mode) { String path = getFilesPath(file.getId()); createSubpath(path); return new FileBuffer(path, mode); }
/** * Implemented as specified by {@link PixelBuffer} I/F. * @see PixelBuffer#setRow(ByteBuffer, Integer, Integer, Integer, Integer) */ public void setRow(ByteBuffer buffer, Integer y, Integer z, Integer c, Integer t) throws IOException, DimensionsOutOfBoundsException { throwIfReadOnly(); Long offset = getRowOffset(y, z, c, t); Integer size = getRowSize(); setRegion(size, offset, buffer); }
/** * Return byte array of Thumbnail * * @param thumbnail * @return a byte array * @throws IOException */ public byte[] getThumbnail(Thumbnail thumbnail) throws IOException { byte[] buf = new byte[(int) getThumbnailLength(thumbnail)]; return getThumbnail(thumbnail, buf); }
/** * Implemented as specified by {@link PixelBuffer} I/F. * @see PixelBuffer#getPlaneSize() */ public Long getPlaneSize() { if (planeSize == null) { planeSize = (long) getSizeX() * (long) getSizeY() * getByteWidth(); } return planeSize; }
/** * Implemented as specified by {@link PixelBuffer} I/F. * @see PixelBuffer#getStackOffset(Integer, Integer) */ public Long getStackOffset(Integer c, Integer t) throws DimensionsOutOfBoundsException { checkBounds(null, null, null, c, t); Long timepointSize = getTimepointSize(); Long stackSize = getStackSize(); return timepointSize * t + stackSize * c; }
/** * Implemented as specified by {@link PixelBuffer} I/F. * @see PixelBuffer#getRow(Integer, Integer, Integer, Integer) */ public PixelData getRow(Integer y, Integer z, Integer c, Integer t) throws IOException, DimensionsOutOfBoundsException { //dimension check getRowOffset Long offset = getRowOffset(y, z, c, t); Integer size = getRowSize(); return getRegion(size, offset); }
/** * Retrieves the number of resolution levels that the backing * pixels pyramid contains. * @return The number of resolution levels. This value does not * necessarily indicate either the presence or absence of a * pixels pyramid. * @see ome.io.nio.PixelBuffer#getResolutionLevels() **/ public int getResolutionLevels() { return buffer.getResolutionLevels(); }
/** * Implemented as specified by {@link PixelBuffer} I/F. * @see PixelBuffer#getTotalSize() */ public Long getTotalSize() { if (totalSize == null) { totalSize = getTimepointSize() * getSizeT(); } return totalSize; }
/** * Retrieves the active resolution level. * @return The active resolution level. * @see ome.io.nio.PixelBuffer#getResolutionLevel() **/ public int getResolutionLevel() { return buffer.getResolutionLevel(); }
public Integer getRowSize() { return getSizeX() * getByteWidth(); }
/** * Implemented as specified by {@link PixelBuffer} I/F. * @see PixelBuffer#getStackSize() */ public Long getStackSize() { if (stackSize == null) { stackSize = getPlaneSize() * getSizeZ(); } return stackSize; }
/** * Returns the image's size information per resolution level. * * @return See above. */ public List<List<Integer>> getResolutionDescriptions() { return buffer.getResolutionDescriptions(); }
/** * Returns a numbered path relative to the root of this service, but is * ignorant of FS and similar constructs. For example, given an id of * 123456 this will return "ROOT/Thumbnails/Dir-123/Dir-456/123456" * * @param id the thumbnail identifier * @return the path relative to the root */ public String getThumbnailPath(Long id) { return getPath(THUMBNAILS_PATH, id); }
public PixelData getTile(Integer z, Integer c, Integer t, Integer x, Integer y, Integer w, Integer h) throws IOException { return getPlaneRegion(x, y, w, h, z, c, t, 0); }
@Override public String toString() { return getPath(); }
/** * Constructor. * @param path The root of the ROMIO proprietary pixels store. (usually * <code>/OMERO/Pixels</code>). */ @Deprecated public PixelsService(String path, FilePathResolver resolver) { this(path, resolver, new SimpleBackOff(), new ConfiguredTileSizes(), null); }
/** * Returns a numbered path relative to the root of this service, but is * ignorant of FS and similar constructs. For example, given an id of * 123456 this will return "ROOT/Files/Dir-123/Dir-456/123456" * * @param id the Files identifier * @return the path relative to the root */ public String getFilesPath(Long id) { return getPath(FILES_PATH, id); }