private int planeCount(final int imageIndex) { final MetadataRetrieve r = getMetadata().getOmeMeta().getRoot(); final int z = Math.max(1, // r.getPixelsSizeZ(imageIndex).getValue().intValue()); final int t = Math.max(1, // r.getPixelsSizeT(imageIndex).getValue().intValue()); int c = r.getChannelCount(imageIndex); final String pixelType = r.getPixelsType(imageIndex).getValue(); final int bytes = FormatTools.getBytesPerPixel(pixelType); if (bytes > 1 && c == 1) { c = r.getChannelSamplesPerPixel(imageIndex, 0).getValue(); } c = Math.max(1, c); return z * c * t; }
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; }
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; }
@Override public int getPlaneCount() { MetadataRetrieve retrieve = getMetadataRetrieve(); int c = getSamplesPerPixel(); int type = FormatTools.pixelTypeFromString( retrieve.getPixelsType(series).toString()); int bytesPerPixel = FormatTools.getBytesPerPixel(type); if (bytesPerPixel > 1 && c != 1 && c != 3) { return super.getPlaneCount() * c; } return super.getPlaneCount(); }
@Override public int getPlaneCount() { MetadataRetrieve retrieve = getMetadataRetrieve(); int c = getSamplesPerPixel(); int type = FormatTools.pixelTypeFromString( retrieve.getPixelsType(series).toString()); int bytesPerPixel = FormatTools.getBytesPerPixel(type); if (bytesPerPixel > 1 && c != 1 && c != 3) { return super.getPlaneCount() * c; } return super.getPlaneCount(); }
private byte[] getTile(byte[] buf, Region tileParams, Region srcParams) { MetadataRetrieve retrieve = getMetadataRetrieve(); int type = FormatTools.pixelTypeFromString(retrieve.getPixelsType(series).toString()); int channel_count = getSamplesPerPixel(); int bytesPerPixel = FormatTools.getBytesPerPixel(type); int tileSize = tileParams.width * tileParams.height * bytesPerPixel * channel_count; byte [] returnBuf = new byte[tileSize]; for (int row = tileParams.y; row != tileParams.y + tileParams.height; row++) { for (int sampleoffset = 0; sampleoffset < (tileParams.width * channel_count); sampleoffset++) { int channel_index = sampleoffset / tileParams.width; int channel_offset = (sampleoffset - (tileParams.width * channel_index)) * bytesPerPixel; int full_row_width = srcParams.width * bytesPerPixel; int full_plane_size = full_row_width * srcParams.height; int xoffset = (tileParams.x - srcParams.x) * bytesPerPixel; int yoffset = (row - srcParams.y) * full_row_width; int row_offset = (row - tileParams.y) * tileParams.width * bytesPerPixel; int src_index = yoffset + xoffset + channel_offset + (channel_index * full_plane_size); int dest_index = (tileParams.height * tileParams.width * channel_index * bytesPerPixel) + row_offset; for (int pixelByte = 0; pixelByte < bytesPerPixel; pixelByte++) { returnBuf[dest_index + channel_offset + pixelByte] = buf[src_index + pixelByte]; } } } return returnBuf; }
private byte[] getTile(byte[] buf, Region tileParams, Region srcParams) { MetadataRetrieve retrieve = getMetadataRetrieve(); int type = FormatTools.pixelTypeFromString(retrieve.getPixelsType(series).toString()); int channel_count = getSamplesPerPixel(); int bytesPerPixel = FormatTools.getBytesPerPixel(type); int tileSize = tileParams.width * tileParams.height * bytesPerPixel * channel_count; byte [] returnBuf = new byte[tileSize]; for (int row = tileParams.y; row != tileParams.y + tileParams.height; row++) { for (int sampleoffset = 0; sampleoffset < (tileParams.width * channel_count); sampleoffset++) { int channel_index = sampleoffset / tileParams.width; int channel_offset = (sampleoffset - (tileParams.width * channel_index)) * bytesPerPixel; int full_row_width = srcParams.width * bytesPerPixel; int full_plane_size = full_row_width * srcParams.height; int xoffset = (tileParams.x - srcParams.x) * bytesPerPixel; int yoffset = (row - srcParams.y) * full_row_width; int row_offset = (row - tileParams.y) * tileParams.width * bytesPerPixel; int src_index = yoffset + xoffset + channel_offset + (channel_index * full_plane_size); int dest_index = (tileParams.height * tileParams.width * channel_index * bytesPerPixel) + row_offset; for (int pixelByte = 0; pixelByte < bytesPerPixel; pixelByte++) { returnBuf[dest_index + channel_offset + pixelByte] = buf[src_index + pixelByte]; } } } return returnBuf; }
/** * Seek to the given (x, y) coordinate of the image that starts at * the given offset. */ protected void seekToPlaneOffset(long baseOffset, int x, int y) throws IOException { out.seek(baseOffset); MetadataRetrieve r = getMetadataRetrieve(); int samples = getSamplesPerPixel(); int pixelType = FormatTools.pixelTypeFromString(r.getPixelsType(series).toString()); int bpp = FormatTools.getBytesPerPixel(pixelType); if (interleaved) bpp *= samples; try { int sizeX = getSizeX(); out.skipBytes(bpp * (y * sizeX + x)); } catch (FormatException e) { throw new IOException(e); } }
/** * Seek to the given (x, y) coordinate of the image that starts at * the given offset. */ protected void seekToPlaneOffset(long baseOffset, int x, int y) throws IOException { out.seek(baseOffset); MetadataRetrieve r = getMetadataRetrieve(); int samples = getSamplesPerPixel(); int pixelType = FormatTools.pixelTypeFromString(r.getPixelsType(series).toString()); int bpp = FormatTools.getBytesPerPixel(pixelType); if (interleaved) bpp *= samples; try { int sizeX = getSizeX(); out.skipBytes(bpp * (y * sizeX + x)); } catch (FormatException e) { throw new IOException(e); } }
String type = r.getPixelsType(series).toString(); int pixelType = FormatTools.pixelTypeFromString(type); int bytes = FormatTools.getBytesPerPixel(pixelType);
String type = r.getPixelsType(series).toString(); int pixelType = FormatTools.pixelTypeFromString(type); int bytes = FormatTools.getBytesPerPixel(pixelType);
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);
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);
final String type = r.getPixelsType(imageIndex).toString(); final int pixelType = FormatTools.pixelTypeFromString(type); final int bytes = FormatTools.getBytesPerPixel(pixelType);
retrieve.getPixelsType(series).toString())); int nChannels = getSamplesPerPixel();
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;
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;
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 sizeC = retrieve.getPixelsSizeC(0).getValue(); int sizeT = retrieve.getPixelsSizeT(0).getValue(); int type = FormatTools.pixelTypeFromString(retrieve.getPixelsType(0).toString()); bpp = FormatTools.getBytesPerPixel(type);
String pixelType = meta.getPixelsType(series).toString(); int type = FormatTools.pixelTypeFromString(pixelType); if (!DataTools.containsValue(getPixelTypes(), type)) {