Skip to content
Discussion options

You must be logged in to vote

That should be fairly easy. The only thing decode expects is a torch Tensor of size N x H x W. If you want a memory map, it could be a bit more advanced (i.e. if the whole framestack does not fit into RAM at once).

E.g. this is the relevant line for the tiff file:

im = tifffile.imread(str(p), multifile=multifile)
frames = torch.from_numpy(im.astype('float32'))

Without trying a drafty implementation could be

from pims import ND2_Reader

def load_nd2(file):
   frames = ND2_Reader(file)
   return torch.from_numpy(frames[:])  # maybe some datatype conversion necessary

Replies: 3 comments 10 replies

Comment options

You must be logged in to vote
7 replies
@cleterrier
Comment options

@Haydnspass
Comment options

@Haydnspass
Comment options

@cleterrier
Comment options

@Haydnspass
Comment options

Answer selected by cleterrier
Comment options

You must be logged in to vote
1 reply
@cleterrier
Comment options

Comment options

You must be logged in to vote
2 replies
@cleterrier
Comment options

@christian-7
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants