Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
erdogant committed Aug 6, 2020
1 parent bd93d25 commit 214ed83
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion findpeaks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

__author__ = 'Erdogan Tasksen'
__email__ = '[email protected]'
__version__ = '2.1.0'
__version__ = '2.1.1'

# module level doc-string
__doc__ = """
Expand Down
2 changes: 1 addition & 1 deletion findpeaks/filters/lee.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def lee_filter(img, win_size=3, cu=0.25):
"""
if win_size < 3: raise Exception('[findpeaks] >ERROR: win size must be at least 3')
if win_size < 3: raise Exception('[findpeaks] >ERROR: window size (win_size) must be at least 3')
if len(img.shape) > 2: raise Exception('[findpeaks] >ERROR: Image should be 2D. Hint: set the parameter: togray=True')
if ((win_size % 2) == 0): print('[findpeaks] >It is highly recommended to user odd window sizes. You provided %s, an even number.' % (win_size))

Expand Down
2 changes: 2 additions & 0 deletions findpeaks/utils/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ def denoise(X, method='fastnl', window=9, cu=0.25, verbose=3):
* https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_filtering/py_filtering.html
"""
if window is None: window=9
if cu is None: cu=0.25
# Import library
cv2 = _import_cv2()

Expand Down
8 changes: 5 additions & 3 deletions tests/test_findpeaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_fit():
from findpeaks import findpeaks
methods = ['mask','topology', None]
filters = ['lee','lee_enhanced','kuan','fastnl','bilateral','frost','median','mean', None]
windows = [None, 0, 3, 63]
windows = [None, 3, 63]
cus = [None, 0, 0.75]
img = fp.import_example('2dpeaks')

Expand All @@ -156,6 +156,8 @@ def test_fit():
for cu in cus:
fp = findpeaks(method='topology', scale=True, denoise=getfilter, window=window, cu=cu, togray=True, imsize=None, verbose=3)
assert fp.fit(img)
title = 'Method=' + str(getfilter) + ', window='+str(window) + ', cu='+str(cu)
assert fp.plot_mesh(wireframe=False, title=title)
assert fp.plot_mesh(wireframe=False)
assert fp.plot_persistence()
assert fp.plot()
# assert fp.plot_preprocessing()

0 comments on commit 214ed83

Please sign in to comment.