]> Creatis software - clitk.git/blobdiff - vv/vv.cxx
Merge branch 'master' of git.creatis.insa-lyon.fr:clitk
[clitk.git] / vv / vv.cxx
index f7b95df3139c056667d8bb622df95263a4f25e05..1fb357e2419c7a082da57eaa7cd951c1417462ed 100644 (file)
--- a/vv/vv.cxx
+++ b/vv/vv.cxx
@@ -30,6 +30,7 @@
 
 #include "clitkIO.h"
 #include "vvMainWindow.h"
+#include "vvReadState.h"
 #include "vvToolsList.h"
 #include <vtkFileOutputWindow.h>
 #include <vtkSmartPointer.h>
@@ -111,6 +112,7 @@ int main( int argc, char** argv )
   int n_image_loaded=0;
   std::string win(""), lev("");
 
+       bool link_images = false;
   if (argc >1) {
     for (int i = 1; i < argc; i++) {
       std::string current = argv[i];
@@ -143,7 +145,10 @@ int main( int argc, char** argv )
           parse_mode=P_WINDOW;
         } else if (current == "--level") {
           parse_mode=P_LEVEL;
-        } else if (current == "--log") {
+        } else if (current == "--linkall") {
+                                       link_images = true;
+                               }
+                               else if (current == "--log") {
           std::string log_dir = QDir::tempPath().toStdString() + std::string("/vv-log");
 
           if(itksys::SystemTools::FileExists(log_dir.c_str()) &&
@@ -169,7 +174,10 @@ int main( int argc, char** argv )
           vtk_log->AppendOn();
           vtkOutputWindow::SetInstance(vtk_log);
         } else if (current == "--state") {
-          window.ReadSavedStateFile(argv[i+1]);
+          //window.ReadSavedStateFile(argv[i+1]);
+          vvReadState read_state;
+          read_state.Run(&window, argv[i+1]);
+          n_image_loaded += read_state.GetNumberOfImages();
           i++;
         }
         
@@ -200,6 +208,8 @@ int main( int argc, char** argv )
     window.ApplyWindowLevelToAllImages();
   }
 
+       if (link_images)
+               window.LinkAllImages();
 
   int ret = app.exec();