// 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);
}
//------------------------------------------------------------------------------
void vvToolROIManager::OpenBinaryImage(QStringList & filename)
{
if (filename.size() == 0) return;
-
+
vvProgressDialog p("Reading ROI ...", true);
p.SetCancelButtonEnabled(false);
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
// GUI selector of roi
vvMeshReader reader;
reader.SetFilename(filename);
+
vvStructSelector selector;
selector.SetStructures(reader.GetROINames());
selector.SetPropagationCheckBoxFlag(false);
// Loop on selected struct
std::vector<int> list = selector.getSelectedItems();
for (uint i=0; i<list.size(); i++) {
- p.SetProgress(i, list.size());
-
+ p.SetProgress(i, list.size());
+
clitk::DicomRTStruct2ImageFilter filter;
filter.SetCropMaskEnabled(true);
filter.SetImage(mCurrentImage);
for(unsigned int i=0; i<mROIList.size(); i++) {
mROIActorsList[i]->Update();
}
- for(int i=0; i<mCurrentSlicerManager->GetNumberOfSlicers(); i++) {
- mCurrentSlicerManager->GetSlicer(i)->Render();
- }
+ mCurrentSlicerManager->Render();
}
//------------------------------------------------------------------------------
mCurrentROIActor->GetROI()->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();
//------------------------------------------------------------------------------
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();