## page was renamed from Automated Defacing Tools
## page was renamed from mri_deface
== Automated Defacing Tools ==
[[https://surfer.nmr.mgh.harvard.edu/fswiki/MiDeFace|See MiDeFace, our newest tool for defacing]]

{{attachment:defacing_figure.jpg}}

See also [[http://www.na-mic.org/Wiki/index.php/Mbirn:_Defacer_for_structural_MRI|MBIRN page]]

Cite this paper is using mri_deface: [[http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2408762/|A Technique for the Deidentification of Structural Brain MR Images]]

Note: A license file is no longer necessary to use these tools:

 * [[https://surfer.nmr.mgh.harvard.edu/pub/dist/mri_deface/mri_deface_linux|mri_deface v1.22 for Linux]]
 * [[https://surfer.nmr.mgh.harvard.edu/pub/dist/mri_deface/mri_deface_osx|mri_deface v1.22 for Mac OS]]
 * [[https://surfer.nmr.mgh.harvard.edu/pub/dist/mri_deface/talairach_mixed_with_skull.gca.gz|talairach_mixed_with_skull.gca]]
 * [[https://surfer.nmr.mgh.harvard.edu/pub/dist/mri_deface/face.gca.gz|face.gca]]

Use gunzip to decompress these downloads, ie.:

{{{
mv mri_deface_linux mri_deface
chmod a+x mri_deface
gunzip talairach_mixed_with_skull.gca.gz
gunzip face.gca.gz
}}}

The command usage is:

{{{
./mri_deface <input> talairach_mixed_with_skull.gca face.gca <output>
}}}

So as an example, to deface your T1-weighted input file, which can be a dicom or nifti, run:

{{{
./mri_deface T1.nii.gz talairach_mixed_with_skull.gca face.gca T1_defaced.nii.gz
}}}

You will need a volume viewer to view the resulting defaced file.  The freesurfer package includes the 'freeview' viewer, but there are many others capable of reading dicom and nifti volumes.  [[http://www.mccauslandcenter.sc.edu/mricro/mricron/|MRIcron]] is a good option (use MRIcron, not MRIcro, because you will want nifti support).

Sample input before and after defacing:

{{attachment:sample_T1_input.jpg}}

{{attachment:sample_T1_input_defaced.jpg}}