フィルターのクリア

dicomreadVolume 'Directory was not readable' error

18 ビュー (過去 30 日間)
Hayley Devine
Hayley Devine 2024 年 7 月 11 日 23:42
回答済み: Gayatri 2024 年 7 月 12 日 3:30
I am trying to load in a zip folder with dcm files into MATLAB. However, when I use the dicomreadVolume function I am getting an error. I tried unzipping it directly in my file explorer. How can I fix this error?
ctScan = dicomreadVolume('Spine_CT.dcm');
Error using dicomreadVolume>getFilenames
Directory was not readable.
Error in dicomreadVolume (line 11)
filenames = getFilenames(inputSource);
Error in untitled (line 1)
ctScan = dicomreadVolume('Spine_CT.dcm');

回答 (2 件)

Walter Roberson
Walter Roberson 2024 年 7 月 12 日 2:24
You would get that error if MATLAB cannot find the given file on the MATLAB path.
Typically, that means that you specified the file name as 'Spine_CT.dcm' but the file is not in the current directory. Typically unzipped files are put into a newly-created directory.

Gayatri
Gayatri 2024 年 7 月 12 日 3:30
Hi Hayley,
Here are steps to load the files correctly:
  • Ensure that the zip file is properly unzipped into a directory that MATLAB can access. You can do this directly within MATLAB to avoid any file path issues.
  • Once the files are unzipped, provide the directory path to "dicomreadVolume".
% Specify the path to the zip file
zipFilePath = 'path/to/your/Spine_CT.zip';
% Specify the output directory for unzipping
outputDir = 'path/to/unzipped/files';
% Unzip the files
unzip(zipFilePath, outputDir);
% Read the DICOM volume from the unzipped directory
ctScan = dicomreadVolume(outputDir);
Please refer the below documentation for unzip function: https://www.mathworks.com/help/matlab/ref/unzip.html
I hope it helps!

カテゴリ

Help Center および File ExchangeDICOM Format についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by