Just a quick follow up for those who might still be interested in the correct solution: simply call the cluster command nested into the fslmaths command as parameter. Like this:
fslmaths `cluster --zstat=zstat_std_masked --zthresh=0 | awk 'FNR==2 {print("'zstat'_std_masked -roi " $4" 1 "$5" 1 "$6" 1 0 1 -bin 'zstat'_std_masked_maxpnt")}'`
The (text) result of the "cluster | awk" command is captured using the backquotes. The pipeline to awk allows to extract particular columns (nr 4, 5, and 6) at the second row (FNR==2), i.e. where the coordinate of the peak was printed.
|