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.

  • 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