Package com.pixelmed.dicom
Class CompressedFrameDecoder
- java.lang.Object
-
- com.pixelmed.dicom.CompressedFrameDecoder
-
public class CompressedFrameDecoder extends java.lang.ObjectThe
CompressedFrameDecoderclass 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 classCompressedFrameDecoder.ByteArrayInputStreamWithOffsetCounterAndOurMethods
-
Field Summary
Fields Modifier and Type Field Description protected booleanareDownsampledprotected booleanareNumberedFromOneByOneprotected booleanhaveAdobeprotected booleanhaveJFIFprotected booleanhaveProcessedMetaDataForFrameRequest
-
Constructor Summary
Constructors Constructor 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, 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)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)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleancanDecompress(java.io.File file)Returns a whether or not a DICOM file contains pixel data that can be decompressed using this class.static booleancanDecompress(java.lang.String filename)Returns a whether or not a DICOM file contains pixel data that can be decompressed using this class.voiddispose()protected voiddoCommonConstructorStuff(java.lang.String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, java.awt.color.ColorSpace colorSpace)protected voiddoCommonConstructorStuff(java.lang.String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, java.awt.color.ColorSpace colorSpace, boolean photometricInterpretationIsKnown, boolean photometricInterpretationIsYBR)booleangetColorSpaceConvertedToRGBDuringDecompression()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.BufferedImagegetDecompressedFrameAsBufferedImage(byte[] frameBytes)java.awt.image.BufferedImagegetDecompressedFrameAsBufferedImage(int f)java.awt.image.BufferedImagegetDecompressedFrameAsBufferedImageUsingImageReader(byte[] frameBytes)java.awt.image.BufferedImagegetDecompressedFrameAsBufferedImageUsingImageReader(int f)java.awt.image.BufferedImagegetDecompressedFrameAsBufferedImageUsingRLE(byte[] frameBytes)java.awt.image.BufferedImagegetDecompressedFrameAsBufferedImageUsingRLE(int f)static booleanisPixelMedLosslessJPEGReader(javax.imageio.ImageReader reader)static booleanisStandardJPEGReader(javax.imageio.ImageReader reader)static voidscanForCodecs()static javax.imageio.ImageReaderselectReaderFromCodecsAvailable(java.lang.String readerWanted, java.lang.String transferSyntaxUID, int bytesPerSample)static javax.imageio.ImageReaderselectReaderFromCodecsAvailable(java.lang.String readerWanted, java.lang.String transferSyntaxUID, int bytesPerSample, java.util.Set<java.lang.String> blacklistedReaders)
-
-
-
Constructor Detail
-
CompressedFrameDecoder
public CompressedFrameDecoder(java.lang.String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, java.awt.color.ColorSpace colorSpace) throws DicomException- Throws:
DicomException
-
CompressedFrameDecoder
public CompressedFrameDecoder(java.lang.String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, java.awt.color.ColorSpace colorSpace, boolean photometricInterpretationIsYBR) throws DicomException- Throws:
DicomException
-
CompressedFrameDecoder
public CompressedFrameDecoder(java.lang.String transferSyntaxUID, ByteFrameSource compressedDataFrameSource, int bytesPerSample, int width, int height, int samples, java.awt.color.ColorSpace colorSpace) throws DicomException- Throws:
DicomException
-
CompressedFrameDecoder
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- Throws:
DicomException
-
CompressedFrameDecoder
public CompressedFrameDecoder(java.lang.String transferSyntaxUID, byte[][] frames, int bytesPerSample, int width, int height, int samples, java.awt.color.ColorSpace colorSpace) throws DicomException- Throws:
DicomException
-
CompressedFrameDecoder
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- 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
-
canDecompress
public 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.
- 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(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, java.util.Set<java.lang.String> blacklistedReaders) throws DicomException- Throws:
DicomException
-
selectReaderFromCodecsAvailable
public static javax.imageio.ImageReader selectReaderFromCodecsAvailable(java.lang.String readerWanted, java.lang.String transferSyntaxUID, int bytesPerSample) throws DicomException- Throws:
DicomException
-
doCommonConstructorStuff
protected void doCommonConstructorStuff(java.lang.String transferSyntaxUID, int bytesPerSample, int width, int height, int samples, java.awt.color.ColorSpace colorSpace) throws DicomException- Throws:
DicomException
-
doCommonConstructorStuff
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- Throws:
DicomException
-
getDecompressedFrameAsBufferedImage
public java.awt.image.BufferedImage getDecompressedFrameAsBufferedImage(int f) throws DicomException, java.io.IOException- Throws:
DicomExceptionjava.io.IOException
-
getDecompressedFrameAsBufferedImage
public java.awt.image.BufferedImage getDecompressedFrameAsBufferedImage(byte[] frameBytes) throws DicomException, java.io.IOException- Throws:
DicomExceptionjava.io.IOException
-
getDecompressedFrameAsBufferedImageUsingRLE
public java.awt.image.BufferedImage getDecompressedFrameAsBufferedImageUsingRLE(int f) throws DicomException, java.io.IOException- Throws:
DicomExceptionjava.io.IOException
-
getDecompressedFrameAsBufferedImageUsingRLE
public java.awt.image.BufferedImage getDecompressedFrameAsBufferedImageUsingRLE(byte[] frameBytes) throws DicomException, java.io.IOException- Throws:
DicomExceptionjava.io.IOException
-
getDecompressedFrameAsBufferedImageUsingImageReader
public java.awt.image.BufferedImage getDecompressedFrameAsBufferedImageUsingImageReader(int f) throws DicomException, java.io.IOException- Throws:
DicomExceptionjava.io.IOException
-
getDecompressedFrameAsBufferedImageUsingImageReader
public java.awt.image.BufferedImage getDecompressedFrameAsBufferedImageUsingImageReader(byte[] frameBytes) throws DicomException, java.io.IOException- Throws:
DicomExceptionjava.io.IOException
-
dispose
public void dispose() throws java.lang.Throwable- Throws:
java.lang.Throwable
-
-