public class OMETiffWriter extends TiffWriter
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMPANION_KEY |
static java.lang.String |
CREATOR_KEY |
private java.util.Map<java.lang.String,java.lang.Integer> |
ifdCounts |
private java.lang.String[][] |
imageLocations |
private OMEXMLMetadata |
omeMeta |
private OMEXMLService |
service |
private java.util.Map<java.lang.String,java.lang.String> |
uuids |
private static java.lang.String |
WARNING_COMMENT |
canDetectBigTiff, checkParams, COMPRESSION_J2K, COMPRESSION_J2K_LOSSY, COMPRESSION_JPEG, COMPRESSION_LZW, COMPRESSION_UNCOMPRESSED, COMPRESSION_ZLIB, in, isBigTiff, tiffSaver, tileSizeX, tileSizeY
cm, compression, compressionTypes, fps, initialized, interleaved, metadataRetrieve, options, out, resolution, resolutionData, sequential, series, validBits
COMPRESSION_SUFFIXES, currentId, format, LOGGER, metadataOptions, suffixes
Constructor and Description |
---|
OMETiffWriter() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
private java.lang.String |
getBinaryOnlyOMEXML(java.lang.String file,
java.lang.String companion,
java.lang.String companionUUID) |
java.lang.String |
getCompanion()
Get the value of the
COMPANION_KEY option. |
private java.lang.String |
getOMEXML(java.lang.String file) |
private java.lang.String |
getUUID(java.lang.String filename)
Gets the UUID corresponding to the given filename.
|
private java.lang.String |
insertWarningComment(java.lang.String xml) |
private int |
planeCount() |
private void |
populateImage(OMEXMLMetadata omeMeta,
int series) |
private void |
populateTiffData(OMEXMLMetadata omeMeta,
int[] zct,
int ifd,
int series,
int plane) |
boolean |
preserveCreator()
Get the value of the
CREATOR_KEY option. |
void |
saveBytes(int no,
byte[] buf,
IFD ifd,
int x,
int y,
int w,
int h)
Saves the given image to the specified series in the current file.
|
void |
saveBytes(int no,
byte[] buf,
int x,
int y,
int w,
int h)
Saves the given image tile to the current series in the current file.
|
private void |
saveComment(java.lang.String file,
java.lang.String xml) |
private void |
setCreator(ome.xml.meta.OMEXMLMetadataRoot root)
Set the Creator attribute on the given OME-XML root object.
|
void |
setId(java.lang.String id)
Initializes a writer from the input file name.
|
private void |
setupServiceAndMetadata() |
canDoStacks, createInputStream, createTiffSaver, getPixelTypes, getPlaneCount, getTileSizeX, getTileSizeY, prepareToWriteImage, saveBytes, setBigTiff, setCanDetectBigTiff, setTileSizeX, setTileSizeY, setupTiffSaver
changeOutputFile, checkParams, createOutputStream, getCodecOptions, getColorModel, getCompression, getCompressionTypes, getFramesPerSecond, getMetadataRetrieve, getPixelTypes, getPlaneCount, getResolution, getResolutionCount, getResolutions, getSamplesPerPixel, getSamplesPerPixel, getSeries, getSizeX, getSizeY, hasResolutions, isFullPlane, isInterleaved, isSupportedType, saveBytes, saveBytes, savePlane, savePlane, savePlane, seekToPlaneOffset, setCodecOptions, setColorModel, setCompression, setFramesPerSecond, setInterleaved, setMetadataRetrieve, setResolution, setResolutions, setSeries, setValidBitsPerPixel, setWriteSequentially
checkSuffix, checkSuffix, getFormat, getMetadataOptions, getNativeDataType, getSuffixes, getSupportedMetadataLevels, isThisType, setMetadataOptions
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFormat, getNativeDataType, getSuffixes, isThisType
getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions
getCodec, saveCompressedBytes
private static final java.lang.String WARNING_COMMENT
public static final java.lang.String COMPANION_KEY
public static final java.lang.String CREATOR_KEY
private java.lang.String[][] imageLocations
private OMEXMLMetadata omeMeta
private OMEXMLService service
private java.util.Map<java.lang.String,java.lang.Integer> ifdCounts
private java.util.Map<java.lang.String,java.lang.String> uuids
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class TiffWriter
java.io.IOException
public void saveBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, java.io.IOException
IFormatWriter
saveBytes
in interface IFormatWriter
saveBytes
in class TiffWriter
no
- the plane index within the series.buf
- the byte array that represents the image tile.x
- the X coordinate of the upper-left corner of the image tile.y
- the Y coordinate of the upper-left corner of the image tile.w
- the width (in pixels) of the image tile.h
- the height (in pixels) of the image tile.FormatException
- if one of the parameters is invalid.java.io.IOException
- if there was a problem writing to the file.IFormatWriter.saveBytes(int, byte[], int, int, int, int)
public void saveBytes(int no, byte[] buf, IFD ifd, int x, int y, int w, int h) throws FormatException, java.io.IOException
TiffWriter
saveBytes
in class TiffWriter
FormatException
java.io.IOException
IFormatWriter.saveBytes(int, byte[], int, int, int, int)
public void setId(java.lang.String id) throws FormatException, java.io.IOException
FormatWriter
RandomAccessOutputStream
for the output
file and initializes the metadata for all the series using
FormatWriter.setSeries(int)
.setId
in interface IFormatHandler
setId
in class TiffWriter
id
- a String
specifying the path to the fileFormatException
java.io.IOException
public java.lang.String getCompanion()
COMPANION_KEY
option.public boolean preserveCreator()
CREATOR_KEY
option.
This toggles whether or not the OME Creator attribute will be
overwritten with the current Bio-Formats version. For input
data that does not have a Creator attribute defined, this makes
no difference.
By default, returns false, i.e. the Creator will be overwritten
if it exists.private java.lang.String getUUID(java.lang.String filename)
private void setupServiceAndMetadata() throws loci.common.services.DependencyException, loci.common.services.ServiceException
loci.common.services.DependencyException
loci.common.services.ServiceException
private java.lang.String insertWarningComment(java.lang.String xml)
private java.lang.String getOMEXML(java.lang.String file) throws FormatException, java.io.IOException
FormatException
java.io.IOException
private java.lang.String getBinaryOnlyOMEXML(java.lang.String file, java.lang.String companion, java.lang.String companionUUID) throws FormatException, java.io.IOException, loci.common.services.DependencyException, loci.common.services.ServiceException
FormatException
java.io.IOException
loci.common.services.DependencyException
loci.common.services.ServiceException
private void setCreator(ome.xml.meta.OMEXMLMetadataRoot root)
CREATOR_KEY
option (via preserveCreator
) is used to determine
whether to overwrite the existing value with the Bio-Formats version.root
- OME-XML root objectprivate void saveComment(java.lang.String file, java.lang.String xml) throws java.io.IOException
java.io.IOException
private void populateTiffData(OMEXMLMetadata omeMeta, int[] zct, int ifd, int series, int plane)
private void populateImage(OMEXMLMetadata omeMeta, int series)
private int planeCount()
Copyright © 2024 Open Microscopy Environment