Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserving initial folder structure #170

Closed
jkarten95 opened this issue Apr 8, 2021 · 7 comments
Closed

Preserving initial folder structure #170

jkarten95 opened this issue Apr 8, 2021 · 7 comments

Comments

@jkarten95
Copy link

Hi All,

In reading the documentation, I see that I can output a newly de-identified .dcm file to a specified folder. I was wondering if there is a way to de-identify "in place" instead of sending to a new folder and thereby preserving the original folder structure? I ask because the imaging studies are kept in complex folder structures that we'd like to maintain. Thanks for any advice!

Jordan

@vsoch
Copy link
Member

vsoch commented Apr 8, 2021

Could you show me the exact command you are running so I can take a look? There are several ways to interact with deid and I want to make sure we are discussing the same one.

@jkarten95
Copy link
Author

Sure!

base = '/folder/with/original/study/directories'
dicom_files = list(get_files(base))

#other code

cleaned_files = replace_identifiers(dicom_files=dicom_files, deid=recipe, ids=items, save=True, overwrite=True, 
output_folder='/folder/for/new/files'). 

I am wondering if instead of stripping the .dcm files from the original location, can they be saved in their original folders? Essentially I have multiple imaging studies in one directory.

@vsoch
Copy link
Member

vsoch commented Apr 8, 2021

@jkarten95 did you try setting the same output folder as where you already have the files, and then overwrite to True?

@vsoch
Copy link
Member

vsoch commented Apr 8, 2021

Actually scratch that - just leave the output folder as None and set overwrite to true. See here:

if output_folder is None:

@vsoch
Copy link
Member

vsoch commented Apr 8, 2021

Based on reading the code, that should accomplish what you want (let me know if it does not!)

@jkarten95
Copy link
Author

That worked perfectly! Thanks for the help.

@vsoch
Copy link
Member

vsoch commented Apr 9, 2021

Definitely! Happy to do so :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants