Tr : [vtkusers] Bug with vtkStructuredPoints when alloctaing scalars
Amy Squillacote
amy.squillacote at kitware.com
Fri Jul 7 09:00:19 EDT 2006
Is it possible that you are running out of memory when you try to
allocate the scalars? What are the dimensions of the vtkStructuredPoints
dataset when AllocateScalars() does not allocate memory?
- Amy
Mohamed Ben Reguiga wrote:
> hello,
> thank you for the answer but I still have the same bug!
> is it possible, at least , to know if the Allocation was done or not?
> the allocateScalrs() function is a void return function so how can I
> be advised if the allocation is ok or not?
>
> thank you for your help!
>
> ----- Message transféré ----
> De : Gabriel Kiss <gg1977 at gmail.com>
> À : Mohamed Ben Reguiga <breguiga_mh at yahoo.fr>
> Envoyé le : Vendredi, 7 Juillet 2006, 1h18mn 43s
> Objet : Re: [vtkusers] Bug with vtkStructuredPoints when alloctaing
> scalars
>
> Hi,
>
> Does it help if you add also:
>
> data2->SetNumberOfScalarComponents(1);
>
> gg
>
> On 7/6/06, *Mohamed Ben Reguiga* < breguiga_mh at yahoo.fr
> <mailto:breguiga_mh at yahoo.fr>> wrote:
>
> hello all,
> I 'm using VTK for 3D reconstitution , MPR and MIP (maximum
> intesity projection).
> for the constitution of the volume of all the pixmaps of the
> images I use a vtkStructuredPoints object :
> data2=vtkStructuredPoints::New();
> data2->SetDimensions(WdthVlm,HghtVlm,DpthVlm);
> data2->SetSpacing (wdgMPR->xsp, wdgMPR->ysp, wdgMPR->zsp);
> data2->SetScalarType(VTK_UNSIGNED_SHORT);
> data2->AllocateScalars();
>
> after thar I recover the scalarpointer to fill the volume by the
> data that i own :
>
> unsigned short * ptr2=(unsigned short *) data2->GetScalarPointer();
>
> for (cptdcm=0;cptdcm<DpthVlm;cptdcm++)
> {
> for(int i=0;i<HghtVlm;i++)
> {
> for(int j=0; j<WdthVlm;j++)
> {
> *(ptr2++) = *(myDataImages++); //myDataImages is a
> unsigned short pointer of course
> }
> }
> }
>
> then I use the vtkStructuredPoints object like an input for the
> vtkImageMapToColors that I use (3 : 1 for each plane X, Y and Z).
>
> every thing goes allright but sometimes something wrong happens
> and I don't know why :
> 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 !!!!!!!
>
> 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!
> it's really an emergency!
> thank you for your help !
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> <http://www.vtk.org/mailman/listinfo/vtkusers>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list