Skip to content

poor signal-to-noise near mask or image boundaries #10

@jewettaij

Description

@jewettaij

I've noticed that , when using the "-mask" argument, that the detection of objects near the boundary of the mask is less reliable. I think this is because the detectors are more susceptible to noise near the boundary of a mask. The technical reason for this is explained below.

On 2021-7-08, I posted a commit that significantly reduces this problem, but the problem has not been completely solved.

Workaround

Strategies to get around this problem have been posted in the documentation here (for surface and curve detection), and also here (for blob detection).

If your goal when using the filter_mrc program to generate a new filtered image (rather than detect surfaces or blobs), then you may have better luck running that program initially on the entire image (without the mask). Afterwards, you can set the brightness of the voxels in the new image outside the mask to zero. You can do that using the combine_mrc program. For example:

combine_mrc  filtered_image.rec  "*"  mask.rec  filtered_clipped_image.rec

Explanation and details (feel free to skip)

As a first step to many operations (such as blob detection, ridge detection, or edge detection), a Gaussian blur is applied to the image at the beginning. When applying a Guassian filters on an image, the contribution of the nearby voxels to the brightness at the target voxel is normalized by dividing by the total (Gaussian) weight of the nearby voxels which were eligible to contribute.

If a mask image is supplied by the user, then only voxels in the mask are eligible. If you are near the boundary of the mask, then a small number of voxels are eligible to contribute, and this amplifies the noise (since you are effectively averaging the brightness over fewer nearby voxels). (I can't recall, but I think I normalize tensor-voting results in a similar way. Perhaps I should make this kind of normalization optional. I'm probably trying to be too clever and it's backfiring.)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions