MIC-DKFZ / HD-BET

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

Correct size comparison, fixes #45 numpy>=1.25 incompatibility #47

Closed mrunibe closed 11 months ago

mrunibe commented 1 year ago

save_segmentation_nifti was comparing the entire segmentation array to target size. Prior numpy-1.25 this returned always false and a swallowed deprecation warning. Raises an error since numpy-1.25: File "HD-BET/HD_BET/data_loading.py", line 87, in save_segmentation_nifti if np.any(np.array(seg_old_size) != np.array(dct['size'])[[2, 1, 0]]): ValueError: operands could not be broadcast together with shapes (117,171,171) (3,)

fixes #45 by comparing current shape to target shape.

mrunibe commented 11 months ago

fixed by https://github.com/MIC-DKFZ/HD-BET/commit/ae160681324d524db3578e4135bf781f8206e146