Dicomread - Out of Memory

조회 수: 3 (최근 30일)
Francesco Maffessanti
Francesco Maffessanti 2012년 3월 28일
답변: Selva Karna 2020년 1월 14일
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