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 <
[email protected]> 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
>
>
from paraview.simple import *
servermanager.sources.LegacyVTKReader(FileNames='wavelet.vtk')
repr = Show()
# Create LUT
SetDisplayProperties(LookupTable = MakeBlueToRedLT(37.35, 276))
# Set array to color by
SetDisplayProperties(ColorAttributeType = "POINT_DATA")
SetDisplayProperties(ColorArrayName = "RTData")
# Register PiecewiseFunction if not already available.
if not "PiecewiseFunction" in dir(servermanager.rendering):
servermanager.createModule("piecewise_functions", servermanager.rendering)
# Setup opacity function
opacity_func = servermanager.rendering.PiecewiseFunction()
opacity_func.Points = [37.35, 0, 276.82, 0.5]
SetDisplayProperties(ScalarOpacityFunction = opacity_func)
repr.Representation = "Volume"
Render()
raw_input()
_______________________________________________
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