convert contour filter to a directive