Skip to content

Fetch imaging modality options from an API endpoint instead of a using hardcoded list #643

@rmanaem

Description

@rmanaem

Having run into the #642 we realized it might no longer be viable to store imaging modality options as a hard coded list on the query tool side and instead they should be retrieved from an API endpoint just like diagnosis and assessment tool options.

Since we will soon have more modalities, we could switch to color-coding them by the BIDS datatype (anat, func, etc.) instead of assigning a distinct color per suffix. These datatypes should be able to be read from a config file - see neurobagel/communities#43.

Tasks:

  • Fetch imaging modality options from the API (nb:Image) the same way diagnoses/assessments are retrieved, replacing the hardcoded constants.
  • Store modality metadata (Label, TermURL, abbreviation, data_type) and use the metadata to map result data to UI labels.
  • Generate a distinct color for modality based on DataType
    • Filter out modalities that miss DataType or Abbreviation
  • Update convertURIToLabel conversion logic to use fetched modality metadata instead of the static map.
  • Update affected component and e2e tests
  • Add tests for the new API request endpoint

References:

Metadata

Metadata

Assignees

Labels

releasedThis issue/pull request has been released.

Projects

Status

Review - Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions