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

Update Suite2pSegmentationExtractor to support multi channel and multi plane outputs #242

Merged
merged 31 commits into from
Nov 6, 2023
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d6be165
update with streams
weiglszonja Sep 14, 2023
47e9903
Merge branch 'main' into update_suite2psegmentationextractor
weiglszonja Sep 14, 2023
03fbc1e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 14, 2023
8b04ae7
fix io test
weiglszonja Sep 14, 2023
1a35f8f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 14, 2023
28dabeb
fix extractor test
weiglszonja Sep 14, 2023
d9474fa
pydocstyle
weiglszonja Sep 14, 2023
2874854
fix tests
weiglszonja Sep 16, 2023
fc07661
allow for incomplete input
weiglszonja Sep 18, 2023
802164d
Merge branch 'main' into update_suite2psegmentationextractor
weiglszonja Sep 28, 2023
a4b9df2
Merge branch 'main' into update_suite2psegmentationextractor
weiglszonja Oct 2, 2023
3ddda89
change from stream to channel+plane name
alessandratrapani Oct 2, 2023
9607007
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 2, 2023
798994c
add tests
weiglszonja Oct 3, 2023
7658e61
change to warn for multi channel multi plane
weiglszonja Oct 3, 2023
849a0f0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 3, 2023
1155278
pydocstyle
weiglszonja Oct 3, 2023
c02ac97
Merge remote-tracking branch 'origin/update_suite2psegmentationextrac…
weiglszonja Oct 3, 2023
b442c87
refactor get_available_planes and get_available_channels
weiglszonja Oct 5, 2023
1107f86
fix io test for suite2p
weiglszonja Oct 5, 2023
bcda76b
format code
alessandratrapani Oct 5, 2023
c9d7628
Merge branch 'update_suite2psegmentationextractor' of https://github.…
alessandratrapani Oct 5, 2023
1529a41
add docstring for plane and channel name
weiglszonja Oct 16, 2023
84be179
Merge branch 'main' into update_suite2psegmentationextractor
weiglszonja Oct 16, 2023
980d738
add channel name as class attribute
weiglszonja Oct 17, 2023
7e198f5
add _image_masks to suite2p extractor
weiglszonja Oct 23, 2023
636265d
remove get_roi_image_masks override
weiglszonja Oct 23, 2023
2b86402
Merge branch 'main' into update_suite2psegmentationextractor
weiglszonja Oct 23, 2023
ade4b3f
Merge branch 'main' into update_suite2psegmentationextractor
weiglszonja Oct 30, 2023
55589ca
update CHANGELOG.md
weiglszonja Oct 31, 2023
c26c4ca
Merge remote-tracking branch 'origin/update_suite2psegmentationextrac…
weiglszonja Oct 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ def get_available_channels(cls, folder_path: PathType):
plane_names = cls.get_available_planes(folder_path=folder_path)

channel_names = ["chan1"]
file_path = Path(folder_path) / plane_names[0] / "F_chan2.npy"

if os.path.isfile(file_path):
channel_names.append("chan2")
second_channel_paths = list((Path(folder_path) / plane_names[0]).glob("F_chan2.npy"))
if not second_channel_paths:
return channel_names
channel_names.append("chan2")

return channel_names

Expand All @@ -65,13 +65,13 @@ def get_available_planes(cls, folder_path: PathType):
plane_names: list
List of plane names.
"""
from natsort import natsorted

folder_path = Path(folder_path)
prefix = "plane"
plane_names = []
for item in os.listdir(folder_path):
if item.startswith(prefix):
plane_names.append(item)

plane_paths = natsorted(folder_path.glob(pattern=prefix + "*"))
assert len(plane_paths), f"No planes found in '{folder_path}'."
plane_names = [plane_path.stem for plane_path in plane_paths]
CodyCBakerPhD marked this conversation as resolved.
Show resolved Hide resolved
return plane_names

def __init__(
Expand Down
Loading