Defacing

Table of contents

  1. Why Reface instead of Deface?
  2. Running the refacing
  3. Interpreting Output
  4. Running FastSurfer on the Refaced NiIfTI

Instead of defacing, an alternative approach is to “reface” the images, which involves replacing the facial features with an average face. This can help in preserving the brain structures and statistical properties of the image intensities while still anonymizing the data.

Your objectives are:

  • Setup the reface tool using the XNAT Container Service
  • Run your images through the reface algorithm
  • Run the results through FastSurfer

Why Reface instead of Deface?

Defacing is a common practice to remove identifiable facial features from brain images, but it can sometimes lead to loss of important anatomical information. Replacing the facial features with an average face can help maintain the integrity of the brain structures while still anonymizing the data.

Running the refacing

Again we’re taking advantage of a prebuilt and configured container that has the tool that we want to run. We’re also leveraging the power of the server that the container is running on, instead of using our local machines.

To run the refacing:

  1. Go to your project
  2. Go to “Project Settings” in the “Actions” menu
  3. Go to “Container Service -> Configure Commands”
  4. Enable the “Run MRI Reface on a Scan.” command
  5. Go to an imaging session in your project
  6. Under the “scan menu”, click “Run Containers” and select “mri-reface-scan.”
  7. In the “Scan Type” dropdown, select T1 for the scan that you have generated NIfTIs for
  8. Ensure that “Resource” has auto-detected “NIFTI”
  9. Click “Run Container” to begin the refacing
  10. You can monitor the processing from the “History” panel at the bottom of the imaging session page.
  11. Once it is complete you will have a “REFACED” Resource generated at the scan level

Interpreting Output

To look at the result of the refacing, download the resource generated following the following instructions:

  1. Navigate to the imaging session that you have refaced
  2. Click “Manage Files” in the “Actions” to load the file manager
  3. Download both the original NIfTI image (in the NII resource) and the nii.gz file under “scans/<your t1 scan>/NIFTI-REFACED”
  4. Extract the files to get the NIfTI files both before and after refacing.
  5. View the NifTI files locally to observe the effects of the refacing. The best way to view the resulting changes it to toggle the refaced image on and off while leaving the orginal image on.

Running FastSurfer on the Refaced NiIfTI

Now that you have removed facial features from the images, we’d like to see if this will have any downstream effect on the FastSurfer results.

  1. Go to your project
  2. Go to “Project Settings” in the “Actions” menu
  3. Go to “Container Service -> Configure Commands”
  4. Enable the “REFACED DATA - Converts refaced NIFTI to 256 conformed MGZ file” command
  5. Enable the “REFACED DATA - Run FastSurfer pipeline on a refaced conformed T1 MGZ” command
  6. Rerun the FastSurfer analysis using the version of the commands for refaced data on the refaced NIfTI and again look at the results.