Package com.pixelmed.dicom

# Class CompressedFrameDecoder

java.lang.Object
com.pixelmed.dicom.CompressedFrameDecoder

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.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`protected class`
`CompressedFrameDecoder.ByteArrayInputStreamWithOffsetCounterAndOurMethods`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected boolean`
`areDownsampled`
`protected boolean`
`areNumberedFromOneByOne`
`protected boolean`
`haveAdobe`
`protected boolean`
`haveJFIF`
`protected boolean`
`haveProcessedMetaDataForFrameRequest`

## Constructor Summary

Constructors
Constructor
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, 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)`
`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)`

## Method Summary

Modifier and Type
Method
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)`

### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### haveProcessedMetaDataForFrameRequest

protected boolean haveProcessedMetaDataForFrameRequest

### haveJFIF

protected boolean haveJFIF

### haveAdobe

protected boolean haveAdobe

### areDownsampled

protected boolean areDownsampled

### areNumberedFromOneByOne

protected boolean areNumberedFromOneByOne

## Constructor Details

### CompressedFrameDecoder

public CompressedFrameDecoder(String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, ColorSpace colorSpace) throws DicomException

Throws:
  `DicomException`

### CompressedFrameDecoder

public CompressedFrameDecoder(String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, ColorSpace colorSpace, boolean photometricInterpretationIsYBR) throws DicomException

Throws:
  `DicomException`

### CompressedFrameDecoder

public CompressedFrameDecoder(String transferSyntaxUID, ByteFrameSource compressedDataFrameSource, int bytesPerSample, int width, int height, int samples, ColorSpace colorSpace) throws DicomException

Throws:
  `DicomException`

### CompressedFrameDecoder

public CompressedFrameDecoder(String transferSyntaxUID, ByteFrameSource compressedDataFrameSource, int bytesPerSample, int width, int height, int samples, ColorSpace colorSpace, boolean photometricInterpretationIsYBR) throws DicomException

Throws:
  `DicomException`

### CompressedFrameDecoder

public CompressedFrameDecoder(String transferSyntaxUID, byte[][] frames, int bytesPerSample, int width, int height, int samples, ColorSpace colorSpace) throws DicomException

Throws:
  `DicomException`

### CompressedFrameDecoder

public CompressedFrameDecoder(String transferSyntaxUID, byte[][] frames, int bytesPerSample, int width, int height, int samples, ColorSpace colorSpace, boolean photometricInterpretationIsYBR) throws DicomException

Throws:
  `DicomException`

## Method Details

### scanForCodecs

public static void scanForCodecs()

### canDecompress

public static boolean canDecompress(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

### canDecompress

public static boolean canDecompress(String filename)

Returns a whether or not a DICOM file contains pixel data that can be decompressed using this class.

Parameters:
  `filename` - the file
Returns:
  true if file can be decompressed using this class

### 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(ImageReader reader)

### isPixelMedLosslessJPEGReader

public static boolean isPixelMedLosslessJPEGReader(ImageReader reader)

### selectReaderFromCodecsAvailable

public static ImageReader selectReaderFromCodecsAvailable(String readerWanted, String transferSyntaxUID, int bytesPerSample, Set<String> blacklistedReaders) throws DicomException

Throws:
  `DicomException`

### selectReaderFromCodecsAvailable

public static ImageReader selectReaderFromCodecsAvailable(String readerWanted, String transferSyntaxUID, int bytesPerSample) throws DicomException

Throws:
  `DicomException`

### doCommonConstructorStuff

protected void doCommonConstructorStuff(String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, ColorSpace colorSpace) throws DicomException

Throws:
  `DicomException`

### doCommonConstructorStuff

protected void doCommonConstructorStuff(String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, ColorSpace colorSpace, boolean photometricInterpretationIsKnown, boolean photometricInterpretationIsYBR) throws DicomException

Throws:
  `DicomException`

### getDecompressedFrameAsBufferedImage

public BufferedImage getDecompressedFrameAsBufferedImage(int f) throws DicomException, IOException

Throws:
  `DicomException`
  `IOException`

### getDecompressedFrameAsBufferedImage

public BufferedImage getDecompressedFrameAsBufferedImage(byte[] frameBytes) throws DicomException, IOException

Throws:
  `DicomException`
  `IOException`

### getDecompressedFrameAsBufferedImageUsingRLE

public BufferedImage getDecompressedFrameAsBufferedImageUsingRLE(int f) throws DicomException, IOException

Throws:
  `DicomException`
  `IOException`

### getDecompressedFrameAsBufferedImageUsingRLE

public BufferedImage getDecompressedFrameAsBufferedImageUsingRLE(byte[] frameBytes) throws DicomException, IOException

Throws:
  `DicomException`
  `IOException`

### getDecompressedFrameAsBufferedImageUsingImageReader

public BufferedImage getDecompressedFrameAsBufferedImageUsingImageReader(int f) throws DicomException, IOException

Throws:
  `DicomException`
  `IOException`

### getDecompressedFrameAsBufferedImageUsingImageReader

public BufferedImage getDecompressedFrameAsBufferedImageUsingImageReader(byte[] frameBytes) throws DicomException, IOException

Throws:
  `DicomException`
  `IOException`

### dispose

public void dispose() throws Throwable

Throws:
  `Throwable`