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
fromdandi.dandiapiimportDandiAPIClientfromspikeinterface.extractorsimportNwbRecordingExtractor, IblSortingExtractorclient=DandiAPIClient.for_dandi_instance("dandi")
# We specifiy a dataset by is dandiset_id and its asset pathdandiset_id="000409"dandiset=client.get_dandiset(dandiset_id)
asset_path="sub-KS042/sub-KS042_ses-8c552ddc-813e-4035-81cc-3971b57efe65_behavior+ecephys+image.nwb"recording_asset=dandiset.get_asset_by_path(path=asset_path)
url=recording_asset.get_content_url(follow_redirects=True, strip_query=True)
file_path=url# Note that this ElectricalSeries corresponds to the data from probe 00electrical_series_path="acquisition/ElectricalSeriesAp00"recording=NwbRecordingExtractor(file_path=file_path, stream_mode="remfile", electrical_series_path=electrical_series_path)
session_id=recording._file["general"]["session_id"][()].decode()
eid=session_id.split("-chunking")[0] # eid : experiment id# We use the sorting extractor from the IBL spike sorting pipeline that matches with eidfromone.apiimportONEONE.setup(base_url='https://openalyx.internationalbrainlab.org', silent=True)
one_instance=ONE(password='international')
# Then we match the available probes with the probe number in the electrical series pathpids, probes=one_instance.eid2pid(eid)
probe_number=electrical_series_path.split("Ap")[-1]
sorting_pid=Noneforpid, probeinzip(pids, probes):
probe_number_in_pid=probe[-2:]
ifprobe_number_in_pid==probe_number:
sorting_pid=pidbreaksorting=IblSortingExtractor(pid=sorting_pid, one=one_instance, good_clusters_only=True)
Note that Ibl might have been modified
SpikeInterface/spikeinterface#2617
The text was updated successfully, but these errors were encountered: