X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkImage2DicomRTStructFilter.txx;h=7325b69edfc81fd9bafb3d297ed09b40e51c7092;hb=d55f025b18f68066a52b8f33c2dc6481e82c2580;hp=77c5e07044f1684b502021b8196c13ec15c5c975;hpb=f45412cabff9aab013b0259377ab9f80e4987c02;p=clitk.git diff --git a/common/clitkImage2DicomRTStructFilter.txx b/common/clitkImage2DicomRTStructFilter.txx index 77c5e07..7325b69 100644 --- a/common/clitkImage2DicomRTStructFilter.txx +++ b/common/clitkImage2DicomRTStructFilter.txx @@ -52,6 +52,8 @@ #include // gdcm +#include +#include #include //-------------------------------------------------------------------- @@ -112,7 +114,6 @@ void clitk::Image2DicomRTStructFilter::Update() std::cout << "Number of structures in the dicom-rt-struct : " << p->GetNumberOfStructureSetROIs() << std::endl; } - // number of additional contours int m = m_InputFilenames.size(); @@ -136,14 +137,14 @@ void clitk::Image2DicomRTStructFilter::Update() roiNames->SetNumberOfValues(numMasks); roiAlgorithms->SetNumberOfValues(numMasks); roiTypes->SetNumberOfValues(numMasks); - + // Convert the image into a mesh std::vector > meshes; std::vector m_ROINames; meshes.resize(m); m_ROINames.resize(m); for(unsigned int i=0; i ImageType; @@ -154,7 +155,7 @@ void clitk::Image2DicomRTStructFilter::Update() GetFilenameName(vtksys::SystemTools::GetFilenameWithoutLastExtension(m_InputFilenames[i])); std::string name = oss.str(); m_ROINames[i] = name; - + // convert to mesh typedef clitk::BinaryImageToMeshFilter BinaryImageToMeshFilterType; typename BinaryImageToMeshFilterType::Pointer convert = BinaryImageToMeshFilterType::New(); @@ -165,7 +166,7 @@ void clitk::Image2DicomRTStructFilter::Update() if (GetVerboseFlag()) { std::cout << "Mesh has " << meshes[i]->GetNumberOfLines() << " lines." << std::endl; } - + /* // debug mesh write FIXME vtkSmartPointer wr = vtkSmartPointer::New(); @@ -175,26 +176,34 @@ void clitk::Image2DicomRTStructFilter::Update() wr->Write(); */ } - + // Copy previous contours for (unsigned int i = 0; i < numMasks-m; ++i) { +#if VTK_MAJOR_VERSION <= 5 writer->SetInput(i, reader->GetOutput(i)); +#else + writer->SetInputData(i, reader->GetOutput(i)); +#endif std::string theString = reader->GetRTStructSetProperties()->GetStructureSetROIName(i); roiNames->InsertValue(i, theString); theString = reader->GetRTStructSetProperties()->GetStructureSetROIGenerationAlgorithm(i); roiAlgorithms->InsertValue(i, theString); theString = reader->GetRTStructSetProperties()->GetStructureSetRTROIInterpretedType(i); roiTypes->InsertValue(i, theString); - } + } // Add new ones for (unsigned int i = numMasks-m; i < numMasks; ++i) { +#if VTK_MAJOR_VERSION <= 5 writer->SetInput(i, meshes[i-numMasks+m]); +#else + writer->SetInputData(i, meshes[i-numMasks+m]); +#endif roiNames->InsertValue(i, m_ROINames[i-numMasks+m]); roiAlgorithms->InsertValue(i, "CLITK_CREATED"); roiTypes->InsertValue(i, m_ROIType); } - + /* // Visu DEBUG vtkPolyDataMapper *cubeMapper = vtkPolyDataMapper::New();