Class CompressedFrameDecoder


  • public class CompressedFrameDecoder
    extends java.lang.Object

    The CompressedFrameDecoder class implements decompression of selected frames in various supported Transfer Syntaxes once already extracted from DICOM encapsulated images.

    • Field Detail

      • haveProcessedMetaDataForFrameRequest

        protected boolean haveProcessedMetaDataForFrameRequest
      • haveJFIF

        protected boolean haveJFIF
      • haveAdobe

        protected boolean haveAdobe
      • areDownsampled

        protected boolean areDownsampled
      • areNumberedFromOneByOne

        protected boolean areNumberedFromOneByOne
    • 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:
        DicomException
        java.io.IOException
      • getDecompressedFrameAsBufferedImage

        public java.awt.image.BufferedImage getDecompressedFrameAsBufferedImage​(byte[] frameBytes)
                                                                         throws DicomException,
                                                                                java.io.IOException
        Throws:
        DicomException
        java.io.IOException
      • getDecompressedFrameAsBufferedImageUsingRLE

        public java.awt.image.BufferedImage getDecompressedFrameAsBufferedImageUsingRLE​(int f)
                                                                                 throws DicomException,
                                                                                        java.io.IOException
        Throws:
        DicomException
        java.io.IOException
      • getDecompressedFrameAsBufferedImageUsingRLE

        public java.awt.image.BufferedImage getDecompressedFrameAsBufferedImageUsingRLE​(byte[] frameBytes)
                                                                                 throws DicomException,
                                                                                        java.io.IOException
        Throws:
        DicomException
        java.io.IOException
      • getDecompressedFrameAsBufferedImageUsingImageReader

        public java.awt.image.BufferedImage getDecompressedFrameAsBufferedImageUsingImageReader​(int f)
                                                                                         throws DicomException,
                                                                                                java.io.IOException
        Throws:
        DicomException
        java.io.IOException
      • getDecompressedFrameAsBufferedImageUsingImageReader

        public java.awt.image.BufferedImage getDecompressedFrameAsBufferedImageUsingImageReader​(byte[] frameBytes)
                                                                                         throws DicomException,
                                                                                                java.io.IOException
        Throws:
        DicomException
        java.io.IOException
      • dispose

        public void dispose()
                     throws java.lang.Throwable
        Throws:
        java.lang.Throwable