Description
I'm trying to convert electrophysiological data from Axona to NWB using the code from the Neuroconv https://github.com/catalystneuro/neuroconv.
I'm using neuroconv version 0.4.9 with Python 3.9 on Windows 11 in a conda environment.
I’m selecting the tetrodes to extract from the .set
file setting the parameters collectMask_* to 1
In the experiment lab I know they’re recording with Axona on channels 17-32, so I'm setting collectMask_* to 1 for tetrodes 5-8. But after running the conversion and plotting the extracted signals, I don't get the correct channels (I can see it's only noise in the output).
This is the code I'm using for conversion:
from dateutil import tz
from pathlib import Path
from neuroconv.datainterfaces import AxonaRecordingInterface
interface = AxonaRecordingInterface(file_path=".../2509202301.bin", verbose=True, es_key="Ephys")
# Extract what metadata we can from the source files
metadata = interface.get_metadata()
# For data provenance we add the time zone information to the conversion
tzinfo = tz.gettz()
session_start_time = metadata["NWBFile"]["session_start_time"]
metadata["NWBFile"].update(session_start_time=session_start_time.replace(tzinfo=tzinfo))
# Choose a path for saving the nwb file and run the conversion
path_to_save_nwbfile = ".../2509202301.nwb"
nwbfile_path = f"{path_to_save_nwbfile}"
interface.run_conversion(nwbfile_path=nwbfile_path, metadata=metadata)
But after running the conversion and plotting the extracted signals, I don't get the correct channels (I can see it's only noise in the output).
This is the plot code:
from pynwb import NWBHDF5IO
import numpy as np
import matplotlib.pyplot as plt
fileobject = NWBHDF5IO('2509202301.nwb', 'r')
nwbobject = fileobject.read()
xx = nwbobject.acquisition['Ephys'].data
time = np.linspace(0,1000, 100000)
fig, ax = plt.subplots(16,1, sharex='all', sharey='all')
for i in range(16):
ax[i].plot(time, xx[100000:200000,i])
plt.show()
If instead, I try to extract the first 32 channels (so setting collectMask_* to 1 for tetrodes 1-8) I'm getting the correct signals in channels 17-32 (here I'm plotting only the last 16 channels).
It seems that in any case I'm extracting the first 16 channels if I select 4 tetrodes, or 32 if I'm selecting 8 tetrodes.
See: Originally posted by @CodyCBakerPhD in catalystneuro/neuroconv#787 (comment)
In general, it appears as if upstream control over Axona groups/streams is not exposed as my minimal attempt to get the RecordingExtractor results in only 16 channels (not 32) and only a single group (well,
None
implying only a single group anyway)from spikeinterface.extractors import AxonaRecordingExtractor recording = AxonaRecordingExtractor(file_path=".../2509202301.bin") recording.channel_ids > array(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15'], dtype='<U64') recording.get_channel_groups() > None
I can share the sample data via email if needed. Thanks!