[Paraview] OBJ reader, Points+normals

2010-11-03 Thread D Haley
Dear List,

I recently compiled paraview 3.8 in order to use the new wavefront/OBJ reader. 
I have a vector cloud in an OBJ file (point+attached vector) that I would like 
to visualise, and thought this might be a solution.

However, I ran the OBJ reader, and the normals for the points are loaded, but 
the normals appear to not be recognised.

The file contents look something like this:
-
# OBJ file, containing only points and normals
#

v 315 -62.3371 156.152
vn -0.157145 0.722267 -0.673525
v 315 -44.3808 162.142
vn 0.146189 0.69951 -0.69951
v 315 -53.3286 163.284
vn 0.26163 0.694284 -0.670462
v 315 -35.2797 162.731
vn -0.103498 0.690928 -0.715477
-
and so on.

There is a 1:1 correspondence between points and normals. However when using 
the as-given reader, applying the glyph filter with 2D arrow mode shows all the 
normals as pointing along the X axis with the same magnitude (scaling mode set 
to "vector").

I tried hacking up the code in IO/vtkOBJReader.cxx , but to be honest I don't 
know what I am doing. I forced an unconditional call to

std::cerr << "Forcing normals" << std::endl;
output->GetPointData()->SetNormals(new_normals);

directly after

if(everything_ok)
{


but  this was unsuccesful, although the print statement is run.

I checked that the vn lines are being parsed by using print statements, and it 
appears that they are. The points are also loaded just fine, and the 
visualisation output is correct.

Any hints? I am unfamiliar with the VTK library unfortunately -- perhaps there 
is an alternate representation (not OBJ) that I can use to do this? 
Alternatively someone can suggest an easy patch to this?

My next stop is to hack up an OpenGL tutorial...


Thanks.


  
___
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


Re: [Paraview] OBJ reader, Points+normals

2010-11-03 Thread David Doria
On Wed, Nov 3, 2010 at 8:13 AM, D Haley  wrote:

> Dear List,
>
> I recently compiled paraview 3.8 in order to use the new wavefront/OBJ
> reader. I have a vector cloud in an OBJ file (point+attached vector) that I
> would like to visualise, and thought this might be a solution.
>
> However, I ran the OBJ reader, and the normals for the points are loaded,
> but the normals appear to not be recognised.
>
> The file contents look something like this:
> -
> # OBJ file, containing only points and normals
> #
>
> v 315 -62.3371 156.152
> vn -0.157145 0.722267 -0.673525
> v 315 -44.3808 162.142
> vn 0.146189 0.69951 -0.69951
> v 315 -53.3286 163.284
> vn 0.26163 0.694284 -0.670462
> v 315 -35.2797 162.731
> vn -0.103498 0.690928 -0.715477
> -
> and so on.
>
> There is a 1:1 correspondence between points and normals. However when
> using the as-given reader, applying the glyph filter with 2D arrow mode
> shows all the normals as pointing along the X axis with the same magnitude
> (scaling mode set to "vector").
>
> I tried hacking up the code in IO/vtkOBJReader.cxx , but to be honest I
> don't know what I am doing. I forced an unconditional call to
>
> std::cerr << "Forcing normals" << std::endl;
> output->GetPointData()->SetNormals(new_normals);
>
> directly after
>
> if(everything_ok)
> {
>
>
> but  this was unsuccesful, although the print statement is run.
>
> I checked that the vn lines are being parsed by using print statements, and
> it appears that they are. The points are also loaded just fine, and the
> visualisation output is correct.
>
> Any hints? I am unfamiliar with the VTK library unfortunately -- perhaps
> there is an alternate representation (not OBJ) that I can use to do this?
> Alternatively someone can suggest an easy patch to this?
>
> My next stop is to hack up an OpenGL tutorial...
>
>
> Thanks.
>

Can you save the imported file as a vtp file and upload it somewhere and
post a link to it? We can poke around to see if it has been imported
properly and you are just missing a step in Paraview or if it has not been
imported properly.

David
___
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


Re: [Paraview] opacity

2010-11-03 Thread Utkarsh Ayachit
Try turning off "Use offscreen rendering for screenshots" from Edit
|Settings dialog.

Utkarsh

On Tue, Nov 2, 2010 at 11:44 PM, Manoj  wrote:
> Hello There,
>
> I am trying to print the "save screenshot" of a vtu file with 0.5 opacity. 
> But when I specify the file name to be saved, the program crashes. If I save 
> it without opacity it works fine. Could you please suggest me how do I save 
> with opacity.
>
> Thank you,
>
> Manoj
>
>
>
> ___
> 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


Re: [Paraview] How to use a filter in a Python script?

2010-11-03 Thread Sebastien Jourdain
Hi Hamilton,

You can look at http://www.paraview.org/Wiki/ParaView/Python_Scripting
and that http://www.paraview.org/Wiki/ParaViewUsersGuide/List_of_filters

Seb

On Tue, Nov 2, 2010 at 10:31 PM,   wrote:
> I am a newbie to Paraview and have little experience programming Python.  I
> would like to know how to call a particular filter from within Python.  The
> only filter I have seen referenced in the Python scripting documentation is
> Shrink().
>
> I want to retrieve the scalar values along a line segment (Plot Over
> Line(ProbeLine)) that extends through an unstructured 3D grid.  I have "The
> ParaView Guide", "The VTK User's Guide" and "The Visualization Toolkit:  An
> Object-Oriented Approach to 3D Graphics".  I don't see how to programmatically
> do this.  I have looked on all of the ParaView web sites that I can find, and
> in tutorials.  I do not even see a list of available filter names.
>
> Is there a guide for Python Scripting (chapter 20 of The ParaView Guide is the
> best I have found) that covers using filters?  Example code?  Anything?  How
> do you even find the filter names in the documentation?
>
> Thanks for any help,
> Hamilton Woods
> ___
> 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


Re: [Paraview] How to use a filter in a Python script?

2010-11-03 Thread Eric E. Monson
Hey Hamilton,

You should also try using the Python Trace (and Trace State) functionality now 
built into ParaView. After (or while) you set up your pipeline in ParaView this 
will give you a Python script to accomplish the same thing. This page tells a 
bit about the current (git) version:

http://www.paraview.org/Wiki/Python_GUI_Tools

You'll see the Start Trace and Trace State if you go to Tools->Python Shell, 
and then click on the Trace tab on the right of the panel.

-Eric

--
Eric E Monson
Duke Visualization Technology Group


On Nov 3, 2010, at 10:00 AM, Sebastien Jourdain wrote:

> Hi Hamilton,
> 
> You can look at http://www.paraview.org/Wiki/ParaView/Python_Scripting
> and that http://www.paraview.org/Wiki/ParaViewUsersGuide/List_of_filters
> 
> Seb
> 
> On Tue, Nov 2, 2010 at 10:31 PM,   wrote:
>> I am a newbie to Paraview and have little experience programming Python.  I
>> would like to know how to call a particular filter from within Python.  The
>> only filter I have seen referenced in the Python scripting documentation is
>> Shrink().
>> 
>> I want to retrieve the scalar values along a line segment (Plot Over
>> Line(ProbeLine)) that extends through an unstructured 3D grid.  I have "The
>> ParaView Guide", "The VTK User's Guide" and "The Visualization Toolkit:  An
>> Object-Oriented Approach to 3D Graphics".  I don't see how to 
>> programmatically
>> do this.  I have looked on all of the ParaView web sites that I can find, and
>> in tutorials.  I do not even see a list of available filter names.
>> 
>> Is there a guide for Python Scripting (chapter 20 of The ParaView Guide is 
>> the
>> best I have found) that covers using filters?  Example code?  Anything?  How
>> do you even find the filter names in the documentation?
>> 
>> Thanks for any help,
>> Hamilton Woods
>> ___
>> 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

___
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


Re: [Paraview] How to use a filter in a Python script?

2010-11-03 Thread ghw
Dude!  You are so awesome!  Why didn't I think of that?  Because 
I thought trace was for something altogether different from that.  

Now I feel like I can do anything!

Thanks immensely for your help,
Hamilton Woods


-- Original Message ---
From: emonson at cs.duke.edu
To: g...@accutrol.com
Cc: paraview list 
Sent: Wed, 3 Nov 2010 11:20:47 -0400
Subject: Re: [Paraview] How to use a filter in a Python script?

> Hey Hamilton,
> 
> You should also try using the Python Trace (and Trace State) 
> functionality now built into ParaView. After (or while) you set up 
> your pipeline in ParaView this will give you a Python script to 
> accomplish the same thing. This page tells a bit about the current 
> (git) version:
> 
> http://www.paraview.org/Wiki/Python_GUI_Tools
> 
> You'll see the Start Trace and Trace State if you go to Tools-
> >Python Shell, and then click on the Trace tab on the right of the panel.
> 
> -Eric
> 
> --
> Eric E Monson
> Duke Visualization Technology Group
> 
> On Nov 3, 2010, at 10:00 AM, Sebastien Jourdain wrote:
> 
> > Hi Hamilton,
> > 
> > You can look at http://www.paraview.org/Wiki/ParaView/Python_Scripting
> > and that http://www.paraview.org/Wiki/ParaViewUsersGuide/List_of_filters
> > 
> > Seb
> > 
> > On Tue, Nov 2, 2010 at 10:31 PM,   wrote:
> >> I am a newbie to Paraview and have little experience programming Python.  I
> >> would like to know how to call a particular filter from within Python.  The
> >> only filter I have seen referenced in the Python scripting documentation is
> >> Shrink().
> >> 
> >> I want to retrieve the scalar values along a line segment (Plot Over
> >> Line(ProbeLine)) that extends through an unstructured 3D grid.  I have "The
> >> ParaView Guide", "The VTK User's Guide" and "The Visualization Toolkit:  An
> >> Object-Oriented Approach to 3D Graphics".  I don't see how to
programmatically
> >> do this.  I have looked on all of the ParaView web sites that I can find, 
> >> and
> >> in tutorials.  I do not even see a list of available filter names.
> >> 
> >> Is there a guide for Python Scripting (chapter 20 of The ParaView Guide
is the
> >> best I have found) that covers using filters?  Example code?  Anything?  
> >> How
> >> do you even find the filter names in the documentation?
> >> 
> >> Thanks for any help,
> >> Hamilton Woods
> >> ___
> >> 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
--- End of Original Message ---

___
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


[Paraview] LoadPlugin(): global name 'pld' is not defined-

2010-11-03 Thread Favre Jean
Hello folks

Running with pvbatch (head version 3.9), I am getting this error:

  File 
"/apps/eiger/src/ParaViewBuildMesa/Utilities/VTKPythonWrapping/site-packages/paraview/simple.py",
 line 820, in LoadPlugin
servermanager.LoadPlugin(filename, remote)
  File 
"/apps/eiger/src/ParaViewBuildMesa/Utilities/VTKPythonWrapping/site-packages/paraview/servermanager.py",
 line 2133, in LoadPlugin
raise RuntimeError, "Problem loading plugin %s: %s" % (filename, 
pld.GetProperty("Error").GetElement(0))
NameError: global name 'pld' is not defined-

what is pld? I can't find it defined in any python file in the source.

Jean
___
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


Re: [Paraview] vtkSMExtractDocumentation linking error for ParaView 3.8.1

2010-11-03 Thread Dave Partyka
Hi Christine,

As far as I am aware (and doing some of my own grepping) I am not finding
any dependency on MD5 in ParaView/VTK, so this is very puzzling. Are you
using some kind of secure MPI? Anyway, just adding in FindOpenSSL won't help
as it won't change what libraries ParaView links to. You could try adding
-lcrypto to CMAKE_CXX_FLAGS and CMAKE_C_FLAGS in ccmake/cmake-gui. But as I
said, this shouldn't be required.

On Mon, Nov 1, 2010 at 8:47 AM, Christine Corbett Moran <
corb...@physik.uzh.ch> wrote:

> I'm setting up ParaView 3.8.1 (stable version from source linked on the
> website) on our cluster and running into a linking error.
>
> the error is
> "[ 87%] Built target vtkPVServerManager
> Linking CXX executable ../../bin/vtkSMExtractDocumentation
> ../../bin/libvtkPVServerCommon.so: undefined reference to `MD5'
> collect2: ld returned 1 exit status"
>
> and I have
>  OPENSSL_CRYPTO_LIBRARIES
> /usr/lib64/libssl.a:/usr/lib64/libcrypto.a
>  OPENSSL_INCLUDE_DIR  /usr/include
>  OPENSSL_LIBRARIES
> /usr/lib64/libssl.a:/usr/lib64/libcrypto.a
>  OPENSSL_SSL_LIBRARIES
>  /usr/lib64/libssl.a:/usr/lib64/libcrypto.a
> set via ccmake.
>
> I've tried both the static and the shared versions of the libraries on
> the machine. I've tried using different versions of CMake (2.8.1 vs.
> 2.8.2). A simple program using MD5 compiles against these libraries no
> problem gcc -o md5sum md5sum.c -lcrypto, I've done an ldd on this test
> program md5sum binary to verify that it is indeed pointing to the same
> libs that I've pointed to in the PV build. I've tried manually adding
> the locations of the libraries to my LD_LIBRARY_PATH. I've also tried
> putting INCLUDE(FindOpenSSL) in my CMakeLists.txt. Now I'm out of new
> ideas.
>
> Christine
> ___
> 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


[Paraview] Announcement: ParaView coprocessing tutorial at SC10

2010-11-03 Thread Moreland, Kenneth
The ParaView developers are pleased to announce that we will be holding a 
tutorial on the ParaView coprocessing library at this year's Supercomputing 
conference for simulation developers and advanced ParaView users.  The 
coprocessing library is a concise API that allows you to integrate the parallel 
ParaView services with another application to perform in-situ visualization or 
other analyses.  Although designed to be coupled with simulation, the 
coproessing library could be used for subservient processing in any 
application.  This tutorial will demonstrate how to use the API, how to bind it 
to other languages, how to dynamically change the visualization via Python 
scripting, and how to use the ParaView GUI to automatically generate Python 
scripts.

The tutorial will be held on Sunday, November 14.  To register, go to the 
Supercomputing web site (http://sc10.supercomputing.org/) and register for the 
Sunday tutorials.  For more information, see the tutorial Wiki page 
(http://www.paraview.org/Wiki/SC10_Coprocessing_Tutorial).

___
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


[Paraview] OBJ reader bug

2010-11-03 Thread D Haley
Dear List,

Continuing a conversation I had off-list with David Doria, there appears to be 
a possible bug with the OBJ reader.

The process goes like this, please forgive my terminology:

1) Using the attached OBJ file, read it, then place a glyph filter on the tree.
2) Note that the attached glyph filter has no arrays. All glyph vectors point 
along (1,0,0).
3) Delete the glyph filter, then save the paraview pipeline as a VTP file.
4) clear the tree
5) open the VTP file
6) attach a glyph filter. Note there is now a "Normals_" array. 

-> Why did the glyph filter not work on the OBJ to show the normals? Is this a 
bug?

OBJ file. Save as something like "data.obj". In case of attachment 
scrubbing/email wrapping, the file is both attached and in-line

-Cut below line-
# OBJ file, containing only points and normals
#

v 315 -62.3371 156.152
vn -0.157145 0.722267 -0.673525
v 315 -44.3808 162.142
vn 0.146189 0.69951 -0.69951
v 315 -53.3286 163.284
vn 0.26163 0.694284 -0.670462
v 315 -35.2797 162.731
vn -0.103498 0.690928 -0.715477
v 315 -25.0252 162.007
vn -0.135635 0.675696 -0.724595
v 302 50.3304 144.752
vn -0.921231 0.255217 -0.293593
v 301 50.6345 144.731
vn -0.681234 0.480278 -0.552497
v 97 165.031 22.0243
vn -0.951071 -0.202705 -0.233185
v 98 181.402 33.6802
vn 0.633716 -0.517616 -0.574871
-Cut above line-

Thanks.


  

data-clip.obj
Description: application/tgif
___
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


[Paraview] Adding Reader Plugin to "Files of Type" dialogue

2010-11-03 Thread Peter Schmitt
Hello,

I cannot get my reader into ParaView's "File -> Open" dialog.  I am
following the "CSVImageReader" tutorial here:
http://www.kitware.com/products/html/WritingAParaViewReaderPlug-in.html

I built ParaView-3.8.1 from source using qt-4.5.3 on my 64-bit Linux
workstation (FWIW, I've also tried this on my Mac OSX 10.5.8 box using
Nokia's qt-4.6.2 dmg release for 10.5+).  I built the libCSVImage.so after
adding the following to the top of vtkCSVImageReader.cxx:

#include "vtkCSVImageReader.h"
#include "vtkDataArray.h"
#include "vtkImageData.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkTable.h"
#include "vtkVariant.h"
vtkStandardNewMacro(vtkCSVImageReader);


I start up ParaView, goto "Tools -> Manage Plugins -> Load New ..." and I
now see "CSVImage" as "Loaded" in the "Local Plugins" pane.  However, the
"File -> Open" menu doesn't show the CSVImage type.

When I attempt to open a *.csvimg file, I am prompted with a dialog titled
"Open Data WIth ..." saying "A reader for
/home/schmitt/paraview/testData/test.csvimg" could not be found.  Please
choose one:"  and a list of 22 readers ("POP Ocean" through "TecPlot", but
no CSVImage type.

What am I doing wrong?

Thank you,
Pete Schmitt
___
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


Re: [Paraview] How to use a filter in a Python script?

2010-11-03 Thread m . c . wilkins

Hi,

Yes the trace is great, it still couldn't tell me how to actually
extract the numbers along a plotoverline though, without doing a
Spreadsheet view or something.

You have probably figured out how to do a plotoverline using the Trace:

from paraview.simple import *
reader = servermanager.sources.XMLUnstructuredGridReader(FileName = 
"/var/tmp/file.vtu")
pl = PlotOverLine(Input = reader)
pl.Source.Point1 = [-7000, -5000, 0]
pl.Source.Point2 = [4300, 6300, .75]
CreateXYPlotView()
d = Show()
d.XArrayName = 'arc_length'
d.SeriesVisibility = ['namecolours (0)', '0', 'namecolours (1)', '0', 
'namecolours (2)', '0', 'vtkValidPointMask', '0', 'arc_length', '0'] # whatever 
your variables are
d.UseIndexForXAxis = 0
Render()

But to actually get the values out you don't even need to do the plot
a simple:

from paraview.simple import *
reader = servermanager.sources.XMLUnstructuredGridReader(FileName = 
"/var/tmp/file.vtu")
pl = PlotOverLine(Input = reader)
pl.Source.Point1 = [-7000, -5000, 0]
pl.Source.Point2 = [4300, 6300, .75]

does, followed by stuff like this:

# to get the number of points on the plotoverline line
pl = servermanager.Fetch(pl)
pl.GetPoints().GetData().GetNumberOfPoints()

# to get the (x,y,z) info for the points on the pol line
pl.GetPoints().GetData().GetValue(0) -> x of first point
pl.GetPoints().GetData().GetValue(1) -> y of first point
pl.GetPoints().GetData().GetValue(2) -> z of first point
etc

# to get the data on the line
pl.GetPointData().GetArray(0).GetValue(0)
etc

# and to get the name of the array on the line
pl.GetPointData().GetArrayName(0) -> 'cfnode'
etc

Matt Wilkins

On Wed, Nov 03, 2010 at 11:38:25AM -0400, g...@accutrol.com wrote:
> Dude!  You are so awesome!  Why didn't I think of that?  Because 
> I thought trace was for something altogether different from that.  
> 
> Now I feel like I can do anything!
> 
> Thanks immensely for your help,
> Hamilton Woods
> 
> 
> -- Original Message ---
> From: emonson at cs.duke.edu
> To: g...@accutrol.com
> Cc: paraview list 
> Sent: Wed, 3 Nov 2010 11:20:47 -0400
> Subject: Re: [Paraview] How to use a filter in a Python script?
> 
> > Hey Hamilton,
> > 
> > You should also try using the Python Trace (and Trace State) 
> > functionality now built into ParaView. After (or while) you set up 
> > your pipeline in ParaView this will give you a Python script to 
> > accomplish the same thing. This page tells a bit about the current 
> > (git) version:
> > 
> > http://www.paraview.org/Wiki/Python_GUI_Tools
> > 
> > You'll see the Start Trace and Trace State if you go to Tools-
> > >Python Shell, and then click on the Trace tab on the right of the panel.
> > 
> > -Eric
> > 
> > --
> > Eric E Monson
> > Duke Visualization Technology Group
> > 
> > On Nov 3, 2010, at 10:00 AM, Sebastien Jourdain wrote:
> > 
> > > Hi Hamilton,
> > > 
> > > You can look at http://www.paraview.org/Wiki/ParaView/Python_Scripting
> > > and that http://www.paraview.org/Wiki/ParaViewUsersGuide/List_of_filters
> > > 
> > > Seb
> > > 
> > > On Tue, Nov 2, 2010 at 10:31 PM,   wrote:
> > >> I am a newbie to Paraview and have little experience programming Python. 
> > >>  I
> > >> would like to know how to call a particular filter from within Python.  
> > >> The
> > >> only filter I have seen referenced in the Python scripting documentation 
> > >> is
> > >> Shrink().
> > >> 
> > >> I want to retrieve the scalar values along a line segment (Plot Over
> > >> Line(ProbeLine)) that extends through an unstructured 3D grid.  I have 
> > >> "The
> > >> ParaView Guide", "The VTK User's Guide" and "The Visualization Toolkit:  
> > >> An
> > >> Object-Oriented Approach to 3D Graphics".  I don't see how to
> programmatically
> > >> do this.  I have looked on all of the ParaView web sites that I can 
> > >> find, and
> > >> in tutorials.  I do not even see a list of available filter names.
> > >> 
> > >> Is there a guide for Python Scripting (chapter 20 of The ParaView Guide
> is the
> > >> best I have found) that covers using filters?  Example code?  Anything?  
> > >> How
> > >> do you even find the filter names in the documentation?
> > >> 
> > >> Thanks for any help,
> > >> Hamilton Woods
> > >> ___
> > >> 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://para

Re: [Paraview] no probe over line output with paraview scripting

2010-11-03 Thread m . c . wilkins

Hi,

Thanks Jerome.  You are dead right!  The writer doesn't want
vtkpolydata, rather vtkimagedata.  G, silly me.  I couldn't figure
out how to convert vtkpolydata to vtkimagedata without actually
rendering to the screen unfortunately.

Actually I found a really old posting on this mailing list (damn, lost
it now) that says that "Offscreen screenshots" aren't possible, unless
you compile paraview with offscreen rendering.  Don't know if this is
still true or not.  But, it appears I am after something too
difficult.

Anyway, I did figure out how to just extract the numbers of the
vtkpolydata, using commands like this:

pl.GetPoints().GetData().GetValue(0)
and
pl.GetPointData().GetArray(0).GetValue(0)

etc

so I can throw them into an array and use matplotlib.

Thanks again

Matt Wilkins

On Fri, Oct 29, 2010 at 09:27:45AM +0200, Jérôme wrote:
> Hi Matt,
> 
> By quickly reading your code, I understand that you try to put
> the ouput of the PlotOverLine on the the input of an image writer.
> The mistake, IMHO, is that PlotOverLine outputs a vtkPolyData
> (Polygonal Mesh in ParaView), that's why the writer doesn't want it as
> input (it expects a vtkImageData instead).
> 
> I think that what you want is a screenshot of the plot. You should look
> in that direction. Sort of "Offscreen screenshot" ?? Don't know...
> 
> HTH
> Jerome
> 
> 2010/10/29  :
> >
> > Hi,
> >
> > As promised, I have another question!
> >
> > The code below can render a picture to the screen fine.  But I would
> > like to send the picture to a file, without rendering anything to the
> > screen.  I know I can put
> >   WriteImage('/tmp/foo.png')
> > at the end to save the output, but that is after I've popped up an
> > image.
> >
> > I did find a powerpoint by David E DeMarle about paraview scripting
> > with this in it:
> >
> > writer = servermanager.writers.PNGWriter()
> > writer.FileName = '/tmp/foo.png'
> > writer.Input = pl
> > writer.UpdatePipeline()
> >
> > But when I try that I get:
> > ERROR: In /scratch/pv/ParaView/VTK/IO/vtkPNGWriter.cxx, line 54
> > vtkPNGWriter (0xb108028): Write:Please specify an input!
> > which is odd since I thought I had set the input via writer.Input = pl
> >
> > My full code was
> >
> > from paraview.simple import *
> > reader = servermanager.sources.XMLUnstructuredGridReader(FileName = 
> > "/var/tmp/file.vtu")
> > pl = PlotOverLine(Input = reader)
> > pl.Source.Point1 = [-7000, -5000, 0]
> > pl.Source.Point2 = [4300, 6300, .75]
> > writer = servermanager.writers.PNGWriter()
> > writer.FileName = '/tmp/foo.png'
> > writer.Input = pl
> > c = CreateXYPlotView()
> > d = Show()
> > d.XArrayName = 'arc_length'
> > d.SeriesVisibility = ['namecolours (0)', '0', 'namecolours (1)', '0',
> > 'namecolours (2)', '0', 'vtkValidPointMask', '0', 'arc_length', '0']
> > d.UseIndexForXAxis = 0
> > writer.UpdatePipeline()
> >
> > I feel pretty bad about always asking questions on this list, but I
> > just can't seem to find documentation, or if I do, it is for a
> > slightly different setup (as in David E DeMarle's powerpoint for
> > instance).  So, if I am just missing some good doco source, please
> > point me that way!
> >
> > Thanks for any help!
> >
> > Matt Wilkins
> >
> > On Fri, Oct 29, 2010 at 01:22:24PM +1300, m.c.wilk...@massey.ac.nz wrote:
> >>
> >> Hi Utkarsh,
> >>
> >> Thanks, I am using 3.9, but I wasn't using paraview.simple, just
> >> following the examples in the Python Scripting chapter in the ParaView
> >> Guide.  Using paraview.simple does make things simpler ;-)  and indeed
> >> I can get it to work.
> >>
> >> For the record this works fine for me:
> >>
> >> from paraview.simple import *
> >> reader = servermanager.sources.XMLUnstructuredGridReader(FileName = 
> >> "/var/tmp/file.vtu")
> >> pl = PlotOverLine(Input = reader)
> >> pl.Source.Point1 = [-7000, -5000, 0]
> >> pl.Source.Point2 = [4300, 6300, .75]
> >> CreateXYPlotView()
> >> d = Show()
> >> d.XArrayName = 'arc_length'
> >> d.SeriesVisibility = ['namecolours (0)', '0', 'namecolours (1)', '0', 
> >> 'namecolours (2)', '0', 'vtkValidPointMask', '0', 'arc_length', '0']
> >> d.UseIndexForXAxis = 0
> >> Render()
> >>
> >> OK, so got past this problem, more to come I expect!
> >>
> >> Thank you
> >>
> >> Matt Wilkins
> >>
> >> On Thu, Oct 28, 2010 at 09:08:50AM -0600, Utkarsh Ayachit wrote:
> >> > What version of ParaView are you using? Here's my script with 3.9
> >> > (should work with 3.8 too).
> >> >
> >> > Wavelet()
> >> > pl = PlotOverLine()
> >> > pl.Source.Point1 = [-10, -10, -10]
> >> > pl.Source.Point2 = [10, 10, 10]
> >> > CreateXYPlotView()
> >> > Show()
> >> > Render()
> >> >
> >> > Utkarsh
> >> >
> >> >
> >> > On Wed, Oct 27, 2010 at 2:30 PM,   wrote:
> >> > >
> >> > > Hi,
> >> > >
> >> > > I am driving paraview via pvpython, and trying to do a probe over
> >> > > line.  I would think this is quite easy, but it is proving
> >> > > frustratingly difficult!  This is what I am typing
> >> > >
> >> > > from paraview import se

Re: [Paraview] Adding Reader Plugin to "Files of Type" dialogue

2010-11-03 Thread burlen

 Hi Peter,

The way PV learns about plugin reader extensions changed some time ago. 
The place we specify the file extension association moved from the gui 
xml to the server manager xml in the SourceProxy's hints.


Here are the modified XML files.































Hope this helps
Burlen

Ps. I think the gui xml is now optional.





On 11/03/2010 02:14 PM, Peter Schmitt wrote:

Hello,

I cannot get my reader into ParaView's "File -> Open" dialog. I am 
following the "CSVImageReader" tutorial here:

http://www.kitware.com/products/html/WritingAParaViewReaderPlug-in.html

I built ParaView-3.8.1 from source using qt-4.5.3 on my 64-bit Linux 
workstation (FWIW, I've also tried this on my Mac OSX 10.5.8 box using 
Nokia's qt-4.6.2 dmg release for 10.5+). I built the libCSVImage.so 
after adding the following to the top of vtkCSVImageReader.cxx:


#include "vtkCSVImageReader.h"
#include "vtkDataArray.h"
#include "vtkImageData.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkTable.h"
#include "vtkVariant.h"
vtkStandardNewMacro(vtkCSVImageReader);


I start up ParaView, goto "Tools -> Manage Plugins -> Load New ..." 
and I now see "CSVImage" as "Loaded" in the "Local Plugins" pane. 
However, the "File -> Open" menu doesn't show the CSVImage type.


When I attempt to open a *.csvimg file, I am prompted with a dialog 
titled "Open Data WIth ..." saying "A reader for 
/home/schmitt/paraview/testData/test.csvimg" could not be found. 
Please choose one:" and a list of 22 readers ("POP Ocean" through 
"TecPlot", but no CSVImage type.


What am I doing wrong?

Thank you,
Pete Schmitt


___
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


Re: [Paraview] no probe over line output with paraview scripting

2010-11-03 Thread pat marion
If it helps, there is an example of how to write a python programmable
filter that outputs image data here:

http://www.paraview.org/Wiki/Here_are_some_more_examples_of_simple_ParaView_3_python_filters.#Producing_Image_Data_.28Source.29

You could modify this to be a filter that takes polydata from the
PlotOverLine and outputs an image data.  The wiki example may be slightly
complicated to read because it is written in a way that it works as a
parallel filter.  You might be able to skip this part for your purposes.

Pat

On Wed, Nov 3, 2010 at 5:33 PM,  wrote:

>
> Hi,
>
> Thanks Jerome.  You are dead right!  The writer doesn't want
> vtkpolydata, rather vtkimagedata.  G, silly me.  I couldn't figure
> out how to convert vtkpolydata to vtkimagedata without actually
> rendering to the screen unfortunately.
>
> Actually I found a really old posting on this mailing list (damn, lost
> it now) that says that "Offscreen screenshots" aren't possible, unless
> you compile paraview with offscreen rendering.  Don't know if this is
> still true or not.  But, it appears I am after something too
> difficult.
>
> Anyway, I did figure out how to just extract the numbers of the
> vtkpolydata, using commands like this:
>
> pl.GetPoints().GetData().GetValue(0)
> and
> pl.GetPointData().GetArray(0).GetValue(0)
>
> etc
>
> so I can throw them into an array and use matplotlib.
>
> Thanks again
>
> Matt Wilkins
>
> On Fri, Oct 29, 2010 at 09:27:45AM +0200, Jérôme wrote:
> > Hi Matt,
> >
> > By quickly reading your code, I understand that you try to put
> > the ouput of the PlotOverLine on the the input of an image writer.
> > The mistake, IMHO, is that PlotOverLine outputs a vtkPolyData
> > (Polygonal Mesh in ParaView), that's why the writer doesn't want it as
> > input (it expects a vtkImageData instead).
> >
> > I think that what you want is a screenshot of the plot. You should look
> > in that direction. Sort of "Offscreen screenshot" ?? Don't know...
> >
> > HTH
> > Jerome
> >
> > 2010/10/29  :
> > >
> > > Hi,
> > >
> > > As promised, I have another question!
> > >
> > > The code below can render a picture to the screen fine.  But I would
> > > like to send the picture to a file, without rendering anything to the
> > > screen.  I know I can put
> > >   WriteImage('/tmp/foo.png')
> > > at the end to save the output, but that is after I've popped up an
> > > image.
> > >
> > > I did find a powerpoint by David E DeMarle about paraview scripting
> > > with this in it:
> > >
> > > writer = servermanager.writers.PNGWriter()
> > > writer.FileName = '/tmp/foo.png'
> > > writer.Input = pl
> > > writer.UpdatePipeline()
> > >
> > > But when I try that I get:
> > > ERROR: In /scratch/pv/ParaView/VTK/IO/vtkPNGWriter.cxx, line 54
> > > vtkPNGWriter (0xb108028): Write:Please specify an input!
> > > which is odd since I thought I had set the input via writer.Input = pl
> > >
> > > My full code was
> > >
> > > from paraview.simple import *
> > > reader = servermanager.sources.XMLUnstructuredGridReader(FileName =
> "/var/tmp/file.vtu")
> > > pl = PlotOverLine(Input = reader)
> > > pl.Source.Point1 = [-7000, -5000, 0]
> > > pl.Source.Point2 = [4300, 6300, .75]
> > > writer = servermanager.writers.PNGWriter()
> > > writer.FileName = '/tmp/foo.png'
> > > writer.Input = pl
> > > c = CreateXYPlotView()
> > > d = Show()
> > > d.XArrayName = 'arc_length'
> > > d.SeriesVisibility = ['namecolours (0)', '0', 'namecolours (1)', '0',
> > > 'namecolours (2)', '0', 'vtkValidPointMask', '0', 'arc_length', '0']
> > > d.UseIndexForXAxis = 0
> > > writer.UpdatePipeline()
> > >
> > > I feel pretty bad about always asking questions on this list, but I
> > > just can't seem to find documentation, or if I do, it is for a
> > > slightly different setup (as in David E DeMarle's powerpoint for
> > > instance).  So, if I am just missing some good doco source, please
> > > point me that way!
> > >
> > > Thanks for any help!
> > >
> > > Matt Wilkins
> > >
> > > On Fri, Oct 29, 2010 at 01:22:24PM +1300, m.c.wilk...@massey.ac.nzwrote:
> > >>
> > >> Hi Utkarsh,
> > >>
> > >> Thanks, I am using 3.9, but I wasn't using paraview.simple, just
> > >> following the examples in the Python Scripting chapter in the ParaView
> > >> Guide.  Using paraview.simple does make things simpler ;-)  and indeed
> > >> I can get it to work.
> > >>
> > >> For the record this works fine for me:
> > >>
> > >> from paraview.simple import *
> > >> reader = servermanager.sources.XMLUnstructuredGridReader(FileName =
> "/var/tmp/file.vtu")
> > >> pl = PlotOverLine(Input = reader)
> > >> pl.Source.Point1 = [-7000, -5000, 0]
> > >> pl.Source.Point2 = [4300, 6300, .75]
> > >> CreateXYPlotView()
> > >> d = Show()
> > >> d.XArrayName = 'arc_length'
> > >> d.SeriesVisibility = ['namecolours (0)', '0', 'namecolours (1)', '0',
> 'namecolours (2)', '0', 'vtkValidPointMask', '0', 'arc_length', '0']
> > >> d.UseIndexForXAxis = 0
> > >> Render()
> > >>
> > >> OK, so got past this problem, more to com