[vtkusers] Problem with vtkImageViewer2 and QVTKWidget

Luis Roberto P. Paula luisrpp at gmail.com
Mon Nov 10 16:47:01 EST 2008


Hi All,

I'm trying to use the vtkImageViewer2 to display a 2D image in a QVTKWidget,
but I'm getting some errors.

Here is a piece of code:

   image_viewer = vtkImageViewer2::New();
   qvtkWidget->SetRenderWindow(image_viewer->GetRenderWindow());
   image_viewer->SetInput(get2DImage());
   image_viewer->Render();

Error messages:

ERROR: In /home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
line 725
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of algorithm
vtkImageMapToWindowLevelColors(0x8b62358) has 0 connections but is not
optional.

ERROR: In /home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
line 725
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of algorithm
vtkImageMapToWindowLevelColors(0x8b62358) has 0 connections but is not
optional.

ERROR: In /home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
line 725
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of algorithm
vtkImageMapToWindowLevelColors(0x8b62358) has 0 connections but is not
optional.

ERROR: In /home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
line 725
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of algorithm
vtkImageMapToWindowLevelColors(0x8b62358) has 0 connections but is not
optional.

ERROR: In /home/luis/dev-tools/VTK/Rendering/vtkImageActor.cxx, line 267
vtkOpenGLImageActor (0x8ba93e0): This filter requires unsigned char scalars
as input

ERROR: In /home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
line 725
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of algorithm
vtkImageMapToWindowLevelColors(0x8b62358) has 0 connections but is not
optional.

ERROR: In /home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
line 725
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of algorithm
vtkImageMapToWindowLevelColors(0x8b62358) has 0 connections but is not
optional.

ERROR: In /home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
line 725
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of algorithm
vtkImageMapToWindowLevelColors(0x8b62358) has 0 connections but is not
optional.

ERROR: In /home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
line 725
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of algorithm
vtkImageMapToWindowLevelColors(0x8b62358) has 0 connections but is not
optional.

ERROR: In /home/luis/dev-tools/VTK/Rendering/vtkImageActor.cxx, line 267
vtkOpenGLImageActor (0x8ba93e0): This filter requires unsigned char scalars
as input

ERROR: In /home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
line 725
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of algorithm
vtkImageMapToWindowLevelColors(0x8b62358) has 0 connections but is not
optional.

ERROR: In /home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
line 725
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of algorithm
vtkImageMapToWindowLevelColors(0x8b62358) has 0 connections but is not
optional.

ERROR: In /home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
line 725
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of algorithm
vtkImageMapToWindowLevelColors(0x8b62358) has 0 connections but is not
optional.

ERROR: In /home/luis/dev-tools/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
line 725
vtkStreamingDemandDrivenPipeline (0x8ba9890): Input port 0 of algorithm
vtkImageMapToWindowLevelColors(0x8b62358) has 0 connections but is not
optional.

ERROR: In /home/luis/dev-tools/VTK/Rendering/vtkImageActor.cxx, line 267
vtkOpenGLImageActor (0x8ba93e0): This filter requires unsigned char scalars
as input

-------------------------------------------------------------------------------------------

Does anybody knows how to fix this? It works with the vtkImageViewer class,
but I think the vtkImageViewer2 is a better option to display a 2D image in
a widget.

Thank's
Luis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081110/3ffed6d3/attachment.htm>


More information about the vtkusers mailing list