[vtkusers] Problem with allocating Memory

Mohamed Ben Reguiga breguiga_mh at yahoo.fr
Fri Sep 15 09:11:52 EDT 2006


hello,
I'm using VTK in may Project for the MPR and MIPs fonctionnalities , and I'm faced to aprblem that I cannot analyse because it depends on the vtkStructuredPoints::AllocateScalars().
the problem is that after the declaration , the specification of the dimensions of the Volume , the allocation doesn't happen and I allways have a NULL pointer when I use  the GetScalarPointer() function.
this is the instructions I do for the Volume creation :
  data2=vtkStructuredPoints::New();
  data2->SetDimensions(WdthVlm,HghtVlm,DpthVlm);                    
  data2->SetSpacing (xsp, ysp, zsp);
  data2->SetScalarType(VTK_UNSIGNED_SHORT);
  data2->AllocateScalars();
  unsigned short *  ptr2=(unsigned short *) data2->GetScalarPointer();
 
//ptr2 is allways = = NULL
ths questions are :
 in whitch conditions the allocation cannot happen?
 how can I know if VTK did the allocation of the memory?
 
NB: I have a 1Go of RAM and a 3Ghz µP! (and I'm sure that I have enough memory available and the scalars are really  VTK_UNSIGNED_SHORT).
 
thank you for your help !
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060915/59a76ffc/attachment.htm>


More information about the vtkusers mailing list