X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkDicomRT_ROI.cxx;h=b6af9c321d5d2a2921cc3e65b352d872b16cde48;hb=2a55297d4d57c41a40f74413940519d251d21f71;hp=783b97227921af73bf540c60a6f3e18c0d8c938a;hpb=ef33edbce5ce9f897e3e6acbc5d36718407329c0;p=clitk.git diff --git a/common/clitkDicomRT_ROI.cxx b/common/clitkDicomRT_ROI.cxx index 783b972..b6af9c3 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" @@ -41,6 +42,7 @@ clitk::DicomRT_ROI::DicomRT_ROI() mBackgroundValue = 0; mForegroundValue = 1; SetDicomUptodateFlag(false); + mFilename = ""; } //-------------------------------------------------------------------- @@ -71,6 +73,14 @@ int clitk::DicomRT_ROI::GetROINumber() const //-------------------------------------------------------------------- +//-------------------------------------------------------------------- +void clitk::DicomRT_ROI::SetROINumber(int number) +{ + mNumber = number; +} +//-------------------------------------------------------------------- + + //-------------------------------------------------------------------- const std::string & clitk::DicomRT_ROI::GetName() const { @@ -141,6 +151,7 @@ double clitk::DicomRT_ROI::GetForegroundValueLabelImage() const #if GDCM_MAJOR_VERSION == 2 bool clitk::DicomRT_ROI::Read(gdcm::Item * itemInfo, gdcm::Item * itemContour) { + //FATAL("Error : compile vv with itk4 + external gdcm"); // Keep dicom item mItemInfo = itemInfo; mItemContour = itemContour; @@ -274,7 +285,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(); @@ -286,10 +301,11 @@ void clitk::DicomRT_ROI::ComputeMeshFromContour() #if GDCM_MAJOR_VERSION == 2 - //-------------------------------------------------------------------- void clitk::DicomRT_ROI::UpdateDicomItem() { + FATAL("Error : compile vv with itk4 + external gdcm"); + if (GetDicomUptoDateFlag()) return; DD("ROI::UpdateDicomItem"); DD(GetName()); @@ -375,6 +391,7 @@ vvImage * clitk::DicomRT_ROI::GetImage() const //-------------------------------------------------------------------- void clitk::DicomRT_ROI::ComputeContoursFromImage() { + FATAL("ComputeContoursFromImage should not be call. To be replace"); DD("ComputeMeshFromImage"); // Check that an image is loaded @@ -390,7 +407,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; @@ -410,7 +432,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(); @@ -442,7 +468,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(); @@ -451,7 +481,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(); @@ -468,7 +502,19 @@ void clitk::DicomRT_ROI::Read(vtkSmartPointer & reader, i mName = p->GetStructureSetROIName(roiindex); mNumber = p->GetStructureSetROINumber(roiindex); + //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);