Skip to content

Commit

Permalink
doc: fix code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennedemontalivet committed Mar 26, 2024
1 parent 6f4616f commit d5537da
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ Main features:
Install
-------

.. code:: bash
.. code-block:: bash
$ pip install micromed-io
\$ pip install micromed-io
Convert a Micromed (*.trc*) file to MNE (*.fif*) format
-------------------------------------------------------

.. code:: python
.. code-block:: python
from micromed_io.to_mne import create_mne_from_micromed_recording
mne_raw = create_mne_from_micromed_recording("path/to/file.TRC")
Expand All @@ -53,18 +53,18 @@ See details in next sections
Emulate Online Micromed TCP from *.trc* file
--------------------------------------------

.. code:: bash
.. code-block:: bash
$ mmio_emulate_trc --file=../data/sample.TRC --address=localhost --port=5123
\$ mmio_emulate_trc --file=../data/sample.TRC --address=localhost --port=5123
Emulate the online data stream of Micromed to test your real-time
platform. See all the arguments and adapt them:


.. code:: bash
.. code-block:: bash
$ mmio_emulate_trc --help # to see all arguments
\$ mmio_emulate_trc --help # to see all arguments
.. note::

Expand All @@ -75,9 +75,9 @@ platform. See all the arguments and adapt them:
Read TCP and push to LSL Stream
-------------------------------

.. code:: bash
.. code-block:: bash
$ mmio_tcp_to_lsl --address=localhost --port=5123
\$ mmio_tcp_to_lsl --address=localhost --port=5123
While receiving online data throug tcp, this command forward the data to
3 LSL stream outlets:
Expand All @@ -91,22 +91,22 @@ While receiving online data throug tcp, this command forward the data to

You can easily change the LSL parameters:

.. code:: bash
.. code-block:: bash
$ mmio_tcp_to_lsl --help # to see all arguments
\$ mmio_tcp_to_lsl --help # to see all arguments
Read TRC file
-------------

.. code:: python
.. code-block:: python
from micromed_io.trc import MicromedTRC
mmtrc = MicromedTRC("sample.TRC")
Then you have access to the *trc* data:

.. code:: python
.. code-block:: python
mmtrc.get_header()
mmtrc.get_markers()
Expand All @@ -125,9 +125,9 @@ Download ``tcp_to_lsl.py`` from the `github
repo <https://github.com/etiennedemontalivet/micromed-io>`__ in
*scripts/*

.. code:: bash
.. code-block:: bash
$ python tcp_to_lsl.py --address=localhost --port=5123
\$ python tcp_to_lsl.py --address=localhost --port=5123
..
Expand All @@ -145,17 +145,17 @@ shows you how to use it (see the ``PROCESS HERE`` comment). It uses a
**buffer** that mimics the **sliding window** and triggers each time it
is filled.

.. code:: python
.. code-block:: python
from micromed_io.buffer import MicromedBuffer
micromed_buffer = MicromedBuffer(epoch_duration=5, epoch_overlap=2.5)
To run the example, you can download and run the ``tcp_to_epoch.py`` script in ``extern/``
folder:

.. code:: bash
.. code-block:: bash
$ python tcp_to_epoch.py --epoch-size=5 --overlap=2.5
\$ python tcp_to_epoch.py --epoch-size=5 --overlap=2.5
.. note::

Expand All @@ -164,16 +164,16 @@ folder:
Rename TRC files with recording datetime
----------------------------------------

.. code:: bash
.. code-block:: bash
$ mmio_rename_trc --dirpath=./ --format=%Y%m%d-%H%M%S
\$ mmio_rename_trc --dirpath=./ --format=%Y%m%d-%H%M%S
Rename the TRC files of the given folder to include the recording date
in the filename. Output is : ``<filename>__<recording_date>.TRC``. The
format must be compliant with python `strftime format
codes <https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes>`__

.. code:: bash
.. code-block:: bash
mmio_rename_trc --help # to see help
Expand All @@ -182,11 +182,11 @@ Local install

Download the repo and:

.. code:: bash
.. code-block:: bash
$ conda env create -f environment.yml
$ conda activate mmio
$ poetry install
\$ conda env create -f environment.yml
\$ conda activate mmio
\$ poetry install
Please feel free to reach me if you want to contribute.

0 comments on commit d5537da

Please sign in to comment.