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
GitLab 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
8ca808aa
Commit
8ca808aa
authored
Apr 11, 2018
by
Joshua Steer
Browse files
Options
Downloads
Patches
Plain Diff
Updated colourmap consistency throughout the code
parent
5fb65dd7
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
AmpScan/AmpScanGUI.py
+5
-5
5 additions, 5 deletions
AmpScan/AmpScanGUI.py
AmpScan/analyse.py
+4
-5
4 additions, 5 deletions
AmpScan/analyse.py
AmpScan/core.py
+8
-0
8 additions, 0 deletions
AmpScan/core.py
AmpScan/pressSens.py
+9
-9
9 additions, 9 deletions
AmpScan/pressSens.py
with
26 additions
and
19 deletions
AmpScan/AmpScanGUI.py
+
5
−
5
View file @
8ca808aa
...
...
@@ -20,8 +20,8 @@ class AmpScanGUI(QMainWindow):
self
.
vtkWidget
=
qtVtkWindow
()
self
.
mainWidget
=
QWidget
()
self
.
AmpObj
=
None
self
.
CMap
=
np
.
array
([[
212.0
,
221.0
,
225.0
],
[
31.0
,
73.0
,
125.0
]])
/
255.0
#
self.CMap = np.array([[212.0, 221.0, 225.0],
#
[31.0, 73.0, 125.0]])/255.0
self
.
setCentralWidget
(
self
.
mainWidget
)
self
.
createActions
()
self
.
createMenus
()
...
...
@@ -76,7 +76,7 @@ class AmpScanGUI(QMainWindow):
self
.
RegObj
=
regObject
(
self
.
AmpObj
)
self
.
RegObj
.
registration
(
steps
=
5
,
baseline
=
'
socket
'
,
target
=
'
limb
'
,
reg
=
'
reglimb
'
,
direct
=
True
)
self
.
RegObj
.
addActor
(
stype
=
'
reglimb
'
,
CMap
=
self
.
CMap
)
self
.
RegObj
.
addActor
(
stype
=
'
reglimb
'
,
CMap
=
self
.
AmpObj
.
CMap
N2P
)
self
.
vtkWidget
.
renderActors
(
self
.
AmpObj
.
actors
,
[
'
reglimb
'
,],
shading
=
False
)
self
.
vtkWidget
.
setScalarBar
(
self
.
AmpObj
.
actors
[
'
reglimb
'
])
...
...
@@ -89,7 +89,7 @@ class AmpScanGUI(QMainWindow):
self
.
vtkWidget
.
setnumViewports
(
1
)
self
.
AmpObj
.
addFE
([
FEname
[
0
],])
self
.
AmpObj
.
lp_smooth
(
'
FE
'
,
n
=
1
)
self
.
AmpObj
.
addActor
(
stype
=
'
FE
'
,
CMap
=
self
.
CMap
)
self
.
AmpObj
.
addActor
(
stype
=
'
FE
'
,
CMap
=
self
.
AmpObj
.
CMap
02P
)
self
.
AmpObj
.
actors
[
'
FE
'
].
setScalarRange
(
smin
=
0.0
,
smax
=
50
)
self
.
vtkWidget
.
renderActors
(
self
.
AmpObj
.
actors
,
[
'
FE
'
,])
self
.
vtkWidget
.
setScalarBar
(
self
.
AmpObj
.
actors
[
'
FE
'
])
...
...
@@ -104,7 +104,7 @@ class AmpScanGUI(QMainWindow):
self
.
pSense
.
calcFaces
(
d
=
5
)
self
.
pSense
.
importVert
(
vName
[
0
])
self
.
pSense
.
importPress
(
pName
[
0
])
self
.
pSense
.
addActor
(
CMap
=
self
.
CMap
)
self
.
pSense
.
addActor
(
CMap
=
self
.
AmpObj
.
CMap
02P
)
self
.
AmpObj
.
actors
[
'
antS
'
]
=
self
.
pSense
.
actors
[
'
antS
'
]
self
.
AmpObj
.
actors
[
'
socket
'
].
setColor
([
1.0
,
1.0
,
1.0
])
self
.
AmpObj
.
actors
[
'
socket
'
].
setOpacity
(
1.0
)
...
...
This diff is collapsed.
Click to expand it.
AmpScan/analyse.py
+
4
−
5
View file @
8ca808aa
...
...
@@ -15,7 +15,7 @@ import AmpScan.cython_ext as cyext
class
analyseMixin
(
object
):
def
plot_slices
(
self
,
axis
=
'
Z
'
,
slWidth
=
3
,
stype
=
0
):
def
plot_slices
(
self
,
axis
=
'
Z
'
,
slWidth
=
10
,
stype
=
0
):
if
isinstance
(
stype
,
int
):
stype
=
self
.
stype
[
stype
]
data
=
getattr
(
self
,
stype
)
...
...
@@ -24,7 +24,7 @@ class analyseMixin(object):
# Define max Z from lowest point on brim
maxZ
=
data
[
'
vert
'
][
data
[
'
edges
'
][
ind
,
:],
2
].
min
()
fig
=
plt
.
figure
()
fig
.
set_size_inches
(
12
,
9
)
fig
.
set_size_inches
(
6
,
4.5
)
ax1
=
fig
.
add_subplot
(
221
,
projection
=
'
3d
'
)
ax2
=
fig
.
add_subplot
(
222
)
...
...
@@ -60,13 +60,12 @@ class analyseMixin(object):
ax3
.
set_axis_off
()
# Rendering of the rectification map
ax4
=
fig
.
add_subplot
(
2
,
2
,
4
)
CMap
=
np
.
array
([[
212.0
,
221.0
,
225.0
],
[
31.0
,
73.0
,
125.0
]])
/
255.0
self
.
addActor
(
stype
=
'
reglimb
'
,
CMap
=
CMap
)
self
.
addActor
(
stype
=
'
reglimb
'
,
CMap
=
self
.
CMapN2P
)
Im
=
self
.
genIm
(
actor
=
[
'
reglimb
'
])
ax4
.
imshow
(
Im
,
None
)
ax4
.
set_axis_off
()
plt
.
tight_layout
()
plt
.
show
()
@staticmethod
def
create_slices
(
data
,
slices
,
axis
=
'
Z
'
):
...
...
This diff is collapsed.
Click to expand it.
AmpScan/core.py
+
8
−
0
View file @
8ca808aa
...
...
@@ -47,6 +47,14 @@ class AmpObject(alignMixin, trimMixin, smoothMixin, analyseMixin,
visMixin
,
feMixin
,
socketDesignMixin
):
def
__init__
(
self
,
Data
,
stype
):
c1
=
[
31.0
,
73.0
,
125.0
]
c3
=
[
170.0
,
75.0
,
65.0
]
c2
=
[
212.0
,
221.0
,
225.0
]
CMap1
=
np
.
c_
[[
np
.
linspace
(
st
,
en
)
for
(
st
,
en
)
in
zip
(
c1
,
c2
)]]
CMap2
=
np
.
c_
[[
np
.
linspace
(
st
,
en
)
for
(
st
,
en
)
in
zip
(
c2
,
c3
)]]
CMap
=
np
.
c_
[
CMap1
[:,
:
-
1
],
CMap2
]
self
.
CMapN2P
=
np
.
transpose
(
CMap
)
/
255.0
self
.
CMap02P
=
np
.
flip
(
np
.
transpose
(
CMap1
)
/
255.0
,
axis
=
0
)
self
.
stype
=
[]
self
.
actors
=
{}
if
stype
in
[
'
limb
'
,
'
socket
'
,
'
reglimb
'
,
'
regsocket
'
,
'
MRI
'
]:
...
...
This diff is collapsed.
Click to expand it.
AmpScan/pressSens.py
+
9
−
9
View file @
8ca808aa
...
...
@@ -91,16 +91,16 @@ class pressSense(object):
# Define face
f0
=
np
.
array
([[
0
,
cols
+
1
,
1
],
[
1
,
cols
+
1
,
cols
+
2
]])
for
row
in
x
range
(
rows
):
for
col
in
x
range
(
cols
):
for
row
in
range
(
rows
):
for
col
in
range
(
cols
):
ind
=
row
*
cols
*
2
+
col
*
2
ind2
=
row
*
(
cols
+
1
)
+
col
f
[[
ind
,
ind
+
1
],
:]
=
f0
+
ind2
ind
=
np
.
arange
(
0
,
cols
*
2
*
d
,
cols
*
2
)[:,
None
]
for
row
in
x
range
(
15
):
for
row
in
range
(
15
):
inds
=
np
.
array
([
np
.
arange
(
2
*
d
)
+
d
*
row
*
cols
*
2
]
*
d
)
inds
+=
np
.
arange
(
0
,
cols
*
2
*
d
,
cols
*
2
)[:,
None
]
for
col
in
x
range
(
3
):
for
col
in
range
(
3
):
sF
[
row
*
3
+
col
,
:]
=
inds
.
flatten
()
inds
+=
2
*
d
self
.
antS
[
'
faces
'
]
=
f
...
...
@@ -120,16 +120,16 @@ class pressSense(object):
sF
=
np
.
zeros
([
45
,
2
*
d
**
2
],
dtype
=
np
.
int64
)
f0
=
np
.
array
([[
0
,
cols
+
1
,
1
],
[
1
,
cols
+
1
,
2
]])
for
row
in
x
range
(
rows
):
for
col
in
x
range
(
cols
):
for
row
in
range
(
rows
):
for
col
in
range
(
cols
):
ind
=
row
*
cols
*
2
+
col
*
2
ind2
=
row
*
(
cols
+
1
)
+
col
f
[[
ind
,
ind
+
1
],
:]
=
f0
+
ind2
ind
=
np
.
arange
(
0
,
cols
*
2
*
d
,
cols
*
2
)[:,
None
]
for
row
in
x
range
(
15
):
for
row
in
range
(
15
):
inds
=
np
.
array
([
np
.
arange
(
2
*
d
)
+
d
*
row
*
cols
*
2
]
*
d
)
inds
+=
np
.
arange
(
0
,
cols
*
2
*
d
,
cols
*
2
)[:,
None
]
for
col
in
x
range
(
3
):
for
col
in
range
(
3
):
sF
[
row
*
3
+
col
,
:]
=
inds
.
flatten
()
inds
+=
2
*
d
self
.
antS
[
'
faces
'
]
=
f
...
...
@@ -199,7 +199,7 @@ class pressSense(object):
self
.
lut
=
vtk
.
vtkLookupTable
()
self
.
lut
.
SetNumberOfTableValues
(
bands
)
self
.
lut
.
Build
()
for
i
in
x
range
(
bands
):
for
i
in
range
(
bands
):
rgb
=
list
(
self
.
ctf
.
GetColor
(
float
(
i
)
/
bands
))
+
[
1
]
self
.
lut
.
SetTableValue
(
i
,
rgb
)
...
...
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