X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvMainWindow.cxx;h=5266fc15f236f1490d2d0bc40b00cd6510e4f3c8;hb=19293142fbe7d12bfbaec385e9384a14655c41b8;hp=f62198883969d56e456f1d22e0a0a54d85b69d11;hpb=31e7228948005ecc782d2a56bb8faf17a785f83e;p=clitk.git diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index f621988..5266fc1 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -268,6 +268,7 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() connect(colorMapComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(UpdateColorMap())); connect(presetComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(UpdateWindowLevel())); connect(inverseButton,SIGNAL(clicked()),this,SLOT(SwitchWindowLevel())); + connect(applyWindowLevelToAllButton,SIGNAL(clicked()),this,SLOT(ApplyWindowLevelToAllImages())); connect(this,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(ShowContextMenu(QPoint))); @@ -316,6 +317,21 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() if (!CLITK_EXPERIMENTAL) menuExperimental->menuAction()->setVisible(false); + + + QTimer * timerMemory = new QTimer(this); + //timerMemory->setInterval(5); + connect(timerMemory, SIGNAL(timeout()), this, SLOT(UpdateMemoryUsage())); + timerMemory->start(2000); +} +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +void vvMainWindow::UpdateMemoryUsage() +{ + // clitk::PrintMemory(true); + infoPanel->setMemoryInMb(QString::number(clitk::GetMemoryUsageInMb())+" MiB"); } //------------------------------------------------------------------------------ @@ -1495,6 +1511,7 @@ void vvMainWindow::CloseImage(QTreeWidgetItem* item, int column) InitDisplay(); } } + ImageInfoChanged(); } //------------------------------------------------------------------------------ @@ -1616,6 +1633,20 @@ void vvMainWindow::SwitchWindowLevel() } //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +void vvMainWindow::ApplyWindowLevelToAllImages() +{ + for (unsigned int i = 0; i < mSlicerManagers.size(); i++) { + if (mSlicerManagers[i] == NULL) + continue; + mSlicerManagers[i]->SetColorWindow(windowSpinBox->value()); + mSlicerManagers[i]->SetColorLevel(levelSpinBox->value()); + mSlicerManagers[i]->SetPreset(6); + mSlicerManagers[i]->Render(); + } +} +//------------------------------------------------------------------------------ + //------------------------------------------------------------------------------ void vvMainWindow::UpdateLinkManager(std::string id, int slicer, double x, double y, double z, int temps) { @@ -2724,6 +2755,7 @@ vvSlicerManager* vvMainWindow::AddImage(vvImage::Pointer image,std::string filen qApp->processEvents(); // End + ImageInfoChanged(); return slicer_manager; } //------------------------------------------------------------------------------