public abstract class ImageWriter
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
userSelectImageFileName(java.lang.String fileName,
java.lang.String suggestedFileName,
java.lang.Class<? extends WritableImage> outputImageClass,
java.awt.Component parentComponent)
Get the user to select an image file name and, if it for a UNC image, make sure that the image
can be written.
|
static java.lang.String |
write(ReadableImage image,
java.lang.String fileName,
java.lang.Class<? extends WritableImage> outputImageClass,
boolean requireMandatoryDICOMElements)
Writes an image to a disk file with the given file name, possibly changing the Class of the
written image.
|
static java.lang.String |
write(ReadableImage image,
java.lang.String fileName,
java.lang.Class<? extends WritableImage> outputImageClass,
PixelDataType savePixelDataType,
ComplexMode complexMode,
boolean requireMandatoryDICOMElements,
java.awt.Component parentComponent,
byte[] roiOutput)
Writes a ReadableImage to a specfied class of WritableImage,
possibly changing the pixel data type.
|
static java.lang.String |
write(WritableImage image,
java.lang.String fileName,
boolean requireMandatoryDICOMElements)
Writes an image to a disk file with the given file name.
|
static java.lang.String |
write(WritableImage image,
java.lang.String fileName,
boolean requireMandatoryDICOMElements,
java.awt.Component parentComponent)
Writes an image to a disk file with the given file name.
|
public static java.lang.String write(WritableImage image, java.lang.String fileName, boolean requireMandatoryDICOMElements) throws InvalidImageException, java.io.IOException, CancelledException
image
- the image to write.fileName
- the file name to which to write the image. In some cases this may act as the
base file name (for example when writing Analyze images).requireMandatoryDICOMElements
- if the image is a DICOM image, this controls whether
mandatory DICOM elements are required, and if not present an error should occur.InvalidImageException
- if the image to be written is invalid.java.io.IOException
- in an I/O error occurs during the write operation.CancelledException
- if the write operation is cancelled by the user.public static java.lang.String write(ReadableImage image, java.lang.String fileName, java.lang.Class<? extends WritableImage> outputImageClass, boolean requireMandatoryDICOMElements) throws InvalidImageException, java.io.IOException, CancelledException
image
- the image to write.fileName
- the file name to which to write the image. In some cases this may act as the
base file name (for example when writing Analyze images).outputImageClass
- the Class of image to be written.requireMandatoryDICOMElements
- if the image is a DICOM image, this controls whether
mandatory DICOM elements are required, and if not present an error should occur.InvalidImageException
- if the image to be written is invalid.java.io.IOException
- in an I/O error occurs during the write operation.CancelledException
- if the write operation is cancelled by the user.public static java.lang.String write(WritableImage image, java.lang.String fileName, boolean requireMandatoryDICOMElements, java.awt.Component parentComponent) throws InvalidImageException, java.io.IOException, CancelledException
image
- the image to write.fileName
- the name of the disk file to which the image will be saved. In some cases,
this may act as the base file name (for example when writing Analyze images). If null,
the user will be prompted to select a file name for output.requireMandatoryDICOMElements
- if the output image is a DICOM image, this controls
whether mandatory DICOM elements are required, and if not present an error should occur.parentComponent
- the Component that will be used to position any dialogs used
to prompt for user input that may be required when prompting for mandatory DICOM elements.InvalidImageException
- if the image to be written is invalid.java.io.IOException
- in an I/O error occurs during the write operation.CancelledException
- if the write operation is cancelled by the user.public static java.lang.String write(ReadableImage image, java.lang.String fileName, java.lang.Class<? extends WritableImage> outputImageClass, PixelDataType savePixelDataType, ComplexMode complexMode, boolean requireMandatoryDICOMElements, java.awt.Component parentComponent, byte[] roiOutput) throws InvalidImageException, java.io.IOException, CancelledException
image
- the image to write.fileName
- the name of the disk file to which the image will be saved. In some cases,
this may act as the base file name (for example when writing Analyze images). If null,
the user will be prompted to select a file name for output.outputImageClass
- the class of WritableImage to which the image will be written.savePixelDataType
- the PixelDataType with which the image will be saved.complexMode
- the ComplexMode if this is a Complex image, and
the savePixelDataType is not complex.requireMandatoryDICOMElements
- if the output image is a DICOM image, this controls
whether mandatory DICOM elements are required, and if not present an error should occur.parentComponent
- if nonnull, a java.awt.Component used
when positioning pop-up message dialogs.roiOutput
- for DICOM images, the text describing the ROIs, to be saved in
a DICOM Element.InvalidImageException
- if the image cannot be created.java.io.IOException
- if an I/O error occurs during the save to disk.CancelledException
- if the save operation is cancelled.public static java.lang.String userSelectImageFileName(java.lang.String fileName, java.lang.String suggestedFileName, java.lang.Class<? extends WritableImage> outputImageClass, java.awt.Component parentComponent) throws java.io.IOException, CancelledException
fileName
- if null, the user is prompted for a file name. If non-null, this
file name is returned.suggestedFileName
- if the user is prompted for a file name. then this is the default
file name set in the image chooser dialog.outputImageClass
- the class of the output image.parentComponent
- if non-null, the component used to position the pop-up dialogs.java.io.IOException
- if the outputImageClass is UNCImage.class, and the image cannot be written.CancelledException
- if file selection is cancelled by the user.Copyright 2017 Xinapse Systems Limited. All Rights Reserved.