]> Creatis software - clitk.git/blobdiff - vv/vvToolSimpleInputSelectorWidget.cxx
- default window level for [0:1] binary image
[clitk.git] / vv / vvToolSimpleInputSelectorWidget.cxx
index fcc1361814f36939f679258bd3e6650f3367732b..02d02775d7025e97d8180d9e65646c7eaac17dc2 100644 (file)
@@ -1,33 +1,22 @@
 /*=========================================================================
+  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
 
-  Program:   vv
-  Module:    $RCSfile: vvToolSimpleInputSelectorWidget.cxx,v $
-  Language:  C++
-  Date:      $Date: 2010/03/24 10:48:18 $
-  Version:   $Revision: 1.2 $
-  Author :   David Sarrut (david.sarrut@creatis.insa-lyon.fr)
+  Authors belong to: 
+  - University of LYON              http://www.universite-lyon.fr/
+  - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
+  - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
 
-  Copyright (C) 2010
-  Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
-  CREATIS                   http://www.creatis.insa-lyon.fr
+  This software is distributed WITHOUT ANY WARRANTY; without even
+  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+  PURPOSE.  See the copyright notices for more information.
 
-  This program is free software: you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation, version 3 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-  =========================================================================*/
+  It is distributed under dual licence
 
+  - BSD        See included LICENSE.txt file
+  - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+======================================================================-====*/
 #ifndef VVTOOLINPUTSELECTORWIDGET_CXX
 #define VVTOOLINPUTSELECTORWIDGET_CXX
-
 #include "vvToolSimpleInputSelectorWidget.h"
 #include "vvSlicerManager.h"
 #include <QAbstractButton>
@@ -48,10 +37,12 @@ void vvToolSimpleInputSelectorWidget::Initialize() {
   connect(mInputSelectionButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
   connect(mInputSelectionButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
   connect(mInputSequenceBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changeInput(int)));  
-  changeInput(0);
   if (mSlicerManagerList.size() == 1) {
     if (!mAllowSkip) accept();
   }
+  if (mSlicerManagerList.size() == 0) {
+    reject();
+  }
 }
 //------------------------------------------------------------------------------
 
@@ -78,6 +69,11 @@ void vvToolSimpleInputSelectorWidget::EnableAllowSkip(bool b) {
 
 //------------------------------------------------------------------------------
 void vvToolSimpleInputSelectorWidget::SetInputList(const std::vector<vvSlicerManager*> & l, int index) {
+  if (l.size() == 0) {
+    // TODO !!!
+    DD("no input > error message");
+    reject();
+  }
   mInputSequenceBox->clear();
   for(unsigned int i=0; i<l.size(); i++)
     mSlicerManagerList.push_back(l[i]);
@@ -86,11 +82,7 @@ void vvToolSimpleInputSelectorWidget::SetInputList(const std::vector<vvSlicerMan
     mInputSequenceBox->addItem(mSlicerManagerList[i]->GetFileName().c_str());
   }
   mInputSequenceBox->setCurrentIndex(mCurrentIndex);
-  if (mSlicerManagerList.size() == 0) {
-    // TODO !!!
-    DD("no input > error message");
-    reject();
-  }
+  changeInput(mCurrentIndex);
 }
 //------------------------------------------------------------------------------