I think he just wants to automate his process of finding mean FA for one scan and one ROI as doing it manually many times is tedious? I did not get the impression that an average OF multiple images is desired.
If that's true, maybe something like:
for im=each file in /images
for mask=each file in /masks
fslmeants -i im -m mask -o im_mask
end
end
This would find every mean for each combination of a list of images and masks.
There is probably an easy utility out there to concatenate the txt files into one.
The above is a sample and the code to write will vary depending on your environment. I could help with bash but otherwise that should get you started.
> On Mar 2, 2016, at 8:07 AM, Matthew Webster <[log in to unmask]> wrote:
>
> Hello,
> You could probably do this with fslmaths and fslmeants - essentially
>
> create a mean image of all N scans ( you can use a loop to create a string with all the -add arguments if you want )
> fslmaths scan1 -add scan2 -add scan3 ... -add scanN -div N averageScan
>
> loop over masks:
> fslmeants -i averageScan -m nameOfMask -o nameOfMask.txt
>
> Kind Regards
> Matthew
>> Dear FSL users,
>>
>> I have been using the following command line to calculate the average FA value for a ROI of an individual scan:
>>
>> fslmeants -i subject_FA_map.nii.gz -m ROI_mask -o subject_mean_FA_ROI.txt
>>
>> This works but I have a large number of scans and ROIs to process, so repeatedly copying in the command line and changing the inputs and outputs manually is very tedious. I was therefore wondering if there was a command I could use to produce a .txt file with the mean FA of a ROI for each of the scans in a particular directory. I have tried the following command to no avail:
>>
>> fslmeants -i *FA_map.nii.gz -m ROI_mask -o all_subjects_mean_FA_ROI.txt --label=*FA_map.nii.gz
>>
>> Do you know what I need to do? Or if this isn't possible, is there a command to produce a .txt file for every scan in a particular group?
>>
>> Kind regards,
>>
>> Joe Harding
|