X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=vv%2FvvMainWindow.cxx;h=456e9bda79a93f4687ad29f0958d5e7a61466c4e;hb=77ed5552a569a557a4ebbda7477a8f452f7b1dcf;hp=89a888456e6a37a38fb53c4efcd4ac5b638a2286;hpb=91342e828163ad49dbed39426ed4521dbfc64629;p=clitk.git diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 89a8884..456e9bd 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))); @@ -792,7 +793,7 @@ void vvMainWindow::LoadImages(std::vector files, LoadedImageType fi progress.SetProgress(i,fileSize); qApp->processEvents(); - for (int j = 0; j < nSlices[i]; j++) { + for (unsigned int j = 0; j < nSlices[i]; j++) { //read the image and put it in mSlicerManagers vvSlicerManager* imageManager = new vvSlicerManager(4); qApp->processEvents(); @@ -821,6 +822,7 @@ void vvMainWindow::LoadImages(std::vector files, LoadedImageType fi item->setData(0,Qt::UserRole,files[i].c_str()); QFileInfo fileinfo(imageManager->GetFileName().c_str()); //Do not show the path item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName()); + item->setToolTip(COLUMN_IMAGE_NAME,fileinfo.absoluteFilePath()); qApp->processEvents(); //Create the buttons for reload and close @@ -1615,6 +1617,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) { @@ -1727,7 +1743,9 @@ void vvMainWindow::AddOverlayImage(int index, QString file) QTreeWidgetItem *item = new QTreeWidgetItem(); item->setData(0,Qt::UserRole,file.toStdString().c_str()); item->setData(1,Qt::UserRole,tr("overlay")); - item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,filename.c_str()); + QFileInfo fileinfo(file); //Do not show the path + item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName()); + item->setToolTip(COLUMN_IMAGE_NAME,fileinfo.absoluteFilePath()); qApp->processEvents(); for (int j = 1; j <= 4; j++) { @@ -1848,7 +1866,9 @@ void vvMainWindow::AddFusionImage(int index, QString file) QTreeWidgetItem *item = new QTreeWidgetItem(); item->setData(0,Qt::UserRole,file.toStdString().c_str()); item->setData(1,Qt::UserRole,tr("fusion")); - item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,filename.c_str()); + QFileInfo fileinfo(filename.c_str()); //Do not show the path + item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName()); + item->setToolTip(COLUMN_IMAGE_NAME,fileinfo.absoluteFilePath()); qApp->processEvents(); for (int j = 1; j <= 4; j++) { @@ -1931,7 +1951,9 @@ void vvMainWindow::AddFieldEntry(QString filename,int index,bool from_disk) QTreeWidgetItem *item = new QTreeWidgetItem(); item->setData(0,Qt::UserRole,filename.toStdString().c_str()); item->setData(1,Qt::UserRole,tr("vector")); - item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,filename); + QFileInfo fileinfo(filename); //Do not show the path + item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName()); + item->setToolTip(COLUMN_IMAGE_NAME,fileinfo.absoluteFilePath()); qApp->processEvents(); for (int j = 1; j <= 4; j++) {