//--------------------------------------------------------------------
// Main function called each time the filter is updated
//--------------------------------------------------------------------
// Main function called each time the filter is updated