Skip to main content

FaceOff Version Licence DOI

Deface anatomical MRI scans with ANTs. FaceOff removes the face, and the eyes if you ask, and can put the template's face and eyes back.

  • Reorients to template orientation and crops in the same run, with no interpolation.
  • --extra-images (MP2RAGE, GRE echoes) and --batch (many scans).
  • A QC page with every run.
  • ANTs from your PATH, Docker, or Apptainer.

Face swap scene from the film Face/Off
Face/Off (1997)

Install

You need Python 3.12 or newer, and ANTs (2.3.3 or newer, tested with 2.6.5) on your PATH, Docker, or Apptainer (or Singularity).

pip install "git+https://github.com/srikash/FaceOff.git"
faceoff --help

The package will be called faceoff-mri on PyPI; pip install faceoff-mri works once the first release is published. The name faceoff on PyPI is a different program, so if you ran pip install faceoff earlier, run pip uninstall faceoff first.

A container image with ANTs inside is described in docs/installation.md.

Conda, clusters, and Apptainer: docs/installation.md.

Quick start

faceoff -i sub-01_T1w.nii.gz                    # deface and reorient
faceoff -i sub-01_T1w.nii.gz --reface           # also put a face back
faceoff -i sub-01_T1w.nii.gz --enucleate        # remove the eyes too
faceoff -i sub-01_T1w.nii.gz --renucleate       # remove the eyes and put template eyes back
faceoff --batch sub-*_T1w.nii.gz                # several scans, one after another
faceoff -i sub-01_UNIT1.nii.gz --extra-images sub-01_inv-*_MP2RAGE.nii.gz   # MP2RAGE or GRE echoes

Outputs go next to the input: docs/outputs.md.

Example outputs

Sagittal sweep of FaceOff's outputs: defaced, with the eyes removed, refaced, and refaced with the template's eyes

The template's face and eyes are shown in turbo.

How it compares

FaceOff, pydeface 2.1.0, and AFNI's afni_refacer2 on the same 1 mm MPRAGE, 12 cores:

FaceOff pydeface afni_refacer2
Deface 12 s 2 min 35 s 2 min 54 s
Reface 56 s not available 2 min 59 s
Remove the eyes 47 s (--enucleate)
59 s with --reface
not available not available
  • Median of 3 runs. FaceOff's reorientation to template orientation comes for free, with no interpolation.
  • Results: the three tools' outputs side by side.

Planned: an option to use AFNI's refacer template and shell in place of FaceOff's own template.

More

Installation · Usage · Outputs · Results · Template · Development · Citation

Licence and citation

MIT licence; the template files keep the MNI licence. If you use FaceOff, please cite it, the MNI ICBM152 template, and ANTs: docs/citation.md.

Metadata

Release files for faceoff-mri 1.9.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for faceoff-mri 1.9.8
File Size Uploaded Provenance Actions
faceoff_mri-1.9.8.tar.gz 3.0 MB Without provenance Details for faceoff_mri-1.9.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for faceoff-mri 1.9.8
File Interpreter ABI Platform Actions
faceoff_mri-1.9.8-py3-none-any.whl Python 3 none any Details for faceoff_mri-1.9.8-py3-none-any.whl

Total release size: 11.4 MB

Release files / faceoff_mri-1.9.8.tar.gz

Download URL faceoff_mri-1.9.8.tar.gz
Size 3.0 MB
Tags Source
SHA-256 checksum
How to use checksums
aefa7c1db88efab0949f00730dbf73d61387bae2b8b369958ac3c64a703562b6
BLAKE2b-256 checksum
How to use checksums
22928b0649963765260025faf92fb8902427b8236987b60c849c0f547b82ed33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / faceoff_mri-1.9.8-py3-none-any.whl

Download URL faceoff_mri-1.9.8-py3-none-any.whl
Size 8.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
4e495c4925b1e0cb8489ec9ef9224772279a587919c23c193b63b61f564d6e0f
BLAKE2b-256 checksum
How to use checksums
c12d09cd8a23a0feafe7d0840dc666e8cdbff1e8d10978b6dbeace60fdf2f43b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for faceoff-mri 1.9.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.9.8 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page