Skip to content

Commit 875dac0

Browse files
committed
Skip array length check for sparse data
1 parent 19230dc commit 875dac0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

neo/rawio/biocamrawio.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,14 @@ def open_biocam_file_header(filename) -> dict:
264264
for well_ID in rf:
265265
if well_ID.startswith("Well_"):
266266
num_channels = len(rf[well_ID]["StoredChIdxs"])
267-
if len(rf[well_ID]["Raw"]) % num_channels:
268-
raise NeoReadWriteError(f"Length of raw data array is not multiple of channel number in {well_ID}")
269-
num_frames = len(rf[well_ID]["Raw"]) // num_channels
270-
break
267+
if "Raw" in rf[well_ID]:
268+
if len(rf[well_ID]["Raw"]) % num_channels:
269+
raise NeoReadWriteError(f"Length of raw data array is not multiple of channel number in {well_ID}")
270+
num_frames = len(rf[well_ID]["Raw"]) // num_channels
271+
break
272+
elif "EventsBasedSparseRaw" in rf[well_ID]:
273+
# Not sure how to check for this with sparse data
274+
pass
271275

272276
if num_channels is not None:
273277
num_channels_x = num_channels_y = int(np.sqrt(num_channels))

0 commit comments

Comments
 (0)