Class WriteIntoDirectory
Any checked-exceptions thrown during writing stacks are converted into run-time exceptions, to make it easy to temporarily use this class in a test for debugging with minimal alteration of functions.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionWriteIntoDirectory
(Path directory) Creates a new WriteIntoDirectory instance with directory printing enabled.WriteIntoDirectory
(Path directory, boolean printDirectoryToConsole) Creates a newWriteIntoDirectory
instance. -
Method Summary
Modifier and TypeMethodDescriptionThe directory in which stacks and other outputs are written.void
writeChannel
(String outputName, Channel channel) Writes a Channel to the output directory.void
writeList
(String outputName, List<DisplayStack> stacks, boolean always2D) Writes a list of display-stacks.void
writeObject
(String outputName, ObjectMask object) Writes an ObjectMask to the output directory.void
writeObjects
(String outputName, ObjectCollection objects) Writes the outline of objects on a blank RGB image, inferring dimensions of the image to center the object.void
writeObjects
(String outputName, ObjectCollection objects, Stack background) Writes the outline of objects on a background.void
writeStack
(String outputName, DisplayStack stack) Writes a DisplayStack to the output directory.void
writeVoxels
(String outputName, Voxels<UnsignedByteBuffer> voxels) Writes Voxels to the output directory.
-
Constructor Details
-
WriteIntoDirectory
Creates a new WriteIntoDirectory instance with directory printing enabled.This constructor sets
printDirectoryToConsole
to true, meaning the directory path will be printed to the console when the first output is written.- Parameters:
directory
- the directory in which stacks and other outputs will be written. It should be a valid, writable directory path.
-
WriteIntoDirectory
Creates a newWriteIntoDirectory
instance.- Parameters:
directory
- The directory in which stacks and other outputs are written.This directory is used as the root location for all file outputs generated by this class. It should be a valid, writable directory path.
If
printDirectoryToConsole
is set to true, this directory path will be printed to the console when the first output is written.printDirectoryToConsole
- If true, the path offolder
is printed to the console- See Also:
-
-
Method Details
-
writeStack
Writes a DisplayStack to the output directory.- Parameters:
outputName
- The name to use for the output file.stack
- The DisplayStack to write.
-
writeObject
Writes an ObjectMask to the output directory.- Parameters:
outputName
- The name to use for the output file.object
- The ObjectMask to write.- Throws:
SetOperationFailedException
- If the operation fails.
-
writeObjects
Writes the outline of objects on a blank RGB image, inferring dimensions of the image to center the object.- Parameters:
outputName
- output-nameobjects
- the objects to draw an outline for
-
writeObjects
Writes the outline of objects on a background.- Parameters:
outputName
- output-nameobjects
- the objects to draw an outline forbackground
- the background
-
writeVoxels
Writes Voxels to the output directory.- Parameters:
outputName
- The name to use for the output file.voxels
- The Voxels to write.
-
writeChannel
Writes a Channel to the output directory.- Parameters:
outputName
- The name to use for the output file.channel
- The Channel to write.
-
writeList
public void writeList(String outputName, List<DisplayStack> stacks, boolean always2D) throws OutputWriteFailedException Writes a list of display-stacks.- Parameters:
outputName
- the output-namestacks
- the list of display-stacksalways2D
- if true, the stacks are guaranteed to always to have only one z-slice (which can influence the output format).- Throws:
OutputWriteFailedException
- if the stacks cannot be successfully written to the file-system.
-
getDirectory
The directory in which stacks and other outputs are written.This directory is used as the root location for all file outputs generated by this class. It should be a valid, writable directory path.
If
printDirectoryToConsole
is set to true, this directory path will be printed to the console when the first output is written.- See Also:
-