The relation between the expressions of stack filters, which are the positive Boolean function (PBF) and the rank output table, are investigated. In particular, we propose methods for finding the PBF expression given the rank output table of a stack filter, and for distinguishing the rank output tables of stack filters from the rank output tables of non-stack filters. These methods can be utilized for desining stack filters. In addition, an efficient algorithm for stack filtering is proposed.