Package com.pixelmed.dicom
Class CompressedFrameEncoder
- java.lang.Object
-
- com.pixelmed.dicom.CompressedFrameEncoder
-
public class CompressedFrameEncoder extends java.lang.Object
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 Constructor Description CompressedFrameEncoder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
chooseOutputFormatForTransferSyntax(java.lang.String transferSyntaxUID)
Determine the output format string used by the JIIO codecs for the DICOM Transfer Syntax.static java.lang.String
chooseTransferSyntaxForOutputFormat(java.lang.String outputFormat)
Determine the DICOM Transfer Syntax for the output format string used by the JIIO codecs.static java.io.File
getCompressedFrameAsFile(AttributeList list, java.awt.image.BufferedImage renderedImage, java.lang.String outputFormat, java.io.File tmpFrameFile)
Compress the supplied frame.
-
-
-
Method Detail
-
chooseOutputFormatForTransferSyntax
public static java.lang.String chooseOutputFormatForTransferSyntax(java.lang.String transferSyntaxUID)
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
public static java.lang.String chooseTransferSyntaxForOutputFormat(java.lang.String outputFormat)
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 java.io.File getCompressedFrameAsFile(AttributeList list, java.awt.image.BufferedImage renderedImage, java.lang.String outputFormat, java.io.File tmpFrameFile) throws java.io.IOException, java.io.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:
java.io.IOException
- if there is an error writing the filejava.io.FileNotFoundException
- if the supplied file path cannot be foundDicomException
- if the image cannot be compressed
-
-