Skip to content

Commit c3cefcf

Browse files
Get correct number of data points from zoomed image (#1460)
Co-authored-by: Heberto Mayorquin <[email protected]>
1 parent fe475f1 commit c3cefcf

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

spikeinterface/widgets/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,13 @@ def array_to_image(data,
144144

145145
num_timepoints = data.shape[0]
146146
num_channels = data.shape[1]
147-
num_channels_after_scaling = int(num_channels * spatial_zoom[1])
148147
spacing = int(num_channels * spatial_zoom[1] * row_spacing)
149148

150-
num_timepoints_after_scaling = int(num_timepoints * spatial_zoom[0])
151-
num_timepoints_per_row_after_scaling = int(np.min([num_timepoints_per_row, num_timepoints]) * spatial_zoom[0])
152149

153150
cmap = plt.get_cmap(colormap)
154151
zoomed_data = zoom(data, spatial_zoom)
152+
num_timepoints_after_scaling, num_channels_after_scaling = zoomed_data.shape
153+
num_timepoints_per_row_after_scaling = int(np.min([num_timepoints_per_row, num_timepoints]) * spatial_zoom[0])
155154

156155
scaled_data = zoomed_data
157156
scaled_data[scaled_data < clim[0]] = clim[0]

0 commit comments

Comments
 (0)