Open fepegar opened 4 years ago
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.
-inf
1.6e-41 == 0
False
diff_perc[diff_perc < epsilon] = np.inf
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 because1.6e-41 == 0
was returningFalse
. I think an epsilon should be used instead:diff_perc[diff_perc < epsilon] = np.inf
.