[vtkusers] Bug in vtkOpenGLImageActor ?

David Gobbi dgobbi at atamai.com
Wed Aug 24 10:24:56 EDT 2005


This is a known bug in the VTK 4.4 vtkOpenGLImageActor, it has been 
fixed in CVS.  The fix is here:
http://public.kitware.com/cgi-bin/viewcvs.cgi/Rendering/vtkOpenGLImageActor.cxx?r1=1.24&r2=1.24.2.1

Jan Ehrhardt wrote:

> Hi,
>
> I found a problem diplaying images with unconventional sizes using VTK 
> 4.4.
> If you re-render an image of size 181x217, it is displayed distorted.
> I think the bug depends on the use of glTexSubImage2D in
> vtkOpenGLImageActor::Load(). The following example programm
> shows the same behaviour on linux and windows (but both machines
> have nvidia cards).
> How can I fix the problem?
>
> Regards and greetings from germany,
>
> Jan Ehrhardt
>
> // use the example image form the ITK Toolkit
> #define EXAMPLE_DATA 
> "/passat/Software/ITK/InsightToolkit-2.0.1/Examples/Data/BrainProtonDensity3Slices.raw" 
>
>
> int main( int argc, char **argv )
> {
> double origin[3]={0,0,0};
> int extent[6]={0, 180, 0, 216, 0, 2};
>
> vtkImageReader *m_reader = vtkImageReader::New();
> m_reader->SetDataByteOrderToLittleEndian();
> m_reader->SetDataScalarTypeToUnsignedChar();
> m_reader->SetFileDimensionality(3);
> m_reader->SetDataExtent(extent);
> m_reader->SetDataOrigin(origin);
> m_reader->SetFileName(EXAMPLE_DATA);
> m_reader->SetNumberOfScalarComponents(1);
> m_reader->SetHeaderSize(0);
> m_reader->UpdateWholeExtent();
>
> vtkImageActor *m_Actor = vtkImageActor::New();
> m_Actor->SetInput(m_reader->GetOutput());
> m_Actor->SetDisplayExtent(extent[0],extent[1],extent[2], extent[3],1,1);
>
> vtkRenderer *m_Renderer = vtkRenderer::New();
>
> vtkRenderWindow *m_RenWin = vtkRenderWindow::New();
> m_RenWin->AddRenderer(m_Renderer);
>
> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
> iren->SetRenderWindow(m_RenWin);
>
> vtkInteractorStyleImage *interactor = vtkInteractorStyleImage::New();
> iren->SetInteractorStyle(interactor);
>
>
> // Add the actors to the renderer, set the background and size
> m_Renderer->AddActor(m_Actor);
> m_Renderer->SetBackground(0.1, 0.2, 0.4);
> m_RenWin->SetSize(400, 400);
>
> m_RenWin->Render();
>
> // uncomment to see the distortion
> m_reader->Modified();
>
> m_RenWin->Render();
>
> // interact with data
> iren->Initialize();
> iren->Start();
>
> return 0;
> }
> _______________________________________________
> This is the private VTK discussion list. Please keep messages 
> on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list