[vtkusers] vtkFloatArray -> vtkImageData

Luke J West ljw at soc.soton.ac.uk
Mon Dec 8 07:28:38 EST 2003


Thanks, bryan - it works a treat!

luke

Quoting bryan cole <bryan.cole at teraview.com>:

> assuming you already have a vtkFloatArray containing data, called
> 'myFltArray' & assuming you use python:
> 
> imgdat = vtkImageData()
> imgdat.GetPointData().SetScalars(myFltArray)
> imgdat.SetDimensions(xdim, ydim, zdim) #set dimensions as necessary
> imgdat.SetScalarTypeToFloat()
> imgdat.SetOrigin(0,0,0) #set origin as necessary
> imgdat.SetSpacing(dx, dy, dz) #set spacing as necessary
> 
> HTH
> Bryan
> 
> 
> On Mon, 2003-12-08 at 08:42, Luke J West wrote:
> > Hi,
> > 
> > what's the easiest way to make a vtkImageData out of a vtkFloatArray
> > 
> > thanks,
> > 
> > 
> > Luke J West : Research Assistant : e-Science
> > --------------------------------------------
> > Rm. 566/12, School of Ocean & Earth Sciences
> > Southampton Oceanography Centre, Southampton
> > SO14 3ZH  United Kingdom
> > --------------------------------------------
> > Tel: +44 23 8059 4801  Fax: +44 23 8059 3052
> > Mob: +44 79 6107 4783
> > 
> > _______________________________________________
> > This is the private VTK discussion list. 
> > Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> -- 
> Bryan Cole
> Teraview Ltd., 302-304 Cambridge Science Park, Milton Road, Cambridge CB4
> 0WG, United Kingdom.
> tel: +44 (1223) 435380 / 435386 (direct-dial) fax: +44 (1223) 435382





More information about the vtkusers mailing list