X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=inline;f=vv%2FvvMainWindow.cxx;h=83fb2f4dc67476104f74ca9175d46ccb87254a7b;hb=9af6cf90d6f7f3d6c57a406301c21927ac33694b;hp=10df05bce2682c3de4c0348207f68a58ffbdd970;hpb=c2ab58be4d4d65c577a944df6849c70387b1095f;p=clitk.git diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 10df05b..83fb2f4 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -161,15 +161,12 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() contextMenu.addAction(actionAdd_VF_to_current_Image); contextActions.push_back(actionAdd_VF_to_current_Image); - QAction* actionAdd_Overlay_to_current_Image = menuOverlay->addAction(QIcon(QString::fromUtf8(":/common/icons/GPSup.png")), - tr("Add overlay image to current image")); - contextMenu.addAction(actionAdd_Overlay_to_current_Image); - contextActions.push_back(actionAdd_Overlay_to_current_Image); - - connect(actionAdd_Overlay_to_current_Image,SIGNAL(triggered()), this,SLOT(SelectOverlayImage())); + //QAction* actionAdd_Overlay_to_current_Image = menuOverlay->addAction(QIcon(QString::fromUtf8(":/common/icons/GPSup.png")), + // tr("Add overlay image to current image")); + contextMenu.addAction(actionAdd_overlay_image_to_current_image); + contextActions.push_back(actionAdd_overlay_image_to_current_image); contextMenu.addAction(actionAdd_fusion_image); - connect(actionAdd_fusion_image,SIGNAL(triggered()),this,SLOT(SelectFusionImage())); contextActions.push_back(actionAdd_fusion_image); contextMenu.addSeparator(); @@ -221,7 +218,7 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() dicomSeriesSelector = new vvDicomSeriesSelector(); inverseButton->setEnabled(0); - actionAdd_Overlay_to_current_Image->setEnabled(0); + actionAdd_overlay_image_to_current_image->setEnabled(0); actionSave_As->setEnabled(0); actionAdd_VF_to_current_Image->setEnabled(0); actionAdd_fusion_image->setEnabled(0); @@ -271,7 +268,8 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() connect(actionRead_saved_state,SIGNAL(triggered()),this,SLOT(ReadSavedState())); connect(actionExit,SIGNAL(triggered()),this,SLOT(close())); connect(actionAdd_VF_to_current_Image,SIGNAL(triggered()),this,SLOT(OpenField())); - connect(actionNavigation_Help,SIGNAL(triggered()),this,SLOT(ShowHelpDialog())); + connect(actionAdd_fusion_image,SIGNAL(triggered()),this,SLOT(SelectFusionImage())); + connect(actionAdd_overlay_image_to_current_image,SIGNAL(triggered()), this,SLOT(SelectOverlayImage())); connect(actionNavigation_Help,SIGNAL(triggered()),this,SLOT(ShowHelpDialog())); connect(actionDocumentation,SIGNAL(triggered()),this,SLOT(ShowDocumentation())); connect(actionRegister_vv,SIGNAL(triggered()),this,SLOT(PopupRegisterForm())); @@ -306,7 +304,6 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() connect(this,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(ShowContextMenu(QPoint))); -#include "vvSaveState.h" connect(linkPanel,SIGNAL(addLink(QString,QString)),this,SLOT(AddLink(QString,QString))); connect(linkPanel,SIGNAL(removeLink(QString,QString)),this,SLOT(RemoveLink(QString,QString))); connect(overlayPanel,SIGNAL(VFPropertyUpdated(int,int,int,int,double,double,double)),this,SLOT(SetVFProperty(int,int,int,int,double,double,double))); @@ -1038,6 +1035,7 @@ void vvMainWindow::ImageInfoChanged() actionSave_As->setEnabled(1); actionAdd_VF_to_current_Image->setEnabled(1); actionAdd_fusion_image->setEnabled(1); + actionAdd_overlay_image_to_current_image->setEnabled(1); actionNorth_East_Window->setEnabled(1); actionNorth_West_Window->setEnabled(1); actionSouth_East_Window->setEnabled(1); @@ -1720,11 +1718,16 @@ void vvMainWindow::SwitchWindowLevel() //------------------------------------------------------------------------------ void vvMainWindow::ApplyWindowLevelToAllImages() { + int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); + if(index==-1) return; + double window = mSlicerManagers[index]->GetColorWindow(); + double level = mSlicerManagers[index]->GetColorLevel(); + 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]->SetColorWindow(window); + mSlicerManagers[i]->SetColorLevel(level); mSlicerManagers[i]->SetPreset(6); mSlicerManagers[i]->Render(); } @@ -2372,10 +2375,13 @@ void vvMainWindow::RemoveLink(QString image1,QString image2) //------------------------------------------------------------------------------ void vvMainWindow::ChangeImageWithIndexOffset(vvSlicerManager *sm, int slicer, int offset) { + if(mSlicerManagers.size()==1) + return; + int index = 0; while(sm != mSlicerManagers[index]) index++; - index = (index+offset) % mSlicerManagers.size(); + index = (index+offset+mSlicerManagers.size()) % mSlicerManagers.size(); QTreeWidgetItem* item = GetItemFromSlicerManager(mSlicerManagers[index]); item->setData(slicer+1,Qt::CheckStateRole,2); //change checkbox @@ -2657,7 +2663,7 @@ void vvMainWindow::SaveScreenshotAllSlices() "Images( *.png);;Images( *.jpg)"); // Loop on slices - for(uint i=0; iSetSlice(i); // -> change the slice of the current slicer SM->UpdateSlice(0); // --> this one emit UpdateSlice