[vtkusers] [Gdcm2] Problem reading RT struct file

Mark Roden mmroden at gmail.com
Wed Mar 9 13:10:14 EST 2011


But if that's what you're trying to do, then don't do it at that
level-- that's what I'm trying to say.  Do it at the level of VTK,
once you already have the vtkPolyData from the reader.

Yes, you can create binary data into a vtkImageData (generally made by
making a blank that's the same size as the CT/MR image from which your
RTStruct was created) using the ImageStencil.

Mark

On Wed, Mar 9, 2011 at 10:05 AM, Jothy <jothybasu at gmail.com> wrote:
> This is exactly what I am trying to do.
>
> But I get memory errors when ever I try to call GetNumberOfItems(). (I am
> using the same part of code in vtkGDCMPolyDAtaReader).
>
> Do you mean I can use vtkGDCMPolyDataReader and get it's output and pass it
> through  ImageStencil.
>
> Thanks
>
> Jothy
>
> On Wed, Mar 9, 2011 at 5: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
>> >> >
>> >> >
>> >
>> >
>
>



More information about the vtkusers mailing list