WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   <multimedia:image>.setImageData question (https://forum.worldviz.com/showthread.php?t=4930)

shivanangel 01-28-2014 07:43 PM

<multimedia:image>.setImageData question
 
Hello Vizard Support,

I had a question when using .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:

Code:

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


All times are GMT -7. The time now is 05:57 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC