]> Creatis software - clitk.git/commitdiff
- improve (?) speed render for contours
authordsarrut <dsarrut>
Wed, 12 May 2010 06:21:08 +0000 (06:21 +0000)
committerdsarrut <dsarrut>
Wed, 12 May 2010 06:21:08 +0000 (06:21 +0000)
- correct link bug (seg fault when remove last link)

vv/vvLinkPanel.cxx
vv/vvMainWindow.cxx
vv/vvSlicer.cxx
vv/vvSlicerManager.cxx
vv/vvSlicerManager.h
vv/vvSlicerManagerCommand.cxx

index b57aefdede60755e881c2b58a8711b4287d10156..5cfd853b57c9f7a63bf894476add8787b776e20d 100644 (file)
 
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-======================================================================-====*/
+  ======================================================================-====*/
+
 #ifndef _vvLinkPanel_CXX
 #define _vvLinkPanel_CXX
+
 #include "vvLinkPanel.h"
 #include "clitkCommon.h"
 
 #include <Qt>
 #include "QTreePushButton.h"
 
-//====================================================================
+//------------------------------------------------------------------------------
 vvLinkPanel::vvLinkPanel(QWidget * parent):QWidget(parent)
 {
-    setupUi(this);
-    imageNames.resize(0);
-    image1Ids.resize(0);
-    image2Ids.resize(0);
-
-    linkTableWidget->resizeColumnsToContents();
-    linkTableWidget->verticalHeader()->hide();
-    linkTableWidget->horizontalHeader()->hide();
-    linkTableWidget->hideColumn(4);
-    linkTableWidget->hideColumn(5);
-
-    connect(image1ComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(UpdateComboBox2(int)));
-    connect(linkButton,SIGNAL(clicked()),this,SLOT(addLink()));
-    connect(linkAllButton,SIGNAL(clicked()),this,SLOT(linkAll()));
+  setupUi(this);
+  imageNames.resize(0);
+  image1Ids.resize(0);
+  image2Ids.resize(0);
+
+  linkTableWidget->resizeColumnsToContents();
+  linkTableWidget->verticalHeader()->hide();
+  linkTableWidget->horizontalHeader()->hide();
+  linkTableWidget->hideColumn(4);
+  linkTableWidget->hideColumn(5);
+
+  connect(image1ComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(UpdateComboBox2(int)));
+  connect(linkButton,SIGNAL(clicked()),this,SLOT(addLink()));
+  connect(linkAllButton,SIGNAL(clicked()),this,SLOT(linkAll()));
 }
+//------------------------------------------------------------------------------
+
 
+//------------------------------------------------------------------------------
 void vvLinkPanel::addImage(std::string name, std::string id)
 {
-    imageNames.push_back(name);
-    image1Ids.push_back(id);
-    UpdateComboBox1();
+  imageNames.push_back(name);
+  image1Ids.push_back(id);
+  UpdateComboBox1();
 }
+//------------------------------------------------------------------------------
 
+
+//------------------------------------------------------------------------------
 void vvLinkPanel::removeImage(int index)
 {
-    std::string idRemoved = image1Ids[index];
-    std::vector<std::string>::iterator Nameiter = imageNames.begin();
-    std::vector<std::string>::iterator Iditer = image1Ids.begin();
-    for (int i = 0; i < index; i++)
+  std::string idRemoved = image1Ids[index];
+  std::vector<std::string>::iterator Nameiter = imageNames.begin();
+  std::vector<std::string>::iterator Iditer = image1Ids.begin();
+  for (int i = 0; i < index; i++)
     {
-        Nameiter++;
-        Iditer++;
+      Nameiter++;
+      Iditer++;
     }
-    imageNames.erase(Nameiter);
-    image1Ids.erase(Iditer);
-    UpdateComboBox1();
-    for (int i = linkTableWidget->rowCount() - 1; i >= 0 ;i--)
+  imageNames.erase(Nameiter);
+  image1Ids.erase(Iditer);
+  UpdateComboBox1();
+  for (int i = linkTableWidget->rowCount() - 1; i >= 0 ;i--)
     {
-        if (linkTableWidget->item(i,4)->text().toStdString() == idRemoved ||
-                linkTableWidget->item(i,5)->text().toStdString() == idRemoved)
+      if (linkTableWidget->item(i,4)->text().toStdString() == idRemoved ||
+          linkTableWidget->item(i,5)->text().toStdString() == idRemoved)
         {
-            emit removeLink(linkTableWidget->item(i,4)->text(),linkTableWidget->item(i,5)->text());
-            linkTableWidget->removeRow(i);
-            UpdateComboBox2(image1ComboBox->currentIndex());
+          emit removeLink(linkTableWidget->item(i,4)->text(),linkTableWidget->item(i,5)->text());
+          linkTableWidget->removeRow(i);
+          UpdateComboBox2(image1ComboBox->currentIndex());
         }
     }
 }
+//------------------------------------------------------------------------------
+
 
+//------------------------------------------------------------------------------
 void vvLinkPanel::UpdateComboBox1()
 {
-    image1ComboBox->clear();
-    for (unsigned int i = 0; i < imageNames.size();i++)
+  image1ComboBox->clear();
+  for (unsigned int i = 0; i < imageNames.size();i++)
     {
-        image1ComboBox->addItem(imageNames[i].c_str());
+      image1ComboBox->addItem(imageNames[i].c_str());
     }
 }
+//------------------------------------------------------------------------------
 
+
+//------------------------------------------------------------------------------
 void vvLinkPanel::UpdateComboBox2(int index)
 {
-    image2ComboBox->clear();
-    image2Ids.resize(0);
-    if (imageNames.size() > 1 && index >= 0)
+  image2ComboBox->clear();
+  image2Ids.resize(0);
+  if (imageNames.size() > 1 && index >= 0)
     {
-        for (unsigned int i = 0; i < imageNames.size();i++)
+      for (unsigned int i = 0; i < imageNames.size();i++)
         {
-            if ((int)i != index)
+          if ((int)i != index)
             {
-                bool AlreadyLinked = false;
-                for (int row = 0; row < linkTableWidget->rowCount();row++)
+              bool AlreadyLinked = false;
+              for (int row = 0; row < linkTableWidget->rowCount();row++)
                 {
-                    if ((linkTableWidget->item(row,1)->text().toStdString() == imageNames[index] &&
-                            linkTableWidget->item(row,3)->text().toStdString() == imageNames[i]) ||
-                            (linkTableWidget->item(row,3)->text().toStdString() == imageNames[index] &&
-                             linkTableWidget->item(row,1)->text().toStdString() == imageNames[i]))
+                  if ((linkTableWidget->item(row,1)->text().toStdString() == imageNames[index] &&
+                       linkTableWidget->item(row,3)->text().toStdString() == imageNames[i]) ||
+                      (linkTableWidget->item(row,3)->text().toStdString() == imageNames[index] &&
+                       linkTableWidget->item(row,1)->text().toStdString() == imageNames[i]))
                     {
-                        AlreadyLinked = true;
-                        break;
+                      AlreadyLinked = true;
+                      break;
                     }
                 }
-                if (!AlreadyLinked)
+              if (!AlreadyLinked)
                 {
-                    image2ComboBox->addItem(imageNames[i].c_str());
-                    image2Ids.push_back(image1Ids[i]);
+                  image2ComboBox->addItem(imageNames[i].c_str());
+                  image2Ids.push_back(image1Ids[i]);
                 }
             }
         }
     }
-    if (image2ComboBox->count() == 0)
-        linkButton->setEnabled(0);
-    else
-        linkButton->setEnabled(1);
+  if (image2ComboBox->count() == 0)
+    linkButton->setEnabled(0);
+  else
+    linkButton->setEnabled(1);
 }
+//------------------------------------------------------------------------------
+
 
+//------------------------------------------------------------------------------
 void vvLinkPanel::linkAll()
 {
-    //First remove all links
-    while (linkTableWidget->rowCount())
-        removeLink(1,1);
-    //Now create all possible links
-    int count=image2ComboBox->count();
-    for (int j=0;j<count;j++)
+  //First remove all links
+  while (linkTableWidget->rowCount())
+    removeLink(1,1);
+  //Now create all possible links
+  int count=image2ComboBox->count();
+  for (int j=0;j<count;j++)
     {
-        image1ComboBox->setCurrentIndex(j);
-        image2ComboBox->setCurrentIndex(0);
-        for (int i=0;i< count-j;i++)
-            addLink();
+      image1ComboBox->setCurrentIndex(j);
+      image2ComboBox->setCurrentIndex(0);
+      for (int i=0;i< count-j;i++)
+        addLink();
     }
 }
+//------------------------------------------------------------------------------
 
+
+//------------------------------------------------------------------------------
 void vvLinkPanel::addLink()
 {
-    if (!image1ComboBox->currentText().isEmpty()
-            && !image2ComboBox->currentText().isEmpty())
+  if (!image1ComboBox->currentText().isEmpty()
+      && !image2ComboBox->currentText().isEmpty())
     {
-        int row = linkTableWidget->rowCount();
-        linkTableWidget->insertRow(row);
-
-        linkTableWidget->setItem(row,1,new QTableWidgetItem(image1ComboBox->currentText()));
-        linkTableWidget->setItem(row,2,new QTableWidgetItem("&"));
-        linkTableWidget->setItem(row,3,new QTableWidgetItem(image2ComboBox->currentText()));
-        linkTableWidget->setItem(row,4,new QTableWidgetItem(image1Ids[image1ComboBox->currentIndex()].c_str()));
-        linkTableWidget->setItem(row,5,new QTableWidgetItem(image2Ids[image2ComboBox->currentIndex()].c_str()));
-        QTreePushButton* cButton = new QTreePushButton;
-        cButton->setIndex(linkTableWidget->rowCount());
-        cButton->setColumn(0);
-        cButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/exit.png")));
-        connect(cButton,SIGNAL(clickedInto(int, int)),
-                this,SLOT(removeLink(int, int)));
-        cButton->setToolTip(tr("remove link"));
-        linkTableWidget->setCellWidget(row,0,cButton);
-
-        linkTableWidget->resizeColumnToContents(0);
-        linkTableWidget->resizeColumnToContents(1);
-        linkTableWidget->resizeColumnToContents(2);
-        linkTableWidget->resizeColumnToContents(3);
-        linkTableWidget->setRowHeight(row,17);
-
-        emit addLink(image1Ids[image1ComboBox->currentIndex()].c_str(),
-                     image2Ids[image2ComboBox->currentIndex()].c_str());
-        UpdateComboBox2(image1ComboBox->currentIndex());
+      int row = linkTableWidget->rowCount();
+      linkTableWidget->insertRow(row);
+
+      linkTableWidget->setItem(row,1,new QTableWidgetItem(image1ComboBox->currentText()));
+      linkTableWidget->setItem(row,2,new QTableWidgetItem("&"));
+      linkTableWidget->setItem(row,3,new QTableWidgetItem(image2ComboBox->currentText()));
+      linkTableWidget->setItem(row,4,new QTableWidgetItem(image1Ids[image1ComboBox->currentIndex()].c_str()));
+      linkTableWidget->setItem(row,5,new QTableWidgetItem(image2Ids[image2ComboBox->currentIndex()].c_str()));
+      QTreePushButton* cButton = new QTreePushButton;
+      cButton->setIndex(linkTableWidget->rowCount());
+      cButton->setColumn(0);
+      cButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/exit.png")));
+      connect(cButton,SIGNAL(clickedInto(int, int)),
+              this,SLOT(removeLink(int, int)));
+      cButton->setToolTip(tr("remove link"));
+      linkTableWidget->setCellWidget(row,0,cButton);
+
+      linkTableWidget->resizeColumnToContents(0);
+      linkTableWidget->resizeColumnToContents(1);
+      linkTableWidget->resizeColumnToContents(2);
+      linkTableWidget->resizeColumnToContents(3);
+      linkTableWidget->setRowHeight(row,17);
+
+      emit addLink(image1Ids[image1ComboBox->currentIndex()].c_str(),
+                   image2Ids[image2ComboBox->currentIndex()].c_str());
+      UpdateComboBox2(image1ComboBox->currentIndex());
     }
 
 }
+//------------------------------------------------------------------------------
+
 
+//------------------------------------------------------------------------------
 void vvLinkPanel::removeLink(int row, int column)
 {
-    emit removeLink(linkTableWidget->item(row-1,4)->text(),linkTableWidget->item(row-1,5)->text());
-    linkTableWidget->removeRow(row-1);
-    UpdateComboBox2(image1ComboBox->currentIndex());
+ //  DD(row);
+//   DD(column);
+  while (linkTableWidget->item(row-1,4) == NULL) {
+    --row;
+   //  DD(linkTableWidget->rowCount());
+//     DD(row);
+    // return;
+  }
+  if (linkTableWidget->item(row-1,5) == NULL) {
+    return; // should not happend ...
+  }
+  
+  emit removeLink(linkTableWidget->item(row-1,4)->text(),linkTableWidget->item(row-1,5)->text());
+  // DD("after emit");
+  linkTableWidget->removeRow(row-1);
+  // DD("after removeRow");
+  UpdateComboBox2(image1ComboBox->currentIndex());
+  // DD("end");
 }
+//------------------------------------------------------------------------------
 
 #endif /* end #define _vvLinkPanel_CXX */
 
index 6b5a677bc98bbf45d9159c11fa109fb17123c9ca..af4b65e4fe17e330f77c6cdb436ad02944fa56d0 100644 (file)
@@ -2340,6 +2340,7 @@ void vvMainWindow::SaveAs() {
 }
 //------------------------------------------------------------------------------
 
+
 //------------------------------------------------------------------------------
 void vvMainWindow::AddLink(QString image1,QString image2) {
   for (unsigned int i = 0; i < mSlicerManagers.size();i++)
@@ -2356,8 +2357,10 @@ void vvMainWindow::AddLink(QString image1,QString image2) {
 }
 //------------------------------------------------------------------------------
 
+
 //------------------------------------------------------------------------------
 void vvMainWindow::RemoveLink(QString image1,QString image2) {
+  // DD("vvMainWindow:RemoveLink");
   for (unsigned int i = 0; i < mSlicerManagers.size();i++)
     {
       if (image1.toStdString() == mSlicerManagers[i]->GetId())
@@ -2444,15 +2447,20 @@ void vvMainWindow::SEHorizontalSliderMoved() {
 
 //------------------------------------------------------------------------------
 void vvMainWindow::NOVerticalSliderChanged() {
-  int value = NOVerticalSlider->value();
+  static int value=-1;
+  if (value == NOVerticalSlider->value()) return;
+  else value = NOVerticalSlider->value();                                           
+  //  int value = NOVerticalSlider->value();
   for (unsigned int i = 0; i < mSlicerManagers.size(); i++)
     {
       if (DataTree->topLevelItem(i)->data(COLUMN_UL_VIEW,Qt::CheckStateRole).toInt() > 1)
         {
-          mSlicerManagers[i]->GetSlicer(0)->SetSlice(value);
-          mSlicerManagers[i]->VerticalSliderHasChanged(0, value);
-          mSlicerManagers[i]->UpdateSlice(0);  // <-- DS add this. Not too much update ? YES. but needed for ImageContour ...
-         mSlicerManagers[i]->GetSlicer(0)->Render(); // <-- DS add this, needed for contour, seems ok ? not too slow ? 
+          if (mSlicerManagers[i]->GetSlicer(0)->GetSlice() != value) {
+            mSlicerManagers[i]->GetSlicer(0)->SetSlice(value);
+            mSlicerManagers[i]->VerticalSliderHasChanged(0, value);
+            mSlicerManagers[i]->UpdateSlice(0);  // <-- DS add this. Not too much update ? YES. but needed for ImageContour ...
+            //mSlicerManagers[i]->GetSlicer(0)->Render(); // <-- DS add this, needed for contour, seems ok ? not too slow ? 
+          }
           break;
         }
     }
@@ -2462,15 +2470,20 @@ void vvMainWindow::NOVerticalSliderChanged() {
 
 //------------------------------------------------------------------------------
 void vvMainWindow::NEVerticalSliderChanged() {
-  int value = NEVerticalSlider->value();
+  static int value=-1;
+  if (value == NEVerticalSlider->value()) return;
+  else value = NEVerticalSlider->value();                                           
+  //  int value = NEVerticalSlider->value();
   for (unsigned int i = 0; i < mSlicerManagers.size(); i++)
     {
       if (DataTree->topLevelItem(i)->data(COLUMN_UR_VIEW,Qt::CheckStateRole).toInt() > 1)
         {
-          mSlicerManagers[i]->GetSlicer(1)->SetSlice(value);
-          mSlicerManagers[i]->VerticalSliderHasChanged(1, value);
-         mSlicerManagers[i]->UpdateSlice(1);
-         mSlicerManagers[i]->GetSlicer(1)->Render(); // <-- DS add this, needed for contour, seems ok ? not too slow ? 
+         if (mSlicerManagers[i]->GetSlicer(1)->GetSlice() != value) {
+            mSlicerManagers[i]->GetSlicer(1)->SetSlice(value);
+            mSlicerManagers[i]->VerticalSliderHasChanged(1, value);
+            mSlicerManagers[i]->UpdateSlice(1);
+            //mSlicerManagers[i]->GetSlicer(1)->Render(); // <-- DS add this, needed for contour, seems ok ? not too slow ? 
+          }
           break;
         }
     }
@@ -2480,15 +2493,24 @@ void vvMainWindow::NEVerticalSliderChanged() {
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SOVerticalSliderChanged() {
-  int value = SOVerticalSlider->value();
+  // DD("SOVerticalSliderChanged");
+  static int value=-1;
+  // DD(value);
+//   DD(SOVerticalSlider->value());
+  if (value == SOVerticalSlider->value()) return;
+  else value = SOVerticalSlider->value();                                           
+  //int value = SOVerticalSlider->value();
   for (unsigned int i = 0; i < mSlicerManagers.size(); i++)
     {
       if (DataTree->topLevelItem(i)->data(COLUMN_DL_VIEW,Qt::CheckStateRole).toInt() > 1)
         {
-          mSlicerManagers[i]->GetSlicer(2)->SetSlice(value);
-          mSlicerManagers[i]->VerticalSliderHasChanged(2, value);
-         mSlicerManagers[i]->UpdateSlice(2);
-         mSlicerManagers[i]->GetSlicer(2)->Render(); // <-- DS add this, needed for contour, seems ok ? not too slow ? 
+         if (mSlicerManagers[i]->GetSlicer(2)->GetSlice() != value) {
+           mSlicerManagers[i]->GetSlicer(2)->SetSlice(value);
+           mSlicerManagers[i]->VerticalSliderHasChanged(2, value);
+           mSlicerManagers[i]->UpdateSlice(2);
+           //mSlicerManagers[i]->GetSlicer(2)->Render(); // <-- DS add this, needed for contour, seems ok ? not too slow ? 
+         }
+         // else { DD("avoid SOVerticalSlider slicer update"); }
           break;
         }
     }
@@ -2498,15 +2520,20 @@ void vvMainWindow::SOVerticalSliderChanged() {
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SEVerticalSliderChanged() {
-  int value = SEVerticalSlider->value();
+  static int value=-1;
+  if (value == SEVerticalSlider->value()) return;
+  else value = SEVerticalSlider->value();                                           
+  // int value = SEVerticalSlider->value();
   for (unsigned int i = 0; i < mSlicerManagers.size(); i++)
     {
       if (DataTree->topLevelItem(i)->data(COLUMN_DR_VIEW,Qt::CheckStateRole).toInt() > 1)
         {
-          mSlicerManagers[i]->GetSlicer(3)->SetSlice(value);
-          mSlicerManagers[i]->VerticalSliderHasChanged(3, value);
-         mSlicerManagers[i]->UpdateSlice(3);
-         mSlicerManagers[i]->GetSlicer(3)->Render(); // <-- DS add this, needed for contour, seems ok ? not too slow ? 
+          if (mSlicerManagers[i]->GetSlicer(3)->GetSlice() != value) {
+            mSlicerManagers[i]->GetSlicer(3)->SetSlice(value);
+            mSlicerManagers[i]->VerticalSliderHasChanged(3, value);
+            mSlicerManagers[i]->UpdateSlice(3);
+            //mSlicerManagers[i]->GetSlicer(3)->Render(); // <-- DS add this, needed for contour, seems ok ? not too slow ? 
+          }
           break;
         }
     }
@@ -2516,16 +2543,26 @@ void vvMainWindow::SEVerticalSliderChanged() {
 
 //------------------------------------------------------------------------------
 void vvMainWindow::UpdateSlice(int slicer, int slice) {
+  // DD("vvMainWindow::UpdateSlice");
+//   DD(slicer);
+//   DD(slice);
   if (slicer == 0) {
-    if (slice != NOVerticalSlider->value())
-      NOVerticalSlider->setValue(slice);
+    //    if (slice != NOVerticalSlider->value())
+    NOVerticalSlider->setValue(slice);
   }
-  else if (slicer == 1)
+  else {
+    if (slicer == 1)
     NEVerticalSlider->setValue(slice);
-  else if (slicer == 2)
-    SOVerticalSlider->setValue(slice);
-  else if (slicer == 3)
-    SEVerticalSlider->setValue(slice);
+    else {
+      if (slicer == 2)
+       SOVerticalSlider->setValue(slice);
+      else {
+       if (slicer == 3)
+         SEVerticalSlider->setValue(slice);
+      }
+    }
+  }
+  // DD("vvMainWindow:UpdateSlice END");
 }
 //------------------------------------------------------------------------------
 
index 3b585b21b838d4d6039853f67ee60eb0ea7f369d..9a2eec41414a0a8193322717ed71bbf47dc7881d 100644 (file)
@@ -1256,7 +1256,7 @@ void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max)
 void vvSlicer::Render()
 {
   //  DD("vvSlicer::Render");
-  //DD(SliceOrientation);
+  // DD(SliceOrientation);
   if (this->GetWindowLevel()->GetLookupTable() && !this->mOverlay && !this->mFusion)
     {
       legend->SetLookupTable(this->GetWindowLevel()->GetLookupTable());
index 344fa73b7e8008e709fbde8beea1cb06056b61c5..ca66064e1f64608fe0f4d1e225926ffcc1ac67ee 100644 (file)
@@ -582,6 +582,10 @@ void vvSlicerManager::SetOpacity(int i, double factor)
 //----------------------------------------------------------------------------
 void vvSlicerManager::UpdateViews(int current,int slicer)
 {
+  // DD("UpdateViews");
+//   DD(current);
+//   DD(slicer);
+
   double x = (mSlicers[slicer]->GetCurrentPosition()[0] - mSlicers[slicer]->GetInput()->GetOrigin()[0])
     /mSlicers[slicer]->GetInput()->GetSpacing()[0];
   double y = (mSlicers[slicer]->GetCurrentPosition()[1] - mSlicers[slicer]->GetInput()->GetOrigin()[1])
@@ -729,8 +733,10 @@ double vvSlicerManager::GetColorLevel()
 //----------------------------------------------------------------------------
 void vvSlicerManager::Render()
 {
+  // DD("vvSlicerManager::Render");
   for ( unsigned int i = 0; i < mSlicers.size(); i++)
     {
+     //  DD(i);
       mSlicers[i]->Render();
     }
 }
@@ -974,6 +980,7 @@ void vvSlicerManager::UpdateSlice(int slicer)
     return;
   }
   emit UpdateSlice(slicer, mSlicers[slicer]->GetSlice());
+  mSlicers[slicer]->Render(); // DS <-- I add this, this could/must be the only Render ...
   mPreviousSlice[slicer] = mSlicers[slicer]->GetSlice();
 }
 //----------------------------------------------------------------------------
index a5eccce4e0610bc86da2f1c1e5ffdbc7e90891b2..5d8d5d2d846890c35e024f99e5e988bbf20ca3c4 100644 (file)
@@ -164,7 +164,7 @@ class vvSlicerManager : public QObject {
     mLinkedId.push_back(newId);
   }
   void RemoveLink(std::string oldId) {
-    mLinkedId.remove(oldId);
+    mLinkedId.remove(oldId); 
   }
 
   ///Remove the actor defined by its type and index (example: 3rd contour)
index 5b35bdd826e9eb94797518a8fcd5f565a9e949bb..f29263b76c34347e66258d9677722c9c05cd71e9 100644 (file)
@@ -247,9 +247,13 @@ void vvSlicerManagerCommand::Execute(vtkObject *caller,
                 }
                 if (KeyPress == "Up")
                 {
-                    this->SM->GetSlicer(VisibleInWindow)->SetSlice(this->SM->GetSlicer(VisibleInWindow)->GetSlice()+1);
-                    this->SM->UpdateSlice(VisibleInWindow);
-                    this->SM->UpdateInfoOnCursorPosition(VisibleInWindow);
+                 DD("------------ up");
+                 this->SM->GetSlicer(VisibleInWindow)->SetSlice(this->SM->GetSlicer(VisibleInWindow)->GetSlice()+1);
+                 DD("------------ after set slice");
+                 this->SM->UpdateInfoOnCursorPosition(VisibleInWindow);
+                 DD("------------ after UpdateInfoOnCursorPosition");
+                 this->SM->UpdateSlice(VisibleInWindow);
+                 DD("------------ after updateslice");
                 }
                 if (KeyPress == "Down")
                 {