]> Creatis software - clitk.git/commitdiff
dicom structure in cmd line
authorRomulo Pinho <romulo.pinho@lyon.unicancer.fr>
Fri, 16 Dec 2011 10:55:00 +0000 (11:55 +0100)
committerRomulo Pinho <romulo.pinho@lyon.unicancer.fr>
Fri, 16 Dec 2011 10:55:00 +0000 (11:55 +0100)
- --contour <FILE>
- in the same way as overlay/fusion/vf

vv/vv.cxx
vv/vvMainWindow.cxx
vv/vvMainWindow.h

index 1fb357e2419c7a082da57eaa7cd951c1417462ed..f3011e687e4e1fd32d77ac89de32ae8fb278cb03 100644 (file)
--- a/vv/vv.cxx
+++ b/vv/vv.cxx
@@ -134,6 +134,10 @@ int main( int argc, char** argv )
           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") {
+          if (!n_image_loaded) load_image_first_error();
+          window.AddDCStructContour(n_image_loaded-1,argv[i+1]);
+          i++; //skip roi name
         } else if (current=="--fusion") {
           if (!n_image_loaded) load_image_first_error();
           window.AddFusionImage(n_image_loaded-1,argv[i+1]);
index 5bdc9780ccd73c693727a1b1dbf1872aa3d70ca7..b102e6234c62fee01ba7f9c683bce3f07d9c998a 100644 (file)
@@ -491,15 +491,8 @@ void vvMainWindow::OpenVTKContour()
 
 
 //------------------------------------------------------------------------------
-void vvMainWindow::OpenDCStructContour()
+void vvMainWindow::AddDCStructContour(int index, QString file)
 {
-  if (mSlicerManagers.size() > 0) {
-    QString Extensions = "Dicom Files ( *.dcm RS*)";
-    Extensions += ";;All Files (*)";
-    QString file = QFileDialog::getOpenFileName(this,tr("Merge Images"),mInputPathName,Extensions);
-    if (file.isNull())
-      return;
-    int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
     vvMeshReader reader;
     reader.SetFilename(file.toStdString());
     vvStructSelector selector;
@@ -519,6 +512,19 @@ void vvMainWindow::OpenDCStructContour()
         AddContour(index,*i,selector.PropagationEnabled());
       QApplication::restoreOverrideCursor();
     }
+}
+
+//------------------------------------------------------------------------------
+void vvMainWindow::OpenDCStructContour()
+{
+  if (mSlicerManagers.size() > 0) {
+    QString Extensions = "Dicom Files ( *.dcm RS*)";
+    Extensions += ";;All Files (*)";
+    QString file = QFileDialog::getOpenFileName(this,tr("Merge Images"),mInputPathName,Extensions);
+    if (file.isNull())
+      return;
+    int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
+    AddDCStructContour(index, file);
   }
 }
 //------------------------------------------------------------------------------
index 12aaaf1a5f0b8d6f0d5a41d40f0d7bfe16092110..23ee6f414f84a1200382bc1431715c605aadef8f 100644 (file)
@@ -73,6 +73,7 @@ class vvMainWindow: public vvMainWindowBase,
 
 public slots:
   ///Allows the user to open and select various surfaces contained in a dicom-struct file
+  void AddDCStructContour(int index, QString file);
   void OpenDCStructContour();
   ///Computes the midposition image of a 4D sequence with a VF and displays it
   void ComputeMidPosition();