Print

Print


Hi,

I am using flirt for standard space mapping in my analyses. The way I
have set it up is as follows:

All single-subject time series (4D) are in NifTI format, the time series
averages (3D) are called *NatAverage.nii, and the statistic images (in
native space) are all called Nat*.nii.

I align the *NatAverage.nii file to the template $TEMPL (which in this
case is EPI.nii) and then use that transformation to apply to all the
other Nat*.nii files as well.

The bash scripting bit that does the jobe looks like this

for PREFIX in PREFIXES; do
	
	# all Nat's except NatAverage
	NATS=${PREFIX}Nat[BMNSV]*.nii

	echo "computing standard space mapping"
	${FLIRT} \
	    -in ${PREFIX}NatAverage.nii -ref ${TEMPL} \
	    -out ${PREFIX}StdAverage.nii -omat ${PREFIX}Affine.txt \
	    -bins 256 -cost corratio -dof 12 \
	    -searchrx -90 90 -searchry -90 90 -searchrz -90 90 \
	    -interp sinc -sincwidth 7 -sincwindow hanning

	echo "applying standard space mapping"
	for NAT in $NATS; do
	
	    printf "."
	    # use FLIRT to apply transformation to other Nat files
	    ${FLIRT} -in ${NAT} -ref ${TEMPL} -out ${NAT//Nat/Std} \
		-applyxfm -init ${PREFIX}Affine.txt \
		-interp sinc -sincwidth 7 -sincwindow hanning

	done
	printf "\n"

done

And it works... but it is amazingly slow for the second part (the
-applyxfm bit). It almost seems that flirt starts the registration all
over again.

I assumed that the other *Nat.nii images would just be resampled using
the transformation parameters in *Affine.txt. That is correct, is it?

Is there any way to speed up the process? Changing the interpolation to
linear seems to have only a marginal effect. Resampling a 90x100x90
volume should be done well inside a second?

Thanks for any hints
Alle Meije