Skip to content

Commit

Permalink
take into account geometric interpretation
Browse files Browse the repository at this point in the history
  • Loading branch information
tuket committed Oct 14, 2024
1 parent 4518032 commit 543f5d0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions dcmimgle/libsrc/didocu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,19 @@ DiDocument::DiDocument(DcmObject *object,
Object = object;
else
DCMIMGLE_ERROR("invalid DICOM object passed to constructor (wrong class)");
if (Object != NULL)
{

if (Object != NULL) {
auto dataset = (Object->ident() == EVR_dataset) ? OFstatic_cast(DcmDataset*, Object) : nullptr;

if (dataset)
dataset->findAndGetOFString(DCM_PhotometricInterpretation, PhotometricInterpretation);

// try to determine the transfer syntax from the given object
if (Xfer == EXS_Unknown)
{
// check type before casting the object
if (Object->ident() == EVR_dataset)
Xfer = OFstatic_cast(DcmDataset *, Object)->getOriginalXfer();
if (dataset)
Xfer = dataset->getOriginalXfer();
else // could only be an item
DCMIMGLE_WARN("can't determine original transfer syntax from given DICOM object");
}
Expand Down

0 comments on commit 543f5d0

Please sign in to comment.