-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5cddf27
commit 208300c
Showing
7 changed files
with
109 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__pycache__/ |
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,28 @@ | ||
import os | ||
from data_conversion import convert_bdv_n5 | ||
|
||
|
||
# def convert_bdv_n5(in_path, out_path, use_nested_store, n_threads): | ||
# add the myosin prospr data | ||
def add_myosin(): | ||
in_path = os.path.join('/g/arendt/EM_6dpf_segmentation/platy-browser-data/data/0.6.3', | ||
'images/local/prospr-6dpf-1-whole-non-muscle-mhc.n5') | ||
convert_bdv_n5(in_path=in_path, | ||
out_path='platy.ome.zarr', | ||
out_key='prospr-myosin', | ||
use_nested_store=False, | ||
n_threads=4) | ||
|
||
|
||
# add the em raw data | ||
def add_raw(): | ||
pass | ||
|
||
|
||
# add the em cell segmentation | ||
def add_seg(): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
add_myosin() |
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 @@ | ||
from .to_ome_zarr import convert_bdv_n5 |
File renamed without changes.
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,69 @@ | ||
#!/usr/bin/env python | ||
|
||
# This assumes that n5-copy has already been used | ||
|
||
import argparse | ||
import zarr | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument("input") | ||
parser.add_argument("output") | ||
ns = parser.parse_args() | ||
|
||
zin = zarr.open(ns.input) | ||
|
||
sizes = [] | ||
|
||
def groups(z): | ||
rv = sorted(list(z.groups())) | ||
assert rv | ||
assert not list(z.arrays()) | ||
return rv | ||
|
||
def arrays(z): | ||
rv = sorted(list(z.arrays())) | ||
assert rv | ||
assert not list(z.groups()) | ||
return rv | ||
|
||
setups = groups(zin) | ||
assert len(setups) == 1 # TODO: multiple channels? | ||
for sname, setup in setups: | ||
timepoints = groups(setup) | ||
for tname, timepoint in timepoints: | ||
resolutions = arrays(timepoint) | ||
for idx, rtuple in enumerate(resolutions): | ||
rname, resolution = rtuple | ||
try: | ||
expected = sizes[idx] | ||
assert expected[0] == rname | ||
assert expected[1] == resolution.shape | ||
assert expected[2] == resolution.chunks | ||
assert expected[3] == resolution.dtype | ||
except: | ||
sizes.append((rname, | ||
resolution.shape, | ||
resolution.chunks, | ||
resolution.dtype)) | ||
|
||
|
||
datasets = [] | ||
out = zarr.open(ns.output, mode="w") | ||
|
||
for idx, size in enumerate(sizes): | ||
name, shape, chunks, dtype = size | ||
shape = tuple([len(timepoints), len(setups)] + list(shape)) | ||
chunks = tuple([1, 1] + list(chunks)) | ||
a = out.create_dataset(name, shape=shape, chunks=chunks, dtype=dtype) | ||
datasets.append({"path": name}) | ||
for sidx, stuple in enumerate(groups(zin)): | ||
for tidx, ttuple in enumerate(groups(stuple[1])): | ||
resolutions = arrays(ttuple[1]) | ||
a[tidx, sidx, :, :, :] = resolutions[idx][1] | ||
out.attrs["multiscales"] = [ | ||
{ | ||
"version": "0.1", | ||
"datasets": datasets, | ||
} | ||
] | ||
|
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 @@ | ||
# TODO |