Additional flags used to deface 7T data #15
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Stuff outside the head (in the posterior region) is a dielectric pad.
After using the default pydeface:
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:
It can be seen that the defacing still fails with certain contrasts however succeeds with proton density weighted image.
After using
--applyto
argument:Defacing mask based on the proton density weighted image applied to other contrasts gives the best result.
Second example to show the new additional arguments is a set of MP2RAGE data:
Original images:
After using the default pydeface:
It can be seen that defacing fails in all images,
After changing the cost function to normalized mutual information:
Defacing was successful in T1 and UNI images.
After using
--applyto
argument: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 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.