Hello,
I'm trying to read and display some info from a .dcm file but when I run the code I always get the same errors:
"Error using reshape
Number of elements must not change. Use [] as one of the size inputs to automatically calculate
the appropriate size for that dimension.
Error in rmfield (line 79)
s = cell2struct(reshape(c(~toRemove,:),sz),f(~toRemove));
Error in dicominfo (line 80)
metadata = rmfield(metadata, pixelDataField);
Error in pmpm11lab (line 3)
info_1 = dicominfo('CT1.dcm')"
The code is simple since I'm only at the beginning of it:
clear
clc
info1 = dicominfo('CT1.3.6.1.4.1.2452.6.2940381419.1112065053.2033732512.1877029011__xid-1447805_2.dcm');
y = dicomread(info1);
imshow(y,[])
I would appreciate any suggestions and help.
Many thanks.

6 件のコメント

Walter Roberson
Walter Roberson 2021 年 2 月 14 日
Would it be possible for you to post the image on a site such as dropbox and put the link here?
I know that the answer might be NO due to patient privacy, but on the other hand perhaps this situation might not happen to require privacy.
Filippos Apostolopoulos
Filippos Apostolopoulos 2021 年 2 月 14 日
Walter Roberson
Walter Roberson 2021 年 2 月 14 日
When I test in R2020b, I do not get an error in my system.
I notice that your error message relates to file CT1.dcm but your code refers to a (potentially) different file.
Filippos Apostolopoulos
Filippos Apostolopoulos 2021 年 2 月 14 日
I'm sorry, I changed the name of the file because it was too long. It is the same file.
Walter Roberson
Walter Roberson 2021 年 2 月 14 日
Hmmm... not sure. You would have to debug rmfield()
Just a suspicion: what shows up for
which matches
The problem you are seeing could occur if you have a matches() function overriding MATLAB's matches() function.
Filippos Apostolopoulos
Filippos Apostolopoulos 2021 年 2 月 14 日
編集済み: Filippos Apostolopoulos 2021 年 2 月 14 日
If I run the:
which matches
It gives me this:
C:\...\Assignement\CERR-master\CERR_core\Database BETA\matches.m
Should I delete something or change the folder?
Many thanks.
Edit: I tried to change the folder but it gave me the same errors.

サインインしてコメントする。

 採用された回答

Walter Roberson
Walter Roberson 2021 年 2 月 14 日

2 投票

Remove C:\...\Assignement\CERR-master\CERR_core\Database BETA from your MATLAB path,
or use pathtool to move it to the bottom of your MATLAB path.

2 件のコメント

Filippos Apostolopoulos
Filippos Apostolopoulos 2021 年 2 月 14 日
Thank you very much Walter!
It was troubling me for the past two days.
Dafa
Dafa 2022 年 6 月 15 日
Thank you Walter!

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by