Skip to content

Commit

Permalink
Merge branch 'next' into qa
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanBilheux committed Feb 16, 2024
2 parents 579edca + 4c29c02 commit 69d375e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ for Efficient Numerical Computation, Computing in Science \& Engineering. Volume
[2 SciPy python library. Travis E. Oliphant, SciPy: Open source scientific tools for Python,
Computing in Science and Engineering, Volume 9, (10-20) 2007

Installation
------------
$ conda install -c neutronimaging neunorm

Meta
----
Expand Down
1 change: 0 additions & 1 deletion src/NeuNorm/_version.py

This file was deleted.

10 changes: 7 additions & 3 deletions src/NeuNorm/normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,13 @@ def _auto_gamma_filtering(self, data=None):
# we may be dealing with a float time, that means it does not need any gamma filtering

try:
max = np.iinfo(data.dtype).max
except Exception as e:
logging.warning(f"Use default max value for data type: {e}")
data_type = data.dtype
if data_type in [float, "float32"]:
max = np.finfo(data_type).max
else:
max = np.iinfo(data.dtype).max
except Exception as error:
logging.warning(f"Use default max value for data type: {error}")
return data

manual_gamma_threshold = max - 5
Expand Down

0 comments on commit 69d375e

Please sign in to comment.