[Insight-users] question for using pointset

Luis Ibanez luis.ibanez@kitware.com
Fri, 21 Mar 2003 18:08:34 -0500


Hi Sean,


1) Yes, you have to call Reserve()

    The reason is that the points are being stored in
    an itk::VectorContainer, which is a wrapper to a
    std::vector.

    Access to points is done using the [] operator,
    so the allocation must be done before trying to
    access the elements of the container.

2) GetNumberOfPoints() returns the number of points you
    Reserved. It is assumed that you set all those points
    to valid values.



---

The PointeSet class is described in detail in
the SoftwareGuide

     http://www.itk.org/ItkSoftwareGuide.pdf

Section 4.2, pdf-pages 57 to 67.


Please let us know if you have further questions.


Thanks


Luis


----------------------------------------



Zhiyong Xie wrote:
> I have a question for using class PointSet to define Landmarks.
> In code "itkSplineKernelTransformTest.cxx", function "Reserve()"
> was used to reserve the memory. Is it necessary to allocate the
> memory?
> Another related question is for the function of "GetNumberOfPoints()",
> is the number it returns the actual number of points I added, or the
> number I used in "Reserve()"?
> 
> Thanks
> 
> Sean
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>