]> Creatis software - clitk.git/commitdiff
- add "convert to" in context menu
authordsarrut <dsarrut>
Mon, 29 Mar 2010 07:48:55 +0000 (07:48 +0000)
committerdsarrut <dsarrut>
Mon, 29 Mar 2010 07:48:55 +0000 (07:48 +0000)
33 files changed:
filters/clitkImageConvertGenericFilter.cxx
filters/clitkImageConvertGenericFilter.h
vv/CMakeLists.txt
vv/qt_ui/vvDocumentation.ui
vv/qt_ui/vvLandmarksPanel.ui
vv/qt_ui/vvMainWindow.ui
vv/qt_ui/vvOverlayPanel.ui
vv/qt_ui/vvProgressDialog.ui
vv/qt_ui/vvToolImageArithm.ui
vv/qt_ui/vvTools.ui
vv/vvIcons.qrc
vv/vvImageContour.cxx
vv/vvLinkPanel.cxx
vv/vvMainWindow.cxx
vv/vvMainWindowBase.h
vv/vvSlicer.cxx
vv/vvSlicerManager.cxx
vv/vvSlicerManager.h
vv/vvToolBase.cxx
vv/vvToolBase.h
vv/vvToolBase.txx
vv/vvToolBaseBase.h
vv/vvToolBinarize.cxx
vv/vvToolCreator.h
vv/vvToolCreator.txx
vv/vvToolCreatorBase.cxx
vv/vvToolCreatorBase.h
vv/vvToolCreatorBase.txx
vv/vvToolCropImage.h
vv/vvToolFoo.cxx
vv/vvToolFooWithWidgetBase.cxx
vv/vvToolImageArithm.cxx
vv/vvToolManager.cxx

index 326f06f14f202ba3be38f2da62b03e7a9d6753a4..9f35379c0e1a59d71d8354e31ada484370e9aae9 100644 (file)
 
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-======================================================================-====*/
+  ======================================================================-====*/
 #ifndef CLITKIMAGECONVERTGENERICFILTER_CXX
 #define CLITKIMAGECONVERTGENERICFILTER_CXX
-/**
- -------------------------------------------------
- * @file   clitkImageConvertGenericFilter.cxx
- * @author David Sarrut <david.sarrut@creatis.insa-lyon.fr>
- * @date   05 May 2008 10:57:19
- * 
- * @brief  
- * 
- * 
- -------------------------------------------------*/
 
 #include "clitkImageConvertGenericFilter.h"
 
@@ -34,6 +24,9 @@
 clitk::ImageConvertGenericFilter::ImageConvertGenericFilter():
   clitk::ImageToImageGenericFilter<Self>("ImageConvert") {
   mOutputPixelTypeName = "NotSpecified";
+  mWarningOccur = false;
+  mWarning = "";
+  mDisplayWarning = true;
   InitializeImageType<2>();
   InitializeImageType<3>();  
   InitializeImageType<4>();  
@@ -45,6 +38,7 @@ clitk::ImageConvertGenericFilter::ImageConvertGenericFilter():
 template<unsigned int Dim>
 void clitk::ImageConvertGenericFilter::InitializeImageType() {      
   ADD_IMAGE_TYPE(Dim, char);
+  ADD_IMAGE_TYPE(Dim, unsigned char);
   ADD_IMAGE_TYPE(Dim, short);
   ADD_IMAGE_TYPE(Dim, unsigned short);
   ADD_IMAGE_TYPE(Dim, int);
@@ -84,10 +78,10 @@ void clitk::ImageConvertGenericFilter::UpdateWithInputImageType() {
     this->SetNextOutput<InputImageType>(input);
   }
   else {
-#define TRY_TYPE(TYPE) \
+#define TRY_TYPE(TYPE)                                                 \
     if (IsSameType<TYPE>(mOutputPixelTypeName)) { UpdateWithOutputType<InputImageType, TYPE>(); return; }
     TRY_TYPE(char);
-    // TRY_TYPE(signed char);
+    //    TRY_TYPE(signed char);
     TRY_TYPE(uchar);
     TRY_TYPE(short);
     TRY_TYPE(ushort);
@@ -114,29 +108,39 @@ void clitk::ImageConvertGenericFilter::UpdateWithOutputType() {
   typedef typename InputImageType::PixelType PixelType;
 
   // Warning
+  std::ostringstream osstream;
   if (std::numeric_limits<PixelType>::is_signed) {
     if (!std::numeric_limits<OutputPixelType>::is_signed) {
-      std::cerr << "Warning, input type is signed (" << mPixelTypeName << ") while output type is not (" 
-               << mOutputPixelTypeName << "), use at your own responsability." << std::endl;
+      osstream << "Warning, input type is signed (" << mPixelTypeName << ") while output type is not (" 
+              << mOutputPixelTypeName << "), use at your own responsability." << std::endl;
+      mWarningOccur = true;      
     }
   }
   if (!std::numeric_limits<PixelType>::is_integer) {
     if (std::numeric_limits<OutputPixelType>::is_integer) {
-      std::cerr << "Warning, input type is not integer (" << mPixelTypeName << ") while output type is (" 
-               << mOutputPixelTypeName << "), use at your own responsability." << std::endl;
+      osstream << "Warning, input type is not integer (" << mPixelTypeName << ") while output type is (" 
+              << mOutputPixelTypeName << "), use at your own responsability." << std::endl;
+      mWarningOccur = true;
     }
   }
   //  DD(std::numeric_limits<PixelType>::digits10);
   // DD(std::numeric_limits<OutputPixelType>::digits10);
   if (!std::numeric_limits<PixelType>::is_integer) {
     if (std::numeric_limits<OutputPixelType>::is_integer) {
-      std::cerr << "Warning, input type is not integer (" << mPixelTypeName << ") while output type is (" 
-               << mOutputPixelTypeName << "), use at your own responsability." << std::endl;
+      osstream << "Warning, input type is not integer (" << mPixelTypeName << ") while output type is (" 
+              << mOutputPixelTypeName << "), use at your own responsability." << std::endl;
+      mWarningOccur = true;
     }
   }
   if (std::numeric_limits<PixelType>::digits10 > std::numeric_limits<OutputPixelType>::digits10) {
-    std::cerr << "Warning, possible loss of precision : input type is (" << mPixelTypeName << ") while output type is (" 
-               << mOutputPixelTypeName << "), use at your own responsability." << std::endl;
+    osstream << "Warning, possible loss of precision : input type is (" << mPixelTypeName << ") while output type is (" 
+            << mOutputPixelTypeName << "), use at your own responsability." << std::endl;
+    mWarningOccur = true;
+  }
+
+  mWarning = osstream.str();
+  if (mDisplayWarning) {
+    std::cerr << mWarning;
   }
 
   // Cast
index 19caaefec6916465e453f0a3fe56bc78cfeb5d6d..8bbca3c0890bbf5ea8093094b7fa52417d34e596 100644 (file)
@@ -52,6 +52,9 @@ namespace clitk {
     
     // Members functions
     void SetOutputPixelType(std::string p) { mOutputPixelTypeName = p; }
+    bool IsWarningOccur() { return mWarningOccur; }
+    std::string & GetWarning() { return mWarning; }
+    void EnableDisplayWarning(bool b) { mDisplayWarning = b; }
 
     //--------------------------------------------------------------------
     // Main function called each time the filter is updated
@@ -61,6 +64,9 @@ namespace clitk {
   protected:
     template<unsigned int Dim> void InitializeImageType();
     std::string mOutputPixelTypeName;
+    std::string mWarning;
+    bool mWarningOccur;
+    bool mDisplayWarning;
 
     template<class InputImageType, class OutputPixelType> void UpdateWithOutputType();
 
index 9d9c89fd0f742596a2ff52b520b6d43811c3289a..fb3fc0341a6e93a1b6cf8fa37b90120a0791269a 100644 (file)
@@ -111,6 +111,7 @@ SET(vv_SRCS
   vvToolInputSelectorWidget.cxx
   vvImageContour.cxx
   vvToolImageArithm.cxx
+  vvToolConvert.cxx
   )
 
 QT4_WRAP_CPP(vv_SRCS 
@@ -141,6 +142,7 @@ QT4_WRAP_CPP(vv_SRCS
   vvToolWidgetBase.h
   vvToolCropImage.h
   vvToolImageArithm.h
+  vvToolConvert.h
   )
 
 QT4_WRAP_UI(vv_UI_CXX 
index 8bb079250eb598ee11aa7684f9ad1d74c92d4802..e9be858a431716b3649a574c8375cfcecdf11f1b 100644 (file)
@@ -31,7 +31,7 @@
       <string/>
      </property>
      <property name="pixmap">
-      <pixmap resource="vvIcons.qrc">:/new/prefix1/icons/splashscreen2.png</pixmap>
+      <pixmap resource="vvIcons.qrc">:/common/icons/splashscreen2.png</pixmap>
      </property>
      <property name="scaledContents">
       <bool>true</bool>
index d0bec19b7ff77d2a01cf4ac9c9c1c2db91cc0306..fd0872396e1eed58fd2122405f3693f44ecf5534 100644 (file)
@@ -88,7 +88,7 @@ p, li { white-space: pre-wrap; }
      </property>
      <property name="icon">
       <iconset resource="../vvIcons.qrc">
-       <normaloff>:/new/prefix1/icons/undo.png</normaloff>:/new/prefix1/icons/undo.png</iconset>
+       <normaloff>:/common/icons/undo.png</normaloff>:/common/icons/undo.png</iconset>
      </property>
     </widget>
    </item>
@@ -112,7 +112,7 @@ p, li { white-space: pre-wrap; }
      </property>
      <property name="icon">
       <iconset resource="../vvIcons.qrc">
-       <normaloff>:/new/prefix1/icons/open.png</normaloff>:/new/prefix1/icons/open.png</iconset>
+       <normaloff>:/common/icons/open.png</normaloff>:/common/icons/open.png</iconset>
      </property>
     </widget>
    </item>
@@ -123,7 +123,7 @@ p, li { white-space: pre-wrap; }
      </property>
      <property name="icon">
       <iconset resource="../vvIcons.qrc">
-       <normaloff>:/new/prefix1/icons/filesave.png</normaloff>:/new/prefix1/icons/filesave.png</iconset>
+       <normaloff>:/common/icons/filesave.png</normaloff>:/common/icons/filesave.png</iconset>
      </property>
     </widget>
    </item>
index a81f942b399dfd0a430c7a262a95a98ebfd2624e..011b4dc82f532e5a8afcf18fee0e86afafa044f6 100644 (file)
@@ -21,7 +21,7 @@
   </property>
   <property name="windowIcon">
    <iconset resource="../vvIcons.qrc">
-    <normaloff>:/new/prefix1/icons/ducky.png</normaloff>:/new/prefix1/icons/ducky.png</iconset>
+    <normaloff>:/common/icons/ducky.png</normaloff>:/common/icons/ducky.png</iconset>
   </property>
   <property name="statusTip">
    <string>Type 'h' on image to display help on navigation</string>
@@ -99,7 +99,7 @@
          </property>
          <property name="icon">
           <iconset resource="../vvIcons.qrc">
-           <normaloff>:/new/prefix1/icons/cross.png</normaloff>:/new/prefix1/icons/cross.png</iconset>
+           <normaloff>:/common/icons/cross.png</normaloff>:/common/icons/cross.png</iconset>
          </property>
         </widget>
        </item>
          </property>
          <property name="icon">
           <iconset resource="../vvIcons.qrc">
-           <normaloff>:/new/prefix1/icons/player_play.png</normaloff>:/new/prefix1/icons/player_play.png</iconset>
+           <normaloff>:/common/icons/player_play.png</normaloff>:/common/icons/player_play.png</iconset>
          </property>
         </widget>
        </item>
          </property>
          <property name="icon">
           <iconset resource="../vvIcons.qrc">
-           <normaloff>:/new/prefix1/icons/invertcolor.png</normaloff>:/new/prefix1/icons/invertcolor.png</iconset>
+           <normaloff>:/common/icons/invertcolor.png</normaloff>:/common/icons/invertcolor.png</iconset>
          </property>
         </widget>
        </item>
          </property>
          <property name="icon">
           <iconset resource="../vvIcons.qrc">
-           <normaloff>:/new/prefix1/icons/adjustsize.png</normaloff>:/new/prefix1/icons/adjustsize.png</iconset>
+           <normaloff>:/common/icons/adjustsize.png</normaloff>:/common/icons/adjustsize.png</iconset>
          </property>
         </widget>
        </item>
   <action name="actionLoad_images">
    <property name="icon">
     <iconset resource="../vvIcons.qrc">
-     <normaloff>:/new/prefix1/icons/fileopen.png</normaloff>:/new/prefix1/icons/fileopen.png</iconset>
+     <normaloff>:/common/icons/fileopen.png</normaloff>:/common/icons/fileopen.png</iconset>
    </property>
    <property name="text">
     <string>Open image(s)</string>
   <action name="actionExit">
    <property name="icon">
     <iconset resource="../vvIcons.qrc">
-     <normaloff>:/new/prefix1/icons/exit.png</normaloff>:/new/prefix1/icons/exit.png</iconset>
+     <normaloff>:/common/icons/exit.png</normaloff>:/common/icons/exit.png</iconset>
    </property>
    <property name="text">
     <string>Exit</string>
   <action name="actionOpen_Dicom">
    <property name="icon">
     <iconset resource="../vvIcons.qrc">
-     <normaloff>:/new/prefix1/icons/open.png</normaloff>:/new/prefix1/icons/open.png</iconset>
+     <normaloff>:/common/icons/open.png</normaloff>:/common/icons/open.png</iconset>
    </property>
    <property name="text">
     <string>Open Dicom</string>
   <action name="actionOpen_Multiple_Images_As_One">
    <property name="icon">
     <iconset resource="../vvIcons.qrc">
-     <normaloff>:/new/prefix1/icons/open.png</normaloff>:/new/prefix1/icons/open.png</iconset>
+     <normaloff>:/common/icons/open.png</normaloff>:/common/icons/open.png</iconset>
    </property>
    <property name="text">
     <string>Open several xD images into a single (x+1) D</string>
   <action name="actionSave_As">
    <property name="icon">
     <iconset resource="../vvIcons.qrc">
-     <normaloff>:/new/prefix1/icons/filesave.png</normaloff>:/new/prefix1/icons/filesave.png</iconset>
+     <normaloff>:/common/icons/filesave.png</normaloff>:/common/icons/filesave.png</iconset>
    </property>
    <property name="text">
     <string>Save current image</string>
   <action name="actionAdd_VF_to_current_Image">
    <property name="icon">
     <iconset resource="../vvIcons.qrc">
-     <normaloff>:/new/prefix1/icons/cursor-uparrow.png</normaloff>:/new/prefix1/icons/cursor-uparrow.png</iconset>
+     <normaloff>:/common/icons/cursor-uparrow.png</normaloff>:/common/icons/cursor-uparrow.png</iconset>
    </property>
    <property name="text">
     <string>Add deformation field to current image</string>
   <action name="actionNorth_West_Window">
    <property name="icon">
     <iconset resource="../vvIcons.qrc">
-     <normaloff>:/new/prefix1/icons/NOgrid.png</normaloff>:/new/prefix1/icons/NOgrid.png</iconset>
+     <normaloff>:/common/icons/NOgrid.png</normaloff>:/common/icons/NOgrid.png</iconset>
    </property>
    <property name="text">
     <string>Save image in TL</string>
   <action name="actionNorth_East_Window">
    <property name="icon">
     <iconset resource="../vvIcons.qrc">
-     <normaloff>:/new/prefix1/icons/NEgrid.png</normaloff>:/new/prefix1/icons/NEgrid.png</iconset>
+     <normaloff>:/common/icons/NEgrid.png</normaloff>:/common/icons/NEgrid.png</iconset>
    </property>
    <property name="text">
     <string>Save image in TR</string>
   <action name="actionSouth_West_Window">
    <property name="icon">
     <iconset resource="../vvIcons.qrc">
-     <normaloff>:/new/prefix1/icons/SOgrid.png</normaloff>:/new/prefix1/icons/SOgrid.png</iconset>
+     <normaloff>:/common/icons/SOgrid.png</normaloff>:/common/icons/SOgrid.png</iconset>
    </property>
    <property name="text">
     <string>Save image in BL</string>
   <action name="actionSouth_East_Window">
    <property name="icon">
     <iconset resource="../vvIcons.qrc">
-     <normaloff>:/new/prefix1/icons/SEgrid.png</normaloff>:/new/prefix1/icons/SEgrid.png</iconset>
+     <normaloff>:/common/icons/SEgrid.png</normaloff>:/common/icons/SEgrid.png</iconset>
    </property>
    <property name="text">
     <string>Save image in BR</string>
   <action name="actionOpen_Image_With_Time">
    <property name="icon">
     <iconset resource="../vvIcons.qrc">
-     <normaloff>:/new/prefix1/icons/open.png</normaloff>:/new/prefix1/icons/open.png</iconset>
+     <normaloff>:/common/icons/open.png</normaloff>:/common/icons/open.png</iconset>
    </property>
    <property name="text">
     <string>Open xD image(s) as (x-1)D + t</string>
   <action name="actionMerge_images_as_n_dim_t">
    <property name="icon">
     <iconset resource="../vvIcons.qrc">
-     <normaloff>:/new/prefix1/icons/open.png</normaloff>:/new/prefix1/icons/open.png</iconset>
+     <normaloff>:/common/icons/open.png</normaloff>:/common/icons/open.png</iconset>
    </property>
    <property name="text">
     <string>Open several xD images into a single xD + t</string>
   <action name="actionAdd_fusion_image">
    <property name="icon">
     <iconset resource="../vvIcons.qrc">
-     <normaloff>:/new/prefix1/icons/fusion.png</normaloff>:/new/prefix1/icons/fusion.png</iconset>
+     <normaloff>:/common/icons/fusion.png</normaloff>:/common/icons/fusion.png</iconset>
    </property>
    <property name="text">
     <string>Add fusion image to current image</string>
   <action name="actionOpen_VTK_contour">
    <property name="icon">
     <iconset resource="../vvIcons.qrc">
-     <normaloff>:/new/prefix1/icons/open.png</normaloff>:/new/prefix1/icons/open.png</iconset>
+     <normaloff>:/common/icons/open.png</normaloff>:/common/icons/open.png</iconset>
    </property>
    <property name="text">
     <string>Open VTK or OBJ contour</string>
   <action name="actionOpen_Dicom_Struct">
    <property name="icon">
     <iconset resource="../vvIcons.qrc">
-     <normaloff>:/new/prefix1/icons/open.png</normaloff>:/new/prefix1/icons/open.png</iconset>
+     <normaloff>:/common/icons/open.png</normaloff>:/common/icons/open.png</iconset>
    </property>
    <property name="text">
     <string>Open Dicom-Struct</string>
index cf9d6c49f485b8d36be33608bc89b9373782414e..b26dc0c8f7b536bf8f580d5b2539ac2c4da3daf2 100644 (file)
@@ -72,7 +72,7 @@ p, li { white-space: pre-wrap; }
          <string/>
         </property>
         <property name="pixmap">
-         <pixmap resource="../vvIcons.qrc">:/new/prefix1/icons/cursor-uparrow.png</pixmap>
+         <pixmap resource="../vvIcons.qrc">:/common/icons/cursor-uparrow.png</pixmap>
         </property>
         <property name="scaledContents">
          <bool>true</bool>
@@ -195,7 +195,7 @@ p, li { white-space: pre-wrap; }
          <string/>
         </property>
         <property name="pixmap">
-         <pixmap resource="../vvIcons.qrc">:/new/prefix1/icons/GPSup.png</pixmap>
+         <pixmap resource="../vvIcons.qrc">:/common/icons/GPSup.png</pixmap>
         </property>
         <property name="scaledContents">
          <bool>true</bool>
@@ -304,7 +304,7 @@ p, li { white-space: pre-wrap; }
          <string/>
         </property>
         <property name="pixmap">
-         <pixmap resource="../vvIcons.qrc">:/new/prefix1/icons/fusion.png</pixmap>
+         <pixmap resource="../vvIcons.qrc">:/common/icons/fusion.png</pixmap>
         </property>
        </widget>
       </item>
index 91000893ba4cb1fc2adc817bdfa3764d3206c8de..2f684e886e9690e2d4c42184848d682663d045b6 100644 (file)
@@ -18,7 +18,7 @@
   </property>
   <property name="windowIcon">
    <iconset resource="../vvIcons.qrc">
-    <normaloff>:/new/prefix1/icons/ducky.png</normaloff>:/new/prefix1/icons/ducky.png</iconset>
+    <normaloff>:/common/icons/ducky.png</normaloff>:/common/icons/ducky.png</iconset>
   </property>
   <layout class="QGridLayout">
    <item row="0" column="0">
index 7535a361e79bbcb3c4a71fa7581abff59fbd1b05..fda39d5e8c736810fa697ea94e96e12ed51ffc2d 100644 (file)
    </item>
   </layout>
  </widget>
- <resources/>
+ <resources>
+  <include location="../vvIcons.qrc"/>
+ </resources>
  <connections/>
 </ui>
index 90d9276f3ab313a9d1259b3ecf8215291c4ffd52..f8cd76b18d263705c50a13b2d5de58da9d44f6af 100644 (file)
@@ -237,7 +237,7 @@ p, li { white-space: pre-wrap; }
        </property>
        <property name="icon">
         <iconset resource="../vvIcons.qrc">
-         <normaloff>:/new/prefix1/icons/standardbutton-apply-16.png</normaloff>:/new/prefix1/icons/standardbutton-apply-16.png</iconset>
+         <normaloff>:/common/icons/standardbutton-apply-16.png</normaloff>:/common/icons/standardbutton-apply-16.png</iconset>
        </property>
       </widget>
       <widget class="QLabel" name="label_11">
index 98a90b77f8474606d3df3b1b9647737eb12d4611..c3d2df7a25a274cc9494b2f39351fdf93d132f3f 100644 (file)
@@ -1,5 +1,11 @@
 <RCC>
-  <qresource prefix="/new/prefix1">
+  <qresource prefix="common" >
+    <file>icons/arithm.png</file>
+    <file>icons/green-arrow.png</file>
+    <file>icons/2b.png</file>
+    <file>icons/4b.png</file>
+    <file>icons/8b.png</file>
+    <file>icons/1b.png</file>
     <file>icons/binarize.png</file>
     <file>icons/crop.png</file>
     <file>icons/splashscreen2.png</file>
index 1dacaf49353b86065758ca85fb32e04307e08eb7..a98247c5123f3e4c2b69d992a88686d026155efd 100644 (file)
@@ -15,6 +15,7 @@
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 ======================================================================-====*/
+
 #include "vvImageContour.h"
 #include <vtkImageActor.h>
 #include <vtkCamera.h>
index 511248e4b5a5301364d8f35990fc9abea0fe22a3..b57aefdede60755e881c2b58a8711b4287d10156 100644 (file)
@@ -152,7 +152,7 @@ void vvLinkPanel::addLink()
         QTreePushButton* cButton = new QTreePushButton;
         cButton->setIndex(linkTableWidget->rowCount());
         cButton->setColumn(0);
-        cButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/exit.png")));
+        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"));
index f556a8a2a759c96e1e0df1102b5bd27935588b83..43df4b439c88e7ad454e76222e662477adc73f00 100644 (file)
@@ -15,6 +15,7 @@
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 ======================================================================-====*/
+
 #include <algorithm>
 #include <QMessageBox>
 #include <QInputDialog>
@@ -101,42 +102,43 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() {
 
   mInputPathName = "";
   mMenuTools = menuTools;
+  mContextMenu = &contextMenu;
   mMenuExperimentalTools = menuExperimental;
   mMainWidget = this;
 
   //Init the contextMenu
   this->setContextMenuPolicy(Qt::CustomContextMenu);
   contextActions.resize(0);
-  QAction* actionOpen_new_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/new/prefix1/icons/fileopen.png")),
+  QAction* actionOpen_new_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/common/icons/fileopen.png")),
                                                         tr("O&pen new Image"));
   actionOpen_new_image->setShortcut(QKeySequence(tr("Ctrl+O")));
   connect(actionOpen_new_image,SIGNAL(triggered()),this,SLOT(OpenImages()));
   contextActions.push_back(actionOpen_new_image);
   contextMenu.addSeparator();
 
-  QAction* actionClose_Image = contextMenu.addAction(QIcon(QString::fromUtf8(":/new/prefix1/icons/exit.png")),
+  QAction* actionClose_Image = contextMenu.addAction(QIcon(QString::fromUtf8(":/common/icons/exit.png")),
                                                      tr("Close Current Image"));
   connect(actionClose_Image,SIGNAL(triggered()),this,SLOT(CloseImage()));
   contextActions.push_back(actionClose_Image);
 
-  QAction* actionReload_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/new/prefix1/icons/rotateright.png")),
+  QAction* actionReload_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/common/icons/rotateright.png")),
                                                       tr("Reload Current Image"));
   connect(actionReload_image,SIGNAL(triggered()),this,SLOT(ReloadImage()));
   contextActions.push_back(actionReload_image);
 
-  QAction* actionSave_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/new/prefix1/icons/filesave.png")),
+  QAction* actionSave_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/common/icons/filesave.png")),
                                                     tr("Save Current Image"));
   connect(actionSave_image,SIGNAL(triggered()),this,SLOT(SaveAs()));
   contextActions.push_back(actionSave_image);
 
   contextMenu.addSeparator();
 
-  // QAction* actionCrop_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/new/prefix1/icons/crop.png")),
+  // QAction* actionCrop_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/common/icons/crop.png")),
   //                                                   tr("Crop Current Image"));
   // connect(actionCrop_image,SIGNAL(triggered()),this,SLOT(CropImage()));
   // contextActions.push_back(actionCrop_image);
 
-  QAction* actionSplit_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/new/prefix1/icons/cut.png")),
+  QAction* actionSplit_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/common/icons/cut.png")),
                                                      tr("Split Current Image"));
   connect(actionSplit_image,SIGNAL(triggered()),this,SLOT(SplitImage()));
   contextActions.push_back(actionSplit_image);
@@ -146,7 +148,7 @@ 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(":/new/prefix1/icons/GPSup.png")),
+  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);
@@ -157,6 +159,21 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() {
   connect(actionAdd_fusion_image,SIGNAL(triggered()),this,SLOT(AddFusionImage()));
   contextActions.push_back(actionAdd_fusion_image);
 
+  // TRIAL DS
+  /*
+  QMenu * m = new QMenu(menubar);
+  m->setTitle("TOTO");
+  //  m->setObjectName(QString::fromUtf8("TOTOTO"));
+  contextMenu.addMenu(m);
+  QAction * a = m->addAction(QIcon(QString::fromUtf8(":/common/icons/GPSup.png")),
+                    tr("BIDON"));
+  QAction * b = m->addAction(QIcon(QString::fromUtf8(":/common/icons/GPSup.png")),
+                    tr("BIDON2"));
+  m->addAction(a);
+  m->addAction(b);
+  connect(a,SIGNAL(triggered()),this,SLOT(AddFusionImage()));
+  */
+
   //init the DataTree
   mSlicerManagers.resize(0);
 
@@ -297,11 +314,11 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() {
   if ( !recent_files.empty() )
     {
       QMenu * rmenu = new QMenu("Recently opened files...");
-      rmenu->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/open.png")));
+      rmenu->setIcon(QIcon(QString::fromUtf8(":/common/icons/open.png")));
       menuFile->insertMenu(actionOpen_Image_With_Time,rmenu);
       for (std::list<std::string>::iterator i = recent_files.begin();i!=recent_files.end();i++)
         {
-          QAction* current=new QAction(QIcon(QString::fromUtf8(":/new/prefix1/icons/open.png")),
+          QAction* current=new QAction(QIcon(QString::fromUtf8(":/common/icons/open.png")),
                                        (*i).c_str(),this);
           rmenu->addAction(current);
           connect(current,SIGNAL(triggered()),this,SLOT(OpenRecentImage()));
@@ -375,7 +392,7 @@ void vvMainWindow::AddContour(int image_index, vvMesh::Pointer contour, bool pro
   cButton->setItem(item);
   cButton->setColumn(COLUMN_CLOSE_IMAGE);
   cButton->setToolTip(tr("close image"));
-  cButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/exit.png")));
+  cButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/exit.png")));
   connect(cButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
           this,SLOT(CloseImage(QTreeWidgetItem*, int)));
 
@@ -383,7 +400,7 @@ void vvMainWindow::AddContour(int image_index, vvMesh::Pointer contour, bool pro
   rButton->setItem(item);
   rButton->setColumn(COLUMN_RELOAD_IMAGE);
   rButton->setToolTip(tr("reload image"));
-  rButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/rotateright.png")));
+  rButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/rotateright.png")));
   rButton->setEnabled(false);
   //Not implemented
   //connect(rButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
@@ -823,7 +840,7 @@ void vvMainWindow::LoadImages(std::vector<std::string> files, LoadedImageType fi
         cButton->setItem(item);
         cButton->setColumn(COLUMN_CLOSE_IMAGE);
         cButton->setToolTip(tr("close image"));
-        cButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/exit.png")));
+        cButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/exit.png")));
         connect(cButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
                 this,SLOT(CloseImage(QTreeWidgetItem*, int)));
 
@@ -831,7 +848,7 @@ void vvMainWindow::LoadImages(std::vector<std::string> files, LoadedImageType fi
         rButton->setItem(item);
         rButton->setColumn(COLUMN_RELOAD_IMAGE);
         rButton->setToolTip(tr("reload image"));
-        rButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/rotateright.png")));
+        rButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/rotateright.png")));
         connect(rButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
                 this,SLOT(ReloadImage(QTreeWidgetItem*, int)));
 
@@ -1615,7 +1632,7 @@ void vvMainWindow::SplitImage() {
               cButton->setItem(item);
               cButton->setColumn(COLUMN_CLOSE_IMAGE);
               cButton->setToolTip(tr("close image"));
-              cButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/exit.png")));
+              cButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/exit.png")));
               connect(cButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
                       this,SLOT(CloseImage(QTreeWidgetItem*, int)));
 
@@ -1623,7 +1640,7 @@ void vvMainWindow::SplitImage() {
               rButton->setItem(item);
               rButton->setColumn(COLUMN_RELOAD_IMAGE);
               rButton->setToolTip(tr("reload image"));
-              rButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/rotateright.png")));
+              rButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/rotateright.png")));
               rButton->setEnabled(false);
               connect(rButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
                       this,SLOT(ReloadImage(QTreeWidgetItem*, int)));
@@ -1878,7 +1895,7 @@ void vvMainWindow::AddOverlayImage(int index, QString file) {
       cButton->setItem(item);
       cButton->setColumn(COLUMN_CLOSE_IMAGE);
       cButton->setToolTip(tr("close image"));
-      cButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/exit.png")));
+      cButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/exit.png")));
       connect(cButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
               this,SLOT(CloseImage(QTreeWidgetItem*, int)));
 
@@ -1886,7 +1903,7 @@ void vvMainWindow::AddOverlayImage(int index, QString file) {
       rButton->setItem(item);
       rButton->setColumn(COLUMN_RELOAD_IMAGE);
       rButton->setToolTip(tr("reload image"));
-      rButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/rotateright.png")));
+      rButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/rotateright.png")));
       connect(rButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
               this,SLOT(ReloadImage(QTreeWidgetItem*, int)));
 
@@ -1968,7 +1985,7 @@ void vvMainWindow::AddFusionImage()
               cButton->setItem(item);
               cButton->setColumn(COLUMN_CLOSE_IMAGE);
               cButton->setToolTip(tr("close image"));
-              cButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/exit.png")));
+              cButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/exit.png")));
               connect(cButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
                       this,SLOT(CloseImage(QTreeWidgetItem*, int)));
 
@@ -1976,7 +1993,7 @@ void vvMainWindow::AddFusionImage()
               rButton->setItem(item);
               rButton->setColumn(COLUMN_RELOAD_IMAGE);
               rButton->setToolTip(tr("reload image"));
-              rButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/rotateright.png")));
+              rButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/rotateright.png")));
               connect(rButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
                       this,SLOT(ReloadImage(QTreeWidgetItem*, int)));
 
@@ -2053,7 +2070,7 @@ void vvMainWindow::AddFieldEntry(QString filename,int index,bool from_disk)
   cButton->setItem(item);
   cButton->setColumn(COLUMN_CLOSE_IMAGE);
   cButton->setToolTip(tr("close vector field"));
-  cButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/exit.png")));
+  cButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/exit.png")));
   connect(cButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
           this,SLOT(CloseImage(QTreeWidgetItem*, int)));
 
@@ -2062,7 +2079,7 @@ void vvMainWindow::AddFieldEntry(QString filename,int index,bool from_disk)
   rButton->setColumn(COLUMN_RELOAD_IMAGE);
   rButton->setToolTip(tr("reload vector field"));
   rButton->setEnabled(from_disk);
-  rButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/rotateright.png")));
+  rButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/rotateright.png")));
   connect(rButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
           this,SLOT(ReloadImage(QTreeWidgetItem*, int)));
 
@@ -2589,7 +2606,7 @@ void vvMainWindow::PlayPause() {
   if (playMode)
     {
       playMode = 0;
-      playButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/player_play.png")));
+      playButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/player_play.png")));
       ImageInfoChanged();
       return;
     }
@@ -2606,7 +2623,7 @@ void vvMainWindow::PlayPause() {
       if (has_temporal)
         {
           playMode = 1;
-          playButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/player_pause.png")));
+          playButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/player_pause.png")));
           QTimer::singleShot(1000/mFrameRate, this, SLOT(PlayNext()));
         }
     }
@@ -2706,14 +2723,14 @@ void vvMainWindow::AddImage(vvSlicerManager * slicer_manager) {
   QTreePushButton* cButton = new QTreePushButton;
   cButton->setItem(item);
   cButton->setColumn(COLUMN_CLOSE_IMAGE);
-  cButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/exit.png")));
+  cButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/exit.png")));
   connect(cButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
           this,SLOT(CloseImage(QTreeWidgetItem*, int)));
 
   QTreePushButton* rButton = new QTreePushButton;
   rButton->setItem(item);
   rButton->setColumn(COLUMN_RELOAD_IMAGE);
-  rButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/rotateright.png")));
+  rButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/rotateright.png")));
   rButton->setEnabled(0);
   connect(rButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
           this,SLOT(ReloadImage(QTreeWidgetItem*, int)));
index a780e9fb0c0000dafb5953b9459ee7e5d499c377..6123a6ecf5488a923f99ee1bfad4c11524140be3 100644 (file)
@@ -15,6 +15,7 @@
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 ======================================================================-====*/
+
 #ifndef VVMAINWINDOWBASE_H
 #define VVMAINWINDOWBASE_H
 #include "clitkCommon.h"
@@ -37,6 +38,7 @@ public:
   virtual void UpdateCurrentSlicer() = 0;
   const std::vector<vvSlicerManager*> & GetSlicerManagers() const { return mSlicerManagers; }
   QMenu * GetToolMenu() const { return mMenuTools; }
+  QMenu * GetContextMenu() const { return mContextMenu; }
   QMenu * GetExperimentalToolMenu() const { return mMenuExperimentalTools; }
   int GetSlicerManagerCurrentIndex() const { return mSlicerManagerCurrentIndex; }
   QWidget * GetMainWidget() { return mMainWidget; }
@@ -47,6 +49,7 @@ signals:
 protected:
   std::vector<vvSlicerManager*> mSlicerManagers;
   QMenu * mMenuTools;
+  QMenu * mContextMenu;
   QMenu * mMenuExperimentalTools;
   int mSlicerManagerCurrentIndex;
   QWidget* mMainWidget;
index 17afe19ede1ac60bb663d9dfbfadb1b1be246866..a5c2641bd1a8f24c249bcf8fda6376441c5bc961 100644 (file)
@@ -14,9 +14,9 @@
 
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-======================================================================-====*/
-#include "vvSlicer.h"
+  ======================================================================-====*/
 
+#include "vvSlicer.h"
 #include "vvImage.h"
 #include "vvSlicerManagerCommand.h"
 #include "vvGlyphSource.h"
@@ -1139,50 +1139,50 @@ void vvSlicer::SetColorLevel(double level)
 // Returns the min an the max value in a 41x41 region around the mouse pointer
 void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max)
 {
-    //Get mouse pointer position in view coordinates
-    double fLocalExtents[6];
-    for(int i=0; i<3; i++)
+  //Get mouse pointer position in view coordinates
+  double fLocalExtents[6];
+  for(int i=0; i<3; i++)
     {
-        fLocalExtents[i*2  ] = mCurrent[i];
-        fLocalExtents[i*2+1] = mCurrent[i];
+      fLocalExtents[i*2  ] = mCurrent[i];
+      fLocalExtents[i*2+1] = mCurrent[i];
     }
-    this->Renderer->WorldToView(fLocalExtents[0], fLocalExtents[2], fLocalExtents[4]);
-    this->Renderer->WorldToView(fLocalExtents[1], fLocalExtents[3], fLocalExtents[5]);
-    for(int i=0; i<3; i++)
+  this->Renderer->WorldToView(fLocalExtents[0], fLocalExtents[2], fLocalExtents[4]);
+  this->Renderer->WorldToView(fLocalExtents[1], fLocalExtents[3], fLocalExtents[5]);
+  for(int i=0; i<3; i++)
     {
-        if (i!=SliceOrientation) //SR: assumes that SliceOrientation is valid in ViewCoordinates (???)
+      if (i!=SliceOrientation) //SR: assumes that SliceOrientation is valid in ViewCoordinates (???)
         {
-            fLocalExtents[i*2  ] -= 0.2;
-            fLocalExtents[i*2+1] += 0.2;
+         fLocalExtents[i*2  ] -= 0.2;
+         fLocalExtents[i*2+1] += 0.2;
         }
     }
-    this->Renderer->ViewToWorld(fLocalExtents[0], fLocalExtents[2], fLocalExtents[4]);
-    this->Renderer->ViewToWorld(fLocalExtents[1], fLocalExtents[3], fLocalExtents[5]);
+  this->Renderer->ViewToWorld(fLocalExtents[0], fLocalExtents[2], fLocalExtents[4]);
+  this->Renderer->ViewToWorld(fLocalExtents[1], fLocalExtents[3], fLocalExtents[5]);
 
-    //Convert to image pixel coordinates (rounded)
-    int iLocalExtents[6];
-    for(int i=0; i<3; i++)
+  //Convert to image pixel coordinates (rounded)
+  int iLocalExtents[6];
+  for(int i=0; i<3; i++)
     {
-        fLocalExtents[i*2  ] = (fLocalExtents[i*2  ] - this->GetInput()->GetOrigin()[i])/this->GetInput()->GetSpacing()[i];
-        fLocalExtents[i*2+1] = (fLocalExtents[i*2+1] - this->GetInput()->GetOrigin()[i])/this->GetInput()->GetSpacing()[i];
+      fLocalExtents[i*2  ] = (fLocalExtents[i*2  ] - this->GetInput()->GetOrigin()[i])/this->GetInput()->GetSpacing()[i];
+      fLocalExtents[i*2+1] = (fLocalExtents[i*2+1] - this->GetInput()->GetOrigin()[i])/this->GetInput()->GetSpacing()[i];
     
-        iLocalExtents[i*2  ] = lrint(fLocalExtents[i*2  ]);
-        iLocalExtents[i*2+1] = lrint(fLocalExtents[i*2+1]);
+      iLocalExtents[i*2  ] = lrint(fLocalExtents[i*2  ]);
+      iLocalExtents[i*2+1] = lrint(fLocalExtents[i*2+1]);
 
-        if(iLocalExtents[i*2  ]>iLocalExtents[i*2+1])
-            std::swap(iLocalExtents[i*2], iLocalExtents[i*2+1]);
+      if(iLocalExtents[i*2  ]>iLocalExtents[i*2+1])
+       std::swap(iLocalExtents[i*2], iLocalExtents[i*2+1]);
     }
     
-    vtkSmartPointer<vtkExtractVOI> voiFilter = vtkExtractVOI::New();
-    voiFilter->SetInput(this->GetInput());
-    voiFilter->SetVOI(iLocalExtents);
+  vtkSmartPointer<vtkExtractVOI> voiFilter = vtkExtractVOI::New();
+  voiFilter->SetInput(this->GetInput());
+  voiFilter->SetVOI(iLocalExtents);
 
-    vtkSmartPointer<vtkImageAccumulate> accFilter = vtkImageAccumulate::New();
-    accFilter->SetInput(voiFilter->GetOutput());
-    accFilter->Update();
+  vtkSmartPointer<vtkImageAccumulate> accFilter = vtkImageAccumulate::New();
+  accFilter->SetInput(voiFilter->GetOutput());
+  accFilter->Update();
    
-    min = *(accFilter->GetMin());
-    max = *(accFilter->GetMax());
+  min = *(accFilter->GetMin());
+  max = *(accFilter->GetMax());
 }
 //----------------------------------------------------------------------------
 
index f2b06abdc54277cb606b11fa735db5b012bd2fbe..e8bf86462dd928e88f9caeb76198b1d5b6a35717 100644 (file)
@@ -14,9 +14,9 @@
 
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-======================================================================-====*/
-#include "vvSlicerManager.h"
+  ======================================================================-====*/
 
+#include "vvSlicerManager.h"
 #include "vvSlicer.h"
 #include "vvImage.h"
 #include "vvSlicerManagerCommand.h"
 #include "vtkImageClip.h"
 #include <vtkLODActor.h>
 #include <vtkPointData.h>
-
 #include <vtksys/SystemTools.hxx>
-//----------------------------------------------------------------------------
 
+//----------------------------------------------------------------------------
 vvSlicerManager::vvSlicerManager(int numberOfSlicers)
 {
-    mFileName = "";
-    mId = "";
-    mVFName = "";
-    mOverlayName = "";
-    mFusionName = "";
-    mVFId = "";
-    mLastError = "";
-    mType = UNDEFINEDIMAGETYPE;
-    mColorMap = 0;
-    mPreset = 0;
-    mOverlayColor = 130;
-
-    mFusionOpacity = 70;
-    mFusionColorMap = 3;
-    mFusionWindow = 1000;
-    mFusionLevel = 1000;
-
-    mReader = NULL;
-    mImage = NULL;
-    mVF=NULL;
-    mVectorReader = NULL;
-    mOverlayReader = NULL;
-    mFusionReader = NULL;
-    mLandmarks = NULL;
-    mLinkedId.resize(0);
-
-    for ( int i = 0; i < numberOfSlicers; i++)
+  mFileName = "";
+  mId = "";
+  mVFName = "";
+  mOverlayName = "";
+  mFusionName = "";
+  mVFId = "";
+  mLastError = "";
+  mType = UNDEFINEDIMAGETYPE;
+  mColorMap = 0;
+  mPreset = 0;
+  mOverlayColor = 130;
+
+  mFusionOpacity = 70;
+  mFusionColorMap = 3;
+  mFusionWindow = 1000;
+  mFusionLevel = 1000;
+
+  mReader = NULL;
+  mImage = NULL;
+  mVF=NULL;
+  mVectorReader = NULL;
+  mOverlayReader = NULL;
+  mFusionReader = NULL;
+  mLandmarks = NULL;
+  mLinkedId.resize(0);
+
+  for ( int i = 0; i < numberOfSlicers; i++)
     {
-        vvSlicer *slicer = vvSlicer::New();
-        mSlicers.push_back(slicer);
+      vvSlicer *slicer = vvSlicer::New();
+      mSlicers.push_back(slicer);
     }
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 vvSlicerManager::~vvSlicerManager()
 {
-    for ( unsigned int i = 0; i < mSlicers.size(); i++)
+  for ( unsigned int i = 0; i < mSlicers.size(); i++)
     {
-        if (mSlicers[i] != NULL)
-            mSlicers[i]->Delete();
+      if (mSlicers[i] != NULL)
+       mSlicers[i]->Delete();
     }
-    if (mReader)
+  if (mReader)
     {
-        delete mReader;
+      delete mReader;
     }
-    if (mVectorReader)
+  if (mVectorReader)
     {
-        delete mVectorReader;
+      delete mVectorReader;
     }
-    if (mOverlayReader)
+  if (mOverlayReader)
     {
-        delete mOverlayReader;
+      delete mOverlayReader;
     }
-    if (mFusionReader)
+  if (mFusionReader)
     {
-        delete mFusionReader;
+      delete mFusionReader;
     }
-    if (mLandmarks)
-        delete mLandmarks;
+  if (mLandmarks)
+    delete mLandmarks;
 }
+//----------------------------------------------------------------------------
 
+
+//------------------------------------------------------------------------------
+void vvSlicerManager::SetFilename(std::string f) {
+  mFileName = f;
+  for(unsigned int i=0; i<mSlicers.size(); i++) {
+    mSlicers[i]->SetFileName(f);
+  }
+}
+//------------------------------------------------------------------------------
+
+
+//----------------------------------------------------------------------------
 void vvSlicerManager::AddContour(vvMesh::Pointer contour,bool propagate)
 {
-    for ( unsigned int i = 0; i < mSlicers.size(); i++)
+  for ( unsigned int i = 0; i < mSlicers.size(); i++)
     {
-        mSlicers[i]->AddContour(contour,propagate);
+      mSlicers[i]->AddContour(contour,propagate);
     }
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 void vvSlicerManager::ToggleContourSuperposition()
 {
-    for ( unsigned int i = 0; i < mSlicers.size(); i++)
-        mSlicers[i]->ToggleContourSuperposition();
+  for ( unsigned int i = 0; i < mSlicers.size(); i++)
+    mSlicers[i]->ToggleContourSuperposition();
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 bool vvSlicerManager::SetImage(std::string filename,LoadedImageType type)
 {
-    mFileName = filename;
-    mType = type;
-    if (mReader == NULL)
-        mReader = new vvImageReader;
-    std::vector<std::string> filenames;
-    filenames.push_back(filename);
-    mReader->SetInputFilenames(filenames);
-    mReader->Update(type);
-    if (mReader->GetLastError().size() == 0)
-    {
-        mImage=mReader->GetOutput();
-        for ( unsigned int i = 0; i < mSlicers.size(); i++)
+  mFileName = filename;
+  mType = type;
+  if (mReader == NULL)
+    mReader = new vvImageReader;
+  std::vector<std::string> filenames;
+  filenames.push_back(filename);
+  mReader->SetInputFilenames(filenames);
+  mReader->Update(type);
+  if (mReader->GetLastError().size() == 0)
+    {
+      mImage=mReader->GetOutput();
+      for ( unsigned int i = 0; i < mSlicers.size(); i++)
         {
-            mSlicers[i]->SetFileName(vtksys::SystemTools::GetFilenameWithoutLastExtension(filename));
-            mSlicers[i]->SetImage(mReader->GetOutput());
+         mSlicers[i]->SetFileName(vtksys::SystemTools::GetFilenameWithoutLastExtension(filename));
+         mSlicers[i]->SetImage(mReader->GetOutput());
         }
     }
-    else
+  else
     {
-        mLastError = mReader->GetLastError();
-        return false;
+      mLastError = mReader->GetLastError();
+      return false;
     }
-    return true;
+  return true;
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 void vvSlicerManager::SetImage(vvImage::Pointer image)
 {
-    mImage=image;
-    for (unsigned int i = 0; i < mSlicers.size();i++)
+  mImage=image;
+  for (unsigned int i = 0; i < mSlicers.size();i++)
     {
-        mSlicers[i]->SetImage(image);
+      mSlicers[i]->SetImage(image);
     }
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 bool vvSlicerManager::SetImages(std::vector<std::string> filenames,LoadedImageType type)
 {
-    mType = type;
-    std::string fileWithoutExtension = vtksys::SystemTools::GetFilenameWithoutExtension(filenames[0]);
-    if (type == DICOM)
-        fileWithoutExtension += "_dicom";
-    else if (type == MERGED)
-        fileWithoutExtension += "_merged";
-    else if (type == MERGEDWITHTIME)
-        fileWithoutExtension += "_merged_wt";
-
-    mFileName = fileWithoutExtension + vtksys::SystemTools::GetFilenameExtension(filenames[0]);
-    if (mReader == NULL)
-        mReader = new vvImageReader;
-    mReader->SetInputFilenames(filenames);
-    mReader->Update(type);
-
-
-    if (mReader->GetLastError().size() == 0)
+  mType = type;
+  std::string fileWithoutExtension = vtksys::SystemTools::GetFilenameWithoutExtension(filenames[0]);
+  if (type == DICOM)
+    fileWithoutExtension += "_dicom";
+  else if (type == MERGED)
+    fileWithoutExtension += "_merged";
+  else if (type == MERGEDWITHTIME)
+    fileWithoutExtension += "_merged_wt";
+
+  mFileName = fileWithoutExtension + vtksys::SystemTools::GetFilenameExtension(filenames[0]);
+  if (mReader == NULL)
+    mReader = new vvImageReader;
+  mReader->SetInputFilenames(filenames);
+  mReader->Update(type);
+
+
+  if (mReader->GetLastError().size() == 0)
     {
-        mImage=mReader->GetOutput();
-        for ( unsigned int i = 0; i < mSlicers.size(); i++)
+      mImage=mReader->GetOutput();
+      for ( unsigned int i = 0; i < mSlicers.size(); i++)
         {
-            mSlicers[i]->SetFileName(fileWithoutExtension);
-            mSlicers[i]->SetImage(mReader->GetOutput());
+         mSlicers[i]->SetFileName(fileWithoutExtension);
+         mSlicers[i]->SetImage(mReader->GetOutput());
         }
     }
-    else
+  else
     {
-        mLastError = mReader->GetLastError();
-        return false;
+      mLastError = mReader->GetLastError();
+      return false;
     }
-    return true;
+  return true;
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 bool vvSlicerManager::SetOverlay(std::string filename,int dim, std::string component)
 {
-    mOverlayName = filename;
-    mOverlayComponent = component;
-    if (dim > mImage->GetNumberOfDimensions())
+  mOverlayName = filename;
+  mOverlayComponent = component;
+  if (dim > mImage->GetNumberOfDimensions())
     {
-        mLastError = " Overlay dimension cannot be greater then reference image!";
-        return false;
+      mLastError = " Overlay dimension cannot be greater then reference image!";
+      return false;
     }
-    if (mOverlayReader == NULL)
-        mOverlayReader = new vvImageReader;
-    std::vector<std::string> filenames;
-    filenames.push_back(filename);
-    mOverlayReader->SetInputFilenames(filenames);
-    mOverlayReader->Update(mImage->GetNumberOfDimensions(),component.c_str(),mType);
-    if (mOverlayReader->GetLastError().size() == 0)
+  if (mOverlayReader == NULL)
+    mOverlayReader = new vvImageReader;
+  std::vector<std::string> filenames;
+  filenames.push_back(filename);
+  mOverlayReader->SetInputFilenames(filenames);
+  mOverlayReader->Update(mImage->GetNumberOfDimensions(),component.c_str(),mType);
+  if (mOverlayReader->GetLastError().size() == 0)
     {
-        for ( unsigned int i = 0; i < mSlicers.size(); i++)
+      for ( unsigned int i = 0; i < mSlicers.size(); i++)
         {
-            mSlicers[i]->SetOverlay(mOverlayReader->GetOutput());
+         mSlicers[i]->SetOverlay(mOverlayReader->GetOutput());
         }
     }
-    else
+  else
     {
-        mLastError = mOverlayReader->GetLastError();
-        return false;
+      mLastError = mOverlayReader->GetLastError();
+      return false;
     }
-    return true;
+  return true;
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 bool vvSlicerManager::SetFusion(std::string filename,int dim, std::string component)
 {
-    mFusionName = filename;
-    mFusionComponent = component;
-    if (dim > mImage->GetNumberOfDimensions())
+  mFusionName = filename;
+  mFusionComponent = component;
+  if (dim > mImage->GetNumberOfDimensions())
     {
-        mLastError = " Overlay dimension cannot be greater then reference image!";
-        return false;
+      mLastError = " Overlay dimension cannot be greater then reference image!";
+      return false;
     }
-    if (mFusionReader == NULL)
-        mFusionReader = new vvImageReader;
-    std::vector<std::string> filenames;
-    filenames.push_back(filename);
-    mFusionReader->SetInputFilenames(filenames);
-    mFusionReader->Update(mImage->GetNumberOfDimensions(),component.c_str(),mType);
-    if (mFusionReader->GetLastError().size() == 0)
+  if (mFusionReader == NULL)
+    mFusionReader = new vvImageReader;
+  std::vector<std::string> filenames;
+  filenames.push_back(filename);
+  mFusionReader->SetInputFilenames(filenames);
+  mFusionReader->Update(mImage->GetNumberOfDimensions(),component.c_str(),mType);
+  if (mFusionReader->GetLastError().size() == 0)
     {
-        for ( unsigned int i = 0; i < mSlicers.size(); i++)
+      for ( unsigned int i = 0; i < mSlicers.size(); i++)
         {
-            mSlicers[i]->SetFusion(mFusionReader->GetOutput());
+         mSlicers[i]->SetFusion(mFusionReader->GetOutput());
         }
     }
-    else
+  else
     {
-        mLastError = mFusionReader->GetLastError();
-        return false;
+      mLastError = mFusionReader->GetLastError();
+      return false;
     }
-    double *fusRange = mFusionReader->GetOutput()->GetVTKImages()[0]->GetScalarRange();
-    mFusionLevel = (fusRange[0]+fusRange[1])/2;
-    mFusionWindow = fusRange[1]-fusRange[0];
-    return true;
+  double *fusRange = mFusionReader->GetOutput()->GetVTKImages()[0]->GetScalarRange();
+  mFusionLevel = (fusRange[0]+fusRange[1])/2;
+  mFusionWindow = fusRange[1]-fusRange[0];
+  return true;
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 bool vvSlicerManager::SetVF(std::string filename)
 {
-    if (mVectorReader == NULL)
-        mVectorReader = new vvImageReader;
-    mVectorReader->SetInputFilename(filename);
-    mVectorReader->Update(VECTORFIELD);
-    if (mVectorReader->GetLastError().size() != 0)
+  if (mVectorReader == NULL)
+    mVectorReader = new vvImageReader;
+  mVectorReader->SetInputFilename(filename);
+  mVectorReader->Update(VECTORFIELD);
+  if (mVectorReader->GetLastError().size() != 0)
     {
-        mLastError = mVectorReader->GetLastError();
-        return false;
+      mLastError = mVectorReader->GetLastError();
+      return false;
     }
-    else
-        return SetVF(mVectorReader->GetOutput(),filename);
+  else
+    return SetVF(mVectorReader->GetOutput(),filename);
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 bool vvSlicerManager::SetVF(vvImage::Pointer vf,std::string filename)
 {
-    if (vf->GetNumberOfDimensions() > mImage->GetNumberOfDimensions())
+  if (vf->GetNumberOfDimensions() > mImage->GetNumberOfDimensions())
     {
-        mLastError = " Vector field dimension cannot be greater then reference image!";
-        return false;
+      mLastError = " Vector field dimension cannot be greater then reference image!";
+      return false;
     }
-    mVF=vf;
-    mVFName = filename;
-    for ( unsigned int i = 0; i < mSlicers.size(); i++)
+  mVF=vf;
+  mVFName = filename;
+  for ( unsigned int i = 0; i < mSlicers.size(); i++)
     {
-        mSlicers[i]->SetVF(vf);
+      mSlicers[i]->SetVF(vf);
     }
-    return true;
+  return true;
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::SetExtractedImage(std::string filename,vvImage::Pointer image, int slice)
 {
-    mFileName = filename;
-    mImage = vvImage::New();
-    if (image->GetNumberOfDimensions() == 4)
+  mFileName = filename;
+  mImage = vvImage::New();
+  if (image->GetNumberOfDimensions() == 4)
     {
-        mImage->AddImage(image->GetVTKImages()[slice]);
-        for ( unsigned int i = 0; i < mSlicers.size(); i++)
+      mImage->AddImage(image->GetVTKImages()[slice]);
+      for ( unsigned int i = 0; i < mSlicers.size(); i++)
         {
-            mSlicers[i]->SetFileName(vtksys::SystemTools::GetFilenameWithoutLastExtension(filename));
-            mSlicers[i]->SetImage(mImage);
+         mSlicers[i]->SetFileName(vtksys::SystemTools::GetFilenameWithoutLastExtension(filename));
+         mSlicers[i]->SetImage(mImage);
         }
     }
-    else
+  else
     {
-        vtkImageClip* clipper = vtkImageClip::New();
-        int extent[6];
-        image->GetVTKImages()[0]->GetWholeExtent(extent);
-        clipper->SetInput(image->GetVTKImages()[0]);
-        clipper->SetOutputWholeExtent(extent[0],extent[1],extent[2],extent[3],slice,slice);
-        clipper->Update();
-        mImage->AddImage(clipper->GetOutput());
-        for ( unsigned int i = 0; i < mSlicers.size(); i++)
+      vtkImageClip* clipper = vtkImageClip::New();
+      int extent[6];
+      image->GetVTKImages()[0]->GetWholeExtent(extent);
+      clipper->SetInput(image->GetVTKImages()[0]);
+      clipper->SetOutputWholeExtent(extent[0],extent[1],extent[2],extent[3],slice,slice);
+      clipper->Update();
+      mImage->AddImage(clipper->GetOutput());
+      for ( unsigned int i = 0; i < mSlicers.size(); i++)
         {
-            mSlicers[i]->SetFileName(vtksys::SystemTools::GetFilenameWithoutLastExtension(filename));
-            mSlicers[i]->SetImage(mImage);
+         mSlicers[i]->SetFileName(vtksys::SystemTools::GetFilenameWithoutLastExtension(filename));
+         mSlicers[i]->SetImage(mImage);
         }
-        clipper->Delete();
+      clipper->Delete();
     }
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 vvSlicer* vvSlicerManager::GetSlicer(int i)
 {
-    return mSlicers[i];
+  return mSlicers[i];
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 void vvSlicerManager::UpdateSlicer(int num, bool state)
 {
-    if (mSlicers[num]->GetImage())
-            mSlicers[num]->SetDisplayMode(state);
+  if (mSlicers[num]->GetImage())
+    mSlicers[num]->SetDisplayMode(state);
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 void vvSlicerManager::SetSlicerWindow(int i, vtkRenderWindow* RW)
 {
-    mSlicers[i]->SetRenderWindow(i,RW);
+  mSlicers[i]->SetRenderWindow(i,RW);
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 void vvSlicerManager::SetInteractorStyleNavigator(int i, vtkInteractorStyle* style)
 {
-    vvSlicerManagerCommand *smc = vvSlicerManagerCommand::New();
-    smc->SM = this;
-    smc->SetSlicerNumber(i);
-    mSlicers[i]->GetRenderWindow()->GetInteractor()->SetInteractorStyle(style);
+  vvSlicerManagerCommand *smc = vvSlicerManagerCommand::New();
+  smc->SM = this;
+  smc->SetSlicerNumber(i);
+  mSlicers[i]->GetRenderWindow()->GetInteractor()->SetInteractorStyle(style);
 
-    mSlicers[i]->GetRenderWindow()->GetInteractor()->
+  mSlicers[i]->GetRenderWindow()->GetInteractor()->
     GetInteractorStyle()->AddObserver(vtkCommand::KeyPressEvent, smc);
-    mSlicers[i]->GetRenderWindow()->GetInteractor()->
+  mSlicers[i]->GetRenderWindow()->GetInteractor()->
     GetInteractorStyle()->AddObserver(vtkCommand::WindowLevelEvent, smc);
-    mSlicers[i]->GetRenderWindow()->GetInteractor()->
+  mSlicers[i]->GetRenderWindow()->GetInteractor()->
     GetInteractorStyle()->AddObserver(vtkCommand::EndWindowLevelEvent, smc);
-    mSlicers[i]->GetRenderWindow()->GetInteractor()->
+  mSlicers[i]->GetRenderWindow()->GetInteractor()->
     GetInteractorStyle()->AddObserver(vtkCommand::StartWindowLevelEvent, smc);
-    mSlicers[i]->GetRenderWindow()->GetInteractor()->
+  mSlicers[i]->GetRenderWindow()->GetInteractor()->
     GetInteractorStyle()->AddObserver(vtkCommand::PickEvent, smc);
-    mSlicers[i]->GetRenderWindow()->GetInteractor()->
+  mSlicers[i]->GetRenderWindow()->GetInteractor()->
     GetInteractorStyle()->AddObserver(vtkCommand::StartPickEvent, smc);
-    mSlicers[i]->GetRenderWindow()->GetInteractor()->
+  mSlicers[i]->GetRenderWindow()->GetInteractor()->
     GetInteractorStyle()->AddObserver(vtkCommand::LeaveEvent, smc);
-    mSlicers[i]->GetRenderWindow()->GetInteractor()->
+  mSlicers[i]->GetRenderWindow()->GetInteractor()->
     GetInteractorStyle()->AddObserver(vtkCommand::UserEvent, smc);
-    mSlicers[i]->GetRenderWindow()->GetInteractor()->
+  mSlicers[i]->GetRenderWindow()->GetInteractor()->
     GetInteractorStyle()->AddObserver(vtkCommand::MouseWheelForwardEvent, smc);
-    mSlicers[i]->GetRenderWindow()->GetInteractor()->
+  mSlicers[i]->GetRenderWindow()->GetInteractor()->
     GetInteractorStyle()->AddObserver(vtkCommand::MouseWheelBackwardEvent, smc);
-    smc->Delete();
+  smc->Delete();
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 void vvSlicerManager::SetTSlice(int slice)
 {
-    if (slice < 0)
-        slice = 0;
-    else if (slice > mSlicers[0]->GetTMax())
-        slice = mSlicers[0]->GetTMax();
-    if (mLandmarks)
-        mLandmarks->SetTime(slice);
-    for ( unsigned int i = 0; i < mSlicers.size(); i++)
+  if (slice < 0)
+    slice = 0;
+  else if (slice > mSlicers[0]->GetTMax())
+    slice = mSlicers[0]->GetTMax();
+  if (mLandmarks)
+    mLandmarks->SetTime(slice);
+  for ( unsigned int i = 0; i < mSlicers.size(); i++)
     {
-        mSlicers[i]->SetTSlice(slice);
-        if (mSlicers[i]->GetImageActor()->GetVisibility())
-            UpdateTSlice(i);
+      mSlicers[i]->SetTSlice(slice);
+      if (mSlicers[i]->GetImageActor()->GetVisibility())
+       UpdateTSlice(i);
     }
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::SetNextTSlice(int originating_slicer)
 {
-    int t = mSlicers[0]->GetTSlice();
-    t++;
-    if (t > mSlicers[0]->GetTMax())
-        t = 0;
-    emit UpdateTSlice(originating_slicer,t);
+  int t = mSlicers[0]->GetTSlice();
+  t++;
+  if (t > mSlicers[0]->GetTMax())
+    t = 0;
+  emit UpdateTSlice(originating_slicer,t);
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::SetPreviousTSlice(int originating_slicer)
 {
-    int t = mSlicers[0]->GetTSlice();
-    t--;
-    if (t < 0)
-        t = mSlicers[0]->GetTMax();
-    emit UpdateTSlice(originating_slicer,t);
+  int t = mSlicers[0]->GetTSlice();
+  t--;
+  if (t < 0)
+    t = mSlicers[0]->GetTMax();
+  emit UpdateTSlice(originating_slicer,t);
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::ToggleInterpolation()
 {
-    bool interpolate=!(mSlicers[0]->GetImageActor()->GetInterpolate());
-    for ( unsigned int i = 0; i < mSlicers.size(); i++)
+  bool interpolate=!(mSlicers[0]->GetImageActor()->GetInterpolate());
+  for ( unsigned int i = 0; i < mSlicers.size(); i++)
     {
-        mSlicers[i]->GetImageActor()->SetInterpolate(interpolate);
+      mSlicers[i]->GetImageActor()->SetInterpolate(interpolate);
     }
 }
+//----------------------------------------------------------------------------
 
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::SetTSliceInSlicer(int tslice, int slicer)
 {
-    if (tslice < 0)
-        tslice = 0;
-    else if (tslice > mSlicers[slicer]->GetTMax())
-        tslice = mSlicers[slicer]->GetTMax();
-    if (mLandmarks)
-        mLandmarks->SetTime(tslice);
-    mSlicers[slicer]->SetTSlice(tslice);
-    if (mSlicers[slicer]->GetImageActor()->GetVisibility())
-        UpdateTSlice(slicer);
+  if (tslice < 0)
+    tslice = 0;
+  else if (tslice > mSlicers[slicer]->GetTMax())
+    tslice = mSlicers[slicer]->GetTMax();
+  if (mLandmarks)
+    mLandmarks->SetTime(tslice);
+  mSlicers[slicer]->SetTSlice(tslice);
+  if (mSlicers[slicer]->GetImageActor()->GetVisibility())
+    UpdateTSlice(slicer);
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 void vvSlicerManager::SetColorWindow(double s)
 {
-    for ( unsigned int i = 0; i < mSlicers.size(); i++)
+  for ( unsigned int i = 0; i < mSlicers.size(); i++)
     {
-        mSlicers[i]->SetColorWindow(s);
+      mSlicers[i]->SetColorWindow(s);
     }
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 void vvSlicerManager::SetColorLevel(double s)
 {
-    for ( unsigned int i = 0; i < mSlicers.size(); i++)
+  for ( unsigned int i = 0; i < mSlicers.size(); i++)
     {
-        mSlicers[i]->SetColorLevel(s);
+      mSlicers[i]->SetColorLevel(s);
     }
 }
+//----------------------------------------------------------------------------
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::SetCursorVisibility(int s)
 {
-    for ( unsigned int i = 0; i < mSlicers.size(); i++)
+  for ( unsigned int i = 0; i < mSlicers.size(); i++)
     {
-        mSlicers[i]->SetCursorVisibility(s);
+      mSlicers[i]->SetCursorVisibility(s);
     }
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::SetOpacity(int i, double factor)
 {
-    mSlicers[i]->SetOpacity(1/factor);
+  mSlicers[i]->SetOpacity(1/factor);
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 void vvSlicerManager::UpdateViews(int current,int 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])
-               /mSlicers[slicer]->GetInput()->GetSpacing()[1];
-    double z = (mSlicers[slicer]->GetCurrentPosition()[2] - mSlicers[slicer]->GetInput()->GetOrigin()[2])
-               /mSlicers[slicer]->GetInput()->GetSpacing()[2];
-
-    if (x >= mSlicers[slicer]->GetInput()->GetWholeExtent()[0] &&
-            x <= mSlicers[slicer]->GetInput()->GetWholeExtent()[1] &&
-            y >= mSlicers[slicer]->GetInput()->GetWholeExtent()[2] &&
-            y <= mSlicers[slicer]->GetInput()->GetWholeExtent()[3] &&
-            z >= mSlicers[slicer]->GetInput()->GetWholeExtent()[4] &&
-            z <= mSlicers[slicer]->GetInput()->GetWholeExtent()[5])
+  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])
+    /mSlicers[slicer]->GetInput()->GetSpacing()[1];
+  double z = (mSlicers[slicer]->GetCurrentPosition()[2] - mSlicers[slicer]->GetInput()->GetOrigin()[2])
+    /mSlicers[slicer]->GetInput()->GetSpacing()[2];
+
+  if (x >= mSlicers[slicer]->GetInput()->GetWholeExtent()[0] &&
+      x <= mSlicers[slicer]->GetInput()->GetWholeExtent()[1] &&
+      y >= mSlicers[slicer]->GetInput()->GetWholeExtent()[2] &&
+      y <= mSlicers[slicer]->GetInput()->GetWholeExtent()[3] &&
+      z >= mSlicers[slicer]->GetInput()->GetWholeExtent()[4] &&
+      z <= mSlicers[slicer]->GetInput()->GetWholeExtent()[5])
     {
-        mSlicers[slicer]->UpdateCursorPosition();
-        mSlicers[slicer]->SetCursorColor(10,212,255);
+      mSlicers[slicer]->UpdateCursorPosition();
+      mSlicers[slicer]->SetCursorColor(10,212,255);
 
-        switch (mSlicers[slicer]->GetSliceOrientation())
+      switch (mSlicers[slicer]->GetSliceOrientation())
         {
         case vtkImageViewer2::SLICE_ORIENTATION_XY:
-            if (mSlicers[slicer]->GetSlice() == (int)floor(z))
-                mSlicers[slicer]->Render();
-            else
-                mSlicers[slicer]->SetSlice((int)floor(z));
-            break;
+         if (mSlicers[slicer]->GetSlice() == (int)floor(z))
+           mSlicers[slicer]->Render();
+         else
+           mSlicers[slicer]->SetSlice((int)floor(z));
+         break;
 
         case vtkImageViewer2::SLICE_ORIENTATION_XZ:
-            if (mSlicers[slicer]->GetSlice() == (int)floor(y))
-                mSlicers[slicer]->Render();
-            else
-                mSlicers[slicer]->SetSlice((int)floor(y));
-            break;
+         if (mSlicers[slicer]->GetSlice() == (int)floor(y))
+           mSlicers[slicer]->Render();
+         else
+           mSlicers[slicer]->SetSlice((int)floor(y));
+         break;
 
         case vtkImageViewer2::SLICE_ORIENTATION_YZ:
-            if (mSlicers[slicer]->GetSlice() == (int)floor(x))
-                mSlicers[slicer]->Render();
-            else
-                mSlicers[slicer]->SetSlice((int)floor(x));
-            break;
+         if (mSlicers[slicer]->GetSlice() == (int)floor(x))
+           mSlicers[slicer]->Render();
+         else
+           mSlicers[slicer]->SetSlice((int)floor(x));
+         break;
         }
 
-        for ( unsigned int i = 0; i < mSlicers.size(); i++)
+      for ( unsigned int i = 0; i < mSlicers.size(); i++)
         {
-            if (i != (unsigned int)slicer && mSlicers[i]->GetImageActor()->GetVisibility()
-                    && mSlicers[i]->GetRenderWindow()->GetSize()[0] > 2
-                    && mSlicers[i]->GetRenderWindow()->GetSize()[1] > 2)
+         if (i != (unsigned int)slicer && mSlicers[i]->GetImageActor()->GetVisibility()
+             && mSlicers[i]->GetRenderWindow()->GetSize()[0] > 2
+             && mSlicers[i]->GetRenderWindow()->GetSize()[1] > 2)
             {
-                mSlicers[i]->SetCurrentPosition(mSlicers[slicer]->GetCurrentPosition()[0],
-                                                mSlicers[slicer]->GetCurrentPosition()[1],
-                                                mSlicers[slicer]->GetCurrentPosition()[2],
-                                                mSlicers[slicer]->GetTSlice());
-                mSlicers[i]->UpdateCursorPosition();
-                if (current) //do not display corner annotation if image is the one picked
+             mSlicers[i]->SetCurrentPosition(mSlicers[slicer]->GetCurrentPosition()[0],
+                                             mSlicers[slicer]->GetCurrentPosition()[1],
+                                             mSlicers[slicer]->GetCurrentPosition()[2],
+                                             mSlicers[slicer]->GetTSlice());
+             mSlicers[i]->UpdateCursorPosition();
+             if (current) //do not display corner annotation if image is the one picked
                 {
-                    mSlicers[i]->SetCurrentPosition(-VTK_DOUBLE_MAX,-VTK_DOUBLE_MAX,
-                                                    -VTK_DOUBLE_MAX, mSlicers[slicer]->GetTSlice());
-                    mSlicers[i]->SetCursorColor(255,10,212);
+                 mSlicers[i]->SetCurrentPosition(-VTK_DOUBLE_MAX,-VTK_DOUBLE_MAX,
+                                                 -VTK_DOUBLE_MAX, mSlicers[slicer]->GetTSlice());
+                 mSlicers[i]->SetCursorColor(255,10,212);
                 }
-                else
+             else
                 {
-                    mSlicers[i]->SetCursorColor(150,10,282);
+                 mSlicers[i]->SetCursorColor(150,10,282);
                 }
-                switch (mSlicers[i]->GetSliceOrientation())
+             switch (mSlicers[i]->GetSliceOrientation())
                 {
                 case vtkImageViewer2::SLICE_ORIENTATION_XY:
-                    if (mSlicers[i]->GetSlice() == (int)floor(z))
-                        mSlicers[i]->Render();
-                    else
-                        mSlicers[i]->SetSlice((int)floor(z));
-                    break;
+                 if (mSlicers[i]->GetSlice() == (int)floor(z))
+                   mSlicers[i]->Render();
+                 else
+                   mSlicers[i]->SetSlice((int)floor(z));
+                 break;
 
                 case vtkImageViewer2::SLICE_ORIENTATION_XZ:
-                    if (mSlicers[i]->GetSlice() == (int)floor(y))
-                        mSlicers[i]->Render();
-                    else
-                        mSlicers[i]->SetSlice((int)floor(y));
-                    break;
+                 if (mSlicers[i]->GetSlice() == (int)floor(y))
+                   mSlicers[i]->Render();
+                 else
+                   mSlicers[i]->SetSlice((int)floor(y));
+                 break;
 
                 case vtkImageViewer2::SLICE_ORIENTATION_YZ:
-                    if (mSlicers[i]->GetSlice() == (int)floor(x))
-                        mSlicers[i]->Render();
-                    else
-                        mSlicers[i]->SetSlice((int)floor(x));
-                    break;
+                 if (mSlicers[i]->GetSlice() == (int)floor(x))
+                   mSlicers[i]->Render();
+                 else
+                   mSlicers[i]->SetSlice((int)floor(x));
+                 break;
                 }
-                UpdateSlice(i);
-                UpdateTSlice(i);
+             UpdateSlice(i);
+             UpdateTSlice(i);
             }
         }
     }
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::UpdateLinked(int 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])
-               /mSlicers[slicer]->GetInput()->GetSpacing()[1];
-    double z = (mSlicers[slicer]->GetCurrentPosition()[2] - mSlicers[slicer]->GetInput()->GetOrigin()[2])
-               /mSlicers[slicer]->GetInput()->GetSpacing()[2];
-
-    if (x >= mSlicers[slicer]->GetInput()->GetWholeExtent()[0] &&
-            x <= mSlicers[slicer]->GetInput()->GetWholeExtent()[1] &&
-            y >= mSlicers[slicer]->GetInput()->GetWholeExtent()[2] &&
-            y <= mSlicers[slicer]->GetInput()->GetWholeExtent()[3] &&
-            z >= mSlicers[slicer]->GetInput()->GetWholeExtent()[4] &&
-            z <= mSlicers[slicer]->GetInput()->GetWholeExtent()[5])
-    {
-        for (std::list<std::string>::const_iterator i = mLinkedId.begin(); i != mLinkedId.end(); i++)
+  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])
+    /mSlicers[slicer]->GetInput()->GetSpacing()[1];
+  double z = (mSlicers[slicer]->GetCurrentPosition()[2] - mSlicers[slicer]->GetInput()->GetOrigin()[2])
+    /mSlicers[slicer]->GetInput()->GetSpacing()[2];
+
+  if (x >= mSlicers[slicer]->GetInput()->GetWholeExtent()[0] &&
+      x <= mSlicers[slicer]->GetInput()->GetWholeExtent()[1] &&
+      y >= mSlicers[slicer]->GetInput()->GetWholeExtent()[2] &&
+      y <= mSlicers[slicer]->GetInput()->GetWholeExtent()[3] &&
+      z >= mSlicers[slicer]->GetInput()->GetWholeExtent()[4] &&
+      z <= mSlicers[slicer]->GetInput()->GetWholeExtent()[5])
+    {
+      for (std::list<std::string>::const_iterator i = mLinkedId.begin(); i != mLinkedId.end(); i++)
         {
-            emit UpdateLinkManager(*i, slicer,mSlicers[slicer]->GetCurrentPosition()[0],
-                                   mSlicers[slicer]->GetCurrentPosition()[1],
-                                   mSlicers[slicer]->GetCurrentPosition()[2],mSlicers[slicer]->GetTSlice());
+         emit UpdateLinkManager(*i, slicer,mSlicers[slicer]->GetCurrentPosition()[0],
+                                mSlicers[slicer]->GetCurrentPosition()[1],
+                                mSlicers[slicer]->GetCurrentPosition()[2],mSlicers[slicer]->GetTSlice());
         }
     }
 }
+//----------------------------------------------------------------------------
+
+
+//----------------------------------------------------------------------------
 double vvSlicerManager::GetColorWindow()
 {
-    if (mSlicers.size())
-        return mSlicers[0]->GetColorWindow();
-    return -1;
+  if (mSlicers.size())
+    return mSlicers[0]->GetColorWindow();
+  return -1;
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 double vvSlicerManager::GetColorLevel()
 {
-    if (mSlicers.size())
-        return mSlicers[0]->GetColorLevel();
-    return -1;
+  if (mSlicers.size())
+    return mSlicers[0]->GetColorLevel();
+  return -1;
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 void vvSlicerManager::Render()
 {
-    for ( unsigned int i = 0; i < mSlicers.size(); i++)
+  for ( unsigned int i = 0; i < mSlicers.size(); i++)
     {
-        mSlicers[i]->Render();
+      mSlicers[i]->Render();
     }
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 void vvSlicerManager::GenerateDefaultLookupTable()
 {
-    SetPreset(mPreset);
-    SetColorMap(mColorMap);
+  SetPreset(mPreset);
+  SetColorMap(mColorMap);
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 void vvSlicerManager::Reload()
 {
-    mReader->Update(mType);
-    mImage=mReader->GetOutput();
-    for ( unsigned int i = 0; i < mSlicers.size(); i++)
+  mReader->Update(mType);
+  mImage=mReader->GetOutput();
+  for ( unsigned int i = 0; i < mSlicers.size(); i++)
     {
-        mSlicers[i]->SetImage(mImage);
+      mSlicers[i]->SetImage(mImage);
     }
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::ReloadFusion()
 {
-    mFusionReader->Update();
-    for ( unsigned int i = 0; i < mSlicers.size(); i++)
+  mFusionReader->Update();
+  for ( unsigned int i = 0; i < mSlicers.size(); i++)
     {
-        mSlicers[i]->SetFusion(mFusionReader->GetOutput());
-        mSlicers[i]->Render();
+      mSlicers[i]->SetFusion(mFusionReader->GetOutput());
+      mSlicers[i]->Render();
     }
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::ReloadOverlay()
 {
-    mOverlayReader->Update();
-    for ( unsigned int i = 0; i < mSlicers.size(); i++)
+  mOverlayReader->Update();
+  for ( unsigned int i = 0; i < mSlicers.size(); i++)
     {
-        mSlicers[i]->SetOverlay(mOverlayReader->GetOutput());
-        mSlicers[i]->Render();
+      mSlicers[i]->SetOverlay(mOverlayReader->GetOutput());
+      mSlicers[i]->Render();
     }
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::ReloadVF()
 {
-    mVectorReader->Update(VECTORFIELD); //deletes the old images through the VF::Init() function
-    mVF=mVectorReader->GetOutput();
-    for ( unsigned int i = 0; i < mSlicers.size(); i++)
+  mVectorReader->Update(VECTORFIELD); //deletes the old images through the VF::Init() function
+  mVF=mVectorReader->GetOutput();
+  for ( unsigned int i = 0; i < mSlicers.size(); i++)
     {
-        mSlicers[i]->SetVF(mVF);
-        mSlicers[i]->Render();
+      mSlicers[i]->SetVF(mVF);
+      mSlicers[i]->Render();
     }
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::RemoveActor(const std::string& actor_type, int overlay_index)
 {
-    for (unsigned int i = 0; i < mSlicers.size();i++)
+  for (unsigned int i = 0; i < mSlicers.size();i++)
     {
-        mSlicers[i]->RemoveActor(actor_type,overlay_index);
+      mSlicers[i]->RemoveActor(actor_type,overlay_index);
     }
-    if (actor_type=="vector")
+  if (actor_type=="vector")
     {
-        mVF=NULL;
-        if (mVectorReader) {
-            delete mVectorReader;
-            mVectorReader=NULL;
-        }
+      mVF=NULL;
+      if (mVectorReader) {
+       delete mVectorReader;
+       mVectorReader=NULL;
+      }
     }
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::RemoveActors()
 {
-    ///This method leaks a few objects. See RemoveActor for what a correct implementation would look like
-    for ( unsigned int i = 0; i < mSlicers.size(); i++)
+  ///This method leaks a few objects. See RemoveActor for what a correct implementation would look like
+  for ( unsigned int i = 0; i < mSlicers.size(); i++)
     {
-        mSlicers[i]->SetDisplayMode(0);
-        mSlicers[i]->GetRenderer()->RemoveActor(mSlicers[i]->GetImageActor());
+      mSlicers[i]->SetDisplayMode(0);
+      mSlicers[i]->GetRenderer()->RemoveActor(mSlicers[i]->GetImageActor());
     }
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::UpdateInfoOnCursorPosition(int slicer)
 {
-//  int view = mSlicers[slicer]->GetSliceOrientation();
-//  int slice = mSlicers[slicer]->GetSlice();
-    double x = mSlicers[slicer]->GetCursorPosition()[0];
-    double y = mSlicers[slicer]->GetCursorPosition()[1];
-    double z = mSlicers[slicer]->GetCursorPosition()[2];
-    double X = (x - mSlicers[slicer]->GetInput()->GetOrigin()[0])/
-        mSlicers[slicer]->GetInput()->GetSpacing()[0];
-    double Y = (y - mSlicers[slicer]->GetInput()->GetOrigin()[1])/
-        mSlicers[slicer]->GetInput()->GetSpacing()[1];
-    double Z = (z - mSlicers[slicer]->GetInput()->GetOrigin()[2])/
-        mSlicers[slicer]->GetInput()->GetSpacing()[2];
-    double value = -VTK_DOUBLE_MAX;
-    int displayVec = 0;
-    double xVec=0, yVec=0, zVec=0, valueVec=0;
-    int displayOver = 0;
-    int displayFus = 0;
-    double valueOver=0, valueFus=0;
-    if (X >= mSlicers[slicer]->GetInput()->GetWholeExtent()[0] &&
-            X <= mSlicers[slicer]->GetInput()->GetWholeExtent()[1] &&
-            Y >= mSlicers[slicer]->GetInput()->GetWholeExtent()[2] &&
-            Y <= mSlicers[slicer]->GetInput()->GetWholeExtent()[3] &&
-            Z >= mSlicers[slicer]->GetInput()->GetWholeExtent()[4] &&
-            Z <= mSlicers[slicer]->GetInput()->GetWholeExtent()[5])
-    {
-        value = mSlicers[slicer]->GetInput()->GetScalarComponentAsDouble(
-                (int)floor(X),
-                (int)floor(Y),
-                (int)floor(Z),0);
-        if (mSlicers[slicer]->GetVFActor() && mSlicers[slicer]->GetVFActor()->GetVisibility())
+  //  int view = mSlicers[slicer]->GetSliceOrientation();
+  //  int slice = mSlicers[slicer]->GetSlice();
+  double x = mSlicers[slicer]->GetCursorPosition()[0];
+  double y = mSlicers[slicer]->GetCursorPosition()[1];
+  double z = mSlicers[slicer]->GetCursorPosition()[2];
+  double X = (x - mSlicers[slicer]->GetInput()->GetOrigin()[0])/
+    mSlicers[slicer]->GetInput()->GetSpacing()[0];
+  double Y = (y - mSlicers[slicer]->GetInput()->GetOrigin()[1])/
+    mSlicers[slicer]->GetInput()->GetSpacing()[1];
+  double Z = (z - mSlicers[slicer]->GetInput()->GetOrigin()[2])/
+    mSlicers[slicer]->GetInput()->GetSpacing()[2];
+  double value = -VTK_DOUBLE_MAX;
+  int displayVec = 0;
+  double xVec=0, yVec=0, zVec=0, valueVec=0;
+  int displayOver = 0;
+  int displayFus = 0;
+  double valueOver=0, valueFus=0;
+  if (X >= mSlicers[slicer]->GetInput()->GetWholeExtent()[0] &&
+      X <= mSlicers[slicer]->GetInput()->GetWholeExtent()[1] &&
+      Y >= mSlicers[slicer]->GetInput()->GetWholeExtent()[2] &&
+      Y <= mSlicers[slicer]->GetInput()->GetWholeExtent()[3] &&
+      Z >= mSlicers[slicer]->GetInput()->GetWholeExtent()[4] &&
+      Z <= mSlicers[slicer]->GetInput()->GetWholeExtent()[5])
+    {
+      value = mSlicers[slicer]->GetInput()->GetScalarComponentAsDouble(
+                                                                      (int)floor(X),
+                                                                      (int)floor(Y),
+                                                                      (int)floor(Z),0);
+      if (mSlicers[slicer]->GetVFActor() && mSlicers[slicer]->GetVFActor()->GetVisibility())
         {
-            displayVec = 1;
-            unsigned int currentTime = mSlicers[slicer]->GetTSlice();
-            vtkImageData *vf = NULL;
+         displayVec = 1;
+         unsigned int currentTime = mSlicers[slicer]->GetTSlice();
+         vtkImageData *vf = NULL;
 
-            if (mSlicers[slicer]->GetVF()->GetVTKImages().size() > currentTime)
-                vf = mSlicers[slicer]->GetVF()->GetVTKImages()[currentTime];
-            else
-                vf = mSlicers[slicer]->GetVF()->GetVTKImages()[0];
+         if (mSlicers[slicer]->GetVF()->GetVTKImages().size() > currentTime)
+           vf = mSlicers[slicer]->GetVF()->GetVTKImages()[currentTime];
+         else
+           vf = mSlicers[slicer]->GetVF()->GetVTKImages()[0];
 
-            if (vf)
+         if (vf)
             {
-                double Xvf = (x - vf->GetOrigin()[0])/ vf->GetSpacing()[0];
-                double Yvf = (y - vf->GetOrigin()[1])/ vf->GetSpacing()[1];
-                double Zvf = (z - vf->GetOrigin()[2])/ vf->GetSpacing()[2];
-                xVec = vf->GetScalarComponentAsDouble( (int)floor(Xvf), (int)floor(Yvf), (int)floor(Zvf),0);
-                yVec = vf->GetScalarComponentAsDouble( (int)floor(Xvf), (int)floor(Yvf), (int)floor(Zvf),1);
-                zVec = vf->GetScalarComponentAsDouble( (int)floor(Xvf), (int)floor(Yvf), (int)floor(Zvf),2);
-                valueVec = sqrt(xVec*xVec + yVec*yVec + zVec*zVec);
+             double Xvf = (x - vf->GetOrigin()[0])/ vf->GetSpacing()[0];
+             double Yvf = (y - vf->GetOrigin()[1])/ vf->GetSpacing()[1];
+             double Zvf = (z - vf->GetOrigin()[2])/ vf->GetSpacing()[2];
+             xVec = vf->GetScalarComponentAsDouble( (int)floor(Xvf), (int)floor(Yvf), (int)floor(Zvf),0);
+             yVec = vf->GetScalarComponentAsDouble( (int)floor(Xvf), (int)floor(Yvf), (int)floor(Zvf),1);
+             zVec = vf->GetScalarComponentAsDouble( (int)floor(Xvf), (int)floor(Yvf), (int)floor(Zvf),2);
+             valueVec = sqrt(xVec*xVec + yVec*yVec + zVec*zVec);
             }
         }
-        if (mSlicers[slicer]->GetOverlayActor() && mSlicers[slicer]->GetOverlayActor()->GetVisibility())
+      if (mSlicers[slicer]->GetOverlayActor() && mSlicers[slicer]->GetOverlayActor()->GetVisibility())
         {
-            displayOver = 1;
-            double Xover = (x - mSlicers[slicer]->GetOverlay()->GetOrigin()[0])
-                /mSlicers[slicer]->GetOverlay()->GetSpacing()[0];
-            double Yover = (y - mSlicers[slicer]->GetOverlay()->GetOrigin()[1])
-                /mSlicers[slicer]->GetOverlay()->GetSpacing()[1];
-            double Zover = (z - mSlicers[slicer]->GetOverlay()->GetOrigin()[2])
-                /mSlicers[slicer]->GetOverlay()->GetSpacing()[2];
-            if (Xover >= mSlicers[slicer]->GetOverlayMapper()->GetInput()->GetWholeExtent()[0] &&
-                    Xover <= mSlicers[slicer]->GetOverlayMapper()->GetInput()->GetWholeExtent()[1] &&
-                    Yover >= mSlicers[slicer]->GetOverlayMapper()->GetInput()->GetWholeExtent()[2] &&
-                    Yover <= mSlicers[slicer]->GetOverlayMapper()->GetInput()->GetWholeExtent()[3] &&
-                    Zover >= mSlicers[slicer]->GetOverlayMapper()->GetInput()->GetWholeExtent()[4] &&
-                    Zover <= mSlicers[slicer]->GetOverlayMapper()->GetInput()->GetWholeExtent()[5])
+         displayOver = 1;
+         double Xover = (x - mSlicers[slicer]->GetOverlay()->GetOrigin()[0])
+           /mSlicers[slicer]->GetOverlay()->GetSpacing()[0];
+         double Yover = (y - mSlicers[slicer]->GetOverlay()->GetOrigin()[1])
+           /mSlicers[slicer]->GetOverlay()->GetSpacing()[1];
+         double Zover = (z - mSlicers[slicer]->GetOverlay()->GetOrigin()[2])
+           /mSlicers[slicer]->GetOverlay()->GetSpacing()[2];
+         if (Xover >= mSlicers[slicer]->GetOverlayMapper()->GetInput()->GetWholeExtent()[0] &&
+             Xover <= mSlicers[slicer]->GetOverlayMapper()->GetInput()->GetWholeExtent()[1] &&
+             Yover >= mSlicers[slicer]->GetOverlayMapper()->GetInput()->GetWholeExtent()[2] &&
+             Yover <= mSlicers[slicer]->GetOverlayMapper()->GetInput()->GetWholeExtent()[3] &&
+             Zover >= mSlicers[slicer]->GetOverlayMapper()->GetInput()->GetWholeExtent()[4] &&
+             Zover <= mSlicers[slicer]->GetOverlayMapper()->GetInput()->GetWholeExtent()[5])
             {
-                valueOver = static_cast<vtkImageData*>(mSlicers[slicer]->GetOverlayMapper()->GetInput())->
-                    GetScalarComponentAsDouble(
-                            (int)floor(Xover),
-                            (int)floor(Yover),
-                            (int)floor(Zover),0);
+             valueOver = static_cast<vtkImageData*>(mSlicers[slicer]->GetOverlayMapper()->GetInput())->
+               GetScalarComponentAsDouble(
+                                          (int)floor(Xover),
+                                          (int)floor(Yover),
+                                          (int)floor(Zover),0);
             }
         }
-        if (mSlicers[slicer]->GetFusionActor() && mSlicers[slicer]->GetFusionActor()->GetVisibility())
+      if (mSlicers[slicer]->GetFusionActor() && mSlicers[slicer]->GetFusionActor()->GetVisibility())
         {
-            displayFus = 1;
-            double Xfus = (x - mSlicers[slicer]->GetFusion()->GetOrigin()[0])
-                /mSlicers[slicer]->GetFusion()->GetSpacing()[0];
-            double Yfus = (y - mSlicers[slicer]->GetFusion()->GetOrigin()[1])
-                /mSlicers[slicer]->GetFusion()->GetSpacing()[1];
-            double Zfus = (z - mSlicers[slicer]->GetFusion()->GetOrigin()[2])
-                /mSlicers[slicer]->GetFusion()->GetSpacing()[2];
-            if (Xfus >= mSlicers[slicer]->GetFusionMapper()->GetInput()->GetWholeExtent()[0] &&
-                    Xfus <= mSlicers[slicer]->GetFusionMapper()->GetInput()->GetWholeExtent()[1] &&
-                    Yfus >= mSlicers[slicer]->GetFusionMapper()->GetInput()->GetWholeExtent()[2] &&
-                    Yfus <= mSlicers[slicer]->GetFusionMapper()->GetInput()->GetWholeExtent()[3] &&
-                    Zfus >= mSlicers[slicer]->GetFusionMapper()->GetInput()->GetWholeExtent()[4] &&
-                    Zfus <= mSlicers[slicer]->GetFusionMapper()->GetInput()->GetWholeExtent()[5])
+         displayFus = 1;
+         double Xfus = (x - mSlicers[slicer]->GetFusion()->GetOrigin()[0])
+           /mSlicers[slicer]->GetFusion()->GetSpacing()[0];
+         double Yfus = (y - mSlicers[slicer]->GetFusion()->GetOrigin()[1])
+           /mSlicers[slicer]->GetFusion()->GetSpacing()[1];
+         double Zfus = (z - mSlicers[slicer]->GetFusion()->GetOrigin()[2])
+           /mSlicers[slicer]->GetFusion()->GetSpacing()[2];
+         if (Xfus >= mSlicers[slicer]->GetFusionMapper()->GetInput()->GetWholeExtent()[0] &&
+             Xfus <= mSlicers[slicer]->GetFusionMapper()->GetInput()->GetWholeExtent()[1] &&
+             Yfus >= mSlicers[slicer]->GetFusionMapper()->GetInput()->GetWholeExtent()[2] &&
+             Yfus <= mSlicers[slicer]->GetFusionMapper()->GetInput()->GetWholeExtent()[3] &&
+             Zfus >= mSlicers[slicer]->GetFusionMapper()->GetInput()->GetWholeExtent()[4] &&
+             Zfus <= mSlicers[slicer]->GetFusionMapper()->GetInput()->GetWholeExtent()[5])
             {
-                valueFus = static_cast<vtkImageData*>(mSlicers[slicer]->GetFusionMapper()->GetInput())->
-                    GetScalarComponentAsDouble(
-                            (int)floor(Xfus),
-                            (int)floor(Yfus),
-                            (int)floor(Zfus),0);
+             valueFus = static_cast<vtkImageData*>(mSlicers[slicer]->GetFusionMapper()->GetInput())->
+               GetScalarComponentAsDouble(
+                                          (int)floor(Xfus),
+                                          (int)floor(Yfus),
+                                          (int)floor(Zfus),0);
             }
         }
-        emit UpdatePosition(mSlicers[slicer]->GetCursorVisibility(),
-                x,y,z,X,Y,Z,value);
-        emit UpdateVector(displayVec,xVec, yVec, zVec, valueVec);
-        emit UpdateOverlay(displayOver,valueOver,value);
-        emit UpdateFusion(displayFus,valueFus);
-        for (unsigned int i = 0; i < mSlicers.size(); i++)
+      emit UpdatePosition(mSlicers[slicer]->GetCursorVisibility(),
+                         x,y,z,X,Y,Z,value);
+      emit UpdateVector(displayVec,xVec, yVec, zVec, valueVec);
+      emit UpdateOverlay(displayOver,valueOver,value);
+      emit UpdateFusion(displayFus,valueFus);
+      for (unsigned int i = 0; i < mSlicers.size(); i++)
         {
-            if (mSlicers[i]->GetImageActor()->GetVisibility() == 1)
-                emit UpdateWindows(i,mSlicers[i]->GetSliceOrientation(),mSlicers[i]->GetSlice());
-            else
-                emit UpdateWindows(i,-1,-1);
+         if (mSlicers[i]->GetImageActor()->GetVisibility() == 1)
+           emit UpdateWindows(i,mSlicers[i]->GetSliceOrientation(),mSlicers[i]->GetSlice());
+         else
+           emit UpdateWindows(i,-1,-1);
         }
     }
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 void vvSlicerManager::Activated()
 {
-    emit currentImageChanged(mId);
+  emit currentImageChanged(mId);
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::UpdateWindowLevel()
 {
-    emit WindowLevelChanged(mSlicers[0]->GetColorWindow(),mSlicers[0]->GetColorLevel(),mPreset,mColorMap);
+  emit WindowLevelChanged(mSlicers[0]->GetColorWindow(),mSlicers[0]->GetColorLevel(),mPreset,mColorMap);
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::UpdateSlice(int slicer)
 {
-    emit UpdateSlice(slicer, mSlicers[slicer]->GetSlice());
+  emit UpdateSlice(slicer, mSlicers[slicer]->GetSlice());
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::UpdateTSlice(int slicer)
 {
-    emit UpdateTSlice(slicer,mSlicers[0]->GetTSlice());
+  emit UpdateTSlice(slicer,mSlicers[0]->GetTSlice());
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::UpdateSliceRange(int slicer)
 {
-    emit UpdateSliceRange(slicer,
-                          mSlicers[slicer]->GetSliceRange()[0], mSlicers[slicer]->GetSliceRange()[1],
-                          0,mSlicers[slicer]->GetTMax());
+  emit UpdateSliceRange(slicer,
+                       mSlicers[slicer]->GetSliceRange()[0], mSlicers[slicer]->GetSliceRange()[1],
+                       0,mSlicers[slicer]->GetTMax());
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::SetPreset(int preset)
 {
-    //vtkLookupTable* LUT = static_cast<vtkLookupTable*>(mSlicers[0]->GetWindowLevel()->GetLookupTable());
-    double window = mSlicers[0]->GetColorWindow();
-    double level = mSlicers[0]->GetColorLevel();
+  //vtkLookupTable* LUT = static_cast<vtkLookupTable*>(mSlicers[0]->GetWindowLevel()->GetLookupTable());
+  double window = mSlicers[0]->GetColorWindow();
+  double level = mSlicers[0]->GetColorLevel();
 
-    std::string component_type=mImage->GetScalarTypeAsString();
-    switch (preset)
+  std::string component_type=mImage->GetScalarTypeAsString();
+  switch (preset)
     {
     case 0:
-        if (component_type == "unsigned_char")
+      if (component_type == "unsigned_char")
         {
-            window = 255;
-            level = 127;
+         window = 255;
+         level = 127;
         }
-        else if (component_type == "short")
+      else if (component_type == "short")
         {
-            window = 2000;
-            level = 0;
+         window = 2000;
+         level = 0;
         }
-        else
+      else
         {
-            double range[2];
-            mImage->GetScalarRange(range);
-            window = range[1] - range[0];
-            level = (range[1] + range[0])* 0.5;
+         double range[2];
+         mImage->GetScalarRange(range);
+         window = range[1] - range[0];
+         level = (range[1] + range[0])* 0.5;
         }
-        break;
+      break;
     case 1:
-        window = 2000;
-        level = 0;
-        break;
+      window = 2000;
+      level = 0;
+      break;
     case 2:
-        window = 350;
-        level = 60;
-        break;
+      window = 350;
+      level = 60;
+      break;
     case 3:
-        window = 1500;
-        level = -500;
-        break;
+      window = 1500;
+      level = -500;
+      break;
     case 4:
-        window = 1000;
-        level = 500;
-        break;
+      window = 1000;
+      level = 500;
+      break;
     case 5:
-        window = 1;
-        level = 0.5;
-        break;
+      window = 1;
+      level = 0.5;
+      break;
     case 6:
-        break;
+      break;
     case 7:
-        window=1.;
-        level=0.;
-        break;
+      window=1.;
+      level=0.;
+      break;
     }
-    mPreset = preset;
-    this->SetColorWindow(window);
-    this->SetColorLevel(level);
-
-    //if (LUT)
-    //{
-    //    SetColorMap(-1);
-    //}
+  mPreset = preset;
+  this->SetColorWindow(window);
+  this->SetColorLevel(level);
+
+  //if (LUT)
+  //{
+  //    SetColorMap(-1);
+  //}
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::SetLocalColorWindowing(const int slicer)
 {
-    double min, max;
-       this->mSlicers[slicer]->GetExtremasAroundMousePointer(min, max);
-    this->SetColorWindow(max-min);
-    this->SetColorLevel(0.5*(min+max));
-       this->Render();
+  double min, max;
+  this->mSlicers[slicer]->GetExtremasAroundMousePointer(min, max);
+  this->SetColorWindow(max-min);
+  this->SetColorLevel(0.5*(min+max));
+  this->Render();
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::SetColorMap()
 {
-    SetColorMap(mColorMap);
+  SetColorMap(mColorMap);
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 void vvSlicerManager::SetColorMap(int colormap)
 {
-    double range[2];
-    range[0] = mSlicers[0]->GetInput()->GetScalarRange()[0];
-    range[1] = mSlicers[0]->GetInput()->GetScalarRange()[1];
+  double range[2];
+  range[0] = mSlicers[0]->GetInput()->GetScalarRange()[0];
+  range[1] = mSlicers[0]->GetInput()->GetScalarRange()[1];
 
-    double window = mSlicers[0]->GetWindowLevel()->GetWindow();
-    double level = mSlicers[0]->GetWindowLevel()->GetLevel();
+  double window = mSlicers[0]->GetWindowLevel()->GetWindow();
+  double level = mSlicers[0]->GetWindowLevel()->GetLevel();
 
-    vtkLookupTable* LUT = static_cast<vtkLookupTable*>(mSlicers[0]->GetWindowLevel()->GetLookupTable());
-    switch (colormap)
+  vtkLookupTable* LUT = static_cast<vtkLookupTable*>(mSlicers[0]->GetWindowLevel()->GetLookupTable());
+  switch (colormap)
     {
     case -1:
-        break;
+      break;
     case 0:
-        LUT = NULL;
-        break;
+      LUT = NULL;
+      break;
     case 1:
-        if (LUT == NULL)
-            LUT = vtkLookupTable::New();
-        LUT->SetValueRange(0,1);
-        LUT->SetSaturationRange(1,1);
-        LUT->SetHueRange(0,0.18);
-        break;
+      if (LUT == NULL)
+       LUT = vtkLookupTable::New();
+      LUT->SetValueRange(0,1);
+      LUT->SetSaturationRange(1,1);
+      LUT->SetHueRange(0,0.18);
+      break;
     case 2:
-        if (LUT == NULL)
-            LUT = vtkLookupTable::New();
-        LUT->SetValueRange(0,1);
-        LUT->SetSaturationRange(1,1);
-        LUT->SetHueRange(0.4,0.80);
-        break;
+      if (LUT == NULL)
+       LUT = vtkLookupTable::New();
+      LUT->SetValueRange(0,1);
+      LUT->SetSaturationRange(1,1);
+      LUT->SetHueRange(0.4,0.80);
+      break;
     case 3:
-        if (LUT == NULL)
-            LUT = vtkLookupTable::New();
-        LUT->SetValueRange(0,1);
-        LUT->SetSaturationRange(1,1);
-        LUT->SetHueRange(0,1);
-        break;
+      if (LUT == NULL)
+       LUT = vtkLookupTable::New();
+      LUT->SetValueRange(0,1);
+      LUT->SetSaturationRange(1,1);
+      LUT->SetHueRange(0,1);
+      break;
     case 5:
-        if (LUT == NULL)
-            LUT = vtkLookupTable::New();
-        LUT->SetValueRange(0.,1);
-        LUT->SetSaturationRange(1,1);
-        LUT->SetHueRange(1,0.1);
-        //LUT->SetRampToLinear();
-        break;
-    }
-    if (LUT)
-    {
-        LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
-        LUT->Build();
-    }
-    vtkLookupTable* fusLUT = NULL;
-    if (mSlicers[0]->GetFusion())
-    {
-        fusLUT = vtkLookupTable::New();
-        double fusRange [2];
-        fusRange[0] = mFusionLevel - mFusionWindow/2;
-        fusRange[1] = mFusionLevel + mFusionWindow/2;
-        fusLUT->SetTableRange(fusRange[0],fusRange[1]);
-        fusLUT->SetValueRange(1,1);
-        fusLUT->SetSaturationRange(1,1);
-        if (mFusionColorMap == 1)
-            fusLUT->SetHueRange(0,0.18);
-        else if (mFusionColorMap == 2)
-            fusLUT->SetHueRange(0.4,0.80);
-        else if (mFusionColorMap == 3)
-            fusLUT->SetHueRange(0,1);
-        fusLUT->Build();
-        if (mFusionColorMap == 0)
-            fusLUT = NULL;
-    }
-    for ( unsigned int i = 0; i < mSlicers.size(); i++) {
-        if (mSlicers[i]->GetOverlay() && mSlicers[i]->GetOverlayActor()->GetVisibility()) {
-            vtkLookupTable* supLUT = vtkLookupTable::New();
-            supLUT->SetTableRange(range[0],range[1]);
-            supLUT->SetValueRange(1,1);
-            supLUT->SetSaturationRange(1,1);
-            supLUT->SetHueRange(double(mOverlayColor)/360,double(mOverlayColor)/360);
-            supLUT->Build();
-            vtkLookupTable* invLUT = vtkLookupTable::New();
-            invLUT->SetTableRange(range[0],range[1]);
-            invLUT->SetValueRange(1,1);
-            invLUT->SetSaturationRange(1,1);
-            invLUT->SetHueRange(double((mOverlayColor+180)%360)/360,double((mOverlayColor+180)%360)/360);
-            invLUT->Build();
-            dynamic_cast<vvImageMapToWLColors*>(mSlicers[i]->GetWindowLevel())
-                ->SetWindowLevelMode(true);
-            mSlicers[i]->GetWindowLevel()->SetLookupTable(supLUT);
-            mSlicers[i]->GetOverlayMapper()->SetLookupTable(invLUT);
-            invLUT->Delete();
-            supLUT->Delete();
-        }
-        else if (mSlicers[i]->GetOverlay())
-        {
-            //dynamic_cast<vvImageMapToWLColors*>(mSlicers[i]->GetWindowLevel())
-                //->SetWindowLevelMode(false);
-            mSlicers[i]->GetWindowLevel()->SetLookupTable(LUT);
-        }
-        else
-        {
-            mSlicers[i]->GetWindowLevel()->SetLookupTable(LUT);
-        }
-        if (mSlicers[i]->GetFusion() && mSlicers[i]->GetFusionActor()->GetVisibility())
-        {
-            mSlicers[i]->GetFusionActor()->SetOpacity(double(mFusionOpacity)/100);
-            mSlicers[i]->GetFusionMapper()->SetLookupTable(fusLUT);
-        }
+      if (LUT == NULL)
+       LUT = vtkLookupTable::New();
+      LUT->SetValueRange(0.,1);
+      LUT->SetSaturationRange(1,1);
+      LUT->SetHueRange(1,0.1);
+      //LUT->SetRampToLinear();
+      break;
+    }
+  if (LUT)
+    {
+      LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
+      LUT->Build();
     }
-    if (fusLUT)
-        fusLUT->Delete();
-    if (colormap >= 0)
-        mColorMap = colormap;
+  vtkLookupTable* fusLUT = NULL;
+  if (mSlicers[0]->GetFusion())
+    {
+      fusLUT = vtkLookupTable::New();
+      double fusRange [2];
+      fusRange[0] = mFusionLevel - mFusionWindow/2;
+      fusRange[1] = mFusionLevel + mFusionWindow/2;
+      fusLUT->SetTableRange(fusRange[0],fusRange[1]);
+      fusLUT->SetValueRange(1,1);
+      fusLUT->SetSaturationRange(1,1);
+      if (mFusionColorMap == 1)
+       fusLUT->SetHueRange(0,0.18);
+      else if (mFusionColorMap == 2)
+       fusLUT->SetHueRange(0.4,0.80);
+      else if (mFusionColorMap == 3)
+       fusLUT->SetHueRange(0,1);
+      fusLUT->Build();
+      if (mFusionColorMap == 0)
+       fusLUT = NULL;
+    }
+  for ( unsigned int i = 0; i < mSlicers.size(); i++) {
+    if (mSlicers[i]->GetOverlay() && mSlicers[i]->GetOverlayActor()->GetVisibility()) {
+      vtkLookupTable* supLUT = vtkLookupTable::New();
+      supLUT->SetTableRange(range[0],range[1]);
+      supLUT->SetValueRange(1,1);
+      supLUT->SetSaturationRange(1,1);
+      supLUT->SetHueRange(double(mOverlayColor)/360,double(mOverlayColor)/360);
+      supLUT->Build();
+      vtkLookupTable* invLUT = vtkLookupTable::New();
+      invLUT->SetTableRange(range[0],range[1]);
+      invLUT->SetValueRange(1,1);
+      invLUT->SetSaturationRange(1,1);
+      invLUT->SetHueRange(double((mOverlayColor+180)%360)/360,double((mOverlayColor+180)%360)/360);
+      invLUT->Build();
+      dynamic_cast<vvImageMapToWLColors*>(mSlicers[i]->GetWindowLevel())
+       ->SetWindowLevelMode(true);
+      mSlicers[i]->GetWindowLevel()->SetLookupTable(supLUT);
+      mSlicers[i]->GetOverlayMapper()->SetLookupTable(invLUT);
+      invLUT->Delete();
+      supLUT->Delete();
+    }
+    else if (mSlicers[i]->GetOverlay())
+      {
+       //dynamic_cast<vvImageMapToWLColors*>(mSlicers[i]->GetWindowLevel())
+       //->SetWindowLevelMode(false);
+       mSlicers[i]->GetWindowLevel()->SetLookupTable(LUT);
+      }
+    else
+      {
+       mSlicers[i]->GetWindowLevel()->SetLookupTable(LUT);
+      }
+    if (mSlicers[i]->GetFusion() && mSlicers[i]->GetFusionActor()->GetVisibility())
+      {
+       mSlicers[i]->GetFusionActor()->SetOpacity(double(mFusionOpacity)/100);
+       mSlicers[i]->GetFusionMapper()->SetLookupTable(fusLUT);
+      }
+  }
+  if (fusLUT)
+    fusLUT->Delete();
+  if (colormap >= 0)
+    mColorMap = colormap;
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 vvLandmarks* vvSlicerManager::GetLandmarks()
 {
-    if (mLandmarks == NULL)
+  if (mLandmarks == NULL)
     {
-        mLandmarks = new vvLandmarks(mSlicers[0]->GetTMax()+1);
-        for (unsigned int i = 0; i < mSlicers.size(); i++)
-            mSlicers[i]->SetLandmarks(mLandmarks);
+      mLandmarks = new vvLandmarks(mSlicers[0]->GetTMax()+1);
+      for (unsigned int i = 0; i < mSlicers.size(); i++)
+       mSlicers[i]->SetLandmarks(mLandmarks);
     }
-    return mLandmarks;
+  return mLandmarks;
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicerManager::AddLandmark(float x,float y,float z,float t)
 {
-    double x_index = (x - mSlicers[0]->GetInput()->GetOrigin()[0])/mSlicers[0]->GetInput()->GetSpacing()[0];
-    double y_index = (y - mSlicers[0]->GetInput()->GetOrigin()[1])/mSlicers[0]->GetInput()->GetSpacing()[1];
-    double z_index = (z - mSlicers[0]->GetInput()->GetOrigin()[2])/mSlicers[0]->GetInput()->GetSpacing()[2];
-    double value = mSlicers[0]->GetInput()->GetScalarComponentAsDouble(
-            (int)x_index,
-            (int)y_index,
-            (int)z_index,0);
-    this->GetLandmarks()->AddLandmark(x,y,z,t,value);
-    emit LandmarkAdded();
+  double x_index = (x - mSlicers[0]->GetInput()->GetOrigin()[0])/mSlicers[0]->GetInput()->GetSpacing()[0];
+  double y_index = (y - mSlicers[0]->GetInput()->GetOrigin()[1])/mSlicers[0]->GetInput()->GetSpacing()[1];
+  double z_index = (z - mSlicers[0]->GetInput()->GetOrigin()[2])/mSlicers[0]->GetInput()->GetSpacing()[2];
+  double value = mSlicers[0]->GetInput()->GetScalarComponentAsDouble(
+                                                                    (int)x_index,
+                                                                    (int)y_index,
+                                                                    (int)z_index,0);
+  this->GetLandmarks()->AddLandmark(x,y,z,t,value);
+  emit LandmarkAdded();
 }
+//----------------------------------------------------------------------------
index e404dc20f96df52f9f68006f83a7942612d8bba8..c1da2533bf7db8d734fbb26756edef40c6101b57 100644 (file)
@@ -15,8 +15,9 @@
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 ======================================================================-====*/
-#ifndef vvSlicerManager_h
-#define vvSlicerManager_h
+#ifndef VVSLICERMANAGER_H
+#define VVSLICERMANAGER_H
+
 #include <iostream>
 #include <vector>
 #include <string>
@@ -113,9 +114,7 @@ public:
         return mId;
     }
 
-    void SetFilename(std::string f) {
-        mFileName = f;
-    }
+    void SetFilename(std::string f);
 
     void SetTSlice(int slice);
     void SetNextTSlice(int originating_slicer);
index 8d2e1d661b51d4c214d022a373b3160d2feccce4..c8ea3119477175c80b7c871c65307bc8d7604d6d 100644 (file)
@@ -15,6 +15,8 @@
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 ======================================================================-====*/
+
+
 #ifndef VVTOOLBASE_CXX
 #define VVTOOLBASE_CXX
 #include "vvToolBase.h"
index 535fa23dcd60ea80185a4ce0bf7362f3344e2aa7..a6629504bb23329e038a9e0ffa56ca0b11fc2d3f 100644 (file)
@@ -15,6 +15,7 @@
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 ======================================================================-====*/
+
 #ifndef VVTOOLBASE_H
 #define VVTOOLBASE_H
 #include "vvToolBaseBase.h"
@@ -37,6 +38,10 @@ public:
     CREATOR(ToolType)->GetMainWindow()->AddImage(image,filename); 
   }
 
+  void setSender(QObject *s) { mSender = s; }
+
+ protected:
+  QObject * mSender;
 };
 //------------------------------------------------------------------------------
 
index 86b71372ac04acd5b00e178052b444abddb298e6..7e1ac3024391fd96babc9d05f0f87d4912f8dc0f 100644 (file)
@@ -15,6 +15,7 @@
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 ======================================================================-====*/
+
 template<class ToolType>
 vvToolBase<ToolType>::vvToolBase(vvMainWindowBase * m) { 
   mMainWindowBase = m; 
index 0c71deb9a50342874fdaf40af67633818875d38b..4a9f4af3d0504f376b08fad9f882e59c43f0f89a 100644 (file)
@@ -15,6 +15,7 @@
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 ======================================================================-====*/
+
 #ifndef VVTOOLBASEBASE_H
 #define VVTOOLBASEBASE_H
 #include "vvMainWindowBase.h"
index 91afa6dd15080e9facae81dcbe1f25ab3d15c680..f8b11e3c2791c0b348d4976d03d03d13a6b69919 100644 (file)
@@ -15,6 +15,7 @@
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 ======================================================================-====*/
+
 #include "vvToolBinarize.h"
 #include "vvSlicerManager.h"
 #include "vvSlicer.h"
@@ -37,7 +38,7 @@ ADD_TOOL(vvToolBinarize);
 void vvToolBinarize::Initialize() {
   SetToolName("Binarize");
   SetToolMenuName("Binarize");
-  SetToolIconFilename(":/new/prefix1/icons/binarize.png");
+  SetToolIconFilename(":/common/icons/binarize.png");
   SetToolTip("Image interactive binarization with thresholds.");
 }
 //------------------------------------------------------------------------------
index ff96010ee481e00932bb6e628ba30e11bd581930..5859a2f1e71dec01f2e4046701edf871b24af2b7 100644 (file)
@@ -17,6 +17,7 @@
 ======================================================================-====*/
 #ifndef VVTOOLCREATOR_H
 #define VVTOOLCREATOR_H
+
 #include "vvToolCreatorBase.h"
 
 //------------------------------------------------------------------------------
index c6a9566f804575917e3c0ecf5e1694cb8c938526..33fd9e040c24bd46e776f07e366dfc31e72ba1fe 100644 (file)
@@ -15,6 +15,8 @@
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 ======================================================================-====*/
+
+//------------------------------------------------------------------------------
 template<class ToolType>
 void vvToolCreator<ToolType>::InsertToolInMenu(vvMainWindowBase * m) { 
   mMainWindow = m;
index 394602e37afca3f9ca0b6edc0a9dfcb8abaa7367..4f6fe47eac5838293044e925e3c451ef04a26326 100644 (file)
@@ -15,6 +15,7 @@
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 ======================================================================-====*/
+
 #include "vvToolCreatorBase.h"
 #include "vvToolManager.h"
 #include <QAction>
 
 //------------------------------------------------------------------------------
 vvToolCreatorBase::vvToolCreatorBase(QString name): mExperimental(false) { 
+  mUseContextMenu = false;
   mToolName = name;
   vvToolManager::GetInstance()->AddTool(this); 
 }
 //------------------------------------------------------------------------------
 
+//------------------------------------------------------------------------------
+void vvToolCreatorBase::MenuToolSlot() { 
+  mSender = QObject::sender(); 
+  MenuSpecificToolSlot(); 
+}
+//------------------------------------------------------------------------------
+
 
 //------------------------------------------------------------------------------
 void vvToolCreatorBase::InsertToolInMenu(vvMainWindowBase * m) { 
   mMainWindow = m; 
+  if (mUseContextMenu) {
+    InsertToolInContextMenu();
+    return; 
+  }
   // Create main action
   if (mToolIconFilename == "noicon") 
     mAction = new QAction(QString("&").append(mToolMenuName), this);
@@ -47,3 +60,23 @@ void vvToolCreatorBase::InsertToolInMenu(vvMainWindowBase * m) {
 } 
 //------------------------------------------------------------------------------
 
+
+//------------------------------------------------------------------------------
+void vvToolCreatorBase::InsertToolInContextMenu() { 
+  mMainWindow->GetContextMenu()->addMenu(mToolMenu);
+  for(unsigned int i=0; i<mListOfActions.size(); i++) {
+    connect(mListOfActions[i], SIGNAL(triggered()), this, SLOT(MenuToolSlot()));
+  }
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolCreatorBase::addMenuToContextMenu(QMenu * m) {
+  mToolMenu = m;
+  for(int i=0; i<m->actions().length(); i++) {
+    mListOfActions.push_back(m->actions()[i]);
+  }
+  mUseContextMenu = true;
+}
+//------------------------------------------------------------------------------
index 8078d1927bdbe1d1fe4e03273939541758ec66d7..025588864055c566c2b4ba2e7ce61c727a798077 100644 (file)
@@ -32,9 +32,11 @@ class vvToolCreatorBase: public QObject {
   vvToolCreatorBase(QString name);
   virtual ~vvToolCreatorBase() {;}  
   virtual void InsertToolInMenu(vvMainWindowBase * m);
+  virtual void InsertToolInContextMenu();
   template<class ToolType> void CreateTool();
   virtual void MenuSpecificToolSlot() = 0;
   vvMainWindowBase * GetMainWindow() const { return mMainWindow; }
+  void addMenuToContextMenu(QMenu * m);
 
   QString mToolName;
   QString mToolMenuName;
@@ -42,13 +44,17 @@ class vvToolCreatorBase: public QObject {
   QString mToolTip;
   QAction * mAction;
   bool mExperimental;
+  bool mUseContextMenu;
+  QMenu * mToolMenu;
+  std::vector<QAction*> mListOfActions;
 
 public slots:
-  virtual void MenuToolSlot() { MenuSpecificToolSlot(); }
+  virtual void MenuToolSlot();
 
 protected:
   vvMainWindowBase * mMainWindow;
   std::vector<vvToolBaseBase*> mListOfTool;
+  QObject * mSender;
 };
 //------------------------------------------------------------------------------
 
index 2f7121e339e63426bfda16de0c5299ceb2fa729f..94741ddff3133af84608c4547ba1aecaa807647f 100644 (file)
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 ======================================================================-====*/
+
 template<class ToolType>
 void vvToolCreatorBase::CreateTool() {
   // Get information on the current image
   mMainWindow->UpdateCurrentSlicer();
   // Create the tool
   ToolType * tool = new ToolType(mMainWindow);
+  tool->setSender(mSender);
   // Put it in the list of open tools
   mListOfTool.push_back(tool);
   // Go !
index c118bf1cf0c6534d20c61595a5df4dd15fcacb3f..308396de6c877dc4fe3ecaebbb96fda1f2531c87 100644 (file)
@@ -56,7 +56,7 @@ public slots:
   static void Initialize() {
     SetToolName("Crop");
     SetToolMenuName("Crop");
-    SetToolIconFilename(":/new/prefix1/icons/crop.png");
+    SetToolIconFilename(":/common/icons/crop.png");
     SetToolTip("Crop image.");
   }
 
index 29c315ecad711fc3bef28af683c0a03384e0a50f..66a97d7417c8e813a5cf592728264a6e0e8fbe0e 100644 (file)
@@ -44,7 +44,7 @@ vvToolFoo::~vvToolFoo() {
 void vvToolFoo::Initialize() {
   SetToolName("Foo");
   SetToolMenuName("Foo");
-  SetToolIconFilename(":/new/prefix1/icons/ducky.png");
+  SetToolIconFilename(":/common/icons/ducky.png");
   SetToolTip("Make 'foo' on an image.");
 }
 //------------------------------------------------------------------------------
index 56f5a2205b61cf9ccf806d4dbba7fcc4f470838e..719c9b0aed1bc449c156cb4288ec14877dfb31a4 100644 (file)
@@ -44,7 +44,7 @@ vvToolFooWithWidgetBase::~vvToolFooWithWidgetBase() {
 void vvToolFooWithWidgetBase::Initialize() {
   SetToolName("Foo");
   SetToolMenuName("Foo with WidgetBase");
-  SetToolIconFilename(":/new/prefix1/icons/ducky.png");
+  SetToolIconFilename(":/common/icons/ducky.png");
   SetToolTip("Make 'foo' on an image.");
 }
 //------------------------------------------------------------------------------
index f3cc6f39c1cd27e850500d0f8a2eca3f0662f2ef..d380531c16b4863573bc21bcd84cc4a3d2df267e 100644 (file)
@@ -54,7 +54,7 @@ vvToolImageArithm::~vvToolImageArithm() {
 void vvToolImageArithm::Initialize() {
   SetToolName("ImageArithm");
   SetToolMenuName("ImageArithm");
-  SetToolIconFilename(":/new/prefix1/icons/cross.png");
+  SetToolIconFilename(":/common/icons/arithm.png");
   SetToolTip("Perform simple arithmetic operations on one or two images.");
   SetToolExperimental(true);
 }
index 37608ef2d5ecb832a446af787206eb10fbaaeaaf..f1450cee6b1050eda2eb86fac313f9f7380b4dec 100644 (file)
@@ -15,6 +15,7 @@
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 ======================================================================-====*/
+
 #include "vvToolManager.h"
 #include "vvToolCreatorBase.h"
 #include "vvMainWindowBase.h"