how to generate a simulated fMRI data in AFNI?

Hi, AFNI experts

Is AFNI capable to generate a simulated fMRI data? For example, I want to create a fake fMRI data which consists of 300 TRs. Which program is able to achieve this aim?



I am not sure, there are pieces that could probably be used to do this. The ease would probably depend on whether you want example time series or a whole, 100k voxel brain dataset.

For a time series, you could:

  • make a practice timing sequence with 0s and 1s, then convolve
  • pick and HRF and convolve that time series with it.
  • add in some polynomial baseline changes
  • add in a lot of random noise
  • add in random spikes occasionally.

Is that kind of thing useful to your project?


I think the simplest way is suggested by the help in 3dUndump:

*** You can combine 3dUndump with 3dcalc to create an all zero
      3D+time dataset from 'thin air', as in
        3dUndump -dimen 128 128 32 -prefix AllZero_A -datum float
        3dcalc -a AllZero_A+orig -b '1D: 100@' -expr 0 -prefix AllZero_B
      If you replace the '0' expression with 'gran(0,1)', you'd get a
      random 3D+time dataset, which might be useful for testing purposes.

If you replace the 100 with 300, and use that gran(0,1) expression you would get a simulated 3D+time dataset. The TR would be assumed to be 1.0 seconds, but you can reset that with
3drefit -TR 3.0 mydset

Also see 3dSynthesize for generating datasets from an xmat.1D file and a “cbucket” of regression coefficients.