Skip to content

Commit

Permalink
Update heuristic.rst
Browse files Browse the repository at this point in the history
Minor Wording Changes
  • Loading branch information
RayStick authored Mar 6, 2020
1 parent 438d458 commit 9176c3d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/heuristic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ It's the file ``heur_tutorial.py`` in ``phys2bids/phy2bids/heuristics/``::

return name

We can split this file into three parts: the initialisation, the dictionaries, and functional code
We can split this file into three parts: the initialisation, the dictionaries, and the functional code.

Initialisation
^^^^^^^^^^^^^^
Expand All @@ -78,13 +78,13 @@ Initialisation

def heur(physinfo, name, task='', acq='', direct='', rec='', run=''):

It's important **not to modify this part of the file**. Instead, you can copy paste it in your own heuristic file.
It's important **not to modify this part of the file**. Instead, you can copy and paste it into your own heuristic file.

This file looks like a python function, initialised by two mandatory parameters:
-``physinfo`` is the information used to label your file. **At the moment, it corresponds to the name of the input file itself**. This is what you need to build your heuristic.
-``name`` is an argument passed by the main script that contains part of the name of the file. Don't worry about this.

It also have another bunch of optional arguments that are empty by default. These are the labels you can add to your dictionaries, in order to construct the BIDsified name of your files.
The file also has another bunch of optional arguments that are empty by default. These are the labels you can add to your dictionaries, in order to construct the BIDsified name of your files.

The scripts imports ``fnmatch``, a nice python module that lets you use bash-like wildcards.

Expand Down Expand Up @@ -127,11 +127,11 @@ This is the core of the function, and the part that should be adapted to process
- ``acq`` is the optional entity for the `set of acquisition parameters <https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/01-magnetic-resonance-imaging-data.html#the-acq-entity>`_.
- ``direct`` is the equivalent of the ``dic`` entity, an optional entity for the phase encoding direction (see `here <https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/01-magnetic-resonance-imaging-data.html#task-including-resting-state-imaging-data>`_).

Note that one mandatory BIDs entity is missing: the **``sub`` entity**, correspondent to the subject label. This is because it has to be specified while calling ``phys2bids``, as it's explained in the `tutorial <howto.html#generating-outputs-in-bids-format>`_. The **session entity** can be specified in the same way. Moreover, if you have a **multifrequency file** there will be another entity, ``recording`` automatically added to those specified here, and containing the sample frequency of the different outputs.
Note that one mandatory BIDs entity is missing: the **``sub`` entity**, corresponding to the subject label. This is because it has to be specified while calling ``phys2bids``, as it's explained in the `tutorial <howto.html#generating-outputs-in-bids-format>`_. The **session entity** can be specified in the same way. Moreover, if you have a **multifrequency file** there will be another entity, ``recording`` automatically added to those specified here, and containing the sample frequency of the different outputs.

Let's try to read the first statement in the example:

*"If the name of the file (``physinfo``) contains the string ``'*tutorial*'``, then assign the entity ``task`` has value ``test``, the ``run`` is number ``00``, and the reconstruction used was ``labchart``"*
*"If the name of the file (``physinfo``) contains the string ``'*tutorial*'``, then assign the entity ``task`` with value ``test``, the ``run`` as number ``00``, and the reconstruction used as ``labchart``"*

Note that we used only a subset of possible entities.

Expand Down Expand Up @@ -179,9 +179,9 @@ There's a warning that will raise if the file wasn't able to process the input f
Using the heuristic file
------------------------

Once you modified your heuristic file or created a new one, you can save it anywhere you want, as a python script (``somename.py``). Check that the file is **executable**! Then, you will have to call ``phys2bids`` using the ``-heur``, the ``-sub``, and optionally the ``-ses`` arguments::
Once you modified your heuristic file or created a new one, you can save it anywhere you want, as a python script (``somename.py``). Check that the file is **executable**! Then, you will have to call ``phys2bids`` using the ``-heur``, the ``-sub``, and optionally the ``-ses``, arguments::

phys2bids -in tutorial_file.txt -chtrig 1 -outdir /home/arthurdent/physio_bids -ntp 158 -tr 1.2 -thr 0.735 -heur /home/arthurdent/git/phys2bids/phys2bids/heuristics/heur_tutorial.py -sub 006 -ses 42
phys2bids -in tutorial_file.txt -chtrig 1 -outdir /home/arthurdent/physio_bids -ntp 158 -tr 1.2 -thr 0.735 -heur /home/arthurdent/git/phys2bids/phys2bids/heuristics/heur_tutorial.py -sub 006 -ses 01

Remember to **specify the full path** to the heuristic file. A copy of the heuristic file will be saved in the site folder.
You can find more information in the `tutorial <howto.html#generating-outputs-in-bids-format>`_.
You can find more information in the `tutorial <howto.html#generating-outputs-in-bids-format>`_.

0 comments on commit 9176c3d

Please sign in to comment.