X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvMeshReader.cxx;h=b04163853d202f14f1a435f89b50c9444f38a036;hb=f4eb79e1b67e9c592a1deba19aa94af365bf2df9;hp=d740ea7921f35e76338d66f574c7777932ba7e2c;hpb=89a8fa2bb1c1b40c20011729ee6dca940ce96496;p=clitk.git diff --git a/vv/vvMeshReader.cxx b/vv/vvMeshReader.cxx index d740ea7..b041638 100644 --- a/vv/vvMeshReader.cxx +++ b/vv/vvMeshReader.cxx @@ -24,7 +24,7 @@ // gdcm #include -#if GDCM_MAJOR_VERSION == 2 +#if GDCM_MAJOR_VERSION >= 2 #include #include #include @@ -34,6 +34,7 @@ #endif // vtk +#include #include #include #include @@ -61,8 +62,6 @@ vtk_mode(false) //------------------------------------------------------------------------------ void vvMeshReader::Update() { - DD("vvMeshReader::Update"); - //Show a progress bar only when opening a DC-struct (ie. multiple contours) vvProgressDialog progress("Opening " + filename,(!vtk_mode) && (selected_contours.size()>1)); this->start(); @@ -107,24 +106,17 @@ std::vector > vvMeshReader::GetROINames() { assert(filename!=""); std::vector > roi_names; - DD(GDCM_MAJOR_VERSION); - DD(CLITK_USE_SYSTEM_GDCM); #if CLITK_USE_SYSTEM_GDCM == 1 + // Read RT-struct data - DD("before read"); vtkSmartPointer areader = vtkGDCMPolyDataReader::New(); areader->SetFileName(filename.c_str()); areader->Update(); - DD("after read"); // get info on roi names vtkRTStructSetProperties * p = areader->GetRTStructSetProperties(); - DD(p->GetNumberOfStructureSetROIs()); - DD(p->GetStructureSetROIName(0)); - DD(p->GetStructureSetROINumber(0)); int n = p->GetNumberOfStructureSetROIs(); - DD(n); for(unsigned int i=0; iGetStructureSetROIName(i); @@ -133,7 +125,7 @@ std::vector > vvMeshReader::GetROINames() } #else -#if GDCM_MAJOR_VERSION == 2 +#if GDCM_MAJOR_VERSION >= 2 // duplicate code from clitk::DicomRT_StructureSet::Read gdcm::Reader * reader = new gdcm::Reader; @@ -223,7 +215,6 @@ std::vector > vvMeshReader::GetROINames() #endif return roi_names; - } //------------------------------------------------------------------------------ @@ -232,14 +223,7 @@ std::vector > vvMeshReader::GetROINames() std::vector vvMeshReader::readSelectedContours() { std::vector result; -#if GDCM_MAJOR_VERSION == 2 - -#if CLITK_USE_SYSTEM_GDCM == 0 - - clitkExceptionMacro("ERROR ! You need to compile vv with itk4 + system_gdcm to use this function"); - -#endif - +#if GDCM_MAJOR_VERSION >= 2 gdcm::Reader reader; reader.SetFileName(filename.c_str()); reader.Read(); @@ -307,7 +291,11 @@ std::vector vvMeshReader::readSelectedContours() ids[1] = (ids[0] + 1) % tpoint_number.GetValue(); //0-1,1-2,...,n-1-0 contour->GetLines()->InsertNextCell(2, ids); } +#if VTK_MAJOR_VERSION <= 5 append->AddInput(contour); +#else + append->AddInputData(contour); +#endif } else if (contour_type == "POINT ")