How to extract figure profile coordinates
Show older comments
Hello,
I am working on a substrate curvature driven tissue growth model.
I create a sinusoidal interface, evaluate the curvature of the profile at each point, evaluate the amount of tissue growth for each point (curvature dependent) at the current step and overwrite the figure showing the tissue deposited.
This is what I obtain, with "old" tissue painted in blue and growth tissue painted in red (no tissue growth where the curvature is negative):

Now I should repeat the process considering the new interface profile obtained after the tissue deposition.
How can I obtain the coordinates of the new profile points (as a 2D matrix) by this Figure keeping the same matrix size (199x199)?
I tried to use getframe but it acquires the profile with the screen resolution (much higer) and then I used the following code to extract the point coordinates:
binaryImage = BW < 1;
[rows, columns, numberOfColorChannels] = size(BW);
for c = 1 : columns
newprofile(c) = rows - find(binaryImage(:,c), 1, 'first') + 1;
end
This works but:
1) I don't know how to "rescale" it along both x and y axes.
2) The updated profile is not smooth (see next image) and that reflects on the curvature measurement in the following steps. I could extract the fitting law but I should still tackle the issue (1).

Thanks.
2 Comments
DGM
on 11 Jul 2022
How exactly is the plot being generated? If it's already a raster process, why not generate the working "image" in the workspace to begin with? Is that possible?
I generally suggest to consider figures as tools for visualization only, and to avoid using them as composition tools -- but I'm not sure if your case is one where it's easy to do that.
MarzioDG
on 12 Jul 2022
Answers (0)
Categories
Find more on Data Exploration 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!