|
26 | 26 | from brainbox.behavior.dlc import SAMPLING, plot_trace_on_frame, plot_wheel_position, plot_lick_hist, \ |
27 | 27 | plot_lick_raster, plot_motion_energy_hist, plot_speed_hist, plot_pupil_diameter_hist |
28 | 28 | from brainbox.ephys_plots import image_lfp_spectrum_plot, image_rms_plot, plot_brain_regions |
29 | | -from brainbox.io.one import load_spike_sorting_fast |
| 29 | +from brainbox.io.one import SpikeSortingLoader |
30 | 30 | from brainbox.behavior import training |
31 | 31 | from iblutil.numerical import ismember |
32 | 32 | from ibllib.plots.misc import Density |
@@ -360,11 +360,12 @@ def plot_driftmap(self, spikes, clusters, channels, collection): |
360 | 360 | if all_here and len(output_files) == len(spike_sorting_runs): |
361 | 361 | return output_files |
362 | 362 | logger.info(self.output_directory) |
363 | | - for run in spike_sorting_runs: |
364 | | - collection = str(Path(run).parent.as_posix()) |
365 | | - spikes, clusters, channels = load_spike_sorting_fast( |
366 | | - eid=self.eid, probe=self.pname, one=self.one, nested=False, collection=collection, |
367 | | - dataset_types=['spikes.depths'], brain_regions=self.brain_regions) |
| 363 | + ss = SpikeSortingLoader( |
| 364 | + one=self.one, pid=self.pid, eid=self.eid, pname=self.pname, session_path=self.session_path) |
| 365 | + for run in map(self.session_path.joinpath, spike_sorting_runs): |
| 366 | + sorter = run.without_revision().relative_to(self.session_path / f'alf/{self.pname}') |
| 367 | + collection = run.relative_to(self.session_path).parent.as_posix() |
| 368 | + spikes, clusters, channels = ss.load_spike_sorting(spike_sorter=sorter, revision=run.revision or None) |
368 | 369 |
|
369 | 370 | if 'atlas_id' not in channels.keys(): |
370 | 371 | channels = self.get_channels('channels', collection) |
|
0 commit comments