<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'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"><<a href="mailto:mmroden@gmail.com">mmroden@gmail.com</a>></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 <<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>> wrote:<br>
> Yes, but I want to create my own code so that I can create a mesh with<br>
> vtkMarchingCubes.<br>
><br>
> But, the same code works well for python (the one I posted earlier.<br>
><br>
><br>
> Thank you<br>
><br>
> Jothy<br>
><br>
><br>
> On Wed, Mar 9, 2011 at 5:07 PM, Mark Roden <<a href="mailto:mmroden@gmail.com">mmroden@gmail.com</a>> wrote:<br>
>><br>
>> Hi Jothy,<br>
>><br>
>> Have you looked at the code for the vtkGDCMPolyDataReader class? That<br>
>> code parses an rtstruct into vtk polydata objects.<br>
>><br>
>> Mark<br>
>><br>
>> On Wed, Mar 9, 2011 at 8:50 AM, Jothy <<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>> wrote:<br>
>> > Hi all,<br>
>> ><br>
>> > I am trying to read a rt structure file. Butm when the program crashes<br>
>> > on<br>
>> > GetNumberOfItems().<br>
>> ><br>
>> > here is the code<br>
>> ><br>
>> > gdcm::Reader reader;<br>
>> ><br>
>> > reader.SetFileName(this->structFileName.toStdString().data());<br>
>> ><br>
>> > //show error msg if file can't be read.<br>
>> ><br>
>> > if( !reader.Read() )<br>
>> ><br>
>> > {<br>
>> ><br>
>> > QMessageBox msgBox;<br>
>> ><br>
>> > msgBox.setText("Can not read the file!");<br>
>> ><br>
>> > msgBox.setIcon(QMessageBox::Critical);<br>
>> ><br>
>> > msgBox.exec();<br>
>> ><br>
>> > }<br>
>> ><br>
>> > reader.Read();<br>
>> ><br>
>> > gdcm::File &file = reader.GetFile();<br>
>> ><br>
>> > // the dataset is the the set of element we are interested in:<br>
>> ><br>
>> > gdcm::DataSet &ds = file.GetDataSet();<br>
>> ><br>
>> > gdcm::Tag troicsq (0x3006,0x0020); // Structure set ROI sequence tag<br>
>> ><br>
>> > gdcm::DataElement de=ds.GetDataElement(troicsq);<br>
>> ><br>
>> > gdcm::SequenceOfItems* roicsq=de.GetSequenceOfItems();<br>
>> ><br>
>> > qDebug()<<roicsq.GetNumberOfItems();<br>
>> ><br>
>> > It says - request for member "GetNumberOfItems" in "roicsq" ,which is of<br>
>> ><br>
>> > non-class type gdcm::SequenceOfItems*.<br>
>> ><br>
>> > Any hints, what's wrong here?<br>
>> ><br>
>> > Thank you<br>
>> ><br>
>> ><br>
>> > Jothy<br>
>> ><br>
>> ><br>
>> ><br>
>> > ------------------------------------------------------------------------------<br>
>> > Colocation vs. Managed Hosting<br>
>> > A question and answer guide to determining the best fit<br>
>> > for your organization - today and in the future.<br>
>> > <a href="http://p.sf.net/sfu/internap-sfd2d" target="_blank">http://p.sf.net/sfu/internap-sfd2d</a><br>
>> > _______________________________________________<br>
>> > Gdcm-developers mailing list<br>
>> > <a href="mailto:Gdcm-developers@lists.sourceforge.net">Gdcm-developers@lists.sourceforge.net</a><br>
>> > <a href="https://lists.sourceforge.net/lists/listinfo/gdcm-developers" target="_blank">https://lists.sourceforge.net/lists/listinfo/gdcm-developers</a><br>
>> ><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br></div>