[Insight-developers] SpatialObjects

Julien Jomier jjomier at cs . unc . edu
Thu, 30 Oct 2003 18:32:52 -0500


Hi Jim,

> 1) Children of a SpatialObject are stored in an std::list of raw =
pointers
to other
> SpatialObjects.  Should this be an std::list of SmartPointers to other
SpatialObjects?=20

That's a good point. I'll take a look at it. Can you add a bug and =
assign it
to me?

> 2) LineSpatialObject::SetPoints() takes a list of =
LineSpatialObjectPoint
whereas=20
> PolygonSpatialObject::SetPoints() and =
LandmarkSpatialObject::SetPoints()
take lists of
> SpatialObjectPoint.  It looks like LineSpatialObjectPoints have a =
vector
associated with them.=20
> 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.=20

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.

> 3) PolygonSpatialObject has a method AddPoint() but =
LandmarkSpatialObject
and LineSpatialObject > do not.

That's a good function to add. Feel free to add the function otherwise =
you
can add a bug in the bugtracker and assign it to me. I'll be happy to =
add
these functions.

Regarding the ValueAt() function for PolygonSpatialObject, I didn't
implement the class so I don't have a good answer for the moment.

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: Thursday, October 30, 2003 4:08 PM
To: Insight-developers (E-mail)
Subject: [Insight-developers] SpatialObjects


I am converting a series of DICOM RTSS contours into label maps. I wrote =
an
RTSS reader parses the contours from the DICOM file and creates a set of
PolygonSpatialObjects.  To create a label map, I figured I run my =
spatial
object through the SpatialObjectToImageFilter and dump the images with
ImageSeriesWriter.

First a set of observations on SpatialObjects:
Children of a SpatialObject are stored in an std::list of raw pointers =
to
other SpatialObjects.  Should this be an std::list of SmartPointers to =
other
SpatialObjects?=20
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.=20
PolygonSpatialObject has a method AddPoint() but LandmarkSpatialObject =
and
LineSpatialObject do not.
Now for issues related to my current task:

>From my DICOM RTSS file I have a set of contours, perhaps with multiple
contours per slice.  I assumed that if I set up the spacing, origin, and
size for the SpatialObjectToImageFilter properly, the slices for the =
output
volume would align with the Z positions of my contours (all the contours
were drawn on axial slices). It has been tricky to get the spacing, =
origin,
and size set properly since I am not quite sure whether the points on my
RTSS contours are in mm or pixels.

The main problem I have, however, is that SpatialObjectToImageFilter =
walks
the output image and calls ValueAt() on the spatial object to determine
whether it is inside or outside object.  For a polygon, ValueAt() =
ignores
one of the dimensions of the point being evaluated (afterall polygons =
are
2D).  The result is that every image in my output volume is identical =
(the
union of all my polygons ignoring the Z coordinates).

So... is this what I should have expected?  Should a polygon's ValueAt
method take into account the third dimension of the query point?  Should =
the
PolygonSpatialObject take into account "thickness" when evaluating =
ValueAt?
This doesn't really help me since I don't know the thickess when I read =
the
RTSS file but I might be able to work around it.




Jim Miller=20
_____________________________________
Visualization & Computer Vision
GE Research
Bldg. KW, Room C218B
P.O. Box 8, Schenectady NY 12301

millerjv at research . ge . com
james . miller at research . ge . com
(518) 387-4005, Dial Comm: 8*833-4005,=20
Cell: (518) 505-7065, Fax: (518) 387-6981=20