Closed KarthikMasi closed 1 year ago
We avoided rmtree on purpose because it is so dangerous. Why did rmdir fail? If there are residual files in there they should be cleared out. If there is ever something wrong with sess_path
the rmtree could do some bad stuff
Also, XnatToBids just names subjects and sessions as "sub-01" and "ses-01" when used with Xnatdownload. I will add a patch for the same.
There is already a command line option --xnat_tag
for Xnatdownload that is supposed to use the XNAT subj/session names for the BIDS files - is it not working?
Might be better to use tempfile.TemporaryDirectory in a with
context to store the intermediates, although that can complicate debugging. Would completely avoid the rmtree/rmdir dilemma though
…moves it
Tested this against a test BIDS directory with correct bids mapping and it works.