X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkDicomRT_ROI.cxx;h=7bec8c51f47b1be17104b0fb16da56c22f3e9317;hb=38230d4e1081fa1f4c4469472137c3c1bdab2a3b;hp=b66135322a39042bfc243dae308e392a8a844b5a;hpb=2b5b3e906ee95519169e9b6d4bb2da9d2e00d8b3;p=clitk.git diff --git a/common/clitkDicomRT_ROI.cxx b/common/clitkDicomRT_ROI.cxx index b661353..7bec8c5 100644 --- a/common/clitkDicomRT_ROI.cxx +++ b/common/clitkDicomRT_ROI.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #if GDCM_MAJOR_VERSION == 2 #include "gdcmAttribute.h" @@ -276,7 +277,11 @@ void clitk::DicomRT_ROI::ComputeMeshFromContour() { vtkSmartPointer append = vtkSmartPointer::New(); for(unsigned int i=0; iAddInput(mListOfContours[i]->GetMesh()); +#if VTK_MAJOR_VERSION <= 5 + append->AddInput(mListOfContours[i]->GetMesh()); +#else + append->AddInputData(mListOfContours[i]->GetMesh()); +#endif } append->Update(); @@ -394,7 +399,12 @@ void clitk::DicomRT_ROI::ComputeContoursFromImage() // Get initial extend for the clipping vtkSmartPointer clipper = vtkSmartPointer::New(); +#if VTK_MAJOR_VERSION <= 5 clipper->SetInput(image); +#else + clipper->SetInputData(image); +#endif + int* extent = image->GetExtent(); DDV(extent, 6); // std::vector extend; @@ -414,7 +424,11 @@ void clitk::DicomRT_ROI::ComputeContoursFromImage() vtkSmartPointer squares = vtkSmartPointer::New(); +#if VTK_MAJOR_VERSION <= 5 squares->SetInput(image); +#else + squares->SetInputData(image); +#endif squares->SetImageRange(extent[0], extent[1], extent[2], extent[3], i, i); squares->SetValue(1, 1.0); squares->Update(); @@ -446,7 +460,11 @@ void clitk::DicomRT_ROI::ComputeContoursFromImage() vtkSmartPointer append = vtkSmartPointer::New(); for(unsigned int i=0; iAddInput(contours[i]); +#else + append->AddInputData(contours[i]); +#endif } append->Update(); @@ -455,7 +473,11 @@ void clitk::DicomRT_ROI::ComputeContoursFromImage() // Write vtk vtkPolyDataWriter * w = vtkPolyDataWriter::New(); +#if VTK_MAJOR_VERSION <= 5 w->SetInput(mMesh); +#else + w->SetInputData(mMesh); +#endif w->SetFileName("toto.vtk"); w->Write(); @@ -475,6 +497,16 @@ void clitk::DicomRT_ROI::Read(vtkSmartPointer & reader, i //mColor = //FIXME !! + // gdcm::Attribute<0x3006,0x002a> color = {}; + + // const gdcm::DataSet & nestedds = mItemContour->GetNestedDataSet(); + // color.SetFromDataSet( nestedds ); + // assert( color.GetNumberOfValues() == 3 ); + // mColor[0] = color.GetValue(0); + // mColor[1] = color.GetValue(1); + // mColor[2] = color.GetValue(2); + + SetDicomUptodateFlag(true); // Get the contour mMesh = reader->GetOutput(roiindex);