]> Creatis software - clitk.git/commitdiff
corrections post- "-h" addition in VV
authorRomulo Pinho <romulo.pinho@lyon.unicancer.fr>
Mon, 1 Oct 2012 13:19:16 +0000 (15:19 +0200)
committerRomulo Pinho <romulo.pinho@lyon.unicancer.fr>
Mon, 1 Oct 2012 13:19:16 +0000 (15:19 +0200)
vv/vv.cxx

index c387c5e801423dd5e70e590cdb1241395fcb8a26..f5029b1d6c9114a0d03d9768364eba90a14af8b4 100644 (file)
--- a/vv/vv.cxx
+++ b/vv/vv.cxx
@@ -124,6 +124,15 @@ int main( int argc, char** argv )
           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
@@ -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();