Conversion to struct from double is not possible

2 vues (au cours des 30 derniers jours)
Stelios Fanourakis
Stelios Fanourakis le 7 Déc 2017
Commenté : KL le 7 Déc 2017
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 commentaires
Stephen23
Stephen23 le 7 Déc 2017
@Stelios Fanourakis: please show us the entire error message. This means all of the red text.
KL
KL le 7 Déc 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'

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur DICOM Format dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by