-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the ome.zarr example creation
- Loading branch information
1 parent
158c941
commit 301482b
Showing
3 changed files
with
197 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import argparse | ||
import os | ||
from glob import glob | ||
|
||
import napari | ||
import zarr | ||
|
||
|
||
def check_example(ff): | ||
fname = os.path.split(ff)[1] | ||
print("Checking", fname) | ||
if fname.startswith('flat'): | ||
store = zarr.storage.DirectoryStore(ff) | ||
else: | ||
store = zarr.storage.NestedDirectoryStore(ff) | ||
|
||
with zarr.open(store, mode='r') as f: | ||
data = f['s0'][:] | ||
print(data.shape) | ||
|
||
with napari.gui_qt(): | ||
v = napari.Viewer() | ||
v.title = fname | ||
v.add_image(data) | ||
|
||
|
||
def check_examples(folder): | ||
files = glob(os.path.join(folder, '*.ome.zarr')) | ||
for ff in files: | ||
check_example(ff) | ||
|
||
|
||
if __name__ == '__main__': | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument('folder') | ||
args = parser.parse_args() | ||
check_examples(args.folder) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters