[mayavi] VTK file issue (data with no scalar)...

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[mayavi] VTK file issue (data with no scalar)...

fred-2
Hi all,

In the VTK file attached,

how can I have acces to number of points, number of lines, number of
polys, etc?

marsu[11:41:02]:Data/VTK_Datasets/{1}/> src=VTKXMLFileReader()

marsu[11:41:13]:Data/VTK_Datasets/{2}/> src.initialize('polydata2.vtp')

marsu[11:41:20]:Data/VTK_Datasets/{3}/> pd=src.outputs[0]

marsu[11:41:29]:Data/VTK_Datasets/{4}/> pd.p
pd.piece                    pd.point_data
pd.prepare_for_new_data     pd.producer_port
pd.pipeline_information     pd.points
pd.print_revisions          pd.propagate_update_extent
pd.pipeline_m_time          pd.polys                    pd.print_traits


marsu[11:41:29]:Data/VTK_Datasets/{4}/> pd.piece
                                 Out[4]: -1

marsu[11:41:41]:Data/VTK_Datasets/{5}/> print pd.points
--------------------------------------> print(pd.points)
None

marsu[11:41:48]:Data/VTK_Datasets/{6}/> print pd.polys
--------------------------------------> print(pd.polys)
vtkCellArray (0x5d492c0)
   Debug: Off
   Modified Time: 804053
   Reference Count: 3
   Registered Events:
     Registered Observers:
       vtkObserver (0x84c8160)
         Event: 33
         EventName: ModifiedEvent
         Command: 0x84c70e0
         Priority: 0
         Tag: 1
   Number Of Cells: 0
   Insert Location: 0
   Traversal Location: 0

marsu[11:41:53]:Data/VTK_Datasets/{7}/> pd.number_of_points
                                 Out[7]: 0

marsu[11:44:28]:Data/VTK_Datasets/{8}/> pd.number_of_polys
                                 Out[8]: 0

pd.points should not be None, as specified in the VTK file.

Moreover, in the VTK file, one can read that there are 50 points and 50
polygons.


What's wrong?


TIA


Cheers,

--
Fred

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

polydata2.vtp (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [mayavi] VTK file issue (data with no scalar)...

Gael Varoquaux
On Thu, Dec 23, 2010 at 11:47:47AM +0100, Fred wrote:
> What's wrong?

I don't know. Does the file open right in other applications, such as
Paraview?

G
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [mayavi] VTK file issue (data with no scalar)...

fred-2
Le 08/01/2011 20:09, Gael Varoquaux a écrit :
> On Thu, Dec 23, 2010 at 11:47:47AM +0100, Fred wrote:
>> What's wrong?
>
> I don't know. Does the file open right in other applications, such as
> Paraview?
Hi Gaël,

With mayavi, it opens with the following error message:
ERROR: In /tmp/buildd/vtk-5.4.2/Graphics/vtkAssignAttribute.cxx, line 276
vtkAssignAttribute (0x66cb820): Data must be point or cell for vtkDataSet

ERROR: In /tmp/buildd/vtk-5.4.2/Filtering/vtkExecutive.cxx, line 757
vtkStreamingDemandDrivenPipeline (0x67f4250): Algorithm
vtkAssignAttribute(0x66cb820) returned failure for request:
vtkInformation (0x68d2530)
   Debug: Off
   Modified Time: 10733
   Reference Count: 1
   Registered Events: (none)
   Request: REQUEST_DATA
   FROM_OUTPUT_PORT: 0
   FORWARD_DIRECTION: 0
   ALGORITHM_AFTER_FORWARD: 1

I don't get any error message with paraview.

--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev