[vtkusers] Re-post: how to use own 3d array to create image

David Doria daviddoria+vtk at gmail.com
Wed Feb 10 09:03:39 EST 2010


On Wed, Feb 10, 2010 at 8:56 AM, Liam Kurmos <quantum.leaf at googlemail.com>wrote:

> I forgot to reference in my last post your example:
>
> http://www.cmake.org/Wiki/VTK/Examples/IterateImageData
>
> which is the way i do it now.
>
> I was thinking there may be a method that lets you set a 3D array as
> scalars that might be faster for performance critical tasks but
> haven't needed to do that yet.
>
> Liam
>

I think that example should be modified to use the GetScalarPointer method.
It seems more "natural" to me - I never followed what happens when you
SetScalarComponentFromDouble when you are not setting a double :)

Also, the documentation for SetScalarComponentFromDouble says "For access to
data from tcl" This leads me to believe this is not the intended way to do
this.

Also, there was an error in my last post:
volValue = whatever you want pixel (x,y,z) to equal
should be
volValue[0] = whatever you want pixel (x,y,z) to equal

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100210/bbb37467/attachment.htm>


More information about the vtkusers mailing list