How can I correct this problem :
조회 수: 1 (최근 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!