public class Compression
extends java.lang.Object
1.2.840.10008.1.2.4.50 | JPEGBaseline
|
1.2.840.10008.1.2.4.70 | JPEGLossless
|
1.2.840.10008.1.2.5 | RLELossless
|
TransferSyntax
Modifier and Type | Field and Description |
---|---|
static int |
COLORBYPIXEL |
static int |
COLORBYPLANE |
protected JdtLogger |
log |
Constructor and Description |
---|
Compression()
Empty constructor.
|
Compression(DicomObject d)
Constructs a new Compression object for a DicomObject.
|
Modifier and Type | Method and Description |
---|---|
void |
compress(int ts)
Encodes the pixeldata of the associated DicomObject.
|
static byte[] |
compressFrame(int encoding,
byte[] frame,
int w,
int h)
This method delegates to
compressFrame(int, byte[], int, int, int)
In case of RGB images, planar configuration of COLOR BY PIXEL is assumed
(0028,0006) = 0 |
static byte[] |
compressFrame(int encoding,
byte[] frame,
int w,
int h,
int planarConfiguration)
Encodes a frame and returns the encoded frame.
|
void |
decompress()
Decompresses the pixeldata of the DicomObject specified in the constructor (or last call
of setDicomObject), and replaces it in this DicomObject.
|
static byte[] |
decompressFrame(int encoding,
byte[] frame,
int w,
int h)
decodes a encoded bytearray 'frame' and returns the result.
|
DicomObject |
getDicomObject()
Returns the DicomObject associated with the Compression object.
|
void |
setDicomObject(DicomObject d)
replaces the current DicomObject with a new one.
|
protected JdtLogger log
public static final int COLORBYPIXEL
public static final int COLORBYPLANE
public Compression()
setDicomObject
to specify the
source for compression.public Compression(DicomObject d) throws DicomException
DicomException
public void decompress() throws DicomException, java.io.IOException
DicomException
- gets thrown when needed information is missing.java.io.IOException
- is thrown when the compressed pixel data seems corrupt.public static byte[] decompressFrame(int encoding, byte[] frame, int w, int h) throws DicomException, java.io.IOException
encoding
- use one of the encapsulating transfer syntaxes specified in TransferSyntax
DicomException
java.io.IOException
public void compress(int ts) throws java.io.IOException, DicomException
ts
- the transfer syntax for the wanted compression schemejava.io.IOException
DicomException
TransferSyntax
public static byte[] compressFrame(int encoding, byte[] frame, int w, int h) throws java.io.IOException, DicomException
compressFrame(int, byte[], int, int, int)
In case of RGB images, planar configuration of COLOR BY PIXEL is assumed
(0028,0006) = 0encoding
- one of the supported transfer syntaxes (see documentation at the top)frame
- frame pixel dataw
- widthh
- heightjava.io.IOException
- -DicomException
- -public static byte[] compressFrame(int encoding, byte[] frame, int w, int h, int planarConfiguration) throws java.io.IOException, DicomException
encoding
- one of the supported transfer syntaxes (see documentation at the top)frame
- frame pixel dataw
- widthh
- heightplanarConfiguration
- ignored, unless RGB imagesjava.io.IOException
- -DicomException
- -public void setDicomObject(DicomObject d) throws DicomException
DicomException
public DicomObject getDicomObject()