[Insight-users] Reading DICOM-RT with vtkGDCMPolyDataReader as supposed by Charles Wang
Mathieu Malaterre
mathieu.malaterre at gmail.com
Mon Oct 5 09:10:42 EDT 2009
On Mon, Oct 5, 2009 at 2:44 PM, Lodron, Gerald
<Gerald.Lodron at joanneum.at> wrote:
> Hello ITK users group,
>
> I am trying to read (and display) DICOM RT Structure Sets. On
> http://www.insight-journal.org/browse/publication/316 I found a nice hint in
> the review section of Charles Wang. I tried to implement it with the
> following code:
>
>
> vtkGDCMPolyDataReader * PolyReader = vtkGDCMPolyDataReader::New();
>
> PolyReader->SetFileName( argv[1] );
>
> PolyReader->Update();
>
> //PolyReader->Print(std::cerr);
>
> vtkPolyData * polyData = PolyReader->GetOutput();
>
>
>
> But when I look at the object polyData I only see strange results:
>
>
>
> int a = polyData->GetNumberOfCells();//1
>
> int b = polyData->GetNumberOfLines();//0
>
> int c = polyData->GetNumberOfPieces();//1
>
> int d = polyData->GetNumberOfPoints();//1
>
> int e = polyData->GetNumberOfPolys();//1
>
> int f = polyData->GetNumberOfStrips();//0
>
> int g = polyData->GetNumberOfVerts();//0
>
>
>
> For sure, also the displaying of those object fails. So I think that the
> reader stops after the first point reading, does anybody (maybe Charles
> Wang) know how to read those RT Structure Sets without modifying the
> PolyReader object and without writing a new parser? Would be very great,
> special thanks to all helpers!
This is a bug in gdcm 2.0.12 when the first object was empty the
reader would stop instead of continuing over all other ojects.
I think you simply need to apply those local changes:
http://gdcm.svn.sourceforge.net/viewvc/gdcm/trunk/Utilities/VTK/vtkGDCMPolyDataReader.cxx?r1=5556&r2=5923
2cts
--
Mathieu
More information about the Insight-users
mailing list