I referred to the following site.
https://support.dcmtk.org/docs/mod_dcmjpeg.html
When I checked OFCondition of chooseRepresentation function, the Status is 'OF_error' and the error text is 'Pixel representation cannot be changed'
How can I solve this problem?
The part of code is below.
Code: Select all
E_TransferSyntax xfer = m_pdcmfile->getDataset()->getOriginalXfer();
if(xfer !=EXS_LittleEndianExplicit)
{
DJDecoderRegistration::registerCodecs();
DcmDataset *dataset = m_pdcmfile->getDataset();
if (dataset->chooseRepresentation(EXS_LittleEndianExplicit, NULL).good() &&
dataset->canWriteXfer(EXS_LittleEndianExplicit))
{
fileformat->saveFile(fileName, EXS_LittleEndianExplicit);
}
DJDecoderRegistration::cleanup();
}
Thank you in advance
Best regards,
Yonah