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
DICOM
Moderator: Moderator Team
-
- Posts: 14
- Joined: Tue, 2018-11-13, 09:05
Re: DICOM
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
Please have a look to the reply to one of your previous posts:
https://forum.dcmtk.org/viewtopic.php? ... ID#p22087
Regards,
Geert
Who is online
Users browsing this forum: Google [Bot] and 1 guest