This repository was archived by the owner on Nov 17, 2025. It is now read-only.
Description Use Case
I thought to open this issue to discuss. napari-aicsimageio does not support open folder right now. It would be good if it supported it.
Solution
Here is a possible implementation. Some notes:
I am using AICSImage. As I understand it, napari-aicsimageio now uses the raw reader data.
I am using the dask interface.
I am saving the filenames in the meta data. This is useful for my plugins.
The metadata aicsimage is still aicsimage and not aicsimages. Again, I like standardization. But in this case, it is returning a list of images.
def load_image_stacks_to_viewer (viewer :napari .Viewer , filenames :list [Path ])-> None :
"""Loads image stack"""
# Stopping condition
if len (filenames )== 0 :
return None
# Load images
images :list [AICSImage ] = []
for filename in filenames :
image = AICSImage (filename )
images .append (image )
# Stopping condition - Check sizes
reference_image_size = images [0 ].shape
is_all_same_size = all ([np .all (image .shape == reference_image_size ) for image in images ])
if not is_all_same_size :
show_message_box (viewer .window ,
message = "Stack cannot be compiled. All images need to be of the same size." ,
title = 'Load Images as Stack' )
return
# Stack images
data = [image .dask_data for image in images ]
image_stack = da .concatenate (data , axis = 2 )
image_layer = viewer .add_image (image_stack , name = filenames [0 ].stem )
image_layer .metadata ['aicsimage' ] = images
image_layer .metadata ['filename' ] = filenames
viewer .reset_view ()
Alternatives
Load images seperatly.
Combine them to stack
Reactions are currently unavailable
Use Case
I thought to open this issue to discuss. napari-aicsimageio does not support open folder right now. It would be good if it supported it.
Solution
Here is a possible implementation. Some notes:
aicsimageis stillaicsimageand notaicsimages. Again, I like standardization. But in this case, it is returning a list of images.Alternatives