NiftyNet icon indicating copy to clipboard operation
NiftyNet copied to clipboard

Float comparison in histogram normalisation layer

Open fepegar opened this issue 5 years ago • 0 comments

This float comparison can be problematic.

https://github.com/NifTK/NiftyNet/blob/9b12da455dd8ed0a5e8e5060c4e939aa62d68c5a/niftynet/utilities/histogram_standardisation.py#L189

I was getting -inf in the output of the function because 1.6e-41 == 0 was returning False. I think an epsilon should be used instead: diff_perc[diff_perc < epsilon] = np.inf.

fepegar avatar Jan 10 '20 18:01 fepegar