GLMakie - Question about extracting 3D data

Hello! Need an assistance from GLMakie experts. I have a 3D data as x, y and z coordinates that is render as a 2D image. I want to extract the 3D data by drawing a line profile around and then render that as a color coded 3D representation. Is there any way to do that using GLMakie? Thanks

I don’t really understand the question :slight_smile: do you have a visual example?


Hi, yes check this attached figure. Here I want to extract the data from this red colored region (RoI).

You can get the colorbuffer like this:

fig, ax, pl = .... # your plotting code

array_of_colors = colorbuffer(fig)

and then extract the pixels out of that!

I didn’t understand if you have the data only as a rendered image/file or if you are creating the plot first in your code and then want to extract the pixels in a specific region from it.

In the first case, you probably need some way of reading the image first to arrive at the individual pixels. Not sure that Makie can do that (but I’m also not a Makie expert).

In the second case, nevermind me :slight_smile: