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 reader for loading input images #41

Open
sophiamaedler opened this issue Jul 16, 2024 · 2 comments
Open

CZI reader for loading input images #41

sophiamaedler opened this issue Jul 16, 2024 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@sophiamaedler
Copy link
Collaborator

CZI reader has issues when files with multiple z-stacks are supplied.

@sophiamaedler
Copy link
Collaborator Author

Code snippet from @nordmannth using an alternative CZI reader package that seems more robust in use:

from aicsimageio import AICSImage

selected_czi = “path_to_.czi”

image = AICSImage(selected_czi)
print(“Dimensions:“, image.dims)
print(“Shape:“, image.shape)
print(“Number of scenes:“, image.scenes)

#if you have multiple scenes, best to choose one now (available scenes are given as output above)
image.set_scene(‘ScanRegion0’)

# filter as needed, for example:
scene1 = image.get_image_data(“CYX”)

# Rearrange the channels if necessary
scene1 = scene1[[0, 3, 1], :, :]

@sophiamaedler
Copy link
Collaborator Author

As a workaround until this solution is implemented users can use the above code snipped to load the czi file to memory and then pass it to the SPARCS project using project.load_input_from_array(scene1). If doing so please ensure that the dtype of the image is uint16 as this is what is expected by sparcspy.

@sophiamaedler sophiamaedler added bug Something isn't working help wanted Extra attention is needed labels Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant