Skip to content

Commit 233c0b4

Browse files
committed
Inheritance principle: Additional example
New example serves only to demonstrate how one metadata file can be applicable to multiple data files; this is of a lower "complexity" of logic than what was previously the first example. Note that "_part-(real|imag)" was used for this example instead of the more common "_part-(mag|phase)" as the latter necessitates the specification of units for only the phase component, which would therefore require more than one metadata file to exploit the inheritance principle.
1 parent d5782c6 commit 233c0b4

1 file changed

Lines changed: 26 additions & 3 deletions

File tree

src/02-common-principles.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,30 @@ Corollaries:
605605
1. Removal of key-values present in files earlier in the ordering based on the content
606606
of files later in the ordering is not possible.
607607

608-
Example 1: Demonstration of inheritance principle
608+
Example 1: Single metadata file applicable to multiple data files
609+
610+
{{ MACROS___make_filetree_example(
611+
{
612+
"sub-01": {
613+
"anat": {
614+
"sub-01_part-real_T2starw.nii.gz": "",
615+
"sub-01_part-imag_T2starw.nii.gz": "",
616+
"sub-01_T2starw.json": "",
617+
}
618+
}
619+
}
620+
) }}
621+
622+
For file `sub-01_T2starw.json`, there does not exist an immediately corresponding data file
623+
with the same basename but different file extension; for instance `sub-01_T2starw.nii.gz`.
624+
It is however applicable to both data files `sub-01_part-real_T2starw.nii.gz` and
625+
`sub-01_part-imag_T2starw.nii.gz` as per rule 2, since it possesses the same suffix "`T2starw`"
626+
and its entities are a subset of those present in the data filename in both cases. This storage
627+
structure is appropriate for such data given that the real and imaginary components of complex
628+
image data would be yielded by a single execution of an MRI sequence, with a fixed common set
629+
of acquisition parameters.
630+
631+
Example 2: Ordered loading of JSON data
609632

610633
{{ MACROS___make_filetree_example(
611634
{
@@ -648,7 +671,7 @@ the value for field "`RepetitionTime`" is therefore overridden to the value `3.0
648671
The value for field "`EchoTime`" remains applicable to that image, and is not unset by its
649672
absence in the metadata file at the lower level (rule 4.c; corollary 3.b).
650673

651-
Example 2: Complex inheritance scenario
674+
Example 3: Complex inheritance scenario
652675

653676
{{ MACROS___make_filetree_example(
654677
{
@@ -713,7 +736,7 @@ file is as follows:
713736
- `task-rest_bold.json`
714737
- `sub-01/sub-01_bold.json`
715738

716-
Example 3: Violation of inheritance principle
739+
Example 4: Violation of inheritance principle
717740

718741
{{ MACROS___make_filetree_example(
719742
{

0 commit comments

Comments
 (0)