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

Why can't I read my czi file? PixelType( Bgra32 ): numberOfSamples: Pixel Type unsupported by libCZI #123

Open
zerosky010 opened this issue Sep 28, 2024 · 2 comments

Comments

@zerosky010
Copy link

zerosky010 commented Sep 28, 2024

System and Software

  • aicspylibczi Version: 3.2.0
  • Python Version:3.10
  • Operating System: Windows

Description

A clear description of the bug
I'm just starting to learn about czi file handling.
However, when I am running a demo script ,


        filepath='sample.czi'
        import numpy as np
        from aicspylibczi import CziFile
        from pathlib import Path
        import matplotlib.pyplot as plt
        pth = Path('sample.czi')
        czi = CziFile(pth)

It turns out:

Traceback (most recent call last)
        Cell In[13], line 8
                  5 import matplotlib.pyplot as plt
                  7 pth = Path('sample.czi')
         ----> 8 czi = CziFile(pth)
                  10 # Get the shape of the data, the coordinate pairs are (start index, size)
                  11 dimensions = czi.get_dims_shape()  # [{'X': (0, 1900), 'Y': (0, 1300), 'Z': (0, 60), 'C': (0, 4), 'S': (0, 40), 'B': (0, 1)}]
        
        File e:\\anaconda3\\envs\apari-env\\lib\\site-packages\\aicspylibczi\\CziFile.py:63, in CziFile.__init__(self, czi_filename, verbose)
                  60 import _aicspylibczi
                  62 self.czilib = _aicspylibczi
          ---> 63 self.reader = self.czilib.Reader(self._bytes)
                  65 self.meta_root = None
        
        PylibCZI_PixelTypeException: PixelType( Bgra32 ): numberOfSamples: Pixel Type unsupported by libCZI."

How can I fix this problem? Or how to convert the format?

@heeler
Copy link
Member

heeler commented Sep 30, 2024

From the message I believe it's a lack of support in the libczi library that Zeiss released. I'll look at the code to double check later. If you're looking to gain familiarity with image reading I'd suggest looking at bioio and download a czi image from the test resources in the aicspylibczi repository.
Hope that helps.

@zerosky010
Copy link
Author

Thank you for your suggestion! I’ll focus on learning bioio to get familiar with image reading. I really appreciate your help!

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