MATLAB: Rayleigh and Gaussian gaussian and rayleigh distribution MRI Late Enhancement for cardiac images

cardiac mri automatic segmentation

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)

Best Answer

Change the
hist(I(:),50)
to
hist(double(I(:)),50)