-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Electrodes mapping #92
Conversation
luiztauffer
commented
Jun 8, 2020
- maps electrodes ids for each trace
- fix Cannot save bad channels #89
Codecov Report
@@ Coverage Diff @@
## master #92 +/- ##
==========================================
- Coverage 19.12% 19.12% -0.01%
==========================================
Files 25 25
Lines 5584 5580 -4
==========================================
- Hits 1068 1067 -1
+ Misses 4516 4513 -3
Continue to review full report at Codecov.
|
ecogvis/functions/nwb_copy_file.py
Outdated
@@ -266,10 +266,10 @@ def copy_obj(obj_old, nwb_old, nwb_new): | |||
|
|||
# ElectricalSeries -------------------------------------------------------- | |||
if type(obj_old) is ElectricalSeries: | |||
nChannels = len(obj_old.electrodes.table['x'].data) | |||
elecs_region = nwb_new.electrodes.create_region( | |||
region = list(obj_old.electrodes.to_dataframe().index) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you are converting to a dataframe, which will work but is unnecessarily costly if all you want is the ids in the region. It is more efficient to first get the ids from the table, and then index them by the data field of the ElectricalSeries.electrodes.data
. See the eventual fix for similar code in SpikeInterface:
https://github.com/SpikeInterface/spikeextractors/pull/401/files
ecogvis/functions/subFunctions.py
Outdated
self.nChTotal = self.source.data.shape[1] # total number of channels | ||
self.allChannels = np.arange(0, self.nChTotal) # array with all channels | ||
self.all_channels_ids = list(self.source.electrodes.to_dataframe().index) # all channels ids | ||
self.n_channels_total = len(self.all_channels_ids) # total number of channels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar issue here. See:
https://github.com/SpikeInterface/spikeextractors/pull/401/files
Also, I don't the "all_channel_ids" is an appropriate name here because we are intentionally excluding the channels that are not associated with the ElectricalSeries, so maybe electrical_series_channel_ids
would be better
- remove unused button save bad channels
- change channel index in copy