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
5fb65dd7
Commit
5fb65dd7
authored
7 years ago
by
Joshua Steer
Browse files
Options
Downloads
Plain Diff
Fixed merges
parents
474dc266
19eed3bd
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
AmpScan/ampVis.py
+21
-13
21 additions, 13 deletions
AmpScan/ampVis.py
AmpScan/fe.py
+1
-1
1 addition, 1 deletion
AmpScan/fe.py
with
22 additions
and
14 deletions
AmpScan/ampVis.py
+
21
−
13
View file @
5fb65dd7
...
...
@@ -96,16 +96,16 @@ class ampVTK(object):
self
.
axes
[
viewport
].
GetTitleTextProperty
(
axes
).
SetFontFamilyToCourier
()
self
.
axes
[
viewport
].
GetLabelTextProperty
(
axes
).
SetFontFamilyToCourier
()
self
.
axes
[
viewport
].
GetXAxesLinesProperty
().
SetColor
(
color
)
self
.
axes
[
viewport
].
GetYAxesLinesProperty
().
SetColor
(
color
)
self
.
axes
[
viewport
].
GetZAxesLinesProperty
().
SetColor
(
color
)
self
.
axes
[
viewport
].
SetGridLineLocation
(
self
.
axes
[
viewport
].
VTK_GRID_LINES_FURTHEST
)
self
.
axes
[
viewport
].
XAxisMinorTickVisibilityOff
()
self
.
axes
[
viewport
].
YAxisMinorTickVisibilityOff
()
self
.
axes
[
viewport
].
ZAxisMinorTickVisibilityOff
()
self
.
rens
[
viewport
].
AddActor
(
self
.
axes
[
viewport
])
#
self.axes[viewport].GetXAxesLinesProperty().SetColor(color)
#
self.axes[viewport].GetYAxesLinesProperty().SetColor(color)
#
self.axes[viewport].GetZAxesLinesProperty().SetColor(color)
#
#
self.axes[viewport].SetGridLineLocation(self.axes[viewport].VTK_GRID_LINES_FURTHEST)
#
#
self.axes[viewport].XAxisMinorTickVisibilityOff()
#
self.axes[viewport].YAxisMinorTickVisibilityOff()
#
self.axes[viewport].ZAxisMinorTickVisibilityOff()
#
self.rens[viewport].AddActor(self.axes[viewport])
class
qtVtkWindow
(
QVTKRenderWindowInteractor
,
ampVTK
):
...
...
@@ -195,12 +195,14 @@ class vtkRenWin(vtk.vtkRenderWindow, ampVTK):
[
self
.
winWidth
,
self
.
winHeight
,
3
]))
/
255.0
def
getScreenshot
(
self
,
fname
,
mag
=
10
):
self
.
SetAlphaBitPlanes
(
1
)
w2if
=
vtk
.
vtkWindowToImageFilter
()
w2if
.
SetInput
(
self
)
w2if
.
SetScale
(
mag
)
w2if
.
SetInputBufferTypeToRGBA
()
w2if
.
Update
()
writer
=
vtk
.
vtk
TIFF
Writer
()
writer
=
vtk
.
vtk
PNG
Writer
()
writer
.
SetFileName
(
fname
)
writer
.
SetInputConnection
(
w2if
.
GetOutputPort
())
writer
.
Write
()
...
...
@@ -210,7 +212,7 @@ class visMixin(object):
def
genIm
(
self
,
actor
=
[
'
limb
'
],
winWidth
=
512
,
winHeight
=
512
,
views
=
[[
0
,
-
1
,
0
]],
background
=
[
1.0
,
1.0
,
1.0
],
projection
=
True
,
shading
=
True
,
mag
=
10
):
shading
=
True
,
mag
=
10
,
out
=
'
im
'
,
name
=
'
test.tiff
'
):
"""
"""
...
...
@@ -224,7 +226,13 @@ class visMixin(object):
win
.
setProjection
(
projection
,
viewport
=
i
)
win
.
renderActors
(
self
.
actors
,
actor
,
viewport
=
i
,
shading
=
shading
,
zoom
=
1.3
)
win
.
Render
()
win
.
getScreenshot
(
'
test.tiff
'
)
win
.
getImage
()
if
out
==
'
im
'
:
return
win
.
im
elif
out
==
'
fh
'
:
win
.
getScreenshot
(
name
)
return
# win.getScreenshot('test.tiff')
# return win.im
def
addActor
(
self
,
stype
=
0
,
CMap
=
None
):
...
...
This diff is collapsed.
Click to expand it.
AmpScan/fe.py
+
1
−
1
View file @
5fb65dd7
...
...
@@ -12,7 +12,7 @@ class feMixin(object):
def
addFE
(
self
,
files
):
if
len
(
files
)
==
1
:
data
=
np
.
load
(
files
[
0
],
encoding
=
'
bytes
'
).
item
()
for
k
,
v
in
data
.
item
s
():
for
k
in
list
(
data
.
key
s
()
)
:
data
[
str
(
k
,
'
utf-8
'
)]
=
data
.
pop
(
k
)
if
len
(
files
)
==
3
:
data
=
{}
...
...
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