<div dir="ltr">Hi Daniel,<div><br></div><div>On quick inspection this looks like a bug in vtkImageMapToColors not handling the output info. You could file a bug here: <a href="http://vtk.org/Bug">http://vtk.org/Bug</a></div>
<div><br></div><div>hth</div><div><br></div><div>Goodwin</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 30, 2014 at 2:23 PM, Frese Daniel Dr. <span dir="ltr"><<a href="mailto:frese@heidenhain.de" target="_blank">frese@heidenhain.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="DE" link="blue" vlink="purple"><div><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">Hi everybody,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">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).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">I tried to assemble a more or less minimal example to illustrate the problem. Basically I use the pipeline <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">vtkImageCanvasSource2D -> vtkImageMapToColors -> vtkImageViewer2.<u></u><u></u></span></p><p class="MsoNormal">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">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 :<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">“vtkTrivialProducer (00F15A08) : This data object does not contain the requested extent.”<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">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.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">The complete code is below. Does anybody have a clue, what I am missing here ?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">Thank you,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">Daniel<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:blue">#include</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:#a31515"><vtkAutoInit.h><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New"">VTK_MODULE_INIT(vtkInteractionStyle);<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New"">VTK_MODULE_INIT(vtkRenderingOpenGL);<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:blue">#include</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:#a31515"><vtkSmartPointer.h><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:blue">#include</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:#a31515"><vtkLookupTable.h><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:blue">#include</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:#a31515"><vtkImageCanvasSource2D.h><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:blue">#include</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:#a31515"><vtkImageMapToColors.h><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:blue">#include</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:#a31515"><vtkRenderWindowInteractor.h><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:blue">#include</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:#a31515"><vtkImageViewer2.h><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:blue">#include</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:#a31515"><vtkRenderer.h><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:blue">#include</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:#a31515"><vtkInformation.h><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:blue">#include</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:#a31515"><vtkImageData.h><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#a31515"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:blue">void</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> main() {<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:green">// Creation of canvas drawing<u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> vtkSmartPointer<vtkImageCanvasSource2D> canvas = vtkSmartPointer<vtkImageCanvasSource2D>::New();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> canvas->SetScalarTypeToUnsignedChar();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> canvas->SetExtent(0, 99, 0, 99, 0, 0);<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> canvas->SetDrawColor(255);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> canvas->DrawSegment(10, 10, 90, 90);<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> canvas->Update();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:green">// canvas->GetOutputInformation(0)->Print(cout); // debug output shows : correct WHOLE_EXTENT / UPDATE_EXTENT<u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:green"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:green">// Map colors<u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> vtkSmartPointer<vtkLookupTable> lut = vtkSmartPointer<vtkLookupTable>::New();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> lut->SetNumberOfColors(256);<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> lut->SetTableRange(0, 255);<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> lut->SetValueRange(0, 255);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> lut->Build();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:blue">for</span> (<span style="color:blue">int</span> i=0; i<256; i++) lut->SetTableValue(i, i/255.0, 0, 0, 1);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> vtkSmartPointer<vtkImageMapToColors> color = vtkSmartPointer<vtkImageMapToColors>::New();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> color->SetLookupTable(lut);<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> color->SetInputConnection(canvas->GetOutputPort());<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:green">// color->GetInputInformation()->Print(cout); // debug output shows : correct WHOLE_EXTENT / UPDATE_EXTENT<u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:green">// color->GetOutput()->Print(cout); // debug output shows : Extent wrong !<u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:green"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:green">// Display the result<u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> vtkSmartPointer<vtkImageViewer2> imageViewer = vtkSmartPointer<vtkImageViewer2>::New();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> imageViewer->SetInputData(canvas->GetOutput()); <span style="color:green">// using this line, I get sensible output<u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:green">//imageViewer->SetInputData(color->GetOutput()); // using this line, I get an empty viewer and an error message<u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> imageViewer->SetupInteractor(renderWindowInteractor);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> imageViewer->GetRenderer()->ResetCamera();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> </span><span style="font-size:10.0pt;font-family:"Courier New"">renderWindowInteractor->Initialize();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New""> renderWindowInteractor->Start();<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">}</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><u></u> <u></u></span></p>
</div><p style="FONT-SIZE:13px"><span style="FONT-FAMILY:Arial">------------------------------------------------------------------------------------------------------ <br>Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: Traunreut <br>
Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard <br>Geschäftsführung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman),<br>Michael Grimm, Matthias Fauser, Sebastian Tondorf</span></p>
<p style="FONT-SIZE:13px"><span style="FONT-FAMILY:Arial">E-Mail Haftungsausschluss / E-Mail Disclaimer: <a href="http://www.heidenhain.de/disclaimer" target="_blank">http://www.heidenhain.de/disclaimer</a></span></p></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>