Rayleigh and Gaussian gaussian and rayleigh distribution MRI Late Enhancement for cardiac images
1 次查看(过去 30 天)
显示 更早的评论
Hello
i found this code on Mathworks.com, when i run this code for my cardiac LV image then i face withe this type of problem. plz i need help here
my id:amjadkhan_cs@yahoo.com
Error using .*
Integers can only be combined with integers of the same class, or scalar doubles.
Error in linspace (line 30)
y = d1 + (0:n1).*(d2 - d1)/n1;
Error in hist (line 94)
edges = linspace(miny,maxy,x+1);
Error in dd (line 13)
[c1,c2]=hist(I(:)',50);"
clear;clear all;close all;
I=dicomread('IM_0001.dcm');
I=uint8(round(double (I)));
I=I(:)',[muhat, sigmahat]=normfit(I);
mean_value=round(muhat);
sigma_value=round(sigmahat);
gauss(i)=100*exp( - (x(i)-mean_value)^2/(2*sigma_value^2)/(sigma_value*sqrt(2*pi)));
%5end
%%x=0:1:29952; for i=1:size(x')
rayl(i)=500*exp( - (x(i)^2/(2*sigma_value^2)*(x(i)/sigma_value^2)));
%%end
%%figure(3),plot(x,gauss, x,rayl),hold on imhist(I)
[c1,c2]=hist(I(:)',50);
f=fit(c2', c1', 'gauss1');
gauss=f.a*exp( - (c2-f.b).^2/ (2*f.c^2) );
hist(I(:),50),hold on, plot(c2,gauss,c2,rayl)
0 个评论
采纳的回答
Walter Roberson
2016-7-13
Change the
hist(I(:),50)
to
hist(double(I(:)),50)
7 个评论
Walter Roberson
2016-7-15
I cannot proceed on this until you post max(I(:)) and min(I(:)) right after reading the .dcm file. .jpg files are not the same as .dcm files.
By the way: you need a comma before the imhist(I) .
I also firmly recommend that you use semi-colon instead of comma after I=I(:)'
更多回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!