Facemasking algorithm to de-identify high resolution MRI of the human head. Earlier versions are here.
Environment requirements:
- 64-bit Linux
- FSL 5 or 6 on path
- MATLAB R2016 or later on path, or MATLAB Runtime (MCR) v.9.4 installed locally.
- ImageMagick convert, bc, which, zip and unzip on path
- (Optional) HD BET tool: https://github.com/NeuroAI-HD/HD-BET
Installation: copy the contents of nrg-improc to a local directory and make sure it's on path. For an MCR installation, also copy the contents of 'mcr/for_redistribution_files_only' directory (that would be your deployed application directory).
Make sure the up to date version of Docker is installed and Docker daemon is running.
sudo docker pull mmilch01/facemasking:1.21
Use the supplied command.json to configure the command.
For a full list of options, run mask_face without parameters. If you wish to use HDBET to mask out the brain, GPU is recommended.
- As a standalone application with MATLAB on path:
mask_face <dicom_series_dir> [options] - As a deployed MCR application (currently not supported):
mask_face_nomatlab <dicom_series_dir> -mcr_home <Matlab runtime environment v 9.4 installation dir> -deployed_home <deployed app dir copied from mcr/for_redistribution_files_only> <dicom_series_dir> [options] - As a Docker container:
**sudo docker run** -u $(id -u ${USER}):$(id -g ${USER})-v `pwd`:/docker_mount --rm xnat/facemasking:1.21 mask_face_nomatlab <dicom_series_dir> options]
To add GPU support to run HDBET, use --gpus <gpu_id|all> option with docker run command.
- A mosaic of the facemasked image is saved under maskface/<original_dicom_dir_name>_normfilter.png
- A 3D surface rendering of facemasked image is saved under maskface/<original_dicom_dir_name>_normfilter_surf.png
- Facemasked image in Analyze 7.5 format is saved under maskface/<original_dicom_dir_name>_masked_nii_orig.img
- MATLAB output logs are saved under maskface/*.out
- Defaced DICOM's are saved under DICOM_DEFACED dir.
- Milchenko, Mikhail, and Daniel Marcus. Obscuring Surface Anatomy in Volumetric Imaging Data. Neuroinformatics, 2012. https://doi.org/10.1007/s12021-012-9160-3.