Dear Jon,
Here's what I'd do (though there are many potential solutions):
fslmaths 1.nii.gz sum_image
for fn in 2.nii.gz 3.nii.gz ... etc ... ; do
fslmaths sum_image -add $fn sum_image
done
All the best,
Mark
On 4 Aug 2011, at 17:05, Jon Brock wrote:
> HI,
>
> Apologies if this is more related to scripting than fsl directly.
>
> I have a series of individual roi images (all from the same individual and in functional space) that I would like to merge together into a single image. I have tried scripting this using a for loop with fslmaths but (of course) only the last image in the list is saved;
> e.g. for i in 1.nii.gz 2.nii.gz etc, do fslmaths base_image -add ${i};done
>
> Any help appreciated
>
|