Error using dicomread. Can anyone help me?

조회 수: 23 (최근 30일)
Saipramod Gorantla
Saipramod Gorantla 2018년 12월 4일
답변: Walter Roberson 2018년 12월 4일
Am using dicom images in my project.
Currently trying to read in a series of dicom images into an array using dicomread but I keep getting these error.
fileFolder = fullfile(pwd,'series');
files = dir(fullfile(fileFolder,'*.dcm'));
fileNames = {files.name};
info = dicominfo(fullfile(fileFolder,fileNames{1}))
voxel_size = [info.PixelSpacing;info.SliceThickness];
I = dicomread(fullfile(fileFolder,fileNames{1}));
classI = class(I);sizeI = size(I);
numImages = length(fileNames)
hWaitBar = waitbar(0,'Reading DICOM files');
ct = zeros(sizeI(1),sizeI(2),numImages,classI);
for p=numImages:-1:1
f = fullfile(fileFolder,fileNames(p));
ct(:,:,1,p) = uint8(dicomread(f));
waitbar((numImages)-p+1)/(length(fileNames));
end
while I run the above code,
Error in dicomread (line 86)
[X, map, alpha, overlays] = newDicomread(msgname, frames, useVRHeuristic);
Error in dicom (line 18)
ct(:,:,1,p) = uint8(dicomread(f));
  댓글 수: 1
KSSV
KSSV 2018년 12월 4일
Tell the full error....what you are showing is the location where error occured.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2018년 12월 4일
filenames{p}
not (p)

카테고리

Help CenterFile Exchange에서 Read and Write Image Data from Files에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by