Closed frasercl closed 5 months ago
Most recent change modifies the API described above: url2
is gone; now multiple source URLs may be passed in as a comma-delimited list in url
, ideally sanitized with encodeURIComponent
. This seems to be the actual ideal way to encode multiple URLs in a single URL. We should make sure to be diligent in the future about using encodeURIComponent
in URL sharing dialogs or auto-updating URLs.
Review time: pretty quick (~20min)
Closes allen-cell-animated/volume-viewer#78: allow users to take advantage of volume-viewer's new ability to load zarrs from multiple data sources.
This PR makes the following breaking changes to the viewer API:
Viewer component: replace the
cellPath
,fovPath
, andbaseUrl
props withimageUrl
andparentImageUrl
.Like the props they replace,
imageUrl
andparentImageUrl
specify the paths from which to load image data. They correspond to the oldcellPath
andfovPath
props, respectively, in that they specify what CFE calls "single cell" and "full field" images. However, they are different from the old set of data-loading props in the following ways:baseUrl
gone, both URLs must be fully qualified. No more automatically picking two files out of a single parent directory.string[]
. When passed down to volume-viewer to get a loader, astring[]
will create a (zarr) loader which loads channels from multiple volumes. (NOTE: JSON loaders may also accept arrays of URLs, but will interpret each image as a different time point, not an additional source of channel data.)parentImageUrl
may beundefined
.CFE will have to be updated to use these new props.
Public app: remove
image
url parameter and addurl2
.image
, when present, behaved like thecellPath
tourl
'sbaseUrl
. This was basically never used, since it was just as easy to specify the full url inurl
. So now it's gone.In its place is
url2
, which adds a second zarr source (or JSON time step, I guess) to the loaded image. After some discussion about how we might support arbitrarily many source urls, we decided that just two sources would be good enough to support 95% of realistic use cases for this feature. (If anyone has any bright ideas about how to safely delimit a list of arbitrary URLs within another URL, let me know.)To test:
npm start