Conversion to struct from double is not possible
2 views (last 30 days)
Show older comments
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 Comments
Stephen23
on 7 Dec 2017
@Stelios Fanourakis: please show us the entire error message. This means all of the red text.
KL
on 7 Dec 2017
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'
Answers (0)
See Also
Categories
Find more on DICOM Format in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!