I am trying to render a dicom image. I have tried using the programmatic approach and also the console application. But I am getting the following error.
The output of the programmatic approach is:
The output when I use dcmj2pnm:E: can't change to unencapsulated representation for pixel data
E: can't determine 'PhotometricInterpretation' of decompressed image
E: mandatory attribute 'PhotometricInterpretation' is missing or can't be determined
The output when I use dcmp2pgm:E: can't change to unencapsulated representation for pixel data
E: can't determine 'PhotometricInterpretation' of decompressed image
E: mandatory attribute 'PhotometricInterpretation' is missing or can't be determined
F: Missing attribute
Here is the code I am trying to render the file:E: can't change to unencapsulated representation for pixel data
E: can't determine 'PhotometricInterpretation' of decompressed image
E: can't convert input pixel data
F: Can't open input file(s).
Code: Select all
bool renderImage(char* dicomFilePath, char* renderedFilePath)
{
DicomImage* dicomImage = new DicomImage(dicomFilePath);
if (dicomImage != NULL)
{
if (dicomImage->getStatus() == EIS_Normal)
{
if (dicomImage->writeBMP(renderedFilePath, 8))
{
return true;
}
}
}
return false;
}
But what confuses me is that other Dicom Viewers are able to render the image just fine. Also Fo-Dicom a C# dicom library can also render the image.
So, I was wondering if I was making some mistakes.
Thank You in advance for your help.