X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2Fvv.cxx;h=f5029b1d6c9114a0d03d9768364eba90a14af8b4;hb=dbc32725670425d3e90c21830daaea16d2c5ce28;hp=4ee2489c348694b761ed1354d7cbf358d2d07f4d;hpb=5e63914651ec58eebb2a08537c94a00e9e861d35;p=clitk.git diff --git a/vv/vv.cxx b/vv/vv.cxx index 4ee2489..f5029b1 100644 --- a/vv/vv.cxx +++ b/vv/vv.cxx @@ -119,11 +119,20 @@ 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") || (current=="-h")) { std::cout << "vv " << VV_VERSION << ", the 2D, 2D+t, 3D and 3D+t (or 4D) image viewer" << std::endl << std::endl @@ -142,11 +151,10 @@ int main( int argc, char** argv ) << "--vf file \t Overlay the vector field in file." << std::endl << "--overlay file \t Overlay the image in file with complementary colors." << std::endl << "--fusion file \t Overlay the image in file with alpha blending and colormap." << std::endl - << "--roi file \t Overlay binary mask images. Option may be repeated on a single base image." << std::endl + //<< "--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 @@ -154,11 +162,11 @@ int main( int argc, char** argv ) if (!n_image_loaded) load_image_first_error(); window.AddOverlayImage(n_image_loaded-1,argv[i+1]); i++; //skip overlay name - } else if (current=="--roi") { + } /*else if (current=="--roi") { if (!n_image_loaded) load_image_first_error(); window.AddROI(n_image_loaded-1,argv[i+1]); i++; //skip roi name - } else if (current=="--contour") { + }*/ else if (current=="--contour") { if (!n_image_loaded) load_image_first_error(); window.AddDCStructContour(n_image_loaded-1,argv[i+1]); i++; //skip roi 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();