Issue with output = czi.read_image(S=0, C=0)
sebi06 opened this issue · 7 comments
Hi all,
when I try to read a multi-scene CZI (BGR) file using output = czi.read_image(S=0, C=0)
I run into the following issue below. But I struggle to make sense of this error message, because I did specify the channel. What is my mistake?
Traceback (most recent call last):
File "c:\Users\m1srh\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_vars.py", line 416, in evaluate_expression
compiled = compile(_expression_to_evaluate(expression), '<string>', 'eval')
File "<string>", line 1
output = czi.read_image(S=0, C=0)
^
SyntaxError: invalid syntax
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\ProgramData\Anaconda3\envs\imageanalysis\lib\site-packages\aicspylibczi\CziFile.py", line 363, in read_image
image, shape = self.reader.read_selected(plane_constraints, m_index)
_aicspylibczi.PylibCZI_ImageAccessUnderspecifiedException: Dimensions underspecified, given 0 dimensions but 1 needed!
In a multi-channel BGR image C must be explicitly specified. This is to avoid confusion between BGR expanded channels.
Surprisingle the following command did work:
output = czi.read_image(S=0, M=20, C=0)
Hi @sebi06, Thanks for pointing this out.
I think this is the same issue as AllenCellModeling/aicsimageio#141
Why adding M to the dims makes it work is a little unclear to me but I'll look into it today.
Hopefully, this should be addressed by the PR I just merged and the PR that's in progress right now. I will push a new version once the latest PR is merged. I'll try to reproduce this although we don't have many BGR images.
If I can I'll add it as a test so that we know we have this sorted.
Thanks again.
Let me know what kind of test data sets with what dimensions you need. I can simulate more or less any Zeiss mic on my machine and acquire testimages.
Maybe we should consider creating a collection of test images on your side?
Maybe we should consider creating a collection of test images on your side?
We have an s3 bucket, I believe, with test images for aicsimageio. It would be interesting to try to expand that with more diverse test cases, without making the tests take forever to run!
Totally agree that we should add more varied test files to our resources. Unfortunately we are going to have to start really slimming our resources down because even the GitHub actions runners only have 14GB of hard drive space during each run. We aren't near this limit but something to keep in mind as we add more and more is both the download time from s3 + the actual amount.
Please try out 2.7.1 It incorporates the fixes to this issue.