Resample small mask


I would like to resample the volume and mask to a fixed spacing using simpleitk in python, but after I do that, the mask of small regions disappears completely. Do you have any idea about this phenomenon?

I tried a smaller spacing, and different interpolator but the results still the same.

Hello @vankhoa21991,

Welcome to ITK/SimpleITK!

I suspect what you are experiencing is aliasing (is your new spacing larger than the original mask spacing?). For a concrete code example illustrating aliasing in SimpleITK take a look at the first couple of cells in this Jupyter notebook.

For the mask image you can try to use the sitkLabelGaussian interpolator instead of the sitkNearestNeighbor interpolator (see full list of interpolator options).

If that doesn’t improve the result you can convert the binary mask image to a distance map, resample the distance map using sitkLinear, or any other interpolator for continuous data, and convert the result back to a binary image (resampled_distance_map<=0).

1 Like

My new spacing is smaller than old spacing, I tried LabelGaussian but the result is still the same. I will try your suggestion of distance map. Thanks