Hi Clint,<br><br>You are right. There is something wrong with the pipeline, but it's something that is ok for vtkImageViewer.<br><br>I have this code at the constructor of a class:<br><br> image_view = vtkImageViewer2::New();<br>
<br> /*** image_view->SetInput(reader->GetOutput()); */<br><br> vtkWidget->SetRenderWindow(image_view->GetRenderWindow());<br> image_view->SetupInteractor(vtkWidget->GetRenderWindow()->GetInteractor());<br>
image_view->SetColorLevel(138.5);<br> image_view->SetColorWindow(233);<br> vtkWidget->show();<br><br>It is basically the same code of the VTK/Examples/GUI/Qt/ImageViewer example, except that I'm not calling the SetInput method at this time.<br>
<br>The reason I do this is because the SetInput is called by one method in order to update the image to be displayed in the widget. The method is just this:<br><br> image_view->SetInput(NEW_IMAGE);<br> image_view->Render();<br>
<br>This method is called when a slider moves and it works fine with the vtkImageViewer, but it is not working the same way with the vtkImageViewer2.<br><br>How can I do this using vtkImageViewer2? I tried to load a dummy picture in the constructor, but when the slider moves, it doesn't update the widget with new images.<br>
<br>Thank's<br>Luis<br><br><div class="gmail_quote">On Tue, Nov 11, 2008 at 11:37 PM, Clinton Stimpson <span dir="ltr"><<a href="mailto:clinton@elemtech.com">clinton@elemtech.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
If I replace vtkImageViewer with vtkImageViewer2 in the VTK/Examples/GUI/Qt/ImageViewer example, it works fine.<br>
Your errors indicate something wrong with how you've set up the image pipeline, not with how you've set up the window.<br>
<br>
Clint<div class="Ih2E3d"><br>
<br>
Luis Roberto P. Paula wrote:<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">
Is there anyone in this group that have used vtkImageViewer2 with QVTKWidget successfully?<br>
<br>
Am I wrong to think that QVTKWidget works only with vtkImageViewer?<br>
<br>
Thanks,<br>
Luis<br>
<br></div><div><div></div><div class="Wj3C7c">
On Mon, Nov 10, 2008 at 7:47 PM, Luis Roberto P. Paula <<a href="mailto:luisrpp@gmail.com" target="_blank">luisrpp@gmail.com</a> <mailto:<a href="mailto:luisrpp@gmail.com" target="_blank">luisrpp@gmail.com</a>>> wrote:<br>
<br>
Hi All,<br>
<br>
I'm trying to use the vtkImageViewer2 to display a 2D image in a<br>
QVTKWidget, but I'm getting some errors.<br>
<br>
Here is a piece of code:<br>
<br>
image_viewer = vtkImageViewer2::New();<br>
qvtkWidget->SetRenderWindow(image_viewer->GetRenderWindow());<br>
image_viewer->SetInput(get2DImage());<br>
image_viewer->Render();<br>
<br>
Error messages:<br>
<br>
ERROR: In<br>
/home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,<br>
line 725<br>
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of<br>
algorithm vtkImageMapToWindowLevelColors(0x8b62358) has 0<br>
connections but is not optional.<br>
<br>
ERROR: In<br>
/home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,<br>
line 725<br>
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of<br>
algorithm vtkImageMapToWindowLevelColors(0x8b62358) has 0<br>
connections but is not optional.<br>
<br>
ERROR: In<br>
/home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,<br>
line 725<br>
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of<br>
algorithm vtkImageMapToWindowLevelColors(0x8b62358) has 0<br>
connections but is not optional.<br>
<br>
ERROR: In<br>
/home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,<br>
line 725<br>
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of<br>
algorithm vtkImageMapToWindowLevelColors(0x8b62358) has 0<br>
connections but is not optional.<br>
<br>
ERROR: In /home/luis/dev-tools/VTK/Rendering/vtkImageActor.cxx,<br>
line 267<br>
vtkOpenGLImageActor (0x8ba93e0): This filter requires unsigned<br>
char scalars as input<br>
<br>
ERROR: In<br>
/home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,<br>
line 725<br>
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of<br>
algorithm vtkImageMapToWindowLevelColors(0x8b62358) has 0<br>
connections but is not optional.<br>
<br>
ERROR: In<br>
/home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,<br>
line 725<br>
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of<br>
algorithm vtkImageMapToWindowLevelColors(0x8b62358) has 0<br>
connections but is not optional.<br>
<br>
ERROR: In<br>
/home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,<br>
line 725<br>
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of<br>
algorithm vtkImageMapToWindowLevelColors(0x8b62358) has 0<br>
connections but is not optional.<br>
<br>
ERROR: In<br>
/home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,<br>
line 725<br>
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of<br>
algorithm vtkImageMapToWindowLevelColors(0x8b62358) has 0<br>
connections but is not optional.<br>
<br>
ERROR: In /home/luis/dev-tools/VTK/Rendering/vtkImageActor.cxx,<br>
line 267<br>
vtkOpenGLImageActor (0x8ba93e0): This filter requires unsigned<br>
char scalars as input<br>
<br>
ERROR: In<br>
/home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,<br>
line 725<br>
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of<br>
algorithm vtkImageMapToWindowLevelColors(0x8b62358) has 0<br>
connections but is not optional.<br>
<br>
ERROR: In<br>
/home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,<br>
line 725<br>
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of<br>
algorithm vtkImageMapToWindowLevelColors(0x8b62358) has 0<br>
connections but is not optional.<br>
<br>
ERROR: In<br>
/home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,<br>
line 725<br>
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of<br>
algorithm vtkImageMapToWindowLevelColors(0x8b62358) has 0<br>
connections but is not optional.<br>
<br>
ERROR: In<br>
/home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,<br>
line 725<br>
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of<br>
algorithm vtkImageMapToWindowLevelColors(0x8b62358) has 0<br>
connections but is not optional.<br>
<br>
ERROR: In /home/luis/dev-tools/VTK/Rendering/vtkImageActor.cxx,<br>
line 267<br>
vtkOpenGLImageActor (0x8ba93e0): This filter requires unsigned<br>
char scalars as input<br>
<br>
-------------------------------------------------------------------------------------------<br>
<br>
Does anybody knows how to fix this? It works with the<br>
vtkImageViewer class, but I think the vtkImageViewer2 is a better<br>
option to display a 2D image in a widget.<br>
<br>
Thank's<br>
Luis<br>
<br>
<br></div></div>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
This is the private VTK discussion list.<br>
Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br>
</blockquote>
<br>
<br>
</blockquote></div><br>