Hi,
I didn't realise that FLIRT was being naughty and changing
pixdim4 - I'll try and correct that in the next patch.
Until then you can script the effect of fsledithd quite easily.
All fsledithd really is is a script that does the following:
runs fslhd -x and dumps the output in a file
allows you to edit this file (with a few helpful comments attached)
runs fslcreatehd with the revised file (which then modifies the
appropriate header elements to match with the file contents).
So all your script has to do is:
fslhd -x myimage > myhdr.txt
sed "s/dt =.*/dt = \'2\'/" myhdr2.txt
fslcreatehd myhdr2.txt myimage
That should do the trick.
All the best,
Mark
On 1 Mar 2010, at 19:53, Spero Nicholas wrote:
> FSL list,
>
> I'd like to change sampling interval of the 4th dimension of some 4-
> D NIFTI files, e.g. the TR in fMRI data, while leaving all other
> header information such as the qto & sto matrices intact. I can do
> it interactively using fsledithd, but I'd like to be able to do this
> automatically in scripts I call from the command line.
>
> My need arises from applying linear transforms to 4-D data using
> flirt.
>
> flirt -in inFile -ref refFile -applyxfm xfmFile -out outFile
>
> In my data pixdim4=2 in both inFile and refFile but i end up with
> pixdim4=1 in outFile. In this example I could use
>
> fslcpgeom reFile outFile
>
> to correct the TR, but sometimes my refFile is a 3-D volume, thus I
> don't have file to copy the geometry from.
>
> If there's a way to apply a linear tranform to 4-D data without
> changing pixdim4, or a way to reset it from the command line, I'd
> appreciate hearing about it. Thanks,
>
> Spero Nicholas
> The Smith-Kettlewell Eye Research Institute
> San Francisco
>
|