Closed vpapaioannou closed 3 years ago
@vpapaioannou the purpose of the overwrite
argument is that, when set to True, if the file already exists it will write over it, exactly as you've specified. The default is set to False, as a protection to the user that might be writing over an existing file they didn't know about.
I want to have both files e.g. same file name from two different sources saved in a way reflecting the different origin.
The organization of your output folders is up to you. If you want to save reflecting a different origin, then I'd just call the function twice with two output folders with different roots.
replace_identifiers(files_subject1, save=True, output_folder="/tmp/subject1")
replace_identifiers(files_subject1, save=True, output_folder="/tmp/subject2")
You can also just change the input file names to reflect what you need.
When running
replace_identfiers
withsave = True
,output_folder = myoutput
andoverwrite = False
it seems that file e.g./a/b/c.dcm
is saved asmyoutput/c.dcm
. However, if there is another filea/d/c.dcm
then there is a conflict and errorERROR image1.dcm already exists, overwrite set to False. Not writing.
is thrown.Then, the feature request is to be able to save the files as
myoutput/b/c.dcm
andmyoutput/d/c.dcm
especially when the absolute path of the files is known.Could that be possible? Would you like me to do that?