Conversion to struct from double is not possible

10 次查看(过去 30 天)
I am trying to load different dicom images in a stack and get this error ''Conversion to struct from double is not possible''
clc;
clear all;
close all;
N=5;
img_dir ='D:\Stelios PhD files'
strfile = 'Z01';
img = dicomread(fullfile(img_dir, strfile));
siz_img = size(img);
dicomlist = dir(fullfile(pwd,img_dir,'*.dcm'));
I=0;
for cnt = 1 : numel(dicomlist)
I{cnt} = dicomread(fullfile(pwd,img_dir,dicomlist(cnt).name));
end
% create result matrix:
D = NaN([dicomlist N]);
D(:,:,1) = I;
D=squeeze(D);
Ds=smooth3(D);
imagesc(Ds(:,:,N));
imagesc(squeeze(Ds(:,N,:))');
imagesc(squeeze(Ds(N,:,:)));
%# view slices as countours
contourslice(Ds,[],[],1:size(Ds,3))
view(3), axis tight
daspect([1 5 1])
ANy help???
  4 个评论
Stephen23
Stephen23 2017-12-7
@Stelios Fanourakis: please show us the entire error message. This means all of the red text.
KL
KL 2017-12-7
using pwd,img_dir together is also strange. your img_dir is like 'D:\...' and pwd would give you your current working directory path. Something like,
'C:\Users\D:\Stelios PhD files'

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 DICOM Format 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by