[Paraview] help with pvpython commands

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Thu Mar 14 14:08:15 EDT 2013


Anton,

Try:

> a = ImageReader()
> help(a)

FYI, I'm hoping to setup a Python docs webpage soon that will document
all of ParaView's Python module API similar to Python's module
documentation.

Utkarsh

On Thu, Mar 14, 2013 at 8:20 AM, Anton Shterenlikht <mexas at bristol.ac.uk> wrote:
> I'm trying to follow this example:
>
> Example 2
>
> In the second example the python script reads a raw binary file with 3Dimensional data and creates a contour at the values 0.1 and -0.1. A Colour bar is also provided.
>
> from paraview.servermanager import *
> Connect()
> reader=sources.ImageReader(FilePrefix="phi-120000")
> reader.DataByteOrder=1
> reader.DataExtent[1]=511
> reader.DataExtent[3]=1023
> reader.DataExtent[5]=511
> reader.DataScalarType=10
> view=CreateRenderView()
> view.Background=[0.3249412, 0.34902, 0.427451]
> rep=CreateRepresentation(reader,view)
> rep.Representation=3
> rep.ColorAttributeType=0
> cont1=filters.Contour(Input=reader)
> cont1.ComputeScalars=1
> cont1.ComputeNormals=0
> cont1.ContourValues=[-0.1,0.1]
> cont1.SelectInputScalars="ImageFile"
> rep2=CreateRepresentation(cont1,view)
> rep2.ColorArrayName="ImageFile"
> rep2.SelectionColor=[1,0,1]
> rep2.ColorAttributeType=0
> lt=rendering.PVLookupTable()
> lt.RGBPoints=[-0.1,0.1381,0.2411,0.7091,0.1,0.6728,0.1408,0.1266]
> lt.ColorSpace=3
> rep2.LookupTable=lt
> sb=rendering.ScalarBarWidgetRepresentation()
> sb.Position=[0.80,0.15]
> sb.Title="ImageFile"
> sb.Enabled=1
> sb.LookupTable=lt
> view.Representations.append(sb)
> view.StillRender()
> view.ResetCamera()
> view.StillRender()
> view.WriteImage("PHI-result.png","vtkPNGWriter")
>
> from
> http://www.hector.ac.uk/support/documentation/userguide/tools.php#paraview
>
> Where and how can I get help on each of these functions?
>
> I can do e.g. help(ImageReader) in pvpython, but
> that doesn't help much. I'm not even sure what's
> sources.ImageReader.
>
> Where shall I start?
>
> Thanks
>
> Anton
> _______________________________________________
> 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