[vtkusers] [Gdcm2] Problem reading RT struct file

Bill Lorensen bill.lorensen at gmail.com
Wed Mar 9 13:06:36 EST 2011


If the image data is a binary image, you should use
vtkDiscreteMarchingCubes rather than vtkMarchingCubes.

Bill


On Wed, Mar 9, 2011 at 12:59 PM, Mark Roden <mmroden at gmail.com> wrote:
> Hi Jothy,
>
> You should probably then pipeline the polydata into vtk marching
> cubes, rather than try to rewrite the gdcm reader.
>
> Such a pipeline would look like:
>
> polydatareader
> polydata to image stencil (produces a binary mask from the contours)
> vtkMarchingCubes (volume from the binary mask)
>
> You could put the creation of the binary mask into gdcm, but vtk is
> much better suited for this kind of approach.
>
> Mark
>
> On Wed, Mar 9, 2011 at 9:14 AM, Jothy <jothybasu at gmail.com> wrote:
>> Yes, but I want to create my own code so that I can create a mesh with
>> vtkMarchingCubes.
>>
>> But, the same code works well for python (the one I posted earlier.
>>
>>
>> Thank you
>>
>> Jothy
>>
>>
>> On Wed, Mar 9, 2011 at 5:07 PM, Mark Roden <mmroden at gmail.com> wrote:
>>>
>>> Hi Jothy,
>>>
>>> Have you looked at the code for the vtkGDCMPolyDataReader class?  That
>>> code parses an rtstruct into vtk polydata objects.
>>>
>>> Mark
>>>
>>> On Wed, Mar 9, 2011 at 8:50 AM, Jothy <jothybasu at gmail.com> wrote:
>>> > Hi all,
>>> >
>>> > I am trying to read a rt structure file. Butm when the program crashes
>>> > on
>>> > GetNumberOfItems().
>>> >
>>> > here is the code
>>> >
>>> >       gdcm::Reader reader;
>>> >
>>> >     reader.SetFileName(this->structFileName.toStdString().data());
>>> >
>>> >     //show error msg if file can't be read.
>>> >
>>> >     if( !reader.Read() )
>>> >
>>> >         {
>>> >
>>> >         QMessageBox msgBox;
>>> >
>>> >         msgBox.setText("Can not read the file!");
>>> >
>>> >         msgBox.setIcon(QMessageBox::Critical);
>>> >
>>> >         msgBox.exec();
>>> >
>>> >         }
>>> >
>>> >     reader.Read();
>>> >
>>> >     gdcm::File &file = reader.GetFile();
>>> >
>>> >     // the dataset is the the set of element we are interested in:
>>> >
>>> >     gdcm::DataSet &ds = file.GetDataSet();
>>> >
>>> >     gdcm::Tag troicsq (0x3006,0x0020); // Structure set ROI sequence tag
>>> >
>>> >     gdcm::DataElement de=ds.GetDataElement(troicsq);
>>> >
>>> >     gdcm::SequenceOfItems* roicsq=de.GetSequenceOfItems();
>>> >
>>> >     qDebug()<<roicsq.GetNumberOfItems();
>>> >
>>> > It says - request for member "GetNumberOfItems" in "roicsq" ,which is of
>>> >
>>> > non-class type gdcm::SequenceOfItems*.
>>> >
>>> > Any hints, what's wrong here?
>>> >
>>> > Thank you
>>> >
>>> >
>>> > Jothy
>>> >
>>> >
>>> >
>>> > ------------------------------------------------------------------------------
>>> > Colocation vs. Managed Hosting
>>> > A question and answer guide to determining the best fit
>>> > for your organization - today and in the future.
>>> > http://p.sf.net/sfu/internap-sfd2d
>>> > _______________________________________________
>>> > Gdcm-developers mailing list
>>> > Gdcm-developers at lists.sourceforge.net
>>> > https://lists.sourceforge.net/lists/listinfo/gdcm-developers
>>> >
>>> >
>>
>>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list