I am working inside a Pluto notebook with WGLMakie and I have 3D volumes that I scrolling through using a PlutoUI.Slider
and heatmap(volume[:, :, b])
where b
is a Slider element. I have a label (segmentation) that I want to overlay on the heatmap in the form of an array of cartesian coordinates. I got this to work with Plots.jl but it looks really strange when I translate to Makie. Any changes that you see to make this more visually appealing?
Working Plots.jl version
# Cell 1
zs_l = unique(label_arr[:,3]);
# Cell 2
indices_l = findall(x -> x == zs_l[q], label_arr[:,3])
# Cell 3
@bind q Slider(1:length(zs_l), default=10, show_value=true)
# Cell 4
begin
plt_lbl = scatter(label_arr[:,1][indices_l], label_arr[:,2][indices_l], color="blue", alpha=0.9, markersize=1)
heatmap!(plt_lbl, (img_array[:,:,zs_l[q]]), size=(5000, 5000), alpha=0.5, color=:grays)
end
Makie version:
# Cell 1
begin
sc, layout = layoutscene(resolution = (1200, 1200))
sc
end
# Cell 2
heatmap!(sc, (img_array[:,:,zs_l[q]]), colormap=:grays)
# Cell 3
scatter!(sc, label_arr[:,1][indices_l], label_arr[:,2][indices_l])