-
Notifications
You must be signed in to change notification settings - Fork 7
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
Support metadata for .zarr
converted from .nd2
using bioformats2raw
conversion
#272
base: main
Are you sure you want to change the base?
Conversation
.zarr
converted from .nd2
using bioformats2raw
conversion.zarr
converted from .nd2
using bioformats2raw
conversion
I'm noticing some OMERO-related issues. Might also be related to #270. |
I'm trying to understand the changes to the metadata models, but the file in OP has been removed. @talonchandler can you point me to an example? |
Pardon me! Here's a test. Thank you @ziw-liu.
|
@@ -166,7 +166,7 @@ class TimeAxisMeta(NamedAxisMeta): | |||
"zettasecond", | |||
] | |||
| None | |||
) | |||
) = None |
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.
Is there an example where not having this change causes a validation error?
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.
Does Pydantic error when an optional field is not present (instead of having the value null
in JSON)?
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.
Yes. Without this change:
iohub info /hpc/projects/virtual_staining/datasets/shiau-lab/Examples_Tests_Talon/2025-02-15-93a-4dpf-test/250215_93a_4dpf_em2_sib_2048_002.zarr/0
gives
WARNING:iohub.ngff.nodes:Zarr group at does not have valid metadata for <class 'iohub.ngff.nodes.Position'>
Traceback (most recent call last):
File "/home/talon.chandler/.conda/envs/iohub-dev/bin/iohub", line 8, in <module>
sys.exit(cli())
File "/home/talon.chandler/.conda/envs/iohub-dev/lib/python3.10/site-packages/click/core.py", line 1161, in __call__
return self.main(*args, **kwargs)
File "/home/talon.chandler/.conda/envs/iohub-dev/lib/python3.10/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
File "/home/talon.chandler/.conda/envs/iohub-dev/lib/python3.10/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/talon.chandler/.conda/envs/iohub-dev/lib/python3.10/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/talon.chandler/.conda/envs/iohub-dev/lib/python3.10/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
File "/home/talon.chandler/iohub/iohub/cli/cli.py", line 50, in info
print_info(file, verbose=verbose)
File "/home/talon.chandler/iohub/iohub/reader.py", line 213, in print_info
ch_msg = f"Channel names:\t\t {reader.channel_names}"
File "/home/talon.chandler/iohub/iohub/ngff/nodes.py", line 142, in channel_names
return self._channel_names
AttributeError: 'Position' object has no attribute '_channel_names'. Did you mean: 'channel_names'?
After the change. The same call prints
Reading file: /hpc/projects/virtual_staining/datasets/shiau-lab/Examples_Tests_Talon/2025-02-15-93a-4dpf-test/250215_93a_4dpf_em2_sib_2048_002.zarr/0
Zarr hierarchy:
/
├── 0 (10, 3, 66, 2048, 2048) >u2
├── 1 (10, 3, 66, 1024, 1024) >u2
├── 2 (10, 3, 66, 512, 512) >u2
└── 3 (10, 3, 66, 256, 256) >u2
=== Summary ===
Format: omezarr v0.4
Axes: t (time); c (channel); z (space); y (space); x (space);
Channel names: ['DIA', 'GFP', 'RFP']
(Z, Y, X) scale (um): (1.0, 0.157177107973598, 0.157177107973598)
Chunk size: (1, 1, 1, 1024, 1024)
No. bytes decompressed: 16609443840 [15.5 GiB]
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.
So removing these causes the node to not parse the metadata, but I wonder if that is a logic bug like #270 instead of a schema modeling bug.
This PR contains minor spec-mismatch bug fixes to enable
iohub info
to work with.zarr
files converted from.nd2
usingbioformats2raw
conversion tool.For example:
prints
Note:
bioformats2raw
seems to create single positions stacked one layer deeper than our typical single positions, so I calliohub info
on.zarr/0
.Note: @ziw-liu @mattersoflight I'm tagging you here to keep you in the loop. I'll plan to request your review after we've completed a phase reconstruction during the week of March 3.