Stroke preprocessing routines.