Skip to content

Commit

Permalink
Remove root EEG variable from exports.
Browse files Browse the repository at this point in the history
  • Loading branch information
jackz314 committed Apr 8, 2021
1 parent 7e7919c commit 4c49758
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
2 changes: 1 addition & 1 deletion eeglabio/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""The version number."""

__version__ = '0.0.1-2'
__version__ = '0.0.1-4'
28 changes: 14 additions & 14 deletions eeglabio/epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,18 @@ def export_set(fname, data, sfreq, events, tmin, tmax, ch_names,
epochs = fromarrays([ep_event, ep_lat, ep_types],
names=["event", "eventlatency", "eventtype"])

eeg_d = dict(EEG=dict(data=data,
setname=fname,
nbchan=data.shape[0],
pnts=float(data.shape[1]),
trials=trials,
srate=sfreq,
xmin=tmin,
xmax=tmax,
chanlocs=chanlocs,
event=events,
epoch=epochs,
icawinv=[],
icasphere=[],
icaweights=[]))
eeg_d = dict(data=data,
setname=fname,
nbchan=data.shape[0],
pnts=float(data.shape[1]),
trials=trials,
srate=sfreq,
xmin=tmin,
xmax=tmax,
chanlocs=chanlocs,
event=events,
epoch=epochs,
icawinv=[],
icasphere=[],
icaweights=[])
savemat(fname, eeg_d, appendmat=False)
12 changes: 5 additions & 7 deletions eeglabio/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,16 @@ def export_set(fname, data, sfreq, ch_names, ch_locs=None, annotations=None):
else:
chanlocs = fromarrays([ch_names], names=["labels"])

eeg = dict(data=data, setname=fname, nbchan=data.shape[0],
pnts=data.shape[1], trials=1, srate=sfreq, xmin=0,
xmax=data.shape[1] / sfreq, chanlocs=chanlocs, icawinv=[],
icasphere=[], icaweights=[])
eeg_d = dict(data=data, setname=fname, nbchan=data.shape[0],
pnts=data.shape[1], trials=1, srate=sfreq, xmin=0,
xmax=data.shape[1] / sfreq, chanlocs=chanlocs, icawinv=[],
icasphere=[], icaweights=[])

if annotations is not None:
events = fromarrays([annotations[0],
annotations[1] * sfreq + 1,
annotations[2] * sfreq],
names=["type", "latency", "duration"])
eeg['event'] = events

eeg_d = dict(EEG=eeg)
eeg_d['event'] = events

savemat(fname, eeg_d, appendmat=False)

0 comments on commit 4c49758

Please sign in to comment.