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

czi number of channels can be out of sync and is reported as error #532

Closed
toloudis opened this issue Sep 18, 2023 · 2 comments · Fixed by #546
Closed

czi number of channels can be out of sync and is reported as error #532

toloudis opened this issue Sep 18, 2023 · 2 comments · Fixed by #546
Labels
bug Something isn't working

Comments

@toloudis
Copy link
Collaborator

Description

Suraj says: Hi. I'm trying to read some czi files using aicsimageio but getting a conflicting sizes for dimension 'C' error while reading (fiji can read these files). Here is the error:

ValueError: conflicting sizes for dimension 'C': length 1 on the data but length 4 on coordinate 'C'

The file contains metadata for 4 channels but the actual array data only consists of 1 channel according to Fiji/Bioformats.

Expected Behavior

I expect the file to load one channel. Perhaps a warning would be acceptable? It should not crash or raise exception - even if exception is caught, user has basically no recourse.

Our code is capturing this as an error but it seems like we should be more lenient and just use what is found in the data. If the data had more channels than the metadata, then we might consider that an error (missing channel names in metadata) but the opposite case seems to be ok.

Reproduction

'/allen/aics/assay-dev/computational/data/4DN_handoff_CTFC/structure_deconvolution/3500004565_100X_ZSD1_20210615-Scene-16-P16-G02_structure_deconvolution.czi'

@toloudis toloudis added the bug Something isn't working label Sep 26, 2023
@SeanLeRoy
Copy link
Collaborator

@toloudis I'm confused about this part of what you said:

If the data had more channels than the metadata, then we might consider that an error (missing channel names in metadata) but the opposite case seems to be ok.

Would it not be more alarming to have missing data when we "should" have more based on the metadata as opposed to having missing metadata when we "should" have more based on the data?

@toloudis
Copy link
Collaborator Author

toloudis commented Nov 20, 2023

Here's what I was trying to say:

  1. If there is more true data channels than metadata, then the metadata will be missing information about those data. (Do we report the file as having fewer channels, then? Or is this a major error?)
  2. (This issue) If there is more metadata channels than actual data, then at least we can load all the existing data channels and know that they all have metadata. In this scenario, we can report that the metadata has extra info but at least it's a superset of the true pixels in the file. We should be able to load this without crashing -- as long as the arrays are complete and not cut off due to some i/o error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants