Skip to content

Commit

Permalink
fix: make igneous view work with matrix, tigerdata
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Jul 10, 2024
1 parent da3ebb5 commit 5f9f18f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions igneous_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

import click
from cloudvolume import CloudVolume, Bbox
from cloudvolume.lib import max2
from cloudvolume.lib import max2, jsonify
import cloudvolume.paths

from cloudfiles import CloudFiles
import cloudfiles.paths
import numpy as np
Expand Down Expand Up @@ -1610,6 +1612,9 @@ def view(path, browser, port, ng):
if cv.meta.path.protocol == "file":
cloudpath = f"http://localhost:{port}"
layer_name = "igneous"
elif cv.meta.path.protocol in ['matrix', 'tigerdata']:
cloudpath = cloudvolume.paths.to_https_protocol(cv.cloudpath)
layer_name = posixpath.basename(cloudpath)
else:
cloudpath = cv.cloudpath
layer_name = posixpath.basename(cloudpath)
Expand Down Expand Up @@ -1656,7 +1661,7 @@ def view(path, browser, port, ng):
if cv.num_channels == 3:
config["layers"][0]["shader"] = rgb_shader

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

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

0 comments on commit 5f9f18f

Please sign in to comment.