You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Phy only shows average templates after spikeinterface.export_to_phy; raw per-spike waveforms cannot be displayed #4169
Hi, do you see the raw traces? The per-spike waveforms are extracted from the traces on the fly, so if Phy cannot load traces, then it won't show single waveforms either!
Hi, thanks for the quick reply.
I also can’t see raw traces in Phy. TraceView fails to open, so single-spike waveforms don’t show either.
What I see in Phy
(phy2) E:\testephys\phy_qcpass_clusters2> phy template-gui params.py
22:00:32.261 [W] model:1415 File None does not exist.
22:00:34.752 [W] model:667 Skipping spike waveforms that do not exist, they will be extracted on the fly from the raw data as needed.
22:00:34.754 [W] traces:462 File E:\testephys\phy_qcpass_clusters2\None does not exist.
22:00:34.754 [W] traces:462 File E:\testephys\phy_qcpass_clusters2\None does not exist.
QMimeDatabase: Error loading internal MIME data
An error has been encountered at line 1 of : Premature end of document.:
22:17:41.848 [W] gui:671 Could not create view TraceView.
22:17:49.060 [W] gui:671 Could not create view TraceView.
22:18:04.658 [W] gui:671 Could not create view TraceView.
The key part seems to be File None does not exist. and the TraceView creation failure.
How I exported from SpikeInterface
export_to_phy
an_qc = an.select_units(unit_ids=qc_unit_ids)
sorting_dedup.copy_metadata(an_qc.sorting, ids=an_qc.sorting.unit_ids)
normalize_str_props(an_qc.sorting, keys=("group","KSLabel","quality"))
props_for_export = [p for p in ("group","KSLabel","quality") if p in an_qc.sorting.get_property_keys()]
from pathlib import Path
PHY_DIR = Path(r"E:/testephys/phy_qcpass_clusters2")
export_to_phy(
sorting_analyzer=an_qc,
output_folder=PHY_DIR,
remove_if_exists=True,
copy_binary=False, # <-- I set this to False
additional_properties=props_for_export,
)
print("Exported to Phy ->", PHY_DIR)
Should I re-export with copy_binary=True so the exporter writes a proper .bin and params.py?
Thanks — that was exactly it. Setting copy_binary=True makes Phy load the traces, so single-spike waveforms show up. 🙏
Quick question: does SpikeInterface have a built-in way to handle events/TTL (e.g., extracting edges from NIDQ and aligning spikes to events) so I can keep everything inside SI? I know I can load the NIDQ stream with read_spikeglx(..., stream_name="nidq"), and I see there’s a BaseEvent API for events, but is there an official helper/example for turning NIDQ TTLs into BaseEvent objects and doing basic alignment/PETH? If so, could you share a pointer? Thanks a lot!
Great. Let us know if it works as expected and, if you can, give us some stars on the repo as that is good for us to get funding for doing more development : )
Everything is working great on my side—thanks for the pointers!
I extracted the events and performed interpolation to align AP and NIDAQ to the same timebase.
Also, I just ⭐️ the repo—hope it helps with funding!
Activity
alejoe91 commentedon Oct 13, 2025
Hi, do you see the raw traces? The per-spike waveforms are extracted from the traces on the fly, so if Phy cannot load traces, then it won't show single waveforms either!
Sicheng-package commentedon Oct 13, 2025
Hi, thanks for the quick reply.
I also can’t see raw traces in Phy. TraceView fails to open, so single-spike waveforms don’t show either.
What I see in Phy
(phy2) E:\testephys\phy_qcpass_clusters2> phy template-gui params.py
22:00:32.261 [W] model:1415 File None does not exist.
22:00:34.752 [W] model:667 Skipping spike waveforms that do not exist, they will be extracted on the fly from the raw data as needed.
22:00:34.754 [W] traces:462 File E:\testephys\phy_qcpass_clusters2\None does not exist.
22:00:34.754 [W] traces:462 File E:\testephys\phy_qcpass_clusters2\None does not exist.
QMimeDatabase: Error loading internal MIME data
An error has been encountered at line 1 of : Premature end of document.:
22:17:41.848 [W] gui:671 Could not create view TraceView.
22:17:49.060 [W] gui:671 Could not create view TraceView.
22:18:04.658 [W] gui:671 Could not create view TraceView.
The key part seems to be File None does not exist. and the TraceView creation failure.
How I exported from SpikeInterface
export_to_phy
an_qc = an.select_units(unit_ids=qc_unit_ids)
sorting_dedup.copy_metadata(an_qc.sorting, ids=an_qc.sorting.unit_ids)
normalize_str_props(an_qc.sorting, keys=("group","KSLabel","quality"))
props_for_export = [p for p in ("group","KSLabel","quality") if p in an_qc.sorting.get_property_keys()]
from pathlib import Path
PHY_DIR = Path(r"E:/testephys/phy_qcpass_clusters2")
export_to_phy(
sorting_analyzer=an_qc,
output_folder=PHY_DIR,
remove_if_exists=True,
copy_binary=False, # <-- I set this to False
additional_properties=props_for_export,
)
print("Exported to Phy ->", PHY_DIR)
Should I re-export with copy_binary=True so the exporter writes a proper .bin and params.py?
alejoe91 commentedon Oct 13, 2025
Exactly, that's the reason. You need
copy_binary=TrueSicheng-package commentedon Oct 15, 2025
Thanks — that was exactly it. Setting copy_binary=True makes Phy load the traces, so single-spike waveforms show up. 🙏
Quick question: does SpikeInterface have a built-in way to handle events/TTL (e.g., extracting edges from NIDQ and aligning spikes to events) so I can keep everything inside SI? I know I can load the NIDQ stream with read_spikeglx(..., stream_name="nidq"), and I see there’s a BaseEvent API for events, but is there an official helper/example for turning NIDQ TTLs into BaseEvent objects and doing basic alignment/PETH? If so, could you share a pointer? Thanks a lot!
alejoe91 commentedon Oct 15, 2025
Good question. Note really currently but @h-mayorquin can comment on it.
Tagging also @guptadivyansh and @manimoh since they looked into this:
NeuralEnsemble/python-neo#1657
h-mayorquin commentedon Oct 15, 2025
There is a
SpikeGLXEventExtractorin the extractor clasess that should give you the timing of the events. It would be good to have it tested.As far as I am aware we don't the machinery for doing the interpolation but that should not be too difficult with numpy.
Sicheng-package commentedon Oct 15, 2025
Thanks a lot for the pointer to SpikeGLXEventExtractor—that’s exactly what I needed for getting event timings. I’ll test it on my SpikeGLX datasets.
h-mayorquin commentedon Oct 19, 2025
Great. Let us know if it works as expected and, if you can, give us some stars on the repo as that is good for us to get funding for doing more development : )
Sicheng-package commentedon Oct 19, 2025
Everything is working great on my side—thanks for the pointers!
I extracted the events and performed interpolation to align AP and NIDAQ to the same timebase.
Also, I just ⭐️ the repo—hope it helps with funding!