How to sum data points within contour lines/isolines?

3 visualizaciones (últimos 30 días)
Sel
Sel el 20 de Mzo. de 2019
Editada: Star Strider el 20 de Mzo. de 2019
Hello,
I have a numeric matrix, z, in which each data point represents a single pixel of an image. If I plot a filled contour, I get the image below that defines my regions of interests (cancer cells) very nicely. Is there a method by which I can sum all the raw data points of my matrix within the outer contour line, including those within the lightest-coloured areas? I am hoping to obtain the total signal intensities of each cancer cell, and then the integrated intensity values. Many thanks in advance.
Screenshot 2019-03-20 at 1.47.10 PM.png

Respuestas (1)

Star Strider
Star Strider el 20 de Mzo. de 2019
Editada: Star Strider el 20 de Mzo. de 2019
You can certainly get the (x,y) coordinates of the contours, although it takes a bit of code the get the result you likely want. See specifically the documentation section on Custom Line Width (link) and the detailed explanation of the contour matrix in the documentation section for M (link). You will also find the Contour Properties (link) documentation section on 'LevelList' (link) helpful.
EDIT —
Also consider the inpolygon (link) function.

Community Treasure Hunt

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

Start Hunting!

Translated by