Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
AmpScan
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Joshua Steer
AmpScan
Commits
e517813b
Commit
e517813b
authored
6 years ago
by
Omar Animashaun
Browse files
Options
Downloads
Patches
Plain Diff
Update to AmpScanGUI.py
parent
d52ad7b7
No related branches found
No related tags found
1 merge request
!24
Omar changes
Pipeline
#803
passed
6 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GUIs/AmpScanGUI.py
+58
-9
58 additions, 9 deletions
GUIs/AmpScanGUI.py
with
58 additions
and
9 deletions
GUIs/AmpScanGUI.py
+
58
−
9
View file @
e517813b
...
@@ -12,7 +12,7 @@ from PyQt5.QtWidgets import (QAction, QApplication, QGridLayout, QHBoxLayout,
...
@@ -12,7 +12,7 @@ from PyQt5.QtWidgets import (QAction, QApplication, QGridLayout, QHBoxLayout,
QMainWindow
,
QMessageBox
,
QComboBox
,
QButtonGroup
,
QMainWindow
,
QMessageBox
,
QComboBox
,
QButtonGroup
,
QOpenGLWidget
,
QFileDialog
,
QLabel
,
QPushButton
,
QOpenGLWidget
,
QFileDialog
,
QLabel
,
QPushButton
,
QSlider
,
QWidget
,
QTableWidget
,
QTableWidgetItem
,
QSlider
,
QWidget
,
QTableWidget
,
QTableWidgetItem
,
QAbstractButton
)
QAbstractButton
,
QCheckBox
)
class
AmpScanGUI
(
QMainWindow
):
class
AmpScanGUI
(
QMainWindow
):
...
@@ -88,6 +88,10 @@ class AmpScanGUI(QMainWindow):
...
@@ -88,6 +88,10 @@ class AmpScanGUI(QMainWindow):
return
return
moving
=
str
(
self
.
alCont
.
moving
.
currentText
())
moving
=
str
(
self
.
alCont
.
moving
.
currentText
())
self
.
files
[
moving
].
save
(
fname
[
0
])
self
.
files
[
moving
].
save
(
fname
[
0
])
if
self
.
pnt
is
not
None
:
f
=
open
(
fname
[
0
]
+
'
.txt
'
,
'
w+
'
)
f
.
write
(
'
Picked Coordinates = {}
'
.
format
(
self
.
pnt
))
def
display
(
self
):
def
display
(
self
):
render
=
[]
render
=
[]
...
@@ -122,7 +126,6 @@ class AmpScanGUI(QMainWindow):
...
@@ -122,7 +126,6 @@ class AmpScanGUI(QMainWindow):
"""
"""
Pick a point on the mesh.
Pick a point on the mesh.
"""
"""
#vtkRenWin.Pick_point(self.renWin, loc = [-59.2877082824707, -2.0703632831573486, 70.64564514160156])
self
.
vtkWidget
.
iren
.
AddObserver
(
'
RightButtonPressEvent
'
,
self
.
pick_loc
)
self
.
vtkWidget
.
iren
.
AddObserver
(
'
RightButtonPressEvent
'
,
self
.
pick_loc
)
self
.
renWin
.
Render
()
self
.
renWin
.
Render
()
...
@@ -133,9 +136,13 @@ class AmpScanGUI(QMainWindow):
...
@@ -133,9 +136,13 @@ class AmpScanGUI(QMainWindow):
#print(event, x)
#print(event, x)
self
.
vtkWidget
.
iren
.
RemoveObservers
(
'
RightButtonPressEvent
'
)
self
.
vtkWidget
.
iren
.
RemoveObservers
(
'
RightButtonPressEvent
'
)
loc
=
event
.
GetEventPosition
()
loc
=
event
.
GetEventPosition
()
pnt
=
vtkRenWin
.
Pick_point
(
self
.
renWin
,
loc
)
self
.
pnt
=
vtkRenWin
.
Pick_point
(
self
.
renWin
,
loc
)
[
name
,
_
,
color
,
opacity
,
display
]
=
self
.
fileManager
.
getRow
(
0
)
#[name, _, color, opacity, display] = self.fileManager.getRow(0)
self
.
files
[
name
].
MeasurementsOut
(
pnt
)
#self.files[name].MeasurementsOut(pnt)
def
removePick
(
self
):
self
.
pnt
=
None
vtkRenWin
.
delMarker
(
self
.
renWin
)
def
rotatex
(
self
,
button
):
def
rotatex
(
self
,
button
):
...
@@ -234,7 +241,8 @@ class AmpScanGUI(QMainWindow):
...
@@ -234,7 +241,8 @@ class AmpScanGUI(QMainWindow):
self
.
fileManager
.
setTable
(
target
,
[
0
,
0
,
1
],
0.5
,
0
)
self
.
fileManager
.
setTable
(
target
,
[
0
,
0
,
1
],
0.5
,
0
)
reg
=
registration
(
self
.
files
[
baseline
],
self
.
files
[
target
],
steps
=
5
,
reg
=
registration
(
self
.
files
[
baseline
],
self
.
files
[
target
],
steps
=
5
,
smooth
=
1
).
reg
smooth
=
1
).
reg
reg
.
addActor
(
CMap
=
self
.
CMap02P
)
#reg.addActor(CMap = self.CMap02P)
reg
.
addActor
(
CMap
=
self
.
CMapN2P
)
regName
=
target
+
'
_reg
'
regName
=
target
+
'
_reg
'
self
.
files
[
regName
]
=
reg
self
.
files
[
regName
]
=
reg
self
.
filesDrop
.
append
(
regName
)
self
.
filesDrop
.
append
(
regName
)
...
@@ -243,7 +251,12 @@ class AmpScanGUI(QMainWindow):
...
@@ -243,7 +251,12 @@ class AmpScanGUI(QMainWindow):
self
.
alCont
.
getNames
()
self
.
alCont
.
getNames
()
if
hasattr
(
self
,
'
regCont
'
):
if
hasattr
(
self
,
'
regCont
'
):
self
.
regCont
.
getNames
()
self
.
regCont
.
getNames
()
#im = []
if
self
.
regCont
.
tick
.
isChecked
()
is
True
:
reg
.
actor
.
setScalarRange
([
-
10
,
10
])
reg
.
actor
.
setShading
(
False
)
reg
.
CMapOut
(
colors
=
self
.
CMapN2P
)
reg
.
plotResults
(
name
=
"
distributionofshapevariance.png
"
)
print
(
'
Run the Registration code between %s and %s
'
%
(
baseline
,
target
))
print
(
'
Run the Registration code between %s and %s
'
%
(
baseline
,
target
))
def
register
(
self
):
def
register
(
self
):
...
@@ -330,6 +343,8 @@ class AmpScanGUI(QMainWindow):
...
@@ -330,6 +343,8 @@ class AmpScanGUI(QMainWindow):
triggered
=
self
.
analyse
)
triggered
=
self
.
analyse
)
self
.
pick
=
QAction
(
QIcon
(
'
open.png
'
),
'
Pick
'
,
self
,
self
.
pick
=
QAction
(
QIcon
(
'
open.png
'
),
'
Pick
'
,
self
,
triggered
=
self
.
Point_Pick
)
triggered
=
self
.
Point_Pick
)
self
.
removePick
=
QAction
(
QIcon
(
'
open.png
'
),
'
Clear all picked points
'
,
self
,
triggered
=
self
.
removePick
)
def
createMenus
(
self
):
def
createMenus
(
self
):
"""
"""
...
@@ -353,6 +368,7 @@ class AmpScanGUI(QMainWindow):
...
@@ -353,6 +368,7 @@ class AmpScanGUI(QMainWindow):
self
.
kineticMenu
.
addAction
(
self
.
openPress
)
self
.
kineticMenu
.
addAction
(
self
.
openPress
)
self
.
PointMenu
=
self
.
menuBar
().
addMenu
(
"
&Pick Point
"
)
self
.
PointMenu
=
self
.
menuBar
().
addMenu
(
"
&Pick Point
"
)
self
.
PointMenu
.
addAction
(
self
.
pick
)
self
.
PointMenu
.
addAction
(
self
.
pick
)
self
.
PointMenu
.
addAction
(
self
.
removePick
)
class
fileManager
(
QMainWindow
):
class
fileManager
(
QMainWindow
):
"""
"""
...
@@ -470,7 +486,38 @@ class AlignControls(QMainWindow):
...
@@ -470,7 +486,38 @@ class AlignControls(QMainWindow):
self
.
moving
.
clear
()
self
.
moving
.
clear
()
self
.
moving
.
addItems
(
self
.
names
)
self
.
moving
.
addItems
(
self
.
names
)
class
PickerControls
(
QMainWindow
):
"""
Pop up after point is picked
"""
def
__init__
(
self
,
names
,
parent
=
None
):
super
(
PickerControls
,
self
).
__init__
(
parent
)
self
.
main
=
QWidget
()
self
.
names
=
names
self
.
baseline
=
QComboBox
()
self
.
target
=
QComboBox
()
self
.
reg
=
QPushButton
(
"
Run Registration
"
)
self
.
setCentralWidget
(
self
.
main
)
self
.
layout
=
QGridLayout
()
self
.
layout
.
addWidget
(
QLabel
(
'
Baseline
'
),
0
,
0
)
self
.
layout
.
addWidget
(
QLabel
(
'
Target
'
),
1
,
0
)
self
.
layout
.
addWidget
(
self
.
baseline
,
0
,
1
)
self
.
layout
.
addWidget
(
self
.
target
,
1
,
1
)
self
.
layout
.
addWidget
(
self
.
reg
,
2
,
0
,
1
,
-
1
)
self
.
main
.
setLayout
(
self
.
layout
)
self
.
setWindowTitle
(
"
Registration Manager
"
)
self
.
getNames
()
def
getNames
(
self
):
"""
"""
self
.
baseline
.
clear
()
self
.
baseline
.
addItems
(
self
.
names
)
self
.
target
.
clear
()
self
.
target
.
addItems
(
self
.
names
)
class
RegistrationControls
(
QMainWindow
):
class
RegistrationControls
(
QMainWindow
):
"""
"""
Pop up for controls to align the
Pop up for controls to align the
...
@@ -490,13 +537,15 @@ class RegistrationControls(QMainWindow):
...
@@ -490,13 +537,15 @@ class RegistrationControls(QMainWindow):
self
.
baseline
=
QComboBox
()
self
.
baseline
=
QComboBox
()
self
.
target
=
QComboBox
()
self
.
target
=
QComboBox
()
self
.
reg
=
QPushButton
(
"
Run Registration
"
)
self
.
reg
=
QPushButton
(
"
Run Registration
"
)
self
.
tick
=
QCheckBox
(
"
Generate Output File for Comparison?
"
)
self
.
setCentralWidget
(
self
.
main
)
self
.
setCentralWidget
(
self
.
main
)
self
.
layout
=
QGridLayout
()
self
.
layout
=
QGridLayout
()
self
.
layout
.
addWidget
(
QLabel
(
'
Baseline
'
),
0
,
0
)
self
.
layout
.
addWidget
(
QLabel
(
'
Baseline
'
),
0
,
0
)
self
.
layout
.
addWidget
(
QLabel
(
'
Target
'
),
1
,
0
)
self
.
layout
.
addWidget
(
QLabel
(
'
Target
'
),
1
,
0
)
self
.
layout
.
addWidget
(
self
.
baseline
,
0
,
1
)
self
.
layout
.
addWidget
(
self
.
baseline
,
0
,
1
)
self
.
layout
.
addWidget
(
self
.
target
,
1
,
1
)
self
.
layout
.
addWidget
(
self
.
target
,
1
,
1
)
self
.
layout
.
addWidget
(
self
.
reg
,
2
,
0
,
1
,
-
1
)
self
.
layout
.
addWidget
(
self
.
tick
,
2
,
1
)
self
.
layout
.
addWidget
(
self
.
reg
,
3
,
0
,
1
,
-
1
)
self
.
main
.
setLayout
(
self
.
layout
)
self
.
main
.
setLayout
(
self
.
layout
)
self
.
setWindowTitle
(
"
Registration Manager
"
)
self
.
setWindowTitle
(
"
Registration Manager
"
)
self
.
getNames
()
self
.
getNames
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment