This paper presents a procedure for calculation of selection probabilities of stack filters using Binary decision diagrams (BDDs) to represent the positive Boolean function that defines the stack filter. The procedure is derived by a modification of the spectral method for calculation of selection probabilities of stack filters. The usage of BDDs, instead of vectors overcomes the exponential complexity of the corresponding spectral method and extends application of the spectral method to stack filters with large windows widths.