Extract the extension of the filename.
For files with the .gz suffix, the previous extension is returned as well.
This is needed e.g. for the compressed NIFTI format (.nii.gz).
- Parameters:
- filename
str, Path The filename from which to extract the extension.
- Returns:
strThe extracted extension. For files with the .gz suffix, the previous
extension is returned as well.