.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/run_fieldtrip_IF.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_run_fieldtrip_IF.py: .. _ft_seeg_example: ========================================= Apply bipolar montage to depth electrodes ========================================= This scripts shows a very simple example on how to create an Interface wrapping a desired function of a Matlab toolbox (|FieldTrip|). .. |FieldTrip| raw:: html FieldTrip The **input** data should be a **.mat** file containing a FieldTrip data struct .. GENERATED FROM PYTHON SOURCE LINES 16-27 .. code-block:: default # Authors: Annalisa Pascarella # License: BSD (3-clause) import os.path as op import ephypype from ephypype.nodes.FT_tools import Reference from ephypype.datasets import fetch_ieeg_dataset .. GENERATED FROM PYTHON SOURCE LINES 28-29 Let us fetch the data first. It is around 675 MB download. .. GENERATED FROM PYTHON SOURCE LINES 29-54 .. code-block:: default base_path = op.join(op.dirname(ephypype.__file__), '..', 'examples') data_path = fetch_ieeg_dataset(base_path) import json # noqa import pprint # noqa params = json.load(open("params.json")) pprint.pprint({'time frequency parameters': params["tfr"]}) ft_path = params["tfr"]['fieldtrip_path'] refmethod = params["tfr"]['refmethod'] channels_name = params["tfr"]['channels_name'] # channels_name = '{\'RAM*\', \'RHH*\', \'RTH*\', \'ROC*\', \'LAM*\',\'LHH*\', \'LTH*\'}' # noqa # Now we call the interface Reference to apply a bipolar montage to sEEG data reference_if = Reference() reference_if.inputs.data_file = op.join(data_path, 'SubjectUCI29_data.mat') reference_if.inputs.channels = channels_name reference_if.inputs.ft_path = ft_path reference_if.inputs.refmethod = refmethod reference_if.inputs.script = '' out = reference_if.run() print('Rereferenced data saved at {}'.format(out.outputs.data_output)) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_auto_examples_run_fieldtrip_IF.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: run_fieldtrip_IF.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: run_fieldtrip_IF.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_