Package com.pixelmed.dicom
Class CompressedFrameDecoder
java.lang.Object
com.pixelmed.dicom.CompressedFrameDecoder
The CompressedFrameDecoder class implements decompression of selected frames
in various supported Transfer Syntaxes once already extracted from DICOM encapsulated images.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected booleanprotected booleanprotected boolean -
Constructor Summary
ConstructorsConstructorDescriptionCompressedFrameDecoder(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 TypeMethodDescriptionstatic booleancanDecompress(File file) Returns a whether or not a DICOM file contains pixel data that can be decompressed using this class.static booleancanDecompress(String filename) Returns a whether or not a DICOM file contains pixel data that can be decompressed using this class.voiddispose()protected voiddoCommonConstructorStuff(String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, ColorSpace colorSpace) protected voiddoCommonConstructorStuff(String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, ColorSpace colorSpace, boolean photometricInterpretationIsKnown, boolean photometricInterpretationIsYBR) booleanReturns a whether or not the color space will be converted to RGB during compression if it was YBR in the first place.getDecompressedFrameAsBufferedImage(byte[] frameBytes) getDecompressedFrameAsBufferedImageUsingImageReader(byte[] frameBytes) getDecompressedFrameAsBufferedImageUsingRLE(byte[] frameBytes) static booleanstatic booleanisStandardJPEGReader(ImageReader reader) static voidstatic ImageReaderselectReaderFromCodecsAvailable(String readerWanted, String transferSyntaxUID, int bytesPerSample) static ImageReaderselectReaderFromCodecsAvailable(String readerWanted, String transferSyntaxUID, int bytesPerSample, Set<String> blacklistedReaders)
-
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
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
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
-
isPixelMedLosslessJPEGReader
-
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
- Throws:
DicomExceptionIOException
-
getDecompressedFrameAsBufferedImage
public BufferedImage getDecompressedFrameAsBufferedImage(byte[] frameBytes) throws DicomException, IOException - Throws:
DicomExceptionIOException
-
getDecompressedFrameAsBufferedImageUsingRLE
public BufferedImage getDecompressedFrameAsBufferedImageUsingRLE(int f) throws DicomException, IOException - Throws:
DicomExceptionIOException
-
getDecompressedFrameAsBufferedImageUsingRLE
public BufferedImage getDecompressedFrameAsBufferedImageUsingRLE(byte[] frameBytes) throws DicomException, IOException - Throws:
DicomExceptionIOException
-
getDecompressedFrameAsBufferedImageUsingImageReader
public BufferedImage getDecompressedFrameAsBufferedImageUsingImageReader(int f) throws DicomException, IOException - Throws:
DicomExceptionIOException
-
getDecompressedFrameAsBufferedImageUsingImageReader
public BufferedImage getDecompressedFrameAsBufferedImageUsingImageReader(byte[] frameBytes) throws DicomException, IOException - Throws:
DicomExceptionIOException
-
dispose
- Throws:
Throwable
-