From simple formula to MATLAB for image analysis: is this correct?
1 view (last 30 days)
Show older comments
To measure the intensity of coloration in a histology protocol, some people (Choudhury et al, 2010) proposed this formula to give a number describing the general intensity. I'm trying to transfer that said formula in a MATLAB program for a confocal microscopy protocol.
And here is my code
%The formula this program emulates is ATM = 1/255 * n^-1 * [sigma] t from 1
%to 255 of [sigma] pixel 1 to n only if the intensity is higher than the
%treshold (t) and if so, the value is 1, if not 0.
%This is the transformation to grayscale 255
imGS = rgb2gray(imRAW);
%Determination of n, the number of pixel in the image
n = numel (imGS);
%Creating a fix v;alue of imGS
imGSF = imGS;
%Coding the sum
sum2 = 0;
for t = 1:255;
Z = zeros(size(imGS)); % Make another array to fill up...
for ii = 1:numel(imGS);
if imGS(ii)>t;
Z(ii) = 1;
else
Z(ii) = 0;
end
end
sum1 = sum(sum(Z));
sum2 = sum1 + sum2;
imGS = imGSF;
end
%formula
ATM = 1/255 * (n^-1) * sum2
It seems to be working, at first glance, but being a brand new user, I wanted to have your opinion on this. Any general tip is also welcome. Sorry, if this post is not conform to your expectations.
0 Comments
Answers (0)
See Also
Categories
Find more on Image Segmentation and Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!