I would like to interpolate the value of some voxels with zero values considering neighbouring voxels within an ROI (e.g. sphere, box) and that it can also consider a mask (e.g. tissue mask) to indicate which voxels to consider. Is there any program that can perform this beyond the options of 3dLocalstat? For instance considering a linear interpolation or high-order spline interpolation?
The point is that we are not doing any spatial transformation since the data is in the same space. I checked 3dresample but it does not have any option for mask.
As for 3dAllineate, is it possible to use it with no spatial transformation or how an identity transformation can be coded? Could the options -emask ee or -source_mask sss serve for our purposes? We only want to do the interpolations (-final) and considering a mask.
Thanks for the suggestions. One question: Does 3dAllineate have the option of setting a mask in the source image so that masked voxels are ignored for the interpolation? In fact, we want to fill in these voxels that we know shouldn’t be zero.
3dAllineate does have mask for the source dataset, but I’m not sure if that’s what you want. Are you trying to fill holes? Is this for ROIs with a particular integer value for each region type, or are you trying to fill holes of function with floating point values.
Hi Daniel,
Yes, we are trying to fill holes based on neighbouring voxels, for instance a sphere but considering a mask within that region. And we don’t want to take the average value as in 3dLocalstat, but would prefer some kind of high-order interpolation. They are floating point values.
Best,
Cesar
It seems to me you can do something more along the lines of Rick’s suggestion then; smooth then with some program and only use the values for the holes. 3dmerge allows custom filters with “-1filter_expr” where you could compose a filter that does not include the voxel itself. It may be simpler to use a median filter, just replacing the hole voxels with the median value in the neighborhood. See “3dmerge -1filter_winsor”, “3dLocalstat -stat median”.
The
National Institute of Mental Health (NIMH) is part of the National Institutes of
Health (NIH), a component of the U.S. Department of Health and Human
Services.