This function anonymizes the anatomical images from the BIDS directory for data sharing. Three different methods are available for defacing/refacing. This tool uses a custom template and a set of ROIs specifically developed to identify the face and skull.

The full head template was created using the T1w images (resolution of 0.8x0.8x0.8mm) of 60 randomly selected healthy individuals from the MICA-MICs dataset (MICs60_T1_0.8mm.nii.gz). An inter-subject non-linear registration was performed without any mask, then the template was built using the mean of the normalized images. Three masks were generated: an ROI that covers the face, a brain mask, and a brain and neck mask.

Unlike other algorithms, micapipe_anonymize supports different anatomical modalities, and has shown good performance across datasets and modalities.

  • Identify the T1w image for registration (run-1 in case of multiple acquisitions)

  • Affine registration from the T1w image to the face atlas

  • Anonymize images according to selected method(s):

    • Deface: Apply the affine transformation to the face mask and crop the native T1w by applying the mask

    • Reface: Apply the affine transformation to the brain-neck mask, use its inverse to crop the native T1w face, and replace with the atlas face.

    • Warpface: Create a non-linear warpfield from the T1w native face to the refaced atlas and apply the warpfield to the face.

  • An affine registration from each anatomical acquisition (e.g. quantitative T1, T2w…) to the main T1w is calculated. Then, the atlas face, the face mask and the warp field are registered to the native anatomical volume and applied.