How to embed 2D slices of an array in a 3D plot using plot recipes?

plotting
#1

Given a 3D array, I would like to produce the following visualization:

The main problem I have is that I don’t know how to embed 2D slices in a 3D plot using plot recipes. Appreciate if you can help, or if you can provide an alternative solution.

0 Likes

#2

You can follow this “tutorial” for Makie:
https://nextjournal.com/ekinakyurek/fmri-visualization-with-julia
There is a bug in there right now, which I can try to fix today :wink:
I think it’s just that colornorm is wrong in heatmap, you can play around it yourself in this command:

heatmap!(
   hscene, axis2, axis2, volume[][indices...], colornorm = (0, 1)
)
1 Like

#3

Thank you @sdanisch, I am looking for a RecipesBase.jl, I should have been more specific, sorry. The visualization of the brain is awesome anyways!

Is it possible to write a recipe that consumes a 3D array and produces the slices as heatmaps?

0 Likes

#4

fair enough :wink: i was thinking to turn it into a makie recipe, but i guess thats also not what you want then :wink:

0 Likes

#5

A Makie recipe would be great as I plan to move Plots -> Makie at some point in the future when things are more stable and working. :+1:

0 Likes

#6

I’d use Makie for this. But AFAIK Makie doesn’t yet have a lightweight recipe format.

0 Likes

#7

It would be nice to keep in mind these embeddings of lower dimensional objects in a higher-dimensional space while designing the new recipes system :+1:

0 Likes