VTK/VTK 6 Migration/Change to CopyOriginAndSpacingFromPipeline

From KitwarePublic
< VTK
Revision as of 19:28, 6 April 2012 by Berk (talk | contribs) (Created page with "= Change to CopyOriginAndSpacingFromPipeline in vtkImageData = VTK 6 introduces a number of backwards-incompatible changes. The reasons behind these changes are described in mor...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Change to CopyOriginAndSpacingFromPipeline in vtkImageData

VTK 6 introduces a number of backwards-incompatible changes. The reasons behind these changes are described in more detail here. One of these changes is the removal of all pipeline related functionality from vtkDataObject. Prior to VTK 6, vtkDataObject’s CopyOriginAndSpacingFromPipeline() method used the origin and spacing meta-data stored in the pipeline information. Since a data object no longer has access to the pipeline information, we change CopyOriginAndSpacingFromPipeline() to take pipeline information as an argument.

Example 1

Replace

<source lang="cpp"> int vtkMyAlg::RequestData(vtkInformation*, vtkInformationVector**,

      vtkInformationVector* outInfoVec)

{

  vtkImageData* output = this->GetOutput();
  output->CopyOriginAndSpacingFromPipeline();

</source>

with

<source lang="cpp"> int vtkMyAlg::RequestData(vtkInformation*, vtkInformationVector**,

      vtkInformationVector* outInfoVec)

{

  vtkInformation* outInfo = outInfoVec->GetInformationObject(0);
  vtkImageData* output = vtkImageData::GetData(outInfo);
  output->CopyOriginAndSpacingFromPipeline(outInfo);

</source>