Conversion to struct from double is not possible
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Stephen23
el 7 de Dic. de 2017
@Stelios Fanourakis: please show us the entire error message. This means all of the red text.
KL
el 7 de Dic. de 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'
Respuestas (0)
Ver también
Categorías
Más información sobre DICOM Format en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!