changeset 3922:74eeadf5d51d transcoding

fix access to compressed frames after transcoding
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 12 May 2020 20:48:19 +0200
parents f6ccff28fbed
children 2434e98987ba
files Core/DicomParsing/FromDcmtkBridge.cpp
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Core/DicomParsing/FromDcmtkBridge.cpp	Tue May 12 19:21:52 2020 +0200
+++ b/Core/DicomParsing/FromDcmtkBridge.cpp	Tue May 12 20:48:19 2020 +0200
@@ -1299,9 +1299,9 @@
     {
       DicomTransferSyntax sourceSyntax;
       bool known = LookupOrthancTransferSyntax(sourceSyntax, dicom);
-
-      if (!dicom.getDataset()->chooseRepresentation(xfer, representation).good() ||
-          !dicom.getDataset()->canWriteXfer(xfer) ||
+      
+      if (!dicom.chooseRepresentation(xfer, representation).good() ||
+          !dicom.canWriteXfer(xfer) ||
           !dicom.validateMetaInfo(xfer, EWM_updateMeta).good())
       {
         return false;
@@ -1780,9 +1780,13 @@
     }
 
     DcmPixelData& pixelData = dynamic_cast<DcmPixelData&>(*element);
+
+    E_TransferSyntax repType;
+    const DcmRepresentationParameter *repParam = NULL;
+    pixelData.getCurrentRepresentationKey(repType, repParam);
+    
     DcmPixelSequence* pixelSequence = NULL;
-    if (!pixelData.getEncapsulatedRepresentation
-        (dataset.getCurrentXfer(), NULL, pixelSequence).good())
+    if (!pixelData.getEncapsulatedRepresentation(repType, repParam, pixelSequence).good())
     {
       return NULL;
     }