Conversion to struct from double is not possible

10 Ansichten (letzte 30 Tage)
Stelios Fanourakis
Stelios Fanourakis am 7 Dez. 2017
Kommentiert: KL am 7 Dez. 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 Kommentare
Stephen23
Stephen23 am 7 Dez. 2017
@Stelios Fanourakis: please show us the entire error message. This means all of the red text.
KL
KL am 7 Dez. 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'

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu DICOM Format finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by