I am wondering how a mask is being applied in abpN4. In N4BiasFieldCorrection there are two options for using a mask:
-x, --mask-image maskImageFilename
If a mask image is specified, the final bias correction is only performed in the
mask region. If a weight image is not specified, only intensity values inside
the masked region are used during the execution of the algorithm. If a weight
image is specified, only the non-zero weights are used in the execution of the
algorithm although the mask region defines where bias correction is performed in
the final output. Otherwise bias correction occurs over the entire image domain.
See also the option description for the weight image. If a mask image is not
specified then the entire image region will be used as the mask region. Note
that this is different than the N3 implementation which uses the results of Otsu
thresholding to define a mask. However, this leads to unknown anatomical regions
being included and excluded during the bias correction.
-w, --weight-image weightImageFilename
The weight image allows the user to perform a relative weighting of specific
voxels during the B-spline fitting. For example, some studies have shown that N3
performed on white matter segmentations improves performance. If one has a
spatial probability map of the white matter, one can use this map to weight the
b-spline fitting towards those voxels which are more probabilistically
classified as white matter. See also the option description for the mask image.
I am wondering if specifying a mask with abpN4 results in the N4 correction only being applied to voxels within the mask (option -x), or the masked region being used for the estimation of the bias field, but the application of the correction is applied to the entire image (option -w).
I am wondering how a mask is being applied in abpN4. In N4BiasFieldCorrection there are two options for using a mask:
I am wondering if specifying a mask with abpN4 results in the N4 correction only being applied to voxels within the mask (option -x), or the masked region being used for the estimation of the bias field, but the application of the correction is applied to the entire image (option -w).
I am specifically interested in the latter.