[Insight-developers] mesh data structure problem.
Luis Ibanez
ibanez@cs.unc.edu
Wed, 28 Feb 2001 20:41:12 -0500 (EST)
Hi Ting,
my mistake, I should have said:
point.Value() = p;
for the iterator,
intead of :
point.Value( p )
In any case, that will only help you
with the speed of access.
I think that the real problem in you
code could be the allocation.
Did you add a line like:
GetPoints()->Reserve( 1000 );
before starting to get access to the
points ?
This line will allocate a number of
points (1000 in this case ) for you.
Hope that helps,
Luis
----------------------------------------
On Wed, 28 Feb 2001, Ting Chen wrote:
> but point.value take no parameter and just return the value stored at the
> location, any other suggestion?
>
> >
> >PointsContainerPointer myPoints = GetPoints();
> >PointsContainer::Iterator point = myPoints->Begin();
> >PointType p;
> >p = 0,0,0;
> >while( point != myPoints->End() )
> >{
> > point.Value( p );
> > ++point;
> >}
> >
> >
> >
> >Luis
> >
> >
> >-----------------------------------------------------------------------
> >
> >Ting Chen wrote:
> >
> >> I write the following code in my itkDeformableMesh class:
> >>
> >> ....
> >> float ds[3], d[3]={0, 0, 0};
> >> SetPoint(1, (PointType)d);
> >> GetPoint(1, (PointType*)ds);
> >> ....
> >>
> >> but I found out that ds={-1.074e+008, 0, 0} after the operation.
> >>
> >> if I do
> >> ....
> >> float ds[3], d[3]={0, 0, 0};
> >> SetPoint(0, (PointType)d);
> >> GetPoint(0, (PointType*)ds);
> >> ....
> >>
> >> ds = {-1.074e+008, -1.074e+008, -1.074e+008}
> >>
> >> it seems the first element in the container has problems here. what is
> the
> >> problem here?
> >> thanks
> >> ting
> >>
> >> _______________________________________________
> >> Insight-developers mailing list
> >> Insight-developers@public.kitware.com
> >> http://public.kitware.com/mailman/listinfo/insight-developers
> >
> >--
> >______________________________________________________________________
> >
> >Luis Ibanez
> >Research Assistant Professor - Division of Neurosurgery
> >University of North Carolina at Chapel Hill
> >CB# 7060, Chapel Hill, NC 27599
> >email : ibanez@cs.unc.edu home : http://www.cs.unc.edu/~ibanez
> >phone : (919)-843-9961 fax : (919)-966-6627
> >______________________________________________________________________
>
>
--
-----------------------------------------------------------
Luis Ibanez
Research Assistant Professor - Division of NeuroSurgery
University of North Carolina at Chapel Hill
Chapel Hill, NC, 27599 http://www.cs.unc.edu/~ibanez
------------------------------------------------------------