[update 24 March 2023: latest HRZ softwarecan be found on HRZ website - www.hrzkit.com]
The function SaveBitmap of the DCXIMG class also handles jpeg 2000 in the same manner.
The following sample code snippet shows how to decode a JPEG 2000 image using the Decode function and save it as a new decompressed DICOM file:
DCXOBJ image = new DCXOBJ();
String filename = "DCMJ2K";
image.openFile(filename);
image.Decode();
image.saveFile("DCMLEE");
Another little feature of this release is the TransferSyntax property (set only) that can be used to encode or decode objects or explicitly set the transfer syntax, for example to store objects as little endian implicit or big endian implicit. Up until now, created objects could have been stored either as little endian explicit or with one of the supported compressed formats (jpeg, jpeg lossles and rle).
The following code shows how to save files as LEI:
DCXOBJ image = new DCXOBJ();
/// ... add elements in
image.TransferSyntax = TS_LEI;
image.saveFile("DCMLEI");
The new release is on the downloads page at downloads.hrzkit.com
Kind of tedious here but now I see the saveFile option. I wrote this little method to make setting the element process a little easier.
ReplyDeletestatic private void SetElement(ref DCXOBJ o, DICOM_TAGS_ENUM enumerable, object value)
{
DCXELM e = new DCXELM();
e.Init((int)enumerable);
e.Value = value;
o.insertElement(e);
}
Cool. Nic helper.
Delete