diff --git a/CMakeExternals/OpenCV.cmake b/CMakeExternals/OpenCV.cmake index 0259ddaf09..cf59852e5a 100644 --- a/CMakeExternals/OpenCV.cmake +++ b/CMakeExternals/OpenCV.cmake @@ -1,82 +1,82 @@ #----------------------------------------------------------------------------- # OpenCV #----------------------------------------------------------------------------- if(MITK_USE_OpenCV) # Sanity checks if(DEFINED OpenCV_DIR AND NOT EXISTS ${OpenCV_DIR}) message(FATAL_ERROR "OpenCV_DIR variable is defined but corresponds to non-existing directory") endif() set(proj OpenCV) set(proj_DEPENDENCIES) set(OpenCV_DEPENDS ${proj}) if(NOT DEFINED OpenCV_DIR) set(additional_cmake_args ) if(MITK_USE_Python) #message(STATUS "PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}") #message(STATUS "PYTHON_DEBUG_LIBRARY: ${PYTHON_DEBUG_LIBRARY}") #message(STATUS "PYTHON_INCLUDE_DIR: ${PYTHON_INCLUDE_DIR}") #message(STATUS "PYTHON_LIBRARY: ${PYTHON_LIBRARY}") list(APPEND additional_cmake_args -DBUILD_opencv_python:BOOL=ON -DBUILD_NEW_PYTHON_SUPPORT:BOOL=ON -DPYTHON_DEBUG_LIBRARY:FILEPATH=${PYTHON_DEBUG_LIBRARY} -DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE} -DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR} -DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY} #-DPYTHON_LIBRARIES=${PYTHON_LIBRARY} #-DPYTHON_DEBUG_LIBRARIES=${PYTHON_DEBUG_LIBRARIES} ) else() list(APPEND additional_cmake_args -DBUILD_opencv_python:BOOL=OFF -DBUILD_NEW_PYTHON_SUPPORT:BOOL=OFF ) endif() # 12-05-02, muellerm, added QT usage by OpenCV if QT is used in MITK # 12-09-11, muellerm, removed automatic usage again, since this will struggle with the MITK Qt application object if(MITK_USE_QT) list(APPEND additional_cmake_args - -DWITH_QT:BOOL=OFF + -DWITH_QT:BOOL=ON -DWITH_QT_OPENGL:BOOL=OFF -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} ) endif() set(opencv_url ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/OpenCV-2.4.2.tar.bz2) set(opencv_url_md5 d5d13c4a65dc96cdfaad54767e428215) ExternalProject_Add(${proj} SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}-src BINARY_DIR ${proj}-build PREFIX ${proj}-cmake URL ${opencv_url} URL_MD5 ${opencv_url_md5} INSTALL_COMMAND "" CMAKE_GENERATOR ${gen} CMAKE_ARGS ${ep_common_args} -DBUILD_DOCS:BOOL=OFF -DBUILD_TESTS:BOOL=OFF -DBUILD_EXAMPLES:BOOL=OFF -DBUILD_DOXYGEN_DOCS:BOOL=OFF -DWITH_CUDA:BOOL=ON ${additional_cmake_args} DEPENDS ${proj_DEPENDENCIES} ) set(OpenCV_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-build) else() mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") endif() endif() diff --git a/Modules/CameraCalibration/mitkEndoMacros.h b/Modules/CameraCalibration/mitkEndoMacros.h index c448efe2a4..2a55c0b372 100644 --- a/Modules/CameraCalibration/mitkEndoMacros.h +++ b/Modules/CameraCalibration/mitkEndoMacros.h @@ -1,96 +1,120 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkEndoMacros_h #define mitkEndoMacros_h /// /// COLLECTION OF MACROS FOR THE ENDOTRACKING MODULE /// /// /// multiplexing for cv mats /// #define endoAccessCvMat(function, T, arg1, arg2) \ if( arg2.type() == cv::DataType::type ) \ function( arg1, arg2 ); \ else if( arg2.type() == cv::DataType::type ) \ function( arg1, arg2 ); \ else if( arg2.type() == cv::DataType::type ) \ function( arg1, arg2 ); \ else if( arg2.type() == cv::DataType::type ) \ function( arg1, arg2 ); \ else if( arg2.type() == cv::DataType::type ) \ function( arg1, arg2 ); \ else if( arg2.type() == cv::DataType::type ) \ function( arg1, arg2 ); \ else if( arg2.type() == cv::DataType::type ) \ function( arg1, arg2 ); \ else if( arg2.type() == cv::DataType::type ) \ function( arg1, arg2 ); \ else \ throw std::invalid_argument("Unknown type for cv::Mat"); /// /// exec an algorithm with 1 output argument /// #define endoExec(macroAlgName, macroOutputType, macroOutputVarName, ...)\ macroOutputType macroOutputVarName;\ { \ macroAlgName _macroAlgName(__VA_ARGS__, ¯oOutputVarName);\ _macroAlgName.Update();\ } /// /// exec an algorithm with 2 output argument /// #define endoExec2(macroAlgName, macroOutputType1, macroOutputVarName1, macroOutputType2, macroOutputVarName2, ...)\ macroOutputType1 macroOutputVarName1;\ macroOutputType1 macroOutputVarName1;\ { \ macroAlgName _macroAlgName(__VA_ARGS__, ¯oOutputVarName1, ¯oOutputVarName2);\ _macroAlgName.Update();\ } /// /// an assert macro for throwing exceptions from an assert /// #define endoAssert(a) if(!(a)) { \ std::ostringstream s; \ s << mitk::EndoDebug::GetInstance().GetFilenameWithoutExtension(__FILE__) << ", " \ << __LINE__ << ", failed: " << #a; \ throw std::invalid_argument(s.str()); } /// /// same as above but with an output error stream /// use it like this: endoAssertMsg( file.read() == true, file << "could not be read" ); /// #define endoAssertMsg(a, msg) if(!(a)) { \ std::ostringstream s; \ s << mitk::EndoDebug::GetInstance().GetFilenameWithoutExtension(__FILE__) << ", " \ << __LINE__ << ": " << msg; \ throw std::invalid_argument(s.str()); \ } /// /// definition of the corresponding directory separator /// #ifdef WIN32 static const std::string DIR_SEPARATOR = "\\"; #else static const std::string DIR_SEPARATOR = "/"; #endif +#define endoSetInput(name, type) \ +public: \ + virtual void Set##name (const type _arg) \ + { \ + if ( this->m_##name != _arg ) \ + { \ + this->m_##name = _arg; \ + } \ + } \ +protected: \ + const type m_##name; + +#define endoSetOutput(name, type) \ +public: \ + virtual void Set##name (type _arg) \ + { \ + if ( this->m_##name != _arg ) \ + { \ + this->m_##name = _arg; \ + } \ + } \ +protected: \ + type m_##name; + #endif // mitkEndoMacros_h