Comments (7)
Pydeface can be called as a script, so that should work. When you pip install it you will end up with a 'pydeface' CLI.
Let me know if that works - I originally developed the anonymiser feature to work with pydeface, but it looks like they may have refactored the code a bit since last time I used it.
from dcm2bids.
Another option is quickshear.
from dcm2bids.
I tried with pydeface, both directly put as an option in dcm2bids
call, and wrapped in a following simple script:
#!/bin/bash
pydeface --outfile $2 --verbose $1
I also made sure its executable. I get an error, that the output file from the subprocess call cannot be found and dcm2bids stops execution.
from dcm2bids.
You shouldn't need a shell script wrapper. Pydeface is a command line application. Try putting in the absolute path to pydeface instead of just the name. It might not be on path in the session you're running python in.
from dcm2bids.
Ok, it was a path issue, of different sort, thanks for the help.
Though, supply pydeface directly as an argument -a /home/hstojic/.pyenv/nipy/bin/pydeface
does not work. I get the following error:
INFO:dcm2bids:subprocess: /home/hstojic/.pyenv/nipy/bin/pydeface /media/hstojic/dataneuro/fnclearning_fmri/dBids/tmp_dcm2bids/sub-s087/002_20190128.MQ05073_FIL_MPRAGE_64ch_Head_20190128184304.nii.gz /media/hstojic/dataneuro/fnclearning_fmri/dBids/sub-s087/anat/sub-s087_T1w.nii.gz
INFO:dcm2bids:
usage: pydeface [-h] [--outfile path] [--force] [--applyto [...]]
[--cost mutualinfo] [--template path] [--facemask path]
[--nocleanup] [--verbose]
path
pydeface: error: unrecognized arguments: /media/hstojic/dataneuro/fnclearning_fmri/dBids/sub-s087/anat/sub-s087_T1w.nii.gz
------------
pydeface 2.0
------------
I think this is because new version of pydeface accepts a single argument, additional flags are needed for output file. Wrapping it in a shell script as in my previous comment works.
from dcm2bids.
Ah, got it. Thanks for looking into this.
from dcm2bids.
Thanks for reporting this.
It's now possible to add the option defaceTpl
in the configuration file.
For this version of pydeface : "defaceTpl": "pydeface -outfile {dstFile} {srcFile}"
from dcm2bids.
Related Issues (20)
- IntendedFor and Sources with only relative path to dataset root is now deprecated
- Two H1s in "How to use advanced configuration" prevent full TOC
- sidecar_changes doesn't support int / numerical objects
- Should this line be pointing to one of the sidecar files? HOT 2
- Typos in some files of the scaffold raise errors on the validator
- Creating several 3D images instead of a single 4D image. HOT 2
- New features or enh for next release
- post_op HOT 6
- Provide a Docker image that includes pydeface HOT 4
- [BUG] dcmbids binary
- Processing order issue ? ```"IntendedFor" No id found for 'IntendedFor' value 'XX'``` HOT 4
- KeyError: 'datatype' HOT 1
- TypeError in Acquisition.init() when running dcm2bids HOT 1
- `sidecar_changes` do not fetch all matches of the referenced description
- Error: Too many NIFTI images with the name HOT 1
- compKeys default for run numbering doesn't seem like a good one HOT 1
- Subprocess Error Assistance HOT 3
- Allowing for post_op command's output to be printed to stdout HOT 2
- Script removes task information from filenames. HOT 8
- bids validator not working properly HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dcm2bids.