All these patterns could also be better represented with dataclasses since they have a defined structure. Something like that would already enrich the code:
@dataclass
class Pattern:
pattern: str
description: str
needed_pipeline: str
Also, a lot of these patterns could be factorized in functions taking some parameters (the hemisphere, the name of the atlas, the pet tracer...) instead of being copy-pasted.
The module
clinica.utils.input_files
defines a long list of dictionaries which are used as query patterns in theclinica_file_reader
functions.First of all, there are a lot of these objects which are not used in the code base. A few examples:
We clearly should get rid of them.
All these patterns could also be better represented with dataclasses since they have a defined structure. Something like that would already enrich the code:
Also, a lot of these patterns could be factorized in functions taking some parameters (the hemisphere, the name of the atlas, the pet tracer...) instead of being copy-pasted.
For example this
https://github.com/aramis-lab/clinica/blob/954d4a950aa341acf54059c1e93b27c9de18fbc2/clinica/utils/input_files.py#L51-L61
could easily be factorized in: