Skip to content

Commit 9b370d0

Browse files
authored
Merge pull request #1746 from b-grimaud/offset
Fix offset when using synthetic noise with BioCAM's sparse compression
2 parents 60a8798 + 87ac553 commit 9b370d0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

neo/rawio/biocamrawio.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,4 +460,10 @@ def generate_synthetic_noise(rf, data, well_ID, start_frame, num_frames):
460460
else:
461461
data[ch_idx] = np.array(np.random.normal(median_mean, median_std, num_frames), dtype=np.uint16)
462462

463+
# Assuming a 12-bit unsigned to signed conversion downstream, the baseline should read at 2048 raw
464+
# However, synthetic noise is generated with a baseline of 0, which requires an offset of + 2048
465+
# See issue #1743
466+
467+
data = data + 2048
468+
463469
return data

0 commit comments

Comments
 (0)