<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:8pt"><div>Hi,<br><br>If this one rings any bells for anybody I'd appreciate hearing about it.&nbsp; I have an application with which a user will repeatedly open an application specific file which includes volume data, and use vtk code to put that data on the screen;&nbsp; the application file also contains other kinds of data with which other things are being done so that using a .vtk file would not help anything.&nbsp; What I'd like to do is eliminate having to write my own data to a .vtk file and then re-read it.&nbsp; I can do that by using a vtkStructuredPoints object directly rather than using vtkStructuredPointsReader, and setting the data for that object directly including adding individual data points by calling SetScalarComponentFromFloat.&nbsp; Nonetheless that is not as fast as I'd like since
 it amounts to calling a wrapped function several million times, literally.&nbsp; What I've tried to do is reduce wrapped calls to one by making up my own load method for the vtkStructuredPoints class in the Filtering section thus:<br><br>in vtkFiltering:<br><br><font size="1"><span style="font-style: italic; color: rgb(0, 0, 191);">void vtkStructuredPoints::loadByteArray(int Width, int Height, int NumSlices, float *bdata )</span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">{</span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; int SliceSize;</span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; float vv;</span><br style="font-style: italic; color: rgb(0, 0, 191);"><span
 style="font-style: italic; color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; int i, j, k, ii, jj, kk;</span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; int x, y, z;</span><br style="font-style: italic; color: rgb(0, 0, 191);"><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SliceSize = Width * Height;&nbsp;&nbsp;&nbsp; </span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; </span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (z = 0; z &lt; NumSlices; z++)</span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic;
 color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (y = 0; y &lt; Height; y++)</span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (x = 0; x &lt; Width; x++)</span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic;
 color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ii = z * SliceSize + y * Width + x;</span><span style="font-style: italic; color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; this-&gt;SetScalarComponentFromFloat(x, y, z, 0, bdata[ii]);</span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</span><br
 style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; </span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">}&nbsp;&nbsp;&nbsp; </span></font><br><br>That gets translated via the SourceForge wrapping software and cmake into:<br><br>in vtkFilteringDotNet:<br><br><span style="font-style: italic; color: rgb(0, 0, 191);">void vtkStructuredPoints::loadByteArray(int Width, int Height, int NumSlices, array&lt;float&gt;^ bdata)</span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">{</span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">&nbsp; pin_ptr&lt;float&gt; bdataPin = &amp;bdata[0];</span><br style="font-style: italic; color: rgb(0, 0, 191);"><span
 style="font-style: italic; color: rgb(0, 0, 191);">&nbsp; float* nativebdataPin = bdataPin;</span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">&nbsp; vtk::ConvertManagedToNative&lt;::vtkStructuredPoints&gt;(m_instance)-&gt;loadByteArray(Width, Height, NumSlices, nativebdataPin);</span><br style="font-style: italic; color: rgb(0, 0, 191);"><span style="font-style: italic; color: rgb(0, 0, 191);">}</span><br><br>That compiles and builds, and the VS intellisense understands it and indicates that the input array is float[], and you'd think it would work.&nbsp; Nonetheless when I try to use it I get a no-such-method exception.<br><br>I'll be looking at this one a bit more this coming week;&nbsp; again if anybody has any suggestions or anything, I'm all ears.<br><br><br>Ted<br><br><br><br><br><br></div></div><br>

      </body></html>