Skip to content

Commit c910cac

Browse files
authored
Merge pull request #52 from ladisk/selection_upgrade
Now added: `SelectionGUI`: - Updated filtering interface - Updated brush selection - Added point retrieval methods: `get_selected_points` (all points from selection mode) and `get_filtered_points` (points that were filtered). - Calling `Points.points` (where `Points` is instance of `SelectionGUI`) returns the filtered points, but if they do not exist (no filtering was done), all selected points are returned. `ResultViewer`: - Mode shape visualization - Export to MP4 (with frame range and region selection)
2 parents e54189d + 8080324 commit c910cac

File tree

8 files changed

+2632
-8
lines changed

8 files changed

+2632
-8
lines changed

pyidi/GUIs/__init__.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import typing
2+
3+
try:
4+
import PyQt6
5+
6+
HAS_PYQT6 = True
7+
except ImportError:
8+
HAS_PYQT6 = False
9+
10+
if HAS_PYQT6 or typing.TYPE_CHECKING:
11+
from .subset_selection import SelectionGUI
12+
from .result_viewer import ResultViewer
13+
else:
14+
class SelectionGUI:
15+
def __init__(self, video):
16+
pass
17+
18+
def show_displacement(self, data):
19+
raise RuntimeError("SelectionGUI requires PyQt6: pip install pyidi[qt]")
20+
21+
class ResultViewer:
22+
def __init__(self):
23+
pass
24+
25+
def show_displacement(self, data):
26+
raise RuntimeError("ResultViewer requires PyQt6: pip install pyidi[qt]")
27+
28+
from .selection import SubsetSelection
29+
from .gui import GUI

pyidi/gui.py renamed to pyidi/GUIs/gui.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
import warnings
77
warnings.simplefilter("default")
88

9-
from . import tools
9+
from .. import tools
1010
from . import selection
11-
from .methods import SimplifiedOpticalFlow
12-
from .methods import LucasKanade
11+
from ..methods import SimplifiedOpticalFlow
12+
from ..methods import LucasKanade
1313

1414
NO_METHOD = '---'
1515
add_vertical_stretch = True

0 commit comments

Comments
 (0)