[Paraview] OpenDataFile with ParaViewWeb JavaScript Console
Tuan Ha Tran
tuan-ha.tran at insa-lyon.fr
Mon May 14 03:47:19 EDT 2012
Thank you Seb,
So, If I understand well, I will charge the file in 2 step, the first one is to charge a file in plugin with "myPlugin.py", then use the plugin to charge the file in ParaViewWeb?
So, in your reply
"def load(file):
return simple.OpenDataFile('/your-path/' + file)"
the parameter ('nameOfFile.mhd') will be parsed directly to OpenDataFile('/my-path/'+file) and become ('/my-path/nameOfFile.mhd')
I wonder if I'm right. Sorry for this question but I just want to be sured.
----- Original Message -----
From: Sebastien Jourdain <sebastien.jourdain at kitware.com>
To: Tuan Ha Tran <tuan-ha.tran at insa-lyon.fr>
Cc: paraview at paraview.org
Sent: Fri, 11 May 2012 19:32:08 +0200 (CEST)
Subject: Re: [Paraview] OpenDataFile with ParaViewWeb JavaScript Console
You can create your own python plugin that will append the proper path
in front of the provided name.
=== myPlugin.py ===
from paraview import simple
def load(file):
return simple.OpenDataFile('/your-path/' + file)
=======
In JS you'll do something like that
var plugin = paraview.getPlugin('myPlugin');
var reader = plugin.load('NameOfFile.mhd');
But you should figure out why the server crashed by looking at the log
if you can. The full path should have worked.
Seb
On Fri, May 11, 2012 at 11:31 AM, Tuan Ha Tran
wrote:
> Hi everybody,
> I have a question to ask. I use ParaViewWeb JavaScript Console to load
> an image file to ParaViewWeb, I use the followed code "var reader
> =paraview.OpenDataFile({filename:"../NameOfFile"});" I tried with the
> absolute path of my PC (which is normally not the good solution) and get the
> "ServerDownException"
> So, if I want ParaViewWeb to look at in the web-apps of tomcat server,
> which path I have to use? As I know, if the file is in the same location as
> the PWConsole.war, we can access to it directly using {filename:"hola.mhd"}
> (for example)
> Anyone have an idea?
> Thank in advance.
>
> _______________________________________________
> 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/20120514/cf788190/attachment.htm>
More information about the ParaView
mailing list