-
Notifications
You must be signed in to change notification settings - Fork 18
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
Ome zarr v0.3 tweaks #104
Ome zarr v0.3 tweaks #104
Conversation
@will-moore - merged #105 |
ed0106e
to
5ca7b07
Compare
Thanks for this PR! @will-moore - is this ready for review? |
Yes, I think it's ready for a look. I was hoping to prepare some v0.3 test data and get it public but I ran out of time and now I'm on holidays for 2-3 weeks, so you might want to wait a bit. |
Great! Enjoy the well deserved holiday 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Just a few comments about organization. In general, I'd prefer that all parsing of axes
for OME-data lives in ome.ts
. Curious to hear your thoughts.
src/io.ts
Outdated
@@ -121,6 +110,9 @@ export async function createSourceData(config: ImageLayerConfig): Promise<Source | |||
|
|||
if (node instanceof ZarrGroup) { | |||
const attrs = (await node.attrs.asObject()) as Ome.Attrs; | |||
if ('multiscales' in attrs && attrs.multiscales?.[0]?.axes) { | |||
config.axis_labels = attrs.multiscales?.[0]?.axes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what I think about overriding config.axis_labels
here. I think we can just inspect the multiscales
metadata in loadOmeroMultiscales
and derive the axis labels for well and plate from the representative image with multiscales
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved this to ome.ts
in 8ed9c89 but this doesn't handle the case when we have axes
data but no omero
data (so loadOmeroMultiscales()
is not called). E.g. sample data at https://oc.embl.de/index.php/s/KLTaSgX1c4zgnHP
Don't know if data with axes
should be handled by ome.ts
too?
@will-moore can you rebase on git switch main
git pull # pull down latest changes
git switch ome_zarr_v0.3_tweaks
git rebase main # should just auto rebase
npm install # install latest dependencies
git push --force # need to force push to github |
caaa02a
to
8ed9c89
Compare
I'm seeing an intermittent failure e.g. https://deploy-preview-104--vizarr.netlify.app/?source=https://minio-dev.openmicroscopy.org/idr/v0.3/idr0062-blin-nuclearsegmentation/6001240.zarr/ Sometimes this works: But even with a refresh, it can fail: |
Having a look now. I can't seem to reproduce locally with |
067cb48
to
8ed9c89
Compare
Thanks @manzt. I'm only seeing that error with the netlify preview, so maybe we can ignore or workaround for now. Just didn't want all the broken links above to be a blocker. The main question that I have now is where to handle the I guess I'm saying that we don't need |
Ah, sorry @will-moore. I got lost in trying to debug the apparent netlify issue and missed your question in the comments. I think what you have proposed sounds reasonable. I took a stab a cleaning things up a bit. Let me know what you think about the latest commit. Happy to revert if you have something else in mind. |
axis_labels = getAxisLabelsFromMultiscales(attrs); | ||
if (!config.axis_labels) { | ||
// Update config axis_labels if present in multiscales | ||
config.axis_labels = attrs.multiscales[0].axes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd rather just be explicit here for this edge case, rather than adding a util that might return undefined.
96a9271
to
b299226
Compare
@@ -24,18 +25,6 @@ import { | |||
RGB, | |||
} from './utils'; | |||
|
|||
function getAxisLabels(arr: ZarrArray, axis_labels?: string[], channel_axis?: number) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I think channel_axis
got lost when moving this to src/utils.ts
. This is important for images without any dimension labels, as you can tell vizarr
to separate out the channels in that dim like in napari.
b299226
to
f31a77e
Compare
f31a77e
to
7de86be
Compare
That looks great, thanks. Tested with the v0.3 links above and various v0.1 examples from the blog, as well as v0.3 data (without I also tried removing the So I'll look at fixing that... |
That commit uses labels.indexOf('c') to pick channel_axis for non |
Wonderful. I just tried it out! Going to go ahead and merge, thanks so much for working on this @will-moore. cc: @joshmoore |
See #103
Use the
axes
data for dimension names and don't assume data is 5D.This PR build is deployed at https://deploy-preview-104--vizarr.netlify.app/
These currently all working except 2D example: