Skip to content

Commit f4e4896

Browse files
authored
Merge pull request #681 from dbic/enh-docs-heuristic
Add description of placeholders which could be used in the produced templates
2 parents a77541c + f1d058c commit f4e4896

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/heuristics.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,24 @@ Conversion outputs are defined as keys, a `tuple` consisting of three elements:
2828
- `None` - a historical artifact (corresponds to some notion of
2929
``annotation_class`` no living human is aware about)
3030

31+
The following details of the sequences could also be used as a ``{detail}`` in the conversion keys:
32+
33+
- ``item``: an index of seqinfo (e.g., ``1``),
34+
- ``subject``: a subject label (e.g., ``qa``)
35+
- ``seqitem``: sequence item, index with a sequence/protocol name (e.g., ``3-anat-scout_ses-{date}``)
36+
- ``subindex``: an index within the ``seqinfo`` (e.g., ``1``),
37+
- ``session``: empty (no session) or a session entity (along with ``ses-``, e.g., ``ses-20191216``),
38+
- ``bids_subject_session_prefix``: shortcut for BIDS file name prefix combining subject and optional session (e.g., ``sub-qa_ses-20191216``),
39+
- ``bids_subject_session_dir``: shortcut for BIDS file path combining subject and optional session (e.g., ``sub-qa/ses-20191216``).
40+
3141
.. note:: An example conversion key
3242

3343
``('sub-{subject}/func/sub-{subject}_task-test_run-{item}_bold', ('nii.gz', 'dicom'), None)``
3444

45+
or equivalent in `--bids` mode which would work also if there is a specified session
46+
47+
``('{bids_subject_session_dir}/func/{bids_subject_session_prefix}_task-test_run-{item}_bold', ('nii.gz', 'dicom'), None)``
48+
3549
The ``seqinfos`` parameter is a list of namedtuples which serves as a grouped and
3650
stacked record of the DICOMs passed in. Each item in `seqinfo` contains DICOM
3751
metadata that can be used to isolate the series, and assign it to a conversion
@@ -49,6 +63,7 @@ A dictionary of {``conversion key``: ``series_id``} is returned, where
4963
---------------------------------
5064

5165
A common helper function used to create the conversion key in ``infotodict``.
66+
But it is not used directly by HeuDiConv.
5267

5368
--------------------
5469
``filter_files(fl)``

0 commit comments

Comments
 (0)