X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=common%2FclitkImage2DicomRTStructFilter.txx;h=9ebde04d0c878cd8dac885da978c7e9ea332af67;hb=refs%2Fheads%2FextentSimon;hp=248451d8fac4e0dff6ac74b2b1316750226037a0;hpb=794be53b8efec2ddb9c3097efd559c514fb4a813;p=clitk.git diff --git a/common/clitkImage2DicomRTStructFilter.txx b/common/clitkImage2DicomRTStructFilter.txx index 248451d..9ebde04 100644 --- a/common/clitkImage2DicomRTStructFilter.txx +++ b/common/clitkImage2DicomRTStructFilter.txx @@ -52,6 +52,8 @@ #include // gdcm +#include +#include #include //-------------------------------------------------------------------- @@ -62,6 +64,7 @@ clitk::Image2DicomRTStructFilter::Image2DicomRTStructFilter() m_DicomFolder = ""; m_OutputFilename = "default-output.dcm"; m_ThresholdValue = 0.5; + m_SkipInitialStructuresFlag = false; } //-------------------------------------------------------------------- @@ -119,6 +122,11 @@ void clitk::Image2DicomRTStructFilter::Update() // Init writer vtkGDCMPolyDataWriter * writer = vtkGDCMPolyDataWriter::New(); int numMasks = reader->GetNumberOfOutputPorts() + m; + + if (m_SkipInitialStructuresFlag) { + numMasks = m; + } + writer->SetNumberOfInputPorts(numMasks); writer->SetFileName(m_OutputFilename.c_str()); writer->SetMedicalImageProperties(reader->GetMedicalImageProperties()); @@ -172,7 +180,11 @@ void clitk::Image2DicomRTStructFilter::Update() // 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); @@ -183,7 +195,11 @@ void clitk::Image2DicomRTStructFilter::Update() // 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);