[vtkusers] Problems calling GetPixelValue

Randy Heiland heiland at ncsa.uiuc.edu
Sun Apr 29 16:59:50 EDT 2001


On Apr 29, 10:27am, Julian Humphries wrote:
> Subject: [vtkusers] Problems calling GetPixelValue
> Environment:
>
> Recent vtkNightly
> Python 1.5
> Win2k
>
> Trying to get scalar value for a pixel with call to
> vtkRenderWindow.GetPixelData():
>
> winRen.GetPixelValue(x,y,x,y,1)
>
> I am getting a NameAttribute error for GetPixelData.  This would seem to be
> a valid property for a vtkRenderWindow, any help on what I am doing
> wrong?  I can get other properties of the render window with no difficulty.
>

Julian,

I'm assuming you mistyped 'Value' instead of 'Data'.  There is no method
'GetPixelValue' - which would be reason enough for the NameAttrib error :)
 However, beyond that, I doubt that 'GetPixelData' is being wrapped either (it
didn't use to be) since it returns an 'unsigned char*', and methods returning
"complex" types are not typically wrapped.

If you're feeling up to it, you can download PyRenderWindow_GetPixelData.cxx
from http://www.ncsa.uiuc.edu/~heiland/vtk/ , insert it into the approp
/graphics/python routine and recompile/rebuild your graphics lib.

For more help on extending Python, rf:
http://www.python.org/doc/current/ext/callingPython.html

good luck,
--Randy




More information about the vtkusers mailing list