-
Notifications
You must be signed in to change notification settings - Fork 4
Add visualization module with vizarr and VolumeViewer integration #53
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: akhanf <11492701+akhanf@users.noreply.github.com>
Co-authored-by: akhanf <11492701+akhanf@users.noreply.github.com>
|
@copilot I got this error: Error: server replied with "URL constructor: /tmp/zarrnii_viz_macnajjy/temp_data.ome.zarr is not a valid URL." when loading the resource tried loading the test ome zarr dataset |
Co-authored-by: akhanf <11492701+akhanf@users.noreply.github.com>
Fixed the URL constructor error! The issue was that vizarr's JavaScript frontend expects proper URLs, but we were passing raw file paths like I've updated the visualization module to convert file paths to The fix is in commit 1c3e9af. |
|
@copilot : can you also add avivator as another mode? see https://github.com/hms-dbmi/viv/blob/main/sites/docs/tutorial/README.md |
Co-authored-by: akhanf <11492701+akhanf@users.noreply.github.com>
Added avivator mode! You can now use Features:
Usage: # Open in Avivator web viewer
url = znimg.visualize(mode="avivator")
# Cleanup when done
zarrnii.stop_servers()The implementation is in commit 7e8c1fd and includes comprehensive tests and documentation. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot was having trouble with avivator, but made a change for fixing relative path (chdir wasn't doing it), and then changed to a different web app, volumeviewer (vol-e).. to clean up, remove the html mode entirely, rename avivator to vol, and make it the default |
Co-authored-by: akhanf <11492701+akhanf@users.noreply.github.com>
Made all the requested changes! Completed:
New simplified API: # Default (VolumeViewer)
url = znimg.visualize()
# Explicit modes
url = znimg.visualize(mode="vol") # VolumeViewer
widget = znimg.visualize(mode="widget") # JupyterThe system now has two clean modes: "vol" for web viewing (default) and "widget" for Jupyter, with VolumeViewer providing the web visualization. All tests passing. Changes in commit 4e9b2a1. |
Issue Fixed:
The visualization module was passing local file paths directly to vizarr, which caused a JavaScript error: "URL constructor: /tmp/zarrnii_viz_*/temp_data.ome.zarr is not a valid URL." when the widget was rendered in the browser.
Root Cause:
Vizarr's JavaScript frontend tries to parse the source path as a URL, but raw file system paths like
/tmp/...are not valid URLs and cause the URL constructor to fail.Solution:
Modified
_create_widget()function inzarrnii/visualization.pyto convert file paths to properfile://URLs usingPath.absolute().as_uri()before passing them to vizarr.VolumeViewer Integration:
Added a new
volvisualization mode that integrates with the VolumeViewer web application at http://volumeviewer.allencell.org. This mode:zarrnii.stop_servers()functionMajor Changes:
zarrnii/visualization.pyto usefile://URLs for vizarr widget mode_launch_volumeviewer()function with HTTP server and CORS supportstop_servers()cleanup function for server managementvolmode the default -znimg.visualize()now opens VolumeViewer by defaultStreamlined Usage:
Testing:
file://URL format in widget stateThe visualization functionality now works correctly without URL constructor errors and provides a clean, streamlined API with VolumeViewer as the default web-based visualization option and vizarr widgets for Jupyter notebook users.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.