Hi,
My fault, I'm sorry :)

Here is what I did in PWConsole:

paraview.loadPlugins();
aaa = paraview.OpenDataFile({filename:"/root/DATA/hola.mhd"}); //It's just a .mhd which point to a .raw data
paraview.Show();
vol = paraview.plugins.renderVol;
vol.init();
vol.setColorArrayName('MetaImage') --> error in log (I pasted it in previous mail)
vol.setRepresentation('Volume')     --> same error

No matter how I try with 'Volume' or "Volume" or Volume or modify the way of parsing the arguments in renderVol.py, it didnt work :(

Thank for you link, I'll give it a try :)

Regards!


----------------------------------------------------
Anh Dung LE.
INSA de Lyon - Télécommunications, Services & Usages


Sebastien Jourdain <sebastien.jourd...@kitware.com> a écrit :

Hi,

You should provide the JavaScript has well. Otherwise it's thought to
understand what is wrong when you have half of the informations.
Moreover, you can also look at that previous e-mail.
(http://markmail.org/thread/bm32g6sckjqvyiy5) It show some code on how
to setup the volume rendering from the JavaScript itself.

Seb

On Tue, May 24, 2011 at 10:14 AM, le Anh Dung <anh-dung...@insa-lyon.fr> wrote:
Hello everybody,
I tried to write a plugin (renderVol.py attached) to do a volume rendering
in PWConsole of ParaviewWeb.
When I tried to set the ColorArrayName or Representation (functions in
renderVol.py), I always got this:

Traceback (most recent call last):
 File "<jsonrpc>", line 147, in handle_request
 File "/root/ParaViewWeb/WebServer/PW-work/plugins/renderVol.py", line 24,
in setColorArrayName
   dp.ColorArrayName = a
 File
"/root/ParaView3/build-paraview3/Utilities/VTKPythonWrapping/site-packages/paraview/servermanager.py",
line 210, in __setattr__
   setter(self, value)
 File
"/root/ParaView3/build-paraview3/Utilities/VTKPythonWrapping/site-packages/paraview/servermanager.py",
line 2384, in setProperty
   return self.SetPropertyWithName(propName, value)
 File
"/root/ParaView3/build-paraview3/Utilities/VTKPythonWrapping/site-packages/paraview/servermanager.py",
line 265, in SetPropertyWithName
   prop.SetData(arg)
 File
"/root/ParaView3/build-paraview3/Utilities/VTKPythonWrapping/site-packages/paraview/servermanager.py",
line 681, in SetData
   raise ValueError("Expected a tuple of 2 values or a string.")
ValueError: Expected a tuple of 2 values or a string.
------------------------------------------------------------
2011-05-24 15:58:57,584 - pw-logger - DEBUG - return of
execute_command_on_plugin {'error': {'message': 'Expected a tuple of 2
values or a string.', 'name': 'ValueError'}, 'result': None, 'id': 1}

It'll work fine if I set them fix in my renderVol.py
examples:
  dp.ColorArrayName = 'MetaImage'
or dp.Representation = 'Volume'
But I want to set them manualy in PWConsole and then get that error :(
Could anyone please help me ? :)

Thank you in advance.
Have a nice day :)

----------------------------------------------------
Anh Dung LE.
INSA de Lyon - Télécommunications, Services & Usages




_______________________________________________
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