X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvToolROIManager.cxx;h=072d3634b23a1c26129ba466fc39c0fcae88224b;hb=892efb56f79121193839cec366f46d29b9bd2427;hp=645941cb4fd3a8555a980c42db12fb3fba0a7486;hpb=e60efb7c468dcc9d3e62864742e5b4c7a015a241;p=clitk.git diff --git a/vv/vvToolROIManager.cxx b/vv/vvToolROIManager.cxx index 645941c..072d363 100644 --- a/vv/vvToolROIManager.cxx +++ b/vv/vvToolROIManager.cxx @@ -104,9 +104,9 @@ vvToolROIManager::~vvToolROIManager() // STATIC void vvToolROIManager::Initialize() { SetToolName("ROIManager"); - SetToolMenuName("Display ROI (binary image)"); + SetToolMenuName("Open ROI (binary image or RT-STRUCT)"); SetToolIconFilename(":/common/icons/tool-roi.png"); - SetToolTip("Display ROI from a binary image."); + SetToolTip("Display ROI from a binary image or a RT-struct file."); SetToolExperimental(false); } //------------------------------------------------------------------------------ @@ -317,7 +317,7 @@ void vvToolROIManager::Open() void vvToolROIManager::OpenBinaryImage(QStringList & filename) { if (filename.size() == 0) return; - + vvProgressDialog p("Reading ROI ...", true); p.SetCancelButtonEnabled(false); QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); @@ -359,6 +359,7 @@ void vvToolROIManager::OpenDicomImage(std::string filename) // GUI selector of roi vvMeshReader reader; reader.SetFilename(filename); + vvStructSelector selector; selector.SetStructures(reader.GetROINames()); selector.SetPropagationCheckBoxFlag(false); @@ -375,8 +376,8 @@ void vvToolROIManager::OpenDicomImage(std::string filename) // Loop on selected struct std::vector list = selector.getSelectedItems(); for (uint i=0; iGetROI()->GetDisplayColor()[1], mCurrentROIActor->GetROI()->GetDisplayColor()[2]); QColor c = QColorDialog::getColor(color, this, "Choose the ROI color"); + if (!c.isValid()) return;// User cancel + mCurrentROIActor->GetROI()->SetDisplayColor(c.redF(), c.greenF(), c.blueF()); mCurrentROIActor->UpdateColor(); @@ -734,6 +737,9 @@ void vvToolROIManager::ChangeDepth(int n) { //------------------------------------------------------------------------------ void vvToolROIManager::ReloadCurrentROI() { + if (mCurrentROI->GetImage()) { + return; // do nothing (contour from rt struct do not reload) + } // Remove all contours/overlay first bool visible = mCurrentROIActor->IsVisible();