M - - The Metadata type required by this Writer.public abstract class AbstractWriter<M extends TypedMetadata> extends AbstractHasSource implements TypedWriter<M>
Writer implementations.| Constructor and Description |
|---|
AbstractWriter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canDoStacks() |
protected void |
checkLocation(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> out,
SCIFIOConfig config)
Validate that the given output is consistent with the given configuration.
|
protected void |
checkParams(int imageIndex,
long planeIndex,
byte[] buf,
net.imglib2.Interval bounds)
Ensure that the arguments that are being passed to saveBytes(...) are
valid.
|
void |
close(boolean fileOnly)
Closes the image source(s) associated with this component, with a toggle to
determine if the component itself is reset.
|
CodecOptions |
getCodecOptions() |
ColorModel |
getColorModel()
Gets the color model.
|
String |
getCompression() |
String[] |
getCompressionTypes()
Gets the available compression types.
|
int |
getFramesPerSecond() |
org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> |
getHandle()
Retrieves a reference to the output source that will be written to during
Writer.savePlane(int, long, io.scif.Plane) calls. |
M |
getMetadata()
Gets the
Metadata that will be used when saving planes. |
int[] |
getPixelTypes(String codec)
Gets the supported pixel types for the given codec.
|
int |
getValidBits() |
protected void |
initialize(int imageIndex,
long planeIndex,
net.imglib2.Interval bounds)
Ensures this writer is prepared to write the given plane of the given
image.
|
boolean |
isInitialized(int imageIndex,
long planeIndex) |
void |
isSupportedCompression(String compression)
Checks if the given compression type is supported.
|
boolean |
isSupportedType(int type,
String codec)
Checks if the given pixel type is supported.
|
protected abstract String[] |
makeCompressionTypes() |
void |
savePlane(int imageIndex,
long planeIndex,
Plane plane)
Saves the provided plane to the specified image and plane index of this
Writer's destination image. |
void |
savePlane(int imageIndex,
long planeIndex,
Plane plane,
net.imglib2.Interval bounds)
Saves the specified tile (sub-region) of the provided plane to the
specified image and plane index of this
Writer's destination image. |
void |
setColorModel(ColorModel cm)
Sets the color model.
|
void |
setDest(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> out)
Sets the source that will be written to during
Writer.savePlane(int, long, io.scif.Plane) calls. |
void |
setDest(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> out,
int imageIndex)
As
Writer.setDest(DataHandle), with specification for source image index. |
void |
setDest(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> out,
int imageIndex,
SCIFIOConfig config)
As
Writer.setDest(DataHandle, int), with specification for new
configuration options. |
void |
setDest(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> out,
SCIFIOConfig config)
As
Writer.setDest(DataHandle), with specification for new configuration
options. |
void |
setDest(org.scijava.io.location.Location fileName)
Sets the source that will be written to during
Writer.savePlane(int, long, io.scif.Plane) calls. |
void |
setDest(org.scijava.io.location.Location loc,
int imageIndex)
As
Writer.setDest(Location) with specification for source image index. |
void |
setDest(org.scijava.io.location.Location loc,
int imageIndex,
SCIFIOConfig config)
As
Writer.setDest(Location, int) with specification for new configuration
options. |
void |
setDest(org.scijava.io.location.Location loc,
SCIFIOConfig config)
As
Writer.setDest(Location) with specification for new configuration
options. |
void |
setMetadata(M meta)
Generic-parameterized
setMetadata method, using
TypedMetadata to avoid type erasure conflicts with
Writer.setMetadata(Metadata). |
void |
setMetadata(Metadata meta)
Provides this
Writer with a Metadata object to use when
interpreting Planes during calls to Writer.savePlane(int, long, io.scif.Plane). |
protected abstract void |
writePlane(int imageIndex,
long planeIndex,
Plane plane,
net.imglib2.Interval bounds)
Helper method invoked by
savePlane(int, long, io.scif.Plane) to perform actual format-
specific output. |
boolean |
writeSequential() |
closeasBrowsableLocation, asBrowsableLocation, getFormat, getFormatNamegetVersion, loggetInfo, getPriority, setInfo, setPriority, toStringcontext, getContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFormat, getFormatNamegetVersion, loggetIdentifiercontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationprotected void checkLocation(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> out, SCIFIOConfig config) throws FormatException, IOException
FormatException - If the output does not meet the requirements of the
configurationIOExceptionprotected void checkParams(int imageIndex,
long planeIndex,
byte[] buf,
net.imglib2.Interval bounds)
throws FormatException
FormatException - if any of the arguments is invalid.protected void initialize(int imageIndex,
long planeIndex,
net.imglib2.Interval bounds)
throws FormatException,
IOException
FormatExceptionIOExceptionprotected abstract String[] makeCompressionTypes()
protected abstract void writePlane(int imageIndex,
long planeIndex,
Plane plane,
net.imglib2.Interval bounds)
throws FormatException,
IOException
savePlane(int, long, io.scif.Plane) to perform actual format-
specific output.FormatExceptionIOExceptionpublic void savePlane(int imageIndex,
long planeIndex,
Plane plane)
throws FormatException,
IOException
WriterWriter's destination image.savePlane in interface WriterimageIndex - the image index within the dataset.planeIndex - the plane index within the image.plane - the pixels saveFormatException - if one of the parameters is invalid.IOException - if there was a problem writing to the file.public void savePlane(int imageIndex,
long planeIndex,
Plane plane,
net.imglib2.Interval bounds)
throws FormatException,
IOException
WriterWriter's destination image.savePlane in interface WriterimageIndex - the image index within the dataset.planeIndex - the plane index within the image.plane - the pixels savebounds - bounds of the planar axes.FormatException - if one of the parameters is invalid.IOException - if there was a problem writing to the file.public boolean canDoStacks()
canDoStacks in interface WriterWriter can save multiple images to a single
file.public void setMetadata(Metadata meta) throws FormatException
WriterWriter with a Metadata object to use when
interpreting Planes during calls to Writer.savePlane(int, long, io.scif.Plane).
NB: This method has accepts a general Metadata so that this
signature can appear in the base interface for all Writers, but
behavior if provided with a Metadata instance not associated with
this Writer is undefined and should throw an exception.
setMetadata in interface Writermeta - The Metadata to associate with this Writer.FormatExceptionpublic M getMetadata()
WriterMetadata that will be used when saving planes.getMetadata in interface TypedWriter<M extends TypedMetadata>getMetadata in interface WriterMetadata associated with this Writer.public void setDest(org.scijava.io.location.Location fileName) throws FormatException, IOException
WriterWriter.savePlane(int, long, io.scif.Plane) calls.
NB: resets any configuration on this writer.setDest in interface WriterfileName - The Location to where the image source will be
written.FormatExceptionIOExceptionpublic void setDest(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> out) throws FormatException, IOException
WriterWriter.savePlane(int, long, io.scif.Plane) calls.
NB: resets any configuration on this writer.setDest in interface Writerout - The image source to write to.FormatExceptionIOExceptionpublic void setDest(org.scijava.io.location.Location loc, int imageIndex) throws FormatException, IOException
WriterWriter.setDest(Location) with specification for source image index.setDest in interface Writerloc - The Location of an image source to be written.imageIndex - The index within the source that will be written.FormatExceptionIOExceptionpublic void setDest(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> out, int imageIndex) throws FormatException, IOException
WriterWriter.setDest(DataHandle), with specification for source image index.setDest in interface Writerout - The image source to write to.imageIndex - The index within the source that will be written.FormatExceptionIOExceptionpublic void setDest(org.scijava.io.location.Location loc, SCIFIOConfig config) throws FormatException, IOException
WriterWriter.setDest(Location) with specification for new configuration
options.setDest in interface Writerloc - The Location of an image source to be written.config - Configuration information to use for this write.FormatExceptionIOExceptionpublic void setDest(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> out, SCIFIOConfig config) throws FormatException, IOException
WriterWriter.setDest(DataHandle), with specification for new configuration
options.setDest in interface Writerout - The image source to write to.config - Configuration information to use for this write.FormatExceptionIOExceptionpublic void setDest(org.scijava.io.location.Location loc, int imageIndex, SCIFIOConfig config) throws FormatException, IOException
WriterWriter.setDest(Location, int) with specification for new configuration
options.setDest in interface Writerloc - The Location of an image source to be written.imageIndex - The index within the source that will be written.config - Configuration information to use for this write.FormatExceptionIOExceptionpublic void setDest(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> out, int imageIndex, SCIFIOConfig config) throws FormatException, IOException
WriterWriter.setDest(DataHandle, int), with specification for new
configuration options.setDest in interface Writerout - The image source to write to.imageIndex - The index within the source that will be written.config - Configuration information to use for this write.FormatExceptionIOExceptionpublic org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> getHandle()
WriterWriter.savePlane(int, long, io.scif.Plane) calls.public void setColorModel(ColorModel cm)
WriterNB: the color model should be set before the output destination.
setColorModel in interface Writerpublic ColorModel getColorModel()
WritergetColorModel in interface Writerpublic String[] getCompressionTypes()
WritergetCompressionTypes in interface Writerpublic int getFramesPerSecond()
getFramesPerSecond in interface Writerpublic CodecOptions getCodecOptions()
getCodecOptions in interface WriterCodecOptions used by this writer, if applicable.public boolean writeSequential()
writeSequential in interface Writerpublic int getValidBits()
getValidBits in interface Writerpublic int[] getPixelTypes(String codec)
WritergetPixelTypes in interface Writerpublic boolean isSupportedType(int type,
String codec)
WriterisSupportedType in interface Writerpublic void isSupportedCompression(String compression) throws FormatException
WriterisSupportedCompression in interface WriterFormatExceptionpublic void setMetadata(M meta) throws FormatException
TypedWritersetMetadata method, using
TypedMetadata to avoid type erasure conflicts with
Writer.setMetadata(Metadata).setMetadata in interface TypedWriter<M extends TypedMetadata>FormatExceptionParser.parse(Location, Metadata)public boolean isInitialized(int imageIndex,
long planeIndex)
isInitialized in interface Writerpublic String getCompression()
getCompression in interface Writerpublic void close(boolean fileOnly)
throws IOException
HasSourceclose in interface HasSourcefileOnly - - If true, only the associated source(s) are closed.IOExceptionCopyright © 2011–2026 SCIFIO. All rights reserved.