I am using vtk-5.4.2 and I am wondering the best approach to moving an 3D 
array of voxel data from MATLAB mex interface into the vtk pipeline.  I 
am have been confused based on what is available to me, what is new, and
 what is being deprecated.  I am also wondering if implementing and a 
class based on vtkArray (abstract) would be an approach in order not to 
have to copy data in memory, though I have and a feeling that it must be
 put into the vtk vector structure at some point.  I currently have a 
working Matlab 2010a to mex interface working and can call vtk<br>
<br><br>I have read:<br><br><a href="http://www.itk.org/Wiki/VTK/VTKMatlab" target="_blank">http://www.itk.org/Wiki/VTK/VTKMatlab</a><br><br>which
 was updated circa 2006 and I am wondering if this is still the appraoch
 based on the seemingly new vtkDenseArray.  Is there a better approach 
to show voxel data in vtk from a 3D array in matlab?<br>
<br>and I have read<br><br><a href="http://kitware.com/InfovisWiki/index.php/N-Way_Array_Data_Structures" target="_blank">http://kitware.com/InfovisWiki/index.php/N-Way_Array_Data_Structures</a><br><br>and
 I had an opinion (yea doesn&#39;t everyone) on the following statements<br>
<br>--snip--<br>The vtkArray::Resize() method is used to set the number 
of dimensions and extents along each dimension of an array. Overloads 
are provided for 1, 2, or 3 dimensions, plus an overload that takes an 
instance of vtkArrayExtents for working in higher dimensions.<br>
<br>    The &quot;Resize&quot; method can be efficiently implemented if it does 
not preserve any data. Therefore it should be called SetSize and 
documented to not initialize data unless an initial value is given. The 
vxl folks went through this same decision process and created lots of 
incompatibilities by changing the name...so it is better to have it 
right early. -Brad King <br>
<br>        From the documentation, Resize() explicitly does not 
preserve data, and leaves the array contents in an undefined state. In 
fact, we don&#39;t provide any mechanism to initialize the array contents in
 vtkArray, because there aren&#39;t any initialization semantics that make 
sense for both dense and sparse arrays - so we leave initialization to 
concrete subclasses. So the only question is whether &quot;Resize()&quot; is the 
right name or not ... FWIW, &quot;SetSize()&quot; doesn&#39;t seem better-or-worse to 
me. Tshead 16:27, 14 September 2009 (UTC) <br>
<br>--end snip--<br><br>I too read that Resize does not perserve data 
and felt sad.  I would perfer the term used by Matlab called &quot;Reshape&quot; 
where your data stays put, but the only thing that is changed structure 
of the pointers to the data.<br>
<br>I am currently doing the following in hopes to use the new template 
goop.  Anyone there look at boost multi array? (<a href="http://www.boost.org/doc/libs/1_43_0/libs/multi_array/doc/user.html" target="_blank">http://www.boost.org/doc/libs/1_43_0/libs/multi_array/doc/user.html</a><b>)<br>

<br></b><br>--snip--<br>    *  Boost 1.34 or-later. Although VTK/vtkSNL 
build with Boost 1.33, the n-way arrays have a dependency on Boost 1.34.<br>   
 * Build vtkSNL with VTKSNL_N_WAY_ARRAYS set to ON. <br>--snip--<br><br clear="all">
In hopes I can try vtkDenseArray&lt;double&gt;<br><br>-- <br>Brian J. 
Davis<br clear="all"><br>-- <br>Brian J. Davis<br><br>