how to fix multibrandread function

1 vue (au cours des 30 derniers jours)
mohd akmal masud
mohd akmal masud le 8 Fév 2021
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?

Réponse acceptée

Walter Roberson
Walter Roberson le 8 Fév 2021
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.

Plus de réponses (0)

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by