From 1a8bc6880f9d5ca9a03e6bef9c25f86e99b3c585 Mon Sep 17 00:00:00 2001 From: Thinh Nguyen Date: Wed, 6 Sep 2023 15:51:47 -0500 Subject: [PATCH 1/4] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7eae37da..45f2333e 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ "elements": [ "element-animal>=0.1.8", "element-event>=0.2.3", - "element-interface>=0.7.0", + "element-interface @ git+https://github.com/datajoint/element-interface.git@multi-plane-caiman", "element-lab>=0.3.0", "element-session>=0.1.5", ], From a5b2e8916b5bca9d55eccf3eb3481deeb77e327c Mon Sep 17 00:00:00 2001 From: Thinh Nguyen Date: Mon, 29 Jan 2024 16:50:26 -0600 Subject: [PATCH 2/4] feat(imaging): write bigtiff for caiman processing for bruker files --- .../imaging_no_curation.py | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/element_calcium_imaging/imaging_no_curation.py b/element_calcium_imaging/imaging_no_curation.py index 2dbdf2f7..8df36179 100644 --- a/element_calcium_imaging/imaging_no_curation.py +++ b/element_calcium_imaging/imaging_no_curation.py @@ -463,8 +463,8 @@ def make(self, key): channel = caiman_params.get("channel_to_process", 0) if ndepths == 1: # single-plane processing - if nchannels > 1: - if acq_software == "ScanImage": + if acq_software == "ScanImage": + if nchannels > 1: # handle multi-channel tiff image before running CaImAn tmp_dir = pathlib.Path(output_dir) / "channel_separated_tif" tmp_dir.mkdir(exist_ok=True) @@ -472,17 +472,24 @@ def make(self, key): [f.as_posix() for f in image_files], output_dir=tmp_dir ) image_files = tmp_dir.glob(f"*_chn{channel}.tif") - elif acq_software == "PrairieView": - from element_interface import PrairieViewMeta - - pv_dir = pathlib.Path(image_files[0]).parent - PVmeta = PrairieViewMeta(pv_dir) - image_files = [ - pv_dir / f - for f in PVmeta.get_prairieview_files( - channel=caiman_params.get("channel_to_process", 0), - ) - ] + elif acq_software == "PrairieView": + from element_interface import PrairieViewMeta + + pv_dir = pathlib.Path(image_files[0]).parent + PVmeta = PrairieViewMeta(pv_dir) + channel = ( + channel + if PVmeta.meta["num_channels"] > 1 + else PVmeta.meta["channels"][0] + ) + image_files = [ + PVmeta.write_single_bigtiff( + plane_idx=0, + channel=channel, + output_dir=output_dir, + caiman_compatible=True, + ) + ] run_caiman( file_paths=[f.as_posix() for f in image_files], From 50b375450489a1fc2c2fb164cae72e08f001818e Mon Sep 17 00:00:00 2001 From: Thinh Nguyen Date: Mon, 29 Jan 2024 16:53:13 -0600 Subject: [PATCH 3/4] style(imaging) --- element_calcium_imaging/imaging_no_curation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/element_calcium_imaging/imaging_no_curation.py b/element_calcium_imaging/imaging_no_curation.py index ad917fe7..e4279dab 100644 --- a/element_calcium_imaging/imaging_no_curation.py +++ b/element_calcium_imaging/imaging_no_curation.py @@ -475,8 +475,8 @@ def make(self, key): image_files = tmp_dir.glob(f"*_chn{channel}.tif") elif acq_software == "PrairieView": from element_interface.prairie_view_loader import ( - PrairieViewMeta, - ) + PrairieViewMeta, + ) pv_dir = pathlib.Path(image_files[0]).parent PVmeta = PrairieViewMeta(pv_dir) From bce6edf4c67a538c316493575c307419585e23ad Mon Sep 17 00:00:00 2001 From: Thinh Nguyen Date: Mon, 29 Jan 2024 16:54:18 -0600 Subject: [PATCH 4/4] update(setup): revert bad merge conflict --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 45f2333e..7eae37da 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ "elements": [ "element-animal>=0.1.8", "element-event>=0.2.3", - "element-interface @ git+https://github.com/datajoint/element-interface.git@multi-plane-caiman", + "element-interface>=0.7.0", "element-lab>=0.3.0", "element-session>=0.1.5", ],