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

draft of multi-tiff multi-page imaging extractor #323

Draft
wants to merge 35 commits into
base: main
Choose a base branch
from
Draft
Changes from 2 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c4904c8
upload draft of multi-tiff multi-page imaging extractor. This could b…
bendichter May 10, 2024
fddf198
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 10, 2024
66c59f2
Merge branch 'main' into multitiff_multipage_imaging_extractor
bendichter May 15, 2024
ccf4d90
add tests
bendichter May 15, 2024
6de2ca4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 15, 2024
85e90db
dynamic import of tifffile
bendichter May 15, 2024
93b2545
Merge remote-tracking branch 'origin/multitiff_multipage_imaging_extr…
bendichter May 15, 2024
fb772d6
fix tests
bendichter May 15, 2024
31c9df4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 15, 2024
7263bd9
fix test
bendichter May 15, 2024
3b6fb6b
Merge remote-tracking branch 'origin/multitiff_multipage_imaging_extr…
bendichter May 15, 2024
f760ba6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 15, 2024
7892f8d
rmv print
bendichter May 15, 2024
44d64f7
Merge remote-tracking branch 'origin/multitiff_multipage_imaging_extr…
bendichter May 15, 2024
fda7b9c
use multiimaginginterface
bendichter May 16, 2024
96152ac
add parse as a dependency
bendichter May 16, 2024
dbdf11e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 16, 2024
4925b40
move parse to minimal requirements
bendichter May 16, 2024
c11fc24
Merge remote-tracking branch 'origin/multitiff_multipage_imaging_extr…
bendichter May 16, 2024
435f600
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 16, 2024
c1ae185
Add docstring for match_paths
bendichter May 16, 2024
2313673
Merge remote-tracking branch 'origin/multitiff_multipage_imaging_extr…
bendichter May 16, 2024
a798a7c
pass docstring tests
bendichter May 16, 2024
a904272
use named vars?
bendichter May 16, 2024
66289fb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 16, 2024
293dc1c
add docstring for module
bendichter May 16, 2024
9f36886
Merge remote-tracking branch 'origin/multitiff_multipage_imaging_extr…
bendichter May 16, 2024
b47ad48
add check for if no TIFF files were found
bendichter May 16, 2024
c54c052
move multitiffmultipage extractor over to existing tiffimagingextract…
bendichter May 16, 2024
a9153f1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 16, 2024
5c7b751
make sure match_paths can sub-select
bendichter May 16, 2024
6ed3bca
Merge remote-tracking branch 'origin/multitiff_multipage_imaging_extr…
bendichter May 16, 2024
a383ecd
refactor
bendichter May 17, 2024
fb93606
update tests
bendichter May 17, 2024
eb5cc8e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 17, 2024
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
@@ -53,7 +53,9 @@ def __init__(self, folder_path: str, pattern: str, sampling_frequency: float):

def get_video(self, start_frame: int = None, end_frame: int = None, channel: Optional[int] = 0) -> np.ndarray:
frame_idxs = np.arange(start_frame or 0, end_frame or self._num_frames)
file_idxs = np.searchsorted(self.page_tracker, frame_idxs, side="right") - 1 # index of the file that contains the frame
file_idxs = (
np.searchsorted(self.page_tracker, frame_idxs, side="right") - 1
) # index of the file that contains the frame
print(f"{file_idxs=}")
file_start_idxs = self.page_tracker[file_idxs] # index of the first frame in the file
frame_offset_idxs = frame_idxs - file_start_idxs # index of the frame in the file
5 changes: 3 additions & 2 deletions tests/test_multitiff_multipage_imaging_extractor.py
Original file line number Diff line number Diff line change
@@ -5,8 +5,9 @@

def test_init_multitiff_multipage_imaging_extractor():
extractor = MultiTiffMultiPageImagingExtractor(
folder_path=OPHYS_DATA_PATH / "imaging_datasets" / "Tif" / "splits", pattern="split_{split:d}.tif",
sampling_frequency=1.0
folder_path=OPHYS_DATA_PATH / "imaging_datasets" / "Tif" / "splits",
pattern="split_{split:d}.tif",
sampling_frequency=1.0,
)

assert extractor.get_num_channels() == 1