This particular method _will_ duplicate memory. As you can see, there's a line that says <br><pre class="de1"> grid<span class="sy2">-</span><span class="sy1">></span>SetScalarComponentFromDouble<span class="br0">(</span>x,y,z,<span class="nu0">0</span>,d<span class="br0">)</span><span class="sy4">;</span><br>
</pre>Look at the documentation (<a href="http://www.vtk.org/doc/nightly/html/classvtkImageData.html#ac65fb626222096573dea74dcb71572ef">http://www.vtk.org/doc/nightly/html/classvtkImageData.html#ac65fb626222096573dea74dcb71572ef</a>) for SetScalarComponentFromDouble; you'll see that it takes the x, y and z indices in the vtkImageData, and the _value_ of the scalar component. In this particular usage, the scalars array is allocated within the vtkImageData instance, which should be blanked and then set from outside.<br>
<br>If you want to share the input array, I'd suggest vtkImageImport (I recall that it was discussed on the list recently).<br><br>Incidentally, Jeff, I don't see an AllocateScalars() call anywhere in your example. From what I know, this will cause a segfault, because the array isn't allocated without that call. I suppose that as a debug-mode run, it would work, but that's not safe. Unless it was changed recently, and I didn't hear about it!<br>
<br>Regards,<br>Shash<br><br><div class="gmail_quote">On Tue, Mar 15, 2011 at 2:19 PM, sara.saeed <span dir="ltr"><<a href="mailto:sosca7@hotmail.com">sosca7@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Thanks Jeff, but i want to know if it duplicates the memory or just share the<br>
same volume ?<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/How-to-visualise-3d-array-of-data-tp1246794p3690617.html" target="_blank">http://vtk.1045678.n5.nabble.com/How-to-visualise-3d-array-of-data-tp1246794p3690617.html</a><br>
</font><div><div></div><div class="h5">Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br>