<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;">hi,<br>well, I can say that I'm sure that I'm not running out of memory when I allocate memory, because I 'm doing tests with the same set of Images from wich I constitute the MPR plans and when I close the MPR window I do deallocate the memory allocated before and when I 'm testing I only run VS2005 to edit my project. Using the Window's Tasks Manager, and when the bug happens , I see that the memory is really deallocated after closing the window&nbsp; but not reallocated after calling AllocateScalars in the next time.<br>-So why it goes allright for several times and in the tenth or more it crashes and in wicth conditions the allocation is not done?<br><br>-to answer to your question the set of the images is equal to : 300Mo<br>- my
 PC is a 1Go of RAM and a 3GHz clock processor (Intel P4).<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 : Amy Squillacote &lt;amy.squillacote@kitware.com&gt;<br>À : Mohamed Ben Reguiga &lt;breguiga_mh@yahoo.fr&gt;<br>Cc : Gabriel Kiss &lt;gg1977@gmail.com&gt;; VTK_Users &lt;vtkusers@vtk.org&gt;<br>Envoyé le : Vendredi, 7 Juillet 2006, 2h00mn 19s<br>Objet&nbsp;: Re: Tr : [vtkusers] Bug with vtkStructuredPoints when alloctaing scalars<br><br><div>Is it possible that you are running out of memory when you try to <br>allocate the scalars? What are the dimensions of the vtkStructuredPoints <br>dataset when AllocateScalars() does not allocate memory?<br><br>- Amy<br><br>Mohamed Ben Reguiga wrote:<br>&gt; hello,<br>&gt; thank you for the answer but I still have the same bug!<br>&gt; is it possible, at least , to know if the Allocation was done or not?<br>&gt; the
 allocateScalrs() function is a void return function so how can I <br>&gt; be advised if the allocation is ok or not?<br>&gt;<br>&gt; thank you for your help!<br>&gt;<br>&gt; ----- Message transféré ----<br>&gt; De : Gabriel Kiss &lt;gg1977@gmail.com&gt;<br>&gt; À : Mohamed Ben Reguiga &lt;breguiga_mh@yahoo.fr&gt;<br>&gt; Envoyé le : Vendredi, 7 Juillet 2006, 1h18mn 43s<br>&gt; Objet : Re: [vtkusers] Bug with vtkStructuredPoints when alloctaing <br>&gt; scalars<br>&gt;<br>&gt; Hi,<br>&gt;<br>&gt; Does it help if you add also:<br>&gt;<br>&gt; data2-&gt;SetNumberOfScalarComponents(1);<br>&gt;<br>&gt; gg<br>&gt;<br>&gt; On 7/6/06, *Mohamed Ben Reguiga* &lt; breguiga_mh@yahoo.fr <br>&gt; &lt;mailto:breguiga_mh@yahoo.fr&gt;&gt; wrote:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; hello all,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; I 'm using VTK for 3D reconstitution , MPR and MIP (maximum<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; intesity projection).<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; for the
 constitution of the volume of all the pixmaps of the<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; images I use a vtkStructuredPoints object :<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; data2=vtkStructuredPoints::New();<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; data2-&gt;SetDimensions(WdthVlm,HghtVlm,DpthVlm);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; data2-&gt;SetSpacing (wdgMPR-&gt;xsp, wdgMPR-&gt;ysp, wdgMPR-&gt;zsp);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; data2-&gt;SetScalarType(VTK_UNSIGNED_SHORT);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; data2-&gt;AllocateScalars();<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; after thar I recover the scalarpointer to fill the volume by the<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; data that i own :<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; unsigned short * ptr2=(unsigned short *) data2-&gt;GetScalarPointer();<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for
 (cptdcm=0;cptdcm&lt;DpthVlm;cptdcm++)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(int i=0;i&lt;HghtVlm;i++)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(int j=0; j&lt;WdthVlm;j++)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*(ptr2++)&nbsp;&nbsp;=&nbsp;&nbsp;*(myDataImages++); //myDataImages is a<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; unsigned short pointer of course<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; then I use the vtkStructuredPoints object like an input for the<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;
 vtkImageMapToColors that I use (3 : 1 for each plane X, Y and Z).<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; every thing goes allright but sometimes something wrong happens<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; and I don't know why :<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; the allocation of the memory is not accomplished when I do :<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; data2-&gt;AllocateScalars(); and the value of&nbsp;&nbsp;unsigned short *<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; ptr2=(unsigned short *) data2-&gt;GetScalarPointer() is 0x00000 and I<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; when I chek the system use of the memory : theer is not a memory<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; allocated !!!!!!!<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; could you please help me to know when this function doesn't do<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; allocate memory and is there sthing to do before allocating to<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; prevent from such problems!<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; it's really an
 emergency!<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; thank you for your help !<br>&gt;</div></div><br></div></div></body></html>