FSL DOUVE_EXT

# FSL provides a remove_ext function to remove any image extension it
# finds (e.g., *.nii, *.nii.gz etc.)
# You can pass in the image name without the extension or with it

remove_ext img
Troubled Tapir