Skip to content

Commit

Permalink
feat: use alternative codec neuroglancer when special codecs are used
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Nov 8, 2024
1 parent 54474d0 commit 94166bb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion igneous_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,7 @@ def memory_used(data_width, shape, factor):
@click.argument("path", type=CloudPath())
@click.option('--browser/--no-browser', default=True, is_flag=True, help="Open the dataset in the system's default web browser.")
@click.option('--port', default=1337, help="localhost server port for the file server.", show_default=True)
@click.option('--ng', default="https://neuroglancer-demo.appspot.com/", help="Alternative Neuroglancer webpage to use.", show_default=True)
@click.option('--ng', default=None, help="Alternative Neuroglancer webpage to use.", show_default=True)
def view(path, browser, port, ng):
"""
Open an on-disk dataset for viewing in neuroglancer.
Expand Down Expand Up @@ -1684,6 +1684,17 @@ def view(path, browser, port, ng):
config["layers"][0]["shader"] = rgb_shader

fragment = urllib.parse.quote(jsonify(config))

has_alternative_codec = any([
scale["encoding"] in ["crackle", "zfpc", "kempressed", "fpzip"]
for scale in cv.scales
])

if ng is None:
if has_alternative_codec:
ng = "https://allcodecs-dot-neuromancer-seung-import.appspot.com/"
else:
ng = "https://neuroglancer-demo.appspot.com/"

url = f"{ng}#!{fragment}"
if browser:
Expand Down

0 comments on commit 94166bb

Please sign in to comment.