brainglobe / brainglobe-heatmap

Rendering anatomical heatmaps with brainrender and matplotlib
https://brainglobe.info
MIT License
34 stars 10 forks source link

Plane parameters specification #1

Closed FedeClaudi closed 2 years ago

FedeClaudi commented 2 years ago

Following on discussion from https://github.com/brainglobe/brainrender/pull/186#issuecomment-1016431053 cc @vigji

Currently, the 'slicing' is done by specifying for one plane:

Now, I think specifying the position of the plane as relative to the center of mass of the root is not very intuitive, perhaps expressing its coordinates as a point in the atlas' reference space is better. The norm is useful because you don't just need to have a plane at a given angle, you need to have a sense of orientation. E.g., if you are slicing through the midline sagittal plane, do you want to keep what's on the left or on the right of the plane? The norm encodes both angles and orientation in an efficient format. The downside for the norm is that it's not very intuitive: what's norm=(1, 1, 1) in angles?

I can think of three ways to specify the plane's position:

I think we should implement all three and let the user pick the one they prefer, it should be some simple geometry to go from one to the other. We should also have 2 useful features:

  1. a 'design' visualization in which the user can see the position of the planes in the brain, without slicing. This should show plane1 and plane2 clearly labelled and maybe the norm vectors as well.
  2. we should export plane metadata information in some easy to use format for records keeping for the users
vigji commented 2 years ago

I think that maybe @nickdelgrosso has gained some experience to offer here in terms of what users might find more intuitive as a slice parameterisation?

FedeClaudi commented 2 years ago

At least it will have a planner so that users can see where the planes are and how they intersect with the regions:

image

I still think that center + norm is the best. Especially since you have the named orientations which means that most of the times users won't even bother with the norm as they'll just use 'frontal'.

FedeClaudi commented 2 years ago

As mentioned yesterday, there's a planner functionality that shows the position of the planes and the norm vectors:

image

as well as how the main plane (blue) intersects with the meshes the user is interested in. The planner also provides some coordinates information: image

I think that this, together with a detailed explanation of how things work (the two planes to slice etc...) and what position/norm do would be enough. Without having to provide additional methods to specify the plane position (which most people won't care about because they'll use the named orientations).

If you're happy with this @vigji (and @adamltyson ), I'd leave it as is and focus on documenting/testing this thing before releasing it.

adamltyson commented 2 years ago

Looks great!