def calc_sigma_from_fwhm(wildcards):
    return f'{float(wildcards.fwhm)/2.355:0.2f}'

rule smooth:
    input:
        'data/sub-{subject}/func/sub-{subject}_task-{task}_run-{run}_bold.nii.gz'
    params:
        sigma = calc_sigma_from_fwhm
    output:
        'results/sub-{subject}/func/sub-{subject}_task-{task}_run-{run}_fwhm-{fwhm}mm_bold.nii.gz'
    shell:
        'fslmaths {input} -s {params.sigma} {output}'
