Giter VIP home page Giter VIP logo

Comments (7)

jooh avatar jooh commented on September 13, 2024

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.

neurolabusc avatar neurolabusc commented on September 13, 2024

Another option is quickshear.

from dcm2bids.

hstojic avatar hstojic commented on September 13, 2024

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.

jooh avatar jooh commented on September 13, 2024

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.

hstojic avatar hstojic commented on September 13, 2024

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.

jooh avatar jooh commented on September 13, 2024

Ah, got it. Thanks for looking into this.

from dcm2bids.

cbedetti avatar cbedetti commented on September 13, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.