added the preprecessing function for Brainstorm