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

Neuroglancer metadata datatype #27

Open
sevaa opened this issue Aug 17, 2022 · 3 comments
Open

Neuroglancer metadata datatype #27

sevaa opened this issue Aug 17, 2022 · 3 comments

Comments

@sevaa
Copy link

sevaa commented Aug 17, 2022

Looks like the tomojs-generated Neuroglancer metadata strings contain their values as string formatted integers (as opposed to numbers), like this:

{"neuroglancerPrecomputedFloor":"31403", "neuroglancerPrecomputedLimit":"34295", "neuroglancerPrecomputedMax":"33467", "neuroglancerPrecomputedMin":"32252"}

May we have compatible metadata, please? No fractions, and stored as strings. Thank you.

@blowekamp
Copy link
Collaborator

Please provide a reproducible example ( a small sample file, and a command line), the version of pytools and python being used. Along with the actual output, and the desired output.

Version 1.0 produces float numeric types for the value of the JSON fields.

@philipmac
Copy link
Member

ATM the value is a float.
Am I correct in thinking @sevaa you would like that float val cast to an int, and then quoted as a string?

eg currently it's:

"metadata": {"neuroglancerPrecomputedMin": 87.22387927907181, "neuroglancerPrecomputedMax": 219.2030384667405, "neuroglancerPrecomputedFloor": 0.0, "neuroglancerPrecomputedLimit": 255.0

and you'd like:
"metadata": {"neuroglancerPrecomputedMin": "87", "neuroglancerPrecomputedMax": "219", "neuroglancerPrecomputedFloor": "0", "neuroglancerPrecomputedLimit": "255"
?

@sevaa
Copy link
Author

sevaa commented Aug 17, 2022

Yes, precisely.

Those min/max/floor/limit parameters are used as boundaries on pixel values, and our neuroglancer pyramids all have integer pixels. I've asked Bryan, he said the devices that they had didn't emit floating point MRCs, ergo, no floating point pixels in the neuroglancer chunks, either. In tomojs I had an explicit check for that, not sure about the current workflows. Round min/floor down, max/limit up.

The fact that integers were converted to strings for storage was a quirk of tomojs that is relatively easy to replicate. If absolutely necessary, I can accommodate the datatype variance.

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

3 participants