How can I correct this problem :
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
dziri halima
le 19 Jan 2019
Commenté : Image Analyst
le 20 Jan 2019
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 commentaires
Réponse acceptée
Image Analyst
le 19 Jan 2019
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 commentaires
Image Analyst
le 20 Jan 2019
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.
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!