public interface ImageExporter
Modifier and Type | Interface and Description |
---|---|
static class |
ImageExporter.OutputFormat
Allowed export formats.
|
Modifier and Type | Method and Description |
---|---|
void |
export()
Run the export process.
|
ImageExporter |
loop(java.lang.String axis,
int start,
int stop)
Add a new "inner loop" to the export parameters.
|
void |
resetLoops()
Reset the current export loop parameters to empty.
|
void |
setDisplay(DisplayWindow display)
Set the display to use for image exporting.
|
void |
setImageJName(java.lang.String imageJName)
Sets the name to be used for the ImageJ Stack Window (if this was
used as the output format).
|
void |
setOutputFormat(ImageExporter.OutputFormat format)
Set the output format to use.
|
void |
setOutputQuality(int quality)
Set the image quality.
|
void |
setSaveInfo(java.lang.String path,
java.lang.String prefix)
Set the path to save images to, and the filename prefix to use when
saving images.
|
void |
setUseLabel(boolean label)
Whether to use labels indicating position, channel, time point and z position
(where) appropriate or to sequentially number output files.
|
void |
waitForExport()
Block until a prior call to export() returns.
|
void setDisplay(DisplayWindow display)
display
- Display to use for exporting images.void setOutputFormat(ImageExporter.OutputFormat format)
format
- The format to output in.void setUseLabel(boolean label)
label
- When true, filename will include position, channel, time point and z
position labels (where appropriate).void setOutputQuality(int quality)
quality
- An integer quality ranging from 1 through 100. The default
value is 90.void setSaveInfo(java.lang.String path, java.lang.String prefix) throws java.io.IOException
path
- Directory in which images will be placedprefix
- String to place at beginning of each output image's name.java.lang.IllegalArgumentException
- if the directory does not exist.java.io.IOException
void setImageJName(java.lang.String imageJName)
imageJName
- Name to be used in ImageJImageExporter loop(java.lang.String axis, int start, int stop)
axis
- Axis name, like Coords.CHANNEL, Coords.Z, etc.start
- Axis index to start exporting from, inclusive.stop
- Axis index to stop exporting from, exclusive (i.e. one more
than the index of the last image you want to export).void resetLoops()
void export() throws java.io.IOException, java.lang.IllegalArgumentException
NOTE: the exporter will silently ignore the following "configuration errors": - Setting a save path when using the OUTPUT_IMAGEJ format - Loops over axes that are not used by any images in the display's datastore - Loops that have invalid start/end boundary conditions (starting or ending index is greater than largest index in the datastore). In the latter two cases, image coordinates that do not refer to a valid image will be ignored (for example, trying to access a Z coordinate of 1 in a dataset that is two-dimensional). It is therefore possible that this method will not actually do anything, if none of the loops encompass valid image coordinates.
java.io.IOException
- if the export process would attempt to write to a
file that already existsjava.lang.IllegalArgumentException
- if no output format has been set, or
OUTPUT_PNG or OUTPUT_JPG formats are used but no save
information has been set, or if no loops have been
configured, or if no display has been set.void waitForExport() throws java.lang.InterruptedException
java.lang.InterruptedException
- if the thread was interrupted while waiting.