From 4ac38e77e58240228b81004e78d6766d8fd69299 Mon Sep 17 00:00:00 2001 From: Christoph Dehner Date: Fri, 2 Jul 2021 10:55:43 +0200 Subject: [PATCH 1/4] Update list of dependencies --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 695f82e..68969fb 100644 --- a/README.md +++ b/README.md @@ -49,4 +49,4 @@ Output of flags `g`, `t`, and `p` is saved at the data location in a new folder # Dependencies -The program requires `numpy`, `scipy`, and `scikit-image`. +The program requires `numpy`, `scipy`, `scikit-image`, `matplotlib`, and `pandas`. From 28ac14ccae4714acb46a06631126f9997b6bb4c8 Mon Sep 17 00:00:00 2001 From: Christoph Dehner Date: Fri, 2 Jul 2021 10:58:04 +0200 Subject: [PATCH 2/4] Remove relative import error by changing "import . from xx" to "import xx" --- find_optimal_frames.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/find_optimal_frames.py b/find_optimal_frames.py index 1b74a39..7f1a20e 100644 --- a/find_optimal_frames.py +++ b/find_optimal_frames.py @@ -11,9 +11,9 @@ import numpy as np import scipy.signal import matplotlib.pyplot as plt -from . import metadata -from . import motion_metrics -from . import ultrasound_utils +import metadata +import motion_metrics +import ultrasound_utils from pathlib import Path From 843aad9eb13a8a01ddec7ce9fe8ae341eeaff0cd Mon Sep 17 00:00:00 2001 From: Christoph Dehner Date: Tue, 5 Jul 2022 16:14:44 +0200 Subject: [PATCH 3/4] Add additional dependency to readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 68969fb..81fe248 100644 --- a/README.md +++ b/README.md @@ -49,4 +49,4 @@ Output of flags `g`, `t`, and `p` is saved at the data location in a new folder # Dependencies -The program requires `numpy`, `scipy`, `scikit-image`, `matplotlib`, and `pandas`. +The program requires `numpy`, `scipy`, `scikit-image`, `matplotlib`, `pandas`, and `happy-tools`. From ccd60a2bfeea20edd3efbb2c2a655936f2f5fcf2 Mon Sep 17 00:00:00 2001 From: Christoph Dehner Date: Wed, 6 Jul 2022 15:13:01 +0200 Subject: [PATCH 4/4] Fix bug during frame selection: If the motion graph is monotonous no peaks are found and the positions with minimal motion should be returned (considering the distance parameter). --- find_optimal_frames.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/find_optimal_frames.py b/find_optimal_frames.py index 7f1a20e..67691ff 100644 --- a/find_optimal_frames.py +++ b/find_optimal_frames.py @@ -484,6 +484,8 @@ def process_scan(ultrasound, metadata_filename, strict=None, ## Find peaks peaks = scipy.signal.find_peaks(-results, distance=max(1,len(results)//distance))[0] sorted_peaks = peaks[np.argsort(results[peaks])] + if len(sorted_peaks) == 0: + sorted_peaks = np.argsort(results)[0:len(results)//distance:] return sorted_peaks, results