Replacing the run number (for ex, 02) sometimes results in replacing the subject ID since the entire path (including sub-REV002, for example) is searched
|
os.rename(targetfile_fullpath, targetfile_fullpath.replace(found_file[run_index + 5:run_index + 7], new_runnum)) |
I made a new replacement string:
new_runstr = 'run-' + new_runnum
And replaced the os.rename() line with this:
os.rename(targetfile_fullpath, targetfile_fullpath.replace(found_file[run_index + 1:run_index + 7], new_runstr))
Replacing the run number (for ex, 02) sometimes results in replacing the subject ID since the entire path (including sub-REV002, for example) is searched
REV_scripts/org/dcm2bids/bidsQC.py
Line 357 in 6cd0943
I made a new replacement string:
new_runstr = 'run-' + new_runnum
And replaced the os.rename() line with this:
os.rename(targetfile_fullpath, targetfile_fullpath.replace(found_file[run_index + 1:run_index + 7], new_runstr))