History of AFNI updates  

|
Daniel Glen
March 16, 2007 02:45PM
This is a little script that should do what you want. This is easier than if you had asked for a sort of generic re-fitting of time. You need to calculate the interpolated time values with 3dcalc and then glue alternating slices from the original and the interpolated values into a new dataset. Lastly, update the TR with 3drefit, as you suggested. I've used pretty much the simplest possible interpolation scheme; you can do something more complicated if you like.

#!/bin/tcsh
# splittime.sh
set Tdset = smallepi+orig
set TR = 1s
rm -f outcat+orig.*
rm -f inbetweens+orig.*
# interpolate values
3dcalc -prefix inbetweens -a $Tdset+orig -b 'a[0,0,0,1]' -expr '(a+b)/2'
# Build interleaved datasets
3dTcat -prefix outcat $Tdset+orig'[0]' inbetweens+orig'[0]'
set brick = 1
set nbricks = `3dnvals $Tdset`
@ nbricks--
foreach brick ( `count -digits 1 2 $nbricks` )
3dTcat -glueto outcat+orig $Tdset"[$brick]" inbetweens+orig"[$brick]"
end
# last sub-brick is from original (no good interpolated value)
3dTcat -glueto outcat+orig $Tdset"[$nbricks]"
3drefit -TR "$TR" outcat+orig
Subject Author Posted

temporal interpolation

Jon T March 16, 2007 09:01AM

Re: temporal interpolation

Jon T March 16, 2007 01:07PM

Re: temporal interpolation

Daniel Glen March 16, 2007 02:45PM

Re: temporal interpolation

Jont T March 20, 2007 01:09PM

Re: temporal interpolation

Jeff Phillips February 12, 2009 12:19PM

Re: temporal interpolation

Bob Cox February 12, 2009 02:37PM