Authors belong to:
- University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
+ - Léon Bérard cancer center http://www.centreleonberard.fr
- CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
This software is distributed WITHOUT ANY WARRANTY; without even
- BSD See included LICENSE.txt file
- CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
- ======================================================================-====*/
+ ===========================================================================**/
// vv
#include "vvToolStructureSetManager.h"
#include <QFileDialog>
#include <QMessageBox>
#include <QColorDialog>
-
+#include <QAbstractEventDispatcher>
+
// vtk
#include <vtkLookupTable.h>
#include <vtkRenderWindow.h>
//------------------------------------------------------------------------------
vvToolStructureSetManager::~vvToolStructureSetManager()
{
- disconnect(mTree, SIGNAL(itemSelectionChanged()), this, SLOT(SelectedItemChangedInTree()));
m_NumberOfTool--;
+
+ // clearing the list at this point avoids
+ // segfaulting due to events being dispatched
+ // after object destruction
+ mTreeWidgetList.clear();
+ mTree->clearSelection();
+
+ //std::cout << "vvToolStructureSetManager::~vvToolStructureSetManager()" << std::endl;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolStructureSetManager::InputIsSelected(vvSlicerManager *m)
{
+ //std::cout << "vvToolStructureSetManager::InputIsSelected()" << std::endl;
+
//int mTabNumber = parent->GetTab()->addTab(this, "");
// this->setFixedWidth(120);
//this->setPreferedHeight(441);
std::vector<std::string> filenames;
filenames.push_back(filename[i].toStdString());
reader->SetInputFilenames(filenames);
- reader->Update(IMAGE);
+ reader->Update(vvImageReader::IMAGE);
QApplication::restoreOverrideCursor();
if (reader->GetLastError().size() != 0) {
AddImage(binaryImage, filename[i].toStdString(), mBackgroundValueSpinBox->value());
mOpenedBinaryImage.push_back(binaryImage);
}
+
UpdateImage();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool vvToolStructureSetManager::close()
{
+ //std::cout << "vvToolStructureSetManager::close()" << std::endl;
+
return vvToolWidgetBase::close();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolStructureSetManager::closeEvent(QCloseEvent *event)
{
+ //std::cout << "vvToolStructureSetManager::closeEvent()" << std::endl;
+
std::vector<vvSlicerManager*>::iterator iter = std::find(mListOfInputs.begin(), mListOfInputs.end(), mCurrentSlicerManager);
if (iter != mListOfInputs.end()) mListOfInputs.erase(iter);
mCheckBoxShowAll->setCheckState(Qt::Unchecked);
mContourCheckBoxShowAll->setCheckState(Qt::Unchecked);
- if (mCurrentSlicerManager != 0) mCurrentSlicerManager->Render();
- if (mCurrentStructureSetActor) {
- for(int i=0; i<mCurrentStructureSetActor->GetNumberOfROIs(); i++) {
- mCurrentStructureSetActor->GetROIList()[i]->SetVisible(false);
- mCurrentStructureSetActor->GetROIList()[i]->SetContourVisible(false);
- delete mCurrentStructureSetActor->GetROIList()[i];
- }
- }
+ if (mCurrentSlicerManager != 0)
+ mCurrentSlicerManager->Render();
if (!isWindow()) {
if (m_NumberOfTool == 1) {
//------------------------------------------------------------------------------
void vvToolStructureSetManager::SelectedItemChangedInTree() {
+
// Search which roi is selected
QList<QTreeWidgetItem *> l = mTree->selectedItems();
if (l.size() == 0) {
return;
}
QTreeWidgetItem * w = l[0];
+ //std::cout << "selected item -> " << w->text(1).toStdString() << std::endl;
+ //std::cout << "m_NumberOfTool -> " << m_NumberOfTool << std::endl;
if (mMapTreeWidgetToROI.find(w) == mMapTreeWidgetToROI.end()) {
mCurrentROIActor = NULL;
mCurrentROI = NULL;
// Reload image
vvImageReader::Pointer reader = vvImageReader::New();
reader->SetInputFilename(mCurrentROI->GetFilename());
- reader->Update(IMAGE);
+ reader->Update(vvImageReader::IMAGE);
if (reader->GetLastError() != "") {
QMessageBox::information(mMainWindowBase, tr("Sorry, error. Could not reload"), reader->GetLastError().c_str());
return;