aramis-lab / clinica

Software platform for clinical neuroimaging studies
http://www.clinica.run/
Other
220 stars 74 forks source link

ADNI_to_BIDS utils : `load_clinical_csv`, hidden csv file matching, issue #1163 #1195

Open HuguesRoy opened 4 months ago

HuguesRoy commented 4 months ago

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:

the pattern is "ADNIMERGE"+ r"(_\d{1,2}[A-Za-z]{3}\d{4})?.csv", only the correct file will be returned.

AliceJoubert commented 4 months ago

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 ?