Package com.pixelmed.dicom
Class CompressedFrameDecoder
- java.lang.Object
-
- com.pixelmed.dicom.CompressedFrameDecoder
-
public class CompressedFrameDecoder extends java.lang.Object
The
CompressedFrameDecoder
class implements decompression of selected frames in various supported Transfer Syntaxes once already extracted from DICOM encapsulated images.
-
-
Constructor Summary
Constructors Constructor Description CompressedFrameDecoder(java.lang.String transferSyntaxUID, byte[][] frames, int bytesPerSample, java.awt.color.ColorSpace colorSpace)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
canDecompress(java.io.File file)
Returns a whether or not a DICOM file contains pixel data that can be decompressed using this class.void
dispose()
boolean
getColorSpaceConvertedToRGBDuringDecompression()
Returns a whether or not the color space will be converted to RGB during compression if it was YBR in the first place.java.awt.image.BufferedImage
getDecompressedFrameAsBufferedImage(int f)
javax.imageio.metadata.IIOMetadata
getIIOMetadata(int frame)
Returns a reference to theIIOMetadata
object for the selected frame, or null if none was available during reading.static boolean
isPixelMedLosslessJPEGReader(javax.imageio.ImageReader reader)
static boolean
isStandardJPEGReader(javax.imageio.ImageReader reader)
static void
scanForCodecs()
static javax.imageio.ImageReader
selectReaderFromCodecsAvailable(java.lang.String readerWanted, java.lang.String transferSyntaxUID, int bytesPerSample)
-
-
-
Constructor Detail
-
CompressedFrameDecoder
public CompressedFrameDecoder(java.lang.String transferSyntaxUID, byte[][] frames, int bytesPerSample, java.awt.color.ColorSpace colorSpace) throws DicomException
- Throws:
DicomException
-
-
Method Detail
-
scanForCodecs
public static void scanForCodecs()
-
canDecompress
public static boolean canDecompress(java.io.File file)
Returns a whether or not a DICOM file contains pixel data that can be decompressed using this class.
- Parameters:
file
- the file- Returns:
- true if file can be decompressed using this class
-
getIIOMetadata
public javax.imageio.metadata.IIOMetadata getIIOMetadata(int frame)
Returns a reference to the
IIOMetadata
object for the selected frame, or null if none was available during reading.- Parameters:
frame
- the frame number, from 0- Returns:
- an
IIOMetadata
object, or null.
-
getColorSpaceConvertedToRGBDuringDecompression
public boolean getColorSpaceConvertedToRGBDuringDecompression()
Returns a whether or not the color space will be converted to RGB during compression if it was YBR in the first place.
- Returns:
- true if RGB after compression
-
isStandardJPEGReader
public static boolean isStandardJPEGReader(javax.imageio.ImageReader reader)
-
isPixelMedLosslessJPEGReader
public static boolean isPixelMedLosslessJPEGReader(javax.imageio.ImageReader reader)
-
selectReaderFromCodecsAvailable
public static javax.imageio.ImageReader selectReaderFromCodecsAvailable(java.lang.String readerWanted, java.lang.String transferSyntaxUID, int bytesPerSample) throws DicomException
- Throws:
DicomException
-
getDecompressedFrameAsBufferedImage
public java.awt.image.BufferedImage getDecompressedFrameAsBufferedImage(int f) throws DicomException, java.io.IOException
- Throws:
DicomException
java.io.IOException
-
dispose
public void dispose() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
-