VTK/VTK 6 Migration/Changes to vtkProcrustesAlignmentFilter

From KitwarePublic
< VTK
Revision as of 19:37, 6 April 2012 by Berk (talk | contribs) (Created page with "= Changes to vtkProcrustesAlignmentFilter = In VTK 6, we changed or removed a few algorithms that previously produced variable number of outputs, which is not supported in VTK 6...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Changes to vtkProcrustesAlignmentFilter

In VTK 6, we changed or removed a few algorithms that previously produced variable number of outputs, which is not supported in VTK 6. Such algorithms need to produce vtkMultiBlockDataSet instead. As part of this change, we change vtkProcrustesAlignmentFilter to take a multi-block dataset as input and produce a multi-block dataset as output.

Example 1

Replace:

<source lang="tcl"> vtkProcrustesAlignmentFilter procrustes

   procrustes SetNumberOfInputs 3
   procrustes SetInput 0 [sphere GetOutput]
   procrustes SetInput 1 [transformer1 GetOutput]
   procrustes SetInput 2 [transformer2 GetOutput]
   [procrustes GetLandmarkTransform] SetModeToRigidBody

vtkPolyDataMapper map2a

   map2a SetInput [procrustes GetOutput 0]

</source>

with:

<source lang="tcl"> vtkMultiBlockDataGroupFilter group

   group AddInputConnection [sphere GetOutputPort]
   group AddInputConnection [transformer1 GetOutputPort]
   group AddInputConnection [transformer2 GetOutputPort]

vtkProcrustesAlignmentFilter procrustes

   procrustes SetInputConnection [group GetOutputPort]
   [procrustes GetLandmarkTransform] SetModeToRigidBody
   procrustes Update

vtkPolyDataMapper map2a

   map2a SetInputData [[procrustes GetOutput] GetBlock 0]

</source>

Note the use of [[procustes GetOutput] GetBlock 0]. It is also possible to create a pipeline that works on one block (or more) by using the composite data pipeline and vtkExtractBlock filter.