NoeliaBest,Hi Saad,Thank you for your help. I tried using fsladd but the terminal shows "command not found". I'm not sure about what the problem is.--2017-12-19 10:51 GMT+01:00 Saad Jbabdi <[log in to unmask]>:You can use fsladd (no need for loops)
Cheers
Saad
> On 19 Dec 2017, at 09:49, Noelia Martinez Molina <[log in to unmask]OM> wrote:
>
> Dear FSL experts,
>
> I need to average images from 38 subjects using fslmaths. The command would be something like this:
>
> fslmaths image1 -add image2 -add image3 ... -add image38 -div 38 average_image
>
> However, I was wondering if you could tell me how to use a loop to create a string with all the -add arguments in order to avoid the tedious of having to write manually all the filenames for each image.
>
> Thank you in advance for your help.
>
> Best,
> Noelia
Noelia Martínez-MolinaCognition and Brain Plasticity GroupDepartment of Cognition, Development and Educational PsychologyUniversitat de BarcelonaCampus Mundet, Edifici de PonentOffice: (34) 93 403 47 68twitter:@NoeliaMrtnez"Where words fail, music speaks."
------------------------------------------------------------ ---------------------------------------- ---- Hans Christian Andersen------------------------------------------------------------ ------------------------------ ---------------