<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:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">hello,<br>thank you for the answer but I still have the same bug!<br>is it possible, at least , to know if the Allocation was done or not?<br>the allocateScalrs() function is a void return function so how can I be advised if the allocation is ok or not?<br><br>thank you for your help!<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Message transféré ----<br>De : Gabriel Kiss <gg1977@gmail.com><br>À : Mohamed Ben Reguiga <breguiga_mh@yahoo.fr><br>Envoyé le : Vendredi, 7 Juillet 2006, 1h18mn 43s<br>Objet : Re: [vtkusers] Bug with vtkStructuredPoints when alloctaing scalars<br><br>Hi,<br><br>Does it help if you add
also:<br><br>data2->SetNumberOfScalarComponents(1);<br><br>gg<br><br><div><span class="gmail_quote">On 7/6/06, <b class="gmail_sendername">Mohamed Ben Reguiga</b> <<a id="bodyLinks" rel="nofollow" target="_blank" href="mailto:breguiga_mh@yahoo.fr">
breguiga_mh@yahoo.fr</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div>hello all,<br>I 'm using VTK for 3D reconstitution , MPR and MIP (maximum intesity projection).<br>for the constitution of the volume of all the pixmaps of the images I use a vtkStructuredPoints object :<br>data2=vtkStructuredPoints::New();
<br>data2->SetDimensions(WdthVlm,HghtVlm,DpthVlm); <br>data2->SetSpacing (wdgMPR->xsp, wdgMPR->ysp, wdgMPR->zsp);<br>data2->SetScalarType(VTK_UNSIGNED_SHORT);<br>data2->AllocateScalars();
<br><br>after thar I recover the scalarpointer to fill the volume by the data that i own :<br><br>unsigned short * ptr2=(unsigned short *) data2->GetScalarPointer();<br><br> for (cptdcm=0;cptdcm<DpthVlm;cptdcm++)<br>
{<br>
for(int i=0;i<HghtVlm;i++)<br> {<br> for(int j=0; j<WdthVlm;j++)<br> { <br> *(ptr2++) = *(myDataImages++); //myDataImages is a unsigned short pointer of course<br> }<br> }<br> }
<br><br>then I use the vtkStructuredPoints object like an input for the vtkImageMapToColors that I use (3 : 1 for each plane X, Y and Z).<br><br>every thing goes allright but sometimes something wrong happens and I don't know why :
<br>the allocation of the memory is not accomplished when I do : data2->AllocateScalars(); and the value of unsigned short * ptr2=(unsigned short *) data2->GetScalarPointer() is 0x00000 and I when I chek the system use of the memory : theer is not a memory allocated !!!!!!!
<br><br>could you please help me to know when this function doesn't do
allocate memory and is there sthing to do before allocating to prevent from such problems!<br>it's really an emergency!<br>thank you for your help !<br>
</div></div></div>
</div><br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a id="bodyLinks" rel="nofollow" target="_blank" href="http://www.vtk.org/Wiki/VTK_FAQ">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a id="bodyLinks" rel="nofollow" target="_blank" href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers
</a><br><br><br></blockquote></div><br></div><br></div></div></body></html>