]> Creatis software - clitk.git/blobdiff - vv/vvMainWindow.cxx
Updating reslice filter information in UpdateDisplayExtent was not enough, calling
[clitk.git] / vv / vvMainWindow.cxx
index c60c04da4771dd2c4ec64c753449161ae410189c..882bc2b16d631c7cf68233f30ac3fe0c3640cf81 100644 (file)
@@ -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);
@@ -910,8 +915,6 @@ void vvMainWindow::LoadImages(std::vector<std::string> files, vvImageReader::Loa
                 this, SLOT(OverlayChanged(int,double,double)));
         connect(mSlicerManagers.back(), SIGNAL(UpdateFusion(int, double)),
                 this, SLOT(FusionChanged(int,double)));
-        connect(mSlicerManagers.back(), SIGNAL(UpdateWindows(int, int, int)),
-                this,SLOT(WindowsChanged(int, int, int)));
         connect(mSlicerManagers.back(), SIGNAL(WindowLevelChanged(double, double,int, int)),
                 this,SLOT(WindowLevelChanged(double, double, int, int)));
         connect(mSlicerManagers.back(), SIGNAL(UpdateSlice(int,int)),
@@ -1165,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(),
@@ -1624,13 +1628,6 @@ void vvMainWindow::FusionChanged(int visibility, double value)
 }
 //------------------------------------------------------------------------------
 
-//------------------------------------------------------------------------------
-void vvMainWindow::WindowsChanged(int window, int view, int slice)
-{
-  infoPanel->setViews(window, view, slice);
-}
-//------------------------------------------------------------------------------
-
 //------------------------------------------------------------------------------
 void vvMainWindow::WindowLevelChanged(double window, double level,int preset,int colormap)
 {
@@ -1911,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)
 {
@@ -2145,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);
@@ -2830,8 +2837,6 @@ vvSlicerManager* vvMainWindow::AddImage(vvImage::Pointer image,std::string filen
           this, SLOT(OverlayChanged(int,double,double)));
   connect(mSlicerManagers.back(), SIGNAL(UpdateFusion(int, double)),
           this, SLOT(FusionChanged(int,double)));
-  connect(mSlicerManagers.back(), SIGNAL(UpdateWindows(int, int, int)),
-          this,SLOT(WindowsChanged(int, int, int)));
   connect(mSlicerManagers.back(), SIGNAL(WindowLevelChanged(double, double,int, int)),
           this,SLOT(WindowLevelChanged(double, double, int, int)));
   connect(mSlicerManagers.back(), SIGNAL(UpdateSlice(int,int)),