[Paraview] [paraview] using with python to read file VTK in 3.7 and to show a volume representation

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Mon May 25 10:09:05 EDT 2009


Jona,

Look at the attached script.
For volume rendering you need to specify the scalar to use for volume
rendering as well as the color lookup table as well as the scalar opacity
function. The attached script illustrates how to do the same.

Utkarsh

On Mon, May 25, 2009 at 8:08 AM, BOUSSOIR Jonathan 167706 <
Jonathan.BOUSSOIR at cea.fr> wrote:

>
> Hi all,
>
> I am new to paraview, I am using Linux. I read a lot of paraview emails
> this morning. I see you have been work hard last days on python script.
> I download last version and compile.
> Now I can read a file VTK surface sphere. But, I have still one error when
> I want to show my volume VTK file. I read a file then I tried to change the
> representation and I execute Render(), I have a problem : Cell Scalars not
> supported.
>
> I link my VTK file in my email.
> Thanks in advance for your kind help.
>
> Regards,
> Jona
>
>
> #!/usr/bin/python
> # -*- coding: latin-1 -*-
>
> from paraview.simple import *
> connection = servermanager.Connect('localhost')
>
> # Create the reader and set the filename.
> reader = servermanager.sources.LegacyVTKReader(FileNames='wavelet.vtk')
>
> Show(reader)
> Render()
>
> dp = GetDisplayProperties(reader)
> dp.Representation
> #>>> : 'Slice'
>
> dp.GetProperty("Representation").Available
> #>>> : ['Outline', 'Points', 'Wireframe', 'Surface', 'Surface With Edges',
> 'Volume', 'Slice']
>
> dp.Representation = 'Volume'
>
> Show(reader)
> Render()
>
> ERROR: In
> /home/myrrha/Desktop/paraview/paraview3.7/ParaView3/VTK/VolumeRendering/vtkFixedPointVolumeRayCastMapper.cxx,
> line 1467
> vtkFixedPointVolumeRayCastMapper (0x2d7d650): Cell Scalars not supported
>
> Erreur de segmentation
>
> "When I excute this last line "Render()", I have a error, I don't
> understand"
>
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090525/5a9c83ff/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: volumerendering.py
Type: text/x-python
Size: 751 bytes
Desc: not available
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090525/5a9c83ff/attachment.py>


More information about the ParaView mailing list