MATLAB Answers

how to fix multibrandread function

조회 수: 1(최근 30일)
mohd akmal masud
mohd akmal masud 2021년 2월 8일
답변: Walter Roberson 2021년 2월 8일
Hi all,
i want to use multibrandread function, but got error. this is my dicom image 128ASTITR2SUB8.dcm
which is my image have Rows=130, Columss=130, numberofFrames =90
this is my coding.
SPECTinfo = dicominfo('128ASTITR2SUB8.dcm');
fixedVolume = multibandread('128ASTITR2SUB8.dcm',...
[SPECTinfo.Rows, SPECTinfo.Columns, SPECTinfo.NumberOfFrames],...
'uint16=>single', 0, 'bsq', 'ieee-be' );
but i got error
Index exceeds the number of array elements (15).
Error in multibandread>readDiskFile (line 269)
im(:,destNdx(2),destNdx(3)) = data(srcNdx{1}-kStart+1);
Error in multibandread (line 165)
im = readDiskFile(filename, info, ndx, readOrder);
What does means by Index exceeds the number of array elements (15).????
Anyone can help me?

채택된 답변

Walter Roberson
Walter Roberson 2021년 2월 8일
dcm files are binary files with structured binary segments. https://docs.fileformat.com/image/dcm/ . The first 128 bytes are reserved for comments, or binary 0 if unused. You are reading starting from byte 0, so you are reading the comments as-if they are data.
The easiest explanation for that error would be if SPECTinfo.Rows, SPECTinfo.Columns, and SPECTinfo.NumberOfFrames are all non-scalar.

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by