<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.E-MailFormatvorlage17
{mso-style-type:personal-compose;
font-family:"Arial","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Hi everybody,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></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).<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></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 <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif"'>vtkImageCanvasSource2D -> vtkImageMapToColors -> vtkImageViewer2.<o:p></o:p></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 :<o:p></o:p></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.”<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></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.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></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 ?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Thank you,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Daniel<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></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><o:p></o:p></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);<o:p></o:p></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);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></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><o:p></o:p></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><o:p></o:p></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><o:p></o:p></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><o:p></o:p></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><o:p></o:p></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><o:p></o:p></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><o:p></o:p></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><o:p></o:p></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><o:p></o:p></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'><o:p> </o:p></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() {<o:p></o:p></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<o:p></o:p></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();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> canvas->SetScalarTypeToUnsignedChar();<o:p></o:p></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);<o:p></o:p></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);<o:p></o:p></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);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> canvas->Update();<o:p></o:p></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<o:p></o:p></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'><o:p> </o:p></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<o:p></o:p></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();<o:p></o:p></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);<o:p></o:p></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);<o:p></o:p></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);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> lut->Build();<o:p></o:p></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);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></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();<o:p></o:p></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);<o:p></o:p></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());<o:p></o:p></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<o:p></o:p></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 !<o:p></o:p></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'><o:p> </o:p></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<o:p></o:p></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();<o:p></o:p></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();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> <o:p></o:p></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<o:p></o:p></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<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> <o:p></o:p></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);<o:p></o:p></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();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> <o:p></o:p></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();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'> renderWindowInteractor->Start();<o:p></o:p></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"'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></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: http://www.heidenhain.de/disclaimer</span></P></body></html>