Dicomread - Out of Memory

3 Ansichten (letzte 30 Tage)
Francesco Maffessanti
Francesco Maffessanti am 28 Mär. 2012
Beantwortet: Selva Karna am 14 Jan. 2020
I am trying to import in MATLAB a multiframe DICOM file. The DICOM data is JEPG compressed. When importing the file using dicomread , MATLAB goes out of memory OOM (file size is 60 MB and thus it should not be a true memory issue). Using dbstop id error, I found out MATLAb runs OOM when trying to write the tempfile containing the actual frame compressed: >> fwrite(fid, metadata,InstanceData((1:len)... this happens because the variable len, describing the length of the current frame in metadata.InstanceData, has huge causeing the OOM. Therefore, I suppose something goes wrong when building the Offset table. Of note, basic DICOM viewer can read all the frames in the DICOM file. I am running MATLAB R2010b on Win64
  1 Kommentar
Eric Larson
Eric Larson am 16 Sep. 2019
I get this same error today (2018b) with a DICOM file every now and then. It has the same length issue where the length is a rediculous value. Perhaps Matlab could constrain the length to be the difference of the offset of the current frame to the offset for the next frame and not blindly accept a length like 2500000000. The symptom is that Matlab is trying to create the indices (1:length)+offset and the system goes to memory extremes (16GB+) trying to do that.
I realize that the DICOM file is not properly constructed in this case but oher DICOM viewers manage to read it just fine. A little defensive programming might go a long way here.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Selva Karna
Selva Karna am 14 Jan. 2020
change DICOM Image data type after read dicom, then load and view your volume

Kategorien

Mehr zu DICOM Format finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by