AFNI Automask does not generate output strings correctly and string pattern %s is literally used in the generated command:
automask = afni.Automask()
automask.inputs.in_file = '/path/to/my_file.nii.gz'
automask.inputs.dilate = 1
automask.inputs.outputtype = "NIFTI_GZ"
No longer generate (automask.cmdline):
3dAutomask -apply_prefix /path/to/my_file_masked.nii.gz -dilate 1 -prefix /path/to/my_file_mask.nii.gz /path/to/my_file.nii.gz
But this nonviable command instead:
3dAutomask -apply_prefix %s_masked -dilate 1 -prefix %s_mask /path/to/my_file.nii.gz