Skip to content
Snippets Groups Projects
Commit 0ff77ecc authored by Andrey Aristov's avatar Andrey Aristov
Browse files

remove conversion, combine directly nd2

parent 2b178663
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,7 @@ rule align_and_count: ...@@ -18,7 +18,7 @@ rule align_and_count:
input: input:
data="{folder}/day{day}/BF_TRITC_maxZ.zarr", data="{folder}/day{day}/BF_TRITC_maxZ.zarr",
concentrations="{folder}/concentrations.yaml", concentrations="{folder}/concentrations.yaml",
template="template16_pad100-adj-sm2.tif", template="v3/template_bin16_v3.tif",
labels="v3/labels_bin2_v4.tif" labels="v3/labels_bin2_v4.tif"
output: output:
zarr = directory("{folder}/day{day}/BF_TRITC_aligned.zarr"), zarr = directory("{folder}/day{day}/BF_TRITC_aligned.zarr"),
...@@ -26,6 +26,14 @@ rule align_and_count: ...@@ -26,6 +26,14 @@ rule align_and_count:
shell: shell:
"python align.py {input.data} {output.zarr} {input.concentrations} {input.template} {input.labels} {output.table} 1" "python align.py {input.data} {output.zarr} {input.concentrations} {input.template} {input.labels} {output.table} 1"
rule correct_xy:
input:
zarr = "{folder}/day{day}/BF_TRITC_aligned-to-correct.zarr",
table = "{folder}/day{day}/correction.csv"
output:
zarr = directory("{folder}/day{day}/BF_TRITC_aligned-corrected.zarr")
shell:
"python correct.py {input.zarr} {input.table} {output.zarr}"
rule align_and_count_2D: rule align_and_count_2D:
input: input:
...@@ -50,8 +58,8 @@ rule get_sizes_nd2: ...@@ -50,8 +58,8 @@ rule get_sizes_nd2:
rule combine_BF_TRITC_3D_maxZ: rule combine_BF_TRITC_3D_maxZ:
input: input:
bf="{folder}/day{day}/BF-2D.zarr", bf="{folder}/day{day}/BF-2D.nd2",
fluo="{folder}/day{day}/TRITC-3D.zarr" fluo="{folder}/day{day}/TRITC-3D.nd2"
output: output:
directory("{folder}/day{day}/BF_TRITC_maxZ.zarr") directory("{folder}/day{day}/BF_TRITC_maxZ.zarr")
shell: shell:
......
...@@ -2,11 +2,12 @@ import dask.array as da ...@@ -2,11 +2,12 @@ import dask.array as da
import os import os
from zarr_tools.convert import to_zarr from zarr_tools.convert import to_zarr
import fire import fire
import nd2
def combine(BF_zarr_2D_path:str, TRITC_zarr_3D_path:str, out_zarr_path:str): def combine(BF_2D_path:str, TRITC_3D_path:str, out_zarr_path:str):
bd2d = da.from_zarr(os.path.join(BF_zarr_2D_path,'0/')) bd2d = nd2.ND2File(BF_2D_path).to_dask()
print('Opened BF:', bd2d) print('Opened BF:', bd2d)
fd3d = da.from_zarr(os.path.join(TRITC_zarr_3D_path,'0/')) fd3d = nd2.ND2File(TRITC_3D_path).to_dask()
print('Opened TRITC:', fd3d) print('Opened TRITC:', fd3d)
fd2d = fd3d.max(axis=1) fd2d = fd3d.max(axis=1)
bd2d = da.stack([bd2d, fd2d], axis=1) bd2d = da.stack([bd2d, fd2d], axis=1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment