PDA

View Full Version : <multimedia:image>.setImageData question


shivanangel
01-28-2014, 07:43 PM
Hello Vizard Support,

I had a question when using <multimedia:image>.setImageData().
I'm working on an updated volume renderer and I'm trying to populate a 3D texture ( btw, thank you for helping me with that months ago ) but instead of using the .load() method with a file name I wish to fill the 3D texture with images that have already been loaded into Vizard.

Specifically, I'm trying to do something like this:


def loadBlank3DTexture( blank3DTex, imageList ):
'''
Fill 3D texture with provided list of images in sequential order
'''

for i, image in enumerate( imageList ):
imageSize = image.getSize()
print i, image
blank3DTex.setImageData( image.getImageData(), imageSize, blank3DTex.getPixelFormat(), i )



I originally was testing with 3 png images that were only all red, green, or blue each. I noticed only the blue images seemed to load.

Then I tested with images with differing RGB values to see if a specific channel was being shown and I noticed only the blue channel was being displayed. Obviously, there is something I am not understanding about the setImageData method. I seem to only be passing the blue channel.

Any thoughts?

Thanks,
George