Afni3dDespike is a wrapper for the AFNI (RW Cox, NIH) 3dDespike application.
Removes 'spikes' from the 3D+time input dataset and writes a new dataset
with the spike values replaced by something more pleasing.
The AFNI 3dDespike program was written by B. Douglas Ward, Medical College
of Wisconsin.
For more information about the AFNI package, see the AFNI Homepage
Currently there is no postscript documentation available for this application.
To read the help documentation generated from the command line go here.
java Afni3dDespikeThis starts up the java interpreter and runs the Afni3dDespike application. You need to have set up your environment for java in order for this to work.
k=L [ (2*PI*k*t) (2*PI*k*t) ]
f(t) = a+b*t+c*t*t + SUM [ d * sin(--------) + e * cos(--------) ]
k=1 [ k ( T ) k ( T ) ]
where T = duration of time series;
the a,b,c,d,e parameters are chosen to minimize the sum over t of
|v(t)-f(t)| (L1 regression);
this type of fitting is is insensitive to large spikes in the data. The default value of L is NT/30, where NT = number of time points.
* L1 fit a smooth-ish curve to each voxel time series
[see -corder option for description of the curve].
* Compute the MAD of the difference between the curve and
the data time series (the residuals).
* Estimate the standard deviation 'sigma' of the residuals
as sqrt(PI/2)*MAD.
* For each voxel value, define s = (value-curve)/sigma.
* Values with s GREATER-THAN c1 are replaced with a value that yields
a modified s' = c1+(c2-c1)*tanh((s-c1)/(c2-c1)).
* c1 is the threshold value of s for a 'spike' [default c1=2.5].
* c2 is the upper range of the allowed deviation from the curve:
s=[c1..infinity) is mapped to s'=[c1..c2) [default c2=4].
* Despiking may interfere with image registration, since head movement may produce 'spikes' at the edge of the brain, and this information would be used in the registration process. This possibility has not been explored. * Check your data visually before and after despiking and registration! [Hint: open 2 AFNI controllers, and turn Time Lock on.]