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 boolean
protected boolean
protected boolean
protected boolean
protected 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 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
Returns 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 boolean
static boolean
isStandardJPEGReader
(ImageReader reader) static void
static ImageReader
selectReaderFromCodecsAvailable
(String readerWanted, String transferSyntaxUID, int bytesPerSample) static ImageReader
selectReaderFromCodecsAvailable
(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:
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
- Throws:
Throwable
-