[vtkusers] Voxel Data from MATLAB to VTK
bitminer at gmail.com
Mon May 17 14:29:29 EDT 2010
The latest I found suports using flat arrays as you suggest and as I tried
to do and reshaping with and example I found at:
The vtkMatlabMexAdapter looks exactly like what I am looking for
However a search in my tree vtkMatlabMexAdapter returns nothing. Seems to
be a part of Titan?
Though it looks as thought it is in latest:
On Mon, May 17, 2010 at 11:25 AM, David Gobbi <david.gobbi at gmail.com> wrote:
> Hi Brian,
> It's much easier to use flat arrays to store n-dimensional data in
> VTK. This is how VTK manages structured data such as vtkImageData.
> Then all you need to do when moving the data into Matlab is reshape
> the flat array into an n-dimensional array by using the known
> dimensions of the desired n-dimensional array.
> For example, when moving vtkImageData to Python's NumPy, I grab the
> Dimensions and NumberOfScalarComponents from the image data and use
> that information to reshape the array into a 3D or 4D array. The same
> could be done with Matlab, I think.
> On Mon, May 17, 2010 at 10:15 AM, Brian Davis <bitminer at gmail.com> wrote:
> > So latest in my search for how to do this I came across:
> > http://www.vtk.org/doc/nightly/html/classvtkArrayData.html
> > With the important part:
> > --snip--
> > Because vtkArray cannot be stored as attributes of data objects (yet), a
> > "carrier" object is needed to pass vtkArray through the pipeline.
> > vtkArrayData acts as a container of zero-to-many vtkArray instances,
> > can be retrieved via a zero-based index. Note that a collection of arrays
> > stored in vtkArrayData may-or-may-not have related types, dimensions, or
> > extents.
> > --end snip--
> > and looking at the api and input types for ImageData and the
> > the input to these appears to only be a route that involves vtkDataSet.
> > get the feeling that using the Array classes in an attempt to create
> > data is an futile attempt at "round hole square plug" am I correct with
> > assessment? Array data appears to have a path to filters and not image
> > data. Is this correct?
> > Which means I may have to result to awful for loops as in the examples.
> > also looked at the examples for
> > Brian
> > _______________________________________________
> > Powered by www.kitware.com
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
Brian J. Davis
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers