DICOM

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
George
Posts: 54
Joined: Sun, 2023-11-12, 16:50

DICOM

#1 Post by George »

Hello,

I am trying to figure out what is wrong with this code as it is not able to read my dicoms transfer syntax
specifically jpeg basline

string getTransferSyntax(const std::string& filePath) {
DcmFileFormat fileFormat;
OFCondition status = fileFormat.loadFile(filePath.c_str());

if (status.good()) {
// Retrieve the dataset from the file
DcmDataset *dataset = fileFormat.getDataset();

// Get the transfer syntax
const char *transferSyntax;
if (dataset->findAndGetString(DCM_TransferSyntaxUID, transferSyntax).good()) {
std::string transferSyntaxStr(transferSyntax);
return (transferSyntaxStr);
}
} else {
std::cerr << "Error: Cannot load DICOM file (" << status.text() << ")" << std::endl;
}

return ""; // The file does not use JPEG2000 transfer syntax or an error occurred
}

Error:

W: DcmItem: Invalid Element (0002,0010) found in data set
W: DcmItem: Invalid Element (0002,0010) found in data set
E: can't determine 'PhotometricInterpretation' of decompressed image
E: mandatory attribute 'PhotometricInterpretation' is missing or can't be determined

Best Regards
George

Geert Vandenbussche
Posts: 14
Joined: Tue, 2018-11-13, 09:05

Re: DICOM

#2 Post by Geert Vandenbussche »

Hi George,

Please have a look to the reply to one of your previous posts:
https://forum.dcmtk.org/viewtopic.php? ... ID#p22087

Regards,

Geert

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest