Skip to content

Commit

Permalink
Merge branch 'rewrite_inheritance_principle' into inheritance_unsetti…
Browse files Browse the repository at this point in the history
…ng_corollary

Conflicts:
	src/02-common-principles.md
  • Loading branch information
Lestropie committed Jan 12, 2022
2 parents 2590d0a + 7bc7ad5 commit 1141cf7
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions src/02-common-principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -550,18 +550,18 @@ for more information.
1. The metadata filename does not include any entity absent from the data filename.

1. A metadata file MUST NOT have a filename that would be otherwise applicable
to some data file based on rules 2.2 and 2.3 but is made inapplicable based on its
location in the directory structure as per rule 2.1.
to some data file based on rules 2.b and 2.c but is made inapplicable based on its
location in the directory structure as per rule 2.a.

1. There MUST NOT be multiple metadata files applicable to a data file at one level
of the directory hierarchy.

1. If multiple metadata files are applicable to a given data file:
1. If multiple metadata files satisfy criteria 2.a-c above:

1. For [tabular files](#tabular-files) and other simple metadata files
(for instance, [`bvec` / `bval` files for diffusion MRI](#04-modality-specific-files/01-magnetic-resonance-imaging#required-gradient-orientation-information),
only the file lowest in the filesystem hierarchy SHALL be treated as being
associated with that data file.
(for instance, [`bvec` / `bval` files for diffusion MRI](#04-modality-specific-files/01-magnetic-resonance-imaging#required-gradient-orientation-information)),
accessing metadata associated with a data file MUST consider only the
applicable file that is lowest in the filesystem hierarchy.

1. For [JSON files](#key-value-files-dictionaries), key-values are loaded
from files from the top of the directory hierarchy downwards, such that
Expand Down Expand Up @@ -602,33 +602,33 @@ Example 1: Demonstration of inheritance principle
}
) }}

Contents of file "task-rest_bold.json":
Contents of file `task-rest_bold.json`:

{{ MACROS___make_metadata_table(
{
"EchoTime": 40.0,
"RepetitionTime": 1000.0,
}
) }}
```JSON
{
"EchoTime": 40.0,
"RepetitionTime": 1000.0
}
```

Contents of file "sub-01/func/sub-01_task-rest_acq-longtr_bold.json":
Contents of file `sub-01/func/sub-01_task-rest_acq-longtr_bold.json`:

{{ MACROS___make_metadata_table(
{
"RepetitionTime": 3000.0,
}
) }}
```JSON
{
"RepetitionTime": 3000.0
}
```

When reading image `sub-01/func/sub-01_task-rest_acq-default_bold.nii.gz`, only
metadata file `task-rest_bold.json` is read; file
`sub-01/func/sub-01_task-rest_acq-longtr_bold.json` is inapplicable as it contains
entity "`acq-longtr`" that is absent from the image path (rule 2.3). When reading image
entity "`acq-longtr`" that is absent from the image path (rule 2.c). When reading image
`sub-01/func/sub-01_task-rest_acq-longtr_bold.nii.gz`, metadata file
`task-rest_bold.json` at the top level is read first, followed by file
`sub-01/func/sub-01_task-rest_acq-longtr_bold.json` at the bottom level (rule 5.2);
the value for field "`RepetitionTime`" is therefore overridden to the value 3000.0.
`sub-01/func/sub-01_task-rest_acq-longtr_bold.json` at the bottom level (rule 5.b);
the value for field "`RepetitionTime`" is therefore overridden to the value `3000.0`.
The value for field "`EchoTime`" remains applicable to that image, and is not unset by its
absence in the metadata file at the lower level (rule 5.2; corollary 3).
absence in the metadata file at the lower level (rule 5.b; corollary 3).

Example 2: Impermissible use of multiple metadata files at one directory level (rule 4)

Expand Down

0 comments on commit 1141cf7

Please sign in to comment.