Ziad,
Here is what I did. Matrix B is the data with reduced timepoints.
OptTSOut.Scale = 1;
OptTSOut.verbose = 1;
OptTSOut.Prefix = 'test';
InfoNewTSOut = Info;
InfoNewTSOut.RootName = '';
InfoNewTSOut.BRICK_STATS = []; %automatically set
InfoNewTSOut.BRICK_FLOAT_FACS = []; %automatically set
InfoNewTSOut.IDCODE_STRING = '';%automatically set
[err, ErrMessage, InfoNewTSOut] = WriteBrik (B, InfoNewTSOut, OptTSOut);
Below is the message I got.
WriteBrik verbose: Checking input data ...HEAD Info structure ...Scaling ...??? Index exceeds matrix dimensions.
Error in ==> WriteBrik at 327
[max1, imax1] = max(abs(M(istrt:istp)));