<div dir="ltr">This is exactly what I am trying to do.<br><br>But I get memory errors when ever I try to call GetNumberOfItems(). (I am using the same part of code in vtkGDCMPolyDAtaReader).<br><br>Do you mean I can use vtkGDCMPolyDataReader and get it&#39;s output and pass it through  ImageStencil.<br>
<br>Thanks<br><br>Jothy<br><br><div class="gmail_quote">On Wed, Mar 9, 2011 at 5:59 PM, Mark Roden <span dir="ltr">&lt;<a href="mailto:mmroden@gmail.com">mmroden@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Jothy,<br>
<br>
You should probably then pipeline the polydata into vtk marching<br>
cubes, rather than try to rewrite the gdcm reader.<br>
<br>
Such a pipeline would look like:<br>
<br>
polydatareader<br>
polydata to image stencil (produces a binary mask from the contours)<br>
vtkMarchingCubes (volume from the binary mask)<br>
<br>
You could put the creation of the binary mask into gdcm, but vtk is<br>
much better suited for this kind of approach.<br>
<font color="#888888"><br>
Mark<br>
</font><div><div></div><div class="h5"><br>
On Wed, Mar 9, 2011 at 9:14 AM, Jothy &lt;<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt; wrote:<br>
&gt; Yes, but I want to create my own code so that I can create a mesh with<br>
&gt; vtkMarchingCubes.<br>
&gt;<br>
&gt; But, the same code works well for python (the one I posted earlier.<br>
&gt;<br>
&gt;<br>
&gt; Thank you<br>
&gt;<br>
&gt; Jothy<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Mar 9, 2011 at 5:07 PM, Mark Roden &lt;<a href="mailto:mmroden@gmail.com">mmroden@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi Jothy,<br>
&gt;&gt;<br>
&gt;&gt; Have you looked at the code for the vtkGDCMPolyDataReader class?  That<br>
&gt;&gt; code parses an rtstruct into vtk polydata objects.<br>
&gt;&gt;<br>
&gt;&gt; Mark<br>
&gt;&gt;<br>
&gt;&gt; On Wed, Mar 9, 2011 at 8:50 AM, Jothy &lt;<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt; Hi all,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I am trying to read a rt structure file. Butm when the program crashes<br>
&gt;&gt; &gt; on<br>
&gt;&gt; &gt; GetNumberOfItems().<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; here is the code<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;       gdcm::Reader reader;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     reader.SetFileName(this-&gt;structFileName.toStdString().data());<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     //show error msg if file can&#39;t be read.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     if( !reader.Read() )<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;         {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;         QMessageBox msgBox;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;         msgBox.setText(&quot;Can not read the file!&quot;);<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;         msgBox.setIcon(QMessageBox::Critical);<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;         msgBox.exec();<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;         }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     reader.Read();<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     gdcm::File &amp;file = reader.GetFile();<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     // the dataset is the the set of element we are interested in:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     gdcm::DataSet &amp;ds = file.GetDataSet();<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     gdcm::Tag troicsq (0x3006,0x0020); // Structure set ROI sequence tag<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     gdcm::DataElement de=ds.GetDataElement(troicsq);<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     gdcm::SequenceOfItems* roicsq=de.GetSequenceOfItems();<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     qDebug()&lt;&lt;roicsq.GetNumberOfItems();<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; It says - request for member &quot;GetNumberOfItems&quot; in &quot;roicsq&quot; ,which is of<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; non-class type gdcm::SequenceOfItems*.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Any hints, what&#39;s wrong here?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thank you<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Jothy<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ------------------------------------------------------------------------------<br>
&gt;&gt; &gt; Colocation vs. Managed Hosting<br>
&gt;&gt; &gt; A question and answer guide to determining the best fit<br>
&gt;&gt; &gt; for your organization - today and in the future.<br>
&gt;&gt; &gt; <a href="http://p.sf.net/sfu/internap-sfd2d" target="_blank">http://p.sf.net/sfu/internap-sfd2d</a><br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; Gdcm-developers mailing list<br>
&gt;&gt; &gt; <a href="mailto:Gdcm-developers@lists.sourceforge.net">Gdcm-developers@lists.sourceforge.net</a><br>
&gt;&gt; &gt; <a href="https://lists.sourceforge.net/lists/listinfo/gdcm-developers" target="_blank">https://lists.sourceforge.net/lists/listinfo/gdcm-developers</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div>