Addresses the problem of detecting significant changes in fMRI time series that are correlated to a stimulus time course. This paper provides a new approach to estimate the parameters of a semiparametric generalized linear model of the fMRI time series. The fMRI signal is described as the sum of two effects: a smooth trend and the response to the stimulus. The trend belongs to a subspace spanned by large scale wavelets. The wavelet transform provides an approximation to the Karhunen-Loeve transform for the long memory noise and we have developed a scale space regression that permits one to carry out the regression in the wavelet domain while omitting the scales that are contaminated by the trend. In order to demonstrate that our approach outperforms the state-of-the art detrending technique, we evaluated our method against a smoothing spline approach. Experiments with simulated data and experimental fMRI data, demonstrate that our approach can infer and remove drifts that cannot be adequately represented with splines.