]> Creatis software - clitk.git/blobdiff - common/clitkDicomRT_Contour.cxx
cosmetic for .ggo
[clitk.git] / common / clitkDicomRT_Contour.cxx
index 7fc71114bc43c987ba9dd9756a5f037a2df99618..9a5042befdef6b7b14f63a86d8e23aa42e290704 100644 (file)
@@ -20,7 +20,7 @@
 #include "clitkDicomRT_Contour.h"
 #include <vtkCellArray.h>
 
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
 #include "gdcmAttribute.h"
 #include "gdcmItem.h"
 #endif
@@ -53,7 +53,7 @@ void clitk::DicomRT_Contour::Print(std::ostream & os) const
 
 
 //--------------------------------------------------------------------
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
 void clitk::DicomRT_Contour::UpdateDicomItem()
 {
   DD("DicomRT_Contour::UpdateDicomItem");
@@ -119,7 +119,7 @@ void clitk::DicomRT_Contour::UpdateDicomItem()
 
 
 //--------------------------------------------------------------------
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
 bool clitk::DicomRT_Contour::Read(gdcm::Item * item)
 {
   mItem = item;
@@ -253,6 +253,14 @@ void clitk::DicomRT_Contour::SetMesh(vtkPolyData * mesh)
 //--------------------------------------------------------------------
 
 
+//--------------------------------------------------------------------
+void clitk::DicomRT_Contour::SetTransformMatrix(vtkMatrix4x4* matrix)
+{
+  mTransformMatrix = matrix;
+}
+//--------------------------------------------------------------------
+
+
 //--------------------------------------------------------------------
 void clitk::DicomRT_Contour::ComputeMeshFromDataPoints()
 {
@@ -263,13 +271,25 @@ void clitk::DicomRT_Contour::ComputeMeshFromDataPoints()
   mMesh->SetPoints(mPoints);
   vtkIdType ids[2];
   for (unsigned int idx=0 ; idx<mNbOfPoints ; idx++) {
+    double pointIn[4];
+    for (unsigned int j=0 ; j<3; ++j)
+      pointIn[j] = mData->GetPoint(idx)[j];
+    pointIn[3] = 1.0;
+    /*double pointOut[4];
+    mTransformMatrix->MultiplyPoint(pointIn, pointOut);
+    std::cout << pointOut[0] << " " << pointOut[1] << " " << pointOut[2] << " " << pointOut[3] << std::endl;
+    mMesh->GetPoints()->InsertNextPoint(pointOut[0],
+                                        pointOut[1],
+                                        pointOut[2]);*/
     mMesh->GetPoints()->InsertNextPoint(mData->GetPoint(idx)[0],
                                         mData->GetPoint(idx)[1],
                                         mData->GetPoint(idx)[2]);
+    //std::cout << mData->GetPoint(idx)[0] << " " << mData->GetPoint(idx)[1] << " " << mData->GetPoint(idx)[2] << std::endl;
     ids[0]=idx;
     ids[1]=(ids[0]+1) % mNbOfPoints; //0-1,1-2,...,n-1-0
     mMesh->GetLines()->InsertNextCell(2,ids);
   }
+  //std::cout << std::endl;
   mMeshIsUpToDate = true;
 }
 //--------------------------------------------------------------------