X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2Fvv.cxx;h=1fb357e2419c7a082da57eaa7cd951c1417462ed;hb=e8efeb699b696aa952ed5301dc3d92629c2b57ec;hp=301521b4662a8509197d81174b348964b4e5e140;hpb=98eb0c23b8066792d7a77e571fb7d48c9fe02db6;p=clitk.git diff --git a/vv/vv.cxx b/vv/vv.cxx index 301521b..1fb357e 100644 --- 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 #include @@ -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()) && @@ -168,7 +173,14 @@ int main( int argc, char** argv ) vtk_log->FlushOn(); vtk_log->AppendOn(); vtkOutputWindow::SetInstance(vtk_log); + } else if (current == "--state") { + //window.ReadSavedStateFile(argv[i+1]); + vvReadState read_state; + read_state.Run(&window, argv[i+1]); + n_image_loaded += read_state.GetNumberOfImages(); + i++; } + } else if (parse_mode == P_SEQUENCE) { sequence_filenames.push_back(current); } else if (parse_mode == P_WINDOW) { @@ -196,6 +208,8 @@ int main( int argc, char** argv ) window.ApplyWindowLevelToAllImages(); } + if (link_images) + window.LinkAllImages(); int ret = app.exec();