[vtkusers] Using "GetPixelData" method

Hoang Hoang hp1711 at gmail.com
Fri Oct 13 00:30:41 EDT 2006


Hi,
 I am not sure if this will help, but try to add img->Update()  after the
GetPixelData() method.
Next time  please put more of your code.  That will help to understand what
you are in for.
thh.

On 10/12/06, hariharan ganesh lalgudi <hgl at ece.arizona.edu> wrote:
>
>
> Hii,
>
>    I am trying to write out some rendered images using vtk. I used
> "GetPixelData" method with "Medical2" example (altered code below). But
> the values I get are all zeros. However I do get the image on the screen.
> I looked at the mailing archive. This problem has been posted before. But
> I couldn't find
> the solution/correct way to acheive this. It would very helpful if I can
> get some suggestions.
>
> Thanks
> Hari
>
> ....
>    for (i = 0; i < 1; ++i)
>      {
>      // render the image
>      renWin->Render();
>       img = renWin->GetPixelData(0, 0, 639, 479, 1);
>      // rotate the active camera by one degree
>      aRenderer->GetActiveCamera()->Azimuth( 1 );
>      }
> ....
>
> --------------------------------
> Hariharan G Lalgudi
> Graduate Student
> Electrical and Computer Engineering
> University of Arizona.
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061013/1c16bb21/attachment.htm>


More information about the vtkusers mailing list