Error using dicom_getFileDetails. Unable to load file .dcm

Am using dicom images in my research project. ('m using Matlab_R2021b on MacBook Air, with the Image processing toolbox).
Currently trying to read series of dicom images but I keep getting errors beacause Matlab is not able to upload the DICOM images.
I can open them correctly from external apps and with the DICOM Browser on Matlab, but I cannot run any code becuase I get errors. I tried to read them with info = dicomread('IM-001.dcm') and i got:
Error using dicom_getFileDetails
File "IM-001.dcm" not found.
Error in dicomread>newDicomread
fileDetails = dicom_getFileDetails(filename);
(Before each "run" i delete the DS_Store files in the terminal. The images is took correctly in the pathway).
Any help would be very appreciated. Thanks in advance!

2 件のコメント

Walter Roberson
Walter Roberson 2022 年 3 月 15 日
The .DS_Store is not relevant to any of this.
Your current directory is not where the files are, and you are not providing the directory at the time you ask to read the file.
Anna
Anna 2022 年 3 月 16 日
Thanks for the reply. I had provided the correct path and the dicomread function was going correctly. However, if I use functions of external tools, it cannot read the image data correctly.

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

 採用された回答

yanqi liu
yanqi liu 2022 年 3 月 15 日

0 投票

yes,sir,may be check the filepath,use absolute path string,such as
if your dcm in c:/folder/ ,then use
info = dicomread('c:/folder/IM-001.dcm')

その他の回答 (1 件)

Simon Chan
Simon Chan 2022 年 3 月 15 日

1 投票

Use function fullfile to indicate the full path to the file.
filename = 'IM-001.dcm';
selpath = uigetdir(pwd,'Select image folder'); % Use uigetdir to selecte the folder
info = dicomread(fullfile(selpath,filename)); % Do dicomread

カテゴリ

ヘルプ センター および File ExchangeDICOM Format についてさらに検索

製品

リリース

R2021b

質問済み:

2022 年 3 月 14 日

コメント済み:

2022 年 3 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by