#=========================================================
# 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)
#ADD_LIBRARY(clitkCommonShared SHARED ${clitkCommon_SRC})
#SET_TARGET_PROPERTIES(clitkCommonShared PROPERTIES COMPILE_FLAGS -fPIC)
-#passing environnment variable
-configure_file (
- globals.h.in
- globals.h
-)
+/*=========================================================================
+ 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
#cmakedefine01 CLITK_EXPERIMENTAL
#cmakedefine01 CLITK_MEMORY_INFO
+// Global environment variables
+#define OS_NAME "@CMAKE_SYSTEM@"
+#define ARCHITECTURE "@CMAKE_SYSTEM_PROCESSOR@"
+
#endif
+++ /dev/null
-#define OS_NAME "@CMAKE_SYSTEM@"
-
\ No newline at end of file
+cmake_policy(SET CMP0005 NEW)
+
+
macro(ADD_GOOGLE_TESTS executable)
foreach ( source ${ARGN} )
file(READ "${source}" contents)
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)
--- /dev/null
+/*=========================================================================
+ 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
#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
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)
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)
INCLUDE(CPack)
#=========================================================
#=========================================================
-configure_file(vvCommon.h.in vvCommon.h)
+configure_file(vvConfiguration.h.in vvConfiguration.h)
#=========================================================
<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><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+ <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><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
-<img src=":/common/icons/weNeedYou.jpg" style="float:right;" />
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Welcome to VV !</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">We wish to keep an estimate of the number of persons using VV. This is</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">really important for us to justify the ressources spent in developing this software.</p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Please, take a few seconds to fill in the following fields and send us</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">the information by clicking OK. If you still prefer to remain </p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">anonymous, simply click &quot;No, thanks&quot; (you can still register afterwards using the help menu).</p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Privacy: the collected information is for internal and non-commercial</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">use only. We will only use your email for vv release announcements.</p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></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>
+<p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:10px; -qt-block-indent:0; text-indent:0px;"><img src=":/common/icons/weNeedYou.png" style="float: left;" /><span style=" font-weight:600; color:#0000c0;">Welcome to VV !</span><br /><br />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.</p>
+<p align="justify" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:10px; -qt-block-indent:0; text-indent:0px;"></p>
+<p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:10px; -qt-block-indent:0; text-indent:0px;">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 &quot;No, thanks&quot; (you can still register afterwards using the help menu).</p>
+<p align="justify" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:10px; -qt-block-indent:0; text-indent:0px;"></p>
+<p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:10px; -qt-block-indent:0; text-indent:0px;">Privacy: the collected information is for internal and non-commercial use only. We will only use your email for vv release announcements.</p></body></html></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"/>
#include "clitkIO.h"
#include "vvMainWindow.h"
+#include "vvToolsList.h"
#include <vtkFileOutputWindow.h>
#include <vtkSmartPointer.h>
#include <itkFileOutputWindow.h>
+++ /dev/null
-#define VV_VERSION "v@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.@CPACK_PACKAGE_VERSION_PATCH@"
-
\ No newline at end of file
--- /dev/null
+/*=========================================================================
+ 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
<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>
#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){
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(){
osName->setText(QString::fromStdString(OS_NAME));
QDialog::show();
-}
\ No newline at end of file
+}
--- /dev/null
+<?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();