Skip to content
Merged
Changes from all commits
Commits
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
16 changes: 12 additions & 4 deletions src/spikeinterface/widgets/unit_templates.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from spikeinterface.core import SortingAnalyzer

from .unit_waveforms import UnitWaveformsWidget
from .base import to_attr

Expand Down Expand Up @@ -40,12 +41,17 @@ def plot_figpack(self, data_plot, **backend_kwargs):
templates_dict = {}
for u_i, unit in enumerate(unit_ids):
templates_dict[unit] = {}
template_data = dp.templates[u_i]
templates_dict[unit]["mean"] = template_data[:, unit_id_to_channel_indices[unit]]
template_data = dp.templates[u_i][:, unit_id_to_channel_indices[unit]].astype("float32")
if use_sortingview:
template_data = template_data.T
templates_dict[unit]["mean"] = template_data
if dp.do_shading:
templates_dict[unit]["shading"] = []
for shading_data in dp.templates_shading:
templates_dict[unit]["shading"].append(shading_data[u_i][:, unit_id_to_channel_indices[unit]])
shading_data_unit = shading_data[u_i][:, unit_id_to_channel_indices[unit]].astype("float32")
if use_sortingview:
shading_data_unit = shading_data_unit.T
templates_dict[unit]["shading"].append(shading_data_unit)
else:
templates_dict[unit]["shading"] = None

Expand All @@ -59,7 +65,9 @@ def plot_figpack(self, data_plot, **backend_kwargs):
for u, t in templates_dict.items()
]

channel_locations = {str(ch): dp.channel_locations[i_ch].astype(float) for i_ch, ch in enumerate(channel_ids)}
channel_locations = {
str(ch): dp.channel_locations[i_ch].astype("float32") for i_ch, ch in enumerate(channel_ids)
}
v_average_waveforms = vv_views.AverageWaveforms(average_waveforms=aw_items, channel_locations=channel_locations)

if not dp.hide_unit_selector:
Expand Down
Loading