Skip to content

Commit

Permalink
fix #89
Browse files Browse the repository at this point in the history
  • Loading branch information
luiztauffer committed May 21, 2020
1 parent 3b34d6a commit e057799
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 8 additions & 1 deletion ecogvis/functions/subFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,14 @@ def BadChannelSave(self):
aux = [False] * self.nChTotal
for ind in self.badChannels:
aux[ind] = True
self.nwb.electrodes['bad'].data[:] = aux
if 'bad' not in self.nwb.electrodes:
self.nwb.add_electrode_column(
name='bad',
description='electrode identified as too noisy',
data=aux,
)
else:
self.nwb.electrodes['bad'].data[:] = aux

def DrawMarkTime(self, position):
"""Marks temporary reference line when adding a new interval."""
Expand Down
3 changes: 1 addition & 2 deletions ecogvis/functions/tdt_to_nwb/chang2nwb.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,6 @@ def chang2nwb(blockpath, out_file_path=None, save_to_file=False, htk_config=None
nwbfile_dict.update(metadata['NWBFile'])
nwbfile = NWBFile(**nwbfile_dict)

nwbfile.add_electrode_column('bad', 'electrode identified as too noisy')

# Electrophysiology
ecephys_dict = {
'Device': [{'name': 'auto_device'}],
Expand Down Expand Up @@ -614,6 +612,7 @@ def chang2nwb(blockpath, out_file_path=None, save_to_file=False, htk_config=None

# Electrodes table
n_electrodes = data.shape[1]
nwbfile.add_electrode_column('bad', 'electrode identified as too noisy')
bad_elecs_inds = get_bad_elecs(blockpath)
for elec_counter in range(n_electrodes):
bad = elec_counter in bad_elecs_inds
Expand Down

0 comments on commit e057799

Please sign in to comment.