Dear Mathieu,<br><br>Thank you very much for your reply.<br><br>&gt;&gt; Is this integrated with any of the Mesh and/or the Meta Object in ITK too ?<br><br>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 written to a ROI module.<br>Because of my little exposure to ITK, I am not aware whether this conversion involves Mesh or Meta Objects.<br><br>I am facing problem while calling the KeepOriginalUIDOn ().<br>
A runtime exception is thrown when the above function is called.<br>I am afraid there is some error in the way I am using the ImageFileWriter, since the error is occurring while updating the writer.<br>To reproduce the problem, I have created a sample code.<br>
Please find attached the .cxx &amp; the associated CMakeLists.txt files.<br>Can you please help me?<br><br>Thank you for the details on the possible pipeline for the RTSTRUCT, which is more flexible and general.<br>I will give a try part by part. <br>
<br>Many thanks for your help.<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><br><br><br><div class="gmail_quote">On Wed, Jul 2, 2008 at 12:03 PM, Mathieu Malaterre &lt;<a href="mailto:mathieu.malaterre@gmail.com" target="_blank">mathieu.malaterre@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Subrahmanyam,<br>
<br>
On Wed, Jul 2, 2008 at 11:30 AM, Subrahmanyam Gorthi<br>
<div>&lt;<a href="mailto:subrahmanyam.gorthi@gmail.com" target="_blank">subrahmanyam.gorthi@gmail.com</a>&gt; wrote:<br>
</div><div>&gt; Dear Mathieu,<br>
&gt;<br>
&gt; Many THANKS for your detailed &amp; prompt reply.<br>
&gt;<br>
&gt; Here is what I am actually trying to implement in ITK:<br>
&gt;<br>
&gt; Using a segmentation algorithm in ITK, I obtained the coordinates for 3-D<br>
&gt; ROI of a patient&#39;s image .<br>
&gt; I am now trying to export these results into a &quot;DICOM-RT Structure-Set&quot;<br>
&gt; file, for RT-Planning in IMRT.<br>
<br>
</div>*Very* cool ! Is this integrated with any of the Mesh and/or the Meta<br>
Object in ITK too ?<br>
<div><br>
&gt; In addition to ROI module, as the DICOM-RT structure-set file has to contain<br>
&gt; other<br>
&gt; mandatory modules like patient-module, study module etc.,<br>
&gt; I am trying to selectively copy those modules from the associated patient&#39;s<br>
&gt; 3-D CT image.<br>
<br>
</div>Ah, I see why the UID can remains the same here. You did not modify the image :)<br>
<div><br>
&gt; I compared the tags of structure-set file that I am creating in ITK with<br>
&gt; the &nbsp;file generated by another software that<br>
&gt; a Physician here is using in his hospital;<br>
&gt; he was manually drawing the contours on the CT image and the corresponding<br>
&gt; DICOM-RT structure-set file is generated by the software.<br>
<br>
</div>ok<br>
<div><br>
&gt; I observed that for the &quot;structure-set&quot; file generated by that software,<br>
&gt; &quot;study-instance UID&quot; tag is same as that of the<br>
&gt; other 3-D CT DICOM images and hence, I am trying to do the same for the file<br>
&gt; created through ITK.<br>
<br>
</div>Yup, in this very special case, then you are even encouraged to keep<br>
the same UID :)<br>
<div><br>
&gt; From your reply, I understand the importance safety issues in &nbsp;changing the<br>
&gt; default behavior.<br>
&gt; I would like to know:<br>
&gt; 1. Is it possible to change the default behavior for ONLY selected UIDs that<br>
&gt; are specified by the user?, and how?<br>
<br>
</div>I am not sure I understand that. but I guess you can do the in your<br>
code (application level):<br>
<br>
 &nbsp;if( currentuid match [set of known uids] )<br>
 &nbsp; &nbsp;GDCMImageIO-&gt;KeepOriginalUIDOn ()<br>
<div><br>
&gt; 2. I want to finally contribute this code to ITK.<br>
<br>
</div>Even better !<br>
<div><br>
&gt; It would be very happy to know and most probably, implement any better ways<br>
&gt; or modifications to the current approach.<br>
&gt; Your suggestions in this regard will be of great help to me.<br>
<br>
</div>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>
 &nbsp;<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>
<font color="#888888">Mathieu<br>
</font></blockquote></div><br>