# GLMakie - Question about extracting 3D data

**URL:** https://discourse.julialang.org/t/glmakie-question-about-extracting-3d-data/106504
**Category:** Visualization
**Tags:** makie
**Created:** [November 21, 2023, 3:33am UTC](https://discourse.julialang.org/t/glmakie-question-about-extracting-3d-data/106504 "2023-11-21T03:33:21Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![sajjad\_khan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sajjad_khan/32/45202_2.png) [@sajjad\_khan](https://discourse.julialang.org/u/sajjad_khan)
#### Post date: [November 21, 2023, 3:33am UTC](https://discourse.julialang.org/t/glmakie-question-about-extracting-3d-data/106504/1 "2023-11-21T03:33:21Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [November 21, 2023, 6:10am UTC](https://discourse.julialang.org/t/glmakie-question-about-extracting-3d-data/106504/2 "2023-11-21T06:10:10Z")

</div>

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

---

<div class="post-metadata">

### Author: ![sajjad\_khan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sajjad_khan/32/45202_2.png) [@sajjad\_khan](https://discourse.julialang.org/u/sajjad_khan)
#### Post date: [November 21, 2023, 6:27am UTC](https://discourse.julialang.org/t/glmakie-question-about-extracting-3d-data/106504/3 "2023-11-21T06:27:18Z")

</div>

![Screen Shot 2023-11-20 at 11.23.06 PM](https://global.discourse-cdn.com/julialang/original/3X/d/7/d757dc9166fd63876859491d869ff0739126d26d.jpeg)  
Hi, yes check this attached figure. Here I want to extract the data from this red colored region (RoI).

---

<div class="post-metadata">

### Author: ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)
#### Post date: [November 21, 2023, 9:39am UTC](https://discourse.julialang.org/t/glmakie-question-about-extracting-3d-data/106504/4 "2023-11-21T09:39:26Z")

</div>

You can get the colorbuffer like this:

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

array_of_colors = colorbuffer(fig)

```

and then extract the pixels out of that!

---

<div class="post-metadata">

### Author: ![Sevi](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@Sevi](https://discourse.julialang.org/u/Sevi)
#### Post date: [November 22, 2023, 11:18am UTC](https://discourse.julialang.org/t/glmakie-question-about-extracting-3d-data/106504/5 "2023-11-22T11:18:14Z")

</div>

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 🙂
