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)
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).
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)