[Insight-developers] SpatialObjects
Julien Jomier
jjomier at cs . unc . edu
Fri, 31 Oct 2003 10:38:42 -0500
Hi Jim,
I see the issue. Can we just create a function AddPoint(float* =
Position)?
Yes, a LineSpatialObject is a polyline (Should we rename it?)
A LineSpatialObject has N-1 normals as well as TubeSpatialObject. A
SurfaceSpatialObject has only 1 normal.
Julien
-----Original Message-----
From: insight-developers-admin at itk . org
[mailto:insight-developers-admin at itk . org] On Behalf Of Miller, James V
(Research)
Sent: Friday, October 31, 2003 10:21 AM
To: 'Julien Jomier'; 'Insight-developers (E-mail)'
Subject: RE: [Insight-developers] SpatialObjects
The issue was not in querying a point after the object was created. The
issue was in creating the spatial objects. I want to use one block of =
code
to read the points from a file and then pass those points to appropriate
type of spatial object. But different types of spatial objects use
different types of points. So you have to "duplicate" the code to build
your point lists since a different type of list is needed for each =
spatial
object type. One solution may be to allow a line spatial object to =
accept
points without normals as well as points with normals.
Why does a line have N-1 normals? Is this really a polyline with N =
points
(and hence N-1 segments)? Why does a line need a normal but other =
spatial
objects do not?
> 2) LineSpatialObject::SetPoints() takes a list of =
LineSpatialObjectPoint
whereas
> PolygonSpatialObject::SetPoints() and =
LandmarkSpatialObject::SetPoints()
take lists of
> SpatialObjectPoint. It looks like LineSpatialObjectPoints have a =
vector
associated with them.
> This meant I had to duplicate code to read landmarks, lines, and =
polygons
since I couldn't read
> the points into a common data structure and then decide whether to it =
is a
line, polygon, or
> landmark.
A LineSpatialObjectPoint has N-1 normals associated with it.
A LineSpatialObjectPoint derives from SpatialObjectPoint so you =
shouldn't
have to duplicate code when you are asking for the position of the point
only.