Hi Nataliya,

both, Median and Median 3D use a circular support (circular Kernel).
I noticed that Median 3D (and the other 3D filters) use a slightly different definition of the radius. For the 3D filters, sometimes one needs to add a small number like 0.5 to the radius of the 2D filters. For a 2D image (no stack), Median 3D with radius=2.5 in x&y and the "usual" (2D) Median with radius=2 do exactly the same (except near the edges, see below). At some radius values. the behavior is the same for the 2D and 3D filters (e.g. radius=10.5 and 14.5), so there is no simple rule. I think that eventually the 3D filters should be modified to use the same definition of the radius as the 2D filters, the one also used for Process>Filters>Show circular masks.

The remaining difference is the handling of the edge pixels.
The 3D filters consider the out-of image pixels as nonexistent. Thus, when calculating the median near the edge, the 3D median uses fewer pixels. The 2D filters (the "usual" Median, Mean, etc.) assume that the out-of-image pixels are the same as the nearest edge pixel, and the mean, median, etc. is always calculated over the same number of pixels (except for float images with NaN = Not a Number). The latter convention (assuming repeated edge pixels) is the usual convention in ImageJ, also for Gaussian Blur, and the Process>Binary functions.

Hope this helps,

Michael
________________________________________________________________


On 22.03.25 12:32, Наталія Тулякова wrote:
Dear colleagues.
I am interested in filtering 2D images. The ImageJ program has two median
filters in the "Process-Filters" menu item. I have not found any
documentation explaining how "Median 3D" works. Median 3D provides better
results than Median. What is the difference between them for 2D image
processing? Does "Median 3D" use a square window while "Median" uses a
circular window?

With best regards,    Nataliya

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

Reply via email to