poldracklab / pydeface

defacing utility for MRI images
MIT License
112 stars 42 forks source link

Outputs to judge success? (aka face still included) #11

Open jlhanson5 opened 7 years ago

jlhanson5 commented 7 years ago

Hello Pydeface repo,

I was just trying to deface some data so that I can put it up on openneuro, but ran into some issues with pydeface. I tried it w/ one sub and had success... However, when I tried to deface a pediatric T1 volume, the face was still present (screengrab below).

deface

Are there other outputs I'm missing from the program that might give some indication of success? The software looked to run without error (command-line output below), but I wondered if there were other files I should inspect to understand why things didn't work out.

jamielh@pfc:~/Volumes/Hanson/Duke_PAC/BIDS_test/derivatives/sub-2014031318263/anat$ pydeface.py sub-${BIDS_sub}_T1w.nii.gz
('defacing', 'sub-2014031318263_T1w.nii.gz')
jamielh@pfc:~/Volumes/Hanson/Duke_PAC/BIDS_test/derivatives/sub-2014031318263/anat$ ls
sub-2014031318263_T1w_defaced.nii.gz  sub-2014031318263_T1w.nii.gz

Any suggestions are greatly appreciated!

Thanks much! Jamie.

vsoch commented 7 years ago

hey @jlhanson5 ! I'm not an expert on this, but I think that the process is based on warping the image to a facemask (likely in MNI 152 space?) and importantly, created with adults and not created on pediatric data. I would try taking a look at the mask, and seeing if you are able to create a version that is more properly fitting to your data. If you'd like to make a contribution, I would suggest the following:

Hope that helps, or is at least something to try!

jlhanson5 commented 7 years ago

Thanks for that head's up! I ended up flipping my image to match the facemask & template (mean_reg2mean) and that improved things (image below, red = the portions of the image left after de-facing).

deface

One potential that might be useful for pediatric data is to try to use ANTS SyN quick registration (to improve any potential misregistration). I'm a python newbie, but maybe I'll try to work on that moving forward...

poldrack commented 7 years ago

I wouldn't think that it should be a problem as long as the children aren't too young (e.g. below 7 or so). there is pretty good evidence that adult normalization templates work pretty well in that case ( https://www.ncbi.nlm.nih.gov/pubmed/12482076)

On Fri, Sep 1, 2017 at 7:27 AM, jlhanson5 notifications@github.com wrote:

Thanks for that head's up! I ended up flipping my image to match the facemask & template (mean_reg2mean) and that improved things (image below, red = the portions of the image left after de-facing).

[image: deface] https://user-images.githubusercontent.com/7240261/29974049-aab51496-8eff-11e7-921c-69ac3d18c487.png

One potential that might be useful for pediatric data is to try to use ANTS SyN quick registration (to improve any potential misregistration). I'm a python newbie, but maybe I'll try to work on that moving forward...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/poldracklab/pydeface/issues/11#issuecomment-326595001, or mute the thread https://github.com/notifications/unsubscribe-auth/AA1KkCUuFFMymI27iA-jnaJWzHztK6zwks5seBRUgaJpZM4PKL7m .

-- Russell A. Poldrack Albert Ray Lang Professor of Psychology Professor (by courtesy) of Computer Science Bldg. 420, Jordan Hall Stanford University Stanford, CA 94305

poldrack@stanford.edu http://www.poldracklab.org/

vsoch commented 7 years ago

It sounds like it was a registration issue with the template then, @poldrack is right that adult brain maps work pretty good! Please post if you need any more help, and feel free to close the issue.

lytlemn commented 6 years ago

I am having the same issue with the face remaining in pediatric data that is looking to be uploaded to openneuro. I know very little about python, did using the ANTS quick registration fix the issue? If so how could this be incorporated? Thanks!

chrisgorgo commented 6 years ago

You can also try: https://surfer.nmr.mgh.harvard.edu/fswiki/mri_deface