Get image extensions from a filename

parse_img_ext(file)

Arguments

file

Character filename to parse

Value

Extension of file

Examples

parse_img_ext("blah.nii.gz")
#> [1] "nii"
parse_img_ext("blah.mnc")
#> [1] "mnc"
parse_img_ext("blah.nii")
#> [1] "nii"
parse_img_ext("blah")
#> [1] NA
parse_img_ext("blah.img")
#> [1] "img"
parse_img_ext("blah.hdr")
#> [1] "hdr"
parse_img_ext("blah.hdr.gz")
#> [1] "hdr"