changeset 6312:6ce5e7b44afc

fix test_decode_elscint
author Alain Mazy <am@orthanc.team>
date Thu, 18 Sep 2025 10:05:21 +0200
parents e90b9d76ff6d
children a84bf2926cc3
files OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp	Thu Sep 18 09:53:50 2025 +0200
+++ b/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp	Thu Sep 18 10:05:21 2025 +0200
@@ -1694,21 +1694,23 @@
                                     MimeType& mime,
                                     unsigned int frameId) const
   {
-    if (!this->HasTag(DICOM_TAG_PIXEL_DATA))
+    DcmDataset* dcmDataset = GetDcmtkObjectConst().getDataset();
+
+    if (!this->HasTag(DICOM_TAG_PIXEL_DATA) && !DicomImageDecoder::IsPsmctRle1(*dcmDataset))
     {
       throw OrthancException(ErrorCode_BadRequest, "Cannot extract a frame from a DIOCM file that does not have pixel data.");
     }
 
     if (pimpl_->frameIndex_.get() == NULL)
     {
-      assert(pimpl_->file_ != NULL &&
-             GetDcmtkObjectConst().getDataset() != NULL);
-      pimpl_->frameIndex_.reset(new DicomFrameIndex(*GetDcmtkObjectConst().getDataset()));
+      assert(pimpl_->file_ != NULL && dcmDataset != NULL);
+
+      pimpl_->frameIndex_.reset(new DicomFrameIndex(*dcmDataset));
     }
 
     pimpl_->frameIndex_->GetRawFrame(target, frameId);
 
-    E_TransferSyntax transferSyntax = GetDcmtkObjectConst().getDataset()->getCurrentXfer();
+    E_TransferSyntax transferSyntax = dcmDataset->getCurrentXfer();
     switch (transferSyntax)
     {
       case EXS_JPEGProcess1: