Dear Dan,<br><br>Thank you very much for your timely reply.<br>The information is very helpful and is what I am looking for regarding the conversion to contours.<br><br>It's nice to know that DICOM is going to support a new segmentation module :-)<br>
<br>Thank you.<br><br>Warm Regards,<br>Subrahmanyam Gorthi.<br><br>EPFL-STI-LTS5<br>Station 11<br>CH - 1015 Lausanne<br>Switzerland.<br><br><br><br><div class="gmail_quote">On Thu, Jul 3, 2008 at 6:59 AM, Dan Mueller <<a href="mailto:dan.muel@gmail.com">dan.muel@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Subrahmanyam,<br>
<br>
2008/7/2 Subrahmanyam Gorthi <<a href="mailto:subrahmanyam.gorthi@gmail.com">subrahmanyam.gorthi@gmail.com</a>>:<br>
<div class="Ih2E3d">> Currently, at the end of my segmentation in ITK, I have ROIs in mask format.<br>
> I still have to work on converting this mask to a polygon so that in can be<br>
> written to a ROI module.<br>
> Because of my little exposure to ITK, I am not aware whether this conversion<br>
> involves Mesh or Meta Objects.<br>
<br>
</div>From my understanding, RTSTRUCTs are an array of contours; therefore,<br>
you will need a mechanism to convert your ITK mesh to a set of<br>
contours. Unfortunately, I don't think such an algorithm exists in ITK<br>
(yet), so you will have to write one yourself. It's not too difficult<br>
given a starting mesh:<br>
// Find intersecting points<br>
foreach plane intersecting mesh<br>
foreach edge in mesh<br>
determine if plane intersects edge, record intersection<br>
end<br>
end<br>
// Order intersection points into closed contour<br>
get random starting face with intersection<br>
while more intersections<br>
for current face, add intersection to contour<br>
current face = adjacent face sharing same intersection as<br>
current face<br>
end<br>
<br>
On a side note, DICOM is about to be extended to support meshes proper<br>
via the "Surface Segmentation" module:<br>
<a href="ftp://medical.nema.org/medical/dicom/supps/sup132_lb.pdf" target="_blank">ftp://medical.nema.org/medical/dicom/supps/sup132_lb.pdf</a><br>
If you really need to use RTSTRUCTs right now, too bad. Otherwise the<br>
surface segmentation module seems much more flexible...<br>
<br>
HTH<br>
<br>
Regards, Dan<br>
<div><div></div><div class="Wj3C7c"><br>
> On Wed, Jul 2, 2008 at 12:03 PM, Mathieu Malaterre<br>
> <<a href="mailto:mathieu.malaterre@gmail.com">mathieu.malaterre@gmail.com</a>> wrote:<br>
>><br>
>> Subrahmanyam,<br>
>><br>
>> On Wed, Jul 2, 2008 at 11:30 AM, Subrahmanyam Gorthi<br>
>> <<a href="mailto:subrahmanyam.gorthi@gmail.com">subrahmanyam.gorthi@gmail.com</a>> wrote:<br>
>> > Dear Mathieu,<br>
>> ><br>
>> > Many THANKS for your detailed & prompt reply.<br>
>> ><br>
>> > Here is what I am actually trying to implement in ITK:<br>
>> ><br>
>> > Using a segmentation algorithm in ITK, I obtained the coordinates for<br>
>> > 3-D<br>
>> > ROI of a patient's image .<br>
>> > I am now trying to export these results into a "DICOM-RT Structure-Set"<br>
>> > file, for RT-Planning in IMRT.<br>
>><br>
>> *Very* cool ! Is this integrated with any of the Mesh and/or the Meta<br>
>> Object in ITK too ?<br>
>><br>
>> > In addition to ROI module, as the DICOM-RT structure-set file has to<br>
>> > contain<br>
>> > other<br>
>> > mandatory modules like patient-module, study module etc.,<br>
>> > I am trying to selectively copy those modules from the associated<br>
>> > patient's<br>
>> > 3-D CT image.<br>
>><br>
>> Ah, I see why the UID can remains the same here. You did not modify the<br>
>> image :)<br>
>><br>
>> > I compared the tags of structure-set file that I am creating in ITK with<br>
>> > the file generated by another software that<br>
>> > a Physician here is using in his hospital;<br>
>> > he was manually drawing the contours on the CT image and the<br>
>> > corresponding<br>
>> > DICOM-RT structure-set file is generated by the software.<br>
>><br>
>> ok<br>
>><br>
>> > I observed that for the "structure-set" file generated by that software,<br>
>> > "study-instance UID" tag is same as that of the<br>
>> > other 3-D CT DICOM images and hence, I am trying to do the same for the<br>
>> > file<br>
>> > created through ITK.<br>
>><br>
>> Yup, in this very special case, then you are even encouraged to keep<br>
>> the same UID :)<br>
>><br>
>> > From your reply, I understand the importance safety issues in changing<br>
>> > the<br>
>> > default behavior.<br>
>> > I would like to know:<br>
>> > 1. Is it possible to change the default behavior for ONLY selected UIDs<br>
>> > that<br>
>> > are specified by the user?, and how?<br>
>><br>
>> I am not sure I understand that. but I guess you can do the in your<br>
>> code (application level):<br>
>><br>
>> if( currentuid match [set of known uids] )<br>
>> GDCMImageIO->KeepOriginalUIDOn ()<br>
>><br>
>> > 2. I want to finally contribute this code to ITK.<br>
>><br>
>> Even better !<br>
>><br>
>> > It would be very happy to know and most probably, implement any better<br>
>> > ways<br>
>> > or modifications to the current approach.<br>
>> > Your suggestions in this regard will be of great help to me.<br>
>><br>
>> IMHO ITK is clearly lacking support for RTSTRUCT object, so any kind<br>
>> of contribution would be AFAIK very welcome. For instance in a newer<br>
>> release of GDCM, we have now integrated RTSTRUCT object nicely in VTK:<br>
>><br>
>> See:<br>
>> <a href="http://gdcm.sourceforge.net/html/classvtkGDCMPolyDataReader.html" target="_blank">http://gdcm.sourceforge.net/html/classvtkGDCMPolyDataReader.html</a><br>
>><br>
>> Thus RTSTRUCT now appears as a set of vtkPolyData which is the base<br>
>> object for 2D unstructred data in VTK.<br>
>> I would think that a similar approach can (should?) be taken for ITK.<br>
>> You would need to implement a itk::somethingIO that will read RTSTRUCT<br>
>> and then convert it to either a itk::Mesh/itkQEMesh or SpatialObject<br>
>> and convert back to file. This would be IMHO the most flexible for<br>
>> people.<br>
>><br>
>> And thus you pipeline would become:<br>
>><br>
>> 1. GDCMImageIO read (filename)<br>
>> 2. Segmentation<br>
>> 3. RTSTRUCT_IO write ouput_filename<br>
>><br>
>> does this make sense ?<br>
>><br>
>> Regards,<br>
>> --<br>
>> Mathieu<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Insight-users mailing list<br>
> <a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br>
> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
><br>
><br>
</blockquote></div><br>