Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update volumeslices - docs #1123

Merged
merged 2 commits into from
Jul 15, 2021
Merged

Update volumeslices - docs #1123

merged 2 commits into from
Jul 15, 2021

Conversation

t-bltg
Copy link
Collaborator

@t-bltg t-bltg commented Jul 14, 2021

vol-slices

@SimonDanisch SimonDanisch requested review from jkrumbiegel and removed request for jkrumbiegel July 14, 2021 17:34
@SimonDanisch
Copy link
Member

Cool, thank you! :)
This was just a random recipe that I added at some point, but I guess it's a useful enough for us to maintain it :)

image
This actually looks wrong - those circles should line up...

@t-bltg
Copy link
Collaborator Author

t-bltg commented Jul 14, 2021

This was just a random recipe that I added at some point, but I guess it's a useful enough for us to maintain it :)

I think this is pretty useful for visualizing volumetric data :)

This actually looks wrong - those circles should line up...

x = LinRange(0, π, 50)
y = LinRange(0, 2π, 100)
z = LinRange(0, 3π, 150)
vol = [cos(X)*sin(Y)*sin(Z) for X  x, Y  y, Z  z]

That does seem right to me, doesn't it ?

@SimonDanisch
Copy link
Member

The input isn't wrong, the planes are flipped ;)

@t-bltg
Copy link
Collaborator Author

t-bltg commented Jul 14, 2021

The input isn't wrong, the planes are flipped ;)

That still looks right to me, compared to:

using GLMakie

main() = begin
  fig = Figure(); axes = [Axis(fig[i, 1]) for i  1:3]

  x = LinRange(0, π, 50)
  y = LinRange(0, 2π, 100)
  z = LinRange(0, 3π, 150)
  v = [cos(X)*sin(Y)*sin(Z) for X  x, Y  y, Z  z]

  ax = axes[1, 1]
  heatmap!(ax, y, z, v[length(x)÷2, :, :])
  ax.aspect = DataAspect()
  ax.title = "yz plane - x axis"
  ax.xlabel = "y"
  ax.ylabel = "z"
  ax = axes[2, 1]
  heatmap!(ax, x, z, v[:, length(y)÷2, :])
  ax.aspect = DataAspect()
  ax.title = "xz plane - y axis"
  ax.xlabel = "x"
  ax.ylabel = "z"
  ax = axes[3, 1]
  heatmap!(ax, x, y, v[:, :, length(z)÷2])
  ax.aspect = DataAspect()
  ax.title = "xy plane - z axis"
  ax.xlabel = "x"
  ax.ylabel = "y"

  save("heatmap.png", fig)
  return
end

main()

heatmap

With show_axis=true:
volslices

@SimonDanisch
Copy link
Member

Where the planes meet, they need to go through the same points in the volume, so they need to have have the same color where they meet... That's quite clearly not happening:
image
That happens either because they're flipped, or because the colorrange is different, so the color gets mapped differently.
The colorrange should actually be global and passed to the heatmap calls, and default to extrema(volume).

@SimonDanisch
Copy link
Member

SimonDanisch commented Jul 14, 2021

This looks correct:
image
So I guess it's the xy plane that's wrong

@t-bltg
Copy link
Collaborator Author

t-bltg commented Jul 14, 2021

Where the planes meet, they need to go through the same points in the volume, so they need to have have the same color where they meet... That's quite clearly not happening

It depends on the location though:
ss-1

🤔

@t-bltg
Copy link
Collaborator Author

t-bltg commented Jul 14, 2021

This looks correct:
image
So I guess it's the xy plane that's wrong

That seems to fix the issue hattributes[:colorrange] = plot[:colorrange][].

@SimonDanisch
Copy link
Member

Yeah been there ;) these cos/sin plots are full of symmetries, so there are lots of configurations where they look correct even when wrong!

@t-bltg
Copy link
Collaborator Author

t-bltg commented Jul 14, 2021

Yeah been there ;) these cos/sin plots are full of symmetries, so there are lots of configurations where they look correct even when wrong!

Harmonic functions are really useful though 😉

@t-bltg
Copy link
Collaborator Author

t-bltg commented Jul 14, 2021

New output:

sl

@SimonDanisch SimonDanisch merged commit 8db13e6 into MakieOrg:master Jul 15, 2021
@t-bltg t-bltg deleted the vol_sl branch July 15, 2021 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants