Hi Utkarsh,
Thank you for your script but I have been a error when I excute this line : 
dp.ScalarOpacityFunction = opacity_func
Thanks in advance for your kind help.
Regards,
Jona

dp.ScalarOpacityFunction = opacity_func
ERROR: In 
/home/myrrha/Desktop/paraview/paraview3.7/ParaView3/Servers/Common/vtkProcessModule.cxx,
 line 1045
vtkProcessModule (0xef5150): Object type: vtkVolumeProperty, could not find 
requested method: "SetScalarOpacity"
or the method was called with incorrect arguments.

while processing
Message 0 = Invoke
  Argument 0 = id_value {78}
  Argument 1 = string_value {SetScalarOpacity}
  Argument 2 = id_value {662}


ERROR: In 
/home/myrrha/Desktop/paraview/paraview3.6/ParaView3/Servers/Common/vtkProcessModule.cxx,
 line 1046
vtkProcessModule (0xef5150): Aborting execution for debugging purposes.

Abandon


My script

from paraview.simple import *
Connect('localhost')

reader = servermanager.sources.LegacyVTKReader(FileNames='wavelet.vtk')

Show(reader)

dp = GetDisplayProperties(reader)

# Create LUT
dp.LookupTable = MakeBlueToRedLT(37.35, 276)

# Set array to color by
dp.ColorAttributeType = 'POINT_DATA'
dp.ColorArrayName = 'RTData'

#dp.Representation = 'Volume'
#Render()

# 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]
dp.ScalarOpacityFunction = opacity_func

dp.Representation = 'Volume'
Render()






-------- Message d'origine--------
De: Utkarsh Ayachit [mailto:[email protected]]
Date: lun. 25/05/2009 16:09
À: BOUSSOIR Jonathan 167706
Cc: [email protected]
Objet : Re: [Paraview] [paraview] using with python to read file VTK in 3.7 and 
to show a volume representation
 
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
>
>

_______________________________________________
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

Reply via email to