]> Creatis software - clitk.git/commitdiff
a few improvements to the struct library, flush for better debug with DD,
authorschaerer <schaerer>
Wed, 4 Aug 2010 09:15:11 +0000 (09:15 +0000)
committerschaerer <schaerer>
Wed, 4 Aug 2010 09:15:11 +0000 (09:15 +0000)
  and fix warning in plastimatch tool

common/clitkCommon.h
common/clitkDicomRT_Contour.cxx
common/clitkDicomRT_Contour.h
common/clitkDicomRT_ROI.cxx
common/clitkDicomRT_ROI.h
vv/vvToolPlastimatch.cxx

index 410c976..476c0f1 100644 (file)
@@ -40,12 +40,12 @@ namespace clitk {
 
   //--------------------------------------------------------------------
   // display 
-#define DD(a) std::cout << #a " = [ " << a << " ]" << std::endl;
-#define DDV(a,n) { std::cout << #a " = [ "; for(unsigned int _i_=0; _i_<n; _i_++) { std::cout << a[_i_] << " "; }; std::cout << " ]" << std::endl;}
+#define DD(a) std::cout << #a " = [ " << a << " ]" << std::endl;std::cout.flush();
+#define DDV(a,n) { std::cout << #a " = [ "; for(unsigned int _i_=0; _i_<n; _i_++) { std::cout << a[_i_] << " "; }; std::cout << " ]" << std::endl;std::cout.flush();}
 template<class T>
 void _print_container(T const& a)
     { for(typename T::const_iterator i=a.begin();i!=a.end();++i) { std::cout << *i << " "; };}
-#define DDS(a) { std::cout << #a " = [ "; _print_container(a) ; std::cout << " ]" << std::endl;}
+#define DDS(a) { std::cout << #a " = [ "; _print_container(a) ; std::cout << " ]" << std::endl;std::cout.flush():}
 
   //--------------------------------------------------------------------
   // when everything goes wrong
index 5c12802..7df4cfe 100644 (file)
@@ -53,10 +53,14 @@ bool clitk::DicomRT_Contour::Read(gdcm::SQItem * item)
   // Contour type [Contour Geometric Type]
   mType = item->GetEntryValue(0x3006,0x0042);
   // DD(mType);
-  if (mType != "CLOSED_PLANAR ") { ///WARNING to the space after the name ...
-    std::cerr << "Skip this contour : type=" << mType << std::endl;
+  if (mType != "CLOSED_PLANAR " && mType != "POINT ") { ///WARNING to the space after the name ...
+    //std::cerr << "Skip this contour : type=" << mType << std::endl;
     return false;
   }
+  if (mType == "POINT ") {
+    std::cout << "Warning: POINT type not fully supported. (don't use GetMesh() with this!)"
+      << std::endl;
+  }
 
   // Number of points [Number of Contour Points]
   mNbOfPoints = parse_value<int>(item->GetEntryValue(0x3006,0x0046));
index 85ebe49..3e9ad8c 100644 (file)
@@ -39,6 +39,7 @@ namespace clitk {
     void Print(std::ostream & os = std::cout) const;
     bool Read(gdcm::SQItem * item);
     vtkPolyData * GetMesh();
+    vtkPoints * GetPoints() {return mData;}
     
   protected:
     void ComputeMesh();
index e9cc0d5..eb15105 100644 (file)
@@ -173,7 +173,10 @@ vtkPolyData * clitk::DicomRT_ROI::GetMesh()
   return mMesh;
 }
 //--------------------------------------------------------------------
-
+clitk::DicomRT_Contour * clitk::DicomRT_ROI::GetContour(int n)
+{
+  return mListOfContours[n];
+}
 
 //--------------------------------------------------------------------
 void clitk::DicomRT_ROI::ComputeMesh()
index 77b5204..288d4d9 100644 (file)
@@ -56,6 +56,7 @@ namespace clitk {
     void SetForegroundValueLabelImage(double bg);
     
     void SetImage(vvImage * im);
+    DicomRT_Contour* GetContour(int n);
     
   protected:
     void ComputeMesh();
index fd156f3..06f8148 100644 (file)
@@ -163,13 +163,15 @@ void vvToolPlastimatch::apply()
   GetOptionsFromGUI();
 
   // Create the command string
-  char *command_string =
+  /*
+  const char *command_string =
     "[STAGE]\n"
     "xform=bspline\n"
     "max_its=30\n"
     "grid_spac=100 100 100\n"
     "res=4 4 2\n"
     ;
+    */
 
   // Prepare the registration
   /*