I currently downloaded Dcmtk 3.6.0 and trying to run this simple piece of code:
Code: Select all
int main() {
DcmRLEDecoderRegistration::registerCodecs();
DcmFileFormat fileformat;
if (fileformat.loadFile("test.dcm").good()) {
DcmDataset *dataset = fileformat.getDataset();
OFCondition a = dataset->chooseRepresentation(EXS_LittleEndianExplicit, NULL);
if (dataset->canWriteXfer(EXS_LittleEndianExplicit)) {
fileformat.saveFile("test.dcm", EXS_LittleEndianExplicit);
DicomImage bmImg(dataset, EXS_LittleEndianExplicit);
int b = bmImg.writeBMP("testBmp.bmp");// Trying to get the bitmap image from the first frame
}
}
DcmRLEDecoderRegistration::cleanup();
return 1;
}
And the following line is not properly executed (i.e. the bitmap image wasn't created).
any hint?