How can I correct this problem :
3 ビュー (過去 30 日間)
古いコメントを表示
i want to create the parametric image ,img : image ,T;total number of image sequence,t number of image
[fn,pn,fi]=uigetfile({'*.cf'})
ffn=horzcat(pn,fn);
global I;
global ffn;
%global rx;
I=dicomread(ffn);
T=size(I,16);%16
% Filtre median pour tout les slices
med=[];
for t=1:T
img(:,:,t)=F_Median(I(:,:,1,t));
end
aux1=img(:,:,t);
for i=1:size(aux1)
for j=1:size(aux1)
somme=0;
for t=1:T
aux=cos((2*pi/T) *(t-1))* aux1;
Icos(i,j)=somme+aux(i,j);
end
end
end
for i=1:size(aux1)
for j=1:size(aux1)
somme=0;
for t=1:T
aux=sin((2*pi/T)*(t-1))*med(i,j,t);
Isin(i,j)=somme+aux(i,j);
end
end
end
% Calcul de l'image d 'amplitude
for i=1:size(aux1)
for j=1:size(aux1)
I_amp(i,j)=sgrt((Icos(i,j))^(2)+(Isin(i,j))^(2) );
end
end
figure();imagesc( I_amp(i,j));
title('Image I_amp');
colorbar;
colormap('jet');
% Calcul de l'image de phase
for i=1:size(aux1)
for j=1:size(aux1)
I_phase(i,j)=arctan(I_sin(i,j)/I_cos(i,j) ) ;
end
end
figure();imagesc( I_phase(i,j));
Index exceeds matrix dimensions
Error in fourier (line 63)
Icos(i,j)=somme+aux(i,j);
0 件のコメント
採用された回答
Image Analyst
2019 年 1 月 19 日
aux is never defined in your program. Only aux1 is. Maybe you meant aux1?
Also, what is the purpose of somme? It is always zero and never changes, so why have it in the loops?
3 件のコメント
Image Analyst
2019 年 1 月 20 日
When it says that you're using a function improperly, it's always good to look in the help. If you had, you'd have seen that it expected two arguments: a Y and an Y. So it should be
I_phase = atan2(Isin, Icos) ;
Your next error will be when you find out they're null since med is null. You need to think about this whole thing some more.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!