Inria-Empenn / shanoir_downloader

Scripts to download, check and anonymize datasets
GNU General Public License v3.0
2 stars 3 forks source link

Adding shanoir2bids log files #2

Closed quentinduche closed 2 years ago

quentinduche commented 2 years ago

Few modifications of the shanoir2bids.py script : 1) A log file is saved. It tracks all the downloading/renaming process so that a final BIDS filename can be directly associated to the dataset ID in Shanoir. 2) When a new file is downloaded and has the same filename as an already existing file, checks two fields in the json content to make the difference between a duplicate (a new download of the same file is performed, we do not erase) and a second run (rsometimes data are re-acquired and then a "-run2" suffix is added to the BIDS filename)

arthursw commented 2 years ago

Nice, for info ; you can use the with open(file_path, 'r') as f: syntax in python so that you don't have to remember to close the file once used (you can skip the f.close() lines).