help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: Octave crash when dicominfo some files


From: John Donoghue
Subject: Re: Re: Octave crash when dicominfo some files
Date: Wed, 15 Apr 2020 08:01:55 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

On 4/15/20 1:55 AM, address@hidden wrote:
Message: 4
Date: Tue, 14 Apr 2020 22:57:20 -0500 (CDT)
From: soapkwan<address@hidden>
To:address@hidden
Subject: Re: Octave crash when dicominfo some files
Message-ID:<address@hidden>
Content-Type: text/plain; charset=us-ascii

I had tried on two different windows: 7 & 10
And both have the same behaviour.

What I do is simply:
pkg load dicom;
inf = dicominfo(filepath);


This is the file doesn't cause a crash:
83633438.83633438
<https://octave.1599824.n4.nabble.com/file/t373731/83633438.83633438> And This is one of the files cause a crash: 17.17<https://octave.1599824.n4.nabble.com/file/t373731/17.17>

It also does the same crash in linux.

The issue a empty sequence of items in the dicom file, which dicominfo should probally be checking for but doesnt.


Changes in the source to (diff) fix the crash:


diff -r 6509b74e7d14 src/dicominfo.cpp
--- a/src/dicominfo.cpp Wed Apr 15 07:41:52 2020 -0400
+++ b/src/dicominfo.cpp Wed Apr 15 07:57:21 2020 -0400
@@ -394,7 +394,10 @@
        } else if (vr & gdcm::VR::SQ) {
                if(chatty) octave_stdout << " reading sequence. "; // \n provided in dumpSequence fn                 gdcm::SmartPointer<gdcm::SequenceOfItems> sqi = elem->GetValueAsSQ();
-               dumpSequence(ov, sqi, chatty, sequenceDepth+1);
+               if(sqi)
+                       dumpSequence(ov, sqi, chatty, sequenceDepth+1);
+               else
+                       *ov = octave_map();
        } else if (vr & gdcm::VR::AT) { // attribute tag
                intNDArray<octave_uint16> uint16pair(dim_vector(1,2));
                uint16_t *p=(uint16_t *)elem->GetByteValue()->GetPointer();






reply via email to

[Prev in Thread] Current Thread [Next in Thread]