[Insight-developers] SpatialObjects

Miller, James V (Research) millerjv at crd . ge . com
Thu, 30 Oct 2003 16:07:39 -0500


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C39F29.DA0168FF
Content-Type: text/plain;
	charset="iso-8859-1"

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:

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?
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.
3.	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 
_____________________________________
Visualization & Computer Vision
GE Research
Bldg. KW, Room C218B
P.O. Box 8, Schenectady NY 12301

millerjv at research . ge . com <mailto:millerjv at research . ge . com> 

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

 

------_=_NextPart_001_01C39F29.DA0168FF
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 6.00.2800.1264" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=904412920-30102003><FONT size=2>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.&nbsp; To create 
a label map, I figured I run my spatial object through the 
SpatialObjectToImageFilter and dump the images with 
ImageSeriesWriter.</FONT></SPAN></DIV>
<DIV><SPAN class=904412920-30102003><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=904412920-30102003><FONT size=2>First a set of observations on 
SpatialObjects:</FONT></SPAN></DIV>
<OL>
  <LI><SPAN class=904412920-30102003><FONT size=2>Children of a SpatialObject 
  are stored in an std::list of raw pointers to other SpatialObjects.&nbsp; 
  Should this be&nbsp;an std::list of SmartPointers to other 
  SpatialObjects?</FONT></SPAN></LI>
  <LI><SPAN class=904412920-30102003><FONT size=2>LineSpatialObject::SetPoints() 
  takes a list of LineSpatialObjectPoint whereas 
  PolygonSpatialObject::SetPoints() and LandmarkSpatialObject::SetPoints() take 
  lists of SpatialObjectPoint.&nbsp; It looks like LineSpatialObjectPoints have 
  a vector associated with them.&nbsp; 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.</FONT></SPAN></LI>
  <LI><SPAN class=904412920-30102003><FONT size=2>PolygonSpatialObject has a 
  method AddPoint() but LandmarkSpatialObject and LineSpatialObject do 
  not.</FONT></SPAN></LI></OL>
<DIV><SPAN class=904412920-30102003><FONT size=2>Now for issues related to my 
current task:</FONT></SPAN></DIV>
<DIV><SPAN class=904412920-30102003><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=904412920-30102003><FONT size=2>From my DICOM RTSS file I have 
a set of contours, perhaps with multiple contours per slice.&nbsp; I assumed 
that if I set up the spacing, origin, and size for the 
SpatialObjectToImageFilter properly, the slices for the output&nbsp;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.</FONT></SPAN></DIV>
<DIV><SPAN class=904412920-30102003><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=904412920-30102003><FONT size=2>The main problem I have, 
however, is that SpatialObjectToImageFilter walks the output image and 
calls&nbsp;ValueAt() on the spatial object to determine whether it is inside or 
outside object.&nbsp; For a polygon, ValueAt() ignores one of the dimensions of 
the point being evaluated (afterall polygons are 2D).&nbsp; The result is that 
every image in my output volume is identical (the union of all my polygons 
ignoring the Z coordinates).</FONT></SPAN></DIV>
<DIV><SPAN class=904412920-30102003><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=904412920-30102003><FONT size=2>So... is this what I should 
have expected?&nbsp; Should a polygon's ValueAt method take into account the 
third dimension of the query point?&nbsp; 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.</FONT></SPAN></DIV>
<DIV><SPAN class=904412920-30102003><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=904412920-30102003><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=904412920-30102003><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV>
<P style="MARGIN: 0in 0in 0pt"><B><SPAN 
style="COLOR: navy; FONT-FAMILY: 'Comic Sans MS'">Jim Miller</SPAN></B> 
<BR><B><I><SPAN 
style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: Arial">_____________________________________</SPAN></I></B><BR><EM><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">Visualization &amp; 
Computer Vision</SPAN></EM><I><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial"><BR><EM>GE 
Research</EM><BR><EM>Bldg. KW, Room C218B</EM><BR><EM>P.O. Box 8, Schenectady NY 
12301</EM><BR><BR></SPAN></I><EM><U><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: blue"><A 
href="mailto:millerjv at research . ge . com">millerjv at research . ge . com</A></SPAN></U></EM></P>
<P style="MARGIN: 0in 0in 0pt"><EM><U><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: blue">james . miller at research . ge . com</SPAN></U></EM><BR><I><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">(518) 387-4005, Dial 
Comm: 8*833-4005, </SPAN></I><BR><I><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">Cell: (518) 505-7065, 
Fax: (518) 387-6981</SPAN></I> </P></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------_=_NextPart_001_01C39F29.DA0168FF--