google / neuroglancer

WebGL-based viewer for volumetric data
Apache License 2.0
1.02k stars 283 forks source link

Show cross sections in 3-d when layout type is 3d #599

Open pedson opened 4 weeks ago

pedson commented 4 weeks ago

Is there a way for the default cross sections (toggle in panel layout by "Show cross sections in 3-d") to be enabled when the layout is "3d"?

I've seen the python example of adding custom cross sections to the layout. But afaict, if you do that, when users toggle back to four panel you get both your custom cross sections and the default ones if they enable Show cross sections in 3-d.

We can add the custom ones, turn of Show cross sections in 3-d, and just let it be on the users if they decide to turn the default ones and effectively and double up. But it would be nice to simply have a way for the existing toggle to work for that layout type.

jbms commented 3 weeks ago

The issue is that the default cross sections in the 4-panel and 2-panel views are exactly determined by what is shown on the screen --- i.e. the width and height of the cross section in the 3d view corresponds to the width and height of the cross-section panel. In the 3d-only view, there is no cross section panel and therefore the width and height of the cross section would need to be determined some other way. Additionally, the zoom level and orientation of the cross sections are also controlled via the cross section panels, and there would be no way to control that in the 3d-only view.

Certainly I imagine that reasonable solutions could be found for these issues, though.

I had the idea of adding a UI for configuring additional cross sections to the same menu that opens up when you hover over "x y z" at the top left of the 3d panel, but I haven't had a chance to implement that.