To remove surface waves from seismic records while preserving other seismic events of interest, we introduced a transform and a filter based on recent developments in image processing. The transform can be seen as a weighted Radon transform, in particular along linear trajectories. The weights in the transform are data dependent and designed to introduce large amplitude differences between surface waves and other events such that surface waves could be separated by a simple amplitude threshold. This is a key property of the filter and distinguishes this approach from others, such as conventional ones that use information on moveout ranges to apply a mask in the transform domain. Initial experiments with synthetic records and field data have demonstrated that, with the appropriate parameters, the proposed trace transform filter performs better both in terms of surface wave attenuation and reflected signal preservation than the conventional methods. Further experiments on larger data sets are needed to fully assess the method.