Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/multitiff_multipage_imaging_extr…
Browse files Browse the repository at this point in the history
…actor' into multitiff_multipage_imaging_extractor

# Conflicts:
#	tests/test_multitiff_multipage_imaging_extractor.py
  • Loading branch information
bendichter committed May 15, 2024
2 parents 7263bd9 + 31c9df4 commit 3b6fb6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions tests/test_multitiff_multipage_imaging_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3b6fb6b

Please sign in to comment.