CAVEconnectome / nglui

https://caveconnectome.github.io/nglui/
MIT License
10 stars 4 forks source link

Issue with viewer default camera settings on mainline #48

Open bdpedigo opened 1 month ago

bdpedigo commented 1 month ago
from nglui import statebuilder

client = CAVEclient("minnie65_public", version=1078)

img_layer, seg_layer = statebuilder.helpers.from_client(client)

sb = statebuilder.StateBuilder(
    layers=[img_layer, seg_layer]
)

sb.render_state(return_as="html", target_site="mainline")

gives a view where the camera is very very zoomed out (note the 200m)

image

my hack has been setting

view_kws={"zoom_3d": 0.001, "zoom_image": 0.0000001}

but would be nice to have the viewer in a reasonable location by default for mainline

ceesem commented 3 weeks ago

This can happen if a resolution is not set directly or via a client. Unfortunately, even if you set an image and 3d zoom in Neuroglancer, if you don't set the resolution the zoom levels will be reset to bonkers values. I posted this as an issue over on Neuroglancer (https://github.com/google/neuroglancer/issues/635), so hopefully that behavior can be changed.