Dicomread - Out of Memory

2 次查看(过去 30 天)
Francesco Maffessanti
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 个评论
Eric Larson
Eric Larson 2019-9-16
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.

请先登录,再进行评论。

回答(1 个)

Selva Karna
Selva Karna 2020-1-14
change DICOM Image data type after read dicom, then load and view your volume

类别

Help CenterFile Exchange 中查找有关 DICOM Format 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by