]> Creatis software - clitk.git/commitdiff
Merge branch 'master' of /home/dsarrut/clitk3.server
authordsarrut <david.sarrut@gmail.com>
Fri, 20 May 2011 05:23:45 +0000 (07:23 +0200)
committerdsarrut <david.sarrut@gmail.com>
Fri, 20 May 2011 05:23:45 +0000 (07:23 +0200)
17 files changed:
CMakeLists.txt
common/CMakeLists.txt
common/clitkConfiguration.h.in
common/globals.h.in [deleted file]
tests/CMakeLists.txt
tests/tools/clitkAffineTransformTest.cxx [new file with mode: 0644]
tests/tools/clitkImageInfoTest.cxx
vv/CMakeLists.txt
vv/icons/weNeedYou.jpg [deleted file]
vv/icons/weNeedYou.png [new file with mode: 0644]
vv/qt_ui/vvRegisterForm.ui
vv/vv.cxx
vv/vvCommon.h.in [deleted file]
vv/vvConfiguration.h.in [new file with mode: 0644]
vv/vvIcons.qrc
vv/vvRegisterForm.cxx
vv/write.php [new file with mode: 0644]

index a340a36f8b1a988abd6a2aa778e8047d01eaacc6..8ce5b58371c0804f5ff99368987b438c9306422d 100644 (file)
@@ -1,7 +1,7 @@
 #=========================================================
 # CLITK = Command Line ITK
-cmake_minimum_required(VERSION 2.8)
-cmake_policy(VERSION 2.8)
+cmake_minimum_required(VERSION 2.4)
+cmake_policy(VERSION 2.4)
 if(COMMAND cmake_policy)
     cmake_policy(SET CMP0003 NEW)
 endif(COMMAND cmake_policy)
index ebe4dff285808e01b16ec47eef0df5c969723bd3..0263f3a031cb7696d0ff821fe993f4f1b49ed64e 100644 (file)
@@ -57,8 +57,3 @@ TARGET_LINK_LIBRARIES(clitkDicomRTStruct vtkHybrid)
 #ADD_LIBRARY(clitkCommonShared SHARED ${clitkCommon_SRC})
 #SET_TARGET_PROPERTIES(clitkCommonShared PROPERTIES COMPILE_FLAGS -fPIC)
 
-#passing environnment variable
-configure_file (
- globals.h.in
- globals.h
-)
index f040914a05aa1ea53e1e4b00fb911a9257fd118f..5f99d7a9c7c27e3a83ac6e6b66999d24888e7a4d 100644 (file)
@@ -1,3 +1,21 @@
+/*=========================================================================
+  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
+
+  Authors belong to:
+  - University of LYON              http://www.universite-lyon.fr/
+  - Léon Bérard cancer center       http://www.centreleonberard.fr
+  - CREATIS CNRS laboratory         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.
+
+  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 clitk_configuration_h
 #define clitk_configuration_h
 //This file is interpreted by cmake, to define macros based on the cmake configuration options
@@ -6,4 +24,8 @@
 #cmakedefine01 CLITK_EXPERIMENTAL
 #cmakedefine01 CLITK_MEMORY_INFO
 
+// Global environment variables
+#define OS_NAME "@CMAKE_SYSTEM@"
+#define ARCHITECTURE "@CMAKE_SYSTEM_PROCESSOR@"
+
 #endif
diff --git a/common/globals.h.in b/common/globals.h.in
deleted file mode 100644 (file)
index 14395c0..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define OS_NAME "@CMAKE_SYSTEM@"
-                              
\ No newline at end of file
index b85b146e75a45f58379761e693dbd0cbeca1a327..bc9beae3f91d5f5ccad2def356d1c46e675d87e7 100644 (file)
@@ -1,3 +1,6 @@
+cmake_policy(SET CMP0005 NEW)
+
+
 macro(ADD_GOOGLE_TESTS executable)
   foreach ( source ${ARGN} )
     file(READ "${source}" contents)
@@ -10,9 +13,8 @@ macro(ADD_GOOGLE_TESTS executable)
 endmacro()
 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/tests/bin)
 SET(BUILDNAME ${CMAKE_SYSTEM_NAME}${CMAKE_OSX_ARCHITECTURES} CACHE INTERNAL DOCSTRING)
-SET(CLITK_DATA_PATH ${PROJECT_BINARY_DIR}/tests/data/ CACHE STRING "dataTest path")
+SET(CLITK_DATA_PATH ${PROJECT_SOURCE_DIR}/tests/data/ CACHE STRING "dataTest path")
 #todo  test if data test path exists
-
 ADD_DEFINITIONS(-DCLITK_DATA_PATH=\"${CLITK_DATA_PATH}\")
 
 add_library(gtest UNKNOWN IMPORTED)
diff --git a/tests/tools/clitkAffineTransformTest.cxx b/tests/tools/clitkAffineTransformTest.cxx
new file mode 100644 (file)
index 0000000..1af7cc2
--- /dev/null
@@ -0,0 +1,43 @@
+/*=========================================================================
+  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
+
+  Authors belong to:
+  - University of LYON              http://www.universite-lyon.fr/
+  - Léon Bérard cancer center       http://www.centreleonberard.fr
+  - CREATIS CNRS laboratory         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.
+
+  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
+===========================================================================*/
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <fstream>
+#include "gtest/gtest.h"
+#include "stdio.h"
+#include <itksys/SystemTools.hxx>
+static inline void compare(std::string mhd, std::string refMhd, std::string refRaw){
+  std::ostringstream cmd_line;
+  ASSERT_TRUE(itksys::SystemTools::FileExists(mhd.c_str(), true));
+  ASSERT_TRUE(itksys::SystemTools::FileExists(refMhd.c_str(), true));
+  ASSERT_TRUE(itksys::SystemTools::FileExists(refRaw.c_str(), true));
+  cmd_line << TOOLS_PATH<<"clitkAffineTransform -i " << mhd << " -o "<<"out.mhd >/dev/null";
+  system(cmd_line.str().c_str());
+  EXPECT_TRUE(itksys::SystemTools::FileExists("out.mhd", true));
+  EXPECT_FALSE( itksys::SystemTools::FilesDiffer("out.mhd", refMhd.c_str())  );
+  EXPECT_FALSE( itksys::SystemTools::FilesDiffer("out.raw", refRaw.c_str())  );
+  remove("out.mhd");
+  remove("out.raw");
+}
+TEST(clitkAffineTransformTest, main){
+  std::string mhd1=std::string(CLITK_DATA_PATH)+"Deformation4D.mhd";
+  std::string refMhd1=std::string(CLITK_DATA_PATH)+"Deformation4DRef.mhd";
+  std::string refRaw1=std::string(CLITK_DATA_PATH)+"Deformation4DRef.raw";
+  compare(mhd1, refMhd1, refRaw1);
+}
\ No newline at end of file
index 5e7476bc9add5f989fd1efd62fd42b2a1454c05c..4f8413c798fba30ae8878e9a216cc22eded500b8 100644 (file)
 #include <itksys/SystemTools.hxx>
 static inline void compare(std::string mhd, std::string ref){
   std::ostringstream cmd_line;
-  ASSERT_TRUE(itksys::SystemTools::FileExists(mhd.c_str(), true));
   cmd_line << TOOLS_PATH<<"clitkImageInfo " << mhd << " > clitkImageInfoTest.out";
-  std::cout << "Executing " << cmd_line.str() << std::endl;
   system(cmd_line.str().c_str());
   
-  bool differ = itksys::SystemTools::FilesDiffer("clitkImageInfoTest.out", ref.c_str());
+  EXPECT_FALSE( itksys::SystemTools::FilesDiffer("clitkImageInfoTest.out", ref.c_str()) );
   remove("clitkImageInfoTest.out");
-  EXPECT_FALSE(differ);
 }
 TEST(clitkImageInfoTest, main){
-  std::string mhd1=std::string(CLITK_DATA_PATH)+"4d/mhd/00.mhd";
-  std::string ref1=std::string(CLITK_DATA_PATH)+"tools/clitkImageInfoTestValidate3D.out";
-  compare(mhd1, ref1);
+  std::string mhd1=std::string(CLITK_DATA_PATH)+"Deformation4D.mhd";
+  ASSERT_TRUE(itksys::SystemTools::FileExists(mhd1.c_str(), true));
+  
+  std::string mhd2=std::string(CLITK_DATA_PATH)+"Lung3D.mhd";
+  ASSERT_TRUE(itksys::SystemTools::FileExists(mhd2.c_str(), true));
   
-  std::string mhd2=std::string(CLITK_DATA_PATH)+"4d/mhd/bh.mhd";
-  std::string ref2=std::string(CLITK_DATA_PATH)+"tools/clitkImageInfoTestValidate4D.out";
-  compare(mhd2, ref2);
+  mhd1+=" "+mhd2;
+  std::string ref1=std::string(CLITK_DATA_PATH)+"clitkImageInfoTestRef.out";
+  ASSERT_TRUE(itksys::SystemTools::FileExists(ref1.c_str(), true));
+  compare(mhd1, ref1);
 }
\ No newline at end of file
index e9cd2d260b858ebed1333bb12ecd458d7c5266c2..81fbf6012dd618aaa48dd787538ea80276c0d0f2 100644 (file)
@@ -128,17 +128,28 @@ QT4_WRAP_UI(vv_UI_CXX
 
 QT4_ADD_RESOURCES(vv_SRCS vvIcons.qrc)
 
-#Add the autotools and the common files ui
+# Add the autotools in the header vvToolsList.h for initialization of the dummy
+# variables in vv.cxx for the tools contained in vvLib
+file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h)
+foreach(tool ${vv_TOOLS})
+    FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "#include \"${tool}.h\"\n")
+    FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "extern const vvToolCreator<${tool}> *dummy${tool};\n")
+    FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "const vvToolCreator<${tool}> *dummy${tool}2 = dummy${tool};\n\n")
+endforeach(tool)
+
+# Add the autotools and the common files ui
 foreach(tool ${vv_TOOLS} ${vv_COMMON_WITH_UI})
     SET(vv_SRCS ${vv_SRCS} ${tool}.cxx)
     QT4_WRAP_CPP(vv_SRCS ${tool}.h)
     QT4_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui)
 endforeach(tool)
-#Add the common source files
+
+# Add the common source files
 foreach(tool ${vv_COMMON})
     SET(vv_SRCS ${vv_SRCS} ${tool}.cxx)
     QT4_WRAP_CPP(vv_SRCS ${tool}.h)
 endforeach(tool)
+
 # if Windows and Qt was built as a static lib then don't set QT_DLL flag
 SET(QT_STATIC 0)
 IF (WIN32)
@@ -241,7 +252,7 @@ SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
 SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
 SET(CPACK_PACKAGE_VERSION_MAJOR "1")
 SET(CPACK_PACKAGE_VERSION_MINOR "2")
-SET(CPACK_PACKAGE_VERSION_PATCH "0")
+SET(CPACK_PACKAGE_VERSION_PATCH "1")
 SET(CPACK_PACKAGE_INSTALL_DIRECTORY "vv")
 SET(CPACK_STRIP_FILES TRUE)
 
@@ -265,5 +276,5 @@ ENDIF(WIN32)
 INCLUDE(CPack)
 #=========================================================
 #=========================================================
-configure_file(vvCommon.h.in vvCommon.h)
+configure_file(vvConfiguration.h.in vvConfiguration.h)
 #=========================================================
diff --git a/vv/icons/weNeedYou.jpg b/vv/icons/weNeedYou.jpg
deleted file mode 100644 (file)
index 56272be..0000000
Binary files a/vv/icons/weNeedYou.jpg and /dev/null differ
diff --git a/vv/icons/weNeedYou.png b/vv/icons/weNeedYou.png
new file mode 100644 (file)
index 0000000..a363a57
Binary files /dev/null and b/vv/icons/weNeedYou.png differ
index fac7fd33cfdfb35c2c719d514c0c47936bfe729a..1bb516822013602ac4f72263b3a0638d9d1b37e5 100644 (file)
@@ -2,6 +2,9 @@
 <ui version="4.0">
  <class>vvRegisterForm</class>
  <widget class="QDialog" name="vvRegisterForm">
+  <property name="windowModality">
+   <enum>Qt::ApplicationModal</enum>
+  </property>
   <property name="geometry">
    <rect>
     <x>0</x>
   <property name="windowTitle">
    <string>Dialog</string>
   </property>
-  <widget class="QWidget" name="">
-   <property name="geometry">
-    <rect>
-     <x>4</x>
-     <y>4</y>
-     <width>361</width>
-     <height>401</height>
-    </rect>
-   </property>
-   <layout class="QVBoxLayout" name="verticalLayout">
-    <item>
-     <widget class="QTextBrowser" name="textBrowser">
-      <property name="contextMenuPolicy">
-       <enum>Qt::DefaultContextMenu</enum>
-      </property>
-      <property name="autoFillBackground">
-       <bool>false</bool>
-      </property>
-      <property name="frameShape">
-       <enum>QFrame::NoFrame</enum>
-      </property>
-      <property name="frameShadow">
-       <enum>QFrame::Plain</enum>
-      </property>
-      <property name="html">
-       <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+  <layout class="QGridLayout" name="gridLayout_2">
+   <item row="0" column="0">
+    <layout class="QVBoxLayout" name="verticalLayout">
+     <item>
+      <widget class="QTextBrowser" name="textBrowser">
+       <property name="contextMenuPolicy">
+        <enum>Qt::DefaultContextMenu</enum>
+       </property>
+       <property name="autoFillBackground">
+        <bool>false</bool>
+       </property>
+       <property name="frameShape">
+        <enum>QFrame::NoFrame</enum>
+       </property>
+       <property name="frameShadow">
+        <enum>QFrame::Plain</enum>
+       </property>
+       <property name="html">
+        <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
 &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;img src=&quot;:/common/icons/weNeedYou.jpg&quot; style=&quot;float:right;&quot; /&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Welcome to VV !&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;We wish to keep an estimate of the number of persons using VV. This is&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;really important for us to justify the ressources spent in developing this software.&lt;/p&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Please, take a few seconds to fill in the following fields and send us&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;the information by clicking OK. If you still prefer to remain &lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;anonymous, simply click &amp;quot;No, thanks&amp;quot; (you can still register afterwards using the help menu).&lt;/p&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Privacy: the collected information is for internal and non-commercial&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;use only. We will only use your email for vv release announcements.&lt;/p&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-      </property>
-     </widget>
-    </item>
-    <item>
-     <layout class="QGridLayout" name="gridLayout">
-      <item row="0" column="0">
-       <widget class="QLabel" name="label">
-        <property name="text">
-         <string>First name</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="1">
-       <widget class="QLineEdit" name="firstName"/>
-      </item>
-      <item row="1" column="0">
-       <widget class="QLabel" name="label_2">
-        <property name="text">
-         <string>Last name</string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="1">
-       <widget class="QLineEdit" name="lastName"/>
-      </item>
-      <item row="2" column="0">
-       <widget class="QLabel" name="label_3">
-        <property name="text">
-         <string>Email</string>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="1">
-       <widget class="QLineEdit" name="email"/>
-      </item>
-      <item row="3" column="0">
-       <widget class="QLabel" name="label_4">
-        <property name="text">
-         <string>Institute</string>
-        </property>
-       </widget>
-      </item>
-      <item row="3" column="1">
-       <widget class="QLineEdit" name="group"/>
-      </item>
-      <item row="4" column="0">
-       <widget class="QLabel" name="label_5">
-        <property name="text">
-         <string>OS name</string>
-        </property>
-       </widget>
-      </item>
-      <item row="4" column="1">
-       <widget class="QLabel" name="osName">
-        <property name="text">
-         <string>OS name</string>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </item>
-    <item>
-     <widget class="QDialogButtonBox" name="buttonBox">
-      <property name="orientation">
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <property name="standardButtons">
-       <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
-      </property>
-     </widget>
-    </item>
-   </layout>
-  </widget>
+&lt;p align=&quot;justify&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:10px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;img src=&quot;:/common/icons/weNeedYou.png&quot; style=&quot;float: left;&quot; /&gt;&lt;span style=&quot; font-weight:600; color:#0000c0;&quot;&gt;Welcome to VV !&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We wish to keep an estimate of the number of persons using VV. This is really important for us to justify the ressources spent in developing this software.&lt;/p&gt;
+&lt;p align=&quot;justify&quot; style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:10px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
+&lt;p align=&quot;justify&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:10px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Please, take a few seconds to fill in the following fields and send us the information by clicking OK. If you still prefer to remain anonymous, simply click &amp;quot;No, thanks&amp;quot; (you can still register afterwards using the help menu).&lt;/p&gt;
+&lt;p align=&quot;justify&quot; style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:10px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
+&lt;p align=&quot;justify&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:10px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Privacy: the collected information is for internal and non-commercial use only. We will only use your email for vv release announcements.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <layout class="QGridLayout" name="gridLayout">
+       <item row="0" column="0">
+        <widget class="QLabel" name="label">
+         <property name="text">
+          <string>First name</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="1">
+        <widget class="QLineEdit" name="firstName"/>
+       </item>
+       <item row="1" column="0">
+        <widget class="QLabel" name="label_2">
+         <property name="text">
+          <string>Last name</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1">
+        <widget class="QLineEdit" name="lastName"/>
+       </item>
+       <item row="2" column="0">
+        <widget class="QLabel" name="label_3">
+         <property name="text">
+          <string>Email</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="1">
+        <widget class="QLineEdit" name="email"/>
+       </item>
+       <item row="3" column="0">
+        <widget class="QLabel" name="label_4">
+         <property name="text">
+          <string>Institute</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="1">
+        <widget class="QLineEdit" name="group"/>
+       </item>
+       <item row="4" column="0">
+        <widget class="QLabel" name="label_5">
+         <property name="text">
+          <string>OS name</string>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="1">
+        <widget class="QLabel" name="osName">
+         <property name="text">
+          <string>OS name</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <widget class="QDialogButtonBox" name="buttonBox">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="standardButtons">
+        <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
  </widget>
  <resources>
   <include location="../vvIcons.qrc"/>
index 13a513e576f1e026f5a30cf1ccf6226fad63f59e..93b708e753b40aad059ce6ac8d5481ce3c2b5b7d 100644 (file)
--- a/vv/vv.cxx
+++ b/vv/vv.cxx
@@ -30,6 +30,7 @@
 
 #include "clitkIO.h"
 #include "vvMainWindow.h"
+#include "vvToolsList.h"
 #include <vtkFileOutputWindow.h>
 #include <vtkSmartPointer.h>
 #include <itkFileOutputWindow.h>
diff --git a/vv/vvCommon.h.in b/vv/vvCommon.h.in
deleted file mode 100644 (file)
index 7ad04e6..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define VV_VERSION "v@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.@CPACK_PACKAGE_VERSION_PATCH@"
-                              
\ No newline at end of file
diff --git a/vv/vvConfiguration.h.in b/vv/vvConfiguration.h.in
new file mode 100644 (file)
index 0000000..36d3258
--- /dev/null
@@ -0,0 +1,24 @@
+/*=========================================================================
+  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
+
+  Authors belong to:
+  - University of LYON              http://www.universite-lyon.fr/
+  - Léon Bérard cancer center       http://www.centreleonberard.fr
+  - CREATIS CNRS laboratory         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.
+
+  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 vv_configuration_h
+#define vv_configuration_h
+
+#define VV_VERSION "v@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.@CPACK_PACKAGE_VERSION_PATCH@"
+
+#endif
index 620ce0c3f4b53f752b9626604aa266d8b185b3d8..9dd0d96908e9470018c54055fdaaf9ba36c44079 100644 (file)
@@ -1,7 +1,7 @@
 <RCC>
   <qresource prefix="common">
-    <file>icons/weNeedYou.jpg</file>
     <file>icons/mip.png</file>
+    <file>icons/weNeedYou.png</file>
     <file>icons/tool-roi.png</file>
     <file>icons/plastimatch.png</file>
     <file>icons/lung-overlay.png</file>
index 93d16e490c9d6d4bef50ad7f658d519db6730a7f..e39ffddadd9faf50f80befbab7f6b679927107d6 100644 (file)
@@ -21,8 +21,8 @@
 #include <QNetworkRequest>
 #include <QDir>
 #include <QPalette>
-#include "common/globals.h"
-#include "vvCommon.h"
+#include "clitkConfiguration.h"
+#include "vvConfiguration.h"
 #include "vvUtils.h"
 
 vvRegisterForm::vvRegisterForm(QUrl url, QString path, QSettings::Format format):url(url), settings(path, format){ 
@@ -39,6 +39,9 @@ void vvRegisterForm::sendData(){
   url2.addQueryItem("group", group->text().toUtf8());
   url2.addQueryItem("os", osName->text().toUtf8());
   url2.addQueryItem("vvVersion", VV_VERSION);
+  url2.addQueryItem("architecture", ARCHITECTURE);
+  url2.addQueryItem("compilationDate", QString(__DATE__) + ", " + QString(__TIME__) );
+
   manager->get(QNetworkRequest(url2));
 }
 void vvRegisterForm::accept(){
@@ -65,4 +68,4 @@ void vvRegisterForm::show(){
   
  osName->setText(QString::fromStdString(OS_NAME));
  QDialog::show();
-}
\ No newline at end of file
+}
diff --git a/vv/write.php b/vv/write.php
new file mode 100644 (file)
index 0000000..a0f193e
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+define('HIDDEN_DATABASE_FILE_NAME', './customers.csv');
+$file=fopen(HIDDEN_DATABASE_FILE_NAME, 'a');
+if($file===FALSE)exit(1);
+define('TOKEN_CSV', '|');
+define('ENTRY_SEPARATOR', "\n");
+define('NAME_LENGTH', 30);
+define('EMAIL_LENGTH', 40);
+define('GROUP_LENGTH', 30);
+define('OS_LENGTH', 20);
+define('VV_VERSION_LENGTH', 30);
+define('COUNTRY_LENGTH', 30); 
+define('ARCHITECTURE_LENGTH',10);
+define('COMPILATION_DATE_LENGTH', 30); 
+function ensureString($var, $length){
+  $var = str_replace("\n", '',$var);
+  $var = str_replace(TOKEN_CSV, '', $var);
+  return substr($var, 0, $length);
+}
+function writeLine($file, $data){
+ fwrite($file, implode(TOKEN_CSV, $data).ENTRY_SEPARATOR);
+}
+$data['name']    = ensureString($_GET['name'], NAME_LENGTH);
+$data['lastname'] = ensureString($_GET['lastName'], NAME_LENGTH);
+$data['email']   = ensureString($_GET['email'], EMAIL_LENGTH);
+$data['group']   = ensureString($_GET['group'], GROUP_LENGTH);
+$data['ip']      = $_SERVER['REMOTE_ADDR'];
+$data['os']      = ensureString($_GET['os'], OS_LENGTH);
+$data['vvVersion']= ensureString($_GET['vvVersion'], VV_VERSION_LENGTH);
+$data['time']    = date("F j, Y, g:i a");
+$data['geoloc']          = ensureString(file_get_contents('http://api.hostip.info/country.php?ip='.$_SERVER['REMOTE_ADDR']), COUNTRY_LENGTH);
+$data['architecture'] = ensureString($_GET['architecture'], ARCHITECTURE_LENGTH);
+$data['compilationDate'] = ensureString($_GET['compilationDate'], COMPILATION_DATE_LENGTH);
+writeLine($file, $data);
+fclose();