Tumor grading in GUI or ...?

I have micro tumor images(9) and there are areas of dlbcl tumor (Nd DAB-stained and Nh H-stained) Proliferation index for this is a solution of the equation PIc=Nd/(Nh+Nd). I have to find PIc for all pictures knowing RGB intervals for Nh= (<45, 180>, <50, 185>, <160, 215>) and for Nd= (<40, 115>, <6,80>, <10,75>). How AM i supposed to do it? Please help!!

4 Kommentare

Jan
Jan am 22 Nov. 2018
Bearbeitet: Jan am 22 Nov. 2018
The question contains a lot of details, which do not matter the problem. As far as I understand you have RGB images and want to find regions in RGB intervals? Then what about:
img = rand(64, 480, 3); % Test data
match = (img(:, :, 1) > 45 & img(:, :, 1) < 180) & ...
(img(:, :, 2) > 50 & img(:, :, 2) < 185) & ...
(img(:, :, 3) > 160 & img(:, :, 3) < 215);
Looks straight.
But now "PIc=Nd/(Nh+Nd)" is not clear. What do you have to calculate exactly? How is Nh and Nd defined? Remember that your notation "Nh= (<45, 180>, <50, 185>, <160, 215>)" is not explained anywhere but a new invention. My above idea is a pure guess only.
Aneta Chwala
Aneta Chwala am 22 Nov. 2018
Sorry i made it unclear. This nine pictures are specimens and there are dab-stained nuclei (Nd) and H-stained nuclei (Nh) and for them I have to calculate index proliferation PIc. Those intervals are for Nh nuclei ( 45<r<180, <50<g<185, <160<b<215) and for Nd nuclei (40<r<115, 6<g<80, 10<b<75). As intervals are given i need to count the number of Nd and Nh pixels from the pictures.
thank you very much!
Image Analyst
Image Analyst am 22 Nov. 2018
And the equations in my answer below don't do it? Please explain why not. And attach your image.
Aneta Chwala
Aneta Chwala am 22 Nov. 2018
Image Analyst I am sorry I am new to MATLAB and I don't really know. But since the Jan's comment isn't ok (?) then how to modify it to your code and what it actually means? It's confusing for me. I didn't get images but they look similar to this:
img.jpg

Melden Sie sich an, um zu kommentieren.

Antworten (4)

Image Analyst
Image Analyst am 22 Nov. 2018

1 Stimme

Use the code in Jan's comment above, but modify it to get two binary images: matchNh and matchNd. Then I think you want the sum (count) and ratio
Nd = nnz(matchNd)
Nh = nnz(matchNh)
Plc = Nd / (Nh + Nd)
Image Analyst
Image Analyst am 22 Nov. 2018

1 Stimme

4 Kommentare

Aneta Chwala
Aneta Chwala am 22 Nov. 2018
Thanks! But I actually can't clustering, also i need to use rgb intervals for my code. I think that your idea was better but i have no idea how to start with that.
Image Analyst
Image Analyst am 22 Nov. 2018
Bearbeitet: Image Analyst am 22 Nov. 2018
Why can't you use clustering??? That's strange.
Have you tried the Color Thresholder on the Apps tab?
As you can see from the RGB gamut below, it will be virtually impossible in rgb color space.
0000 Screenshot.png
You'd be better off in HSV color space.
0001 Screenshot.png
Aneta Chwala
Aneta Chwala am 22 Nov. 2018
I need to compute PIc, so i need the number of Nd and Nh pixels from rgb. So I have to find a code which will check a photo then based on rgb intervals gave Nc Nh and PIc. I guess lol. How is clustering helping here idk. Also I don't need new images occur.
sorry if I confused more now.
And thank you for helping me!!
Image Analyst
Image Analyst am 23 Nov. 2018
Look at the gamuts - they're essentially a 3-D histogram where there is one point for every (r,g,b) triplet (every pixel value/color).
Point 1: note how there are no well contained clusters - it's basically a continuum - so the dividing plane will essentially be sort of arbitrary. You could almost put it wherever you want but at least kmeans has some sort of logic behind where it splits the gamut into the 2 colors.
Point 2: thresholding essentially divides up the gamut by slicing the color could with planes aligned with the axes, and you can see that there are no planes perpendicular to the R, G, and B axes that will do even a half way decent job of dividing the image up into different colors that are meaningfull. With HSV color space, your dividing surfaces are basically cones, sectors, and planes perpendicular to the V axis. By doing that, you can definitely carve out different regions because the hue, saturation, and brightness are different between the pink, purple, and white. The R, G, and B are also different, but you can see that planes perpendicular to the axes will not carve that cloud up into pink, purple, and white sub-clouds.

Melden Sie sich an, um zu kommentieren.

Aneta Chwala
Aneta Chwala am 27 Nov. 2018

0 Stimmen

I decided to use the code below but i get wrong PIc from it. Why is this happening?
Let say i have a picture cat.tif:
%
img = imread('cat.tif');
matchNh = (img(:, :, 1) > 45 & img(:, :, 1) < 180)
(img(:, :, 2) > 50 & img(:, :, 2) < 185)
(img(:, :, 3) > 160 & img(:, :, 3) < 215);
matchNd = (img(:, :, 1) > 40 & img(:, :, 1) < 115)
(img(:, :, 2) > 6 & img(:, :, 2) < 80)
(img(:, :, 3) > 10 & img(:, :, 3) < 75);
Nd = nnz(matchNd);
Nh = nnz(matchNh);
PIc = Nd / (Nh + Nd);
imagesc(img);
title(PIc);
%

3 Kommentare

Image Analyst
Image Analyst am 27 Nov. 2018
You forgot to attach the image.
Why do you say it's wrong?
Aneta Chwala
Aneta Chwala am 27 Nov. 2018
My outcomes are different than the examples I got. Also I have specimens but can't upload here.
Image Analyst, may I have another question??
Image Analyst
Image Analyst am 27 Nov. 2018
Yes, you may.
If it's unrelated to your first one way at the top, then create a new thread.

Melden Sie sich an, um zu kommentieren.

Aneta Chwala
Aneta Chwala am 27 Nov. 2018

0 Stimmen

That method was based on color filtration pixel by pixel of the whole image (globally) so how to mix it to local method where we would analyse the image with sliding window?

Gefragt:

am 22 Nov. 2018

Beantwortet:

am 27 Nov. 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by