2

I am tring to convert a DICOM with JPEG 2000 Transfer Syntax to regular DICOM file (Explicit Little Endian, or Implicit Little Endian).

I was able to read pixels from DICOM / JPEG 2000 file into a buffer, but I am now stuck on to create JPEG 2000 dicom file using DCMTK library.

This is what i have to tried so far.

OFCondition isrep = datas->chooseRepresentation(EXS_JPEG2000, NULL);

if(datas->canWriteXfer(EXS_JPEG2000,orxfer))
{
OFCondition  issaved = fileformat.saveFile("d:\\test.dcm", EXS_JPEG2000, EET_ExplicitLength, EGL_recalcGL,
                       EPD_noChange, OFstatic_cast(Uint32, 0), OFstatic_cast(Uint32, 0), EWM_updateMeta);
}

I am getting an error:

pixel representation not found

malat
  • 12,152
  • 13
  • 89
  • 158
Bhuvan Bose
  • 21
  • 1
  • 4

1 Answers1

4

Did you install the private (commercial) J2K module ? If not, DCMTK open-source does not support JPEG 2000. Instead you should use GDCM. Eg:

$ gdcmimg input.jp2 output.dcm

See gdcmimg documentation.

malat
  • 12,152
  • 13
  • 89
  • 158