From a84258318fc97846b5e26492217490cbc15c39de Mon Sep 17 00:00:00 2001 From: David Sarrut Date: Wed, 27 Jul 2011 11:43:33 +0200 Subject: [PATCH] Replace ListOfROI (vector) by MapOfROI to avoid ambiguity between the ROI number and the index --- vv/vvToolStructureSetManager.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/vv/vvToolStructureSetManager.cxx b/vv/vvToolStructureSetManager.cxx index 151435f..542e50c 100644 --- a/vv/vvToolStructureSetManager.cxx +++ b/vv/vvToolStructureSetManager.cxx @@ -202,11 +202,19 @@ void vvToolStructureSetManager::AddRoiInTreeWidget(clitk::DicomRT_ROI * roi, QTr //------------------------------------------------------------------------------ void vvToolStructureSetManager::UpdateStructureSetInTreeWidget(int index, clitk::DicomRT_StructureSet * s) { // Insert ROI + /* const std::vector & rois = s->GetListOfROI(); for(unsigned int i=0; iGetROIs().begin(); iter != s->GetROIs().end(); iter++) { + clitk::DicomRT_ROI::Pointer roi = iter->second; + if (mMapROIToTreeWidget.find(roi) == mMapROIToTreeWidget.end()) + AddRoiInTreeWidget(roi, mTree); // replace mTree with ss if several SS + } } //------------------------------------------------------------------------------ @@ -334,14 +342,14 @@ void vvToolStructureSetManager::AddImage(vvImage * binaryImage, std::string file int n = mCurrentStructureSet->AddBinaryImageAsNewROI(binaryImage, filename); mLoadedROIIndex.push_back(n); if (m_modeBG) - mCurrentStructureSet->GetROI(n)->SetBackgroundValueLabelImage(BG); + mCurrentStructureSet->GetROIFromROINumber(n)->SetBackgroundValueLabelImage(BG); else - mCurrentStructureSet->GetROI(n)->SetForegroundValueLabelImage(BG); + mCurrentStructureSet->GetROIFromROINumber(n)->SetForegroundValueLabelImage(BG); // Change color if (nGetNumberOfTableValues ()) { double * color = mDefaultLUTColor->GetTableValue(n % mDefaultLUTColor->GetNumberOfTableValues ()); - mCurrentStructureSet->GetROI(n)->SetDisplayColor(color[0], color[1], color[2]); + mCurrentStructureSet->GetROIFromROINumber(n)->SetDisplayColor(color[0], color[1], color[2]); } // Add a new roi actor -- 2.47.1