Based on the fact that the output of a given stack filter can be determined if the ranks of the samples in the input window is known and that this output always equals one of the samples in the input window, rank, and sample selection probabilities are defined. The output distribution of the stack filter of size N with independent identically distributed (i.i.d.) inputs can be expressed as a weighted sum of the ith, i = 1, 2,..., N order statistics, where the rank selection probabilities are the weights. The sample selection probabilities equal the impulse response coefficients of a finite impulse response (FIR) filter whose output spectrum is closest, of all linear filters, to that of the stack filter for i.i.d. Gaussian inputs. Results are also derived for correlated inputs. Robustness and detail preserving properties of stack filters are related to the selection probabilities. Other statistical properties are also derived. Finally, methods to compute the selection probabilities of the stack filter from its positive Boolean function and the selection probabilities of the WM filter from its weights are given in detail.