<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 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 <amy.squillacote@kitware.com><br>À : Mohamed Ben Reguiga <breguiga_mh@yahoo.fr><br>Cc : Gabriel Kiss <gg1977@gmail.com>; VTK_Users <vtkusers@vtk.org><br>Envoyé le : Vendredi, 7 Juillet 2006, 2h00mn 19s<br>Objet : 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>> 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 <br>> be advised if the allocation is ok or not?<br>><br>> thank you for your help!<br>><br>> ----- 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 <br>> scalars<br>><br>> Hi,<br>><br>> Does it help if you add also:<br>><br>> data2->SetNumberOfScalarComponents(1);<br>><br>> gg<br>><br>> On 7/6/06, *Mohamed Ben Reguiga* < breguiga_mh@yahoo.fr <br>> <mailto:breguiga_mh@yahoo.fr>> wrote:<br>><br>> hello all,<br>> I 'm using VTK for 3D reconstitution , MPR and MIP (maximum<br>> intesity projection).<br>> for the
constitution of the volume of all the pixmaps of the<br>> 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<br>> 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<br>> unsigned short pointer of course<br>> }<br>> }<br>> }<br>><br>> then I use the vtkStructuredPoints object like an input for the<br>>
vtkImageMapToColors that I use (3 : 1 for each plane X, Y and Z).<br>><br>> every thing goes allright but sometimes something wrong happens<br>> and I don't know why :<br>> the allocation of the memory is not accomplished when I do :<br>> data2->AllocateScalars(); and the value of unsigned short *<br>> ptr2=(unsigned short *) data2->GetScalarPointer() is 0x00000 and I<br>> when I chek the system use of the memory : theer is not a memory<br>> allocated !!!!!!!<br>><br>> could you please help me to know when this function doesn't do<br>> allocate memory and is there sthing to do before allocating to<br>> prevent from such problems!<br>> it's really an
emergency!<br>> thank you for your help !<br>></div></div><br></div></div></body></html>