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.
Modifier and Type | Class and Description |
---|---|
protected class |
CompressedFrameDecoder.ByteArrayInputStreamWithOffsetCounterAndOurMethods |
Modifier and Type | Field and Description |
---|---|
protected boolean |
areDownsampled |
protected boolean |
areNumberedFromOneByOne |
protected boolean |
haveAdobe |
protected boolean |
haveJFIF |
protected boolean |
haveProcessedMetaDataForFrameRequest |
Constructor and Description |
---|
CompressedFrameDecoder(java.lang.String transferSyntaxUID,
byte[][] frames,
int bytesPerSample,
int width,
int height,
int samples,
java.awt.color.ColorSpace colorSpace) |
CompressedFrameDecoder(java.lang.String transferSyntaxUID,
byte[][] frames,
int bytesPerSample,
int width,
int height,
int samples,
java.awt.color.ColorSpace colorSpace,
boolean photometricInterpretationIsYBR) |
CompressedFrameDecoder(java.lang.String transferSyntaxUID,
ByteFrameSource compressedDataFrameSource,
int bytesPerSample,
int width,
int height,
int samples,
java.awt.color.ColorSpace colorSpace) |
CompressedFrameDecoder(java.lang.String transferSyntaxUID,
ByteFrameSource compressedDataFrameSource,
int bytesPerSample,
int width,
int height,
int samples,
java.awt.color.ColorSpace colorSpace,
boolean photometricInterpretationIsYBR) |
CompressedFrameDecoder(java.lang.String transferSyntaxUID,
int bytesPerSample,
int width,
int height,
int samples,
java.awt.color.ColorSpace colorSpace) |
CompressedFrameDecoder(java.lang.String transferSyntaxUID,
int bytesPerSample,
int width,
int height,
int samples,
java.awt.color.ColorSpace colorSpace,
boolean photometricInterpretationIsYBR) |
Modifier and Type | Method and 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.
|
static boolean |
canDecompress(java.lang.String filename)
Returns a whether or not a DICOM file contains pixel data that can be decompressed using this class.
|
void |
dispose() |
protected void |
doCommonConstructorStuff(java.lang.String transferSyntaxUID,
int bytesPerSample,
int width,
int height,
int samples,
java.awt.color.ColorSpace colorSpace) |
protected void |
doCommonConstructorStuff(java.lang.String transferSyntaxUID,
int bytesPerSample,
int width,
int height,
int samples,
java.awt.color.ColorSpace colorSpace,
boolean photometricInterpretationIsKnown,
boolean photometricInterpretationIsYBR) |
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(byte[] frameBytes) |
java.awt.image.BufferedImage |
getDecompressedFrameAsBufferedImage(int f) |
java.awt.image.BufferedImage |
getDecompressedFrameAsBufferedImageUsingImageReader(byte[] frameBytes) |
java.awt.image.BufferedImage |
getDecompressedFrameAsBufferedImageUsingImageReader(int f) |
java.awt.image.BufferedImage |
getDecompressedFrameAsBufferedImageUsingRLE(byte[] frameBytes) |
java.awt.image.BufferedImage |
getDecompressedFrameAsBufferedImageUsingRLE(int f) |
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) |
static javax.imageio.ImageReader |
selectReaderFromCodecsAvailable(java.lang.String readerWanted,
java.lang.String transferSyntaxUID,
int bytesPerSample,
java.util.Set<java.lang.String> blacklistedReaders) |
protected boolean areDownsampled
protected boolean areNumberedFromOneByOne
protected boolean haveAdobe
protected boolean haveJFIF
protected boolean haveProcessedMetaDataForFrameRequest
public CompressedFrameDecoder(java.lang.String transferSyntaxUID, byte[][] frames, int bytesPerSample, int width, int height, int samples, java.awt.color.ColorSpace colorSpace) throws DicomException
DicomException
public CompressedFrameDecoder(java.lang.String transferSyntaxUID, byte[][] frames, int bytesPerSample, int width, int height, int samples, java.awt.color.ColorSpace colorSpace, boolean photometricInterpretationIsYBR) throws DicomException
DicomException
public CompressedFrameDecoder(java.lang.String transferSyntaxUID, ByteFrameSource compressedDataFrameSource, int bytesPerSample, int width, int height, int samples, java.awt.color.ColorSpace colorSpace) throws DicomException
DicomException
public CompressedFrameDecoder(java.lang.String transferSyntaxUID, ByteFrameSource compressedDataFrameSource, int bytesPerSample, int width, int height, int samples, java.awt.color.ColorSpace colorSpace, boolean photometricInterpretationIsYBR) throws DicomException
DicomException
public CompressedFrameDecoder(java.lang.String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, java.awt.color.ColorSpace colorSpace) throws DicomException
DicomException
public CompressedFrameDecoder(java.lang.String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, java.awt.color.ColorSpace colorSpace, boolean photometricInterpretationIsYBR) throws DicomException
DicomException
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.
file
- the filepublic static boolean canDecompress(java.lang.String filename)
Returns a whether or not a DICOM file contains pixel data that can be decompressed using this class.
filename
- the filepublic void dispose() throws java.lang.Throwable
java.lang.Throwable
protected void doCommonConstructorStuff(java.lang.String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, java.awt.color.ColorSpace colorSpace) throws DicomException
DicomException
protected void doCommonConstructorStuff(java.lang.String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, java.awt.color.ColorSpace colorSpace, boolean photometricInterpretationIsKnown, boolean photometricInterpretationIsYBR) throws DicomException
DicomException
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.
public java.awt.image.BufferedImage getDecompressedFrameAsBufferedImage(byte[] frameBytes) throws DicomException, java.io.IOException
DicomException
java.io.IOException
public java.awt.image.BufferedImage getDecompressedFrameAsBufferedImage(int f) throws DicomException, java.io.IOException
DicomException
java.io.IOException
public java.awt.image.BufferedImage getDecompressedFrameAsBufferedImageUsingImageReader(byte[] frameBytes) throws DicomException, java.io.IOException
DicomException
java.io.IOException
public java.awt.image.BufferedImage getDecompressedFrameAsBufferedImageUsingImageReader(int f) throws DicomException, java.io.IOException
DicomException
java.io.IOException
public java.awt.image.BufferedImage getDecompressedFrameAsBufferedImageUsingRLE(byte[] frameBytes) throws DicomException, java.io.IOException
DicomException
java.io.IOException
public java.awt.image.BufferedImage getDecompressedFrameAsBufferedImageUsingRLE(int f) throws DicomException, java.io.IOException
DicomException
java.io.IOException
public static boolean isPixelMedLosslessJPEGReader(javax.imageio.ImageReader reader)
public static boolean isStandardJPEGReader(javax.imageio.ImageReader reader)
public static void scanForCodecs()
public static javax.imageio.ImageReader selectReaderFromCodecsAvailable(java.lang.String readerWanted, java.lang.String transferSyntaxUID, int bytesPerSample) throws DicomException
DicomException
public static javax.imageio.ImageReader selectReaderFromCodecsAvailable(java.lang.String readerWanted, java.lang.String transferSyntaxUID, int bytesPerSample, java.util.Set<java.lang.String> blacklistedReaders) throws DicomException
DicomException