From 303324c27d660280e3ed0a3f40b10bb1bbd5d0c8 Mon Sep 17 00:00:00 2001 From: schaerer Date: Wed, 4 Aug 2010 09:15:11 +0000 Subject: [PATCH] a few improvements to the struct library, flush for better debug with DD, and fix warning in plastimatch tool --- common/clitkCommon.h | 6 +++--- common/clitkDicomRT_Contour.cxx | 8 ++++++-- common/clitkDicomRT_Contour.h | 1 + common/clitkDicomRT_ROI.cxx | 5 ++++- common/clitkDicomRT_ROI.h | 1 + vv/vvToolPlastimatch.cxx | 4 +++- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/common/clitkCommon.h b/common/clitkCommon.h index 410c976..476c0f1 100644 --- a/common/clitkCommon.h +++ b/common/clitkCommon.h @@ -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_ 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 diff --git a/common/clitkDicomRT_Contour.cxx b/common/clitkDicomRT_Contour.cxx index 5c12802..7df4cfe 100644 --- a/common/clitkDicomRT_Contour.cxx +++ b/common/clitkDicomRT_Contour.cxx @@ -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(item->GetEntryValue(0x3006,0x0046)); diff --git a/common/clitkDicomRT_Contour.h b/common/clitkDicomRT_Contour.h index 85ebe49..3e9ad8c 100644 --- a/common/clitkDicomRT_Contour.h +++ b/common/clitkDicomRT_Contour.h @@ -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(); diff --git a/common/clitkDicomRT_ROI.cxx b/common/clitkDicomRT_ROI.cxx index e9cc0d5..eb15105 100644 --- a/common/clitkDicomRT_ROI.cxx +++ b/common/clitkDicomRT_ROI.cxx @@ -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() diff --git a/common/clitkDicomRT_ROI.h b/common/clitkDicomRT_ROI.h index 77b5204..288d4d9 100644 --- a/common/clitkDicomRT_ROI.h +++ b/common/clitkDicomRT_ROI.h @@ -56,6 +56,7 @@ namespace clitk { void SetForegroundValueLabelImage(double bg); void SetImage(vvImage * im); + DicomRT_Contour* GetContour(int n); protected: void ComputeMesh(); diff --git a/vv/vvToolPlastimatch.cxx b/vv/vvToolPlastimatch.cxx index fd156f3..06f8148 100644 --- a/vv/vvToolPlastimatch.cxx +++ b/vv/vvToolPlastimatch.cxx @@ -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 /* -- 2.47.1