Package com.pixelmed.dicom
Class CompressedFrameEncoder
java.lang.Object
com.pixelmed.dicom.CompressedFrameEncoder
The CompressedFrameEncoder
class implements compression of specified frames
in various supported Transfer Syntaxes, which can then be incorporated in DICOM encapsulated images.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
chooseOutputFormatForTransferSyntax
(String transferSyntaxUID) Determine the output format string used by the JIIO codecs for the DICOM Transfer Syntax.static String
chooseTransferSyntaxForOutputFormat
(String outputFormat) Determine the DICOM Transfer Syntax for the output format string used by the JIIO codecs.static File
getCompressedFrameAsFile
(AttributeList list, BufferedImage renderedImage, String outputFormat, File tmpFrameFile) Compress the supplied frame.
-
Constructor Details
-
CompressedFrameEncoder
public CompressedFrameEncoder()
-
-
Method Details
-
chooseOutputFormatForTransferSyntax
Determine the output format string used by the JIIO codecs for the DICOM Transfer Syntax.
Though not supported by the JIIO codecs, an output format string of "rle" is also recognized.
- Parameters:
transferSyntaxUID
- the DICOM Transfer Syntax UID- Returns:
- the format string (lower case) or null if unrecognized
-
chooseTransferSyntaxForOutputFormat
Determine the DICOM Transfer Syntax for the output format string used by the JIIO codecs.
Though not supported by the JIIO codecs, an output format string of "rle" is also recognized.
- Parameters:
outputFormat
- the format string (lower case)- Returns:
- the DICOM Transfer Syntax UID or null if unrecognized
-
getCompressedFrameAsFile
public static File getCompressedFrameAsFile(AttributeList list, BufferedImage renderedImage, String outputFormat, File tmpFrameFile) throws IOException, FileNotFoundException, DicomException Compress the supplied frame.
- Parameters:
list
- the AttributeList from which the frame was extractedrenderedImage
- the frame as an imageoutputFormat
- the compression format to use [jpeg2000|jpeg-lossless|jpeg-ls|rle]tmpFrameFile
- the file to write the compressed bit stream to- Returns:
- the file written to, or null if compression failed
- Throws:
IOException
- if there is an error writing the fileFileNotFoundException
- if the supplied file path cannot be foundDicomException
- if the image cannot be compressed
-