[vtkusers] Extent / Pipeline Problem with vtk 6.1

Frese Daniel Dr. frese at heidenhain.de
Mon Jun 30 09:23:37 EDT 2014

Hi everybody,

After porting a working application from vtk 5.x to vtk 6.1, I ran into some problems that I can't solve by myself. Based on the error messages, I think though, it originates in the modified pipeline behavior of vtk 6.1 (admittedly I use an already aged snapshot from November 2013).

I tried to assemble a more or less minimal example to illustrate the problem. Basically I use the pipeline
vtkImageCanvasSource2D -> vtkImageMapToColors -> vtkImageViewer2.
If I visualize the canvas, without passing through the vtkImageMapToColors filter, everything works fine. If I pass through the vtkImageMapToColors filter, I get a blank render window and the error message :
"vtkTrivialProducer (00F15A08) : This data object does not contain the requested extent."

I printed out the vtkInformation objects of the canvas' output port and the the vtkImageMapToColors' input port, and both outputs showed the correct extents for WHOLE_EXTENT and UPDATE_EXTENT, but wrong values for COMBINED_UPDATE_EXTENT. Moreover, canvas->GetOutput()->Print() gives also the right extents, whereas the output of the the vtkImageMapToColors shows that basically no meta information has been transmitted.

The complete code is below. Does anybody have a clue, what I am missing here ?

Thank you,

#include <vtkAutoInit.h>

#include <vtkSmartPointer.h>
#include <vtkLookupTable.h>
#include <vtkImageCanvasSource2D.h>
#include <vtkImageMapToColors.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkImageViewer2.h>
#include <vtkRenderer.h>
#include <vtkInformation.h>
#include <vtkImageData.h>

void main() {
      // Creation of canvas drawing
      vtkSmartPointer<vtkImageCanvasSource2D> canvas = vtkSmartPointer<vtkImageCanvasSource2D>::New();
      canvas->SetExtent(0, 99, 0, 99, 0, 0);
      canvas->DrawSegment(10, 10, 90, 90);
      // canvas->GetOutputInformation(0)->Print(cout); // debug output shows : correct WHOLE_EXTENT / UPDATE_EXTENT

      // Map colors
      vtkSmartPointer<vtkLookupTable> lut = vtkSmartPointer<vtkLookupTable>::New();
      lut->SetTableRange(0, 255);
      lut->SetValueRange(0, 255);
      for (int i=0; i<256; i++) lut->SetTableValue(i, i/255.0, 0, 0, 1);

      vtkSmartPointer<vtkImageMapToColors> color = vtkSmartPointer<vtkImageMapToColors>::New();
      // color->GetInputInformation()->Print(cout); // debug output shows : correct WHOLE_EXTENT / UPDATE_EXTENT
      // color->GetOutput()->Print(cout); // debug output shows : Extent wrong !

      // Display the result
      vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
      vtkSmartPointer<vtkImageViewer2> imageViewer = vtkSmartPointer<vtkImageViewer2>::New();

      imageViewer->SetInputData(canvas->GetOutput());  // using this line, I get sensible output
      //imageViewer->SetInputData(color->GetOutput());  // using this line, I get an empty viewer and an error message



Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: Traunreut
Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard
Geschäftsführung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman),
Michael Grimm, Matthias Fauser, Sebastian Tondorf

E-Mail Haftungsausschluss / E-Mail Disclaimer: http://www.heidenhain.de/disclaimer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140630/0aac0f77/attachment.html>

More information about the vtkusers mailing list