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 newWriteIntoDirectoryinstance. -
Method Summary
Modifier and TypeMethodDescriptionThe directory in which stacks and other outputs are written.voidwriteChannel(String outputName, Channel channel) Writes a Channel to the output directory.voidwriteList(String outputName, List<DisplayStack> stacks, boolean always2D) Writes a list of display-stacks.voidwriteObject(String outputName, ObjectMask object) Writes an ObjectMask to the output directory.voidwriteObjects(String outputName, ObjectCollection objects) Writes the outline of objects on a blank RGB image, inferring dimensions of the image to center the object.voidwriteObjects(String outputName, ObjectCollection objects, Stack background) Writes the outline of objects on a background.voidwriteStack(String outputName, DisplayStack stack) Writes a DisplayStack to the output directory.voidwriteVoxels(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
printDirectoryToConsoleto 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 newWriteIntoDirectoryinstance.- 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
printDirectoryToConsoleis set to true, this directory path will be printed to the console when the first output is written.printDirectoryToConsole- If true, the path offolderis 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
printDirectoryToConsoleis set to true, this directory path will be printed to the console when the first output is written.- See Also:
-