You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thanks for working on this critical package. I understand and appreciate how complex opening proprietary binary file formats can be. I followed the package from aicsimageio to its new home at bioio and am excited to get this working!
Describe the Bug
I would like to open 'line scan' czi files using bioio. When I do this, some image data is missing, it does not include the correct number of frames(t). In both cases below, I get only one (1) frame whereas I expect 1000 and 10000 in my two example files (see below).
Background. Lines scans are where you perform, well, a line scan over and over. With something like 1000 or 10000 repeated scans of a line. You then make a 2D image of all the pixel data by constructing a 2D image where each line scan is one row in the image. What results is referred to as a kymograph or space/time image. For example, each line scan might be 1024 pixels and it is repeatedly acquired 1000 times. You then make a kymograph image from all the raw pixel data and it has a pixel size/shape of 1000 x 1024 (or visa-versa).
Problem is, when I open with bioio, I am only getting one line-scan, e.g. one frame(t), rather than the expected 1000 or 10000.
Expected Behavior
I would expect all the raw pixel data would be available and it is not. It seems to be missing frames(t), with 1 when I expect 1000 or 1000
Reproduction
Here are two sample files
CO2.czi with 512 pixels per line and 10000 repeated line scans.
Image 14.czi with 1024 pixels per line and 1000 repeated line scans.
In this example, bioio got the pixels per line correct (e.g. 1024) but there is no raw pixel data corresponding to the repeated line-scans. In all case frames(T) is just 1. I expect some dimension to represent the repeated line scans, e.g. 1000.
importosfrombioioimportBioImage#from aicspylibczi import CziFile # tried this too but same bug/behaviorpath='path/to/my/example/file/Image 14.czi'print(f'loading {os.path.split(path)[1]}')
img=BioImage(path)
print('img.data.shape:', img.data.shape) # (1, 2, 1, 1, 1024)print('=== xarray_data:')
print(img.xarray_data) # <xarray.DataArray (T: 1, C: 2, Z: 1, Y: 1, X: 1024)>print('dims:', img.dims) # <Dimensions [T: 1, C: 2, Z: 1, Y: 1, X: 1024]>print('dims.order:', img.dims.order) # TCZYXprint('dims.X:', img.dims.X) # 1024print('dims.Y:', img.dims.Y) # 1print('dims.T:', img.dims.T) # 1print('img.shape:', img.shape) # (1, 2, 1, 1, 1024)# returns the X dimension pixel size as found in the metadataprint('physical_pixel_sizes.X:', img.physical_pixel_sizes.X)
I also see another version of pylibczi coming directly from zeiss (no github) but can download source from PyPi pylibCZIrw. This has very recent updates (Dec 4, 2023). I am not able to install this because I haven't been able to build the wheels on a macOS machine with apple silicon (M2) CPU (afaik). The email contact there is [email protected].
Idea 2) I can open these czi files using Fiji/Bio-Formats importer and get all the pixel data
Fiji environment is
Fiji: 2.14.0/1.54f (2023-07-07)
Bio-Formats Plugins for ImageJ 7.0.1 (2023-10-16)
File image 14.czi
Each line (image) is (1024, 1)
Channels (c): 2
Slices(z): 1
Frames(t): 1000
physical pixel size: 0.066
manually saved as tif and openend with tifffile yields a good shape of (1000, 1, 1024)
File CO2.czi
Each line (image) is (512,1)
Channels (c): 2
Slices(z): 1
Frames(t): 10000
physical pixel size: 0.0175789
manually saved as tif and openend with tifffile yields a good shape of (10000, 1, 512)
Thank you for the thorough issue writeup!! And thanks for trying bioio so early. #30 has now been merged to main.
We'll look into this CZI issue but many people are on vacation soon so it may not be till 2024. Also we might want to move this ticket into bioio-czi since it may be specific to that reader.
Making a new czi reader to use pylibCZIrw is a longer project which we won't take on in the near term. More likely we can see if there are changes to aicspylibczi that would fix this.
First, thanks for working on this critical package. I understand and appreciate how complex opening proprietary binary file formats can be. I followed the package from aicsimageio to its new home at bioio and am excited to get this working!
Describe the Bug
I would like to open 'line scan' czi files using bioio. When I do this, some image data is missing, it does not include the correct number of frames(t). In both cases below, I get only one (1) frame whereas I expect 1000 and 10000 in my two example files (see below).
Background. Lines scans are where you perform, well, a line scan over and over. With something like 1000 or 10000 repeated scans of a line. You then make a 2D image of all the pixel data by constructing a 2D image where each line scan is one row in the image. What results is referred to as a kymograph or
space/time image
. For example, each line scan might be 1024 pixels and it is repeatedly acquired 1000 times. You then make a kymograph image from all the raw pixel data and it has a pixel size/shape of 1000 x 1024 (or visa-versa).Problem is, when I open with bioio, I am only getting one line-scan, e.g. one frame(t), rather than the expected 1000 or 10000.
Expected Behavior
I would expect all the raw pixel data would be available and it is not. It seems to be missing
frames(t)
, with 1 when I expect 1000 or 1000Reproduction
Here are two sample files
In this example, bioio got the pixels per line correct (e.g. 1024) but there is no raw pixel data corresponding to the repeated line-scans. In all case frames(T) is just 1. I expect some dimension to represent the repeated line scans, e.g. 1000.
Results in this output
Ideas
Idea 1) There are recent updates from Zeiss on a different/newer package called
pylibCZIrw
I see bioio is using aicspylibczi which is a fork of elhuhdron/pylibczi.
I also see another version of pylibczi coming directly from zeiss (no github) but can download source from PyPi pylibCZIrw. This has very recent updates (Dec 4, 2023). I am not able to install this because I haven't been able to build the wheels on a macOS machine with apple silicon (M2) CPU (afaik). The email contact there is
[email protected]
.Idea 2) I can open these czi files using
Fiji/Bio-Formats importer
and get all the pixel dataFiji environment is
File
image 14.czi
Each line (image) is (1024, 1)
Channels (c): 2
Slices(z): 1
Frames(t): 1000
physical pixel size: 0.066
manually saved as tif and openend with tifffile yields a good shape of (1000, 1, 1024)
File
CO2.czi
Each line (image) is (512,1)
Channels (c): 2
Slices(z): 1
Frames(t): 10000
physical pixel size: 0.0175789
manually saved as tif and openend with tifffile yields a good shape of (10000, 1, 512)
Environment
macOS 13.3.1 (a)
Python 3.11.5
bioio 1.0.1.dev2+gf594aa5
bioio-base 1.0.1.dev1+g1003511
bioio-czi 1.0.1.dev0+gcb2ed27.d20231212
p.s. I am actually using the bioio branch `fix/resolution-level from a recent issue and pull request.
The text was updated successfully, but these errors were encountered: