<div dir="ltr"><div><div>dear joachim<br></div>thanks a lot for your response but if i use this:<br><br>vtkDataArray* da = vtkDataArray::New();<br><br></div>then i have a compile error :<br><br>error C2440: 'initializing' : cannot convert from 'vtkObject *' to 'vtkDataArray *'<br>
<br><br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 30, 2013 at 6:12 PM, Joachim Pouderoux <span dir="ltr"><<a href="mailto:joachim.pouderoux@kitware.com" target="_blank">joachim.pouderoux@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div class="im"><br><br>da = 0;<br>da->SetVoidArray(buffer,512*512*295,1);<br><br></div>For sure it crashes! :)<br>
Why do you set da = 0 ? Instead you mush create the vtkDataArray :<br>da = vtkDataArray::New();<br><br>Joachim<br><br><div class="gmail_quote">
2013/1/30 Hossein Nazem <span dir="ltr"><<a href="mailto:hossein.nazem@gmail.com" target="_blank">hossein.nazem@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5">
hi all<br>
i'm trying to load a volume from memory by means of setvoidarray.<br>
its a 3d array of int (512*512*295) and i use vs2012 win7 x64.<br>
there is no compile error but in run time when i trace program to<br>
the line"da->SetVoidArray(buffer,512*512*295,1);" (by F10 or F11) ,<br>
tracing terminate!<br>
nothing happen and no runtime error!<br>
any help is appreciated<br>
here is my code:<br>
<br>
void rendering::LoadFromMemory(INT16 buffer[512][512][295], int width,<br>
int height, int slices, double voxelsizeX, double voxelsizeY, double<br>
voxelsizeZ, double originX, double originY, double originZ)<br>
{<br>
input = 0;<br>
if (!input)<br>
{<br>
input = vtkImageData::New();<br>
}<br>
vtkDataArray* da ;<br>
da = 0;<br>
da->SetVoidArray(buffer,512*512*295,1);<br>
input->GetPointData()->SetScalars(da);<br>
input->SetDimensions(width, height, slices);<br>
input->SetSpacing(voxelsizeX, voxelsizeY, voxelsizeZ);<br>
input->SetOrigin(originX, originX, originZ);<br>
}<br></div></div>
_______________________________________________<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><span class="HOEnZb"><font color="#888888"><br>
</font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br><b>Joachim Pouderoux</b><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<font size="1"><i>PhD, R&D Enginee</i>r</font> <br>
<b><font size="1"><a href="http://www.kitware.fr" target="_blank">Kitware SAS</a></font></b><br></blockquote>
</font></span></blockquote></div><br></div>