Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sankhesh Jhaveri
VTK
Commits
0061b2d5
Commit
0061b2d5
authored
Mar 28, 2012
by
David Gobbi
Browse files
BUG: Update python vtk module for VTK6-style input.
Change-Id: Ifc76340e581c5cf07b6c40b7ecd77f292b96962b
parent
24ea32d7
Changes
14
Hide whitespace changes
Inline
Side-by-side
Wrapping/Python/vtk/gtk/GtkGLExtVTKRenderWindow.py
View file @
0061b2d5
...
...
@@ -521,7 +521,7 @@ def main():
cone
=
vtk
.
vtkConeSource
()
cone
.
SetResolution
(
80
)
coneMapper
=
vtk
.
vtkPolyDataMapper
()
coneMapper
.
SetInput
(
cone
.
GetOutput
())
coneMapper
.
SetInput
Connection
(
cone
.
GetOutput
Port
())
#coneActor = vtk.vtkLODActor()
coneActor
=
vtk
.
vtkActor
()
coneActor
.
SetMapper
(
coneMapper
)
...
...
Wrapping/Python/vtk/gtk/GtkGLExtVTKRenderWindowInteractor.py
View file @
0061b2d5
...
...
@@ -280,7 +280,7 @@ def main():
cone
=
vtk
.
vtkConeSource
()
cone
.
SetResolution
(
80
)
coneMapper
=
vtk
.
vtkPolyDataMapper
()
coneMapper
.
SetInput
(
cone
.
GetOutput
())
coneMapper
.
SetInput
Connection
(
cone
.
GetOutput
Port
())
#coneActor = vtk.vtkLODActor()
coneActor
=
vtk
.
vtkActor
()
coneActor
.
SetMapper
(
coneMapper
)
...
...
Wrapping/Python/vtk/gtk/GtkVTKRenderWindow.py
View file @
0061b2d5
...
...
@@ -505,7 +505,7 @@ def main():
cone
=
vtk
.
vtkConeSource
()
cone
.
SetResolution
(
80
)
coneMapper
=
vtk
.
vtkPolyDataMapper
()
coneMapper
.
SetInput
(
cone
.
GetOutput
())
coneMapper
.
SetInput
Connection
(
cone
.
GetOutput
Port
())
#coneActor = vtk.vtkLODActor()
coneActor
=
vtk
.
vtkActor
()
coneActor
.
SetMapper
(
coneMapper
)
...
...
Wrapping/Python/vtk/gtk/GtkVTKRenderWindowInteractor.py
View file @
0061b2d5
...
...
@@ -273,7 +273,7 @@ def main():
cone
=
vtk
.
vtkConeSource
()
cone
.
SetResolution
(
80
)
coneMapper
=
vtk
.
vtkPolyDataMapper
()
coneMapper
.
SetInput
(
cone
.
GetOutput
())
coneMapper
.
SetInput
Connection
(
cone
.
GetOutput
Port
())
#coneActor = vtk.vtkLODActor()
coneActor
=
vtk
.
vtkActor
()
coneActor
.
SetMapper
(
coneMapper
)
...
...
Wrapping/Python/vtk/qt/QVTKRenderWidget.py
View file @
0061b2d5
...
...
@@ -457,7 +457,7 @@ def QVTKRenderWidgetConeExample():
cone
.
SetResolution
(
8
)
coneMapper
=
vtk
.
vtkPolyDataMapper
()
coneMapper
.
SetInput
(
cone
.
GetOutput
())
coneMapper
.
SetInput
Connection
(
cone
.
GetOutput
Port
())
coneActor
=
vtk
.
vtkActor
()
coneActor
.
SetMapper
(
coneMapper
)
...
...
Wrapping/Python/vtk/qt/QVTKRenderWindowInteractor.py
View file @
0061b2d5
...
...
@@ -330,7 +330,7 @@ def QVTKRenderWidgetConeExample():
cone
.
SetResolution
(
8
)
coneMapper
=
vtk
.
vtkPolyDataMapper
()
coneMapper
.
SetInput
(
cone
.
GetOutput
())
coneMapper
.
SetInput
Connection
(
cone
.
GetOutput
Port
())
coneActor
=
vtk
.
vtkActor
()
coneActor
.
SetMapper
(
coneMapper
)
...
...
Wrapping/Python/vtk/qt4/QVTKRenderWindowInteractor.py
View file @
0061b2d5
...
...
@@ -368,7 +368,7 @@ def QVTKRenderWidgetConeExample():
cone
.
SetResolution
(
8
)
coneMapper
=
vtk
.
vtkPolyDataMapper
()
coneMapper
.
SetInput
(
cone
.
GetOutput
())
coneMapper
.
SetInput
Connection
(
cone
.
GetOutput
Port
())
coneActor
=
vtk
.
vtkActor
()
coneActor
.
SetMapper
(
coneMapper
)
...
...
Wrapping/Python/vtk/tk/vtkTkImageViewerWidget.py
View file @
0061b2d5
...
...
@@ -280,14 +280,12 @@ class vtkTkImageViewerWidget(Tkinter.Widget):
# y is flipped upside down
y
=
self
.
winfo_height
()
-
y
# make sure point is in the
whole
extent of the image.
(
xMin
,
xMax
,
yMin
,
yMax
,
zMin
,
zMax
)
=
input
.
Get
Whole
Extent
()
# make sure point is in the extent of the image.
(
xMin
,
xMax
,
yMin
,
yMax
,
zMin
,
zMax
)
=
input
.
GetExtent
()
if
(
x
<
xMin
or
x
>
xMax
or
y
<
yMin
or
\
y
>
yMax
or
z
<
zMin
or
z
>
zMax
):
return
input
.
SetUpdateExtent
(
x
,
x
,
y
,
y
,
z
,
z
)
input
.
Update
()
numComps
=
input
.
GetNumberOfScalarComponents
()
text
=
""
for
i
in
xrange
(
numComps
):
...
...
@@ -348,7 +346,7 @@ if __name__ == "__main__":
widget
=
vtkTkImageViewerWidget
(
frame
,
width
=
512
,
height
=
512
,
double
=
1
)
viewer
=
widget
.
GetImageViewer
()
viewer
.
SetInput
(
canvas
.
GetOutput
())
viewer
.
SetInput
Connection
(
canvas
.
GetOutput
Port
())
viewer
.
SetColorWindow
(
256
)
viewer
.
SetColorLevel
(
127.5
)
...
...
Wrapping/Python/vtk/tk/vtkTkRenderWidget.py
View file @
0061b2d5
...
...
@@ -450,7 +450,7 @@ def vtkRenderWidgetConeExample():
cone
.
SetResolution
(
8
)
coneMapper
=
vtk
.
vtkPolyDataMapper
()
coneMapper
.
SetInput
(
cone
.
GetOutput
())
coneMapper
.
SetInput
Connection
(
cone
.
GetOutput
Port
())
coneActor
=
vtk
.
vtkActor
()
coneActor
.
SetMapper
(
coneMapper
)
...
...
Wrapping/Python/vtk/tk/vtkTkRenderWindowInteractor.py
View file @
0061b2d5
...
...
@@ -377,7 +377,7 @@ def vtkRenderWindowInteractorConeExample():
cone
.
SetResolution
(
8
)
coneMapper
=
vtk
.
vtkPolyDataMapper
()
coneMapper
.
SetInput
(
cone
.
GetOutput
())
coneMapper
.
SetInput
Connection
(
cone
.
GetOutput
Port
())
coneActor
=
vtk
.
vtkActor
()
coneActor
.
SetMapper
(
coneMapper
)
...
...
Wrapping/Python/vtk/util/misc.py
View file @
0061b2d5
...
...
@@ -47,7 +47,7 @@ def vtkRegressionTestImage( renWin ):
else
:
rt_pngw
=
vtk
.
vtkPNGWriter
()
rt_pngw
.
SetFileName
(
fname
)
rt_pngw
.
SetInput
(
rt_w2if
.
GetOutput
())
rt_pngw
.
SetInput
Connection
(
rt_w2if
.
GetOutput
Port
())
rt_pngw
.
Write
()
rt_pngw
=
None
...
...
@@ -55,8 +55,8 @@ def vtkRegressionTestImage( renWin ):
rt_png
.
SetFileName
(
fname
)
rt_id
=
vtk
.
vtkImageDifference
()
rt_id
.
SetInput
(
rt_w2if
.
GetOutput
())
rt_id
.
SetImage
(
rt_png
.
GetOutput
())
rt_id
.
SetInput
Connection
(
rt_w2if
.
GetOutput
Port
())
rt_id
.
SetImage
Connection
(
rt_png
.
GetOutput
Port
())
rt_id
.
Update
()
if
rt_id
.
GetThresholdedError
()
<=
10
:
...
...
Wrapping/Python/vtk/util/vtkImageExportToArray.py
View file @
0061b2d5
...
...
@@ -10,7 +10,7 @@ To use this class, you must have numpy installed (http://numpy.scipy.org)
Methods
SetInputConnection(vtkAlgorithmOutput) -- connect to VTK image pipeline
SetInput(vtkImageData) -- set an vtkImageData to export
SetInput
Data
(vtkImageData) -- set an vtkImageData to export
GetArray() -- execute pipeline and return a numpy array
Methods from vtkImageExport
...
...
@@ -24,6 +24,7 @@ import umath
import
numpy
from
vtk
import
vtkImageExport
from
vtk
import
vtkStreamingDemandDrivenPipeline
from
vtk
import
VTK_SIGNED_CHAR
from
vtk
import
VTK_UNSIGNED_CHAR
from
vtk
import
VTK_SHORT
...
...
@@ -78,17 +79,17 @@ class vtkImageExportToArray:
def
SetInputConnection
(
self
,
input
):
return
self
.
__export
.
SetInputConnection
(
input
)
def
SetInput
(
self
,
input
):
return
self
.
__export
.
SetInput
(
input
)
def
SetInput
Data
(
self
,
input
):
return
self
.
__export
.
SetInput
Data
(
input
)
def
GetInput
(
self
):
return
self
.
__export
.
GetInput
()
def
GetArray
(
self
):
self
.
__export
.
Update
()
input
=
self
.
__export
.
GetInput
()
input
.
UpdateInformation
()
extent
=
input
.
GetExtent
()
type
=
input
.
GetScalarType
()
extent
=
input
.
GetWholeExtent
()
numComponents
=
input
.
GetNumberOfScalarComponents
()
dim
=
(
extent
[
5
]
-
extent
[
4
]
+
1
,
extent
[
3
]
-
extent
[
2
]
+
1
,
...
...
Wrapping/Python/vtk/wx/wxVTKRenderWindow.py
View file @
0061b2d5
...
...
@@ -748,7 +748,7 @@ def wxVTKRenderWindowConeExample():
cone
.
SetResolution
(
8
)
coneMapper
=
vtk
.
vtkPolyDataMapper
()
coneMapper
.
SetInput
(
cone
.
GetOutput
())
coneMapper
.
SetInput
Connection
(
cone
.
GetOutput
Port
())
coneActor
=
vtk
.
vtkActor
()
coneActor
.
SetMapper
(
coneMapper
)
...
...
Wrapping/Python/vtk/wx/wxVTKRenderWindowInteractor.py
View file @
0061b2d5
...
...
@@ -695,7 +695,7 @@ def wxVTKRenderWindowInteractorConeExample():
cone
.
SetResolution
(
8
)
coneMapper
=
vtk
.
vtkPolyDataMapper
()
coneMapper
.
SetInput
(
cone
.
GetOutput
())
coneMapper
.
SetInput
Connection
(
cone
.
GetOutput
Port
())
coneActor
=
vtk
.
vtkActor
()
coneActor
.
SetMapper
(
coneMapper
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment