[Paraview] VTK access from python

Sean Ziegeler sean.ziegeler at nrlssc.navy.mil
Tue Jan 29 12:57:13 EST 2013


FWIW, I've also found that only importing the VTK modules that one needs 
in a given script shaves off some time during the initialization of the 
script.

On 01/29/13 06:50, Pat Marion wrote:
> There's a lot of VTK python modules, and unfortunately they are not all
> imported with you import paraview.vtk from ParaView's python console.
>   But, all the python modules are shipped with ParaView, as far as I
> know, they just aren't imported.  I wish there was an easy way to import
> the full set of vtk python modules in ParaView, maybe someone else knows
> a way?  The only way I know how to do it is to import the modules
> manually.  For example, to get the IOXML module:
>
>  >>> from vtkIOXMLPython import *
>
> Or, you can create a new .py file (or edit the vtk/__init__.py file) to
> import all the modules.  To find the __init__.py file:
>
>  >>> import paraview.vtk
>  >>> print paraview.vtk.__file__ # this the path to a .pyc file, edit
> the .py file in the same directory
>
>
> Either edit the __init__.py file, or create a new file named like
> vtkFull.py and add import statements like:  from <modulename> import *.
> Here's a long list of all the modules I found, depending on which
> version you have, you might have a different list:
>
>
> from vtkCPTestDriverPython import *
> from vtkChartsCorePython import *
> from vtkCoProcessorPython import *
> from vtkCommonColorPython import *
> from vtkCommonComputationalGeometryPython import *
> from vtkCommonCorePython import *
> from vtkCommonDataModelPython import *
> from vtkCommonExecutionModelPython import *
> from vtkCommonMathPython import *
> from vtkCommonMiscPython import *
> from vtkCommonSystemPython import *
> from vtkCommonTransformsPython import *
> from vtkDomainsChemistryPython import *
> from vtkFiltersAMRPython import *
> from vtkFiltersCorePython import *
> from vtkFiltersCosmoPython import *
> from vtkFiltersExtractionPython import *
> from vtkFiltersFlowPathsPython import *
> from vtkFiltersGeneralPython import *
> from vtkFiltersGenericPython import *
> from vtkFiltersGeometryPython import *
> from vtkFiltersHybridPython import *
> from vtkFiltersHyperTreePython import *
> from vtkFiltersImagingPython import *
> from vtkFiltersModelingPython import *
> from vtkFiltersParallelPython import *
> from vtkFiltersParallelStatisticsPython import *
> from vtkFiltersProgrammablePython import *
> from vtkFiltersSourcesPython import *
> from vtkFiltersStatisticsPython import *
> from vtkFiltersTexturePython import *
> from vtkFiltersVerdictPython import *
> from vtkIOAMRPython import *
> from vtkIOCorePython import *
> from vtkIOEnSightPython import *
> from vtkIOExodusPython import *
> from vtkIOExportPython import *
> from vtkIOGeometryPython import *
> from vtkIOImagePython import *
> from vtkIOImportPython import *
> from vtkIOInfovisPython import *
> from vtkIOLSDynaPython import *
> from vtkIOLegacyPython import *
> from vtkIOMoviePython import *
> from vtkIONetCDFPython import *
> from vtkIOPLYPython import *
> from vtkIOParallelExodusPython import *
> from vtkIOParallelLSDynaPython import *
> from vtkIOParallelPython import *
> from vtkIOVPICPython import *
> from vtkIOXMLParserPython import *
> from vtkIOXMLPython import *
> from vtkIOXdmf2Python import *
> from vtkImagingColorPython import *
> from vtkImagingCorePython import *
> from vtkImagingFourierPython import *
> from vtkImagingGeneralPython import *
> from vtkImagingHybridPython import *
> from vtkImagingMorphologicalPython import *
> from vtkImagingSourcesPython import *
> from vtkInfovisCorePython import *
> from vtkInfovisLayoutPython import *
> from vtkInteractionImagePython import *
> from vtkInteractionStylePython import *
> from vtkInteractionWidgetsPython import *
> from vtkPVClientServerCoreCorePython import *
> from vtkPVClientServerCoreDefaultPython import *
> from vtkPVClientServerCoreRenderingPython import *
> from vtkPVCommonPython import *
> from vtkPVServerImplementationCorePython import *
> from vtkPVServerImplementationDefaultPython import *
> from vtkPVServerImplementationRenderingPython import *
> from vtkPVServerManagerApplicationPython import *
> from vtkPVServerManagerCorePython import *
> from vtkPVServerManagerDefaultPython import *
> from vtkPVServerManagerRenderingPython import *
> from vtkPVVTKExtensionsCorePython import *
> from vtkPVVTKExtensionsDefaultPython import *
> from vtkPVVTKExtensionsRenderingPython import *
> from vtkPVVTKExtensionsWebGLExporterPython import *
> from vtkParallelCorePython import *
> from vtkRenderingAnnotationPython import *
> from vtkRenderingContext2DPython import *
> from vtkRenderingCorePython import *
> from vtkRenderingFreeTypeOpenGLPython import *
> from vtkRenderingFreeTypePython import *
> from vtkRenderingGL2PSPython import *
> from vtkRenderingHybridOpenGLPython import *
> from vtkRenderingLODPython import *
> from vtkRenderingLabelPython import *
> from vtkRenderingMatplotlibPython import *
> from vtkRenderingOpenGLPython import *
> from vtkRenderingParallelPython import *
> from vtkRenderingVolumeAMRPython import *
> from vtkRenderingVolumeOpenGLPython import *
> from vtkRenderingVolumePython import *
> from vtkTestingRenderingPython import *
> from vtkViewsContext2DPython import *
> from vtkViewsCorePython import *
> from vtkViewsInfovisPython import *
>
>
> Pat
>
> On Sun, Jan 27, 2013 at 4:02 AM, Demian Wassermann
> <demian at bwh.harvard.edu <mailto:demian at bwh.harvard.edu>> wrote:
>
>     Dear Paraview Users / Developers,
>
>     I have just started using version 3.98 and I must say I like it a lot.
>
>     However, on the binary distribution the number of vtk classes
>     accessible through python scripting was greatly reduced with respect
>     to the previous version.
>
>     I suspect that because it is now using the modularized VTK
>     architecture as it says in the release notes:
>
>     “VTK was restructured to use a modularized approach for building
>     various components, and ParaView's build infrastructure was revamped
>     to make use of this. Users may now build variants of the ParaView
>     library while choosing only modules of interest from VTK. This
>     enables developers to build small, lightweight VTK and ParaView
>     packages ideal for co-processing.”
>
>     Is there a way to re-eanable the full python library?
>
>
>     Thanks in advance!
>     --
>     Demian Wassermann, PhD
>     demian at bwh.harvard.edu <mailto:demian at bwh.harvard.edu>
>     LMI / PNL / SPL Labs
>     Harvard Medical School
>     Brigham and Women's Hospital
>     1249 Boylston, Boston, MA, USA
>     http://lmi.bwh.harvard.edu/~wassermann/
>
>     _______________________________________________
>     Powered by www.kitware.com <http://www.kitware.com>
>
>     Visit other Kitware open-source projects at
>     http://www.kitware.com/opensource/opensource.html
>
>     Please keep messages on-topic and check the ParaView Wiki at:
>     http://paraview.org/Wiki/ParaView
>
>     Follow this link to subscribe/unsubscribe:
>     http://www.paraview.org/mailman/listinfo/paraview
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>


More information about the ParaView mailing list