I have made somewhat extensive changes to the interface, these are:
Using entry point instead of script (command line call is just pydeface now instead of pydeface.py) to have a flexible structure for adding additional options.
Usage can now be accessed with pydeface --help or pydeface -h
--force flag to overwrite previous results.
--template and --facemask optional arguments to allow custom template and defacing mask instead of the defaults.
--cost argument to select other fsl-flirt cost function options.
--applyto argument, which accepts multiple paths to apply defacing based on one image to other images.
I have needed these options to deface images with several contrasts acquired at 7T. First example is a set of MPRAGE data:
Original images:
Stuff outside the head (in the posterior region) is a dielectric pad.
It can be seen that the defacing fails with certain contrasts (T1w, SI-T1w, T2*w). Even in PDw image where it mostly succeeds it removes a small chunk from the frontal lobe.
After changing the cost function to normalized mutual information:
Defacing mask based on the T1 (or UNI) image applied to other contrasts gives the best result.
I have tested the new command line interface with several 3T-7T data, it seems that everything works as it was (including exceptions etc.) so the previous users should see no difference other than making the command line call as pydeface instead of pydeface.py.
If you decide to merge this, I would recommend to first release the current version (pydeface 1.1) and then merge this PR in case if people still want to conveniently find the old version.
Also, let me know if you have any suggestions about the interface.
Hi again,
I have made somewhat extensive changes to the interface, these are:
pydeface
now instead ofpydeface.py
) to have a flexible structure for adding additional options.pydeface --help
orpydeface -h
--force
flag to overwrite previous results.--template
and--facemask
optional arguments to allow custom template and defacing mask instead of the defaults.--cost
argument to select other fsl-flirt cost function options.--applyto
argument, which accepts multiple paths to apply defacing based on one image to other images.I have needed these options to deface images with several contrasts acquired at 7T. First example is a set of MPRAGE data:
Original images:
After using the default pydeface:
After changing the cost function to normalized mutual information:
After using
--applyto
argument:Second example to show the new additional arguments is a set of MP2RAGE data:
Original images:
After using the default pydeface:
After changing the cost function to normalized mutual information:
After using
--applyto
argument:I have tested the new command line interface with several 3T-7T data, it seems that everything works as it was (including exceptions etc.) so the previous users should see no difference other than making the command line call as
pydeface
instead ofpydeface.py
.If you decide to merge this, I would recommend to first release the current version (pydeface 1.1) and then merge this PR in case if people still want to conveniently find the old version.
Also, let me know if you have any suggestions about the interface.