Browse Source

gin commit from Ivory

New files: 1
Modified files: 2
Achilleas Koutsou 5 years ago
parent
commit
6d1f986015
3 changed files with 28 additions and 1 deletions
  1. BIN
      __pycache__/mnetonix.cpython-37.pyc
  2. 13 1
      mnetonix.html
  3. 15 0
      mnetonix.py

BIN
__pycache__/mnetonix.cpython-37.pyc


+ 13 - 1
mnetonix.html

@@ -33,6 +33,9 @@ Command line script for reading EDF and Brain
 (mne-python)&nbsp;and&nbsp;storing&nbsp;the&nbsp;data&nbsp;and&nbsp;metadata&nbsp;into&nbsp;a&nbsp;NIX&nbsp;file.&nbsp;&nbsp;Supports<br>
 reading&nbsp;montage&nbsp;files&nbsp;for&nbsp;recording&nbsp;channel&nbsp;locations.<br>
 &nbsp;<br>
+To&nbsp;include&nbsp;in&nbsp;a&nbsp;script,&nbsp;call&nbsp;the&nbsp;'<a href="#-write_raw_mne">write_raw_mne</a>()'&nbsp;and&nbsp;provide&nbsp;a&nbsp;NIX&nbsp;filename<br>
+and&nbsp;MNE&nbsp;Raw&nbsp;structure&nbsp;as&nbsp;arguments.<br>
+&nbsp;<br>
 NIX&nbsp;Format&nbsp;layout<br>
 =================<br>
 &nbsp;<br>
@@ -89,7 +92,16 @@ separate&nbsp;Section&nbsp;with&nbsp;name&nbsp;"Extras".</tt></p>
  <dl><dt><a name="-plot_channel"><strong>plot_channel</strong></a>(data_array, index)</dt></dl>
  <dl><dt><a name="-separate_stimulus_types"><strong>separate_stimulus_types</strong></a>(stimuli)</dt></dl>
  <dl><dt><a name="-write_multi_da"><strong>write_multi_da</strong></a>(mneraw, block)</dt></dl>
- <dl><dt><a name="-write_raw_mne"><strong>write_raw_mne</strong></a>(nfname, mneraw, split_data_channels=False, split_stimuli=False)</dt></dl>
+ <dl><dt><a name="-write_raw_mne"><strong>write_raw_mne</strong></a>(nfname, mneraw, split_data_channels=False, split_stimuli=False)</dt><dd><tt>Writes&nbsp;the&nbsp;provided&nbsp;Raw&nbsp;MNE&nbsp;structure&nbsp;to&nbsp;a&nbsp;NIX&nbsp;file&nbsp;with&nbsp;the&nbsp;given&nbsp;name.<br>
+&nbsp;<br>
+:param&nbsp;nfname:&nbsp;Name&nbsp;for&nbsp;the&nbsp;NIX&nbsp;file&nbsp;to&nbsp;write&nbsp;to.&nbsp;Existing&nbsp;file&nbsp;will&nbsp;be<br>
+overwritten.<br>
+:param&nbsp;mneraw:&nbsp;An&nbsp;MNE&nbsp;Raw&nbsp;structure&nbsp;(any&nbsp;mne.io.BaseRaw&nbsp;subclass).<br>
+:param&nbsp;split_data_channels:&nbsp;If&nbsp;True,&nbsp;each&nbsp;raw&nbsp;data&nbsp;channel&nbsp;will&nbsp;be&nbsp;stored<br>
+in&nbsp;a&nbsp;separate&nbsp;DataArray.<br>
+:param&nbsp;split_stimuli:&nbsp;If&nbsp;True,&nbsp;stimuli&nbsp;will&nbsp;be&nbsp;split&nbsp;into&nbsp;separate<br>
+MultiTags&nbsp;based&nbsp;on&nbsp;the&nbsp;stimulus&nbsp;type&nbsp;(label).<br>
+:rtype:&nbsp;None</tt></dd></dl>
  <dl><dt><a name="-write_single_da"><strong>write_single_da</strong></a>(mneraw, block)</dt></dl>
  <dl><dt><a name="-write_stim_tags"><strong>write_stim_tags</strong></a>(mneraw, block, split)</dt></dl>
 </td></tr></table><p>

+ 15 - 0
mnetonix.py

@@ -23,6 +23,9 @@ Command line script for reading EDF and BrainVision files using MNE
 (mne-python) and storing the data and metadata into a NIX file.  Supports
 reading montage files for recording channel locations.
 
+To include in a script, call the 'write_raw_mne()' and provide a NIX filename
+and MNE Raw structure as arguments.
+
 NIX Format layout
 =================
 
@@ -250,6 +253,18 @@ def create_stimulus_multi_tag(stimtuples, block, mneraw, mtagname="Stimuli"):
 
 def write_raw_mne(nfname, mneraw,
                   split_data_channels=False, split_stimuli=False):
+    """
+    Writes the provided Raw MNE structure to a NIX file with the given name.
+
+    :param nfname: Name for the NIX file to write to. Existing file will be
+    overwritten.
+    :param mneraw: An MNE Raw structure (any mne.io.BaseRaw subclass).
+    :param split_data_channels: If True, each raw data channel will be stored
+    in a separate DataArray.
+    :param split_stimuli: If True, stimuli will be split into separate
+    MultiTags based on the stimulus type (label).
+    :rtype: None
+    """
     mneinfo = mneraw.info
     extrainfo = mneraw._raw_extras