kayarre
(Kurt Sansom)
November 15, 2018, 6:14pm
1
in 3d slicer there is a way to grab data that is already loaded with the grabNode() function, is there a similar function in paraview where you can interactively grab a loaded dataset and apply other vtk filters to it?
this in the context of using the python shell along with the gui.
mwestphal
(Mathieu Westphal (Kitware))
November 16, 2018, 8:13am
2
This is a task for servermanager.Fetch
, be aware that it can be expansive to call it in some cases.
from vtk import *
s=Cone()
object = servermanager.Fetch(s)
writer = vtkXMLPolyDataWriter()
writer.SetInputData(object)
writer.SetFilename("test.vtp")
writer.Write()
kayarre
(Kurt Sansom)
December 19, 2018, 11:48pm
3
this is helpful but when I say loaded I mean loaded via the gui. not the python shell.
an example would be to access the origin of a triangle surface that was already loaded via the gui and get the object as a python object in the shell.
mwestphal
(Mathieu Westphal (Kitware))
December 21, 2018, 10:39am
4
The python shell is compatible with the GUI.
In the GUI, in the Pipeline Browsser, click on the source you want to examine, then :
s = GetActiveSource()
object = servermanager.Fetch(s)
1 Like