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

allow manually setting shape #192

Merged
merged 1 commit into from
Apr 5, 2023
Merged

allow manually setting shape #192

merged 1 commit into from
Apr 5, 2023

Conversation

kushalkolar
Copy link
Collaborator

@kushalkolar kushalkolar commented Apr 3, 2023

partly addresses #178

Allows manually setting the shape when using LazyTiff if known.

Example:

from mesmerize_core import *
from mesmerize_core.arrays import LazyTiff
from fastplotlib.widgets import ImageWidget

# set parent data path, load batch as `df`, etc.

def load_tiff(path):
  tif = tifffile.TiffFile(path)  # create tiff object

  # sometimes you can get the shape like this, but it varies depending on your filetyep
  # explore the structure of your tif to determine how to get the shape
  s = tif.series[0].levels[0].shape
  # return lazy tiff instance
  return LazyTiff(path, shape=s)

input_movie = df.iloc[0].caiman.get_input(load_tiff)

iw = ImageWidget(data=input_movie)
iw.show()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant