|
9 | 9 | import spikeinterface as si
|
10 | 10 | from element_array_ephys import probe, readers
|
11 | 11 | from element_interface.utils import find_full_path, memoized_result
|
12 |
| -from spikeinterface import exporters, postprocessing, qualitymetrics, sorters |
| 12 | +from spikeinterface import exporters, extractors, sorters |
13 | 13 |
|
14 | 14 | from . import si_preprocessing
|
15 | 15 |
|
@@ -111,25 +111,30 @@ def make(self, key):
|
111 | 111 | )
|
112 | 112 | spikeglx_recording.validate_file("ap")
|
113 | 113 | data_dir = spikeglx_meta_filepath.parent
|
| 114 | + |
| 115 | + si_extractor = si.extractors.neoextractors.spikeglx.SpikeGLXRecordingExtractor |
| 116 | + stream_names, stream_ids = si.extractors.get_neo_streams( |
| 117 | + acq_software, folder_path=data_dir |
| 118 | + ) |
| 119 | + si_recording: si.BaseRecording = si_extractor( |
| 120 | + folder_path=data_dir, stream_name=stream_names[0] |
| 121 | + ) |
114 | 122 | elif acq_software == "Open Ephys":
|
115 | 123 | oe_probe = ephys.get_openephys_probe_data(key)
|
116 | 124 | assert len(oe_probe.recording_info["recording_files"]) == 1
|
117 | 125 | data_dir = oe_probe.recording_info["recording_files"][0]
|
| 126 | + si_extractor = si.extractors.neoextractors.openephys.OpenEphysBinaryRecordingExtractor |
| 127 | + |
| 128 | + stream_names, stream_ids = si.extractors.get_neo_streams( |
| 129 | + acq_software, folder_path=data_dir |
| 130 | + ) |
| 131 | + si_recording: si.BaseRecording = si_extractor( |
| 132 | + folder_path=data_dir, stream_name=stream_names[0] |
| 133 | + ) |
118 | 134 | else:
|
119 | 135 | raise NotImplementedError(
|
120 | 136 | f"SpikeInterface processing for {acq_software} not yet implemented."
|
121 | 137 | )
|
122 |
| - acq_software = acq_software.replace(" ", "").lower() |
123 |
| - si_extractor: si.extractors.neoextractors = ( |
124 |
| - si.extractors.extractorlist.recording_extractor_full_dict[acq_software] |
125 |
| - ) # data extractor object |
126 |
| - |
127 |
| - stream_names, stream_ids = si.extractors.get_neo_streams( |
128 |
| - acq_software, folder_path=data_dir |
129 |
| - ) |
130 |
| - si_recording: si.BaseRecording = si_extractor( |
131 |
| - folder_path=data_dir, stream_name=stream_names[0] |
132 |
| - ) |
133 | 138 |
|
134 | 139 | # Add probe information to recording object
|
135 | 140 | electrodes_df = (
|
|
0 commit comments