Skip to content

olinickalls/PyFaceWipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyFaceWipe

A python defacing tool for almost any MRI contrast. (It also does CT)

Free for non-commercial use only. Free for personal use, and non-commercial research use. If in doubt or to aquire a commercial license, please contact me.

PyFaceWipe was built to address problems of defacing MRI data within our IT environment. Although developed with Windows in mind, it will work just as well on MacOS and Linux.

Powered by a skullstrip with the excellent tool SynthStrip [https://github.com/nipreps/synthstrip], it is fast and robust, while removing facial details just as well as the competition (if not better).

If you use PyFaceWipe in your work, please cite us:

Prerequisites

Before you begin, ensure you have met the following requirements:

  • You have at least python 3.7
  • Windows, Linux & Mac supported.

Installation

New- Wheels coming soon! In the meantime... for Windows on x64

  • Download and unpack the source into your project directory

  • Install requirements

python -m pip install -r requirements.txt
  • Go! (if you are running Windows on x64)

MacOS and Linux (also a fallback for windows):

You may need to recompile with Cython:

python -m pip install cython
python setup.py  build_ext --inplace

Quick Guide

It's quick & easy to get started:

from pyfacewipe import PyFaceWipe

pfw = PyFaceWipe()
pfw.deface(source=r"C:\myMRIsrc\anat\pt001.nii.gz", output_dir=r"c:\myMRIdefaced")

GPU

To use hardware accelleration you'll need to install the appropriate GPU-enabled Torch version. You can find the correct pip command at [https://pytorch.org/get-started/locally/].

It is easiest if you install the GPU Torch before requirements.txt.

For example (you will need to edit this for your system)

python -m pip install torch --index-url https://download.pytorch.org/whl/cu118
python -m pip install -r requirements.txt

Release History

  • 0.1
    • Alpha - as published in Magn Reson Mater Phy (2024)
  • 0.1.1
    • CHANGE: Refactor into a class. No change to algorithm.
    • CHANGE: Update docs

Meta

Oliver Nickalls – Oliver.James.Nickalls@SingHealth.com.sg

Distributed for review and research purposes only. Not for commercial use.

About

PyFaceWipe -A multiplatform fast and robust defacing tool for almost any MRI contrast (and CT)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors