The only thing I can figure is that the fourier filter is seeing the wrong
TR or the wrong number of time steps. I worked through it with your
numbers, and the algorithm works fine.
Is it possible that there's bad data in the header, or that you really
don't have that number of time steps/sub-briks? IF for example, you
only had 40 time steps, it would fail, of course.
rich