MIC-DKFZ / HD-BET

MRI brain extraction tool
Apache License 2.0
255 stars 61 forks source link

Fix mask output filename issues when '.nii.gz' is not included in out_fname #53

Open bacaron opened 2 months ago

bacaron commented 2 months ago

The current run_hd_bet function has a hard-coded string filter on the output mask name to append _mask.nii.gz to the output mask (line 78: mask_fname = out_fname[:-7] + "_mask.nii.gz"). However, if the user doesn't include the '.nii.gz' extension in the out_fname parameter, this will cause issues. For example, if out_fname is set to 'hd_bet_output', the resulting mask name will be 'hd_bet.nii.gz'.

This update fixes this small bug and should work in both cases (i.e. where a user includes the '.nii.gz' extension, and those when the user doesn't include the '.nii.gz' extension).