X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=vv%2FvvMainWindow.cxx;h=882bc2b16d631c7cf68233f30ac3fe0c3640cf81;hb=bac54d8f063fa3d0cffedd59edc5996a2378ceab;hp=7117da868c2126a5ebf529ea92dc9b0bf08df72b;hpb=4e8939cad4521503fc448378dd148373bd4d129e;p=clitk.git diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 7117da8..882bc2b 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -160,6 +160,11 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() connect(actionAdd_fusion_image,SIGNAL(triggered()),this,SLOT(SelectFusionImage())); contextActions.push_back(actionAdd_fusion_image); + contextMenu.addSeparator(); + QAction* actionResetMatrix = contextMenu.addAction(QIcon(QString::fromUtf8(":/common/icons/identity.png")), + tr("Reset transformation to identity")); + connect(actionResetMatrix, SIGNAL(triggered()), this,SLOT(ResetTransformationToIdentity())); + // TRIAL DS /* QMenu * m = new QMenu(menubar); @@ -1163,6 +1168,7 @@ void vvMainWindow::ImageInfoChanged() overlayPanel->getOverlayName(mSlicerManagers[index]->GetOverlayName().c_str()); overlayPanel->getOverlayProperty(-1); } + if (mSlicerManagers[index]->GetSlicer(0)->GetFusion()) { overlayPanel->getFusionName(mSlicerManagers[index]->GetFusionName().c_str()); overlayPanel->getFusionProperty(mSlicerManagers[index]->GetFusionOpacity(), @@ -1902,6 +1908,16 @@ void vvMainWindow::SelectFusionImage() } //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +void vvMainWindow::ResetTransformationToIdentity() +{ + std::string actorType = DataTree->selectedItems()[0]->data(1,Qt::UserRole).toString().toStdString(); + int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); + mSlicerManagers[index]->ResetTransformationToIdentity(actorType); + ImageInfoChanged(); +} +//------------------------------------------------------------------------------ + //------------------------------------------------------------------------------ void vvMainWindow::AddFusionImage(int index, QString file) { @@ -2136,9 +2152,9 @@ void vvMainWindow::SetFusionProperty(int opacity, int thresOpacity, int colormap { int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); if (mSlicerManagers[index]->GetSlicer(0)->GetFusion()) { + mSlicerManagers[index]->SetFusionColorMap(colormap); mSlicerManagers[index]->SetFusionOpacity(opacity); mSlicerManagers[index]->SetFusionThresholdOpacity(thresOpacity); - mSlicerManagers[index]->SetFusionColorMap(colormap); mSlicerManagers[index]->SetFusionWindow(window); mSlicerManagers[index]->SetFusionLevel(level); mSlicerManagers[index]->SetColorMap(0);