clinica
clinica copied to clipboard
ADNI_to_BIDS utils : `load_clinical_csv`, hidden csv file matching, issue #1163
Fix issue #1163
Change re.search by re.match.
It will avoid hidden file matching by constraining to an exact match with the pattern
if we have two files:
- correct file:
ADNIMERGE_25Apr2024.csv - hidden file:
.ADNIMERGE_25Apr2024.csv
the pattern is "ADNIMERGE"+ r"(_\d{1,2}[A-Za-z]{3}\d{4})?.csv", only the correct file will be returned.
I would prefer changing the rglob regex to not consider hidden files at all (either check on beginning of string or different rglob match but I would need to check how to). WDYT @NicolasGensollen ?
Closed by #1343