Re: [Paraview] Trouble making simple VTK filter plugin

2009-10-30 Thread Utkarsh Ayachit
Any vtk object that needs to be treated as a filter or source has to
be a vtkAlgorithm subclass. Also whenever you use SourceProxy / tag,
it assumes that the vtk-class referred to by the  class attribute is
a vtkAlgorithm subclass.

Utkarsh

On Mon, Oct 26, 2009 at 5:33 AM, Jérôme jerome.ve...@gmail.com wrote:
 If someone confirms that paraview proxy have to represent a vtkAlgorithm or
 one of its subclass, that will mean that you cannot use
 vtkIterativeClosestPointTransform directly as in the paraview pipeline. And
 yes, you got it, a custom VTK class would be needed to embed the pipeline
 connection and the transformation computation.

 Jerome

 2009/10/25 David Doria daviddo...@gmail.com

 On Sun, Oct 25, 2009 at 3:31 PM, Jérôme jerome.ve...@gmail.com wrote:
  Hi,
 
  I took a look at your xml, and I didn't find any problems... So I verify
  in
  the VTK doc if you didn't misused the vtkIterativeClosestPointTransform,
  that I never had to work with. Especially, I checked the input data
  types
  (that was one of my major crashes' cause!) and I found that this filter
  is
  not a vtkAlgorithm (in the OO sense). And I think, but ParaView
  developers
  have to confirm this, that the ParaView proxy -that's what you described
  in
  your XML- concept is linked to vtkAlgorithm.
 
  If I am right, you cannot use the Enabling VTK filters in ParaView
  wiki-way. In your case, you certainly will have to write a subclass of
  vtkAlgorithm that outputs a matrix of transformation.
 
  Sorry for not being of more helps...
 
  Jerome

 Ah, that makes a lot of sense. I need to use a
 vtkTransformPolyDataFilter and set the input of this filter to the
 output of the vtkIterativeClosestPointTransform. Is this something
 that can be chained together in paraview? Or do I need to make a VTK
 filter that does all of this in one step and interface to the new
 filter with Paraview?

 Thanks,

 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


 ___
 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] Trouble making simple VTK filter plugin

2009-10-26 Thread Jérôme
If someone confirms that paraview proxy have to represent a vtkAlgorithm or
one of its subclass, that will mean that you cannot use
vtkIterativeClosestPointTransform directly as in the paraview pipeline. And
yes, you got it, a custom VTK class would be needed to embed the pipeline
connection and the transformation computation.

Jerome

2009/10/25 David Doria daviddo...@gmail.com

 On Sun, Oct 25, 2009 at 3:31 PM, Jérôme jerome.ve...@gmail.com wrote:
  Hi,
 
  I took a look at your xml, and I didn't find any problems... So I verify
 in
  the VTK doc if you didn't misused the vtkIterativeClosestPointTransform,
  that I never had to work with. Especially, I checked the input data types
  (that was one of my major crashes' cause!) and I found that this filter
 is
  not a vtkAlgorithm (in the OO sense). And I think, but ParaView
 developers
  have to confirm this, that the ParaView proxy -that's what you described
 in
  your XML- concept is linked to vtkAlgorithm.
 
  If I am right, you cannot use the Enabling VTK filters in ParaView
  wiki-way. In your case, you certainly will have to write a subclass of
  vtkAlgorithm that outputs a matrix of transformation.
 
  Sorry for not being of more helps...
 
  Jerome

 Ah, that makes a lot of sense. I need to use a
 vtkTransformPolyDataFilter and set the input of this filter to the
 output of the vtkIterativeClosestPointTransform. Is this something
 that can be chained together in paraview? Or do I need to make a VTK
 filter that does all of this in one step and interface to the new
 filter with Paraview?

 Thanks,

 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

___
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] Trouble making simple VTK filter plugin

2009-10-25 Thread David Doria
On Sun, Oct 25, 2009 at 8:59 AM, Jérôme jerome.ve...@gmail.com wrote:
 Hi David,
 I have to expose a lot of native VTK filters that are not in ParaView. I
 never had to use a CMakeLists and a _GUI XML. In my mind, your input
 properties should be totally described in your ICP. xml file. For example on
 how to write proxy property elements, you should take a look at
 Paraview3/Servers/ServerManagers/Resources/filtering.xml. It was sufficient
 for me for many VTK filters, before I bought for the Paraview book.

 steps:
    - write your xml description of the wanted VTK filter
    - run ParaView
    - Tools - Manage Plugin/Extension
    - Load New
    - choose Files of type - *.xml
    - pick your file - OK

 Then your filter should appear in the filters list.

 Hope that helps
 Jerome

 (Attached is an example of how I expose vtkImageMathematic to Paraview.)

Jerome,

Thanks for the example. It is really nice not having to write the GUI
manually, in most cases this automatic window that pops up should be
sufficient. Is there any advantage of compiling into a library before
loading into paraview?

I tried to modify your file into my ICP filter. However, when I try to
load my modified version, Paraview simply crashes as soon as I select
the ICP filter from the filters menu. The only changes I made were to
change the input types from vtkImageData to vtkDataSet and remove the
rest of the properties, leaving only Source and Target. I tried
port_index of the second input as 0 and 1 (what does this actually
do?) with no change. Would you mind taking a look at the attached
file?

Thanks,

David
ServerManagerConfiguration
   ProxyGroup name=filters
  !-- == --
  SourceProxy name=ICP class=vtkIterativeClosestPointTransform label=ICP
 Documentation
   long_help=Perform registration using iterative closest points.
   short_help=vtkIterativeClosestPointTransform filter.
 /Documentation
 InputProperty
   name=Source
   command=SetSource
   port_index=0
ProxyGroupDomain name=groups
   Group name=sources/
   Group name=filters/
/ProxyGroupDomain
DataTypeDomain name=input_type
   DataType value=vtkDataSet/
/DataTypeDomain
Documentation
   Set the source data set. This data set will be moved towards the target data set.
/Documentation
 /InputProperty
 InputProperty
   name=Target
   command=SetTarget
   port_index=0
ProxyGroupDomain name=groups
   Group name=sources/
   Group name=filters/
/ProxyGroupDomain
DataTypeDomain name=input_type
   DataType value=vtkDataSet/
/DataTypeDomain
Documentation
   Set the target data set. This data set will remain unchanged.
/Documentation
 /InputProperty
  
  /SourceProxy
  !-- End ICP --
   /ProxyGroup
   !-- End Filters Group --
/ServerManagerConfiguration
___
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