1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ======================================================================-====*/
20 #include "vvToolStructureSetManager.h"
21 #include "vvImageReader.h"
22 #include "vvStructureSetActor.h"
24 #include "vvROIActor.h"
27 #include <QFileDialog>
28 #include <QMessageBox>
29 #include <QColorDialog>
32 #include <vtkLookupTable.h>
33 #include <vtkRenderWindow.h>
35 //------------------------------------------------------------------------------
36 // Create the tool and automagically (I like this word) insert it in
37 // the main window menu.
38 ADD_TOOL(vvToolStructureSetManager);
39 //------------------------------------------------------------------------------
41 int vvToolStructureSetManager::m_NumberOfTool = 0;
42 std::vector<vvSlicerManager*> vvToolStructureSetManager::mListOfInputs;
43 std::map<vvSlicerManager*, vvToolStructureSetManager*> vvToolStructureSetManager::mListOfOpenTool;
44 bool vvToolStructureSetManager::mDestroyed = false;
46 //------------------------------------------------------------------------------
47 vvToolStructureSetManager::vvToolStructureSetManager(vvMainWindowBase * parent,
49 vvSlicerManager * current):
50 vvToolWidgetBase(parent, f),
51 // if Qt::Widget -> No dialog in this case (in tab) ; PB = "invisible widget on menu" !
52 // if "f" normal widget
53 vvToolBase<vvToolStructureSetManager>(parent),
54 Ui::vvToolStructureSetManager()
56 Ui_vvToolStructureSetManager::setupUi(mToolWidget);
58 // this->setFixedWidth(120);
60 mCurrentStructureSetActor = 0;
61 connect(mCloseButton, SIGNAL(clicked()), this, SLOT(close()));
62 mCloseButton->setVisible(false);
64 mTree->header()->resizeSection(0, 30);
65 mMainWindowBase->GetTab()->setTabIcon(mTabNumber, GetToolIcon());
66 mCurrentStructureSet = NULL;
67 mCurrentStructureSetIndex = -1;
68 mGroupBoxROI->setEnabled(false);
69 mCurrentROIActor = NULL;
70 mIsAllVisibleEnabled = false;
71 mNumberOfVisibleROI = 0;
72 mNumberOfVisibleContourROI = 0;
73 mDefaultLUTColor = vtkSmartPointer<vtkLookupTable>::New();
74 for(int i=0; i<mDefaultLUTColor->GetNumberOfTableValues(); i++) {
75 double r = (rand()/(RAND_MAX+1.0));
76 double v = (rand()/(RAND_MAX+1.0));
77 double b = (rand()/(RAND_MAX+1.0));
78 mDefaultLUTColor->SetTableValue(i, r, v, b);
79 // std::cout << "mDefaultLUTColor->SetTableValue(" << i << ", " << r << ", " << v << ", " << b << ");" << std::endl;
81 #include "vvDefaultLut.h"
84 if (current == NULL) {
85 MustOpenDialogWhenCreated = true;
86 AddInputSelector("Select image");
89 MustOpenDialogWhenCreated = false;
90 mMainButtonBox->setEnabled(true);
91 mCurrentSlicerManager = current;
92 mCurrentImage = mCurrentSlicerManager->GetImage();
93 mToolWidget->setEnabled(true);
94 InputIsSelected(mCurrentSlicerManager);
97 //------------------------------------------------------------------------------
100 //------------------------------------------------------------------------------
101 vvToolStructureSetManager::~vvToolStructureSetManager()
103 //std::cout << "vvToolStructureSetManager::~vvToolStructureSetManager()" << std::endl;
107 //------------------------------------------------------------------------------
110 //------------------------------------------------------------------------------
112 void vvToolStructureSetManager::Initialize() {
113 SetToolName("ROIManager");
114 SetToolMenuName("Display ROI (binary image)");
115 SetToolIconFilename(":/common/icons/tool-roi.png");
116 SetToolTip("Display ROI from a binary image.");
117 SetToolExperimental(false);
119 //------------------------------------------------------------------------------
122 //------------------------------------------------------------------------------
123 void vvToolStructureSetManager::InputIsSelected(vvSlicerManager *m)
125 //std::cout << "vvToolStructureSetManager::InputIsSelected()" << std::endl;
127 //int mTabNumber = parent->GetTab()->addTab(this, "");
128 // this->setFixedWidth(120);
129 //this->setPreferedHeight(441);
131 if (mCurrentImage->GetNumberOfDimensions() != 3) {
132 QMessageBox::information(this,tr("Sorry only 3D yet"), tr("Sorry only 3D yet"));
136 HideInputSelector(); // splitter
137 mToolInputSelectionWidget->hide();
138 mLabelInputInfo->setText(QString("%1").arg(m->GetFileName().c_str()));
141 // if (!isWindow()) {
142 mListOfInputs.push_back(mCurrentSlicerManager);
143 mListOfOpenTool[mCurrentSlicerManager] = this;
146 // Connect open menus
147 connect(mOpenBinaryButton, SIGNAL(clicked()), this, SLOT(OpenBinaryImage()));
148 connect(mTree, SIGNAL(itemSelectionChanged()), this, SLOT(SelectedItemChangedInTree()));
149 connect(mCheckBoxShow, SIGNAL(toggled(bool)), this, SLOT(VisibleROIToggled(bool)));
150 connect(mOpacitySlider, SIGNAL(valueChanged(int)), this, SLOT(OpacityChanged(int)));
151 connect(mChangeColorButton, SIGNAL(clicked()), this, SLOT(ChangeColor()));
152 connect(mContourCheckBoxShow, SIGNAL(toggled(bool)), this, SLOT(VisibleContourROIToggled(bool)));
153 connect(mChangeContourColorButton, SIGNAL(clicked()), this, SLOT(ChangeContourColor()));
154 connect(mContourWidthSpinBox, SIGNAL(valueChanged(int)), this, SLOT(ChangeContourWidth(int)));
155 connect(mReloadButton, SIGNAL(clicked()), this, SLOT(ReloadCurrentROI()));
156 connect(mCheckBoxShowAll, SIGNAL(stateChanged(int)), this, SLOT(AllVisibleROIToggled(int)));
157 connect(mContourCheckBoxShowAll, SIGNAL(toggled(bool)), this, SLOT(AllVisibleContourROIToggled(bool)));
159 // Browse to load image
160 if (MustOpenDialogWhenCreated)
163 //------------------------------------------------------------------------------
166 //------------------------------------------------------------------------------
167 void vvToolStructureSetManager::Open(int type) {
169 case 0: OpenBinaryImage(); return; // Open binary image;
170 case 1: DD("TODO"); return; // Open DICOM RT
171 case 2: DD("TODO"); return; // Open mesh
172 default: std::cerr << "Error ????" << std::endl; exit(0);
175 //------------------------------------------------------------------------------
178 //------------------------------------------------------------------------------
179 void vvToolStructureSetManager::AddRoiInTreeWidget(clitk::DicomRT_ROI * roi, QTreeWidget * ww) {
180 mTreeWidgetList.push_back(QSharedPointer<QTreeWidgetItem>(new QTreeWidgetItem(ww)));
181 QTreeWidgetItem * w = mTreeWidgetList.back().data();
182 w->setText(0, QString("%1").arg(roi->GetROINumber()));
183 w->setText(1, QString("%1").arg(roi->GetName().c_str()));
184 QBrush brush(QColor(roi->GetDisplayColor()[0]*255, roi->GetDisplayColor()[1]*255, roi->GetDisplayColor()[2]*255));
185 brush.setStyle(Qt::SolidPattern);
186 w->setBackground(2, brush);
187 mMapROIToTreeWidget[roi] = w;
188 mMapTreeWidgetToROI[w] = roi;
189 mTree->resizeColumnToContents(0);
190 mTree->resizeColumnToContents(1);
192 //------------------------------------------------------------------------------
195 //------------------------------------------------------------------------------
196 void vvToolStructureSetManager::UpdateStructureSetInTreeWidget(int index, clitk::DicomRT_StructureSet * s) {
198 const std::vector<clitk::DicomRT_ROI::Pointer> & rois = s->GetListOfROI();
199 for(unsigned int i=0; i<rois.size(); i++) {
200 if (mMapROIToTreeWidget.find(rois[i]) == mMapROIToTreeWidget.end())
201 AddRoiInTreeWidget(rois[i], mTree); // replace mTree with ss if several SS
204 //------------------------------------------------------------------------------
207 //------------------------------------------------------------------------------
208 int vvToolStructureSetManager::AddStructureSet(clitk::DicomRT_StructureSet * mStructureSet) {
209 // Create actor for this SS
211 QSharedPointer<vvStructureSetActor> mStructureSetActor(new vvStructureSetActor);
213 mStructureSetActor->SetStructureSet(mStructureSet);
214 mStructureSetActor->SetSlicerManager(mCurrentSlicerManager);
215 // Insert in lists and get index
216 mStructureSetsList.push_back(mStructureSet);
217 mStructureSetActorsList.push_back(mStructureSetActor);
218 int index = mStructureSetsList.size()-1;
222 //------------------------------------------------------------------------------
225 //------------------------------------------------------------------------------
226 void vvToolStructureSetManager::OpenBinaryImage()
229 if (mCurrentStructureSet == NULL) {
230 if (mStructureSetsList.size() == 0) { // Create a default SS
231 clitk::DicomRT_StructureSet::Pointer mStructureSet = clitk::DicomRT_StructureSet::New();
232 index = AddStructureSet(mStructureSet);
234 else { // Get first SS
238 index = mCurrentStructureSetIndex;
240 mCurrentStructureSet = mStructureSetsList[index];
241 mCurrentStructureSetActor = mStructureSetActorsList[index].data();
242 mCurrentStructureSetIndex = index;
244 QString Extensions = "Images files ( *.mhd *.hdr *.his)";
245 Extensions += ";;All Files (*)";
246 QStringList filename =
247 QFileDialog::getOpenFileNames(this,tr("Open binary image"),
248 mMainWindowBase->GetInputPathName(),Extensions);
249 if (filename.size() == 0) return;
250 mLoadedROIIndex.clear();
251 for(int i=0; i<filename.size(); i++) {
253 QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
254 vvImageReader::Pointer reader = vvImageReader::New();
255 std::vector<std::string> filenames;
256 filenames.push_back(filename[i].toStdString());
257 reader->SetInputFilenames(filenames);
258 reader->Update(IMAGE);
259 QApplication::restoreOverrideCursor();
261 if (reader->GetLastError().size() != 0) {
262 std::cerr << "Error while reading " << filename[i].toStdString() << std::endl;
263 QString error = "Cannot open file \n";
264 error += reader->GetLastError().c_str();
265 QMessageBox::information(this,tr("Reading problem"),error);
268 vvImage::Pointer binaryImage = reader->GetOutput();
269 AddImage(binaryImage, filename[i].toStdString(), mBackgroundValueSpinBox->value());
270 mOpenedBinaryImage.push_back(binaryImage);
275 //------------------------------------------------------------------------------
278 //------------------------------------------------------------------------------
279 void vvToolStructureSetManager::UpdateImage()
281 // Update the TreeWidget
282 UpdateStructureSetInTreeWidget(mCurrentStructureSetIndex, mCurrentStructureSet);
283 // Render loaded ROIs (the first is sufficient)
284 for(unsigned int i=0; i<mLoadedROIIndex.size(); i++) {
285 mCurrentStructureSetActor->GetROIActor(mLoadedROIIndex[i])->Update();
287 for(int i=0; i<mCurrentSlicerManager->GetNumberOfSlicers(); i++) {
288 mCurrentSlicerManager->GetSlicer(i)->Render();
291 //------------------------------------------------------------------------------
294 //------------------------------------------------------------------------------
295 void vvToolStructureSetManager::AddImage(vvImage * binaryImage, std::string filename,
296 double BG, bool m_modeBG)
298 // Check current structure set
300 if (mCurrentStructureSet == NULL) {
301 if (mStructureSetsList.size() == 0) { // Create a default SS
302 clitk::DicomRT_StructureSet::Pointer mStructureSet = clitk::DicomRT_StructureSet::New();
303 index = AddStructureSet(mStructureSet);
305 else { // Get first SS
309 index = mCurrentStructureSetIndex;
311 mCurrentStructureSet = mStructureSetsList[index];
312 mCurrentStructureSetActor = mStructureSetActorsList[index].data();
313 mCurrentStructureSetIndex = index;
316 int dim = mCurrentImage->GetNumberOfDimensions();
317 int bin_dim = binaryImage->GetNumberOfDimensions();
318 if (dim < bin_dim) { ////////// TO CHANGE FOR 3D/4D
319 std::ostringstream os;
320 os << "Error. Loaded binary image is " << bin_dim
321 << "D while selected image is " << dim << "D" << std::endl;
322 QMessageBox::information(this,tr("Reading problem"),os.str().c_str());
326 // Add a new roi to the structure
327 int n = mCurrentStructureSet->AddBinaryImageAsNewROI(binaryImage, filename);
328 mLoadedROIIndex.push_back(n);
330 mCurrentStructureSet->GetROI(n)->SetBackgroundValueLabelImage(BG);
332 mCurrentStructureSet->GetROI(n)->SetForegroundValueLabelImage(BG);
335 if (n<mDefaultLUTColor->GetNumberOfTableValues ()) {
336 double * color = mDefaultLUTColor->GetTableValue(n % mDefaultLUTColor->GetNumberOfTableValues ());
337 mCurrentStructureSet->GetROI(n)->SetDisplayColor(color[0], color[1], color[2]);
340 // Add a new roi actor
341 mCurrentStructureSetActor->CreateNewROIActor(n, m_modeBG);
343 // CheckBox for "All"
344 if (mCurrentStructureSetActor->GetROIActor(n)->IsVisible())
345 mNumberOfVisibleROI++;
346 if (mCurrentStructureSetActor->GetROIActor(n)->IsContourVisible())
347 mNumberOfVisibleContourROI++;
348 UpdateAllROIStatus();
350 //------------------------------------------------------------------------------
353 //------------------------------------------------------------------------------
354 void vvToolStructureSetManager::apply()
358 //------------------------------------------------------------------------------
361 //------------------------------------------------------------------------------
362 bool vvToolStructureSetManager::close()
364 //std::cout << "vvToolStructureSetManager::close()" << std::endl;
365 return vvToolWidgetBase::close();
367 //------------------------------------------------------------------------------
370 //------------------------------------------------------------------------------
371 void vvToolStructureSetManager::closeEvent(QCloseEvent *event)
373 //std::cout << "vvToolStructureSetManager::closeEvent()" << std::endl;
374 disconnect(mTree, SIGNAL(itemSelectionChanged()));
376 std::vector<vvSlicerManager*>::iterator iter = std::find(mListOfInputs.begin(), mListOfInputs.end(), mCurrentSlicerManager);
377 if (iter != mListOfInputs.end()) mListOfInputs.erase(iter);
379 // DD("how delete mListOfOpenTool ???");
380 mListOfOpenTool.erase(mCurrentSlicerManager);
382 mCheckBoxShowAll->setCheckState(Qt::Unchecked);
383 mContourCheckBoxShowAll->setCheckState(Qt::Unchecked);
384 if (mCurrentSlicerManager != 0)
385 mCurrentSlicerManager->Render();
388 if (m_NumberOfTool == 1) {
389 mMainWindow->GetTab()->removeTab(mTabNumber);
395 //------------------------------------------------------------------------------
398 //------------------------------------------------------------------------------
399 // CURRENT ROI INTERACTION
400 //------------------------------------------------------------------------------
403 //------------------------------------------------------------------------------
404 void vvToolStructureSetManager::SelectedItemChangedInTree() {
408 // Horrible solution for the problem of triggering this event
409 // after the window has been closed and the object instance
410 // has been destroyed. I couldn't find the place where the
411 // window is destroyed, though.
416 // Search which roi is selected
417 QList<QTreeWidgetItem *> l = mTree->selectedItems();
419 mCurrentROIActor = NULL;
421 mGroupBoxROI->setEnabled(false);
424 QTreeWidgetItem * w = l[0];
425 //std::cout << "selected item -> " << w->text(1).toStdString() << std::endl;
426 //std::cout << "m_NumberOfTool -> " << m_NumberOfTool << std::endl;
427 if (mMapTreeWidgetToROI.find(w) == mMapTreeWidgetToROI.end()) {
428 mCurrentROIActor = NULL;
430 mGroupBoxROI->setEnabled(false);
433 clitk::DicomRT_ROI * roi = mMapTreeWidgetToROI[w];
434 // Get selected roi actor
435 vvROIActor * actor = mStructureSetActorsList[mCurrentStructureSetIndex]->GetROIActor(roi->GetROINumber());
437 mCurrentROIActor = actor;
440 mGroupBoxROI->setEnabled(true);
441 mROInameLabel->setText(roi->GetName().c_str());
442 mCheckBoxShow->setChecked(actor->IsVisible());
443 mContourCheckBoxShow->setChecked(actor->IsContourVisible());
444 mContourWidthSpinBox->setValue(actor->GetContourWidth());
446 // Warning -> avoir unuseful Render here by disconnect slider
447 disconnect(mOpacitySlider, SIGNAL(valueChanged(int)),
448 this, SLOT(OpacityChanged(int)));
449 mOpacitySlider->setValue((int)lrint(actor->GetOpacity()*100));
450 mOpacitySpinBox->setValue((int)lrint(actor->GetOpacity()*100));
451 connect(mOpacitySlider, SIGNAL(valueChanged(int)),
452 this, SLOT(OpacityChanged(int)));
456 mCurrentSlicerManager->Render();
458 //------------------------------------------------------------------------------
461 //------------------------------------------------------------------------------
462 void vvToolStructureSetManager::UpdateAllROIStatus() {
464 int nb = mCurrentStructureSetActor->GetROIList().size();
465 for(int i=0; i<nb; i++) {
466 if (mCurrentStructureSetActor->GetROIList()[i]->IsVisible()) {
471 disconnect(mCheckBoxShowAll, SIGNAL(stateChanged(int)), this, SLOT(AllVisibleROIToggled(int)));
472 disconnect(mContourCheckBoxShowAll, SIGNAL(toggled(bool)), this, SLOT(AllVisibleContourROIToggled(bool)));
473 if (nbVisible == nb) mCheckBoxShowAll->setCheckState(Qt::Checked);
475 if (nbVisible == 0) mCheckBoxShowAll->setCheckState(Qt::Unchecked);
476 else mCheckBoxShowAll->setCheckState(Qt::PartiallyChecked);
478 connect(mContourCheckBoxShowAll, SIGNAL(toggled(bool)), this, SLOT(AllVisibleContourROIToggled(bool)));
479 connect(mCheckBoxShowAll, SIGNAL(stateChanged(int)), this, SLOT(AllVisibleROIToggled(int)));
481 //------------------------------------------------------------------------------
483 //------------------------------------------------------------------------------
484 void vvToolStructureSetManager::VisibleROIToggled(bool b) {
485 if (mCurrentROIActor == NULL) return;
486 if (b == mCurrentROIActor->IsVisible()) return; // nothing to do
487 mCurrentROIActor->SetVisible(b);
488 UpdateAllROIStatus();
489 mCurrentSlicerManager->Render();
491 //------------------------------------------------------------------------------
494 //------------------------------------------------------------------------------
495 void vvToolStructureSetManager::VisibleContourROIToggled(bool b) {
496 if (mCurrentROIActor == NULL) return;
497 if (mCurrentROIActor->IsContourVisible() == b) return; // nothing to do
498 mCurrentROIActor->SetContourVisible(b);
499 mCurrentROIActor->UpdateColor();
500 mCurrentSlicerManager->Render();
502 //------------------------------------------------------------------------------
505 //------------------------------------------------------------------------------
506 void vvToolStructureSetManager::OpacityChanged(int v) {
507 if (mCurrentROIActor == NULL) return;
508 mCurrentROIActor->SetOpacity((double)v/100.0);
509 mCurrentROIActor->UpdateColor();
510 mCurrentSlicerManager->Render();
512 //------------------------------------------------------------------------------
515 //------------------------------------------------------------------------------
516 void vvToolStructureSetManager::AllVisibleROIToggled(int b) {
518 if ((mCheckBoxShowAll->checkState() == Qt::Checked) ||
519 (mCheckBoxShowAll->checkState() == Qt::PartiallyChecked)) status = true;
521 for(int i=0; i<mCurrentStructureSetActor->GetNumberOfROIs(); i++) {
522 mCurrentStructureSetActor->GetROIList()[i]->SetVisible(status);
524 if (status) mCheckBoxShowAll->setCheckState(Qt::Checked);
525 else mCheckBoxShowAll->setCheckState(Qt::Unchecked);
526 mCheckBoxShow->setChecked(status);
527 mCurrentSlicerManager->Render();
529 //------------------------------------------------------------------------------
532 //------------------------------------------------------------------------------
533 void vvToolStructureSetManager::AllVisibleContourROIToggled(bool b) {
535 if ((mContourCheckBoxShowAll->checkState() == Qt::Checked) ||
536 (mContourCheckBoxShowAll->checkState() == Qt::PartiallyChecked)) status = true;
538 for(int i=0; i<mCurrentStructureSetActor->GetNumberOfROIs(); i++) {
539 mCurrentStructureSetActor->GetROIList()[i]->SetContourVisible(status);
541 // Update current selection
542 if (status) mContourCheckBoxShowAll->setCheckState(Qt::Checked);
543 else mContourCheckBoxShowAll->setCheckState(Qt::Unchecked);
544 mContourCheckBoxShow->setChecked(status);
545 mCurrentSlicerManager->Render();
547 //------------------------------------------------------------------------------
550 //------------------------------------------------------------------------------
551 void vvToolStructureSetManager::ChangeColor() {
553 color.setRgbF(mCurrentROIActor->GetROI()->GetDisplayColor()[0],
554 mCurrentROIActor->GetROI()->GetDisplayColor()[1],
555 mCurrentROIActor->GetROI()->GetDisplayColor()[2]);
556 QColor c = QColorDialog::getColor(color, this, "Choose the ROI color");
557 mCurrentROIActor->GetROI()->SetDisplayColor(c.redF(), c.greenF(), c.blueF());
558 mCurrentROIActor->UpdateColor();
560 QTreeWidgetItem * w = mMapROIToTreeWidget[mCurrentROI];
561 QBrush brush(QColor(mCurrentROI->GetDisplayColor()[0]*255,
562 mCurrentROI->GetDisplayColor()[1]*255,
563 mCurrentROI->GetDisplayColor()[2]*255));
564 brush.setStyle(Qt::SolidPattern);
565 w->setBackground(2, brush);
567 mCurrentSlicerManager->Render();
569 //------------------------------------------------------------------------------
572 //------------------------------------------------------------------------------
573 void vvToolStructureSetManager::ChangeContourColor() {
575 color.setRgbF(mCurrentROIActor->GetContourColor()[0],
576 mCurrentROIActor->GetContourColor()[1],
577 mCurrentROIActor->GetContourColor()[2]);
578 QColor c = QColorDialog::getColor(color, this, "Choose the contour color");
579 mCurrentROIActor->SetContourColor(c.redF(), c.greenF(), c.blueF());
580 mCurrentROIActor->UpdateColor();
581 mCurrentSlicerManager->Render();
583 //------------------------------------------------------------------------------
586 //------------------------------------------------------------------------------
587 void vvToolStructureSetManager::ChangeContourWidth(int n) {
588 mCurrentROIActor->SetContourWidth(n);
589 mCurrentROIActor->UpdateColor();
590 mCurrentSlicerManager->Render();
592 //------------------------------------------------------------------------------
595 //------------------------------------------------------------------------------
596 void vvToolStructureSetManager::ReloadCurrentROI() {
598 vvImageReader::Pointer reader = vvImageReader::New();
599 reader->SetInputFilename(mCurrentROI->GetFilename());
600 reader->Update(IMAGE);
601 if (reader->GetLastError() != "") {
602 QMessageBox::information(mMainWindowBase, tr("Sorry, error. Could not reload"), reader->GetLastError().c_str());
605 mCurrentROI->GetImage()->GetFirstVTKImageData()->ReleaseData();
606 mCurrentROI->SetImage(reader->GetOutput());
609 mCurrentROIActor->UpdateImage();
610 mCurrentSlicerManager->Render();
612 //------------------------------------------------------------------------------
615 //------------------------------------------------------------------------------
616 void vvToolStructureSetManager::CheckInputList(std::vector<vvSlicerManager*> & l, int & index)
618 for(unsigned int i=0; i<l.size(); i++) {
619 std::vector<vvSlicerManager*>::iterator iter = std::find(mListOfInputs.begin(), mListOfInputs.end(), l[i]);
620 if (iter != mListOfInputs.end()) {
621 for(unsigned int j=i;j<l.size(); j++) l[j] = l[j+1];
623 if (index == (int)i) index = 0;
628 //------------------------------------------------------------------------------
631 //------------------------------------------------------------------------------
633 vvToolStructureSetManager * vvToolStructureSetManager::AddImage(vvSlicerManager * m, std::string name, vvImage::Pointer image, double BG, bool m_modeBG)
635 // If the tool is open for this vvSlicerManager, use it and return
636 if (mListOfOpenTool[m]) {
637 vvToolStructureSetManager * tool = mListOfOpenTool[m];
638 tool->AddImage(image, name, BG, m_modeBG);
643 // If the tool is not open, create it
644 vvToolStructureSetManager * tool = new vvToolStructureSetManager
645 (CREATOR(vvToolStructureSetManager)->GetMainWindow(), Qt::Dialog, m);
646 tool->AddImage(image, name, BG, m_modeBG);
651 //------------------------------------------------------------------------------