// gdcm
#include <gdcmFile.h>
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
#include <gdcmReader.h>
#include <gdcmTag.h>
#include <gdcmAttribute.h>
#endif
// vtk
+#include <vtkVersion.h>
#include <vtkSmartPointer.h>
#include <vtkAppendPolyData.h>
#include <vtkCellArray.h>
//------------------------------------------------------------------------------
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();
{
assert(filename!="");
std::vector<std::pair<int, std::string> > 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<vtkGDCMPolyDataReader> 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; i<n; i++) {
std::string name = p->GetStructureSetROIName(i);
}
#else
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
// duplicate code from clitk::DicomRT_StructureSet::Read
gdcm::Reader * reader = new gdcm::Reader;
#endif
return roi_names;
-
}
//------------------------------------------------------------------------------
std::vector<vvMesh::Pointer> vvMeshReader::readSelectedContours()
{
std::vector<vvMesh::Pointer> 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();
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 ")