Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operation: Maximal use of Inheritance Principle; first pass #2

Open
7 tasks
Lestropie opened this issue May 3, 2024 · 0 comments
Open
7 tasks

Operation: Maximal use of Inheritance Principle; first pass #2

Lestropie opened this issue May 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Lestropie
Copy link
Owner

For a given input BIDS dataset, make maximal use of the Inheritance Principle.
Wherever possible, define metadata fields only once, to then be associated with all relevant data files according to the Inheritance Principle (and conversely not be associated with data files to which that particular field is not applicable).

I am intentionally listing this operation before describing the corresponding operation under BIDS 1.0 because I believe that from a technical standpoint this operation will be simpler under various BIDS 2.0 proposals. This will hopefully make more sense once I later list a separate Issue for automating maximal use of the Inheritance Principle under BIDS 1.0.

I'm going to attempt to describe the algorithm by which this operation would work. However I can't guarantee that it is most definitely the right algorithm. It would likely take a bit of experimentation with the first attempt at an implementation to figure out whether the proposed algorithm is flawed.

  • For all data files in the input BIDS dataset:
    • Build complete set of metadata fields associated with that data file according to the Inheritance Principle
    • Add metadata to global dictionary, explicitly associating each metadata key and corresponding value with that particular data file
  • For every unique metadata key-value pair in the global dictionary:
    (noting that for a given metadata key, there could be different data files with different values for that key)
    • While there still remain data files to which that metadata key-value have not yet been associated:
      (whether using the Inheritance Principle or otherwise)
      • Find the highest location in the filesystem hierarchy, and the minimal number of metadata file entities, that will exclusively associate that field only with data files for which that value of that metadata field is appropriate
      • Either create new metadata file, or append to existing metadata file at that location, based on that filesystem location & set of entities.

Note that this sort of approach intrinsically does not utilise overloading values of metadata fields at lower levels of the filesystem hierarchy, as is currently permitted by the Inheritance Principle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant