> For the complete documentation index, see [llms.txt](https://docs.ccv.brown.edu/bnc-user-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ccv.brown.edu/bnc-user-manual/xnat/anonymization-and-defacing-on-xnat/removing-identifiable-facial-features.md).

# Removing identifiable facial features

Some types of MRI scans (T1, T2, proton density-weighted) contain sufficient contrast, resolution, and coverage of the face region to allow the participant's face to be reconstructed. This could pose a potential re-identification risk for an anonymized dataset. We have set up a tool on XNAT called [mri reface](https://www.nitrc.org/projects/mri_reface), which replaces potentially identifiable facial features (left) with an average face (right). Replacing with an average face, rather than just removing the face, is intended to minimize the effect on future processing (Schwarz et al., 2021).

<div><figure><img src="https://4276957606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LtSg7ZEM6EHbi9iE84a%2Fuploads%2FdS2TiRJTeKdQQKORwNrw%2FScreenshot%202026-09-16%20at%2010.29.44%E2%80%AFAM.png?alt=media&amp;token=0d97d8b2-f2a3-414f-8658-98e139e5d826" alt="a detailed face reconstruction from a T1 anatomical scan"><figcaption><p>face reconstructed from a T1 MEMPRAGE scan</p></figcaption></figure> <figure><img src="https://4276957606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LtSg7ZEM6EHbi9iE84a%2Fuploads%2FCYwvy3HZnc89SY9tCJSG%2FScreenshot%202026-09-16%20at%2010.29.40%E2%80%AFAM.png?alt=media&amp;token=7e2f65de-8e32-49be-9e10-6830ec6b4b50" alt="a detailed reconstruction of the same T1 scan as on the left, but with the face replaced with an average face"><figcaption><p>the same scan, with face and ears replaced with an average face</p></figcaption></figure></div>

We can configure your XNAT project to run the refacing process automatically as new data arrives on XNAT (and we can help run it on existing data already on XNAT). When the processing is complete, you will see that in addition to your original DICOM files, there is a new folder called REFACED\_DICOM that contains the refaced anatomical data.&#x20;

<figure><img src="https://4276957606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LtSg7ZEM6EHbi9iE84a%2Fuploads%2FALIfdUPjpB8FlsQTXnvR%2Frefaced_dicoms.png?alt=media&amp;token=72ac3601-056e-4927-b61b-6f738446b638" alt="hovering over the &#x22;files&#x22; listing for a refaced scan shows that both the original DICOM(s) and refaced DICOM(s) are present "><figcaption><p>hovering over the "files" listing for a refaced scan shows that both the original DICOM(s) and refaced DICOM(s) are present </p></figcaption></figure>

You can [download this data directly](https://docs.ccv.brown.edu/pages/F1C1l7E7ZcDDwfUXA4Ci#id-1.2-download-one-sequence) (from the browser or with the XNAT Desktop Client), or you can export it with the rest of your data with [xnat-tools](https://docs.ccv.brown.edu/bnc-user-manual/xnat-to-bids-intro/getting-started.md). By default, for any scan that contains refaced DICOMs, xnat-tools will only export the refaced DICOMs, leaving the original DICOMs on XNAT. However, if you'd like to export only the original DICOMs, or both the original and refaced DICOMs, you just need to add one line to your configuration toml file. Under \[xnat2bids-args], add a line that says `reface-mode="orig"` or `reface-mode="both"` (`reface-mode="refaced"` is the default).

Any exported data that has been refaced will have "rec-refaced" added to its name. For example, running xnat2bids with `reface-mode="both"` will give two pairs of files like this:

<figure><img src="https://4276957606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LtSg7ZEM6EHbi9iE84a%2Fuploads%2FCyO2lxoG1TVGEyuNAaBX%2FScreenshot%202026-10-06%20at%2010.46.46%E2%80%AFAM.png?alt=media&amp;token=197edf39-7e69-4519-a80b-77cf82a39c23" alt="two .nii.gz/json pairs of T1 files, one with the rec-refaced entity added"><figcaption><p>two .nii.gz/json pairs of T1 files, with the rec-refaced entity added to the refaced scan</p></figcaption></figure>
