-------------------------------------------------*/
#include "clitkCommon.h"
-#include "itkMacro.h"
+#include <fstream>
//------------------------------------------------------------------
// skip line which begin with a sharp '#'
-------------------------------------------------------------------*/
// std include
-#include <config.h>
-#include <cstdlib>
-#include <algorithm>
-#include <iostream>
-#include <fstream>
-#include <sstream>
-#include <vector>
-#include <math.h>
-#include <typeinfo>
-
-#include "itkMacro.h"
+//#include <config.h>
+//#include <cstdlib>
+//#include <algorithm>
+//#include <iostream>
+//#include <string>
+//#include <fstream>
+//#include <sstream>
+//#include <vector>
+//#include <math.h>
+//#include <typeinfo>
+//#include <utility>
+//#include <algorithm>
+
+// itk include (include std)
#include <itkContinuousIndex.h>
+#include <itkMacro.h>
#include <itkImageRegionConstIterator.h>
#include <itkImageRegionIterator.h>
l'Image). All rights reserved. See Doc/License.txt or
http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the above copyright notices for more information.
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notices for more information.
-------------------------------------------------------------------------=*/
+ ------------------------------------------------------------------------=*/
#ifndef CLITKLISTOFPAIR_CXX
//--------------------------------------------------------------------
double clitk::convertValue(double v,
- const std::multimap<double, double> & conversionTable,
- bool linear) {
+ const std::multimap<double, double> & conversionTable,
+ bool linear) {
std::map<double, double>::const_iterator i;
i = conversionTable.lower_bound(v);
if (i == conversionTable.end()) {
- std::cerr << "The value " << v << " is out of the table" << std::endl;
- exit(0);
+ std::cerr << "The value " << v << " is out of the table" << std::endl;
+ exit(0);
}
double v2 = i->first;
// interpol
if (!linear) {
- if ((v-v1) > (v2-v)) return p2;
- else return p1;
+ if ((v-v1) > (v2-v)) return p2;
+ else return p1;
}
else {
- double w = (v-v1)/(v2-v1);
- return p1*(1.0-w)+w*p2;
+ double w = (v-v1)/(v2-v1);
+ return p1*(1.0-w)+w*p2;
}
}
//--------------------------------------------------------------------
#define CLITKLISTOFPAIR_H
/**
- ===================================================================
- * @file clitkListOfPair.h
- * @author David Sarrut <David.Sarrut@creatis.insa-lyon.fr>
- * @date 27 Feb 2007 09:44:18
+ ===================================================================
+ * @file clitkListOfPair.h
+ * @author David Sarrut <David.Sarrut@creatis.insa-lyon.fr>
+ * @date 27 Feb 2007 09:44:18
- * @brief
+ * @brief
- ===================================================================*/
+ ===================================================================*/
#include "clitkCommon.h"
+#include <fstream>
+
namespace clitk {
//====================================================================
//====================================================================
double convertValue(double v,
- const std::multimap<double, double> & conversionTable,
- bool linear);
+ const std::multimap<double, double> & conversionTable,
+ bool linear);
#include "clitkListOfPair.txx"
#include <sys/time.h>
#include <sys/resource.h>
#include <iostream>
+#include <utility>
namespace clitk {
// itk include
#include "itkImageIOBase.h"
+// std include
+#include <fstream>
+
namespace clitk {
//====================================================================
// itk include
#include "itkImageIOBase.h"
+// std include
+#include <fstream>
+
namespace clitk {
//====================================================================
#include "clitkVoxImageIOFactory.h"
+#include <fstream>
+
//====================================================================
clitk::VoxImageIOFactory::VoxImageIOFactory()
{
<rect>
<x>0</x>
<y>0</y>
- <width>388</width>
- <height>318</height>
+ <width>320</width>
+ <height>298</height>
</rect>
</property>
<property name="windowTitle">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
- <widget class="vvIntensityValueSlider" name="mFGSlider" native="true"/>
+ <widget class="QCheckBox" name="mCheckBoxUseFG">
+ <property name="text">
+ <string>Use FG</string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="vvIntensityValueSlider" name="mFGSlider" native="true">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
+ <item>
+ <widget class="QCheckBox" name="mCheckBoxUseBG">
+ <property name="text">
+ <string>Use BG</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
<item>
<widget class="vvIntensityValueSlider" name="mBGSlider" native="true"/>
</item>
</item>
<item>
<widget class="QCheckBox" name="checkBox_2">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<property name="text">
<string>Interactive (unchek to disable on the fly contours drawing)</string>
</property>
<hints>
<hint type="sourcelabel">
<x>85</x>
- <y>191</y>
+ <y>129</y>
</hint>
<hint type="destinationlabel">
- <x>601</x>
- <y>203</y>
+ <x>305</x>
+ <y>129</y>
</hint>
</hints>
</connection>
<hints>
<hint type="sourcelabel">
<x>82</x>
- <y>121</y>
+ <y>70</y>
</hint>
<hint type="destinationlabel">
<x>88</x>
- <y>191</y>
+ <y>129</y>
</hint>
</hints>
</connection>
<hints>
<hint type="sourcelabel">
<x>73</x>
- <y>141</y>
+ <y>90</y>
</hint>
<hint type="destinationlabel">
<x>137</x>
- <y>191</y>
+ <y>129</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>mCheckBoxUseBG</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mBGSlider</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>79</x>
+ <y>203</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>202</x>
+ <y>204</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>mCheckBoxUseFG</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mFGSlider</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>63</x>
+ <y>177</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>242</x>
+ <y>177</y>
</hint>
</hints>
</connection>
#include "vvInit.h"
#include "vvConstants.h"
-//------------------------------------------------------------------------------
-// (*NEEDED HERE*) Static instances initialization for ToolManager
-TOOL_MANAGER_INITIALIZATION;
-
//------------------------------------------------------------------------------
int main( int argc, char** argv )
{
Program: vv
Module: $RCSfile: vvToolBinarize.cxx,v $
Language: C++
- Date: $Date: 2010/02/01 15:54:25 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2010/02/03 10:54:08 $
+ Version: $Revision: 1.3 $
Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr)
Copyright (C) 2008
mArgsInfo.fg_arg = mFGSlider->GetValue();
mArgsInfo.bg_arg = mBGSlider->GetValue();
+
+ DD(inverseBGandFG);
if (inverseBGandFG) {
- mArgsInfo.fg_arg = mBGSlider->GetValue();
- mArgsInfo.bg_arg = mFGSlider->GetValue();
+ mArgsInfo.fg_arg = mFGSlider->GetValue();
+ mArgsInfo.bg_arg = mBGSlider->GetValue();
}
mArgsInfo.fg_given = 1;
mArgsInfo.bg_given = 1;
- mArgsInfo.setBG_flag = true;
+ mArgsInfo.useBG_flag = mCheckBoxUseBG->isChecked();
+ mArgsInfo.useFG_flag = mCheckBoxUseFG->isChecked();
+
+ DD(mArgsInfo.useBG_flag);
+ DD(mArgsInfo.useFG_flag);
mArgsInfo.verbose_flag = true;
Program: vv
Module: $RCSfile: vvToolManager.cxx,v $
Language: C++
- Date: $Date: 2010/01/29 13:54:37 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2010/02/03 10:54:08 $
+ Version: $Revision: 1.2 $
Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr)
Copyright (C) 2008
#include "vvToolManager.h"
#include "vvMainWindow.h"
+vvToolManager* vvToolManager::mSingleton=0;
+
//------------------------------------------------------------------------------
vvToolManager * vvToolManager::GetInstance() {
if (mSingleton == 0) {
//------------------------------------------------------------------------------
void vvToolManager::AddTool(vvToolCreatorBase * v) {
std::cout << "Adding the tool <" << v->mToolName.toStdString() << ">." << std::endl;
- mListOfTools.push_back(v);
+ GetInstance()->mListOfTools.push_back(v);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolManager::Initialize(vvMainWindow * m) {
- for(unsigned int i=0; i<mListOfTools.size(); i++) {
- mListOfTools[i]->Initialize(m);
+ for(unsigned int i=0; i<GetInstance()->mListOfTools.size(); i++) {
+ GetInstance()->mListOfTools[i]->Initialize(m);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolManager::UpdateEnabledTool() {
- for(unsigned int i=0; i<mListOfTools.size(); i++) {
- mListOfTools[i]->UpdateEnabledTool();
+ for(unsigned int i=0; i<GetInstance()->mListOfTools.size(); i++) {
+ GetInstance()->mListOfTools[i]->UpdateEnabledTool();
}
}
//------------------------------------------------------------------------------
Program: vv
Module: $RCSfile: vvToolManager.h,v $
Language: C++
- Date: $Date: 2010/01/29 13:54:37 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2010/02/03 10:54:08 $
+ Version: $Revision: 1.2 $
Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr)
Copyright (C) 2008
static void Initialize(vvMainWindow * m);
static void UpdateEnabledTool();
// Variables
- static std::vector<vvToolCreatorBase *> mListOfTools;
+ std::vector<vvToolCreatorBase *> mListOfTools;
static vvToolManager * mSingleton;
};
//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-// Static instances initialization (to put in main)
-#define TOOL_MANAGER_INITIALIZATION \
- vvToolManager* vvToolManager::mSingleton=0; \
- std::vector<vvToolCreatorBase *> vvToolManager::mListOfTools;
-//------------------------------------------------------------------------------
-
-
#endif