Skip to content
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

Only write supported unit names, especially avoid non UTF-8 characters #74

Closed
constantinpape opened this issue Feb 17, 2022 · 4 comments
Assignees

Comments

@constantinpape
Copy link
Collaborator

It would be good to only write unit names that are recommended in the v0.4 spec, see https://github.com/ome/ngff/blob/main/0.4/index.bs#L228-L229.

I understand that this is a bit tricky, since the unit names are read from the image metadata in Fiji, but we can add a dict with common translations and then throw a warning if no match is found.

It would be especially important to write micrometer instead of $\mu$m, to stick with simple string encoding; this otherwise might break implementations that only support utf-8.

(There might be an issue on this topic already, but I couldn't find it.)

@K-Meech
Copy link
Contributor

K-Meech commented Feb 17, 2022

I'll look into this - link this issue: mobie/mobie-viewer-fiji#583
How do you handle this in the python library? Do you only accept the specific 0.4 strings? Also, do you specify a certain unit to use for the whole project? At the moment, I don't constrain this at all, so the project could be all in nanometer, all in micrometer etc...

@constantinpape
Copy link
Collaborator Author

I'll look into this - link this issue: mobie/mobie-viewer-fiji#583

Thanks for linking the issue.

How do you handle this in the python library? Do you only accept the specific 0.4 strings?

Right now I am also not handling this at all in python, I made an issue to keep track of this: mobie/mobie-utils-python#41 and I will try to use functionality from ome-zarr-py / maybe contribute it myself.
(But the plan is to only allow units in the v0.4 spec.)

Also, do you specify a certain unit to use for the whole project? At the moment, I don't constrain this at all, so the project could be all in nanometer, all in micrometer etc...

Yes, I also do not constrain this right now. It would indeed be good to think about this, I am not sure what's the best approach right now...

@constantinpape
Copy link
Collaborator Author

I think this is implemented already, correct @K-Meech?

@K-Meech
Copy link
Contributor

K-Meech commented Mar 16, 2022

Yes - this is done already. If possible, it converts the unit to one of the approved OME-ZARR units.

@K-Meech K-Meech closed this as completed Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants