First version: 08.24.2012
Current version: 01.24.2014
New in version 01.24.2014:
- Reworked the structure of the script into procedure-based
- The script now accepts multiple scans to process with the same parameters.
- The following modes of face masking are allowed by script
- based on FSL-coregistered coordinates file (generated by fsl after coregistration)
- based on supplied ROI coordinate file
- based on explicitly supplied ROI coordinates
- based on the reference scan
- each masking region requires a separate run of mask_surf_auto.m
- 3D snapshots
- tweaked brain mask application to exclude more boundary voxels
- better support of anisotropic voxels
- added ear masking
- major updates to the face masking xnat pipeline:
- new parameters:
- ref: reference scan
- use_manual_roi: signal that manual ROI will be used instead of auto-registration.
- rois: specification of manual ROI’s
- dirs: ROI normal direction (s)
- step 0: scan lists are converted to be used with xnat2loc
- step 1: xnat2loc is now used to download and process DICOM scans instead of XNATRestClient.
- new face masking script takes a list of scans, reference and ROI parameters as input.
- new parameters:
mask_face <image>[,<image>..] [options]
The first argument must list one or more MR head image files. If more than one image is specified, you must also specify one of them as reference with -r option. The reference image will be used for spatial co-registration with an atlas, and others will use the reference facial mask.
By default, the input is the DICOM directory of a single series. You can also supply images in Analyze/NIFTI (.hdr/.img pair) format by adding -a option. The output and input formats are the same.
For the complete set of options, run mask_face without parameters.
-m: method used (coating, blur, normfilter, all).
coating will set all voxels in the face layer to the single average intensity.
blur will perform the entire volume blur, and limit the effect to the facial region.
normfilter (recommended) is fine-tuned method that will preserve most of the intensity distribution.
The all option will produce output by all three methods.
-t: mask threshold.
Threshold is selected automatically (recommended), but can be changed with this option.
-s: grid step.
Larger grid step will result in coarser looking 3D renderings, and tends to modify more voxels outside of the immediate near-surface.
-v: controls the amount of intermediate output. -v 2 will generate the 3D volumes for boundary layer, boundary mask, and “flattened” face (both blurred and unblurred). -v 0 only saves the resulting output.
-b: brain mask generated by FSL’s bet algorithm is generated prior to face masking and is used to exclude brain voxels from modification.
-e: set to 1 to mask ears.
-um: set to 1 to specify manual ROI coordinates (the latter are set with -roi and -ver or with -rf option)
-r: must specify is more than one image is being defaced. Use the highest quality image as reference.
The algorithm main paper:
Milchenko, M. V. & Marcus, D. (2012). Obscuring surface anatomy in volumetric imaging data. Neuroinformatics. doi: 10.1007/s12021-012-9160-3