-2. **Using a text editor**. This is the most powerful way to create a bidsmap template but requires more indepth knowledge of `YAML <http://yaml.org/>`__ and of how BIDScoin identifies different acquisitions in a protocol given a bidsmap. How you can customize your template is well illustrated by the DCCN template bidsmap (``[path_to_bidscoin]/heuristics/bidsmap_dccn.yaml``). If you open that template, there are a few things to take notice of (as shown in the template snippet below). First, you can see that the DCCN template makes use of YAML `anchors and aliases <https://blog.daemonl.com/2016/02/yaml.html>`__ (to make maintanance more sustainable). The second thing to notice is that, of the first run, all values of the attribute dictionary are empty, meaning that it won't match any run / will be ignored. In that way, however, the subsequent runs that alias (``<<: *anatattributes_dicom``) this anchor (``&anatattributes_dicom``) will inherit only the keys and can inject their own values, as shown in the second run. The first run of each modality sub-section (like ``anat``) also serves as the default bidsmapping when users manually overrule / change the bids modality using the `bidsmapper <workflow.html#step-1a-running-the-bidsmapper>`__ GUI. Finally, it is important to take notice of the usage of the lists of values (any of which can match) and `Unix shell-style wildcards <https://docs.python.org/3/library/fnmatch.html>`__ (see ``DICOM Attributes``).
0 commit comments