public class CompressedFrameDecoder extends 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(String transferSyntaxUID,
byte[][] frames,
int bytesPerSample,
int width,
int height,
int samples,
ColorSpace colorSpace) |
CompressedFrameDecoder(String transferSyntaxUID,
byte[][] frames,
int bytesPerSample,
int width,
int height,
int samples,
ColorSpace colorSpace,
boolean photometricInterpretationIsYBR) |
CompressedFrameDecoder(String transferSyntaxUID,
ByteFrameSource compressedDataFrameSource,
int bytesPerSample,
int width,
int height,
int samples,
ColorSpace colorSpace) |
CompressedFrameDecoder(String transferSyntaxUID,
ByteFrameSource compressedDataFrameSource,
int bytesPerSample,
int width,
int height,
int samples,
ColorSpace colorSpace,
boolean photometricInterpretationIsYBR) |
CompressedFrameDecoder(String transferSyntaxUID,
int bytesPerSample,
int width,
int height,
int samples,
ColorSpace colorSpace) |
CompressedFrameDecoder(String transferSyntaxUID,
int bytesPerSample,
int width,
int height,
int samples,
ColorSpace colorSpace,
boolean photometricInterpretationIsYBR) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canDecompress(File file)
Returns a whether or not a DICOM file contains pixel data that can be decompressed using this class.
|
static boolean |
canDecompress(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(String transferSyntaxUID,
int bytesPerSample,
int width,
int height,
int samples,
ColorSpace colorSpace) |
protected void |
doCommonConstructorStuff(String transferSyntaxUID,
int bytesPerSample,
int width,
int height,
int samples,
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.
|
BufferedImage |
getDecompressedFrameAsBufferedImage(byte[] frameBytes) |
BufferedImage |
getDecompressedFrameAsBufferedImage(int f) |
BufferedImage |
getDecompressedFrameAsBufferedImageUsingImageReader(byte[] frameBytes) |
BufferedImage |
getDecompressedFrameAsBufferedImageUsingImageReader(int f) |
BufferedImage |
getDecompressedFrameAsBufferedImageUsingRLE(byte[] frameBytes) |
BufferedImage |
getDecompressedFrameAsBufferedImageUsingRLE(int f) |
static boolean |
isPixelMedLosslessJPEGReader(ImageReader reader) |
static boolean |
isStandardJPEGReader(ImageReader reader) |
static void |
scanForCodecs() |
static ImageReader |
selectReaderFromCodecsAvailable(String readerWanted,
String transferSyntaxUID,
int bytesPerSample) |
static ImageReader |
selectReaderFromCodecsAvailable(String readerWanted,
String transferSyntaxUID,
int bytesPerSample,
Set<String> blacklistedReaders) |
protected boolean areDownsampled
protected boolean areNumberedFromOneByOne
protected boolean haveAdobe
protected boolean haveJFIF
protected boolean haveProcessedMetaDataForFrameRequest
public CompressedFrameDecoder(String transferSyntaxUID, byte[][] frames, int bytesPerSample, int width, int height, int samples, ColorSpace colorSpace) throws DicomException
DicomExceptionpublic CompressedFrameDecoder(String transferSyntaxUID, byte[][] frames, int bytesPerSample, int width, int height, int samples, ColorSpace colorSpace, boolean photometricInterpretationIsYBR) throws DicomException
DicomExceptionpublic CompressedFrameDecoder(String transferSyntaxUID, ByteFrameSource compressedDataFrameSource, int bytesPerSample, int width, int height, int samples, ColorSpace colorSpace) throws DicomException
DicomExceptionpublic CompressedFrameDecoder(String transferSyntaxUID, ByteFrameSource compressedDataFrameSource, int bytesPerSample, int width, int height, int samples, ColorSpace colorSpace, boolean photometricInterpretationIsYBR) throws DicomException
DicomExceptionpublic CompressedFrameDecoder(String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, ColorSpace colorSpace) throws DicomException
DicomExceptionpublic CompressedFrameDecoder(String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, ColorSpace colorSpace, boolean photometricInterpretationIsYBR) throws DicomException
DicomExceptionpublic static boolean canDecompress(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(String filename)
Returns a whether or not a DICOM file contains pixel data that can be decompressed using this class.
filename - the fileprotected void doCommonConstructorStuff(String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, ColorSpace colorSpace) throws DicomException
DicomExceptionprotected void doCommonConstructorStuff(String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, ColorSpace colorSpace, boolean photometricInterpretationIsKnown, boolean photometricInterpretationIsYBR) throws DicomException
DicomExceptionpublic 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 BufferedImage getDecompressedFrameAsBufferedImage(byte[] frameBytes) throws DicomException, IOException
DicomExceptionIOExceptionpublic BufferedImage getDecompressedFrameAsBufferedImage(int f) throws DicomException, IOException
DicomExceptionIOExceptionpublic BufferedImage getDecompressedFrameAsBufferedImageUsingImageReader(byte[] frameBytes) throws DicomException, IOException
DicomExceptionIOExceptionpublic BufferedImage getDecompressedFrameAsBufferedImageUsingImageReader(int f) throws DicomException, IOException
DicomExceptionIOExceptionpublic BufferedImage getDecompressedFrameAsBufferedImageUsingRLE(byte[] frameBytes) throws DicomException, IOException
DicomExceptionIOExceptionpublic BufferedImage getDecompressedFrameAsBufferedImageUsingRLE(int f) throws DicomException, IOException
DicomExceptionIOExceptionpublic static boolean isPixelMedLosslessJPEGReader(ImageReader reader)
public static boolean isStandardJPEGReader(ImageReader reader)
public static void scanForCodecs()
public static ImageReader selectReaderFromCodecsAvailable(String readerWanted, String transferSyntaxUID, int bytesPerSample) throws DicomException
DicomExceptionpublic static ImageReader selectReaderFromCodecsAvailable(String readerWanted, String transferSyntaxUID, int bytesPerSample, Set<String> blacklistedReaders) throws DicomException
DicomException