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

How to save defaced output in a different directory (from input) when using --applyto argument. #50

Open
anandsaini024 opened this issue Mar 6, 2023 · 7 comments

Comments

@anandsaini024
Copy link

I am using pydeface 2.0.2 on docker. Following is the command I am using to deface my multiple .nii files using --applyto argument:

docker run -v /home/ .. /outputs:/output -v /home/ .. /inputs/:/input pydeface:0.1.2 pydeface --outfile /output/defaced.nii.gz --applyto /input/*.nii.gz --outfile /output/ --force /input/sample_file_1.nii.gz

Pydeface command is basically as follows:

pydeface --outfile /output/defaced.nii.gz --applyto /input/*.nii.gz --outfile /output/ --force /input/sample_file_1.nii.gz

This works fine and save the defaced output in my input directory and not in the outfile directory where I want to store the output. Can you please let me know what corrections can be made to save defaced output in a separate directory to that of input using --applyto argument?

Thanks

@ofgulban
Copy link
Collaborator

ofgulban commented Mar 7, 2023

Hi @anandsaini024 , thanks for your question.

Looking at the source, I see that the --applyto uses its input path as the output. So I think the extra --outfile arguments you use are actually not doing anything with regards to where the applyto outputs are saved.

Quickest workaround would be if you use a few move commands to move the applyto outputs to the folders you want them to be. Would this work for you? Otherwise, we need to modify the behavior make a new release of pydeface etc. which might take some time in my schedule.

@anandsaini024
Copy link
Author

Quickest workaround would be if you use a few move commands to move the applyto outputs to the folders you want them to be. Would this work for you? Otherwise, we need to modify the behavior make a new release of pydeface etc. which might take some time in my schedule.

Using move commands will not help in my case as I have a problem with the outputs saving in the same path to begin with ( because my input directory is read-only). Can you think of anything else that could be helpful in my case? Also, let me know if you think there should be any modification in pydeface.
Thanks

@ofgulban
Copy link
Collaborator

ofgulban commented Mar 7, 2023

I see, ok then I can have a look at this on thursday, or latest friday. Will update you.

@anandsaini024
Copy link
Author

Sure, Thanks!

ofgulban added a commit that referenced this issue Mar 9, 2023
@ofgulban
Copy link
Collaborator

ofgulban commented Mar 9, 2023

Hi @anandsaini024 , try cloning pydeface from the devel branch and install it (if done correctly you should see pydeface 2.0.3). See the new --outdir argument. Using this should export all your outputs into a custom output directory.

@anandsaini024
Copy link
Author

Thank you @ofgulban

@ofgulban
Copy link
Collaborator

@anandsaini024 , I assume everything is working. It might take some time for me to release this update. So, if you encounter any bugs related to this issue feel free to post here.

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

No branches or pull requests

2 participants