X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2Fvv.cxx;h=f5029b1d6c9114a0d03d9768364eba90a14af8b4;hb=dbc32725670425d3e90c21830daaea16d2c5ce28;hp=f9430fe7ab12c79f7a3ba6c82c4ad8d8a8a4cd2a;hpb=35fba665ddd51b6365673748907606b787899720;p=clitk.git diff --git a/vv/vv.cxx b/vv/vv.cxx index f9430fe..f5029b1 100644 --- a/vv/vv.cxx +++ b/vv/vv.cxx @@ -119,13 +119,22 @@ int main( int argc, char** argv ) if (argc >1) { for (int i = 1; i < argc; i++) { std::string current = argv[i]; - if (!current.compare(0,2,"--")) { //We are parsing an option + if (!current.compare(0,1,"-")) { // && !current.compare(0,2,"--")) { //We are parsing an option if (parse_mode == P_SEQUENCE) {//First finish the current sequence window.LoadImages(sequence_filenames, vvImageReader::MERGEDWITHTIME); sequence_filenames.clear(); parse_mode=P_NORMAL; + } + else if (parse_mode == P_WINDOW) { // handle negative window values + win=current; + parse_mode=P_NORMAL; + continue; + } else if (parse_mode == P_LEVEL) { // handle negative level values + lev=current; + parse_mode=P_NORMAL; + continue; } - if (current=="--help") { + if ((current=="--help") || (current=="-h")) { std::cout << "vv " << VV_VERSION << ", the 2D, 2D+t, 3D and 3D+t (or 4D) image viewer" << std::endl << std::endl << "Synopsis: vv file(s) [OPTIONS] file(s)" << std::endl << std::endl << "Open file(s) for visualization." << std::endl << std::endl @@ -145,8 +154,7 @@ int main( int argc, char** argv ) //<< "--roi file \t Overlay binary mask images. Option may be repeated on a single base image." << std::endl << "--contour file \t Overlay DICOM RT-STRUCT contours." << std::endl; exit(0); - } - if (current=="--vf") { + } else if (current=="--vf") { if (!n_image_loaded) load_image_first_error(); window.AddField(argv[i+1],n_image_loaded-1); i++; //skip vf name @@ -174,9 +182,9 @@ int main( int argc, char** argv ) } else if (current == "--level") { parse_mode=P_LEVEL; } else if (current == "--linkall") { - link_images = true; - } - else if (current == "--log") { + 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()) && @@ -236,8 +244,8 @@ int main( int argc, char** argv ) window.ApplyWindowLevelToAllImages(); } - if (link_images) - window.LinkAllImages(); + if (link_images) + window.LinkAllImages(); int ret = app.exec();