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
I'd like to iterate over iterated axes of multiple .nd2 files as if they were one continuous flat iterable. I think the outcome would be something similar to ImageSequence from other readers.
Is this missing from this nd2 reader?
The following code illustrates the use-case, where I accumulate a list of ND2_reader objects. I later then iterate with nested for loops, but this feels silly and complicates merging external metadata, for example.
# List of files:
image_file_dir = "/run/media/steve/usb_msata/microscopy_images/"
image_filenames = (
"WellA1-A3.nd2",
"WellA4-A7.nd2",
"WellA8-A12.nd2",
"WellB1-C12.nd2",
"WellD1-E12.nd2",
"WellF1-H12.nd2"
)
files = []
for i in image_filenames:
image = ND2Reader_SDK(image_file_dir+i)
image.bundle_axes = ['x', 'y', 'z', 'c']
image.iter_axes = "m" # iterate over the scene/field of view axis which is 'm'
files.append(image)
As far as I can tell I'm unable to use any of the usual external array functions (concatenation, chaining, joining) to get to where I want because the objects provided by pims are incompatible (due to the lazy loading, I am guessing).
Disclaimer: I'm extremely new to pims and even python, so I'm likely to just be missing something super obvious. Apologies in advance if so.
The text was updated successfully, but these errors were encountered:
steveb-123
changed the title
Iterate/concantenate multiple .nd2 files
Iterate/concatenate multiple .nd2 files
Apr 21, 2022
I'd like to iterate over iterated axes of multiple .nd2 files as if they were one continuous flat iterable. I think the outcome would be something similar to ImageSequence from other readers.
Is this missing from this nd2 reader?
The following code illustrates the use-case, where I accumulate a list of ND2_reader objects. I later then iterate with nested
for
loops, but this feels silly and complicates merging external metadata, for example.One of
files
might look likeAs far as I can tell I'm unable to use any of the usual external array functions (concatenation, chaining, joining) to get to where I want because the objects provided by pims are incompatible (due to the lazy loading, I am guessing).
Disclaimer: I'm extremely new to
pims
and even python, so I'm likely to just be missing something super obvious. Apologies in advance if so.The text was updated successfully, but these errors were encountered: