From 3c2462eafabcf428b4d2775c414a7b5f62511d3f Mon Sep 17 00:00:00 2001 From: Romulo Pinho Date: Fri, 16 Dec 2011 11:55:00 +0100 Subject: [PATCH] dicom structure in cmd line - --contour - in the same way as overlay/fusion/vf --- vv/vv.cxx | 4 ++++ vv/vvMainWindow.cxx | 22 ++++++++++++++-------- vv/vvMainWindow.h | 1 + 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/vv/vv.cxx b/vv/vv.cxx index 1fb357e..f3011e6 100644 --- 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]); diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 5bdc978..b102e62 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -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); } } //------------------------------------------------------------------------------ diff --git a/vv/vvMainWindow.h b/vv/vvMainWindow.h index 12aaaf1..23ee6f4 100644 --- a/vv/vvMainWindow.h +++ b/vv/vvMainWindow.h @@ -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(); -- 2.47.1