<div dir="ltr">Still having the problem, trying to simplify:<div><br></div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,0)">con</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetInput</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,0)">modelo</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">getImageToSave</span><span style="color:rgb(0,0,0)">());</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,0)">con</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">Update</span><span style="color:rgb(0,0,0)">();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,0)">imageData</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">DeepCopy</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,0)">con</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">GetOutput</span><span style="color:rgb(0,0,0)">());</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,0)">imageViewer</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">SetInputData</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,0)">con</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">GetOutput</span><span style="color:rgb(0,0,0)">());</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,0)">imageViewer</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">GetRenderer</span><span style="color:rgb(0,0,0)">()-></span><span style="color:rgb(0,0,0)">ResetCamera</span><span style="color:rgb(0,0,0)">();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,0)">imageViewer</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">Render</span><span style="color:rgb(0,0,0)">();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,0)">ui</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">qvtkwidget</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">SetRenderWindow</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,0)">imageViewer</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">GetRenderWindow</span><span style="color:rgb(0,0,0)">());</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,0)">ui</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">qvtkwidget</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">GetRenderWindow</span><span style="color:rgb(0,0,0)">()-></span><span style="color:rgb(0,0,0)">SetInteractor</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,0)">imageViewer</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">GetRenderWindow</span><span style="color:rgb(0,0,0)">()-></span><span style="font-style:italic;color:rgb(0,0,0)">GetInteractor</span><span style="color:rgb(0,0,0)">());</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,0)">ui</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">qvtkwidget</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">update</span><span style="color:rgb(0,0,0)">();</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000">I'll keep on trying.</font></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000">I would appreciate any help on this.</font></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-08-27 18:26 GMT+02:00 Marcos <span dir="ltr"><<a href="mailto:fotosentido@gmail.com" target="_blank">fotosentido@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I have an image loaded in vtkImageViewer2 (from itk::ImageToVTKImageFilter).</div><div><br></div><div>The point is when I update the pipeline... a window appears and disappears instantly.</div><div><br></div><div>I'm trying to connect these two buddies, but I'm unsure which render or renderWindow assign to who.</div><div><br></div><div>I've tried different things reading examples (people try a lot of things!). Right now my code is this:</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,128)">vtkSmartPointer</span><span style="color:rgb(0,0,0)"><</span><span style="color:rgb(128,0,128)">vtkImageViewer2</span><span style="color:rgb(0,0,0)">></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">imageViewer</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">vtkSmartPointer</span><span style="color:rgb(0,0,0)"><</span><span style="color:rgb(128,0,128)">vtkImageViewer2</span><span style="color:rgb(0,0,0)">>::</span><span style="color:rgb(0,0,0)">New</span><span style="color:rgb(0,0,0)">();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">imageViewer</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">SetInputData</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,0)">con</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">GetOutput</span><span style="color:rgb(0,0,0)">());</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">imageViewer</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">Render</span><span style="color:rgb(0,0,0)">();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//ui->qvtkwidget->SetRenderWindow(imageViewer->GetRenderWindow());</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">imageViewer</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">SetupInteractor</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,0)">ui</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">qvtkwidget</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">GetRenderWindow</span><span style="color:rgb(0,0,0)">()-></span><span style="font-style:italic;color:rgb(0,0,0)">GetInteractor</span><span style="color:rgb(0,0,0)">());</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//imageViewer->SetRenderWindow(ui->qvtkwidget->GetRenderWindow());</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">imageViewer</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">Render</span><span style="color:rgb(0,0,0)">();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//renderer->ResetCamera();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//renderWindow->AddRenderer(renderer);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//renderWindow->Render();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//vtkSmartPointer<vtkRenderWindowInteractor></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">interactor</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">vtkSmartPointer<vtkRenderWindowInteractor>::New();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//vtkSmartPointer<vtkInteractorStyleImage></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">style</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">vtkSmartPointer<vtkInteractorStyleImage>::New();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//interactor->SetInteractorStyle(style);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//interactor->SetRenderWindow(renderWindow);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//interactor->Initialize();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//renderWindow->Start();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//ui->qvtkwidget->GetRenderWindow()->GetInteractor()->Initialize();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">ui</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">qvtkwidget</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">show</span><span style="color:rgb(0,0,0)">();</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;white-space:normal">The commented lines were uncommented sometimes, trying to find out the correct sequence, but unsuccessfully.</span><span style="color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;white-space:normal"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;white-space:normal">Any idea?</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;white-space:normal">Thank you.</span></pre></div></div>
</blockquote></div><br></div>