[vtkusers] getting blue box when trying to visualize

Erik Tuerke tuerke at cbs.mpg.de
Tue Jun 1 05:07:59 EDT 2010


Hi!

I am trying to visualize an image with the pipeline:

vtkImageData->vtkDataSetMapper->vtkActor->vtkRenderer->vtkRenderWindow->qvtWidget

m_mapper->SetInput( m_vtkImage );
m_mapper->SetScalarModeToUserPointData();
m_actor->SetScale( scale );
m_actor->SetMapper( m_mapper );

m_actor->GetProperty()->SetInterpolationToFlat();
m_actor->GetTexture()-> InterpolateOff();   //ok, the above code is 
futile here ...?
m_renderer->SetActor( m_actor );

m_window->SetInteractor( m_interactor );
m_interactor->Initialize();
m_window->Render();

this->ui.qvtkWidget->SetRenderWindow( m_window );


If i am trying to visualize an image of datatype uint8 (char), all works 
fine. But if the datatype is not uint8 (i did not try int8) the viewer 
shows a blue box with some red dots.

The weird thing is that when i am using the vtkImageViewer with the 
following code:

vtkImageViewer* viewer = vtkImageViewer::New();
viewer->SetInput( m_vtkImage );
viewer->SetZSlice( m_vtkImage->GetDimensions()[2] / 2 );
viewer->Render();

...images of all data types are visualized perfectly.

Has any one a hint for me?

Thanks a lot and best regards!







More information about the vtkusers mailing list