Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`, `pandas`, and `happy-tools`.
8 changes: 5 additions & 3 deletions find_optimal_frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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

Expand Down