Page MenuHomePhabricator

No OneTemporary

This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/CMake/mitkFunctionAddCustomModuleTest.cmake b/CMake/mitkFunctionAddCustomModuleTest.cmake
index 67de10bcd8..4659520d33 100644
--- a/CMake/mitkFunctionAddCustomModuleTest.cmake
+++ b/CMake/mitkFunctionAddCustomModuleTest.cmake
@@ -1,23 +1,28 @@
#!
#! \brief Add a custom test for MITK module
#!
#! \param test_name Unique identifier for the test
#! \param test_function Name of the test function (the one with the argc,argv signature)
#!
#! Additional parameters will be passed as command line parameters to the test.
#!
function(mitkAddCustomModuleTest test_name test_function)
if (BUILD_TESTING AND MODULE_IS_ENABLED)
- add_test(${test_name} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTDRIVER} ${test_function} ${ARGN})
+ if(MITK_XVFB_TESTING)
+ set(xvfb_run "xvfb-run" "--auto-servernum")
+ else()
+ set(xvfb_run )
+ endif()
+ add_test(NAME ${test_name} COMMAND ${xvfb_run} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTDRIVER} ${test_function} ${ARGN})
set_property(TEST ${test_name} PROPERTY LABELS ${MODULE_SUBPROJECTS} MITK)
mitkFunctionGetLibrarySearchPaths(MITK_RUNTIME_PATH_RELEASE release RELEASE)
mitkFunctionGetLibrarySearchPaths(MITK_RUNTIME_PATH_DEBUG debug DEBUG)
set(test_env_path ${MITK_RUNTIME_PATH_RELEASE} ${MITK_RUNTIME_PATH_DEBUG} $ENV{PATH})
list(REMOVE_DUPLICATES test_env_path)
string (REGEX REPLACE "\;" "\\\;" test_env_path "${test_env_path}")
set_property(TEST ${test_name} PROPERTY ENVIRONMENT "PATH=${test_env_path}" APPEND)
set_property(TEST ${test_name} PROPERTY SKIP_RETURN_CODE 77)
endif()
endfunction()
diff --git a/CMake/mitkInstallRules.cmake b/CMake/mitkInstallRules.cmake
index c07ba835cf..0b02b0bc21 100644
--- a/CMake/mitkInstallRules.cmake
+++ b/CMake/mitkInstallRules.cmake
@@ -1,94 +1,109 @@
# Install MITK icon and logo
MITK_INSTALL(FILES
"${MITK_SOURCE_DIR}/mitk.ico"
"${MITK_SOURCE_DIR}/mitk.bmp")
+# Helper vars
+
+if(WIN32)
+ set(_prefix "")
+ set(_ext ".dll")
+elseif(UNIX)
+ set(_prefix "lib")
+ if(APPLE)
+ set(_ext ".dylib")
+ else()
+ set(_ext ".so")
+ endif()
+endif()
+
+# Install PythonQt
+
+if(MITK_USE_Python3 AND PythonQt_DIR)
+ set(_python_qt_lib "${PythonQt_DIR}/")
+ if(WIN32)
+ set(_python_qt_lib "${_python_qt_lib}bin")
+ else()
+ set(_python_qt_lib "${_python_qt_lib}lib")
+ endif()
+ set(_python_qt_lib "${_python_qt_lib}/${_prefix}PythonQt${_ext}")
+ MITK_INSTALL(FILES ${_python_qt_lib})
+endif()
+
# Install Qt plugins
if(MITK_USE_Qt5)
get_property(_qmake_location TARGET ${Qt5Core_QMAKE_EXECUTABLE} PROPERTY IMPORT_LOCATION)
get_filename_component(_qmake_path ${_qmake_location} DIRECTORY)
- if(WIN32)
- set(_prefix "")
- set(_ext ".dll")
- elseif(UNIX)
- set(_prefix "lib")
- if(APPLE)
- set(_ext ".dylib")
- else()
- set(_ext ".so")
- endif()
- endif()
-
set(_install_DESTINATION "plugins/sqldrivers")
MITK_INSTALL(FILES "${_qmake_path}/../plugins/sqldrivers/${_prefix}qsqlite${_ext}")
set(_install_DESTINATION "plugins/imageformats")
MITK_INSTALL(FILES "${_qmake_path}/../plugins/imageformats/${_prefix}qsvg${_ext}")
set(_install_DESTINATION "plugins/iconengines")
MITK_INSTALL(FILES "${_qmake_path}/../plugins/iconengines/${_prefix}qsvgicon${_ext}")
# Install platform-specific Qt plugins
set(_install_DESTINATION "plugins/platforms")
if(WIN32)
MITK_INSTALL(FILES "${_qmake_path}/../plugins/platforms/qwindows.dll")
elseif(APPLE)
MITK_INSTALL(FILES "${_qmake_path}/../plugins/platforms/libqcocoa.dylib")
elseif(UNIX)
MITK_INSTALL(FILES "${_qmake_path}/../plugins/platforms/libqxcb.so")
set(_install_DESTINATION "plugins/xcbglintegrations")
MITK_INSTALL(FILES "${_qmake_path}/../plugins/xcbglintegrations/libqxcb-glx-integration.so")
endif()
# Install platform-specific Qt styles
set(_install_DESTINATION "plugins/styles")
if(WIN32)
MITK_INSTALL(FILES "${_qmake_path}/../plugins/styles/qwindowsvistastyle.dll")
elseif(APPLE)
MITK_INSTALL(FILES "${_qmake_path}/../plugins/styles/libqmacstyle.dylib")
endif()
# Install Qt WebEngine
if(APPLE)
set(_install_DESTINATION "../Frameworks/QtWebEngineCore.framework")
get_filename_component(_real_path "${_qmake_path}/../lib/QtWebEngineCore.framework/Helpers" REALPATH)
MITK_INSTALL(DIRECTORY ${_real_path} USE_SOURCE_PERMISSIONS)
# Translations are included in the Resources directory of
# QtWebEngineCore.framework and are installed by default.
else()
set(_install_DESTINATION "")
if(WIN32)
MITK_INSTALL(PROGRAMS "${_qmake_path}/QtWebEngineProcess.exe")
elseif(UNIX)
MITK_INSTALL(PROGRAMS "${_qmake_path}/../libexec/QtWebEngineProcess")
endif()
MITK_INSTALL(DIRECTORY "${_qmake_path}/../resources")
set(_install_DESTINATION "translations")
MITK_INSTALL(DIRECTORY "${_qmake_path}/../translations/qtwebengine_locales")
endif()
endif()
set(_install_DESTINATION "")
# Install MatchPoint binaries that are not auto-detected
if(MITK_USE_MatchPoint)
MITK_INSTALL(DIRECTORY "${MITK_EXTERNAL_PROJECT_PREFIX}/bin/" FILES_MATCHING PATTERN "MapUtilities*")
MITK_INSTALL(DIRECTORY "${MITK_EXTERNAL_PROJECT_PREFIX}/bin/" FILES_MATCHING PATTERN "MapAlgorithms*")
endif()
# IMPORTANT: Restore default install destination! Do not edit this file beyond this line!
set(_install_DESTINATION "")
diff --git a/CMake/mitkMacroCreateModuleTests.cmake b/CMake/mitkMacroCreateModuleTests.cmake
index 2a26abd10e..9cd2e0a889 100644
--- a/CMake/mitkMacroCreateModuleTests.cmake
+++ b/CMake/mitkMacroCreateModuleTests.cmake
@@ -1,100 +1,106 @@
#
# Create tests and testdriver for this module
#
# Usage: MITK_CREATE_MODULE_TESTS( [EXTRA_DRIVER_INIT init_code] )
#
# EXTRA_DRIVER_INIT is inserted as c++ code in the testdriver and will be executed before each test
#
macro(MITK_CREATE_MODULE_TESTS)
cmake_parse_arguments(MODULE_TEST
"US_MODULE;NO_INIT" "EXTRA_DRIVER_INIT;EXTRA_DRIVER_INCLUDE" "EXTRA_DEPENDS;DEPENDS;PACKAGE_DEPENDS" ${ARGN})
if(BUILD_TESTING AND MODULE_IS_ENABLED)
include(files.cmake)
include_directories(.)
set(TESTDRIVER ${MODULE_NAME}TestDriver)
set(MODULE_TEST_EXTRA_DRIVER_INIT "${MODULE_TEST_EXTRA_DRIVER_INIT}")
+ if(MITK_XVFB_TESTING)
+ set(xvfb_run "xvfb-run" "--auto-servernum")
+ else()
+ set(xvfb_run )
+ endif()
+
if(MODULE_TEST_US_MODULE)
message(WARNING "The US_MODULE argument is deprecated and should be removed")
endif()
if(MODULE_TEST_US_MODULE AND MODULE_TEST_NO_INIT)
message(WARNING "Conflicting arguments US_MODULE and NO_INIT: NO_INIT wins.")
endif()
set(_no_init)
if(MODULE_TEST_NO_INIT)
set(_no_init NO_INIT)
endif()
set(MITK_MODULE_NAME_REGEX_MATCH )
set(MITK_MODULE_NAME_REGEX_NOT_MATCH )
set(_testdriver_file_list ${CMAKE_CURRENT_BINARY_DIR}/testdriver_files.cmake)
configure_file(${MITK_CMAKE_DIR}/mitkTestDriverFiles.cmake.in ${_testdriver_file_list} @ONLY)
mitk_create_executable(${TESTDRIVER}
DEPENDS ${MODULE_NAME} ${MODULE_TEST_DEPENDS} ${MODULE_TEST_EXTRA_DEPENDS} MitkTestingHelper
PACKAGE_DEPENDS ${MODULE_TEST_PACKAGE_DEPENDS}
SUBPROJECTS ${MODULE_SUBPROJECTS}
FILES_CMAKE ${_testdriver_file_list}
NO_FEATURE_INFO NO_BATCH_FILE ${_no_init})
set_property(TARGET ${EXECUTABLE_TARGET} PROPERTY FOLDER "${MITK_ROOT_FOLDER}/Modules/Tests")
#
# Now tell CMake which tests should be run. This is done automatically
# for all tests in ${KITNAME}_TESTS and ${KITNAME}_IMAGE_TESTS. The IMAGE_TESTS
# are run for each image in the TESTIMAGES list.
#
include(files.cmake)
foreach( test ${MODULE_TESTS} )
get_filename_component(TName ${test} NAME_WE)
- add_test(${TName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTDRIVER} ${TName})
+ add_test(NAME ${TName} COMMAND ${xvfb_run} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTDRIVER} ${TName})
# Add labels for CDash subproject support
if(MODULE_SUBPROJECTS)
set_property(TEST ${TName} PROPERTY LABELS ${MODULE_SUBPROJECTS} MITK)
endif()
mitkFunctionGetLibrarySearchPaths(MITK_RUNTIME_PATH_RELEASE release RELEASE)
mitkFunctionGetLibrarySearchPaths(MITK_RUNTIME_PATH_DEBUG debug DEBUG)
set(test_env_path ${MITK_RUNTIME_PATH_RELEASE} ${MITK_RUNTIME_PATH_DEBUG} $ENV{PATH})
list(REMOVE_DUPLICATES test_env_path)
string (REGEX REPLACE "\;" "\\\;" test_env_path "${test_env_path}")
set_property(TEST ${TName} PROPERTY ENVIRONMENT "PATH=${test_env_path}" APPEND)
set_property(TEST ${TName} PROPERTY SKIP_RETURN_CODE 77)
endforeach()
set(TEST_TYPES IMAGE SURFACE POINTSET) # add other file types here
foreach(test_type ${TEST_TYPES})
foreach(test_data ${MODULE_TEST${test_type}} ${ADDITIONAL_TEST_${test_type}})
if(EXISTS ${test_data})
set(TEST_DATA_FULL_PATH ${test_data})
else()
# todo: maybe search other paths as well
# yes, please in mitk/Testing/Data, too
set(TEST_DATA_FULL_PATH ${MITK_DATA_DIR}/${test_data})
endif()
if(EXISTS ${TEST_DATA_FULL_PATH})
foreach( test ${MODULE_${test_type}_TESTS})
get_filename_component(TName ${test} NAME_WE)
get_filename_component(DName ${TEST_DATA_FULL_PATH} NAME)
- add_test(${TName}_${DName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTDRIVER} ${TName} ${TEST_DATA_FULL_PATH})
+ add_test(NAME ${TName}_${DName} COMMAND ${xvfb_run} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTDRIVER} ${TName} ${TEST_DATA_FULL_PATH})
# Add labels for CDash subproject support
if(MODULE_SUBPROJECTS)
set_property(TEST ${TName}_${DName} PROPERTY LABELS ${MODULE_SUBPROJECTS} MITK)
endif()
set_property(TEST ${TName}_${DName} PROPERTY ENVIRONMENT "PATH=${test_env_path}" APPEND)
set_property(TEST ${TName}_${DName} PROPERTY SKIP_RETURN_CODE 77)
endforeach()
else()
message("!!!!! No such file: ${TEST_DATA_FULL_PATH} !!!!!")
endif()
endforeach()
endforeach()
endif()
endmacro()
diff --git a/CMake/mitkMacroInstall.cmake b/CMake/mitkMacroInstall.cmake
index 7ed361b728..82939b49fd 100644
--- a/CMake/mitkMacroInstall.cmake
+++ b/CMake/mitkMacroInstall.cmake
@@ -1,204 +1,204 @@
#
# MITK specific install macro
#
# On Mac everything is installed for each bundle listed in MACOSX_BUNDLE_NAMES
# by replacing the DESTINATION parameter. Everything else is passed to the CMake INSTALL command
#
# Usage: MITK_INSTALL( )
#
macro(MITK_INSTALL)
set(ARGS ${ARGN})
set(install_directories "")
list(FIND ARGS DESTINATION _destination_index)
if(_destination_index GREATER -1)
message(SEND_ERROR "MITK_INSTALL macro must not be called with a DESTINATION parameter.")
else()
# If there is a FILES_MATCHING parameter we need to make sure that the
# DESTINATION parameter is located in front of it.
set(ARGS1 "")
set(ARGS2 "")
list(FIND ARGS FILES_MATCHING _files_matching_index)
if(_files_matching_index GREATER -1)
set(_index "0")
list(LENGTH ARGS _count)
while(_index LESS _files_matching_index )
list(GET ARGS ${_index} _arg)
list(APPEND ARGS1 ${_arg})
math(EXPR _index "${_index}+1")
endwhile()
while(_index LESS _count)
list(GET ARGS ${_index} _arg)
list(APPEND ARGS2 ${_arg})
math(EXPR _index "${_index}+1")
endwhile()
else()
set(ARGS1 ${ARGS})
endif()
if(NOT MACOSX_BUNDLE_NAMES)
install(${ARGS1} DESTINATION bin/${_install_DESTINATION} ${ARGS2})
else()
foreach(bundle_name ${MACOSX_BUNDLE_NAMES})
install(${ARGS1} DESTINATION ${bundle_name}.app/Contents/MacOS/${_install_DESTINATION} ${ARGS2})
endforeach()
endif()
endif()
endmacro()
# Fix _target_location
# This is used in several install macros
macro(_fixup_target)
if(NOT intermediate_dir)
if(WIN32)
set(intermediate_dir Release)
else()
set(intermediate_dir .)
endif()
endif()
mitkFunctionGetLibrarySearchPaths(_search_paths ${intermediate_dir})
install(CODE "
set(_bundle_dest_dir \"${_bundle_dest_dir}\")
if(_bundle_dest_dir)
set(_bin_path \"\${CMAKE_INSTALL_PREFIX}/\${_bundle_dest_dir}\")
else()
set(_bin_path \"\${CMAKE_INSTALL_PREFIX}/bin\")
endif()
macro(gp_item_default_embedded_path_override item default_embedded_path_var)
get_filename_component(_item_name \"\${item}\" NAME)
get_filename_component(_item_path \"\${item}\" PATH)
# We have to fix all path references to build trees for plugins
if(NOT _item_path MATCHES \"\${CMAKE_INSTALL_PREFIX}/${_bundle_dest_dir}\")
# item with relative path or embedded path pointing to some build dir
set(full_path \"full_path-NOTFOUND\")
file(GLOB_RECURSE full_path \${CMAKE_INSTALL_PREFIX}/${_bundle_dest_dir}/\${_item_name} )
list(LENGTH full_path full_path_length)
if(full_path_length GREATER 1)
list(GET full_path 0 full_path)
endif()
get_filename_component(_item_path \"\${full_path}\" PATH)
endif()
set(_plugins_path \"\${_bin_path}/plugins\")
if(_item_path STREQUAL _plugins_path
OR (_item_path MATCHES \"\${_plugins_path}/\" AND _item_name MATCHES \"liborg\") # this is for legacy BlueBerry bundle support
)
# Only fix plugins
message(\"override: \${item}\")
message(\"found file: \${_item_path}/\${_item_name}\")
if(APPLE)
string(REPLACE
\${CMAKE_INSTALL_PREFIX}/${_bundle_dest_dir}
@executable_path \${default_embedded_path_var} \"\${_item_path}\" )
else()
set(\${default_embedded_path_var} \"\${_item_path}\")
endif()
message(\"override result: \${\${default_embedded_path_var}}\")
endif()
endmacro(gp_item_default_embedded_path_override)
macro(gp_resolved_file_type_override file type)
if(NOT APPLE)
get_filename_component(_file_path \"\${file}\" PATH)
get_filename_component(_file_name \"\${file}\" NAME)
if(_file_path MATCHES \"^\${CMAKE_INSTALL_PREFIX}\")
set(\${type} \"local\")
endif()
if(_file_name MATCHES gdiplus)
set(\${type} \"system\")
endif(_file_name MATCHES gdiplus)
endif()
if(WIN32)
if(file MATCHES \"BluetoothApis.dll\")
set(\${type} \"system\" )
endif()
endif()
endmacro(gp_resolved_file_type_override)
if(NOT APPLE)
macro(gp_resolve_item_override context item exepath dirs resolved_item_var resolved_var)
if(\${item} MATCHES \"blueberry_core_runtime\")
get_filename_component(_item_name \${item} NAME)
set(\${resolved_item_var} \"\${exepath}/plugins/\${_item_name}\")
set(\${resolved_var} 1)
endif()
endmacro()
endif()
if(\"${_install_GLOB_PLUGINS}\" STREQUAL \"TRUE\")
set(GLOBBED_PLUGINS )
set(_bb_runtime_lib \"\${_bin_path}/liborg_blueberry_core_runtime${CMAKE_SHARED_LIBRARY_SUFFIX}\")
if(EXISTS \"\${_bb_runtime_lib}\")
list(APPEND GLOBBED_PLUGINS \"\${_bb_runtime_lib}\")
endif()
# Iterate over all sub-directories which contain plug-ins
# (BlueBerry plug-ins, Qt plug-ins, and auto-load modules)
file(GLOB _children \"\${_bin_path}/*\")
foreach(_child \${_children})
if(IS_DIRECTORY \${_child})
set(_plugins )
set(_modules )
file(GLOB_RECURSE _plugins \"\${_child}/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
if(_plugins)
list(APPEND GLOBBED_PLUGINS \${_plugins})
endif()
# Now glob for all modules which might have a different extensions.
# E.g. on MacOS plugins could have a .dylib extension as well as a .so extension
if(NOT \"${CMAKE_SHARED_MODULE_SUFFIX}\" STREQUAL \"\" AND NOT \"${CMAKE_SHARED_MODULE_SUFFIX}\" STREQUAL \"${CMAKE_SHARED_LIBRARY_SUFFIX}\")
file(GLOB_RECURSE _modules \"\${_child}/*${CMAKE_SHARED_MODULE_SUFFIX}\")
endif()
if(_modules)
list(APPEND GLOBBED_PLUGINS \${_modules})
endif()
endif()
endforeach()
endif()
file(GLOB _match_point_plugins \"\${_bin_path}/mdra-*\")
set(PLUGINS )
foreach(_plugin ${_install_PLUGINS} \${GLOBBED_PLUGINS} \${_match_point_plugins})
get_filename_component(_plugin_realpath \${_plugin} REALPATH)
list(APPEND PLUGINS \${_plugin_realpath})
endforeach()
if(PLUGINS)
list(REMOVE_DUPLICATES PLUGINS)
endif(PLUGINS)
message(\"globbed plugins: \${PLUGINS}\")
set(CMAKE_MODULE_PATH ${MITK_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH} )
set(DIRS \"${_search_paths}\")
set(_additional_search_paths ${_install_LIBRARY_DIRS})
if(_additional_search_paths)
set(DIRS \"\${DIRS};\${_additional_search_paths}\")
endif()
foreach(_plugin \${PLUGINS})
get_filename_component(_pluginpath \${_plugin} PATH)
list(APPEND DIRS \"\${_pluginpath}\")
endforeach(_plugin)
list(REMOVE_DUPLICATES DIRS)
# use custom version of BundleUtilities
include(BundleUtilities)
set(BU_CHMOD_BUNDLE_ITEMS ON)
- fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${_target_location}\" \"\${PLUGINS}\" \"\${DIRS}\")
+ fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${_target_location}\" \"\${PLUGINS}\" \"\${DIRS}\" IGNORE_ITEM Python)
if(APPLE)
include(FixMacOSInstaller)
endif()
")
endmacro()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e148bc017d..9026898987 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,1472 +1,1467 @@
set(MITK_CMAKE_MINIMUM_REQUIRED_VERSION 3.14.5)
cmake_minimum_required(VERSION ${MITK_CMAKE_MINIMUM_REQUIRED_VERSION})
#-----------------------------------------------------------------------------
# See https://cmake.org/cmake/help/v3.14/manual/cmake-policies.7.html for details
#-----------------------------------------------------------------------------
set(project_policies )
foreach(policy ${project_policies})
if(POLICY ${policy})
cmake_policy(SET ${policy} NEW)
endif()
endforeach()
#-----------------------------------------------------------------------------
# Superbuild Option - Enabled by default
#-----------------------------------------------------------------------------
option(MITK_USE_SUPERBUILD "Build MITK and the projects it depends on via SuperBuild.cmake." ON)
if(MITK_USE_SUPERBUILD)
project(MITK-superbuild)
set(MITK_SOURCE_DIR ${PROJECT_SOURCE_DIR})
set(MITK_BINARY_DIR ${PROJECT_BINARY_DIR})
else()
project(MITK VERSION 2018.04.99)
include_directories(SYSTEM ${MITK_SUPERBUILD_BINARY_DIR})
endif()
#-----------------------------------------------------------------------------
# MITK Extension Feature
#-----------------------------------------------------------------------------
set(MITK_EXTENSION_DIRS "" CACHE STRING "")
set(MITK_DIR_PLUS_EXTENSION_DIRS ${MITK_SOURCE_DIR} ${MITK_EXTENSION_DIRS})
#-----------------------------------------------------------------------------
# Update CMake module path
#-----------------------------------------------------------------------------
set(MITK_CMAKE_DIR ${MITK_SOURCE_DIR}/CMake)
set(CMAKE_MODULE_PATH ${MITK_CMAKE_DIR})
foreach(MITK_EXTENSION_DIR ${MITK_EXTENSION_DIRS})
set(MITK_CMAKE_EXTENSION_DIR ${MITK_EXTENSION_DIR}/CMake)
get_filename_component(MITK_CMAKE_EXTENSION_DIR ${MITK_CMAKE_EXTENSION_DIR} ABSOLUTE)
if(EXISTS ${MITK_CMAKE_EXTENSION_DIR})
list(APPEND CMAKE_MODULE_PATH ${MITK_CMAKE_EXTENSION_DIR})
endif()
endforeach()
#-----------------------------------------------------------------------------
# CMake function(s) and macro(s)
#-----------------------------------------------------------------------------
# Standard CMake macros
include(FeatureSummary)
include(CTestUseLaunchers)
include(CMakeParseArguments)
include(FindPackageHandleStandardArgs)
# MITK macros
include(mitkFunctionGetGccVersion)
include(mitkFunctionCheckCompilerFlags)
include(mitkFunctionSuppressWarnings) # includes several functions
include(mitkMacroEmptyExternalProject)
include(mitkFunctionGenerateProjectXml)
include(mitkFunctionEnableBuildConfiguration)
include(mitkFunctionWhitelists)
include(mitkFunctionAddExternalProject)
include(mitkFunctionAddLibrarySearchPaths)
SUPPRESS_VC_DEPRECATED_WARNINGS()
#-----------------------------------------------------------------------------
# Set a default build type if none was specified
#-----------------------------------------------------------------------------
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
#-----------------------------------------------------------------------------
# Check miminum macOS version
#-----------------------------------------------------------------------------
# The minimum supported macOS version is 10.13. If you use a version less than 10.13, there is no guarantee that the build still works.
if(APPLE)
exec_program(sw_vers ARGS -productVersion OUTPUT_VARIABLE macos_version)
if (macos_version VERSION_LESS "10.13")
message(WARNING "Detected macOS version \"${macos_version}\" is not supported anymore. Minimum required macOS version is at least 10.13.")
endif()
if (CMAKE_OSX_DEPLOYMENT_TARGET AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.13)
message(WARNING "Detected macOS deployment target \"${CMAKE_OSX_DEPLOYMENT_TARGET}\" is not supported anymore. Minimum required macOS version is at least 10.13.")
endif()
endif()
#-----------------------------------------------------------------------------
# Check miminum compiler versions
#-----------------------------------------------------------------------------
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# require at least gcc 4.9 as provided by ppa:ubuntu-toolchain-r/test for Ubuntu 14.04
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
message(FATAL_ERROR "GCC version must be at least 4.9
If you are using Ubuntu 14.04, you can easily install gcc and g++ 4.9 (or any later version available) in addition to your version ${CMAKE_CXX_COMPILER_VERSION}:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9
Make sure to explicitly specify these compilers when configuring MITK:
CMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc-4.9
CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/g++-4.9
For more information on the proposed PPA see the Toolchain Updates section of https://wiki.ubuntu.com/ToolChain.")
endif()
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# require at least clang 3.4
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
message(FATAL_ERROR "Clang version must be at least 3.4")
endif()
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
# require at least clang 5.0
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
message(FATAL_ERROR "Apple Clang version must be at least 5.0")
endif()
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# require at least Visual Studio 2017
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10)
message(FATAL_ERROR "Microsoft Visual Studio 2017 or newer required")
endif()
else()
message(WARNING "You are using an unsupported compiler! Compilation has only been tested with Clang (Linux or Apple), GCC and MSVC.")
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
mitkFunctionGetGccVersion(${CMAKE_CXX_COMPILER} GCC_VERSION)
else()
set(GCC_VERSION 0)
endif()
set(MITK_CXX_STANDARD 14)
set(CMAKE_CXX_EXTENSIONS 0)
set(CMAKE_CXX_STANDARD ${MITK_CXX_STANDARD})
set(CMAKE_CXX_STANDARD_REQUIRED 1)
# This is necessary to avoid problems with compile feature checks.
# CMAKE_CXX_STANDARD seems to only set the -std=c++14 flag for targets.
# However, compile flag checks also need to be done with -std=c++14.
# The MITK_CXX14_FLAG variable is also used for external projects
# build during the MITK super-build.
mitkFunctionCheckCompilerFlags("-std=c++14" MITK_CXX14_FLAG)
#-----------------------------------------------------------------------------
# Warn if source or build path is too long
#-----------------------------------------------------------------------------
if(WIN32)
set(_src_dir_length_max 50)
set(_bin_dir_length_max 50)
if(MITK_USE_SUPERBUILD)
set(_src_dir_length_max 34) # _src_dir_length_max - strlen(ep/src/ITK-build)
set(_bin_dir_length_max 40) # _bin_dir_length_max - strlen(MITK-build)
endif()
string(LENGTH "${MITK_SOURCE_DIR}" _src_n)
string(LENGTH "${MITK_BINARY_DIR}" _bin_n)
# The warnings should be converted to errors
if(_src_n GREATER _src_dir_length_max)
message(WARNING "MITK source code directory path length is too long (${_src_n} > ${_src_dir_length_max})."
"Please move the MITK source code directory to a directory with a shorter path." )
endif()
if(_bin_n GREATER _bin_dir_length_max)
message(WARNING "MITK build directory path length is too long (${_bin_n} > ${_bin_dir_length_max})."
"Please move the MITK build directory to a directory with a shorter path." )
endif()
endif()
#-----------------------------------------------------------------------------
# Additional MITK Options (also shown during superbuild)
#-----------------------------------------------------------------------------
# -----------------------------------------
# General build options
option(BUILD_SHARED_LIBS "Build MITK with shared libraries" ON)
option(WITH_COVERAGE "Enable/Disable coverage" OFF)
option(BUILD_TESTING "Test the project" ON)
option(MITK_FAST_TESTING "Disable long-running tests like packaging" OFF)
+option(MITK_XVFB_TESTING "Execute test drivers through xvfb-run" OFF)
option(MITK_BUILD_ALL_APPS "Build all MITK applications" OFF)
option(MITK_BUILD_EXAMPLES "Build the MITK Examples" OFF)
option(MITK_ENABLE_PIC_READER "Enable support for reading the DKFZ pic file format." ON)
mark_as_advanced(
+ MITK_XVFB_TESTING
MITK_FAST_TESTING
MITK_BUILD_ALL_APPS
MITK_ENABLE_PIC_READER
)
# -----------------------------------------
# Qt version related variables
option(MITK_USE_Qt5 "Use Qt 5 library" ON)
if(MITK_USE_Qt5)
set(MITK_QT5_MINIMUM_VERSION 5.12)
set(MITK_QT5_COMPONENTS Concurrent OpenGL PrintSupport Script Sql Svg Widgets Xml XmlPatterns WebEngineWidgets UiTools Help LinguistTools)
if(APPLE)
list(APPEND MITK_QT5_COMPONENTS DBus)
elseif(UNIX)
list(APPEND MITK_QT5_COMPONENTS X11Extras)
endif()
# Hint at default install locations of Qt
if(NOT Qt5_DIR)
if(MSVC)
set(_dir_candidates "C:/Qt")
if(CMAKE_GENERATOR MATCHES "^Visual Studio [0-9]+ ([0-9]+)")
set(_compilers "msvc${CMAKE_MATCH_1}")
elseif(CMAKE_GENERATOR MATCHES "Ninja")
include(mitkFunctionGetMSVCVersion)
mitkFunctionGetMSVCVersion()
if(VISUAL_STUDIO_PRODUCT_NAME MATCHES "^Visual Studio ([0-9]+)")
set(_compilers "msvc${CMAKE_MATCH_1}")
endif()
endif()
if(_compilers MATCHES "[0-9]+")
if (CMAKE_MATCH_0 EQUAL 2019)
list(APPEND _compilers "msvc2017") # Binary compatible to 2019
endif()
endif()
else()
set(_dir_candidates ~/Qt)
if(APPLE)
set(_compilers clang)
else()
list(APPEND _dir_candidates /opt/Qt)
set(_compilers gcc)
endif()
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
foreach(_compiler ${_compilers})
list(APPEND _compilers64 "${_compiler}_64")
endforeach()
set(_compilers ${_compilers64})
endif()
foreach(_dir_candidate ${_dir_candidates})
get_filename_component(_dir_candidate ${_dir_candidate} REALPATH)
foreach(_compiler ${_compilers})
set(_glob_expression "${_dir_candidate}/5.*/${_compiler}")
file(GLOB _hints ${_glob_expression})
list(SORT _hints)
list(APPEND MITK_QT5_HINTS ${_hints})
endforeach()
endforeach()
endif()
find_package(Qt5 ${MITK_QT5_MINIMUM_VERSION} COMPONENTS ${MITK_QT5_COMPONENTS} REQUIRED HINTS ${MITK_QT5_HINTS})
if(${Qt5_VERSION} VERSION_GREATER_EQUAL 5.13)
message(FATAL_ERROR "Qt version ${Qt5_VERSION_MAJOR}.${Qt5_VERSION_MINOR} is not yet supported. We recommend using the latest long-term support version 5.12.x.")
endif()
endif()
set_property(GLOBAL PROPERTY MITK_EXTERNAL_PROJECTS "")
include(CMakeExternals/ExternalProjectList.cmake)
foreach(MITK_EXTENSION_DIR ${MITK_EXTENSION_DIRS})
set(MITK_CMAKE_EXTERNALS_EXTENSION_DIR ${MITK_EXTENSION_DIR}/CMakeExternals)
get_filename_component(MITK_CMAKE_EXTERNALS_EXTENSION_DIR ${MITK_CMAKE_EXTERNALS_EXTENSION_DIR} ABSOLUTE)
if(EXISTS ${MITK_CMAKE_EXTERNALS_EXTENSION_DIR}/ExternalProjectList.cmake)
include(${MITK_CMAKE_EXTERNALS_EXTENSION_DIR}/ExternalProjectList.cmake)
endif()
endforeach()
# -----------------------------------------
# Other MITK_USE_* options not related to
# external projects build via the
# MITK superbuild
option(MITK_USE_BLUEBERRY "Build the BlueBerry platform" ON)
option(MITK_USE_OpenCL "Use OpenCL GPU-Computing library" OFF)
option(MITK_USE_OpenMP "Use OpenMP" OFF)
option(MITK_USE_Python3 "Use Python 3" OFF)
#-----------------------------------------------------------------------------
# Build configurations
#-----------------------------------------------------------------------------
set(_buildConfigs "Custom")
file(GLOB _buildConfigFiles CMake/BuildConfigurations/*.cmake)
foreach(_buildConfigFile ${_buildConfigFiles})
get_filename_component(_buildConfigFile ${_buildConfigFile} NAME_WE)
list(APPEND _buildConfigs ${_buildConfigFile})
endforeach()
foreach(MITK_EXTENSION_DIR ${MITK_EXTENSION_DIRS})
file(GLOB _extBuildConfigFiles ${MITK_EXTENSION_DIR}/CMake/BuildConfigurations/*.cmake)
foreach(_extBuildConfigFile ${_extBuildConfigFiles})
get_filename_component(_extBuildConfigFile ${_extBuildConfigFile} NAME_WE)
list(APPEND _buildConfigs ${_extBuildConfigFile})
endforeach()
list(REMOVE_DUPLICATES _buildConfigs)
endforeach()
set(MITK_BUILD_CONFIGURATION "Custom" CACHE STRING "Use pre-defined MITK configurations")
set_property(CACHE MITK_BUILD_CONFIGURATION PROPERTY STRINGS ${_buildConfigs})
mitkFunctionEnableBuildConfiguration()
mitkFunctionCreateWhitelistPaths(MITK)
mitkFunctionFindWhitelists(MITK)
# -----------------------------------------
# Custom dependency logic
option(MITK_USE_SYSTEM_Boost "Use the system Boost" OFF)
set(MITK_USE_Boost_LIBRARIES "" CACHE STRING "A semi-colon separated list of required Boost libraries")
if(MITK_USE_cpprestsdk)
find_package(OpenSSL QUIET)
if(NOT OpenSSL_FOUND)
set(openssl_message "Could not find OpenSSL (dependency of C++ REST SDK).\n")
if(UNIX)
if(APPLE)
set(openssl_message "${openssl_message}Please install it using your favorite package management "
"system (i.e. Homebrew or MacPorts).\n")
else()
set(openssl_message "${openssl_message}Please install the dev package of OpenSSL (i.e. libssl-dev).\n")
endif()
else()
set(openssl_message "${openssl_message}Please install Win32 OpenSSL:\n"
" https://slproweb.com/products/Win32OpenSSL.html\n")
endif()
set(openssl_message "${openssl_message}If it still cannot be found, you can hint CMake to find OpenSSL by "
"adding/setting the OPENSSL_ROOT_DIR variable to the root directory of an "
"OpenSSL installation. Make sure to clear variables of partly found "
"versions of OpenSSL before, or they will be mixed up.")
message(FATAL_ERROR ${openssl_message})
endif()
list(APPEND MITK_USE_Boost_LIBRARIES date_time regex system)
if(UNIX)
list(APPEND MITK_USE_Boost_LIBRARIES atomic chrono filesystem random thread)
endif()
list(REMOVE_DUPLICATES MITK_USE_Boost_LIBRARIES)
set(MITK_USE_Boost_LIBRARIES ${MITK_USE_Boost_LIBRARIES} CACHE STRING "A semi-colon separated list of required Boost libraries" FORCE)
endif()
if(MITK_USE_Python3)
set(MITK_USE_ZLIB ON CACHE BOOL "" FORCE)
if(APPLE AND CMAKE_FRAMEWORK_PATH AND CMAKE_FRAMEWORK_PATH MATCHES "python3\\.?([0-9]+)")
find_package(Python3 3.${CMAKE_MATCH_1} EXACT REQUIRED COMPONENTS Interpreter Development NumPy)
else()
find_package(Python3 REQUIRED COMPONENTS Interpreter Development NumPy)
endif()
if(WIN32)
string(REPLACE "\\" "/" Python3_STDARCH "${Python3_STDARCH}")
string(REPLACE "\\" "/" Python3_STDLIB "${Python3_STDLIB}")
string(REPLACE "\\" "/" Python3_SITELIB "${Python3_SITELIB}")
endif()
endif()
if(BUILD_TESTING AND NOT MITK_USE_CppUnit)
message("> Forcing MITK_USE_CppUnit to ON because BUILD_TESTING=ON")
set(MITK_USE_CppUnit ON CACHE BOOL "Use CppUnit for unit tests" FORCE)
endif()
if(MITK_USE_BLUEBERRY)
option(MITK_BUILD_ALL_PLUGINS "Build all MITK plugins" OFF)
mark_as_advanced(MITK_BUILD_ALL_PLUGINS)
if(NOT MITK_USE_CTK)
message("> Forcing MITK_USE_CTK to ON because of MITK_USE_BLUEBERRY")
set(MITK_USE_CTK ON CACHE BOOL "Use CTK in MITK" FORCE)
endif()
endif()
#-----------------------------------------------------------------------------
# Pixel type multiplexing
#-----------------------------------------------------------------------------
# Customize the default pixel types for multiplex macros
set(MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES
"int, unsigned int, short, unsigned short, char, unsigned char"
CACHE STRING "List of integral pixel types used in AccessByItk and InstantiateAccessFunction macros")
set(MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES
"double, float"
CACHE STRING "List of floating pixel types used in AccessByItk and InstantiateAccessFunction macros")
set(MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES
"itk::RGBPixel<unsigned char>, itk::RGBAPixel<unsigned char>"
CACHE STRING "List of composite pixel types used in AccessByItk and InstantiateAccessFunction macros")
set(MITK_ACCESSBYITK_DIMENSIONS
"2,3"
CACHE STRING "List of dimensions used in AccessByItk and InstantiateAccessFunction macros")
mark_as_advanced(MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES
MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES
MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES
MITK_ACCESSBYITK_DIMENSIONS
)
# consistency checks
if(NOT MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES)
set(MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES
"int, unsigned int, short, unsigned short, char, unsigned char"
CACHE STRING "List of integral pixel types used in AccessByItk and InstantiateAccessFunction macros" FORCE)
endif()
if(NOT MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES)
set(MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES
"double, float"
CACHE STRING "List of floating pixel types used in AccessByItk and InstantiateAccessFunction macros" FORCE)
endif()
if(NOT MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES)
set(MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES
"itk::RGBPixel<unsigned char>, itk::RGBAPixel<unsigned char>"
CACHE STRING "List of composite pixel types used in AccessByItk and InstantiateAccessFunction macros" FORCE)
endif()
if(NOT MITK_ACCESSBYITK_VECTOR_PIXEL_TYPES)
string(REPLACE "," ";" _integral_types ${MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES})
string(REPLACE "," ";" _floating_types ${MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES})
foreach(_scalar_type ${_integral_types} ${_floating_types})
set(MITK_ACCESSBYITK_VECTOR_PIXEL_TYPES
"${MITK_ACCESSBYITK_VECTOR_PIXEL_TYPES}itk::VariableLengthVector<${_scalar_type}>,")
endforeach()
string(LENGTH "${MITK_ACCESSBYITK_VECTOR_PIXEL_TYPES}" _length)
math(EXPR _length "${_length} - 1")
string(SUBSTRING "${MITK_ACCESSBYITK_VECTOR_PIXEL_TYPES}" 0 ${_length} MITK_ACCESSBYITK_VECTOR_PIXEL_TYPES)
set(MITK_ACCESSBYITK_VECTOR_PIXEL_TYPES ${MITK_ACCESSBYITK_VECTOR_PIXEL_TYPES}
CACHE STRING "List of vector pixel types used in AccessByItk and InstantiateAccessFunction macros for itk::VectorImage types" FORCE)
endif()
if(NOT MITK_ACCESSBYITK_DIMENSIONS)
set(MITK_ACCESSBYITK_DIMENSIONS
"2,3"
CACHE STRING "List of dimensions used in AccessByItk and InstantiateAccessFunction macros")
endif()
#-----------------------------------------------------------------------------
# Project.xml
#-----------------------------------------------------------------------------
# A list of topologically ordered targets
set(CTEST_PROJECT_SUBPROJECTS)
list(APPEND CTEST_PROJECT_SUBPROJECTS
MITK-Core
MITK-CoreUI
MITK-IGT
MITK-ToF
MITK-Diffusion
MITK-Modules # all modules not contained in a specific subproject
MITK-Plugins # all plugins not contained in a specific subproject
MITK-Examples
Unlabeled # special "subproject" catching all unlabeled targets and tests
)
# Configure CTestConfigSubProject.cmake that could be used by CTest scripts
configure_file(${MITK_SOURCE_DIR}/CTestConfigSubProject.cmake.in
${MITK_BINARY_DIR}/CTestConfigSubProject.cmake)
if(CTEST_PROJECT_ADDITIONAL_TARGETS)
# those targets will be executed at the end of the ctest driver script
# and they also get their own subproject label
set(subproject_list "${CTEST_PROJECT_SUBPROJECTS};${CTEST_PROJECT_ADDITIONAL_TARGETS}")
else()
set(subproject_list "${CTEST_PROJECT_SUBPROJECTS}")
endif()
# Generate Project.xml file expected by the CTest driver script
mitkFunctionGenerateProjectXml(${MITK_BINARY_DIR} MITK "${subproject_list}" ${MITK_USE_SUPERBUILD})
#-----------------------------------------------------------------------------
# Superbuild script
#-----------------------------------------------------------------------------
if(MITK_USE_SUPERBUILD)
include("${CMAKE_CURRENT_SOURCE_DIR}/SuperBuild.cmake")
# Print configuration summary
message("\n\n")
feature_summary(
DESCRIPTION "------- FEATURE SUMMARY FOR ${PROJECT_NAME} -------"
WHAT ALL)
return()
endif()
#*****************************************************************************
#**************************** END OF SUPERBUILD ****************************
#*****************************************************************************
#-----------------------------------------------------------------------------
# Organize MITK targets in folders
#-----------------------------------------------------------------------------
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(MITK_ROOT_FOLDER "MITK" CACHE STRING "")
mark_as_advanced(MITK_ROOT_FOLDER)
#-----------------------------------------------------------------------------
# CMake function(s) and macro(s)
#-----------------------------------------------------------------------------
include(WriteBasicConfigVersionFile)
include(CheckCXXSourceCompiles)
include(GenerateExportHeader)
include(mitkFunctionAddCustomModuleTest)
include(mitkFunctionCheckModuleDependencies)
include(mitkFunctionCompileSnippets)
include(mitkFunctionConfigureVisualStudioUserProjectFile)
include(mitkFunctionConvertXPSchema)
include(mitkFunctionCreateBlueBerryApplication)
include(mitkFunctionCreateCommandLineApp)
include(mitkFunctionCreateModule)
include(mitkFunctionCreatePlugin)
include(mitkFunctionCreateProvisioningFile)
include(mitkFunctionGetLibrarySearchPaths)
include(mitkFunctionGetVersion)
include(mitkFunctionGetVersionDescription)
include(mitkFunctionInstallAutoLoadModules)
include(mitkFunctionInstallCTKPlugin)
include(mitkFunctionInstallProvisioningFiles)
include(mitkFunctionInstallThirdPartyCTKPlugins)
include(mitkFunctionOrganizeSources)
include(mitkFunctionTestPlugin)
include(mitkFunctionUseModules)
if( ${MITK_USE_MatchPoint} )
include(mitkFunctionCreateMatchPointDeployedAlgorithm)
endif()
include(mitkMacroConfigureItkPixelTypes)
include(mitkMacroCreateExecutable)
include(mitkMacroCreateModuleTests)
include(mitkMacroGenerateToolsLibrary)
include(mitkMacroGetLinuxDistribution)
include(mitkMacroGetPMDPlatformString)
include(mitkMacroInstall)
include(mitkMacroInstallHelperApp)
include(mitkMacroInstallTargets)
include(mitkMacroMultiplexPicType)
# Deprecated
include(mitkMacroCreateCTKPlugin)
#-----------------------------------------------------------------------------
# Global CMake variables
#-----------------------------------------------------------------------------
# Required and enabled C++14 features for all MITK code.
# These are added as PUBLIC compile features to all MITK modules.
set(MITK_CXX_FEATURES
cxx_auto_type
cxx_decltype
cxx_enum_forward_declarations
cxx_extended_friend_declarations
cxx_extern_templates
cxx_final
cxx_lambdas
cxx_local_type_template_args
cxx_long_long_type
cxx_nullptr
cxx_override
cxx_range_for
cxx_right_angle_brackets
cxx_rvalue_references
cxx_static_assert
cxx_strong_enums
cxx_template_template_parameters
cxx_trailing_return_types
cxx_variadic_macros
)
if(NOT DEFINED CMAKE_DEBUG_POSTFIX)
# We can't do this yet because the CTK Plugin Framework
# cannot cope with a postfix yet.
#set(CMAKE_DEBUG_POSTFIX d)
endif()
#-----------------------------------------------------------------------------
# Output directories.
#-----------------------------------------------------------------------------
set(_default_LIBRARY_output_dir lib)
set(_default_RUNTIME_output_dir bin)
set(_default_ARCHIVE_output_dir lib)
foreach(type LIBRARY RUNTIME ARCHIVE)
# Make sure the directory exists
if(MITK_CMAKE_${type}_OUTPUT_DIRECTORY
AND NOT EXISTS ${MITK_CMAKE_${type}_OUTPUT_DIRECTORY})
message("Creating directory MITK_CMAKE_${type}_OUTPUT_DIRECTORY: ${MITK_CMAKE_${type}_OUTPUT_DIRECTORY}")
file(MAKE_DIRECTORY "${MITK_CMAKE_${type}_OUTPUT_DIRECTORY}")
endif()
if(MITK_CMAKE_${type}_OUTPUT_DIRECTORY)
set(CMAKE_${type}_OUTPUT_DIRECTORY ${MITK_CMAKE_${type}_OUTPUT_DIRECTORY})
else()
set(CMAKE_${type}_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${_default_${type}_output_dir})
set(MITK_CMAKE_${type}_OUTPUT_DIRECTORY ${CMAKE_${type}_OUTPUT_DIRECTORY})
endif()
set(CMAKE_${type}_OUTPUT_DIRECTORY ${CMAKE_${type}_OUTPUT_DIRECTORY} CACHE INTERNAL "Output directory for ${type} files.")
mark_as_advanced(CMAKE_${type}_OUTPUT_DIRECTORY)
endforeach()
#-----------------------------------------------------------------------------
# Set MITK specific options and variables (NOT available during superbuild)
#-----------------------------------------------------------------------------
# Look for optional Doxygen package
find_package(Doxygen)
option(BLUEBERRY_DEBUG_SMARTPOINTER "Enable code for debugging smart pointers" OFF)
mark_as_advanced(BLUEBERRY_DEBUG_SMARTPOINTER)
# ASK THE USER TO SHOW THE CONSOLE WINDOW FOR CoreApp and mitkWorkbench
option(MITK_SHOW_CONSOLE_WINDOW "Use this to enable or disable the console window when starting MITK GUI Applications" ON)
mark_as_advanced(MITK_SHOW_CONSOLE_WINDOW)
# TODO: check if necessary
option(USE_ITKZLIB "Use the ITK zlib for pic compression." ON)
mark_as_advanced(USE_ITKZLIB)
if(NOT MITK_FAST_TESTING)
if(DEFINED MITK_CTEST_SCRIPT_MODE
AND (MITK_CTEST_SCRIPT_MODE STREQUAL "continuous" OR MITK_CTEST_SCRIPT_MODE STREQUAL "experimental") )
set(MITK_FAST_TESTING ON)
endif()
endif()
if(NOT UNIX)
set(MITK_WIN32_FORCE_STATIC "STATIC" CACHE INTERNAL "Use this variable to always build static libraries on non-unix platforms")
endif()
if(MITK_BUILD_ALL_PLUGINS)
set(MITK_BUILD_ALL_PLUGINS_OPTION "FORCE_BUILD_ALL")
endif()
# Configure pixel types used for ITK image access multiplexing
mitkMacroConfigureItkPixelTypes()
# Configure module naming conventions
set(MITK_MODULE_NAME_REGEX_MATCH "^[A-Z].*$")
set(MITK_MODULE_NAME_REGEX_NOT_MATCH "^[Mm][Ii][Tt][Kk].*$")
set(MITK_DEFAULT_MODULE_NAME_PREFIX "Mitk")
set(MITK_MODULE_NAME_PREFIX ${MITK_DEFAULT_MODULE_NAME_PREFIX})
set(MITK_MODULE_NAME_DEFAULTS_TO_DIRECTORY_NAME 1)
#-----------------------------------------------------------------------------
# Get MITK version info
#-----------------------------------------------------------------------------
mitkFunctionGetVersion(${MITK_SOURCE_DIR} MITK)
mitkFunctionGetVersionDescription(${MITK_SOURCE_DIR} MITK)
# MITK_VERSION
set(MITK_VERSION_STRING "${MITK_VERSION_MAJOR}.${MITK_VERSION_MINOR}.${MITK_VERSION_PATCH}")
if(MITK_VERSION_PATCH STREQUAL "99")
set(MITK_VERSION_STRING "${MITK_VERSION_STRING}-${MITK_REVISION_SHORTID}")
endif()
#-----------------------------------------------------------------------------
# Installation preparation
#
# These should be set before any MITK install macros are used
#-----------------------------------------------------------------------------
# on macOS all BlueBerry plugins get copied into every
# application bundle (.app directory) specified here
if(MITK_USE_BLUEBERRY AND APPLE)
foreach(MITK_EXTENSION_DIR ${MITK_DIR_PLUS_EXTENSION_DIRS})
set(MITK_APPLICATIONS_EXTENSION_DIR ${MITK_EXTENSION_DIR}/Applications)
get_filename_component(MITK_APPLICATIONS_EXTENSION_DIR ${MITK_APPLICATIONS_EXTENSION_DIR} ABSOLUTE)
if(EXISTS ${MITK_APPLICATIONS_EXTENSION_DIR}/AppList.cmake)
set(MITK_APPS "")
include(${MITK_APPLICATIONS_EXTENSION_DIR}/AppList.cmake)
foreach(mitk_app ${MITK_APPS})
# extract option_name
string(REPLACE "^^" "\\;" target_info ${mitk_app})
set(target_info_list ${target_info})
list(GET target_info_list 1 option_name)
list(GET target_info_list 0 app_name)
# check if the application is enabled
if(${option_name} OR MITK_BUILD_ALL_APPS)
set(MACOSX_BUNDLE_NAMES ${MACOSX_BUNDLE_NAMES} Mitk${app_name})
endif()
endforeach()
endif()
endforeach()
endif()
#-----------------------------------------------------------------------------
# Set coverage Flags
#-----------------------------------------------------------------------------
if(WITH_COVERAGE)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(coverage_flags "-g -fprofile-arcs -ftest-coverage -O0 -DNDEBUG")
set(COVERAGE_CXX_FLAGS ${coverage_flags})
set(COVERAGE_C_FLAGS ${coverage_flags})
endif()
endif()
#-----------------------------------------------------------------------------
# MITK C/CXX Flags
#-----------------------------------------------------------------------------
set(MITK_C_FLAGS "${COVERAGE_C_FLAGS}")
set(MITK_C_FLAGS_DEBUG )
set(MITK_C_FLAGS_RELEASE )
set(MITK_CXX_FLAGS "${COVERAGE_CXX_FLAGS} ${MITK_CXX14_FLAG}")
set(MITK_CXX_FLAGS_DEBUG )
set(MITK_CXX_FLAGS_RELEASE )
set(MITK_EXE_LINKER_FLAGS )
set(MITK_SHARED_LINKER_FLAGS )
if(WIN32)
set(MITK_CXX_FLAGS "${MITK_CXX_FLAGS} -DPOCO_NO_UNWINDOWS -DWIN32_LEAN_AND_MEAN -DNOMINMAX")
mitkFunctionCheckCompilerFlags("/wd4005" MITK_CXX_FLAGS) # warning C4005: macro redefinition
mitkFunctionCheckCompilerFlags("/wd4231" MITK_CXX_FLAGS) # warning C4231: nonstandard extension used : 'extern' before template explicit instantiation
# the following line should be removed after fixing bug 17637
mitkFunctionCheckCompilerFlags("/wd4316" MITK_CXX_FLAGS) # warning C4316: object alignment on heap
mitkFunctionCheckCompilerFlags("/wd4180" MITK_CXX_FLAGS) # warning C4180: qualifier applied to function type has no meaning
mitkFunctionCheckCompilerFlags("/wd4251" MITK_CXX_FLAGS) # warning C4251: 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
endif()
if(APPLE)
set(MITK_CXX_FLAGS "${MITK_CXX_FLAGS} -DGL_SILENCE_DEPRECATION") # Apple deprecated OpenGL in macOS 10.14
endif()
if(NOT MSVC_VERSION)
foreach(_flag
-Wall
-Wextra
-Wpointer-arith
-Winvalid-pch
-Wcast-align
-Wwrite-strings
-Wno-error=gnu
-Wno-error=unknown-pragmas
# The strict-overflow warning is generated by ITK template code
-Wno-error=strict-overflow
-Woverloaded-virtual
-Wstrict-null-sentinel
#-Wold-style-cast
#-Wsign-promo
-Wno-error=deprecated-copy
-Wno-array-bounds
-fdiagnostics-show-option
)
mitkFunctionCheckCAndCXXCompilerFlags(${_flag} MITK_C_FLAGS MITK_CXX_FLAGS)
endforeach()
endif()
if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE)
mitkFunctionCheckCompilerFlags("-Wl,--no-undefined" MITK_SHARED_LINKER_FLAGS)
mitkFunctionCheckCompilerFlags("-Wl,--as-needed" MITK_SHARED_LINKER_FLAGS)
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
mitkFunctionCheckCAndCXXCompilerFlags("-fstack-protector-all" MITK_C_FLAGS MITK_CXX_FLAGS)
set(MITK_CXX_FLAGS_RELEASE "-U_FORTIFY_SOURCES -D_FORTIFY_SOURCE=2 ${MITK_CXX_FLAGS_RELEASE}")
endif()
set(MITK_MODULE_LINKER_FLAGS ${MITK_SHARED_LINKER_FLAGS})
set(MITK_EXE_LINKER_FLAGS ${MITK_SHARED_LINKER_FLAGS})
#-----------------------------------------------------------------------------
# MITK Packages
#-----------------------------------------------------------------------------
set(MITK_MODULES_PACKAGE_DEPENDS_DIR ${MITK_SOURCE_DIR}/CMake/PackageDepends)
set(MODULES_PACKAGE_DEPENDS_DIRS ${MITK_MODULES_PACKAGE_DEPENDS_DIR})
foreach(MITK_EXTENSION_DIR ${MITK_EXTENSION_DIRS})
set(MITK_PACKAGE_DEPENDS_EXTENSION_DIR ${MITK_EXTENSION_DIR}/CMake/PackageDepends)
get_filename_component(MITK_PACKAGE_DEPENDS_EXTENSION_DIR ${MITK_PACKAGE_DEPENDS_EXTENSION_DIR} ABSOLUTE)
if(EXISTS ${MITK_PACKAGE_DEPENDS_EXTENSION_DIR})
list(APPEND MODULES_PACKAGE_DEPENDS_DIRS ${MITK_PACKAGE_DEPENDS_EXTENSION_DIR})
endif()
endforeach()
if(NOT MITK_USE_SYSTEM_Boost)
set(Boost_NO_SYSTEM_PATHS 1)
endif()
set(Boost_USE_MULTITHREADED 1)
set(Boost_USE_STATIC_LIBS 0)
set(Boost_USE_STATIC_RUNTIME 0)
set(Boost_ADDITIONAL_VERSIONS 1.68 1.68.0)
# We need this later for a DCMTK workaround
set(_dcmtk_dir_orig ${DCMTK_DIR})
# This property is populated at the top half of this file
get_property(MITK_EXTERNAL_PROJECTS GLOBAL PROPERTY MITK_EXTERNAL_PROJECTS)
foreach(ep ${MITK_EXTERNAL_PROJECTS})
get_property(_package GLOBAL PROPERTY MITK_${ep}_PACKAGE)
get_property(_components GLOBAL PROPERTY MITK_${ep}_COMPONENTS)
if(MITK_USE_${ep} AND _package)
if(_components)
find_package(${_package} COMPONENTS ${_components} REQUIRED CONFIG)
else()
# Prefer config mode first because it finds external
# <proj>Config.cmake files pointed at by <proj>_DIR variables.
# Otherwise, existing Find<proj>.cmake files could fail.
if(DEFINED ${_package}_DIR)
#we store the information because it will be overwritten by find_package
#and would get lost for all EPs that use on Find<proj>.cmake instead of config
#files.
set(_temp_EP_${_package}_dir ${${_package}_DIR})
endif(DEFINED ${_package}_DIR)
find_package(${_package} QUIET CONFIG)
string(TOUPPER "${_package}" _package_uc)
if(NOT (${_package}_FOUND OR ${_package_uc}_FOUND))
if(DEFINED _temp_EP_${_package}_dir)
set(${_package}_DIR ${_temp_EP_${_package}_dir} CACHE PATH "externaly set dir of the package ${_package}" FORCE)
endif(DEFINED _temp_EP_${_package}_dir)
find_package(${_package} REQUIRED)
endif()
endif()
endif()
endforeach()
# Ensure that the MITK CMake module path comes first
set(CMAKE_MODULE_PATH
${MITK_CMAKE_DIR}
${CMAKE_MODULE_PATH}
)
if(MITK_USE_DCMTK)
# Due to the preferred CONFIG mode in find_package calls above,
# the DCMTKConfig.cmake file is read, which does not provide useful
# package information. We explictly need MODULE mode to find DCMTK.
if(${_dcmtk_dir_orig} MATCHES "${MITK_EXTERNAL_PROJECT_PREFIX}.*")
# Help our FindDCMTK.cmake script find our super-build DCMTK
set(DCMTK_DIR ${MITK_EXTERNAL_PROJECT_PREFIX})
else()
# Use the original value
set(DCMTK_DIR ${_dcmtk_dir_orig})
endif()
find_package(DCMTK REQUIRED MODULE)
endif()
if(MITK_USE_DCMQI)
# Due to the preferred CONFIG mode in find_package calls above,
# the DCMQIConfig.cmake file is read, which does not provide useful
# package information. We explictly need MODULE mode to find DCMQI.
# Help our FindDCMQI.cmake script find our super-build DCMQI
set(DCMQI_DIR ${MITK_EXTERNAL_PROJECT_PREFIX})
find_package(DCMQI REQUIRED)
endif()
link_directories(${Boost_LIBRARY_DIRS})
if(MITK_USE_OpenIGTLink)
link_directories(${OpenIGTLink_LIBRARY_DIRS})
endif()
if(MITK_USE_OpenCL)
find_package(OpenCL REQUIRED)
endif()
if(MITK_USE_OpenMP)
find_package(OpenMP REQUIRED COMPONENTS CXX)
else()
find_package(OpenMP QUIET COMPONENTS CXX)
if(OpenMP_FOUND)
set(MITK_USE_OpenMP ON CACHE BOOL "" FORCE)
elseif(APPLE AND OpenMP_libomp_LIBRARY AND NOT OpenMP_CXX_LIB_NAMES)
set(OpenMP_CXX_LIB_NAMES libomp CACHE STRING "" FORCE)
get_filename_component(openmp_lib_dir "${OpenMP_libomp_LIBRARY}" DIRECTORY)
set(openmp_include_dir "${openmp_lib_dir}/../include")
if(EXISTS "${openmp_include_dir}")
get_filename_component(openmp_include_dir "${openmp_include_dir}" REALPATH)
set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp -I${openmp_include_dir}" CACHE STRING "" FORCE)
find_package(OpenMP QUIET COMPONENTS CXX)
if(OpenMP_FOUND)
set(MITK_USE_OpenMP ON CACHE BOOL "" FORCE)
endif()
endif()
endif()
endif()
# Qt support
if(MITK_USE_Qt5)
find_package(Qt5Core ${MITK_QT5_MINIMUM_VERSION} REQUIRED) # at least Core required
get_target_property(_qmake_exec Qt5::qmake LOCATION)
execute_process(COMMAND ${_qmake_exec} -query QT_INSTALL_BINS
RESULT_VARIABLE _result
OUTPUT_VARIABLE QT_BINARY_DIR
ERROR_VARIABLE _error
)
string(STRIP "${QT_BINARY_DIR}" QT_BINARY_DIR)
if(_result OR NOT EXISTS "${QT_BINARY_DIR}")
message(FATAL_ERROR "Could not determine Qt binary directory: ${_result} ${QT_BINARY_DIR} ${_error}")
endif()
find_program(QT_HELPGENERATOR_EXECUTABLE
NAMES qhelpgenerator qhelpgenerator-qt5 qhelpgenerator5
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
find_program(QT_COLLECTIONGENERATOR_EXECUTABLE
NAMES qcollectiongenerator qcollectiongenerator-qt5 qcollectiongenerator5
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
find_program(QT_ASSISTANT_EXECUTABLE
NAMES assistant assistant-qt5 assistant5
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
find_program(QT_XMLPATTERNS_EXECUTABLE
NAMES xmlpatterns
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
mark_as_advanced(QT_HELPGENERATOR_EXECUTABLE
QT_COLLECTIONGENERATOR_EXECUTABLE
QT_ASSISTANT_EXECUTABLE
QT_XMLPATTERNS_EXECUTABLE
)
if(MITK_USE_BLUEBERRY)
option(BLUEBERRY_USE_QT_HELP "Enable support for integrating plugin documentation into Qt Help" ${DOXYGEN_FOUND})
mark_as_advanced(BLUEBERRY_USE_QT_HELP)
# Sanity checks for in-application BlueBerry plug-in help generation
if(BLUEBERRY_USE_QT_HELP)
set(_force_blueberry_use_qt_help_to_off 0)
if(NOT DOXYGEN_FOUND)
message("> Forcing BLUEBERRY_USE_QT_HELP to OFF because Doxygen was not found.")
set(_force_blueberry_use_qt_help_to_off 1)
endif()
if(DOXYGEN_FOUND AND DOXYGEN_VERSION VERSION_LESS 1.8.7)
message("> Forcing BLUEBERRY_USE_QT_HELP to OFF because Doxygen version 1.8.7 or newer not found.")
set(_force_blueberry_use_qt_help_to_off 1)
endif()
if(NOT QT_HELPGENERATOR_EXECUTABLE)
message("> Forcing BLUEBERRY_USE_QT_HELP to OFF because QT_HELPGENERATOR_EXECUTABLE is empty.")
set(_force_blueberry_use_qt_help_to_off 1)
endif()
if(NOT MITK_USE_Qt5)
message("> Forcing BLUEBERRY_USE_QT_HELP to OFF because MITK_USE_Qt5 is OFF.")
set(_force_blueberry_use_qt_help_to_off 1)
endif()
if(NOT QT_XMLPATTERNS_EXECUTABLE)
message("You have enabled Qt Help support, but QT_XMLPATTERNS_EXECUTABLE is empty")
set(_force_blueberry_use_qt_help_to_off 1)
endif()
if(_force_blueberry_use_qt_help_to_off)
set(BLUEBERRY_USE_QT_HELP OFF CACHE BOOL "Enable support for integrating plugin documentation into Qt Help" FORCE)
endif()
endif()
if(BLUEBERRY_QT_HELP_REQUIRED AND NOT BLUEBERRY_USE_QT_HELP)
message(FATAL_ERROR "BLUEBERRY_USE_QT_HELP is required to be set to ON")
endif()
endif()
endif()
#-----------------------------------------------------------------------------
# Testing
#-----------------------------------------------------------------------------
if(BUILD_TESTING)
enable_testing()
include(CTest)
mark_as_advanced(TCL_TCLSH DART_ROOT)
- option(MITK_ENABLE_RENDERING_TESTING OFF "Enable the MITK rendering tests. Requires x-server in Linux.")
- #Rendering testing does not work for Linux nightlies, thus it is disabled per default
- #and activated for Mac and Windows.
- if(WIN32 OR APPLE)
- set(MITK_ENABLE_RENDERING_TESTING ON)
- endif()
- mark_as_advanced( MITK_ENABLE_RENDERING_TESTING )
-
# Setup file for setting custom ctest vars
configure_file(
CMake/CTestCustom.cmake.in
${MITK_BINARY_DIR}/CTestCustom.cmake
@ONLY
)
# Initial cache for ProjectTemplate and PluginGenerator tests
configure_file(
CMake/mitkTestInitialCache.txt.in
${MITK_BINARY_DIR}/mitkTestInitialCache.txt
@ONLY
)
# Configuration for the CMake-generated test driver
set(CMAKE_TESTDRIVER_EXTRA_INCLUDES "#include <stdexcept>")
set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "
try
{")
set(CMAKE_TESTDRIVER_AFTER_TESTMAIN " }
catch ( const std::exception & excp )
{
fprintf(stderr,\"%s\\n\",excp.what());
return EXIT_FAILURE;
}
catch( ... )
{
printf(\"Exception caught in the test driver\\n\");
return EXIT_FAILURE;
}
")
set(MITK_TEST_OUTPUT_DIR "${MITK_BINARY_DIR}/test_output")
if(NOT EXISTS ${MITK_TEST_OUTPUT_DIR})
file(MAKE_DIRECTORY ${MITK_TEST_OUTPUT_DIR})
endif()
# Test the package target
include(mitkPackageTest)
endif()
configure_file(mitkTestingConfig.h.in ${MITK_BINARY_DIR}/mitkTestingConfig.h)
#-----------------------------------------------------------------------------
# MITK_SUPERBUILD_BINARY_DIR
#-----------------------------------------------------------------------------
# If MITK_SUPERBUILD_BINARY_DIR isn't defined, it means MITK is *NOT* build using Superbuild.
# In that specific case, MITK_SUPERBUILD_BINARY_DIR should default to MITK_BINARY_DIR
if(NOT DEFINED MITK_SUPERBUILD_BINARY_DIR)
set(MITK_SUPERBUILD_BINARY_DIR ${MITK_BINARY_DIR})
endif()
#-----------------------------------------------------------------------------
# Set C/CXX and linker flags for MITK code
#-----------------------------------------------------------------------------
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MITK_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${MITK_CXX_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${MITK_CXX_FLAGS_RELEASE}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MITK_C_FLAGS}")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${MITK_C_FLAGS_DEBUG}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${MITK_C_FLAGS_RELEASE}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MITK_EXE_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${MITK_SHARED_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${MITK_MODULE_LINKER_FLAGS}")
#-----------------------------------------------------------------------------
# Add custom targets representing CDash subprojects
#-----------------------------------------------------------------------------
foreach(subproject ${CTEST_PROJECT_SUBPROJECTS})
if(NOT TARGET ${subproject} AND NOT subproject MATCHES "Unlabeled")
add_custom_target(${subproject})
set_property(TARGET ${subproject} PROPERTY FOLDER "${MITK_ROOT_FOLDER}/CTestSubprojects")
endif()
endforeach()
#-----------------------------------------------------------------------------
# Add subdirectories
#-----------------------------------------------------------------------------
add_subdirectory(Utilities)
add_subdirectory(Modules)
include("${CMAKE_CURRENT_SOURCE_DIR}/Modules/ModuleList.cmake")
mitkFunctionWhitelistModules(MITK MITK_MODULES)
set(MITK_ROOT_FOLDER_BACKUP "${MITK_ROOT_FOLDER}")
foreach(MITK_EXTENSION_DIR ${MITK_EXTENSION_DIRS})
get_filename_component(MITK_ROOT_FOLDER ${MITK_EXTENSION_DIR} NAME)
set(MITK_MODULES_EXTENSION_DIR ${MITK_EXTENSION_DIR}/Modules)
get_filename_component(MITK_MODULES_EXTENSION_DIR ${MITK_MODULES_EXTENSION_DIR} ABSOLUTE)
if(EXISTS ${MITK_MODULES_EXTENSION_DIR}/ModuleList.cmake)
set(MITK_MODULES "")
include(${MITK_MODULES_EXTENSION_DIR}/ModuleList.cmake)
foreach(mitk_module ${MITK_MODULES})
add_subdirectory(${MITK_MODULES_EXTENSION_DIR}/${mitk_module} Modules/${mitk_module})
endforeach()
endif()
set(MITK_MODULE_NAME_PREFIX ${MITK_DEFAULT_MODULE_NAME_PREFIX})
endforeach()
set(MITK_ROOT_FOLDER "${MITK_ROOT_FOLDER_BACKUP}")
add_subdirectory(Wrapping)
if(MITK_USE_BLUEBERRY)
- set(BLUEBERRY_XPDOC_OUTPUT_DIR ${MITK_DOXYGEN_OUTPUT_DIR}/html/extension-points/html/)
+ set(BLUEBERRY_XPDOC_OUTPUT_DIR "${MITK_DOXYGEN_OUTPUT_DIR}/html/extension-points/html/")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${BLUEBERRY_XPDOC_OUTPUT_DIR})
# Plug-in testing (needs some work to be enabled again)
if(BUILD_TESTING)
set(BLUEBERRY_UI_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreApp")
if(TARGET CoreApp)
get_target_property(_is_macosx_bundle CoreApp MACOSX_BUNDLE)
if(APPLE AND _is_macosx_bundle)
set(BLUEBERRY_UI_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreApp.app/Contents/MacOS/CoreApp")
endif()
endif()
set(BLUEBERRY_TEST_APP_ID "org.mitk.qt.coreapplication")
endif()
include("${CMAKE_CURRENT_SOURCE_DIR}/Plugins/PluginList.cmake")
mitkFunctionWhitelistPlugins(MITK MITK_PLUGINS)
set(mitk_plugins_fullpath "")
foreach(mitk_plugin ${MITK_PLUGINS})
list(APPEND mitk_plugins_fullpath Plugins/${mitk_plugin})
endforeach()
set(MITK_PLUGIN_REGEX_LIST "")
foreach(MITK_EXTENSION_DIR ${MITK_EXTENSION_DIRS})
set(MITK_PLUGINS_EXTENSION_DIR ${MITK_EXTENSION_DIR}/Plugins)
get_filename_component(MITK_PLUGINS_EXTENSION_DIR ${MITK_PLUGINS_EXTENSION_DIR} ABSOLUTE)
if(EXISTS ${MITK_PLUGINS_EXTENSION_DIR}/PluginList.cmake)
set(MITK_PLUGINS "")
include(${MITK_PLUGINS_EXTENSION_DIR}/PluginList.cmake)
foreach(mitk_plugin ${MITK_PLUGINS})
list(APPEND mitk_plugins_fullpath ${MITK_PLUGINS_EXTENSION_DIR}/${mitk_plugin})
endforeach()
endif()
endforeach()
if(EXISTS ${MITK_PRIVATE_MODULES}/PluginList.cmake)
include(${MITK_PRIVATE_MODULES}/PluginList.cmake)
foreach(mitk_plugin ${MITK_PRIVATE_PLUGINS})
list(APPEND mitk_plugins_fullpath ${MITK_PRIVATE_MODULES}/${mitk_plugin})
endforeach()
endif()
if(MITK_BUILD_EXAMPLES)
include("${CMAKE_CURRENT_SOURCE_DIR}/Examples/Plugins/PluginList.cmake")
set(mitk_example_plugins_fullpath )
foreach(mitk_example_plugin ${MITK_EXAMPLE_PLUGINS})
list(APPEND mitk_example_plugins_fullpath Examples/Plugins/${mitk_example_plugin})
list(APPEND mitk_plugins_fullpath Examples/Plugins/${mitk_example_plugin})
endforeach()
endif()
# Specify which plug-ins belong to this project
macro(GetMyTargetLibraries all_target_libraries varname)
set(re_ctkplugin_mitk "^org_mitk_[a-zA-Z0-9_]+$")
set(re_ctkplugin_bb "^org_blueberry_[a-zA-Z0-9_]+$")
set(_tmp_list)
list(APPEND _tmp_list ${all_target_libraries})
ctkMacroListFilter(_tmp_list re_ctkplugin_mitk re_ctkplugin_bb MITK_PLUGIN_REGEX_LIST OUTPUT_VARIABLE ${varname})
endmacro()
# Get infos about application directories and build options
set(mitk_apps_fullpath "")
foreach(MITK_EXTENSION_DIR ${MITK_DIR_PLUS_EXTENSION_DIRS})
set(MITK_APPLICATIONS_EXTENSION_DIR ${MITK_EXTENSION_DIR}/Applications)
get_filename_component(MITK_APPLICATIONS_EXTENSION_DIR ${MITK_APPLICATIONS_EXTENSION_DIR} ABSOLUTE)
if(EXISTS ${MITK_APPLICATIONS_EXTENSION_DIR}/AppList.cmake)
set(MITK_APPS "")
include(${MITK_APPLICATIONS_EXTENSION_DIR}/AppList.cmake)
foreach(mitk_app ${MITK_APPS})
# extract option_name
string(REPLACE "^^" "\\;" target_info ${mitk_app})
set(target_info_list ${target_info})
list(GET target_info_list 0 directory_name)
list(GET target_info_list 1 option_name)
if(${option_name})
list(APPEND mitk_apps_fullpath "${MITK_APPLICATIONS_EXTENSION_DIR}/${directory_name}^^${option_name}")
endif()
endforeach()
endif()
endforeach()
if (mitk_plugins_fullpath)
ctkMacroSetupPlugins(${mitk_plugins_fullpath}
BUILD_OPTION_PREFIX MITK_BUILD_
APPS ${mitk_apps_fullpath}
BUILD_ALL ${MITK_BUILD_ALL_PLUGINS}
COMPACT_OPTIONS)
endif()
set(MITK_PLUGIN_USE_FILE "${MITK_BINARY_DIR}/MitkPluginUseFile.cmake")
if(${PROJECT_NAME}_PLUGIN_LIBRARIES)
ctkFunctionGeneratePluginUseFile(${MITK_PLUGIN_USE_FILE})
else()
file(REMOVE ${MITK_PLUGIN_USE_FILE})
set(MITK_PLUGIN_USE_FILE )
endif()
endif()
#-----------------------------------------------------------------------------
# Documentation
#-----------------------------------------------------------------------------
if(DOXYGEN_FOUND)
add_subdirectory(Documentation)
endif()
#-----------------------------------------------------------------------------
# Installation
#-----------------------------------------------------------------------------
# set MITK cpack variables
# These are the default variables, which can be overwritten ( see below )
include(mitkSetupCPack)
set(use_default_config ON)
set(ALL_MITK_APPS "")
set(activated_apps_no 0)
foreach(MITK_EXTENSION_DIR ${MITK_DIR_PLUS_EXTENSION_DIRS})
set(MITK_APPLICATIONS_EXTENSION_DIR ${MITK_EXTENSION_DIR}/Applications)
get_filename_component(MITK_APPLICATIONS_EXTENSION_DIR ${MITK_APPLICATIONS_EXTENSION_DIR} ABSOLUTE)
if(EXISTS ${MITK_APPLICATIONS_EXTENSION_DIR}/AppList.cmake)
set(MITK_APPS "")
include(${MITK_APPLICATIONS_EXTENSION_DIR}/AppList.cmake)
foreach(mitk_app ${MITK_APPS})
string(REPLACE "^^" "\\;" target_info ${mitk_app})
set(target_info_list ${target_info})
list(GET target_info_list 0 directory_name)
list(GET target_info_list 1 option_name)
list(GET target_info_list 2 executable_name)
list(APPEND ALL_MITK_APPS "${MITK_EXTENSION_DIR}/Applications/${directory_name}^^${option_name}^^${executable_name}")
if(${option_name} OR MITK_BUILD_ALL_APPS)
MATH(EXPR activated_apps_no "${activated_apps_no} + 1")
endif()
endforeach()
endif()
endforeach()
list(LENGTH ALL_MITK_APPS app_count)
if(app_count EQUAL 1 AND (activated_apps_no EQUAL 1 OR MITK_BUILD_ALL_APPS))
# Corner case if there is only one app in total
set(use_project_cpack ON)
elseif(activated_apps_no EQUAL 1 AND NOT MITK_BUILD_ALL_APPS)
# Only one app is enabled (no "build all" flag set)
set(use_project_cpack ON)
else()
# Less or more then one app is enabled
set(use_project_cpack OFF)
endif()
foreach(mitk_app ${ALL_MITK_APPS})
# extract target_dir and option_name
string(REPLACE "^^" "\\;" target_info ${mitk_app})
set(target_info_list ${target_info})
list(GET target_info_list 0 target_dir)
list(GET target_info_list 1 option_name)
list(GET target_info_list 2 executable_name)
# check if the application is enabled
if(${option_name} OR MITK_BUILD_ALL_APPS)
# check whether application specific configuration files will be used
if(use_project_cpack)
# use files if they exist
if(EXISTS "${target_dir}/CPackOptions.cmake")
include("${target_dir}/CPackOptions.cmake")
endif()
if(EXISTS "${target_dir}/CPackConfig.cmake.in")
set(CPACK_PROJECT_CONFIG_FILE "${target_dir}/CPackConfig.cmake")
configure_file(${target_dir}/CPackConfig.cmake.in
${CPACK_PROJECT_CONFIG_FILE} @ONLY)
set(use_default_config OFF)
endif()
endif()
# add link to the list
list(APPEND CPACK_CREATE_DESKTOP_LINKS "${executable_name}")
endif()
endforeach()
# if no application specific configuration file was used, use default
if(use_default_config)
configure_file(${MITK_SOURCE_DIR}/MITKCPackOptions.cmake.in
${MITK_BINARY_DIR}/MITKCPackOptions.cmake @ONLY)
set(CPACK_PROJECT_CONFIG_FILE "${MITK_BINARY_DIR}/MITKCPackOptions.cmake")
endif()
# include CPack model once all variables are set
include(CPack)
# Additional installation rules
include(mitkInstallRules)
#-----------------------------------------------------------------------------
# Last configuration steps
#-----------------------------------------------------------------------------
# ---------------- Export targets -----------------
set(MITK_EXPORTS_FILE "${MITK_BINARY_DIR}/MitkExports.cmake")
file(REMOVE ${MITK_EXPORTS_FILE})
set(targets_to_export)
get_property(module_targets GLOBAL PROPERTY MITK_MODULE_TARGETS)
if(module_targets)
list(APPEND targets_to_export ${module_targets})
endif()
if(MITK_USE_BLUEBERRY)
if(MITK_PLUGIN_LIBRARIES)
list(APPEND targets_to_export ${MITK_PLUGIN_LIBRARIES})
endif()
endif()
export(TARGETS ${targets_to_export} APPEND
FILE ${MITK_EXPORTS_FILE})
set(MITK_EXPORTED_TARGET_PROPERTIES )
foreach(target_to_export ${targets_to_export})
get_target_property(autoload_targets ${target_to_export} MITK_AUTOLOAD_TARGETS)
if(autoload_targets)
set(MITK_EXPORTED_TARGET_PROPERTIES "${MITK_EXPORTED_TARGET_PROPERTIES}
set_target_properties(${target_to_export} PROPERTIES MITK_AUTOLOAD_TARGETS \"${autoload_targets}\")")
endif()
get_target_property(autoload_dir ${target_to_export} MITK_AUTOLOAD_DIRECTORY)
if(autoload_dir)
set(MITK_EXPORTED_TARGET_PROPERTIES "${MITK_EXPORTED_TARGET_PROPERTIES}
set_target_properties(${target_to_export} PROPERTIES MITK_AUTOLOAD_DIRECTORY \"${autoload_dir}\")")
endif()
get_target_property(deprecated_module ${target_to_export} MITK_MODULE_DEPRECATED_SINCE)
if(deprecated_module)
set(MITK_EXPORTED_TARGET_PROPERTIES "${MITK_EXPORTED_TARGET_PROPERTIES}
set_target_properties(${target_to_export} PROPERTIES MITK_MODULE_DEPRECATED_SINCE \"${deprecated_module}\")")
endif()
endforeach()
# ---------------- External projects -----------------
get_property(MITK_ADDITIONAL_LIBRARY_SEARCH_PATHS_CONFIG GLOBAL PROPERTY MITK_ADDITIONAL_LIBRARY_SEARCH_PATHS)
set(MITK_CONFIG_EXTERNAL_PROJECTS )
#string(REPLACE "^^" ";" _mitk_external_projects ${MITK_EXTERNAL_PROJECTS})
foreach(ep ${MITK_EXTERNAL_PROJECTS})
get_property(_components GLOBAL PROPERTY MITK_${ep}_COMPONENTS)
set(MITK_CONFIG_EXTERNAL_PROJECTS "${MITK_CONFIG_EXTERNAL_PROJECTS}
set(MITK_USE_${ep} ${MITK_USE_${ep}})
set(MITK_${ep}_DIR \"${${ep}_DIR}\")
set(MITK_${ep}_COMPONENTS ${_components})
")
endforeach()
foreach(ep ${MITK_EXTERNAL_PROJECTS})
get_property(_package GLOBAL PROPERTY MITK_${ep}_PACKAGE)
get_property(_components GLOBAL PROPERTY MITK_${ep}_COMPONENTS)
if(_components)
set(_components_arg COMPONENTS \${_components})
else()
set(_components_arg)
endif()
if(_package)
set(MITK_CONFIG_EXTERNAL_PROJECTS "${MITK_CONFIG_EXTERNAL_PROJECTS}
if(MITK_USE_${ep})
set(${ep}_DIR \${MITK_${ep}_DIR})
if(MITK_${ep}_COMPONENTS)
mitkMacroFindDependency(${_package} COMPONENTS \${MITK_${ep}_COMPONENTS})
else()
mitkMacroFindDependency(${_package})
endif()
endif()")
endif()
endforeach()
# ---------------- Tools -----------------
configure_file(${MITK_SOURCE_DIR}/CMake/ToolExtensionITKFactory.cpp.in
${MITK_BINARY_DIR}/ToolExtensionITKFactory.cpp.in COPYONLY)
configure_file(${MITK_SOURCE_DIR}/CMake/ToolExtensionITKFactoryLoader.cpp.in
${MITK_BINARY_DIR}/ToolExtensionITKFactoryLoader.cpp.in COPYONLY)
configure_file(${MITK_SOURCE_DIR}/CMake/ToolGUIExtensionITKFactory.cpp.in
${MITK_BINARY_DIR}/ToolGUIExtensionITKFactory.cpp.in COPYONLY)
# ---------------- Configure files -----------------
configure_file(mitkVersion.h.in ${MITK_BINARY_DIR}/mitkVersion.h)
configure_file(mitkConfig.h.in ${MITK_BINARY_DIR}/mitkConfig.h)
set(IPFUNC_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/ipFunc)
set(UTILITIES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities)
configure_file(mitkConfig.h.in ${MITK_BINARY_DIR}/mitkConfig.h)
configure_file(MITKConfig.cmake.in ${MITK_BINARY_DIR}/MITKConfig.cmake @ONLY)
write_basic_config_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${MITK_VERSION_STRING} COMPATIBILITY AnyNewerVersion)
#-----------------------------------------------------------------------------
# MITK Applications
#-----------------------------------------------------------------------------
# This must come after MITKConfig.h was generated, since applications
# might do a find_package(MITK REQUIRED).
add_subdirectory(Applications)
if(MSVC AND TARGET MitkWorkbench)
set_directory_properties(PROPERTIES VS_STARTUP_PROJECT MitkWorkbench)
endif()
foreach(MITK_EXTENSION_DIR ${MITK_EXTENSION_DIRS})
set(MITK_APPLICATIONS_EXTENSION_DIR ${MITK_EXTENSION_DIR}/Applications)
get_filename_component(MITK_APPLICATIONS_EXTENSION_DIR ${MITK_APPLICATIONS_EXTENSION_DIR} ABSOLUTE)
if(EXISTS ${MITK_APPLICATIONS_EXTENSION_DIR}/CMakeLists.txt)
add_subdirectory(${MITK_APPLICATIONS_EXTENSION_DIR} Applications)
endif()
endforeach()
#-----------------------------------------------------------------------------
# MITK Examples
#-----------------------------------------------------------------------------
if(MITK_BUILD_EXAMPLES)
# This must come after MITKConfig.h was generated, since applications
# might do a find_package(MITK REQUIRED).
add_subdirectory(Examples)
endif()
#-----------------------------------------------------------------------------
# Print configuration summary
#-----------------------------------------------------------------------------
message("\n\n")
feature_summary(
DESCRIPTION "------- FEATURE SUMMARY FOR ${PROJECT_NAME} -------"
WHAT ALL
)
diff --git a/Documentation/CMakeLists.txt b/Documentation/CMakeLists.txt
index a83ea3d273..c0f2041897 100644
--- a/Documentation/CMakeLists.txt
+++ b/Documentation/CMakeLists.txt
@@ -1,211 +1,224 @@
#
# Variables:
# MITK_DOXYGEN_OUTPUT_DIR: doxygen output directory (optional)
# Needed early on for redirecting the BlueBerry documentation output dir
set(MITK_DOXYGEN_OUTPUT_DIR ${PROJECT_BINARY_DIR}/Documentation/Doxygen CACHE PATH
"Output directory for doxygen generated documentation." )
# Compile source code snippets
add_subdirectory(Snippets)
# Different doxygen versions produce significantly different behaviour in the MITK documentation
# especially in regards to the MITK Qt assistant help files and markdown files.
# The HTML documentation is supposed to be build with Doxygen 1.8.7 or newer, the
# Qt assistant QCH files are supposed to be generated with Doxygen 1.8.7 or newer.
# So we check for 1.8.7 here and QCH generation support is checked in
# BlueBerry/CMakeLists.txt
set(supported_doxygen_version "1.8.7")
if(DOXYGEN_VERSION VERSION_LESS ${supported_doxygen_version})
MESSAGE(WARNING "Unsupported doxygen version ${DOXYGEN_VERSION}. The MITK HTML documentation has been tested to work with doxygen ${supported_doxygen_version} or newer.")
endif()
option(USE_DOT "Use dot program for generating graphical class diagrams with doxygen, if available" ON)
option(MITK_DOXYGEN_BUILD_ALWAYS "Always build the MITK documentation when building the default target" OFF)
option(MITK_DOXYGEN_GENERATE_QCH_FILES "Use doxygen to generate Qt compressed help files for MITK docs" OFF)
mark_as_advanced(USE_DOT MITK_DOXYGEN_BUILD_ALWAYS MITK_DOXYGEN_GENERATE_QCH_FILES)
if (MITK_DOXYGEN_GENERATE_QCH_FILES AND DOXYGEN_VERSION VERSION_LESS "1.8.7")
message(WARNING "> Forcing MITK_DOXYGEN_GENERATE_QCH_FILES to OFF because Doxygen version 1.8.7 or newer not found.")
set(MITK_DOXYGEN_GENERATE_QCH_FILES OFF CACHE BOOL "Use doxygen to generate Qt compressed help files for MITK docs" FORCE)
endif()
set(HAVE_DOT "NO")
if(DOXYGEN_DOT_EXECUTABLE AND USE_DOT)
set(HAVE_DOT "YES")
endif()
set(MITK_DOXYGEN_TAGFILE_NAME ${MITK_DOXYGEN_OUTPUT_DIR}/MITK.tag CACHE INTERNAL "MITK Doxygen tag file")
# This is relative to the working directory of the doxygen command
set(MITK_DOXYGEN_STYLESHEET mitk_doxygen_extra.css)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${MITK_DOXYGEN_STYLESHEET}
${CMAKE_CURRENT_BINARY_DIR}/${MITK_DOXYGEN_STYLESHEET} COPYONLY)
# Create QCH files for MITK and external projects
set(MITK_DOXYGEN_GENERATE_QHP "NO")
if(MITK_DOXYGEN_GENERATE_QCH_FILES)
find_program(QT_HELPGENERATOR_EXECUTABLE
NAMES qhelpgenerator qhelpgenerator-qt5 qhelpgenerator5
PATHS ${QT_BINARY_DIR}
DOC "The location of the the Qt help generator executable"
NO_DEFAULT_PATH
)
mark_as_advanced(QT_HELPGENERATOR_EXECUTABLE)
if(NOT QT_HELPGENERATOR_EXECUTABLE)
message(SEND_ERROR "The Qt help generator could not be found. Disabling qch generation")
else()
set(MITK_DOXYGEN_GENERATE_QHP "YES")
endif()
# The name of the generated MITK qch file, relative to the
# Doxygen HTML output folder
set(MITK_DOXYGEN_QCH_FILE "${MITK_BINARY_DIR}/MITK-${MITK_REVISION_ID}.qch")
# Generating ITK and VTK docs it not done yet
#option(MITK_DOXYGEN_GENERATE_VTK_QCH_FILE "Use doxygen to generate a Qt compressed help file for VTK docs" OFF)
#option(MITK_DOXYGEN_GENERATE_ITK_QCH_FILE "Use doxygen to generate a Qt compressed help file for ITK docs" OFF)
#mark_as_advanced(MITK_DOXYGEN_GENERATE_VTK_QCH_FILE MITK_DOXYGEN_GENERATE_ITK_QCH_FILE)
endif()
if(MITK_USE_BLUEBERRY)
file(RELATIVE_PATH _blueberry_doxygen_path ${MITK_DOXYGEN_OUTPUT_DIR}/html ${BLUEBERRY_DOXYGEN_OUTPUT_DIR}/html)
set(BLUEBERRY_DOXYGEN_TAGFILE "${BLUEBERRY_DOXYGEN_TAGFILE_NAME}=${_blueberry_doxygen_path}")
set(BLUEBERRY_DOXYGEN_LINK "<a class=\"el\" href=\"${_blueberry_doxygen_path}/index.html\">BlueBerry Documentation</a>")
set(MITK_XP_LINK "\\ref mitkExtPointsIndex")
configure_file(schema.css ${MITK_DOXYGEN_OUTPUT_DIR}/html/schema.css)
set(MITK_DOXYGEN_ENABLED_SECTIONS "${MITK_DOXYGEN_ENABLED_SECTIONS} BLUEBERRY")
endif(MITK_USE_BLUEBERRY)
# Compile a doxygen input filter for processing CMake scripts
include(mitkFunctionCMakeDoxygenFilterCompile)
mitkFunctionCMakeDoxygenFilterCompile(NAMESPACE "CMake")
# Configure some doxygen options
if(NOT MITK_DOXYGEN_INTERNAL_DOCS)
set(MITK_DOXYGEN_INTERNAL_DOCS "NO")
set(MITK_DOXYGEN_HIDE_FRIEND_COMPOUNDS "YES")
set(MITK_DOXYGEN_EXCLUDE_PATTERNS "*_p.* *Private.h */internal/*")
else()
set(MITK_DOXYGEN_HIDE_FRIEND_COMPOUNDS "NO")
set(MITK_DOXYGEN_EXCLUDE_PATTERNS "")
endif()
if(NOT MITK_DOXYGEN_GENERATE_TODOLIST)
set(MITK_DOXYGEN_GENERATE_TODOLIST "NO")
endif()
if(NOT MITK_DOXYGEN_GENERATE_BUGLIST)
set(MITK_DOXYGEN_GENERATE_BUGLIST "NO")
endif()
if(NOT MITK_DOXYGEN_HTML_DYNAMIC_SECTIONS)
set(MITK_DOXYGEN_HTML_DYNAMIC_SECTIONS "NO")
endif()
if(NOT MITK_DOXYGEN_UML_LOOK)
set(MITK_DOXYGEN_UML_LOOK "NO")
endif()
if(NOT MITK_DOXYGEN_GENERATE_DEPRECATEDLIST)
set(MITK_DOXYGEN_GENERATE_DEPRECATEDLIST "YES")
endif()
if(NOT DEFINED MITK_DOXYGEN_DOT_NUM_THREADS)
set(MITK_DOXYGEN_DOT_NUM_THREADS 0)
endif()
+if(NOT DEFINED US_PLATFORM)
+ if(UNIX)
+ if(APPLE)
+ set(US_PLATFORM "US_PLATFORM_APPLE=1")
+ else()
+ set(US_PLATFORM "US_PLATFORM_LINUX=1")
+ endif()
+ set(US_PLATFORM "${US_PLATFORM} \\\nUS_PLATFORM_POSIX=1")
+ else()
+ set(US_PLATFORM "US_PLATFORM_WINDOWS=1")
+ endif()
+endif()
+
# parse which plug-in documentation to activate
set(USERS_GUIDE_INPUT "${MITK_SOURCE_DIR}/Documentation/Doxygen/UserManual/")
if(MITK_USE_BLUEBERRY)
if(MITK_BUILD_ALL_PLUGINS)
set(USERS_GUIDE_INPUT "${USERS_GUIDE_INPUT} \\
${MITK_SOURCE_DIR}/Plugins/")
else()
foreach(mitk_plugin ${${CMAKE_PROJECT_NAME}_PLUGIN_LIBRARIES})
# we want each line to end in " \" and each directory be on a separate line
set(USERS_GUIDE_INPUT "${USERS_GUIDE_INPUT} \\
${${mitk_plugin}_SOURCE_DIR}/")
endforeach()
endif()
if(MITK_BUILD_EXAMPLES)
set(USERS_GUIDE_INPUT "${USERS_GUIDE_INPUT} \\
${MITK_SOURCE_DIR}/Examples/Plugins/")
endif()
endif()
# create output directories for the guides
file(MAKE_DIRECTORY ${MITK_DOXYGEN_OUTPUT_DIR}/Guides/Users_Guide/)
file(MAKE_DIRECTORY ${MITK_DOXYGEN_OUTPUT_DIR}/Guides/Developers_Guide/)
configure_file(doxygen.conf.in
${CMAKE_CURRENT_BINARY_DIR}/doxygen.conf)
configure_file(doxygen_users_guide.conf.in
${CMAKE_CURRENT_BINARY_DIR}/doxygen_users_guide.conf)
configure_file(doxygen_developers_guide.conf.in
${CMAKE_CURRENT_BINARY_DIR}/doxygen_developers_guide.conf)
if(MITK_DOXYGEN_BUILD_ALWAYS)
set(_doc_in_all "ALL")
else()
set(_doc_in_all "")
endif()
add_custom_target(doc ${_doc_in_all}
${DOXYGEN} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.conf
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target(doc_usersguide
${DOXYGEN} ${CMAKE_CURRENT_BINARY_DIR}/doxygen_users_guide.conf
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target(doc_developersguide
${DOXYGEN} ${CMAKE_CURRENT_BINARY_DIR}/doxygen_developers_guide.conf
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
set_property(TARGET doc doc_usersguide doc_developersguide PROPERTY FOLDER "${MITK_ROOT_FOLDER}/Documentation")
if(MITK_USE_BLUEBERRY)
# convert the extension points schema files into html
find_package(Ant)
set(BLUEBERRY_DOC_TOOLS_DIR "" CACHE PATH "Directory containing additional tools needed for generating the documentation")
if(ANT_FOUND AND BLUEBERRY_DOC_TOOLS_DIR)
list(APPEND MITK_XP_GLOB_EXPRESSIONS
${MITK_SOURCE_DIR}/Plugins/plugin.xml)
file(GLOB_RECURSE _plugin_xmls ${MITK_XP_GLOB_EXPRESSIONS})
mitkFunctionConvertXPSchema(INPUT ${_plugin_xmls}
OUTPUT_DIR "${MITK_DOXYGEN_OUTPUT_DIR}/html/extension-points/html"
TARGET_NAME mitkXPDoc
)
add_dependencies(doc mitkXPDoc)
else()
- message("Extension-point schema documentation generation disabled due to missing Ant and / or missing BlueBerry doc tools.")
+ message(STATUS "Extension-point schema documentation generation disabled due to missing Ant and / or missing BlueBerry doc tools.")
endif()
endif(MITK_USE_BLUEBERRY)
#if(MITK_DOXYGEN_GENERATE_ITK_QCH_FILE)
# # add the command to generate the ITK documentation
# add_custom_target(doc-itk
# COMMAND ${DOXYGEN} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.itk.conf)
# add_dependencies(doc doc-itk)
#endif()
#if(MITK_DOXYGEN_GENERATE_VTK_QCH_FILE)
# # add the command to generate the VTK documentation
# add_custom_target(doc-vtk
# COMMAND ${DOXYGEN} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.vtk.conf)
# add_dependencies(doc doc-vtk)
#endif()
diff --git a/Documentation/Doxygen/3-DeveloperManual/Starting/FirstSteps/NewDataType.dox b/Documentation/Doxygen/3-DeveloperManual/Starting/FirstSteps/NewDataType.dox
index e30e8f3e7d..6bfdac56cf 100644
--- a/Documentation/Doxygen/3-DeveloperManual/Starting/FirstSteps/NewDataType.dox
+++ b/Documentation/Doxygen/3-DeveloperManual/Starting/FirstSteps/NewDataType.dox
@@ -1,52 +1,52 @@
/**
\page NewDataTypePage How to create a new custom data type
\tableofcontents
\section NewDataTypePagePrerequisites Prerequisites and further reading
We will use some concepts during this tutorial which we assume you are aware of, as well as taking advantage of infrastructure which needs to be set up. The following is a list of prerequisites which should be present to effectively use this tutorial.
<ul>
<li> An understanding of the general \ref DataManagementPage </li>
<li> An understanding about the \ref ModularizationPage "modularization of MITK" </li>
<li> We also assume you have created your own module "NewModule" ( \ref NewModulePage ) </li>
</ul>
Some concepts will only be briefly touched upon in this tutorial, for a more concise presentation of these concepts please refer to the following further reading.
<ul>
<li> A general understanding of how the \ref ReaderWriterPage concept works </li>
<li> If you want to know more about the mitk rendering see \ref QVTKRendering </li>
</ul>
\section NewDataTypePageCreatingANewDataType Creating a new data type
A new data type needs to derive from mitk::BaseData in order to be handled by the mitk::DataStorage via mitk::DataNode. An example of a very simple data type is provided in the example module. This type encapsulates a string.
\include mitkExampleDataStructure.h
Overloading mitk::Equal to work with your data type will enable you to write simpler, standardized tests.
\section NewDataTypePageAddingReadersAndWriters Adding readers and writers
In order for your data type to be read from and written to disk, you need to implement readers and writers. In order for your readers/writers to be registered and available even if your module has not been loaded (usually after just starting the application), it is advisable to implement them separately in a autoload module. The default location for this is "YourModuleName/autoload/IO".
More information regarding implementing IO and MimeTypes is available at \ref ReaderWriterPage. An example MimeType is implemented for the example data structure.
\include mitkExampleIOMimeTypes.h
\note{ You do not need to create your own class to manage your MimeTypes. Instead they can be defined within the Reader/Writer. }
-\section NewDataTypePageAddingReadersAndWriters Adding a mapper
+\section NewDataTypePageAddingMappers Adding a mapper
If your data type needs a special way to render its data for the user, you need to implement a new mapper. More information can be found at \ref QVTKRendering.
<p>
If you meet any difficulties during this How-To, don't hesitate to ask on the MITK mailing list mitk-users@lists.sourceforge.net!
People there are kind and will try to help you.
If you notice that there is an error, or that the code has changed so the way shown here is no longer correct, please open a bug report a http://bugs.mitk.org .</p>
*/
diff --git a/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/GeometryMigration.dox b/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/GeometryMigration.dox
index bd9146de8b..b16c6ce5f9 100644
--- a/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/GeometryMigration.dox
+++ b/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/GeometryMigration.dox
@@ -1,148 +1,148 @@
/**
\page GeometryMigration Migration Guide to new Geometry Concept
\tableofcontents
-\section GeneralChanges General Changes
+\section GeometryGeneralChanges General Changes
\subsection OldClasses Old class diagram
Until now, all geometry classes inherited from Geometry3D. This inheritance didn't make sense. For example, there is no reason, why we need a Geometry2D and a PlaneGeometry as both describe the same thing. Also, why does a two-dimensional class need to inherit from a three-dimensional class?
\imageMacro{oldClasses.png,"Old class diagram.",12.70}
\subsection NewClasses New class diagram
Therefore, we inserted an abstract BaseGeometry class, from which all other geometry classes should inherit. The classes Geometry2D and PlaneGeometry are combined in the new PlaneGeometry class. Also, the LandmarkBasedCurvedGeometry is included in LandmarkProjectorBasedCurvedGeometry.
\imageMacro{currentClasses.png,"New class diagram.",15.32}
-\section Howto How to adapt your code
+\section GeometryHowto How to adapt your code
Most content of the BaseGeometry class consists of functions and variables of the former Geometry3D.
Here are some guidelines, how to change your code to the new geometry scheme.
\subsection privateVariables Variables are private.
All variables of BaseGeometry (former in Geometry3D) are private now. Hence, use the Set and Get methods to access the variables.
\subsection geo2d Always use PlaneGeometry instead of Geometry2D.
The class Geometry2D does not exist any more. In most cases, you can just replace the Geometry2D by PlaneGeometry. Please pay attention if you use the function "IsAbove(Point3D point)". There were two different implementations in Geometry2D and PlaneGeometry. The default behavior is implemented according to the former function of PlaneGeometry. If you want to use the implementation of the former Geometry2D, please call "IsAbove(point,true)".\n
Here are the different implementations:
\code
bool PlaneGeometry::IsAbove( const Point3D &pt3d_mm , bool considerBoundingBox = false) const
{
if(considerBoundingBox)
{
//This is the implementation of former Geometry2D
Point3D pt3d_units;
BaseGeometry::WorldToIndex(pt3d_mm, pt3d_units);
return (pt3d_units[2] > this->GetBoundingBox()->GetBounds()[4]);
}
else
{
//This is the implementation of former PlaneGeometry and the default behavior.
return SignedDistanceFromPlane(pt3d_mm) > 0;
}
}
\endcode
\subsection geo2ddata Rename Geometry2D... classes.
All ...Geometry2D... classes and functions are renamed to ...PlaneGeometry... . The new names are for example PlaneGeometryData instead of Geometry2DData. An example for functions is GetGeometry2D, which is now called GetPlaneGeometry. A simple search & replace of Geometry2D should work in most cases.\n\n
List of all names changed (excluding variables):
<ul>
<li> Geometry2D
<li> Geometry2DData
<li> Geometry2DDataToSurfaceFilter
<li> Geometry2DDataMapper2D
<li> Geometry2DDataVTKMapper
<li> GetCurrentWorldGeometry2D
<li> GetCurrentWorldGeometry2DNode
<li> GetCurrentWorldGeometry2DUpdateTime
<li> SetCurrentWorldGeometry2D
<li> GetGeometry2DData
<li> GetGeometry2D
<li> SetGeometry2D
</ul>
\subsection geo3d In some cases, use BaseGeometry instead of Geometry3D.
As there are no classes any more, which inherit from Geometry3D, you cannot insert other classes (i.e. SlicedGeometry3D) for a Geometry3D.
If you have trouble, e.g. calling a function which expects a Geometry3D parameter, try one of the following steps:
<ul>
<li> Do you really need a Geometry3D? Maybe you always use e.g. a PlaneGeometry. Change your function to PlaneGeometry.
<li> If your function/object needs to be flexible for all geometry classes, change the Geometry3D to BaseGeometry.
<li> Try dynamic type casts to BaseGeometry.
</ul>
\subsection clone Clones of BaseGeometry.
The BaseGeometry class is an abstract class. You cannot create an object of BaseGeometry. If you need a clone of BaseGeometry to call a function, use the following code:
\code
itk::LightObject::Pointer lopointer = geometry.Clone();
Initialize(dynamic_cast<BaseGeometry*>(lopointer.GetPointer()));
\endcode
instead of:
\code
Geometry3D::Pointer geometry3D = geometry.Clone();
Initialize(geometry3D.GetPointer());
\endcode
\subsection object Create an object of BaseGeometry.
Again, you cannot create an object of BaseGeometry. However, there are cases, where we need a flexible Variable which can contain objects of any other geometry class later on. This might be the case for member variables, etc. In this case, try:
\code
mitk::Geometry3D::Pointer geo3D = Geometry3D::New();
mitk::BaseGeometry::Pointer m_geometry = dynamic_cast<BaseGeometry*>(geo3D.GetPointer());
\endcode
instead of
\code
mitk::Geometry3D::Pointer m_geometry = mitk::Geometry3D::New();
\endcode
\subsection virtual Virtual functions.
To ensure a reliable behavior of functions, most functions are not virtual any more. However, if a function needs a different behavior in subclasses, there are virtual Pre- and Post- functions, which allow for additional code. The pre-functions are called at the very beginning of a function, the post-functions at the end. In the BaseGeometry, all pre- and post-functions are empty.\n
An example:\n
The function "SetIndexToWorldTransform" is not virtual any more.
For a PlaneGeometry, we need a perpendicular normal before the transformation is set. Afterwards, we need to apply the transformation to the scaling factors.\n
Code of the BaseGeometry class:
\code
void SetIndexToWorldTransform(mitk::AffineTransform3D* transform)
{
PreSetIndexToWorldTransform(transform);
if(m_IndexToWorldTransform.GetPointer() != transform)
{
m_IndexToWorldTransform = transform;
CopySpacingFromTransform(m_IndexToWorldTransform, m_Spacing);
vtk2itk(m_IndexToWorldTransform->GetOffset(), m_Origin);
TransferItkToVtkTransform();
Modified();
}
PostSetIndexToWorldTransform(transform);
}
virtual void PreSetIndexToWorldTransform(mitk::AffineTransform3D* transform){};
virtual void PostSetIndexToWorldTransform(mitk::AffineTransform3D* transform){};
\endcode
Code of PlaneGeometry:
\code
void PlaneGeometry::PreSetIndexToWorldTransform(mitk::AffineTransform3D *transform)
{
EnsurePerpendicularNormal(transform);
}
void PlaneGeometry::PostSetIndexToWorldTransform(mitk::AffineTransform3D* transform)
{
m_ScaleFactorMMPerUnitX=GetExtentInMM(0)/GetExtent(0);
m_ScaleFactorMMPerUnitY=GetExtentInMM(1)/GetExtent(1);
}
\endcode
\subsection parametric Parametric functions are not part of BaseGeometry.
In Geometry3D, there were several "Parametric" functions (e.g. GetParametricExtent, GetParametricTransform), which only called the non-parametric function (e.g. GetExtent, GetIndexToWorldTransform). These functions are removed, please use the non-parametric implementation instead. However, in the AbstractTransformGeometry (and all subclasses), these parametric functions behave different and are still available.
\subsection floatspacing There is no float spacing any more.
Use GetSpacing instead of GetFloatSpacing.
\subsection LandmarkBased Always use LandmarkProjectorBasedCurvedGeometry instead of LandmarkBasedCurvedGeometry.
The class LandmarkBasedCurvedGeometry does not exist any more. Please use LandmarkProjectorBasedCurvedGeometry.
*/
diff --git a/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/InteractionMigration.dox b/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/InteractionMigration.dox
index 59911213a6..a8b2240d01 100644
--- a/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/InteractionMigration.dox
+++ b/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/InteractionMigration.dox
@@ -1,154 +1,154 @@
/**
\page InteractionMigration Migration Guide to new Interaction Concept
\tableofcontents
-\section GeneralChanges General Changes
+\section InteractionGeneralChanges General Changes
\subsection StatemachineDefinitions
Previously the statemachine pattern along with the event description has been stored in a single file (StateMachine.xml).
Now the pattern and the events are separated from each other. The statemachine pattern describes the workflow and the configuration
file describes which specific event triggers an action in the workflow. Every pattern is now put into a single file (for inclusion refer to \ref IncludeFiles ).
The pattern description has to be completely rewritten, but is pretty straight forward based on the old one, how to do this is explained here \ref HowToStateMachine .
Here an example is shown for a simple state containing a transition and a parameter.
\code
<state NAME="neutral" ID="1" START_STATE="TRUE">
<transition NAME="Shift+press" NEXT_STATE_ID="1" EVENT_ID="3">
<action ID="10" />
<intParameter NAME="DIRECTION_X" VALUE="0" />
</transition>
</state>
\endcode
<b> Example snippet (old) </b>
\code
<state name="neutral" startstate="true">
<transition event_class="MousePressEvent" event_variant="MouseLeftButtonPressed" target="neutral">
<action name="addPoint"/>
</transition>
</state>
\endcode
<b> Example snippet (new) </b>
Changes:
<ul>
<li> ID is dropped, states are referenced now by their name
<li> transition now longer have names
<li> NEXT_STATE_ID becomes target
<li> action ids become names, these names are used in the interactor to connect an action with a function
<li> parameters are stored in the configuration file
<li> EVENT_ID is replaced by event_class and event_variant (see below)
</ul>
Event_class describes the class of the event (see \ref EventClassSection ) - the event_variant provides a name that is used in the configuration file
to give an explicit description of the event (or the globalConfig.xml is loaded as configuration file and standard values are used).
Configuration files for state machines are described here: \ref ConfigFileDescriptionSection .
\subsection InteractorStruture Structure of an Interactor
Actions are now directly connected to functions in the DataInteractors, so the classic switch statement becomes obsolete:
\code
bool mitk::SomeInteractor::ExecuteAction(Action* action, mitk::StateEvent const* stateEvent)
{
switch (action->GetActionId())
{
case Action1:
...
case Action2:
...
}
}
\endcode
changes to
\code
void mitk::ExampleInteractor::ConnectActionsAndFunctions()
{
CONNECT_FUNCTION("stringOfActionFromXmlFile", Action1);
CONNECT_FUNCTION("stringOfActionFromXmlFile2", Action2);
...
}
void Action1(StateMachineAction* , InteractionEvent*)
{
...
}
...
\endcode
where each action is implemented as a function. See \ref HowToDataInteractor .
\subsection GuardStates Guard States / Conditions
Formerly there where so called guard states, which cause a transition only if certain conditions are met. These states have been removed,
as a replacement serve the InternalEvents which can be triggered from within a data interactor. An example showing how to use them is given in \ref ExampleInternalEvent .
In most cases, guard states can be eliminated by using transition conditions.
\subsection IncludeFiles Register statemachine patterns and configuration w/o the build system
There are different ways to load a statemachine pattern or configuration objects from files.
If you are working in a module you can use the resources to easily load patterns and configurations.
To use this place your XML file in the 'Resources/Interactions' folder of the respective module, and add the file path to the corresponding files.cmake in the resource section
like this:
\code
set(RESOURCE_FILES
Interactions/dummyStatemachine.xml
)
\endcode
Loading the statemachine pattern can then be done by simply calling
\code
#include "mitkModule.h"
#include <mitkGetModuleContext.h>
Module* module = GetModuleContext()->GetModule();
mitk::PointSetDataInteractor::m_CurrentInteractor = mitk::PointSetDataInteractor::New();
m_CurrentInteractor->LoadStateMachine("dummyStatemachine.xml", module);
\endcode
here module is optional, if none is provided the core module is assumed.
The third possibility is to build up a configuration by vector of mitk::PropertyLists, where each item describes an event configuration.
In the following example a configuration is build which defines two event variants using basic properties,
for a full list of usable properties see mitkInteractionEventConst.h
\code
#include "mitkPropertyList.h"
#include "mitkEventConfig.h"
// First event
mitk::PropertyList::Pointer propertyList1 = mitk::PropertyList::New();
// Setting the EventClass property to 'MousePressEvent'
propertyList1->SetStringProperty(mitk::InteractionEventConst::xmlParameterEventClass.c_str(), "MousePressEvent");
// Setting the Event variant value to 'MousePressEventVariantÄ
propertyList1->SetStringProperty(mitk::InteractionEventConst::xmlParameterEventVariant.c_str(), "MousePressEventVariant");
// set control and alt buttons as modifiers
propertyList1->SetStringProperty("Modifiers","CTRL,ALT");
// Second event
mitk::PropertyList::Pointer propertyList2 = mitk::PropertyList::New();
propertyList2->SetStringProperty(mitk::InteractionEventConst::xmlParameterEventClass.c_str(), "MouseReleaseEvent");
propertyList2->SetStringProperty(mitk::InteractionEventConst::xmlParameterEventVariant.c_str(), "MouseReleaseEventVariant");
propertyList2->SetStringProperty("Modifiers","SHIFT");
// putting both descriptions in a vector
std::vector<mitk::PropertyList::Pointer>* configDescription = new std::vector<mitk::PropertyList::Pointer>();
configDescription->push_back(propertyList1);
configDescription->push_back(propertyList2);
// create the config object
mitk::EventConfig newConfig(configDescription);
\endcode
*/
diff --git a/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/OverlayMigration.dox b/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/OverlayMigration.dox
index 2f3abc81bd..cd0b5df391 100644
--- a/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/OverlayMigration.dox
+++ b/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/OverlayMigration.dox
@@ -1,37 +1,37 @@
/**
\page OverlayMigration Migration Guide from Overlays to the new Annotation concept
\tableofcontents
-\section Howto How to adapt your code
+\section OverlayHowto How to adapt your code
All classes have been renamed from "Overlay" to "Annotation", e.g. the mitk::TextOverlay2D is now mitk::TextAnnotation2D. Most of the interface of mitk::Overlay remains unchanged in
mitk::Annotation, but it is no longer registered at the mitk::OverlayManager. Instead, mitk::ManualPlacementAnnotationRenderer and mitk::LayoutAnnotationRenderer are used the register an annotation.
\code
// Old Overlay registration:
overlayManager->AddOverlay(textOverlay3D.GetPointer(), renderer);
\endcode
\code
// New Annotation registration:
mitk::ManualPlacementAnnotationRenderer::AddAnnotation(textAnnotation3D, renderer);
\endcode
A single mitk::Annotation is no longer automatically registered in all available RenderWindows. Each mitk::Annotation is shown only once. The user is also responsible for the memory management.
When a created mitk::Annotation has no more SmartPointer references, it disappears.
The Layouter concept was implemented in the mitk::LayoutAnnotationRenderer:
\code
// Old way to layout an mitk::Overlay:
verlayManager->AddOverlay(textOverlay.GetPointer());
overlayManager->AddLayouter(
mitk::Overlay2DLayouter::CreateLayouter(mitk::Overlay2DLayouter::STANDARD_2D_TOPLEFT(), renderer2D).GetPointer());
overlayManager->SetLayouter(textOverlay.GetPointer(), mitk::Overlay2DLayouter::STANDARD_2D_TOPLEFT(), renderer2D);
\endcode
\code
// New way to layout an mitk::Annotation:
mitk::LayoutAnnotationRenderer::AddAnnotation(textAnnotation, rendererID, mitk::LayoutAnnotationRenderer::TopLeft, 5, 5, 1);
// The layouter gets parameters for margins and the priority for the placement in the RenderWindow corners.
\endcode
*/
diff --git a/Documentation/doxygen.conf.in b/Documentation/doxygen.conf.in
index 765cb860a1..f0125c858c 100644
--- a/Documentation/doxygen.conf.in
+++ b/Documentation/doxygen.conf.in
@@ -1,2455 +1,2441 @@
# Doxyfile 1.8.8
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a double hash (##) is considered a comment and is placed in
# front of the TAG it is preceding.
#
# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
# TAG = value [value, ...]
# For lists, items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (\" \").
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the config file
# that follow. The default is UTF-8 which is also the encoding used for all text
# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
# for the list of possible encodings.
# The default value is: UTF-8.
DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
# double-quotes, unless you are using Doxywizard) that should identify the
# project for which the documentation is generated. This name is used in the
# title of most generated pages and in a few other places.
# The default value is: My Project.
PROJECT_NAME = "Medical Imaging Interaction Toolkit"
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = @MITK_VERSION_STRING@
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF = "Medical Imaging Interaction Toolkit"
# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
# the documentation. The maximum height of the logo should not exceed 55 pixels
# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
# to the output directory.
PROJECT_LOGO =
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
-OUTPUT_DIRECTORY = @MITK_DOXYGEN_OUTPUT_DIR@
+OUTPUT_DIRECTORY = "@MITK_DOXYGEN_OUTPUT_DIR@"
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
# will distribute the generated files over these directories. Enabling this
# option can be useful when feeding doxygen a huge amount of source files, where
# putting all generated files in the same directory would otherwise causes
# performance problems for the file system.
# The default value is: NO.
CREATE_SUBDIRS = NO
# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
# characters to appear in the names of generated files. If set to NO, non-ASCII
# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
# U+3044.
# The default value is: NO.
ALLOW_UNICODE_NAMES = NO
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
# Ukrainian and Vietnamese.
# The default value is: English.
OUTPUT_LANGUAGE = English
# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
# descriptions after the members that are listed in the file and class
# documentation (similar to Javadoc). Set to NO to disable this.
# The default value is: YES.
BRIEF_MEMBER_DESC = YES
# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
# description of a member or function before the detailed description
#
# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
# The default value is: YES.
REPEAT_BRIEF = YES
# This tag implements a quasi-intelligent brief description abbreviator that is
# used to form the text in various listings. Each string in this list, if found
# as the leading text of the brief description, will be stripped from the text
# and the result, after processing the whole list, is used as the annotated
# text. Otherwise, the brief description is used as-is. If left blank, the
# following values are used ($name is automatically replaced with the name of
# the entity):The $name class, The $name widget, The $name file, is, provides,
# specifies, contains, represents, a, an and the.
ABBREVIATE_BRIEF =
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# doxygen will generate a detailed section even if there is only a brief
# description.
# The default value is: NO.
ALWAYS_DETAILED_SEC = NO
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
# The default value is: NO.
INLINE_INHERITED_MEMB = NO
# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
# before files name in the file list and in the header files. If set to NO the
# shortest path that makes the file name unique will be used
# The default value is: YES.
FULL_PATH_NAMES = NO
# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
# Stripping is only done if one of the specified strings matches the left-hand
# part of the path. The tag can be used to show relative paths in the file list.
# If left blank the directory from which doxygen is run is used as the path to
# strip.
#
# Note that you can specify absolute paths here, but also relative paths, which
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
STRIP_FROM_PATH =
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
# header file to include in order to use a class. If left blank only the name of
# the header file containing the class definition is used. Otherwise one should
# specify the list of include paths that are normally passed to the compiler
# using the -I flag.
STRIP_FROM_INC_PATH =
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
# less readable) file names. This can be useful is your file systems doesn't
# support long names like on DOS, Mac, or CD-ROM.
# The default value is: NO.
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
# first line (until the first dot) of a Javadoc-style comment as the brief
# description. If set to NO, the Javadoc-style will behave just like regular Qt-
# style comments (thus requiring an explicit @brief command for a brief
# description.)
# The default value is: NO.
JAVADOC_AUTOBRIEF = NO
# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
# line (until the first dot) of a Qt-style comment as the brief description. If
# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
# requiring an explicit \brief command for a brief description.)
# The default value is: NO.
QT_AUTOBRIEF = NO
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
# a brief description. This used to be the default behavior. The new default is
# to treat a multi-line C++ comment block as a detailed description. Set this
# tag to YES if you prefer the old behavior instead.
#
# Note that setting this tag to YES also means that rational rose comments are
# not recognized any more.
# The default value is: NO.
MULTILINE_CPP_IS_BRIEF = NO
# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
# documentation from any documented member that it re-implements.
# The default value is: YES.
INHERIT_DOCS = YES
# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
# new page for each member. If set to NO, the documentation of a member will be
# part of the file/class/namespace that contains it.
# The default value is: NO.
SEPARATE_MEMBER_PAGES = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
# uses this value to replace tabs by spaces in code fragments.
# Minimum value: 1, maximum value: 16, default value: 4.
TAB_SIZE = 8
# This tag can be used to specify a number of aliases that act as commands in
# the documentation. An alias has the form:
# name=value
# For example adding
# "sideeffect=@par Side Effects:\n"
# will allow you to put the command \sideeffect (or @sideeffect) in the
# documentation, which will result in a user-defined paragraph with heading
# "Side Effects:". You can put \n's in the value part of an alias to insert
# newlines.
ALIASES = "FIXME=\par Fix Me's:\n" \
"BlueBerry=\if BLUEBERRY" \
"endBlueBerry=\endif" \
"bundlemainpage{1}=\page \1" \
"embmainpage{1}=\page \1" \
"github{2}=<a href=\"https://github.com/MITK/MITK/blob/master/\1\">\2</a>" \
"deprecatedSince{1}=\xrefitem deprecatedSince\1 \"\" \"Functions deprecated as of \1\" \deprecated (as of \1) " \
"minimumCMakeVersion=@MITK_CMAKE_MINIMUM_REQUIRED_VERSION@" \
"minimumQt5Version=@MITK_QT5_MINIMUM_VERSION@" \
"imageMacro{3}=\image html \1 \2 \n \image latex \1 \2 width=\3cm" \
"developersguidemainpage{1}=\page \1 " \
"usersguidemainpage{1}=\page \1 " \
"nondependentPluginLink{3}= \ref \1 \"\3\" "
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
# will allow you to use the command class in the itcl::class meaning.
TCL_SUBST =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For
# instance, some of the names that are used will be different. The list of all
# members will be omitted, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_FOR_C = NO
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
# Python sources only. Doxygen will then generate output that is more tailored
# for that language. For instance, namespaces will be presented as packages,
# qualified scopes will look different, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_JAVA = NO
# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
# sources. Doxygen will then generate output that is tailored for Fortran.
# The default value is: NO.
OPTIMIZE_FOR_FORTRAN = NO
# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
# sources. Doxygen will then generate output that is tailored for VHDL.
# The default value is: NO.
OPTIMIZE_OUTPUT_VHDL = NO
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
# using this tag. The format is ext=language, where ext is a file extension, and
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
# Fortran. In the later case the parser tries to guess whether the code is fixed
# or free formatted code, this is the default for Fortran type files), VHDL. For
# instance to make doxygen treat .inc files as Fortran files (default is PHP),
# and .f files as C (default is Fortran), use: inc=Fortran f=C.
#
# Note For files without extension you can use no_extension as a placeholder.
#
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
# the files are not read by doxygen.
EXTENSION_MAPPING = cmake=c++
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
# according to the Markdown format, which allows for more readable
# documentation. See http://daringfireball.net/projects/markdown/ for details.
# The output of markdown processing is further processed by doxygen, so you can
# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
# case of backward compatibilities issues.
# The default value is: YES.
MARKDOWN_SUPPORT = YES
# When enabled doxygen tries to link words that correspond to documented
# classes, or namespaces to their corresponding documentation. Such a link can
# be prevented in individual cases by by putting a % sign in front of the word
# or globally by setting AUTOLINK_SUPPORT to NO.
# The default value is: YES.
AUTOLINK_SUPPORT = YES
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
# to include (a tag file for) the STL sources as input, then you should set this
# tag to YES in order to let doxygen match functions declarations and
# definitions whose arguments contain STL classes (e.g. func(std::string);
# versus func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
# The default value is: NO.
BUILTIN_STL_SUPPORT = YES
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
# The default value is: NO.
CPP_CLI_SUPPORT = NO
# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
# will parse them like normal C++ but will assume all classes use public instead
# of private inheritance when no explicit protection keyword is present.
# The default value is: NO.
SIP_SUPPORT = NO
# For Microsoft's IDL there are propget and propput attributes to indicate
# getter and setter methods for a property. Setting this option to YES will make
# doxygen to replace the get and set methods by a property in the documentation.
# This will only work if the methods are indeed getting or setting a simple
# type. If this is not the case, or you want to show the methods anyway, you
# should set this option to NO.
# The default value is: YES.
IDL_PROPERTY_SUPPORT = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
# The default value is: NO.
DISTRIBUTE_GROUP_DOC = YES
# Set the SUBGROUPING tag to YES to allow class member groups of the same type
# (for instance a group of public functions) to be put as a subgroup of that
# type (e.g. under the Public Functions section). Set it to NO to prevent
# subgrouping. Alternatively, this can be done per class using the
# \nosubgrouping command.
# The default value is: YES.
SUBGROUPING = YES
# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
# are shown inside the group in which they are included (e.g. using \ingroup)
# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
# and RTF).
#
# Note that this feature does not work in combination with
# SEPARATE_MEMBER_PAGES.
# The default value is: NO.
INLINE_GROUPED_CLASSES = NO
# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
# with only public data fields or simple typedef fields will be shown inline in
# the documentation of the scope in which they are defined (i.e. file,
# namespace, or group documentation), provided this scope is documented. If set
# to NO, structs, classes, and unions are shown on a separate page (for HTML and
# Man pages) or section (for LaTeX and RTF).
# The default value is: NO.
INLINE_SIMPLE_STRUCTS = NO
# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
# enum is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
# namespace, or class. And the struct will be named TypeS. This can typically be
# useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name.
# The default value is: NO.
TYPEDEF_HIDES_STRUCT = NO
# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
# cache is used to resolve symbols given their name and scope. Since this can be
# an expensive process and often the same symbol appears multiple times in the
# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
# doxygen will become slower. If the cache is too large, memory is wasted. The
# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
# symbols. At the end of a run doxygen will report the cache usage and suggest
# the optimal cache size from a speed point of view.
# Minimum value: 0, maximum value: 9, default value: 0.
LOOKUP_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
# documentation are documented, even if no documentation was available. Private
# class members and static file members will be hidden unless the
# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
# Note: This will also disable the warnings about undocumented members that are
# normally produced when WARNINGS is set to YES.
# The default value is: NO.
EXTRACT_ALL = YES
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
# be included in the documentation.
# The default value is: NO.
EXTRACT_PRIVATE = NO
# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
# scope will be included in the documentation.
# The default value is: NO.
EXTRACT_PACKAGE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
# included in the documentation.
# The default value is: NO.
EXTRACT_STATIC = YES
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
# locally in source files will be included in the documentation. If set to NO
# only classes defined in header files are included. Does not have any effect
# for Java sources.
# The default value is: YES.
EXTRACT_LOCAL_CLASSES = @MITK_DOXYGEN_INTERNAL_DOCS@
# This flag is only useful for Objective-C code. When set to YES local methods,
# which are defined in the implementation section but not in the interface are
# included in the documentation. If set to NO only methods in the interface are
# included.
# The default value is: NO.
EXTRACT_LOCAL_METHODS = NO
# If this flag is set to YES, the members of anonymous namespaces will be
# extracted and appear in the documentation as a namespace called
# 'anonymous_namespace{file}', where file will be replaced with the base name of
# the file that contains the anonymous namespace. By default anonymous namespace
# are hidden.
# The default value is: NO.
EXTRACT_ANON_NSPACES = NO
# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
# undocumented members inside documented classes or files. If set to NO these
# members will be included in the various overviews, but no documentation
# section is generated. This option has no effect if EXTRACT_ALL is enabled.
# The default value is: NO.
HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy. If set
# to NO these classes will be included in the various overviews. This option has
# no effect if EXTRACT_ALL is enabled.
# The default value is: NO.
HIDE_UNDOC_CLASSES = NO
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
# (class|struct|union) declarations. If set to NO these declarations will be
# included in the documentation.
# The default value is: NO.
HIDE_FRIEND_COMPOUNDS = @MITK_DOXYGEN_HIDE_FRIEND_COMPOUNDS@
# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
# documentation blocks found inside the body of a function. If set to NO these
# blocks will be appended to the function's detailed documentation block.
# The default value is: NO.
HIDE_IN_BODY_DOCS = NO
# The INTERNAL_DOCS tag determines if documentation that is typed after a
# \internal command is included. If the tag is set to NO then the documentation
# will be excluded. Set it to YES to include the internal documentation.
# The default value is: NO.
INTERNAL_DOCS = @MITK_DOXYGEN_INTERNAL_DOCS@
# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
# names in lower-case letters. If set to YES upper-case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# and Mac users are advised to set this option to NO.
# The default value is: system dependent.
CASE_SENSE_NAMES = YES
# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
# their full class and namespace scopes in the documentation. If set to YES the
# scope will be hidden.
# The default value is: NO.
HIDE_SCOPE_NAMES = NO
# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
# the files that are included by a file in the documentation of that file.
# The default value is: YES.
SHOW_INCLUDE_FILES = YES
# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
# grouped member an include statement to the documentation, telling the reader
# which file to include in order to use the member.
# The default value is: NO.
SHOW_GROUPED_MEMB_INC = NO
# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
# files with double quotes in the documentation rather than with sharp brackets.
# The default value is: NO.
FORCE_LOCAL_INCLUDES = NO
# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
# documentation for inline members.
# The default value is: YES.
INLINE_INFO = YES
# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
# (detailed) documentation of file and class members alphabetically by member
# name. If set to NO the members will appear in declaration order.
# The default value is: YES.
SORT_MEMBER_DOCS = YES
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
# descriptions of file, namespace and class members alphabetically by member
# name. If set to NO the members will appear in declaration order. Note that
# this will also influence the order of the classes in the class list.
# The default value is: NO.
SORT_BRIEF_DOCS = NO
# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
# (brief and detailed) documentation of class members so that constructors and
# destructors are listed first. If set to NO the constructors will appear in the
# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
# member documentation.
# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
# detailed member documentation.
# The default value is: NO.
SORT_MEMBERS_CTORS_1ST = NO
# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
# of group names into alphabetical order. If set to NO the group names will
# appear in their defined order.
# The default value is: NO.
SORT_GROUP_NAMES = NO
# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
# fully-qualified names, including namespaces. If set to NO, the class list will
# be sorted only by class name, not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
# Note: This option applies only to the class list, not to the alphabetical
# list.
# The default value is: NO.
SORT_BY_SCOPE_NAME = YES
# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
# type resolution of all parameters of a function it will reject a match between
# the prototype and the implementation of a member function even if there is
# only one candidate or it is obvious which candidate to choose by doing a
# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
# accept a match between prototype and implementation in such cases.
# The default value is: NO.
STRICT_PROTO_MATCHING = NO
# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
# todo list. This list is created by putting \todo commands in the
# documentation.
# The default value is: YES.
GENERATE_TODOLIST = @MITK_DOXYGEN_GENERATE_TODOLIST@
# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
# test list. This list is created by putting \test commands in the
# documentation.
# The default value is: YES.
GENERATE_TESTLIST = YES
# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
# list. This list is created by putting \bug commands in the documentation.
# The default value is: YES.
GENERATE_BUGLIST = @MITK_DOXYGEN_GENERATE_BUGLIST@
# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
# the deprecated list. This list is created by putting \deprecated commands in
# the documentation.
# The default value is: YES.
GENERATE_DEPRECATEDLIST= @MITK_DOXYGEN_GENERATE_DEPRECATEDLIST@
# The ENABLED_SECTIONS tag can be used to enable conditional documentation
# sections, marked by \if <section_label> ... \endif and \cond <section_label>
# ... \endcond blocks.
ENABLED_SECTIONS = @MITK_DOXYGEN_ENABLED_SECTIONS@
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
# initial value of a variable or macro / define can have for it to appear in the
# documentation. If the initializer consists of more lines than specified here
# it will be hidden. Use a value of 0 to hide initializers completely. The
# appearance of the value of individual variables and macros / defines can be
# controlled using \showinitializer or \hideinitializer command in the
# documentation regardless of this setting.
# Minimum value: 0, maximum value: 10000, default value: 30.
MAX_INITIALIZER_LINES = 0
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
# the bottom of the documentation of classes and structs. If set to YES the list
# will mention the files that were used to generate the documentation.
# The default value is: YES.
SHOW_USED_FILES = YES
# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
# will remove the Files entry from the Quick Index and from the Folder Tree View
# (if specified).
# The default value is: YES.
SHOW_FILES = YES
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
# page. This will remove the Namespaces entry from the Quick Index and from the
# Folder Tree View (if specified).
# The default value is: YES.
SHOW_NAMESPACES = YES
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
# doxygen should invoke to get the current version for each file (typically from
# the version control system). Doxygen will invoke the program by executing (via
# popen()) the command command input-file, where command is the value of the
# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
# by doxygen. Whatever the program writes to standard output is used as the file
# version. For an example see the documentation.
FILE_VERSION_FILTER =
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
# output files in an output format independent way. To create the layout file
# that represents doxygen's defaults, run doxygen with the -l option. You can
# optionally specify a file name after the option, if omitted DoxygenLayout.xml
# will be used as the name of the layout file.
#
# Note that if you run doxygen from a directory containing a file called
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.
-LAYOUT_FILE = @MITK_SOURCE_DIR@/Documentation/MITKDoxygenLayout.xml
+LAYOUT_FILE = "@MITK_SOURCE_DIR@/Documentation/MITKDoxygenLayout.xml"
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
# extension is automatically appended if omitted. This requires the bibtex tool
# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
# For LaTeX the style of the bibliography can be controlled using
# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
# search path. See also \cite for info how to create references.
CITE_BIB_FILES =
#---------------------------------------------------------------------------
# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
# The QUIET tag can be used to turn on/off the messages that are generated to
# standard output by doxygen. If QUIET is set to YES this implies that the
# messages are off.
# The default value is: NO.
QUIET = NO
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
# this implies that the warnings are on.
#
# Tip: Turn warnings on while writing the documentation.
# The default value is: YES.
WARNINGS = YES
# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
# will automatically be disabled.
# The default value is: YES.
WARN_IF_UNDOCUMENTED = YES
# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some parameters
# in a documented function, or documenting parameters that don't exist or using
# markup commands wrongly.
# The default value is: YES.
WARN_IF_DOC_ERROR = YES
# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
# are documented, but have no documentation for their parameters or return
# value. If set to NO doxygen will only warn about wrong or incomplete parameter
# documentation, but not about the absence of documentation.
# The default value is: NO.
WARN_NO_PARAMDOC = NO
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
# can produce. The string should contain the $file, $line, and $text tags, which
# will be replaced by the file and line number from which the warning originated
# and the warning text. Optionally the format may contain $version, which will
# be replaced by the version of the file (if it could be obtained via
# FILE_VERSION_FILTER)
# The default value is: $file:$line: $text.
WARN_FORMAT = "$file:$line: $text"
# The WARN_LOGFILE tag can be used to specify a file to which warning and error
# messages should be written. If left blank the output is written to standard
# error (stderr).
WARN_LOGFILE =
#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag is used to specify the files and/or directories that contain
# documented source files. You may enter file names like myfile.cpp or
# directories like /usr/src/myproject. Separate the files or directories with
# spaces.
# Note: If this tag is empty the current directory is searched.
-INPUT = @MITK_SOURCE_DIR@ \
- @MITK_SOURCE_DIR@/README.md \
- @MITK_BINARY_DIR@ \
- @MITK_DOXYGEN_ADDITIONAL_INPUT_DIRS@
+INPUT = "@MITK_SOURCE_DIR@" \
+ "@MITK_SOURCE_DIR@/README.md" \
+ "@MITK_BINARY_DIR@" \
+ "@MITK_DOXYGEN_ADDITIONAL_INPUT_DIRS@"
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
# documentation (see: http://www.gnu.org/software/libiconv) for the list of
# possible encodings.
# The default value is: UTF-8.
INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
# *.h) to filter out the source-files in the directories. If left blank the
# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
# *.qsf, *.as and *.js.
FILE_PATTERNS = *.h \
*.cpp \
*.dox \
*.md \
*.txx \
*.tpp \
*.cxx \
*.cmake
# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
# The default value is: NO.
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
#
# Note that relative paths are relative to the directory from which doxygen is
# run.
-EXCLUDE = @MITK_SOURCE_DIR@/Utilities/IpFunc/ \
- @MITK_SOURCE_DIR@/Utilities/IpSegmentation/ \
- @MITK_SOURCE_DIR@/Utilities/qtsingleapplication/ \
- @MITK_SOURCE_DIR@/Applications/PluginGenerator/ \
- @MITK_SOURCE_DIR@/Modules/CppMicroServices/core/doc/snippets/ \
- @MITK_SOURCE_DIR@/Modules/CppMicroServices/core/doc/doxygen/standalone/ \
- @MITK_SOURCE_DIR@/Modules/CppMicroServices/core/test/ \
- @MITK_SOURCE_DIR@/Modules/CppMicroServices/core/examples/ \
- @MITK_SOURCE_DIR@/Modules/CppMicroServices/core/src/util/jsoncpp.cpp \
- @MITK_SOURCE_DIR@/CMake/PackageDepends \
- @MITK_SOURCE_DIR@/CMakeExternals \
- @MITK_SOURCE_DIR@/Licenses \
- @MITK_BINARY_DIR@/Documentation/Doxygen \
- @MITK_BINARY_DIR@/bin/ \
- @MITK_BINARY_DIR@/PT/ \
- @MITK_BINARY_DIR@/GP/ \
- @MITK_BINARY_DIR@/Modules/CppMicroServices/ \
- @MITK_BINARY_DIR@/_CPack_Packages/ \
+EXCLUDE = "@MITK_SOURCE_DIR@/Utilities/IpFunc/" \
+ "@MITK_SOURCE_DIR@/Utilities/IpSegmentation/" \
+ "@MITK_SOURCE_DIR@/Utilities/qtsingleapplication/" \
+ "@MITK_SOURCE_DIR@/Applications/PluginGenerator/" \
+ "@MITK_SOURCE_DIR@/Modules/CppMicroServices/core/doc/snippets/" \
+ "@MITK_SOURCE_DIR@/Modules/CppMicroServices/core/doc/doxygen/standalone/" \
+ "@MITK_SOURCE_DIR@/Modules/CppMicroServices/core/test/" \
+ "@MITK_SOURCE_DIR@/Modules/CppMicroServices/core/examples/" \
+ "@MITK_SOURCE_DIR@/Modules/CppMicroServices/core/src/util/jsoncpp.cpp" \
+ "@MITK_SOURCE_DIR@/CMake/PackageDepends" \
+ "@MITK_SOURCE_DIR@/CMakeExternals" \
+ "@MITK_SOURCE_DIR@/Licenses" \
+ "@MITK_BINARY_DIR@/Documentation/Doxygen" \
+ "@MITK_BINARY_DIR@/bin/" \
+ "@MITK_BINARY_DIR@/PT/" \
+ "@MITK_BINARY_DIR@/GP/" \
+ "@MITK_BINARY_DIR@/Modules/CppMicroServices/" \
+ "@MITK_BINARY_DIR@/_CPack_Packages/" \
@MITK_DOXYGEN_ADDITIONAL_EXCLUDE_DIRS@
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
# The default value is: NO.
EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories.
#
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS = README* \
moc_* \
ui_* \
qrc_* \
wrap_* \
Register* \
*/files.cmake \
*/.git/* \
*_p.h \
*Private.* \
*/Internal/* \
*/internal/* \
*/Snippets/* \
*/snippets/* \
*/testing/* \
*/Testing/* \
- @MITK_BINARY_DIR@/*.cmake \
+ "@MITK_BINARY_DIR@/*.cmake" \
@MITK_DOXYGEN_EXCLUDE_PATTERNS@
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
#
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*
EXCLUDE_SYMBOLS =
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
# that contain example code fragments that are included (see the \include
# command).
-EXAMPLE_PATH = @MITK_SOURCE_DIR@/Documentation/Snippets/ \
- @MITK_SOURCE_DIR@/Examples/ \
- @MITK_SOURCE_DIR@/Examples/Tutorial/ \
- @MITK_SOURCE_DIR@/Examples/Plugins/ \
- @MITK_SOURCE_DIR@/Examples/QtFreeRender/ \
- @MITK_SOURCE_DIR@/Modules/Core/ \
- @MITK_SOURCE_DIR@/Modules/CppMicroServices/core/doc/snippets/ \
- @MITK_SOURCE_DIR@/Modules/CppMicroServices/core/examples/ \
- @MITK_DOXYGEN_OUTPUT_DIR@/html/extension-points/html/ \
- @MITK_SOURCE_DIR@/Modules/OpenCL/Documentation/doxygen/snippets/ \
- @MITK_SOURCE_DIR@/Modules/IGT/Tutorial/ \
- @MITK_SOURCE_DIR@/Plugins/org.mitk.gui.qt.igtexamples/ \
- @MITK_SOURCE_DIR@/Plugins/org.mitk.gui.qt.igttracking/
+EXAMPLE_PATH = "@MITK_SOURCE_DIR@/Documentation/Snippets/" \
+ "@MITK_SOURCE_DIR@/Examples/" \
+ "@MITK_SOURCE_DIR@/Examples/Tutorial/" \
+ "@MITK_SOURCE_DIR@/Examples/Plugins/" \
+ "@MITK_SOURCE_DIR@/Examples/QtFreeRender/" \
+ "@MITK_SOURCE_DIR@/Modules/Core/" \
+ "@MITK_SOURCE_DIR@/Modules/CppMicroServices/core/doc/snippets/" \
+ "@MITK_SOURCE_DIR@/Modules/CppMicroServices/core/examples/" \
+ "@MITK_DOXYGEN_OUTPUT_DIR@/html/extension-points/html/" \
+ "@MITK_SOURCE_DIR@/Modules/OpenCL/Documentation/doxygen/snippets/" \
+ "@MITK_SOURCE_DIR@/Modules/IGT/Tutorial/" \
+ "@MITK_SOURCE_DIR@/Plugins/org.mitk.gui.qt.igtexamples/" \
+ "@MITK_SOURCE_DIR@/Plugins/org.mitk.gui.qt.igttracking/"
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
# *.h) to filter out the source-files in the directories. If left blank all
# files are included.
EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude commands
# irrespective of the value of the RECURSIVE tag.
# The default value is: NO.
EXAMPLE_RECURSIVE = YES
# The IMAGE_PATH tag can be used to specify one or more files or directories
# that contain images that are to be included in the documentation (see the
# \image command).
-IMAGE_PATH = @MITK_SOURCE_DIR@/Documentation/Doxygen/ \
- @MITK_SOURCE_DIR@
+IMAGE_PATH = "@MITK_SOURCE_DIR@/Documentation/Doxygen/" \
+ "@MITK_SOURCE_DIR@"
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
# by executing (via popen()) the command:
#
# <filter> <input-file>
#
# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
# name of an input file. Doxygen will then use the output that the filter
# program writes to standard output. If FILTER_PATTERNS is specified, this tag
# will be ignored.
#
# Note that the filter must not add or remove lines; it is applied before the
# code is scanned, but not when the output code is generated. If lines are added
# or removed, the anchors will not be placed correctly.
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis. Doxygen will compare the file name with each pattern and apply the
# filter if there is a match. The filters are a list of the form: pattern=filter
# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
# patterns match the file name, INPUT_FILTER is applied.
FILTER_PATTERNS = *.cmake=@CMakeDoxygenFilter_EXECUTABLE@
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER ) will also be used to filter the input files that are used for
# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
# The default value is: NO.
FILTER_SOURCE_FILES = NO
# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
# it is also possible to disable source filtering for a specific pattern using
# *.ext= (so without naming a filter).
# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
FILTER_SOURCE_PATTERNS =
# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
# is part of the input, its contents will be placed on the main page
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.
USE_MDFILE_AS_MAINPAGE = README.md
#---------------------------------------------------------------------------
# Configuration options related to source browsing
#---------------------------------------------------------------------------
# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
# generated. Documented entities will be cross-referenced with these sources.
#
# Note: To get rid of all source code in the generated output, make sure that
# also VERBATIM_HEADERS is set to NO.
# The default value is: NO.
SOURCE_BROWSER = YES
# Setting the INLINE_SOURCES tag to YES will include the body of functions,
# classes and enums directly into the documentation.
# The default value is: NO.
INLINE_SOURCES = NO
# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
# special comment blocks from generated source code fragments. Normal C, C++ and
# Fortran comments will always remain visible.
# The default value is: YES.
STRIP_CODE_COMMENTS = YES
# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
# function all documented functions referencing it will be listed.
# The default value is: NO.
REFERENCED_BY_RELATION = YES
# If the REFERENCES_RELATION tag is set to YES then for each documented function
# all documented entities called/used by that function will be listed.
# The default value is: NO.
REFERENCES_RELATION = YES
# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
# link to the documentation.
# The default value is: YES.
REFERENCES_LINK_SOURCE = YES
# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
# source code will show a tooltip with additional information such as prototype,
# brief description and links to the definition and documentation. Since this
# will make the HTML file larger and loading of large files a bit slower, you
# can opt to disable this feature.
# The default value is: YES.
# This tag requires that the tag SOURCE_BROWSER is set to YES.
SOURCE_TOOLTIPS = YES
# If the USE_HTAGS tag is set to YES then the references to source code will
# point to the HTML generated by the htags(1) tool instead of doxygen built-in
# source browser. The htags tool is part of GNU's global source tagging system
# (see http://www.gnu.org/software/global/global.html). You will need version
# 4.8.6 or higher.
#
# To use it do the following:
# - Install the latest version of global
# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
# - Make sure the INPUT points to the root of the source tree
# - Run doxygen as normal
#
# Doxygen will invoke htags (and that will in turn invoke gtags), so these
# tools must be available from the command line (i.e. in the search path).
#
# The result: instead of the source browser generated by doxygen, the links to
# source code will now point to the output of htags.
# The default value is: NO.
# This tag requires that the tag SOURCE_BROWSER is set to YES.
USE_HTAGS = NO
# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
# verbatim copy of the header file for each class for which an include is
# specified. Set to NO to disable this.
# See also: Section \class.
# The default value is: YES.
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
# compounds will be generated. Enable this if the project contains a lot of
# classes, structs, unions or interfaces.
# The default value is: YES.
ALPHABETICAL_INDEX = YES
# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
# which the alphabetical index list will be split.
# Minimum value: 1, maximum value: 20, default value: 5.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
COLS_IN_ALPHA_INDEX = 3
# In case all classes in a project start with a common prefix, all classes will
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
# can be used to specify a prefix (or a list of prefixes) that should be ignored
# while generating the index headers.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the HTML output
#---------------------------------------------------------------------------
# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
# The default value is: YES.
GENERATE_HTML = YES
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: html.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_OUTPUT = html
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
# generated HTML page (for example: .htm, .php, .asp).
# The default value is: .html.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FILE_EXTENSION = .html
# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
# each generated HTML page. If the tag is left blank doxygen will generate a
# standard header.
#
# To get valid HTML the header file that includes any scripts and style sheets
# that doxygen needs, which is dependent on the configuration options used (e.g.
# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
# default header using
# doxygen -w html new_header.html new_footer.html new_stylesheet.css
# YourConfigFile
# and then modify the file new_header.html. See also section "Doxygen usage"
# for information on how to generate the default header that doxygen normally
# uses.
# Note: The header is subject to change so you typically have to regenerate the
# default header when upgrading to a newer version of doxygen. For a description
# of the possible markers and block names see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
# generated HTML page. If the tag is left blank doxygen will generate a standard
# footer. See HTML_HEADER for more information on how to generate a default
# footer and what special commands can be used inside the footer. See also
# section "Doxygen usage" for information on how to generate the default footer
# that doxygen normally uses.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
# sheet that is used by each HTML page. It can be used to fine-tune the look of
# the HTML output. If left blank doxygen will generate a default style sheet.
# See also section "Doxygen usage" for information on how to generate the style
# sheet that doxygen normally uses.
# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
# it is more robust and this tag (HTML_STYLESHEET) will in the future become
# obsolete.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_STYLESHEET =
# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
# cascading style sheets that are included after the standard style sheets
# created by doxygen. Using this option one can overrule certain style aspects.
# This is preferred over using HTML_STYLESHEET since it does not replace the
# standard style sheet and is therefor more robust against future updates.
# Doxygen will copy the style sheet files to the output directory.
# Note: The order of the extra stylesheet files is of importance (e.g. the last
# stylesheet in the list overrules the setting of the previous ones in the
# list). For an example see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_STYLESHEET = @MITK_DOXYGEN_STYLESHEET@
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
# that these files will be copied to the base HTML output directory. Use the
# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
# files will be copied as-is; there are no commands or markers available.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_EXTRA_FILES = @MITK_SOURCE_DIR@/Documentation/Doxygen/mitkLogo.jpg
+HTML_EXTRA_FILES = "@MITK_SOURCE_DIR@/Documentation/Doxygen/mitkLogo.jpg"
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
# will adjust the colors in the stylesheet and background images according to
# this color. Hue is specified as an angle on a colorwheel, see
# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
# purple, and 360 is red again.
# Minimum value: 0, maximum value: 359, default value: 220.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_HUE = 220
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
# in the HTML output. For a value of 0 the output will use grayscales only. A
# value of 255 will produce the most vivid colors.
# Minimum value: 0, maximum value: 255, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_SAT = 100
# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
# luminance component of the colors in the HTML output. Values below 100
# gradually make the output lighter, whereas values above 100 make the output
# darker. The value divided by 100 is the actual gamma applied, so 80 represents
# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
# change the gamma.
# Minimum value: 40, maximum value: 240, default value: 80.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_GAMMA = 80
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting this
# to NO can help when comparing the output of multiple runs.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_TIMESTAMP = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_DYNAMIC_SECTIONS = @MITK_DOXYGEN_HTML_DYNAMIC_SECTIONS@
# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
# shown in the various tree structured indices initially; the user can expand
# and collapse entries dynamically later on. Doxygen will expand the tree to
# such a level that at most the specified number of entries are visible (unless
# a fully collapsed tree already exceeds this amount). So setting the number of
# entries 1 will produce a full collapsed tree by default. 0 is a special value
# representing an infinite number of entries and will result in a full expanded
# tree by default.
# Minimum value: 0, maximum value: 9999, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_INDEX_NUM_ENTRIES = 100
# If the GENERATE_DOCSET tag is set to YES, additional index files will be
# generated that can be used as input for Apple's Xcode 3 integrated development
# environment (see: http://developer.apple.com/tools/xcode/), introduced with
# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
# Makefile in the HTML output directory. Running make will produce the docset in
# that directory and running make install will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
# for more information.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_DOCSET = NO
# This tag determines the name of the docset feed. A documentation feed provides
# an umbrella under which multiple documentation sets from a single provider
# (such as a company or product suite) can be grouped.
# The default value is: Doxygen generated docs.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_FEEDNAME = "Doxygen generated docs"
# This tag specifies a string that should uniquely identify the documentation
# set bundle. This should be a reverse domain-name style string, e.g.
# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_BUNDLE_ID = org.doxygen.Project
# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
# the documentation publisher. This should be a reverse domain-name style
# string, e.g. com.mycompany.MyDocSet.documentation.
# The default value is: org.doxygen.Publisher.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
# The default value is: Publisher.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_NAME = Publisher
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
# Windows.
#
# The HTML Help Workshop contains a compiler that can convert all HTML output
# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
# files are now used as the Windows 98 help format, and will replace the old
# Windows help format (.hlp) on all Windows platforms in the future. Compressed
# HTML files also contain an index, a table of contents, and you can search for
# words in the documentation. The HTML workshop also contains a viewer for
# compressed HTML files.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_HTMLHELP = NO
# The CHM_FILE tag can be used to specify the file name of the resulting .chm
# file. You can add a path in front of the file if the result should not be
# written to the html output directory.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_FILE =
# The HHC_LOCATION tag can be used to specify the location (absolute path
# including file name) of the HTML help compiler ( hhc.exe). If non-empty
# doxygen will try to run the HTML help compiler on the generated index.hhp.
# The file has to be specified with full path.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
HHC_LOCATION =
# The GENERATE_CHI flag controls if a separate .chi index file is generated (
# YES) or that it should be included in the master .chm file ( NO).
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
GENERATE_CHI = NO
# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
# and project file content.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_INDEX_ENCODING =
# The BINARY_TOC flag controls whether a binary table of contents is generated (
# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it
# enables the Previous and Next buttons.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
BINARY_TOC = NO
# The TOC_EXPAND flag can be set to YES to add extra items for group members to
# the table of contents of the HTML help documentation and to the tree view.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
TOC_EXPAND = NO
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
# (.qch) of the generated HTML documentation.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_QHP = @MITK_DOXYGEN_GENERATE_QHP@
# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
# the file name of the resulting .qch file. The path specified is relative to
# the HTML output folder.
# This tag requires that the tag GENERATE_QHP is set to YES.
QCH_FILE = @MITK_DOXYGEN_QCH_FILE@
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace
# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_NAMESPACE = "org.mitk"
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
# Help Project output. For more information please see Qt Help Project / Virtual
# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
# folders).
# The default value is: doc.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_VIRTUAL_FOLDER = MITK
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
# filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
# The QHG_LOCATION tag can be used to specify the location of Qt's
# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
# generated .qhp file.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHG_LOCATION = @QT_HELPGENERATOR_EXECUTABLE@
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
# generated, together with the HTML files, they form an Eclipse help plugin. To
# install this plugin and make it available under the help contents menu in
# Eclipse, the contents of the directory containing the HTML and XML files needs
# to be copied into the plugins directory of eclipse. The name of the directory
# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
# After copying Eclipse needs to be restarted before the help appears.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_ECLIPSEHELP = NO
# A unique identifier for the Eclipse help plugin. When installing the plugin
# the directory name containing the HTML and XML files should also have this
# name. Each documentation set should have its own identifier.
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
ECLIPSE_DOC_ID = org.doxygen.Project
# If you want full control over the layout of the generated HTML pages it might
# be necessary to disable the index and replace it with your own. The
# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
# of each HTML page. A value of NO enables the index and the value YES disables
# it. Since the tabs in the index contain the same information as the navigation
# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
DISABLE_INDEX = NO
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
# structure should be generated to display hierarchical information. If the tag
# value is set to YES, a side panel will be generated containing a tree-like
# index structure (just like the one that is generated for HTML Help). For this
# to work a browser that supports JavaScript, DHTML, CSS and frames is required
# (i.e. any modern browser). Windows users are probably better off using the
# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
# further fine-tune the look of the index. As an example, the default style
# sheet generated by doxygen has an example that shows how to put an image at
# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
# the same information as the tab index, you could consider setting
# DISABLE_INDEX to YES when enabling this option.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_TREEVIEW = YES
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
# doxygen will group on one line in the generated HTML documentation.
#
# Note that a value of 0 will completely suppress the enum values from appearing
# in the overview section.
# Minimum value: 0, maximum value: 20, default value: 4.
# This tag requires that the tag GENERATE_HTML is set to YES.
ENUM_VALUES_PER_LINE = 4
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
# to set the initial width (in pixels) of the frame in which the tree is shown.
# Minimum value: 0, maximum value: 1500, default value: 250.
# This tag requires that the tag GENERATE_HTML is set to YES.
TREEVIEW_WIDTH = 300
# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
# external symbols imported via tag files in a separate window.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
EXT_LINKS_IN_WINDOW = NO
# Use this tag to change the font size of LaTeX formulas included as images in
# the HTML documentation. When you change the font size after a successful
# doxygen run you need to manually remove any form_*.png images from the HTML
# output directory to force them to be regenerated.
# Minimum value: 8, maximum value: 50, default value: 10.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_FONTSIZE = 10
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not
# supported properly for IE 6.0, but are supported on all modern browsers.
#
# Note that when changing this option you need to delete any form_*.png files in
# the HTML output directory before the changes have effect.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_TRANSPARENT = YES
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
# http://www.mathjax.org) which uses client side Javascript for the rendering
# instead of using prerendered bitmaps. Use this if you do not have LaTeX
# installed or if you want to formulas look prettier in the HTML output. When
# enabled you may also need to install MathJax separately and configure the path
# to it using the MATHJAX_RELPATH option.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
USE_MATHJAX = YES
# When MathJax is enabled you can set the default output format to be used for
# the MathJax output. See the MathJax site (see:
# http://docs.mathjax.org/en/latest/output.html) for more details.
# Possible values are: HTML-CSS (which is slower, but has the best
# compatibility), NativeMML (i.e. MathML) and SVG.
# The default value is: HTML-CSS.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_FORMAT = HTML-CSS
# When MathJax is enabled you need to specify the location relative to the HTML
# output directory using the MATHJAX_RELPATH option. The destination directory
# should contain the MathJax.js script. For instance, if the mathjax directory
# is located at the same level as the HTML output directory, then
# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
# Content Delivery Network so you can quickly see the result without installing
# MathJax. However, it is strongly recommended to install a local copy of
# MathJax from http://www.mathjax.org before deployment.
# The default value is: http://cdn.mathjax.org/mathjax/latest.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
# extension names that should be enabled during MathJax rendering. For example
# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_EXTENSIONS =
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
# of code that will be used on startup of the MathJax code. See the MathJax site
# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
# example see the documentation.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_CODEFILE =
# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
# the HTML output. The underlying search engine uses javascript and DHTML and
# should work on any modern browser. Note that when using HTML help
# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
# there is already a search function so this one should typically be disabled.
# For large projects the javascript based search engine can be slow, then
# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
# search using the keyboard; to jump to the search box use <access key> + S
# (what the <access key> is depends on the OS and browser, but it is typically
# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
# key> to jump into the search results window, the results can be navigated
# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
# the search. The filter options can be selected when the cursor is inside the
# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
# to select a filter and <Enter> or <escape> to activate or cancel the filter
# option.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
SEARCHENGINE = YES
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
# implemented using a web server instead of a web client using Javascript. There
# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
# setting. When disabled, doxygen will generate a PHP script for searching and
# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
# and searching needs to be provided by external tools. See the section
# "External Indexing and Searching" for details.
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
SERVER_BASED_SEARCH = NO
# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
# script for searching. Instead the search results are written to an XML file
# which needs to be processed by an external indexer. Doxygen will invoke an
# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
# search results.
#
# Doxygen ships with an example indexer ( doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: http://xapian.org/).
#
# See the section "External Indexing and Searching" for details.
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH = NO
# The SEARCHENGINE_URL should point to a search engine hosted by a web server
# which will return the search results when EXTERNAL_SEARCH is enabled.
#
# Doxygen ships with an example indexer ( doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: http://xapian.org/). See the section "External Indexing and
# Searching" for details.
# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHENGINE_URL =
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
# search data is written to a file for indexing by an external tool. With the
# SEARCHDATA_FILE tag the name of this file can be specified.
# The default file is: searchdata.xml.
# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHDATA_FILE = searchdata.xml
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
# projects and redirect the results back to the right project.
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH_ID =
# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
# projects other than the one defined by this configuration file, but that are
# all added to the same external search index. Each project needs to have a
# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
# to a relative location where the documentation can be found. The format is:
# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
# The default value is: YES.
GENERATE_LATEX = NO
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked.
#
# Note that when enabling USE_PDFLATEX this option is only used for generating
# bitmaps for formulas in the HTML output, but not in the Makefile that is
# written to the output directory.
# The default file is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_CMD_NAME = latex
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
# index for LaTeX.
# The default file is: makeindex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
MAKEINDEX_CMD_NAME = makeindex
# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
# documents. This may be useful for small projects and may help to save some
# trees in general.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used by the
# printer.
# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
# 14 inches) and executive (7.25 x 10.5 inches).
# The default value is: a4.
# This tag requires that the tag GENERATE_LATEX is set to YES.
PAPER_TYPE = a4wide
# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
# that should be included in the LaTeX output. To get the times font for
# instance you can specify
# EXTRA_PACKAGES=times
# If left blank no extra packages will be included.
# This tag requires that the tag GENERATE_LATEX is set to YES.
EXTRA_PACKAGES = amssymb
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
# generated LaTeX document. The header should contain everything until the first
# chapter. If it is left blank doxygen will generate a standard header. See
# section "Doxygen usage" for information on how to let doxygen write the
# default header to a separate file.
#
# Note: Only use a user-defined header if you know what you are doing! The
# following commands have a special meaning inside the header: $title,
# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
# $projectbrief, $projectlogo. Doxygen will replace $title with the empy string,
# for the replacement values of the other commands the user is refered to
# HTML_HEADER.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HEADER =
# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
# generated LaTeX document. The footer should contain everything after the last
# chapter. If it is left blank doxygen will generate a standard footer. See
# LATEX_HEADER for more information on how to generate a default footer and what
# special commands can be used inside the footer.
#
# Note: Only use a user-defined footer if you know what you are doing!
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_FOOTER =
# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the LATEX_OUTPUT output
# directory. Note that the files will be copied as-is; there are no commands or
# markers available.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_EXTRA_FILES =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
# contain links (just like the HTML output) instead of page references. This
# makes the output suitable for online browsing using a PDF viewer.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.
PDF_HYPERLINKS = NO
# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
# the PDF file directly from the LaTeX files. Set this option to YES to get a
# higher quality PDF documentation.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.
USE_PDFLATEX = NO
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
# command to the generated LaTeX files. This will instruct LaTeX to keep running
# if errors occur, instead of asking the user for help. This option is also used
# when generating formulas in HTML.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BATCHMODE = NO
# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
# index chapters (such as File Index, Compound Index, etc.) in the output.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HIDE_INDICES = NO
# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
# code with syntax highlighting in the LaTeX output.
#
# Note that which sources are shown also depends on other settings such as
# SOURCE_BROWSER.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_SOURCE_CODE = NO
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
# bibliography, e.g. plainnat, or ieeetr. See
# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
# The default value is: plain.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BIB_STYLE = plain
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
# RTF output is optimized for Word 97 and may not look too pretty with other RTF
# readers/editors.
# The default value is: NO.
GENERATE_RTF = NO
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: rtf.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_OUTPUT = rtf
# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
# documents. This may be useful for small projects and may help to save some
# trees in general.
# The default value is: NO.
# This tag requires that the tag GENERATE_RTF is set to YES.
COMPACT_RTF = NO
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
# contain hyperlink fields. The RTF file will contain links (just like the HTML
# output) instead of page references. This makes the output suitable for online
# browsing using Word or some other Word compatible readers that support those
# fields.
#
# Note: WordPad (write) and others do not support links.
# The default value is: NO.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's config
# file, i.e. a series of assignments. You only have to provide replacements,
# missing definitions are set to their default value.
#
# See also section "Doxygen usage" for information on how to generate the
# default style sheet that doxygen normally uses.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an RTF document. Syntax is
# similar to doxygen's config file. A template extensions file can be generated
# using doxygen -e rtf extensionFile.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# Configuration options related to the man page output
#---------------------------------------------------------------------------
# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
# classes and files.
# The default value is: NO.
GENERATE_MAN = NO
# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it. A directory man3 will be created inside the directory specified by
# MAN_OUTPUT.
# The default directory is: man.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_OUTPUT = man
# The MAN_EXTENSION tag determines the extension that is added to the generated
# man pages. In case the manual section does not start with a number, the number
# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
# optional.
# The default value is: .3.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_EXTENSION = .3
# The MAN_SUBDIR tag determines the name of the directory created within
# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
# MAN_EXTENSION with the initial . removed.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_SUBDIR =
# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
# will generate one additional man file for each entity documented in the real
# man page(s). These additional files only source the real man page, but without
# them the man command would be unable to find the correct page.
# The default value is: NO.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_LINKS = NO
#---------------------------------------------------------------------------
# Configuration options related to the XML output
#---------------------------------------------------------------------------
# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
# captures the structure of the code including all documentation.
# The default value is: NO.
GENERATE_XML = NO
# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: xml.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_OUTPUT = xml
# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
# listings (including syntax highlighting and cross-referencing information) to
# the XML output. Note that enabling this will significantly increase the size
# of the XML output.
# The default value is: YES.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
# that can be used to generate PDF.
# The default value is: NO.
GENERATE_DOCBOOK = NO
# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
# front of it.
# The default directory is: docbook.
# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
DOCBOOK_OUTPUT = docbook
# If the DOCBOOK_PROGRAMLISTING tag is set to YES doxygen will include the
# program listings (including syntax highlighting and cross-referencing
# information) to the DOCBOOK output. Note that enabling this will significantly
# increase the size of the DOCBOOK output.
# The default value is: NO.
# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
DOCBOOK_PROGRAMLISTING = NO
#---------------------------------------------------------------------------
# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
# Definitions (see http://autogen.sf.net) file that captures the structure of
# the code including all documentation. Note that this feature is still
# experimental and incomplete at the moment.
# The default value is: NO.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# Configuration options related to the Perl module output
#---------------------------------------------------------------------------
# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
# file that captures the structure of the code including all documentation.
#
# Note that this feature is still experimental and incomplete at the moment.
# The default value is: NO.
GENERATE_PERLMOD = NO
# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
# output from the Perl module output.
# The default value is: NO.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_LATEX = NO
# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
# formatted so it can be parsed by a human reader. This is useful if you want to
# understand what is going on. On the other hand, if this tag is set to NO the
# size of the Perl module output will be much smaller and Perl will parse it
# just the same.
# The default value is: YES.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_PRETTY = YES
# The names of the make variables in the generated doxyrules.make file are
# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
# so different doxyrules.make files included by the same Makefile don't
# overwrite each other's variables.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
# C-preprocessor directives found in the sources and include files.
# The default value is: YES.
ENABLE_PREPROCESSING = YES
# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
# in the source code. If set to NO only conditional compilation will be
# performed. Macro expansion can be done in a controlled way by setting
# EXPAND_ONLY_PREDEF to YES.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
MACRO_EXPANSION = YES
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
# the macro expansion is limited to the macros specified with the PREDEFINED and
# EXPAND_AS_DEFINED tags.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES the includes files in the
# INCLUDE_PATH will be searched if a #include is found.
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by the
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
# directories. If left blank, the patterns specified with FILE_PATTERNS will be
# used.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that are
# defined before the preprocessor is started (similar to the -D option of e.g.
# gcc). The argument of the tag is a list of macros of the form: name or
# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
# is assumed. To prevent a macro definition from being undefined via #undef or
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED = itkNotUsed(x)= \
- "itkSetMacro(name,type)= virtual void Set##name (type _arg);" \
- "itkGetMacro(name,type)= virtual type Get##name ();" \
- "itkGetConstMacro(name,type)= virtual type Get##name () const;" \
- "itkSetStringMacro(name)= virtual void Set##name (const char* _arg);" \
- "itkGetStringMacro(name)= virtual const char* Get##name () const;" \
- "itkSetClampMacro(name,type,min,max)= virtual void Set##name (type _arg);" \
- "itkSetObjectMacro(name,type)= virtual void Set##name (type* _arg);" \
- "itkGetObjectMacro(name,type)= virtual type* Get##name ();" \
- "itkSetConstObjectMacro(name,type)= virtual void Set##name ( const type* _arg);" \
- "itkGetConstObjectMacro(name,type)= virtual const type* Get##name ();" \
- "itkGetConstReferenceMacro(name,type)= virtual const type& Get##name ();" \
- "itkGetConstReferenceObjectMacro(name,type)= virtual const type::Pointer& Get##name () const;" \
- "itkBooleanMacro(name)= virtual void name##On (); virtual void name##Off ();" \
- "itkSetVector2Macro(name,type)= virtual void Set##name (type _arg1, type _arg2) virtual void Set##name (type _arg[2]);" \
- "itkGetVector2Macro(name,type)= virtual type* Get##name () const; virtual void Get##name (type& _arg1, type& _arg2) const; virtual void Get##name (type _arg[2]) const;" \
- "itkSetVector3Macro(name,type)= virtual void Set##name (type _arg1, type _arg2, type _arg3) virtual void Set##name (type _arg[3]);" \
- "itkGetVector3Macro(name,type)= virtual type* Get##name () const; virtual void Get##name (type& _arg1, type& _arg2, type& _arg3) const; virtual void Get##name (type _arg[3]) const;" \
- "itkSetVector4Macro(name,type)= virtual void Set##name (type _arg1, type _arg2, type _arg3, type _arg4) virtual void Set##name (type _arg[4]);" \
- "itkGetVector4Macro(name,type)= virtual type* Get##name () const; virtual void Get##name (type& _arg1, type& _arg2, type& _arg3, type& _arg4) const; virtual void Get##name (type _arg[4]) const;" \
- "itkSetVector6Macro(name,type)= virtual void Set##name (type _arg1, type _arg2, type _arg3, type _arg4, type _arg5, type _arg6) virtual void Set##name (type _arg[6]);" \
- "itkGetVector6Macro(name,type)= virtual type* Get##name () const; virtual void Get##name (type& _arg1, type& _arg2, type& _arg3, type& _arg4, type& _arg5, type& _arg6) const; virtual void Get##name (type _arg[6]) const;" \
- "itkSetVectorMacro(name,type,count)= virtual void Set##name(type data[]);" \
- "itkGetVectorMacro(name,type,count)= virtual type* Get##name () const;" \
- "itkNewMacro(type)= static Pointer New();" \
- "itkFactorylessNewMacro(type)= static Pointer New();" \
- "itkCloneMacro(type)= Pointer Clone() const;" \
- "itkTypeMacro(thisClass,superclass)= virtual const char *GetClassName() const;" \
- "itkConceptMacro(name,concept)= enum { name = 0 };" \
- "ITK_NUMERIC_LIMITS= std::numeric_limits" \
- "ITK_TYPENAME= typename" \
- "FEM_ABSTRACT_CLASS(thisClass,parentClass)= public: /** Standard Self typedef.*/ typedef thisClass Self; /** Standard Superclass typedef. */ typedef parentClass Superclass; /** Pointer or SmartPointer to an object. */ typedef Self* Pointer; /** Const pointer or SmartPointer to an object. */ typedef const Self* ConstPointer; private:" \
- "FEM_CLASS(thisClass,parentClass)= FEM_ABSTRACT_CLASS(thisClass,parentClass) public: /** Create a new object from the existing one */ virtual Baseclass::Pointer Clone() const; /** Class ID for FEM object factory */ static const int CLID; /** Virtual function to access the class ID */ virtual int ClassID() const { return CLID; } /** Object creation in an itk compatible way */ static Self::Pointer New() { return new Self(); } private:" \
+ "itkSetMacro(name,type)=virtual void Set##name (type _arg);" \
+ "itkGetMacro(name,type)=virtual type Get##name ();" \
+ "itkGetConstMacro(name,type)=virtual type Get##name () const;" \
+ "itkSetStringMacro(name)=virtual void Set##name (const char* _arg);" \
+ "itkGetStringMacro(name)=virtual const char* Get##name () const;" \
+ "itkSetClampMacro(name,type,min,max)=virtual void Set##name (type _arg);" \
+ "itkSetObjectMacro(name,type)=virtual void Set##name (type* _arg);" \
+ "itkGetObjectMacro(name,type)=virtual type* Get##name ();" \
+ "itkSetConstObjectMacro(name,type)=virtual void Set##name ( const type* _arg);" \
+ "itkGetConstObjectMacro(name,type)=virtual const type* Get##name ();" \
+ "itkGetConstReferenceMacro(name,type)=virtual const type& Get##name ();" \
+ "itkGetConstReferenceObjectMacro(name,type)=virtual const type::Pointer& Get##name () const;" \
+ "itkBooleanMacro(name)=virtual void name##On (); virtual void name##Off ();" \
+ "itkSetVector2Macro(name,type)=virtual void Set##name (type _arg1, type _arg2) virtual void Set##name (type _arg[2]);" \
+ "itkGetVector2Macro(name,type)=virtual type* Get##name () const; virtual void Get##name (type& _arg1, type& _arg2) const; virtual void Get##name (type _arg[2]) const;" \
+ "itkSetVector3Macro(name,type)=virtual void Set##name (type _arg1, type _arg2, type _arg3) virtual void Set##name (type _arg[3]);" \
+ "itkGetVector3Macro(name,type)=virtual type* Get##name () const; virtual void Get##name (type& _arg1, type& _arg2, type& _arg3) const; virtual void Get##name (type _arg[3]) const;" \
+ "itkSetVector4Macro(name,type)=virtual void Set##name (type _arg1, type _arg2, type _arg3, type _arg4) virtual void Set##name (type _arg[4]);" \
+ "itkGetVector4Macro(name,type)=virtual type* Get##name () const; virtual void Get##name (type& _arg1, type& _arg2, type& _arg3, type& _arg4) const; virtual void Get##name (type _arg[4]) const;" \
+ "itkSetVector6Macro(name,type)=virtual void Set##name (type _arg1, type _arg2, type _arg3, type _arg4, type _arg5, type _arg6) virtual void Set##name (type _arg[6]);" \
+ "itkGetVector6Macro(name,type)=virtual type* Get##name () const; virtual void Get##name (type& _arg1, type& _arg2, type& _arg3, type& _arg4, type& _arg5, type& _arg6) const; virtual void Get##name (type _arg[6]) const;" \
+ "itkSetVectorMacro(name,type,count)=virtual void Set##name(type data[]);" \
+ "itkGetVectorMacro(name,type,count)=virtual type* Get##name () const;" \
+ "itkNewMacro(type)=static Pointer New();" \
+ "itkFactorylessNewMacro(type)=static Pointer New();" \
+ "itkCloneMacro(type)=Pointer Clone() const;" \
+ "itkTypeMacro(thisClass,superclass)=virtual const char *GetClassName() const;" \
+ "itkConceptMacro(name,concept)=enum { name = 0 };" \
+ "ITK_NUMERIC_LIMITS=std::numeric_limits" \
+ "ITK_TYPENAME=typename" \
+ "FEM_ABSTRACT_CLASS(thisClass,parentClass)=public: /** Standard Self typedef.*/ typedef thisClass Self; /** Standard Superclass typedef. */ typedef parentClass Superclass; /** Pointer or SmartPointer to an object. */ typedef Self* Pointer; /** Const pointer or SmartPointer to an object. */ typedef const Self* ConstPointer; private:" \
+ "FEM_CLASS(thisClass,parentClass)=FEM_ABSTRACT_CLASS(thisClass,parentClass) public: /** Create a new object from the existing one */ virtual Baseclass::Pointer Clone() const; /** Class ID for FEM object factory */ static const int CLID; /** Virtual function to access the class ID */ virtual int ClassID() const { return CLID; /** Object creation in an itk compatible way */ static Self::Pointer New() { return new Self(); } private:" \
FREEVERSION \
ERROR_CHECKING \
HAS_TIFF \
HAS_JPEG \
HAS_NETLIB \
HAS_PNG \
HAS_ZLIB \
HAS_GLUT \
HAS_QT \
VCL_USE_NATIVE_STL=1 \
VCL_USE_NATIVE_COMPLEX=1 \
VCL_HAS_BOOL=1 \
VXL_BIG_ENDIAN=1 \
VXL_LITTLE_ENDIAN=0 \
VNL_DLL_DATA= \
size_t=vcl_size_t \
"US_PREPEND_NAMESPACE(x)=us::x" \
"US_BEGIN_NAMESPACE= namespace us {" \
"US_END_NAMESPACE=}" \
"US_BASECLASS_NAME=itk::LightObject" \
US_EXPORT= \
- "DEPRECATED(func)=func"
+ "DEPRECATED(func)=func" \
+ @US_PLATFORM@
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
# macro definition that is found in the sources will be used. Use the PREDEFINED
# tag if you want to use a different macro definition that overrules the
# definition found in the source code.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
# remove all references to function-like macros that are alone on a line, have
# an all uppercase name, and do not end with a semicolon. Such function macros
# are typically used for boiler-plate code, and will confuse the parser if not
# removed.
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration options related to external references
#---------------------------------------------------------------------------
# The TAGFILES tag can be used to specify one or more tag files. For each tag
# file the location of the external documentation should be added. The format of
# a tag file without this location is as follows:
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
# TAGFILES = file1=loc1 "file2 = loc2" ...
# where loc1 and loc2 can be relative or absolute paths or URLs. See the
# section "Linking to external documentation" for more information about the use
# of tag files.
# Note: Each tag file must have a unique name (where the name does NOT include
# the path). If a tag file is not located in the directory in which doxygen is
# run, you must also specify the path to the tagfile here.
TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
# tag file that is based on the input files it reads. See section "Linking to
# external documentation" for more information about the usage of tag files.
GENERATE_TAGFILE = @MITK_DOXYGEN_TAGFILE_NAME@
# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
# class index. If set to NO only the inherited external classes will be listed.
# The default value is: NO.
ALLEXTERNALS = NO
# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
# the modules index. If set to NO, only the current project's groups will be
# listed.
# The default value is: YES.
EXTERNAL_GROUPS = NO
# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
# the related pages index. If set to NO, only the current project's pages will
# be listed.
# The default value is: YES.
EXTERNAL_PAGES = YES
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of 'which perl').
-# The default file (with absolute path) is: /usr/bin/perl.
-
-PERL_PATH = /usr/bin/perl
-
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
# NO turns the diagrams off. Note that this option also works with HAVE_DOT
# disabled, but it is recommended to install and use dot, since it yields more
# powerful graphs.
# The default value is: YES.
CLASS_DIAGRAMS = YES
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see:
-# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
# You can include diagrams made with dia in doxygen documentation. Doxygen will
# then run dia to produce the diagram and insert it in the documentation. The
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
# If left empty dia is assumed to be found in the default search path.
DIA_PATH =
# If set to YES, the inheritance and collaboration graphs will hide inheritance
# and usage relations if the target is undocumented or is not a class.
# The default value is: YES.
HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz (see:
# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
# Bell Labs. The other options in this section have no effect if this option is
# set to NO
# The default value is: NO.
HAVE_DOT = @HAVE_DOT@
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
# to run in parallel. When set to 0 doxygen will base this on the number of
# processors available in the system. You can set it explicitly to a value
# larger than 0 to get control over the balance between CPU load and processing
# speed.
# Minimum value: 0, maximum value: 32, default value: 0.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_NUM_THREADS = @MITK_DOXYGEN_DOT_NUM_THREADS@
# When you want a differently looking font in the dot files that doxygen
# generates you can specify the font name using DOT_FONTNAME. You need to make
# sure dot is able to find the font, which can be done by putting it in a
# standard location or by setting the DOTFONTPATH environment variable or by
# setting DOT_FONTPATH to the directory containing the font.
# The default value is: Helvetica.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTNAME = Helvetica
# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
# dot graphs.
# Minimum value: 4, maximum value: 24, default value: 10.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTSIZE = 10
# By default doxygen will tell dot to use the default font as specified with
# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
# the path where dot can find it using this tag.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTPATH =
# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
# each documented class showing the direct and indirect inheritance relations.
# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
CLASS_GRAPH = YES
# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
# graph for each documented class showing the direct and indirect implementation
# dependencies (inheritance, containment, and class references variables) of the
# class with other documented classes.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
COLLABORATION_GRAPH = YES
# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
# groups, showing the direct groups dependencies.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GROUP_GRAPHS = YES
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
UML_LOOK = @MITK_DOXYGEN_UML_LOOK@
# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
# class node. If there are many fields or methods and many nodes the graph may
# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
# number of items for each type to make the size more manageable. Set this to 0
# for no limit. Note that the threshold may be exceeded by 50% before the limit
# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
# but if the number exceeds 15, the total amount of fields shown is limited to
# 10.
# Minimum value: 0, maximum value: 100, default value: 10.
# This tag requires that the tag HAVE_DOT is set to YES.
UML_LIMIT_NUM_FIELDS = 10
# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
# collaboration graphs will show the relations between templates and their
# instances.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
TEMPLATE_RELATIONS = YES
# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
# YES then doxygen will generate a graph for each documented file showing the
# direct and indirect include dependencies of the file with other documented
# files.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDE_GRAPH = NO
# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
# set to YES then doxygen will generate a graph for each documented file showing
# the direct and indirect include dependencies of the file with other documented
# files.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDED_BY_GRAPH = NO
# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
# dependency graph for every global function or class method.
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable call graphs for selected
# functions only using the \callgraph command.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
CALL_GRAPH = NO
# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
# dependency graph for every global function or class method.
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable caller graphs for selected
# functions only using the \callergraph command.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
CALLER_GRAPH = NO
# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
# hierarchy of all classes instead of a textual one.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GRAPHICAL_HIERARCHY = NO
# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
# dependencies a directory has on other directories in a graphical way. The
# dependency relations are determined by the #include relations between the
# files in the directories.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot.
# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
# to make the SVG files visible in IE 9+ (other browsers do not have this
# requirement).
# Possible values are: png, jpg, gif and svg.
# The default value is: png.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_IMAGE_FORMAT = png
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
# enable generation of interactive SVG images that allow zooming and panning.
#
# Note that this requires a modern browser other than Internet Explorer. Tested
# and working are Firefox, Chrome, Safari, and Opera.
# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
# the SVG files visible. Older versions of IE do not have SVG support.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
INTERACTIVE_SVG = NO
# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_PATH = @DOXYGEN_DOT_PATH@
+DOT_PATH = "@DOXYGEN_DOT_PATH@"
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the \dotfile
# command).
# This tag requires that the tag HAVE_DOT is set to YES.
DOTFILE_DIRS =
# The MSCFILE_DIRS tag can be used to specify one or more directories that
# contain msc files that are included in the documentation (see the \mscfile
# command).
MSCFILE_DIRS =
# The DIAFILE_DIRS tag can be used to specify one or more directories that
# contain dia files that are included in the documentation (see the \diafile
# command).
DIAFILE_DIRS =
# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
# path where java can find the plantuml.jar file. If left blank, it is assumed
# PlantUML is not used or called during a preprocessing step. Doxygen will
# generate a warning when it encounters a \startuml command in this case and
# will not generate output for the diagram.
# This tag requires that the tag HAVE_DOT is set to YES.
PLANTUML_JAR_PATH =
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
# that will be shown in the graph. If the number of nodes in a graph becomes
# larger than this value, doxygen will truncate the graph, which is visualized
# by representing a node as a red box. Note that doxygen if the number of direct
# children of the root node in a graph is already larger than
# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
# Minimum value: 0, maximum value: 10000, default value: 50.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_GRAPH_MAX_NODES = 50
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
# generated by dot. A depth value of 3 means that only nodes reachable from the
# root by following a path via at most 3 edges will be shown. Nodes that lay
# further from the root node will be omitted. Note that setting this option to 1
# or 2 may greatly reduce the computation time needed for large code bases. Also
# note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
# Minimum value: 0, maximum value: 1000, default value: 0.
# This tag requires that the tag HAVE_DOT is set to YES.
MAX_DOT_GRAPH_DEPTH = 0
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
# background. This is disabled by default, because dot on Windows does not seem
# to support this out of the box.
#
# Warning: Depending on the platform used, enabling this option may lead to
# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
# read).
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_TRANSPARENT = NO
# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
# makes dot run faster, but since only newer versions of dot (>1.8.10) support
# this, this feature is disabled by default.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_MULTI_TARGETS = NO
# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
# explaining the meaning of the various boxes and arrows in the dot generated
# graphs.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GENERATE_LEGEND = YES
# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
# files that are used to generate the various graphs.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_CLEANUP = YES
diff --git a/Documentation/doxygen_developers_guide.conf.in b/Documentation/doxygen_developers_guide.conf.in
index 054af7ff55..2b7d5a1c56 100644
--- a/Documentation/doxygen_developers_guide.conf.in
+++ b/Documentation/doxygen_developers_guide.conf.in
@@ -1,2349 +1,2334 @@
# Doxyfile 1.8.8
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a double hash (##) is considered a comment and is placed in
# front of the TAG it is preceding.
#
# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
# TAG = value [value, ...]
# For lists, items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (\" \").
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the config file
# that follow. The default is UTF-8 which is also the encoding used for all text
# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
# for the list of possible encodings.
# The default value is: UTF-8.
DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
# double-quotes, unless you are using Doxywizard) that should identify the
# project for which the documentation is generated. This name is used in the
# title of most generated pages and in a few other places.
# The default value is: My Project.
PROJECT_NAME = MITK
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = @MITK_VERSION_STRING@
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF = "Medical Imaging Interaction Toolkit"
# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
# the documentation. The maximum height of the logo should not exceed 55 pixels
# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
# to the output directory.
PROJECT_LOGO =
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
-OUTPUT_DIRECTORY = @MITK_DOXYGEN_OUTPUT_DIR@/Guides/Developers_Guide/
+OUTPUT_DIRECTORY = "@MITK_DOXYGEN_OUTPUT_DIR@/Guides/Developers_Guide/"
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
# will distribute the generated files over these directories. Enabling this
# option can be useful when feeding doxygen a huge amount of source files, where
# putting all generated files in the same directory would otherwise causes
# performance problems for the file system.
# The default value is: NO.
CREATE_SUBDIRS = NO
# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
# characters to appear in the names of generated files. If set to NO, non-ASCII
# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
# U+3044.
# The default value is: NO.
ALLOW_UNICODE_NAMES = NO
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
# Ukrainian and Vietnamese.
# The default value is: English.
OUTPUT_LANGUAGE = English
# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
# descriptions after the members that are listed in the file and class
# documentation (similar to Javadoc). Set to NO to disable this.
# The default value is: YES.
BRIEF_MEMBER_DESC = YES
# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
# description of a member or function before the detailed description
#
# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
# The default value is: YES.
REPEAT_BRIEF = YES
# This tag implements a quasi-intelligent brief description abbreviator that is
# used to form the text in various listings. Each string in this list, if found
# as the leading text of the brief description, will be stripped from the text
# and the result, after processing the whole list, is used as the annotated
# text. Otherwise, the brief description is used as-is. If left blank, the
# following values are used ($name is automatically replaced with the name of
# the entity):The $name class, The $name widget, The $name file, is, provides,
# specifies, contains, represents, a, an and the.
ABBREVIATE_BRIEF =
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# doxygen will generate a detailed section even if there is only a brief
# description.
# The default value is: NO.
ALWAYS_DETAILED_SEC = NO
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
# The default value is: NO.
INLINE_INHERITED_MEMB = NO
# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
# before files name in the file list and in the header files. If set to NO the
# shortest path that makes the file name unique will be used
# The default value is: YES.
FULL_PATH_NAMES = NO
# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
# Stripping is only done if one of the specified strings matches the left-hand
# part of the path. The tag can be used to show relative paths in the file list.
# If left blank the directory from which doxygen is run is used as the path to
# strip.
#
# Note that you can specify absolute paths here, but also relative paths, which
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
STRIP_FROM_PATH =
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
# header file to include in order to use a class. If left blank only the name of
# the header file containing the class definition is used. Otherwise one should
# specify the list of include paths that are normally passed to the compiler
# using the -I flag.
STRIP_FROM_INC_PATH =
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
# less readable) file names. This can be useful is your file systems doesn't
# support long names like on DOS, Mac, or CD-ROM.
# The default value is: NO.
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
# first line (until the first dot) of a Javadoc-style comment as the brief
# description. If set to NO, the Javadoc-style will behave just like regular Qt-
# style comments (thus requiring an explicit @brief command for a brief
# description.)
# The default value is: NO.
JAVADOC_AUTOBRIEF = NO
# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
# line (until the first dot) of a Qt-style comment as the brief description. If
# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
# requiring an explicit \brief command for a brief description.)
# The default value is: NO.
QT_AUTOBRIEF = NO
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
# a brief description. This used to be the default behavior. The new default is
# to treat a multi-line C++ comment block as a detailed description. Set this
# tag to YES if you prefer the old behavior instead.
#
# Note that setting this tag to YES also means that rational rose comments are
# not recognized any more.
# The default value is: NO.
MULTILINE_CPP_IS_BRIEF = NO
# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
# documentation from any documented member that it re-implements.
# The default value is: YES.
INHERIT_DOCS = YES
# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
# new page for each member. If set to NO, the documentation of a member will be
# part of the file/class/namespace that contains it.
# The default value is: NO.
SEPARATE_MEMBER_PAGES = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
# uses this value to replace tabs by spaces in code fragments.
# Minimum value: 1, maximum value: 16, default value: 4.
TAB_SIZE = 8
# This tag can be used to specify a number of aliases that act as commands in
# the documentation. An alias has the form:
# name=value
# For example adding
# "sideeffect=@par Side Effects:\n"
# will allow you to put the command \sideeffect (or @sideeffect) in the
# documentation, which will result in a user-defined paragraph with heading
# "Side Effects:". You can put \n's in the value part of an alias to insert
# newlines.
ALIASES = "FIXME=\par Fix Me's:\n" \
"BlueBerry=\if BLUEBERRY" \
"endBlueBerry=\endif" \
"bundlemainpage{1}=\page \1" \
"embmainpage{1}=\page \1" \
"github{2}=<a href=\"https://github.com/MITK/MITK/blob/master/\1\">\2</a>" \
"deprecatedSince{1}=\xrefitem deprecatedSince\1 \" Deprecated as of \1\" \"Functions deprecated as of \1\" " \
"minimumCMakeVersion=@MITK_CMAKE_MINIMUM_REQUIRED_VERSION@" \
"minimumQt5Version=@MITK_QT5_MINIMUM_VERSION@" \
"imageMacro{3}=\image html \1 \2 \n \image latex \1 \2 width=\3cm" \
"developersguidemainpage{1}=\mainpage " \
"usersguidemainpage{1}=\page \1" \
"nondependentPluginLink{3}= \ref \1 \"\3\" "
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
# will allow you to use the command class in the itcl::class meaning.
TCL_SUBST =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For
# instance, some of the names that are used will be different. The list of all
# members will be omitted, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_FOR_C = NO
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
# Python sources only. Doxygen will then generate output that is more tailored
# for that language. For instance, namespaces will be presented as packages,
# qualified scopes will look different, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_JAVA = NO
# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
# sources. Doxygen will then generate output that is tailored for Fortran.
# The default value is: NO.
OPTIMIZE_FOR_FORTRAN = NO
# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
# sources. Doxygen will then generate output that is tailored for VHDL.
# The default value is: NO.
OPTIMIZE_OUTPUT_VHDL = NO
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
# using this tag. The format is ext=language, where ext is a file extension, and
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
# Fortran. In the later case the parser tries to guess whether the code is fixed
# or free formatted code, this is the default for Fortran type files), VHDL. For
# instance to make doxygen treat .inc files as Fortran files (default is PHP),
# and .f files as C (default is Fortran), use: inc=Fortran f=C.
#
# Note For files without extension you can use no_extension as a placeholder.
#
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
# the files are not read by doxygen.
EXTENSION_MAPPING =
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
# according to the Markdown format, which allows for more readable
# documentation. See http://daringfireball.net/projects/markdown/ for details.
# The output of markdown processing is further processed by doxygen, so you can
# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
# case of backward compatibilities issues.
# The default value is: YES.
MARKDOWN_SUPPORT = YES
# When enabled doxygen tries to link words that correspond to documented
# classes, or namespaces to their corresponding documentation. Such a link can
# be prevented in individual cases by by putting a % sign in front of the word
# or globally by setting AUTOLINK_SUPPORT to NO.
# The default value is: YES.
AUTOLINK_SUPPORT = YES
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
# to include (a tag file for) the STL sources as input, then you should set this
# tag to YES in order to let doxygen match functions declarations and
# definitions whose arguments contain STL classes (e.g. func(std::string);
# versus func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
# The default value is: NO.
BUILTIN_STL_SUPPORT = YES
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
# The default value is: NO.
CPP_CLI_SUPPORT = NO
# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
# will parse them like normal C++ but will assume all classes use public instead
# of private inheritance when no explicit protection keyword is present.
# The default value is: NO.
SIP_SUPPORT = NO
# For Microsoft's IDL there are propget and propput attributes to indicate
# getter and setter methods for a property. Setting this option to YES will make
# doxygen to replace the get and set methods by a property in the documentation.
# This will only work if the methods are indeed getting or setting a simple
# type. If this is not the case, or you want to show the methods anyway, you
# should set this option to NO.
# The default value is: YES.
IDL_PROPERTY_SUPPORT = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
# The default value is: NO.
DISTRIBUTE_GROUP_DOC = YES
# Set the SUBGROUPING tag to YES to allow class member groups of the same type
# (for instance a group of public functions) to be put as a subgroup of that
# type (e.g. under the Public Functions section). Set it to NO to prevent
# subgrouping. Alternatively, this can be done per class using the
# \nosubgrouping command.
# The default value is: YES.
SUBGROUPING = YES
# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
# are shown inside the group in which they are included (e.g. using \ingroup)
# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
# and RTF).
#
# Note that this feature does not work in combination with
# SEPARATE_MEMBER_PAGES.
# The default value is: NO.
INLINE_GROUPED_CLASSES = NO
# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
# with only public data fields or simple typedef fields will be shown inline in
# the documentation of the scope in which they are defined (i.e. file,
# namespace, or group documentation), provided this scope is documented. If set
# to NO, structs, classes, and unions are shown on a separate page (for HTML and
# Man pages) or section (for LaTeX and RTF).
# The default value is: NO.
INLINE_SIMPLE_STRUCTS = NO
# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
# enum is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
# namespace, or class. And the struct will be named TypeS. This can typically be
# useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name.
# The default value is: NO.
TYPEDEF_HIDES_STRUCT = NO
# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
# cache is used to resolve symbols given their name and scope. Since this can be
# an expensive process and often the same symbol appears multiple times in the
# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
# doxygen will become slower. If the cache is too large, memory is wasted. The
# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
# symbols. At the end of a run doxygen will report the cache usage and suggest
# the optimal cache size from a speed point of view.
# Minimum value: 0, maximum value: 9, default value: 0.
LOOKUP_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
# documentation are documented, even if no documentation was available. Private
# class members and static file members will be hidden unless the
# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
# Note: This will also disable the warnings about undocumented members that are
# normally produced when WARNINGS is set to YES.
# The default value is: NO.
EXTRACT_ALL = YES
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
# be included in the documentation.
# The default value is: NO.
EXTRACT_PRIVATE = NO
# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
# scope will be included in the documentation.
# The default value is: NO.
EXTRACT_PACKAGE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
# included in the documentation.
# The default value is: NO.
EXTRACT_STATIC = YES
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
# locally in source files will be included in the documentation. If set to NO
# only classes defined in header files are included. Does not have any effect
# for Java sources.
# The default value is: YES.
EXTRACT_LOCAL_CLASSES = @MITK_DOXYGEN_INTERNAL_DOCS@
# This flag is only useful for Objective-C code. When set to YES local methods,
# which are defined in the implementation section but not in the interface are
# included in the documentation. If set to NO only methods in the interface are
# included.
# The default value is: NO.
EXTRACT_LOCAL_METHODS = NO
# If this flag is set to YES, the members of anonymous namespaces will be
# extracted and appear in the documentation as a namespace called
# 'anonymous_namespace{file}', where file will be replaced with the base name of
# the file that contains the anonymous namespace. By default anonymous namespace
# are hidden.
# The default value is: NO.
EXTRACT_ANON_NSPACES = NO
# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
# undocumented members inside documented classes or files. If set to NO these
# members will be included in the various overviews, but no documentation
# section is generated. This option has no effect if EXTRACT_ALL is enabled.
# The default value is: NO.
HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy. If set
# to NO these classes will be included in the various overviews. This option has
# no effect if EXTRACT_ALL is enabled.
# The default value is: NO.
HIDE_UNDOC_CLASSES = NO
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
# (class|struct|union) declarations. If set to NO these declarations will be
# included in the documentation.
# The default value is: NO.
HIDE_FRIEND_COMPOUNDS = @MITK_DOXYGEN_HIDE_FRIEND_COMPOUNDS@
# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
# documentation blocks found inside the body of a function. If set to NO these
# blocks will be appended to the function's detailed documentation block.
# The default value is: NO.
HIDE_IN_BODY_DOCS = NO
# The INTERNAL_DOCS tag determines if documentation that is typed after a
# \internal command is included. If the tag is set to NO then the documentation
# will be excluded. Set it to YES to include the internal documentation.
# The default value is: NO.
INTERNAL_DOCS = @MITK_DOXYGEN_INTERNAL_DOCS@
# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
# names in lower-case letters. If set to YES upper-case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# and Mac users are advised to set this option to NO.
# The default value is: system dependent.
CASE_SENSE_NAMES = YES
# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
# their full class and namespace scopes in the documentation. If set to YES the
# scope will be hidden.
# The default value is: NO.
HIDE_SCOPE_NAMES = NO
# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
# the files that are included by a file in the documentation of that file.
# The default value is: YES.
SHOW_INCLUDE_FILES = YES
# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
# grouped member an include statement to the documentation, telling the reader
# which file to include in order to use the member.
# The default value is: NO.
SHOW_GROUPED_MEMB_INC = NO
# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
# files with double quotes in the documentation rather than with sharp brackets.
# The default value is: NO.
FORCE_LOCAL_INCLUDES = NO
# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
# documentation for inline members.
# The default value is: YES.
INLINE_INFO = YES
# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
# (detailed) documentation of file and class members alphabetically by member
# name. If set to NO the members will appear in declaration order.
# The default value is: YES.
SORT_MEMBER_DOCS = YES
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
# descriptions of file, namespace and class members alphabetically by member
# name. If set to NO the members will appear in declaration order. Note that
# this will also influence the order of the classes in the class list.
# The default value is: NO.
SORT_BRIEF_DOCS = NO
# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
# (brief and detailed) documentation of class members so that constructors and
# destructors are listed first. If set to NO the constructors will appear in the
# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
# member documentation.
# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
# detailed member documentation.
# The default value is: NO.
SORT_MEMBERS_CTORS_1ST = NO
# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
# of group names into alphabetical order. If set to NO the group names will
# appear in their defined order.
# The default value is: NO.
SORT_GROUP_NAMES = NO
# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
# fully-qualified names, including namespaces. If set to NO, the class list will
# be sorted only by class name, not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
# Note: This option applies only to the class list, not to the alphabetical
# list.
# The default value is: NO.
SORT_BY_SCOPE_NAME = YES
# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
# type resolution of all parameters of a function it will reject a match between
# the prototype and the implementation of a member function even if there is
# only one candidate or it is obvious which candidate to choose by doing a
# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
# accept a match between prototype and implementation in such cases.
# The default value is: NO.
STRICT_PROTO_MATCHING = NO
# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
# todo list. This list is created by putting \todo commands in the
# documentation.
# The default value is: YES.
GENERATE_TODOLIST = @MITK_DOXYGEN_GENERATE_TODOLIST@
# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
# test list. This list is created by putting \test commands in the
# documentation.
# The default value is: YES.
GENERATE_TESTLIST = YES
# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
# list. This list is created by putting \bug commands in the documentation.
# The default value is: YES.
GENERATE_BUGLIST = @MITK_DOXYGEN_GENERATE_BUGLIST@
# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
# the deprecated list. This list is created by putting \deprecated commands in
# the documentation.
# The default value is: YES.
GENERATE_DEPRECATEDLIST= @MITK_DOXYGEN_GENERATE_DEPRECATEDLIST@
# The ENABLED_SECTIONS tag can be used to enable conditional documentation
# sections, marked by \if <section_label> ... \endif and \cond <section_label>
# ... \endcond blocks.
ENABLED_SECTIONS = @MITK_DOXYGEN_ENABLED_SECTIONS@
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
# initial value of a variable or macro / define can have for it to appear in the
# documentation. If the initializer consists of more lines than specified here
# it will be hidden. Use a value of 0 to hide initializers completely. The
# appearance of the value of individual variables and macros / defines can be
# controlled using \showinitializer or \hideinitializer command in the
# documentation regardless of this setting.
# Minimum value: 0, maximum value: 10000, default value: 30.
MAX_INITIALIZER_LINES = 0
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
# the bottom of the documentation of classes and structs. If set to YES the list
# will mention the files that were used to generate the documentation.
# The default value is: YES.
SHOW_USED_FILES = YES
# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
# will remove the Files entry from the Quick Index and from the Folder Tree View
# (if specified).
# The default value is: YES.
SHOW_FILES = NO
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
# page. This will remove the Namespaces entry from the Quick Index and from the
# Folder Tree View (if specified).
# The default value is: YES.
SHOW_NAMESPACES = NO
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
# doxygen should invoke to get the current version for each file (typically from
# the version control system). Doxygen will invoke the program by executing (via
# popen()) the command command input-file, where command is the value of the
# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
# by doxygen. Whatever the program writes to standard output is used as the file
# version. For an example see the documentation.
FILE_VERSION_FILTER =
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
# output files in an output format independent way. To create the layout file
# that represents doxygen's defaults, run doxygen with the -l option. You can
# optionally specify a file name after the option, if omitted DoxygenLayout.xml
# will be used as the name of the layout file.
#
# Note that if you run doxygen from a directory containing a file called
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.
LAYOUT_FILE =
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
# extension is automatically appended if omitted. This requires the bibtex tool
# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
# For LaTeX the style of the bibliography can be controlled using
# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
# search path. See also \cite for info how to create references.
CITE_BIB_FILES =
#---------------------------------------------------------------------------
# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
# The QUIET tag can be used to turn on/off the messages that are generated to
# standard output by doxygen. If QUIET is set to YES this implies that the
# messages are off.
# The default value is: NO.
QUIET = NO
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
# this implies that the warnings are on.
#
# Tip: Turn warnings on while writing the documentation.
# The default value is: YES.
WARNINGS = YES
# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
# will automatically be disabled.
# The default value is: YES.
WARN_IF_UNDOCUMENTED = YES
# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some parameters
# in a documented function, or documenting parameters that don't exist or using
# markup commands wrongly.
# The default value is: YES.
WARN_IF_DOC_ERROR = YES
# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
# are documented, but have no documentation for their parameters or return
# value. If set to NO doxygen will only warn about wrong or incomplete parameter
# documentation, but not about the absence of documentation.
# The default value is: NO.
WARN_NO_PARAMDOC = NO
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
# can produce. The string should contain the $file, $line, and $text tags, which
# will be replaced by the file and line number from which the warning originated
# and the warning text. Optionally the format may contain $version, which will
# be replaced by the version of the file (if it could be obtained via
# FILE_VERSION_FILTER)
# The default value is: $file:$line: $text.
WARN_FORMAT = "$file:$line: $text"
# The WARN_LOGFILE tag can be used to specify a file to which warning and error
# messages should be written. If left blank the output is written to standard
# error (stderr).
WARN_LOGFILE =
#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag is used to specify the files and/or directories that contain
# documented source files. You may enter file names like myfile.cpp or
# directories like /usr/src/myproject. Separate the files or directories with
# spaces.
# Note: If this tag is empty the current directory is searched.
-INPUT = @MITK_SOURCE_DIR@/Core/Documentation/Doxygen/Concepts/ \
- @MITK_SOURCE_DIR@/Documentation/Doxygen/DeveloperManual/ \
- @MITK_SOURCE_DIR@/Modules/
+INPUT = "@MITK_SOURCE_DIR@/Core/Documentation/Doxygen/Concepts/" \
+ "@MITK_SOURCE_DIR@/Documentation/Doxygen/DeveloperManual/" \
+ "@MITK_SOURCE_DIR@/Modules/"
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
# documentation (see: http://www.gnu.org/software/libiconv) for the list of
# possible encodings.
# The default value is: UTF-8.
INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
# *.h) to filter out the source-files in the directories. If left blank the
# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
# *.qsf, *.as and *.js.
FILE_PATTERNS = *.dox \
*.md
# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
# The default value is: NO.
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
#
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
# The default value is: NO.
EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories.
#
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS = modules.dox \
*/Plugins/*/documentation/doxygen/*
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
#
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*
EXCLUDE_SYMBOLS =
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
# that contain example code fragments that are included (see the \include
# command).
EXAMPLE_PATH =
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
# *.h) to filter out the source-files in the directories. If left blank all
# files are included.
EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude commands
# irrespective of the value of the RECURSIVE tag.
# The default value is: NO.
EXAMPLE_RECURSIVE = YES
# The IMAGE_PATH tag can be used to specify one or more files or directories
# that contain images that are to be included in the documentation (see the
# \image command).
-IMAGE_PATH = @MITK_SOURCE_DIR@/Core/Documentation/Doxygen/Concepts/ \
- @MITK_SOURCE_DIR@/Documentation/Doxygen/DeveloperManual/ \
- @MITK_SOURCE_DIR@/Modules/
+IMAGE_PATH = "@MITK_SOURCE_DIR@/Core/Documentation/Doxygen/Concepts/" \
+ "@MITK_SOURCE_DIR@/Documentation/Doxygen/DeveloperManual/" \
+ "@MITK_SOURCE_DIR@/Modules/"
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
# by executing (via popen()) the command:
#
# <filter> <input-file>
#
# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
# name of an input file. Doxygen will then use the output that the filter
# program writes to standard output. If FILTER_PATTERNS is specified, this tag
# will be ignored.
#
# Note that the filter must not add or remove lines; it is applied before the
# code is scanned, but not when the output code is generated. If lines are added
# or removed, the anchors will not be placed correctly.
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis. Doxygen will compare the file name with each pattern and apply the
# filter if there is a match. The filters are a list of the form: pattern=filter
# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
# patterns match the file name, INPUT_FILTER is applied.
FILTER_PATTERNS = *.cmake=@CMakeDoxygenFilter_EXECUTABLE@
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER ) will also be used to filter the input files that are used for
# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
# The default value is: NO.
FILTER_SOURCE_FILES = NO
# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
# it is also possible to disable source filtering for a specific pattern using
# *.ext= (so without naming a filter).
# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
FILTER_SOURCE_PATTERNS =
# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
# is part of the input, its contents will be placed on the main page
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.
USE_MDFILE_AS_MAINPAGE =
#---------------------------------------------------------------------------
# Configuration options related to source browsing
#---------------------------------------------------------------------------
# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
# generated. Documented entities will be cross-referenced with these sources.
#
# Note: To get rid of all source code in the generated output, make sure that
# also VERBATIM_HEADERS is set to NO.
# The default value is: NO.
SOURCE_BROWSER = YES
# Setting the INLINE_SOURCES tag to YES will include the body of functions,
# classes and enums directly into the documentation.
# The default value is: NO.
INLINE_SOURCES = NO
# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
# special comment blocks from generated source code fragments. Normal C, C++ and
# Fortran comments will always remain visible.
# The default value is: YES.
STRIP_CODE_COMMENTS = YES
# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
# function all documented functions referencing it will be listed.
# The default value is: NO.
REFERENCED_BY_RELATION = YES
# If the REFERENCES_RELATION tag is set to YES then for each documented function
# all documented entities called/used by that function will be listed.
# The default value is: NO.
REFERENCES_RELATION = YES
# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
# link to the documentation.
# The default value is: YES.
REFERENCES_LINK_SOURCE = YES
# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
# source code will show a tooltip with additional information such as prototype,
# brief description and links to the definition and documentation. Since this
# will make the HTML file larger and loading of large files a bit slower, you
# can opt to disable this feature.
# The default value is: YES.
# This tag requires that the tag SOURCE_BROWSER is set to YES.
SOURCE_TOOLTIPS = YES
# If the USE_HTAGS tag is set to YES then the references to source code will
# point to the HTML generated by the htags(1) tool instead of doxygen built-in
# source browser. The htags tool is part of GNU's global source tagging system
# (see http://www.gnu.org/software/global/global.html). You will need version
# 4.8.6 or higher.
#
# To use it do the following:
# - Install the latest version of global
# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
# - Make sure the INPUT points to the root of the source tree
# - Run doxygen as normal
#
# Doxygen will invoke htags (and that will in turn invoke gtags), so these
# tools must be available from the command line (i.e. in the search path).
#
# The result: instead of the source browser generated by doxygen, the links to
# source code will now point to the output of htags.
# The default value is: NO.
# This tag requires that the tag SOURCE_BROWSER is set to YES.
USE_HTAGS = NO
# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
# verbatim copy of the header file for each class for which an include is
# specified. Set to NO to disable this.
# See also: Section \class.
# The default value is: YES.
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
# compounds will be generated. Enable this if the project contains a lot of
# classes, structs, unions or interfaces.
# The default value is: YES.
ALPHABETICAL_INDEX = YES
# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
# which the alphabetical index list will be split.
# Minimum value: 1, maximum value: 20, default value: 5.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
COLS_IN_ALPHA_INDEX = 3
# In case all classes in a project start with a common prefix, all classes will
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
# can be used to specify a prefix (or a list of prefixes) that should be ignored
# while generating the index headers.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the HTML output
#---------------------------------------------------------------------------
# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
# The default value is: YES.
GENERATE_HTML = NO
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: html.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_OUTPUT = html
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
# generated HTML page (for example: .htm, .php, .asp).
# The default value is: .html.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FILE_EXTENSION = .html
# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
# each generated HTML page. If the tag is left blank doxygen will generate a
# standard header.
#
# To get valid HTML the header file that includes any scripts and style sheets
# that doxygen needs, which is dependent on the configuration options used (e.g.
# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
# default header using
# doxygen -w html new_header.html new_footer.html new_stylesheet.css
# YourConfigFile
# and then modify the file new_header.html. See also section "Doxygen usage"
# for information on how to generate the default header that doxygen normally
# uses.
# Note: The header is subject to change so you typically have to regenerate the
# default header when upgrading to a newer version of doxygen. For a description
# of the possible markers and block names see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
# generated HTML page. If the tag is left blank doxygen will generate a standard
# footer. See HTML_HEADER for more information on how to generate a default
# footer and what special commands can be used inside the footer. See also
# section "Doxygen usage" for information on how to generate the default footer
# that doxygen normally uses.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
# sheet that is used by each HTML page. It can be used to fine-tune the look of
# the HTML output. If left blank doxygen will generate a default style sheet.
# See also section "Doxygen usage" for information on how to generate the style
# sheet that doxygen normally uses.
# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
# it is more robust and this tag (HTML_STYLESHEET) will in the future become
# obsolete.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_STYLESHEET =
# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
# cascading style sheets that are included after the standard style sheets
# created by doxygen. Using this option one can overrule certain style aspects.
# This is preferred over using HTML_STYLESHEET since it does not replace the
# standard style sheet and is therefor more robust against future updates.
# Doxygen will copy the style sheet files to the output directory.
# Note: The order of the extra stylesheet files is of importance (e.g. the last
# stylesheet in the list overrules the setting of the previous ones in the
# list). For an example see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_STYLESHEET = @MITK_DOXYGEN_STYLESHEET@
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
# that these files will be copied to the base HTML output directory. Use the
# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
# files will be copied as-is; there are no commands or markers available.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_FILES =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
# will adjust the colors in the stylesheet and background images according to
# this color. Hue is specified as an angle on a colorwheel, see
# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
# purple, and 360 is red again.
# Minimum value: 0, maximum value: 359, default value: 220.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_HUE = 220
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
# in the HTML output. For a value of 0 the output will use grayscales only. A
# value of 255 will produce the most vivid colors.
# Minimum value: 0, maximum value: 255, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_SAT = 100
# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
# luminance component of the colors in the HTML output. Values below 100
# gradually make the output lighter, whereas values above 100 make the output
# darker. The value divided by 100 is the actual gamma applied, so 80 represents
# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
# change the gamma.
# Minimum value: 40, maximum value: 240, default value: 80.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_GAMMA = 80
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting this
# to NO can help when comparing the output of multiple runs.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_TIMESTAMP = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_DYNAMIC_SECTIONS = @MITK_DOXYGEN_HTML_DYNAMIC_SECTIONS@
# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
# shown in the various tree structured indices initially; the user can expand
# and collapse entries dynamically later on. Doxygen will expand the tree to
# such a level that at most the specified number of entries are visible (unless
# a fully collapsed tree already exceeds this amount). So setting the number of
# entries 1 will produce a full collapsed tree by default. 0 is a special value
# representing an infinite number of entries and will result in a full expanded
# tree by default.
# Minimum value: 0, maximum value: 9999, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_INDEX_NUM_ENTRIES = 100
# If the GENERATE_DOCSET tag is set to YES, additional index files will be
# generated that can be used as input for Apple's Xcode 3 integrated development
# environment (see: http://developer.apple.com/tools/xcode/), introduced with
# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
# Makefile in the HTML output directory. Running make will produce the docset in
# that directory and running make install will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
# for more information.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_DOCSET = NO
# This tag determines the name of the docset feed. A documentation feed provides
# an umbrella under which multiple documentation sets from a single provider
# (such as a company or product suite) can be grouped.
# The default value is: Doxygen generated docs.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_FEEDNAME = "Doxygen generated docs"
# This tag specifies a string that should uniquely identify the documentation
# set bundle. This should be a reverse domain-name style string, e.g.
# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_BUNDLE_ID = org.doxygen.Project
# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
# the documentation publisher. This should be a reverse domain-name style
# string, e.g. com.mycompany.MyDocSet.documentation.
# The default value is: org.doxygen.Publisher.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
# The default value is: Publisher.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_NAME = Publisher
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
# Windows.
#
# The HTML Help Workshop contains a compiler that can convert all HTML output
# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
# files are now used as the Windows 98 help format, and will replace the old
# Windows help format (.hlp) on all Windows platforms in the future. Compressed
# HTML files also contain an index, a table of contents, and you can search for
# words in the documentation. The HTML workshop also contains a viewer for
# compressed HTML files.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_HTMLHELP = NO
# The CHM_FILE tag can be used to specify the file name of the resulting .chm
# file. You can add a path in front of the file if the result should not be
# written to the html output directory.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_FILE =
# The HHC_LOCATION tag can be used to specify the location (absolute path
# including file name) of the HTML help compiler ( hhc.exe). If non-empty
# doxygen will try to run the HTML help compiler on the generated index.hhp.
# The file has to be specified with full path.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
HHC_LOCATION =
# The GENERATE_CHI flag controls if a separate .chi index file is generated (
# YES) or that it should be included in the master .chm file ( NO).
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
GENERATE_CHI = NO
# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
# and project file content.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_INDEX_ENCODING =
# The BINARY_TOC flag controls whether a binary table of contents is generated (
# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it
# enables the Previous and Next buttons.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
BINARY_TOC = NO
# The TOC_EXPAND flag can be set to YES to add extra items for group members to
# the table of contents of the HTML help documentation and to the tree view.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
TOC_EXPAND = NO
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
# (.qch) of the generated HTML documentation.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_QHP = @MITK_DOXYGEN_GENERATE_QHP@
# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
# the file name of the resulting .qch file. The path specified is relative to
# the HTML output folder.
# This tag requires that the tag GENERATE_QHP is set to YES.
QCH_FILE = @MITK_DOXYGEN_QCH_FILE@
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace
# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_NAMESPACE = "org.mitk"
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
# Help Project output. For more information please see Qt Help Project / Virtual
# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
# folders).
# The default value is: doc.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_VIRTUAL_FOLDER = MITK
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
# filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
# The QHG_LOCATION tag can be used to specify the location of Qt's
# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
# generated .qhp file.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHG_LOCATION = @QT_HELPGENERATOR_EXECUTABLE@
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
# generated, together with the HTML files, they form an Eclipse help plugin. To
# install this plugin and make it available under the help contents menu in
# Eclipse, the contents of the directory containing the HTML and XML files needs
# to be copied into the plugins directory of eclipse. The name of the directory
# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
# After copying Eclipse needs to be restarted before the help appears.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_ECLIPSEHELP = NO
# A unique identifier for the Eclipse help plugin. When installing the plugin
# the directory name containing the HTML and XML files should also have this
# name. Each documentation set should have its own identifier.
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
ECLIPSE_DOC_ID = org.doxygen.Project
# If you want full control over the layout of the generated HTML pages it might
# be necessary to disable the index and replace it with your own. The
# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
# of each HTML page. A value of NO enables the index and the value YES disables
# it. Since the tabs in the index contain the same information as the navigation
# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
DISABLE_INDEX = NO
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
# structure should be generated to display hierarchical information. If the tag
# value is set to YES, a side panel will be generated containing a tree-like
# index structure (just like the one that is generated for HTML Help). For this
# to work a browser that supports JavaScript, DHTML, CSS and frames is required
# (i.e. any modern browser). Windows users are probably better off using the
# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
# further fine-tune the look of the index. As an example, the default style
# sheet generated by doxygen has an example that shows how to put an image at
# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
# the same information as the tab index, you could consider setting
# DISABLE_INDEX to YES when enabling this option.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_TREEVIEW = YES
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
# doxygen will group on one line in the generated HTML documentation.
#
# Note that a value of 0 will completely suppress the enum values from appearing
# in the overview section.
# Minimum value: 0, maximum value: 20, default value: 4.
# This tag requires that the tag GENERATE_HTML is set to YES.
ENUM_VALUES_PER_LINE = 4
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
# to set the initial width (in pixels) of the frame in which the tree is shown.
# Minimum value: 0, maximum value: 1500, default value: 250.
# This tag requires that the tag GENERATE_HTML is set to YES.
TREEVIEW_WIDTH = 300
# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
# external symbols imported via tag files in a separate window.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
EXT_LINKS_IN_WINDOW = NO
# Use this tag to change the font size of LaTeX formulas included as images in
# the HTML documentation. When you change the font size after a successful
# doxygen run you need to manually remove any form_*.png images from the HTML
# output directory to force them to be regenerated.
# Minimum value: 8, maximum value: 50, default value: 10.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_FONTSIZE = 10
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not
# supported properly for IE 6.0, but are supported on all modern browsers.
#
# Note that when changing this option you need to delete any form_*.png files in
# the HTML output directory before the changes have effect.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_TRANSPARENT = YES
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
# http://www.mathjax.org) which uses client side Javascript for the rendering
# instead of using prerendered bitmaps. Use this if you do not have LaTeX
# installed or if you want to formulas look prettier in the HTML output. When
# enabled you may also need to install MathJax separately and configure the path
# to it using the MATHJAX_RELPATH option.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
USE_MATHJAX = NO
# When MathJax is enabled you can set the default output format to be used for
# the MathJax output. See the MathJax site (see:
# http://docs.mathjax.org/en/latest/output.html) for more details.
# Possible values are: HTML-CSS (which is slower, but has the best
# compatibility), NativeMML (i.e. MathML) and SVG.
# The default value is: HTML-CSS.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_FORMAT = HTML-CSS
# When MathJax is enabled you need to specify the location relative to the HTML
# output directory using the MATHJAX_RELPATH option. The destination directory
# should contain the MathJax.js script. For instance, if the mathjax directory
# is located at the same level as the HTML output directory, then
# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
# Content Delivery Network so you can quickly see the result without installing
# MathJax. However, it is strongly recommended to install a local copy of
# MathJax from http://www.mathjax.org before deployment.
# The default value is: http://cdn.mathjax.org/mathjax/latest.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
# extension names that should be enabled during MathJax rendering. For example
# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_EXTENSIONS =
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
# of code that will be used on startup of the MathJax code. See the MathJax site
# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
# example see the documentation.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_CODEFILE =
# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
# the HTML output. The underlying search engine uses javascript and DHTML and
# should work on any modern browser. Note that when using HTML help
# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
# there is already a search function so this one should typically be disabled.
# For large projects the javascript based search engine can be slow, then
# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
# search using the keyboard; to jump to the search box use <access key> + S
# (what the <access key> is depends on the OS and browser, but it is typically
# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
# key> to jump into the search results window, the results can be navigated
# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
# the search. The filter options can be selected when the cursor is inside the
# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
# to select a filter and <Enter> or <escape> to activate or cancel the filter
# option.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
SEARCHENGINE = YES
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
# implemented using a web server instead of a web client using Javascript. There
# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
# setting. When disabled, doxygen will generate a PHP script for searching and
# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
# and searching needs to be provided by external tools. See the section
# "External Indexing and Searching" for details.
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
SERVER_BASED_SEARCH = NO
# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
# script for searching. Instead the search results are written to an XML file
# which needs to be processed by an external indexer. Doxygen will invoke an
# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
# search results.
#
# Doxygen ships with an example indexer ( doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: http://xapian.org/).
#
# See the section "External Indexing and Searching" for details.
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH = NO
# The SEARCHENGINE_URL should point to a search engine hosted by a web server
# which will return the search results when EXTERNAL_SEARCH is enabled.
#
# Doxygen ships with an example indexer ( doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: http://xapian.org/). See the section "External Indexing and
# Searching" for details.
# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHENGINE_URL =
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
# search data is written to a file for indexing by an external tool. With the
# SEARCHDATA_FILE tag the name of this file can be specified.
# The default file is: searchdata.xml.
# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHDATA_FILE = searchdata.xml
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
# projects and redirect the results back to the right project.
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH_ID =
# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
# projects other than the one defined by this configuration file, but that are
# all added to the same external search index. Each project needs to have a
# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
# to a relative location where the documentation can be found. The format is:
# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
# The default value is: YES.
GENERATE_LATEX = YES
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked.
#
# Note that when enabling USE_PDFLATEX this option is only used for generating
# bitmaps for formulas in the HTML output, but not in the Makefile that is
# written to the output directory.
# The default file is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_CMD_NAME = latex
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
# index for LaTeX.
# The default file is: makeindex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
MAKEINDEX_CMD_NAME = makeindex
# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
# documents. This may be useful for small projects and may help to save some
# trees in general.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used by the
# printer.
# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
# 14 inches) and executive (7.25 x 10.5 inches).
# The default value is: a4.
# This tag requires that the tag GENERATE_LATEX is set to YES.
PAPER_TYPE = a4wide
# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
# that should be included in the LaTeX output. To get the times font for
# instance you can specify
# EXTRA_PACKAGES=times
# If left blank no extra packages will be included.
# This tag requires that the tag GENERATE_LATEX is set to YES.
EXTRA_PACKAGES = amssymb
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
# generated LaTeX document. The header should contain everything until the first
# chapter. If it is left blank doxygen will generate a standard header. See
# section "Doxygen usage" for information on how to let doxygen write the
# default header to a separate file.
#
# Note: Only use a user-defined header if you know what you are doing! The
# following commands have a special meaning inside the header: $title,
# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
# $projectbrief, $projectlogo. Doxygen will replace $title with the empy string,
# for the replacement values of the other commands the user is refered to
# HTML_HEADER.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HEADER =
# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
# generated LaTeX document. The footer should contain everything after the last
# chapter. If it is left blank doxygen will generate a standard footer. See
# LATEX_HEADER for more information on how to generate a default footer and what
# special commands can be used inside the footer.
#
# Note: Only use a user-defined footer if you know what you are doing!
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_FOOTER =
# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the LATEX_OUTPUT output
# directory. Note that the files will be copied as-is; there are no commands or
# markers available.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_EXTRA_FILES =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
# contain links (just like the HTML output) instead of page references. This
# makes the output suitable for online browsing using a PDF viewer.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.
PDF_HYPERLINKS = YES
# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
# the PDF file directly from the LaTeX files. Set this option to YES to get a
# higher quality PDF documentation.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.
USE_PDFLATEX = YES
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
# command to the generated LaTeX files. This will instruct LaTeX to keep running
# if errors occur, instead of asking the user for help. This option is also used
# when generating formulas in HTML.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BATCHMODE = YES
# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
# index chapters (such as File Index, Compound Index, etc.) in the output.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HIDE_INDICES = YES
# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
# code with syntax highlighting in the LaTeX output.
#
# Note that which sources are shown also depends on other settings such as
# SOURCE_BROWSER.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_SOURCE_CODE = NO
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
# bibliography, e.g. plainnat, or ieeetr. See
# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
# The default value is: plain.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BIB_STYLE = plain
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
# RTF output is optimized for Word 97 and may not look too pretty with other RTF
# readers/editors.
# The default value is: NO.
GENERATE_RTF = NO
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: rtf.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_OUTPUT = rtf
# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
# documents. This may be useful for small projects and may help to save some
# trees in general.
# The default value is: NO.
# This tag requires that the tag GENERATE_RTF is set to YES.
COMPACT_RTF = NO
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
# contain hyperlink fields. The RTF file will contain links (just like the HTML
# output) instead of page references. This makes the output suitable for online
# browsing using Word or some other Word compatible readers that support those
# fields.
#
# Note: WordPad (write) and others do not support links.
# The default value is: NO.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's config
# file, i.e. a series of assignments. You only have to provide replacements,
# missing definitions are set to their default value.
#
# See also section "Doxygen usage" for information on how to generate the
# default style sheet that doxygen normally uses.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an RTF document. Syntax is
# similar to doxygen's config file. A template extensions file can be generated
# using doxygen -e rtf extensionFile.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# Configuration options related to the man page output
#---------------------------------------------------------------------------
# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
# classes and files.
# The default value is: NO.
GENERATE_MAN = NO
# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it. A directory man3 will be created inside the directory specified by
# MAN_OUTPUT.
# The default directory is: man.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_OUTPUT = man
# The MAN_EXTENSION tag determines the extension that is added to the generated
# man pages. In case the manual section does not start with a number, the number
# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
# optional.
# The default value is: .3.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_EXTENSION = .3
# The MAN_SUBDIR tag determines the name of the directory created within
# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
# MAN_EXTENSION with the initial . removed.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_SUBDIR =
# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
# will generate one additional man file for each entity documented in the real
# man page(s). These additional files only source the real man page, but without
# them the man command would be unable to find the correct page.
# The default value is: NO.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_LINKS = NO
#---------------------------------------------------------------------------
# Configuration options related to the XML output
#---------------------------------------------------------------------------
# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
# captures the structure of the code including all documentation.
# The default value is: NO.
GENERATE_XML = NO
# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: xml.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_OUTPUT = xml
# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
# listings (including syntax highlighting and cross-referencing information) to
# the XML output. Note that enabling this will significantly increase the size
# of the XML output.
# The default value is: YES.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
# that can be used to generate PDF.
# The default value is: NO.
GENERATE_DOCBOOK = NO
# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
# front of it.
# The default directory is: docbook.
# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
DOCBOOK_OUTPUT = docbook
# If the DOCBOOK_PROGRAMLISTING tag is set to YES doxygen will include the
# program listings (including syntax highlighting and cross-referencing
# information) to the DOCBOOK output. Note that enabling this will significantly
# increase the size of the DOCBOOK output.
# The default value is: NO.
# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
DOCBOOK_PROGRAMLISTING = NO
#---------------------------------------------------------------------------
# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
# Definitions (see http://autogen.sf.net) file that captures the structure of
# the code including all documentation. Note that this feature is still
# experimental and incomplete at the moment.
# The default value is: NO.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# Configuration options related to the Perl module output
#---------------------------------------------------------------------------
# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
# file that captures the structure of the code including all documentation.
#
# Note that this feature is still experimental and incomplete at the moment.
# The default value is: NO.
GENERATE_PERLMOD = NO
# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
# output from the Perl module output.
# The default value is: NO.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_LATEX = NO
# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
# formatted so it can be parsed by a human reader. This is useful if you want to
# understand what is going on. On the other hand, if this tag is set to NO the
# size of the Perl module output will be much smaller and Perl will parse it
# just the same.
# The default value is: YES.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_PRETTY = YES
# The names of the make variables in the generated doxyrules.make file are
# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
# so different doxyrules.make files included by the same Makefile don't
# overwrite each other's variables.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
# C-preprocessor directives found in the sources and include files.
# The default value is: YES.
ENABLE_PREPROCESSING = YES
# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
# in the source code. If set to NO only conditional compilation will be
# performed. Macro expansion can be done in a controlled way by setting
# EXPAND_ONLY_PREDEF to YES.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
MACRO_EXPANSION = YES
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
# the macro expansion is limited to the macros specified with the PREDEFINED and
# EXPAND_AS_DEFINED tags.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES the includes files in the
# INCLUDE_PATH will be searched if a #include is found.
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by the
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
# directories. If left blank, the patterns specified with FILE_PATTERNS will be
# used.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that are
# defined before the preprocessor is started (similar to the -D option of e.g.
# gcc). The argument of the tag is a list of macros of the form: name or
# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
# is assumed. To prevent a macro definition from being undefined via #undef or
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
# macro definition that is found in the sources will be used. Use the PREDEFINED
# tag if you want to use a different macro definition that overrules the
# definition found in the source code.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
# remove all references to function-like macros that are alone on a line, have
# an all uppercase name, and do not end with a semicolon. Such function macros
# are typically used for boiler-plate code, and will confuse the parser if not
# removed.
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration options related to external references
#---------------------------------------------------------------------------
# The TAGFILES tag can be used to specify one or more tag files. For each tag
# file the location of the external documentation should be added. The format of
# a tag file without this location is as follows:
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
# TAGFILES = file1=loc1 "file2 = loc2" ...
# where loc1 and loc2 can be relative or absolute paths or URLs. See the
# section "Linking to external documentation" for more information about the use
# of tag files.
# Note: Each tag file must have a unique name (where the name does NOT include
# the path). If a tag file is not located in the directory in which doxygen is
# run, you must also specify the path to the tagfile here.
TAGFILES = @BLUEBERRY_DOXYGEN_TAGFILE@
# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
# tag file that is based on the input files it reads. See section "Linking to
# external documentation" for more information about the usage of tag files.
GENERATE_TAGFILE = @MITK_DOXYGEN_TAGFILE_NAME@
# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
# class index. If set to NO only the inherited external classes will be listed.
# The default value is: NO.
ALLEXTERNALS = NO
# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
# the modules index. If set to NO, only the current project's groups will be
# listed.
# The default value is: YES.
EXTERNAL_GROUPS = NO
# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
# the related pages index. If set to NO, only the current project's pages will
# be listed.
# The default value is: YES.
EXTERNAL_PAGES = YES
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of 'which perl').
-# The default file (with absolute path) is: /usr/bin/perl.
-
-PERL_PATH = /usr/bin/perl
-
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
# NO turns the diagrams off. Note that this option also works with HAVE_DOT
# disabled, but it is recommended to install and use dot, since it yields more
# powerful graphs.
# The default value is: YES.
CLASS_DIAGRAMS = YES
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see:
-# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
# You can include diagrams made with dia in doxygen documentation. Doxygen will
# then run dia to produce the diagram and insert it in the documentation. The
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
# If left empty dia is assumed to be found in the default search path.
DIA_PATH =
# If set to YES, the inheritance and collaboration graphs will hide inheritance
# and usage relations if the target is undocumented or is not a class.
# The default value is: YES.
HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz (see:
# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
# Bell Labs. The other options in this section have no effect if this option is
# set to NO
# The default value is: NO.
HAVE_DOT = @HAVE_DOT@
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
# to run in parallel. When set to 0 doxygen will base this on the number of
# processors available in the system. You can set it explicitly to a value
# larger than 0 to get control over the balance between CPU load and processing
# speed.
# Minimum value: 0, maximum value: 32, default value: 0.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_NUM_THREADS = @MITK_DOXYGEN_DOT_NUM_THREADS@
# When you want a differently looking font in the dot files that doxygen
# generates you can specify the font name using DOT_FONTNAME. You need to make
# sure dot is able to find the font, which can be done by putting it in a
# standard location or by setting the DOTFONTPATH environment variable or by
# setting DOT_FONTPATH to the directory containing the font.
# The default value is: Helvetica.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTNAME = Helvetica
# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
# dot graphs.
# Minimum value: 4, maximum value: 24, default value: 10.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTSIZE = 10
# By default doxygen will tell dot to use the default font as specified with
# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
# the path where dot can find it using this tag.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTPATH =
# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
# each documented class showing the direct and indirect inheritance relations.
# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
CLASS_GRAPH = YES
# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
# graph for each documented class showing the direct and indirect implementation
# dependencies (inheritance, containment, and class references variables) of the
# class with other documented classes.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
COLLABORATION_GRAPH = YES
# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
# groups, showing the direct groups dependencies.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GROUP_GRAPHS = YES
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
UML_LOOK = @MITK_DOXYGEN_UML_LOOK@
# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
# class node. If there are many fields or methods and many nodes the graph may
# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
# number of items for each type to make the size more manageable. Set this to 0
# for no limit. Note that the threshold may be exceeded by 50% before the limit
# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
# but if the number exceeds 15, the total amount of fields shown is limited to
# 10.
# Minimum value: 0, maximum value: 100, default value: 10.
# This tag requires that the tag HAVE_DOT is set to YES.
UML_LIMIT_NUM_FIELDS = 10
# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
# collaboration graphs will show the relations between templates and their
# instances.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
TEMPLATE_RELATIONS = YES
# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
# YES then doxygen will generate a graph for each documented file showing the
# direct and indirect include dependencies of the file with other documented
# files.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDE_GRAPH = NO
# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
# set to YES then doxygen will generate a graph for each documented file showing
# the direct and indirect include dependencies of the file with other documented
# files.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDED_BY_GRAPH = NO
# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
# dependency graph for every global function or class method.
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable call graphs for selected
# functions only using the \callgraph command.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
CALL_GRAPH = NO
# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
# dependency graph for every global function or class method.
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable caller graphs for selected
# functions only using the \callergraph command.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
CALLER_GRAPH = NO
# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
# hierarchy of all classes instead of a textual one.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GRAPHICAL_HIERARCHY = NO
# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
# dependencies a directory has on other directories in a graphical way. The
# dependency relations are determined by the #include relations between the
# files in the directories.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot.
# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
# to make the SVG files visible in IE 9+ (other browsers do not have this
# requirement).
# Possible values are: png, jpg, gif and svg.
# The default value is: png.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_IMAGE_FORMAT = png
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
# enable generation of interactive SVG images that allow zooming and panning.
#
# Note that this requires a modern browser other than Internet Explorer. Tested
# and working are Firefox, Chrome, Safari, and Opera.
# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
# the SVG files visible. Older versions of IE do not have SVG support.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
INTERACTIVE_SVG = NO
# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_PATH = @DOXYGEN_DOT_PATH@
+DOT_PATH = "@DOXYGEN_DOT_PATH@"
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the \dotfile
# command).
# This tag requires that the tag HAVE_DOT is set to YES.
DOTFILE_DIRS =
# The MSCFILE_DIRS tag can be used to specify one or more directories that
# contain msc files that are included in the documentation (see the \mscfile
# command).
MSCFILE_DIRS =
# The DIAFILE_DIRS tag can be used to specify one or more directories that
# contain dia files that are included in the documentation (see the \diafile
# command).
DIAFILE_DIRS =
# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
# path where java can find the plantuml.jar file. If left blank, it is assumed
# PlantUML is not used or called during a preprocessing step. Doxygen will
# generate a warning when it encounters a \startuml command in this case and
# will not generate output for the diagram.
# This tag requires that the tag HAVE_DOT is set to YES.
PLANTUML_JAR_PATH =
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
# that will be shown in the graph. If the number of nodes in a graph becomes
# larger than this value, doxygen will truncate the graph, which is visualized
# by representing a node as a red box. Note that doxygen if the number of direct
# children of the root node in a graph is already larger than
# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
# Minimum value: 0, maximum value: 10000, default value: 50.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_GRAPH_MAX_NODES = 50
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
# generated by dot. A depth value of 3 means that only nodes reachable from the
# root by following a path via at most 3 edges will be shown. Nodes that lay
# further from the root node will be omitted. Note that setting this option to 1
# or 2 may greatly reduce the computation time needed for large code bases. Also
# note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
# Minimum value: 0, maximum value: 1000, default value: 0.
# This tag requires that the tag HAVE_DOT is set to YES.
MAX_DOT_GRAPH_DEPTH = 0
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
# background. This is disabled by default, because dot on Windows does not seem
# to support this out of the box.
#
# Warning: Depending on the platform used, enabling this option may lead to
# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
# read).
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_TRANSPARENT = NO
# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
# makes dot run faster, but since only newer versions of dot (>1.8.10) support
# this, this feature is disabled by default.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_MULTI_TARGETS = NO
# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
# explaining the meaning of the various boxes and arrows in the dot generated
# graphs.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GENERATE_LEGEND = YES
# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
# files that are used to generate the various graphs.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_CLEANUP = YES
diff --git a/Documentation/doxygen_plugin_manual.conf.in b/Documentation/doxygen_plugin_manual.conf.in
index 8a1b3c7e8a..02af836a8b 100644
--- a/Documentation/doxygen_plugin_manual.conf.in
+++ b/Documentation/doxygen_plugin_manual.conf.in
@@ -1,2337 +1,2322 @@
# Doxyfile 1.8.8
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a double hash (##) is considered a comment and is placed in
# front of the TAG it is preceding.
#
# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
# TAG = value [value, ...]
# For lists, items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (\" \").
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the config file
# that follow. The default is UTF-8 which is also the encoding used for all text
# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
# for the list of possible encodings.
# The default value is: UTF-8.
DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
# double-quotes, unless you are using Doxywizard) that should identify the
# project for which the documentation is generated. This name is used in the
# title of most generated pages and in a few other places.
# The default value is: My Project.
PROJECT_NAME = "@Plugin-Name@"
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER =
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF =
# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
# the documentation. The maximum height of the logo should not exceed 55 pixels
# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
# to the output directory.
PROJECT_LOGO =
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY = "@PLUGIN_DOXYGEN_OUTPUT_DIR@"
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
# will distribute the generated files over these directories. Enabling this
# option can be useful when feeding doxygen a huge amount of source files, where
# putting all generated files in the same directory would otherwise causes
# performance problems for the file system.
# The default value is: NO.
CREATE_SUBDIRS = NO
# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
# characters to appear in the names of generated files. If set to NO, non-ASCII
# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
# U+3044.
# The default value is: NO.
ALLOW_UNICODE_NAMES = NO
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
# Ukrainian and Vietnamese.
# The default value is: English.
OUTPUT_LANGUAGE = English
# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
# descriptions after the members that are listed in the file and class
# documentation (similar to Javadoc). Set to NO to disable this.
# The default value is: YES.
BRIEF_MEMBER_DESC = YES
# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
# description of a member or function before the detailed description
#
# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
# The default value is: YES.
REPEAT_BRIEF = YES
# This tag implements a quasi-intelligent brief description abbreviator that is
# used to form the text in various listings. Each string in this list, if found
# as the leading text of the brief description, will be stripped from the text
# and the result, after processing the whole list, is used as the annotated
# text. Otherwise, the brief description is used as-is. If left blank, the
# following values are used ($name is automatically replaced with the name of
# the entity):The $name class, The $name widget, The $name file, is, provides,
# specifies, contains, represents, a, an and the.
ABBREVIATE_BRIEF =
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# doxygen will generate a detailed section even if there is only a brief
# description.
# The default value is: NO.
ALWAYS_DETAILED_SEC = NO
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
# The default value is: NO.
INLINE_INHERITED_MEMB = NO
# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
# before files name in the file list and in the header files. If set to NO the
# shortest path that makes the file name unique will be used
# The default value is: YES.
FULL_PATH_NAMES = NO
# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
# Stripping is only done if one of the specified strings matches the left-hand
# part of the path. The tag can be used to show relative paths in the file list.
# If left blank the directory from which doxygen is run is used as the path to
# strip.
#
# Note that you can specify absolute paths here, but also relative paths, which
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
STRIP_FROM_PATH =
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
# header file to include in order to use a class. If left blank only the name of
# the header file containing the class definition is used. Otherwise one should
# specify the list of include paths that are normally passed to the compiler
# using the -I flag.
STRIP_FROM_INC_PATH =
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
# less readable) file names. This can be useful is your file systems doesn't
# support long names like on DOS, Mac, or CD-ROM.
# The default value is: NO.
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
# first line (until the first dot) of a Javadoc-style comment as the brief
# description. If set to NO, the Javadoc-style will behave just like regular Qt-
# style comments (thus requiring an explicit @brief command for a brief
# description.)
# The default value is: NO.
JAVADOC_AUTOBRIEF = NO
# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
# line (until the first dot) of a Qt-style comment as the brief description. If
# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
# requiring an explicit \brief command for a brief description.)
# The default value is: NO.
QT_AUTOBRIEF = NO
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
# a brief description. This used to be the default behavior. The new default is
# to treat a multi-line C++ comment block as a detailed description. Set this
# tag to YES if you prefer the old behavior instead.
#
# Note that setting this tag to YES also means that rational rose comments are
# not recognized any more.
# The default value is: NO.
MULTILINE_CPP_IS_BRIEF = NO
# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
# documentation from any documented member that it re-implements.
# The default value is: YES.
INHERIT_DOCS = YES
# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
# new page for each member. If set to NO, the documentation of a member will be
# part of the file/class/namespace that contains it.
# The default value is: NO.
SEPARATE_MEMBER_PAGES = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
# uses this value to replace tabs by spaces in code fragments.
# Minimum value: 1, maximum value: 16, default value: 4.
TAB_SIZE = 8
# This tag can be used to specify a number of aliases that act as commands in
# the documentation. An alias has the form:
# name=value
# For example adding
# "sideeffect=@par Side Effects:\n"
# will allow you to put the command \sideeffect (or @sideeffect) in the
# documentation, which will result in a user-defined paragraph with heading
# "Side Effects:". You can put \n's in the value part of an alias to insert
# newlines.
ALIASES = bundlemainpage{1}=\mainpage \
"isHtml=\if NO_SUCH_THING" \
"isHtmlend=\endif" \
"imageMacro{3}=\image html \1 \2 \n \image latex \1 \2 width=\3cm" \
"developersguidemainpage{1}=\page \1 " \
"usersguidemainpage{1}=\page \1 " \
"nondependentPluginLink{3}= <a href=\"qthelp://\2/bundle/\1.html\"> \3 </a> "
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
# will allow you to use the command class in the itcl::class meaning.
TCL_SUBST =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For
# instance, some of the names that are used will be different. The list of all
# members will be omitted, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_FOR_C = NO
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
# Python sources only. Doxygen will then generate output that is more tailored
# for that language. For instance, namespaces will be presented as packages,
# qualified scopes will look different, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_JAVA = NO
# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
# sources. Doxygen will then generate output that is tailored for Fortran.
# The default value is: NO.
OPTIMIZE_FOR_FORTRAN = NO
# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
# sources. Doxygen will then generate output that is tailored for VHDL.
# The default value is: NO.
OPTIMIZE_OUTPUT_VHDL = NO
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
# using this tag. The format is ext=language, where ext is a file extension, and
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
# Fortran. In the later case the parser tries to guess whether the code is fixed
# or free formatted code, this is the default for Fortran type files), VHDL. For
# instance to make doxygen treat .inc files as Fortran files (default is PHP),
# and .f files as C (default is Fortran), use: inc=Fortran f=C.
#
# Note For files without extension you can use no_extension as a placeholder.
#
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
# the files are not read by doxygen.
EXTENSION_MAPPING =
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
# according to the Markdown format, which allows for more readable
# documentation. See http://daringfireball.net/projects/markdown/ for details.
# The output of markdown processing is further processed by doxygen, so you can
# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
# case of backward compatibilities issues.
# The default value is: YES.
MARKDOWN_SUPPORT = YES
# When enabled doxygen tries to link words that correspond to documented
# classes, or namespaces to their corresponding documentation. Such a link can
# be prevented in individual cases by by putting a % sign in front of the word
# or globally by setting AUTOLINK_SUPPORT to NO.
# The default value is: YES.
AUTOLINK_SUPPORT = YES
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
# to include (a tag file for) the STL sources as input, then you should set this
# tag to YES in order to let doxygen match functions declarations and
# definitions whose arguments contain STL classes (e.g. func(std::string);
# versus func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
# The default value is: NO.
BUILTIN_STL_SUPPORT = NO
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
# The default value is: NO.
CPP_CLI_SUPPORT = NO
# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
# will parse them like normal C++ but will assume all classes use public instead
# of private inheritance when no explicit protection keyword is present.
# The default value is: NO.
SIP_SUPPORT = NO
# For Microsoft's IDL there are propget and propput attributes to indicate
# getter and setter methods for a property. Setting this option to YES will make
# doxygen to replace the get and set methods by a property in the documentation.
# This will only work if the methods are indeed getting or setting a simple
# type. If this is not the case, or you want to show the methods anyway, you
# should set this option to NO.
# The default value is: YES.
IDL_PROPERTY_SUPPORT = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
# The default value is: NO.
DISTRIBUTE_GROUP_DOC = NO
# Set the SUBGROUPING tag to YES to allow class member groups of the same type
# (for instance a group of public functions) to be put as a subgroup of that
# type (e.g. under the Public Functions section). Set it to NO to prevent
# subgrouping. Alternatively, this can be done per class using the
# \nosubgrouping command.
# The default value is: YES.
SUBGROUPING = YES
# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
# are shown inside the group in which they are included (e.g. using \ingroup)
# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
# and RTF).
#
# Note that this feature does not work in combination with
# SEPARATE_MEMBER_PAGES.
# The default value is: NO.
INLINE_GROUPED_CLASSES = NO
# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
# with only public data fields or simple typedef fields will be shown inline in
# the documentation of the scope in which they are defined (i.e. file,
# namespace, or group documentation), provided this scope is documented. If set
# to NO, structs, classes, and unions are shown on a separate page (for HTML and
# Man pages) or section (for LaTeX and RTF).
# The default value is: NO.
INLINE_SIMPLE_STRUCTS = NO
# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
# enum is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
# namespace, or class. And the struct will be named TypeS. This can typically be
# useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name.
# The default value is: NO.
TYPEDEF_HIDES_STRUCT = NO
# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
# cache is used to resolve symbols given their name and scope. Since this can be
# an expensive process and often the same symbol appears multiple times in the
# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
# doxygen will become slower. If the cache is too large, memory is wasted. The
# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
# symbols. At the end of a run doxygen will report the cache usage and suggest
# the optimal cache size from a speed point of view.
# Minimum value: 0, maximum value: 9, default value: 0.
LOOKUP_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
# documentation are documented, even if no documentation was available. Private
# class members and static file members will be hidden unless the
# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
# Note: This will also disable the warnings about undocumented members that are
# normally produced when WARNINGS is set to YES.
# The default value is: NO.
EXTRACT_ALL = YES
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
# be included in the documentation.
# The default value is: NO.
EXTRACT_PRIVATE = NO
# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
# scope will be included in the documentation.
# The default value is: NO.
EXTRACT_PACKAGE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
# included in the documentation.
# The default value is: NO.
EXTRACT_STATIC = YES
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
# locally in source files will be included in the documentation. If set to NO
# only classes defined in header files are included. Does not have any effect
# for Java sources.
# The default value is: YES.
EXTRACT_LOCAL_CLASSES = YES
# This flag is only useful for Objective-C code. When set to YES local methods,
# which are defined in the implementation section but not in the interface are
# included in the documentation. If set to NO only methods in the interface are
# included.
# The default value is: NO.
EXTRACT_LOCAL_METHODS = NO
# If this flag is set to YES, the members of anonymous namespaces will be
# extracted and appear in the documentation as a namespace called
# 'anonymous_namespace{file}', where file will be replaced with the base name of
# the file that contains the anonymous namespace. By default anonymous namespace
# are hidden.
# The default value is: NO.
EXTRACT_ANON_NSPACES = NO
# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
# undocumented members inside documented classes or files. If set to NO these
# members will be included in the various overviews, but no documentation
# section is generated. This option has no effect if EXTRACT_ALL is enabled.
# The default value is: NO.
HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy. If set
# to NO these classes will be included in the various overviews. This option has
# no effect if EXTRACT_ALL is enabled.
# The default value is: NO.
HIDE_UNDOC_CLASSES = NO
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
# (class|struct|union) declarations. If set to NO these declarations will be
# included in the documentation.
# The default value is: NO.
HIDE_FRIEND_COMPOUNDS = NO
# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
# documentation blocks found inside the body of a function. If set to NO these
# blocks will be appended to the function's detailed documentation block.
# The default value is: NO.
HIDE_IN_BODY_DOCS = NO
# The INTERNAL_DOCS tag determines if documentation that is typed after a
# \internal command is included. If the tag is set to NO then the documentation
# will be excluded. Set it to YES to include the internal documentation.
# The default value is: NO.
INTERNAL_DOCS = NO
# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
# names in lower-case letters. If set to YES upper-case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# and Mac users are advised to set this option to NO.
# The default value is: system dependent.
CASE_SENSE_NAMES = YES
# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
# their full class and namespace scopes in the documentation. If set to YES the
# scope will be hidden.
# The default value is: NO.
HIDE_SCOPE_NAMES = NO
# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
# the files that are included by a file in the documentation of that file.
# The default value is: YES.
SHOW_INCLUDE_FILES = YES
# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
# grouped member an include statement to the documentation, telling the reader
# which file to include in order to use the member.
# The default value is: NO.
SHOW_GROUPED_MEMB_INC = NO
# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
# files with double quotes in the documentation rather than with sharp brackets.
# The default value is: NO.
FORCE_LOCAL_INCLUDES = NO
# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
# documentation for inline members.
# The default value is: YES.
INLINE_INFO = YES
# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
# (detailed) documentation of file and class members alphabetically by member
# name. If set to NO the members will appear in declaration order.
# The default value is: YES.
SORT_MEMBER_DOCS = YES
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
# descriptions of file, namespace and class members alphabetically by member
# name. If set to NO the members will appear in declaration order. Note that
# this will also influence the order of the classes in the class list.
# The default value is: NO.
SORT_BRIEF_DOCS = NO
# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
# (brief and detailed) documentation of class members so that constructors and
# destructors are listed first. If set to NO the constructors will appear in the
# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
# member documentation.
# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
# detailed member documentation.
# The default value is: NO.
SORT_MEMBERS_CTORS_1ST = NO
# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
# of group names into alphabetical order. If set to NO the group names will
# appear in their defined order.
# The default value is: NO.
SORT_GROUP_NAMES = NO
# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
# fully-qualified names, including namespaces. If set to NO, the class list will
# be sorted only by class name, not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
# Note: This option applies only to the class list, not to the alphabetical
# list.
# The default value is: NO.
SORT_BY_SCOPE_NAME = NO
# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
# type resolution of all parameters of a function it will reject a match between
# the prototype and the implementation of a member function even if there is
# only one candidate or it is obvious which candidate to choose by doing a
# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
# accept a match between prototype and implementation in such cases.
# The default value is: NO.
STRICT_PROTO_MATCHING = NO
# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
# todo list. This list is created by putting \todo commands in the
# documentation.
# The default value is: YES.
GENERATE_TODOLIST = NO
# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
# test list. This list is created by putting \test commands in the
# documentation.
# The default value is: YES.
GENERATE_TESTLIST = NO
# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
# list. This list is created by putting \bug commands in the documentation.
# The default value is: YES.
GENERATE_BUGLIST = NO
# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
# the deprecated list. This list is created by putting \deprecated commands in
# the documentation.
# The default value is: YES.
GENERATE_DEPRECATEDLIST= NO
# The ENABLED_SECTIONS tag can be used to enable conditional documentation
# sections, marked by \if <section_label> ... \endif and \cond <section_label>
# ... \endcond blocks.
ENABLED_SECTIONS =
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
# initial value of a variable or macro / define can have for it to appear in the
# documentation. If the initializer consists of more lines than specified here
# it will be hidden. Use a value of 0 to hide initializers completely. The
# appearance of the value of individual variables and macros / defines can be
# controlled using \showinitializer or \hideinitializer command in the
# documentation regardless of this setting.
# Minimum value: 0, maximum value: 10000, default value: 30.
MAX_INITIALIZER_LINES = 30
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
# the bottom of the documentation of classes and structs. If set to YES the list
# will mention the files that were used to generate the documentation.
# The default value is: YES.
SHOW_USED_FILES = YES
# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
# will remove the Files entry from the Quick Index and from the Folder Tree View
# (if specified).
# The default value is: YES.
SHOW_FILES = YES
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
# page. This will remove the Namespaces entry from the Quick Index and from the
# Folder Tree View (if specified).
# The default value is: YES.
SHOW_NAMESPACES = NO
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
# doxygen should invoke to get the current version for each file (typically from
# the version control system). Doxygen will invoke the program by executing (via
# popen()) the command command input-file, where command is the value of the
# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
# by doxygen. Whatever the program writes to standard output is used as the file
# version. For an example see the documentation.
FILE_VERSION_FILTER =
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
# output files in an output format independent way. To create the layout file
# that represents doxygen's defaults, run doxygen with the -l option. You can
# optionally specify a file name after the option, if omitted DoxygenLayout.xml
# will be used as the name of the layout file.
#
# Note that if you run doxygen from a directory containing a file called
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.
LAYOUT_FILE =
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
# extension is automatically appended if omitted. This requires the bibtex tool
# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
# For LaTeX the style of the bibliography can be controlled using
# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
# search path. See also \cite for info how to create references.
CITE_BIB_FILES =
#---------------------------------------------------------------------------
# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
# The QUIET tag can be used to turn on/off the messages that are generated to
# standard output by doxygen. If QUIET is set to YES this implies that the
# messages are off.
# The default value is: NO.
QUIET = YES
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
# this implies that the warnings are on.
#
# Tip: Turn warnings on while writing the documentation.
# The default value is: YES.
WARNINGS = YES
# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
# will automatically be disabled.
# The default value is: YES.
WARN_IF_UNDOCUMENTED = YES
# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some parameters
# in a documented function, or documenting parameters that don't exist or using
# markup commands wrongly.
# The default value is: YES.
WARN_IF_DOC_ERROR = YES
# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
# are documented, but have no documentation for their parameters or return
# value. If set to NO doxygen will only warn about wrong or incomplete parameter
# documentation, but not about the absence of documentation.
# The default value is: NO.
WARN_NO_PARAMDOC = NO
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
# can produce. The string should contain the $file, $line, and $text tags, which
# will be replaced by the file and line number from which the warning originated
# and the warning text. Optionally the format may contain $version, which will
# be replaced by the version of the file (if it could be obtained via
# FILE_VERSION_FILTER)
# The default value is: $file:$line: $text.
WARN_FORMAT = "$file:$line: $text"
# The WARN_LOGFILE tag can be used to specify a file to which warning and error
# messages should be written. If left blank the output is written to standard
# error (stderr).
WARN_LOGFILE =
#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag is used to specify the files and/or directories that contain
# documented source files. You may enter file names like myfile.cpp or
# directories like /usr/src/myproject. Separate the files or directories with
# spaces.
# Note: If this tag is empty the current directory is searched.
INPUT = "@PLUGIN_DOXYGEN_INPUT_DIR@"
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
# documentation (see: http://www.gnu.org/software/libiconv) for the list of
# possible encodings.
# The default value is: UTF-8.
INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
# *.h) to filter out the source-files in the directories. If left blank the
# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
# *.qsf, *.as and *.js.
FILE_PATTERNS = *.dox
# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
# The default value is: NO.
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
#
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
# The default value is: NO.
EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories.
#
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS =
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
#
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*
EXCLUDE_SYMBOLS =
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
# that contain example code fragments that are included (see the \include
# command).
EXAMPLE_PATH =
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
# *.h) to filter out the source-files in the directories. If left blank all
# files are included.
EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude commands
# irrespective of the value of the RECURSIVE tag.
# The default value is: NO.
EXAMPLE_RECURSIVE = NO
# The IMAGE_PATH tag can be used to specify one or more files or directories
# that contain images that are to be included in the documentation (see the
# \image command).
IMAGE_PATH = "@PLUGIN_DOXYGEN_INPUT_DIR@"
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
# by executing (via popen()) the command:
#
# <filter> <input-file>
#
# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
# name of an input file. Doxygen will then use the output that the filter
# program writes to standard output. If FILTER_PATTERNS is specified, this tag
# will be ignored.
#
# Note that the filter must not add or remove lines; it is applied before the
# code is scanned, but not when the output code is generated. If lines are added
# or removed, the anchors will not be placed correctly.
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis. Doxygen will compare the file name with each pattern and apply the
# filter if there is a match. The filters are a list of the form: pattern=filter
# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
# patterns match the file name, INPUT_FILTER is applied.
FILTER_PATTERNS =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER ) will also be used to filter the input files that are used for
# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
# The default value is: NO.
FILTER_SOURCE_FILES = NO
# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
# it is also possible to disable source filtering for a specific pattern using
# *.ext= (so without naming a filter).
# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
FILTER_SOURCE_PATTERNS =
# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
# is part of the input, its contents will be placed on the main page
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.
USE_MDFILE_AS_MAINPAGE =
#---------------------------------------------------------------------------
# Configuration options related to source browsing
#---------------------------------------------------------------------------
# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
# generated. Documented entities will be cross-referenced with these sources.
#
# Note: To get rid of all source code in the generated output, make sure that
# also VERBATIM_HEADERS is set to NO.
# The default value is: NO.
SOURCE_BROWSER = NO
# Setting the INLINE_SOURCES tag to YES will include the body of functions,
# classes and enums directly into the documentation.
# The default value is: NO.
INLINE_SOURCES = YES
# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
# special comment blocks from generated source code fragments. Normal C, C++ and
# Fortran comments will always remain visible.
# The default value is: YES.
STRIP_CODE_COMMENTS = YES
# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
# function all documented functions referencing it will be listed.
# The default value is: NO.
REFERENCED_BY_RELATION = YES
# If the REFERENCES_RELATION tag is set to YES then for each documented function
# all documented entities called/used by that function will be listed.
# The default value is: NO.
REFERENCES_RELATION = YES
# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
# link to the documentation.
# The default value is: YES.
REFERENCES_LINK_SOURCE = YES
# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
# source code will show a tooltip with additional information such as prototype,
# brief description and links to the definition and documentation. Since this
# will make the HTML file larger and loading of large files a bit slower, you
# can opt to disable this feature.
# The default value is: YES.
# This tag requires that the tag SOURCE_BROWSER is set to YES.
SOURCE_TOOLTIPS = YES
# If the USE_HTAGS tag is set to YES then the references to source code will
# point to the HTML generated by the htags(1) tool instead of doxygen built-in
# source browser. The htags tool is part of GNU's global source tagging system
# (see http://www.gnu.org/software/global/global.html). You will need version
# 4.8.6 or higher.
#
# To use it do the following:
# - Install the latest version of global
# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
# - Make sure the INPUT points to the root of the source tree
# - Run doxygen as normal
#
# Doxygen will invoke htags (and that will in turn invoke gtags), so these
# tools must be available from the command line (i.e. in the search path).
#
# The result: instead of the source browser generated by doxygen, the links to
# source code will now point to the output of htags.
# The default value is: NO.
# This tag requires that the tag SOURCE_BROWSER is set to YES.
USE_HTAGS = NO
# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
# verbatim copy of the header file for each class for which an include is
# specified. Set to NO to disable this.
# See also: Section \class.
# The default value is: YES.
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
# compounds will be generated. Enable this if the project contains a lot of
# classes, structs, unions or interfaces.
# The default value is: YES.
ALPHABETICAL_INDEX = NO
# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
# which the alphabetical index list will be split.
# Minimum value: 1, maximum value: 20, default value: 5.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
COLS_IN_ALPHA_INDEX = 3
# In case all classes in a project start with a common prefix, all classes will
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
# can be used to specify a prefix (or a list of prefixes) that should be ignored
# while generating the index headers.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the HTML output
#---------------------------------------------------------------------------
# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
# The default value is: YES.
GENERATE_HTML = YES
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: html.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_OUTPUT = html
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
# generated HTML page (for example: .htm, .php, .asp).
# The default value is: .html.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FILE_EXTENSION = .html
# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
# each generated HTML page. If the tag is left blank doxygen will generate a
# standard header.
#
# To get valid HTML the header file that includes any scripts and style sheets
# that doxygen needs, which is dependent on the configuration options used (e.g.
# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
# default header using
# doxygen -w html new_header.html new_footer.html new_stylesheet.css
# YourConfigFile
# and then modify the file new_header.html. See also section "Doxygen usage"
# for information on how to generate the default header that doxygen normally
# uses.
# Note: The header is subject to change so you typically have to regenerate the
# default header when upgrading to a newer version of doxygen. For a description
# of the possible markers and block names see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
# generated HTML page. If the tag is left blank doxygen will generate a standard
# footer. See HTML_HEADER for more information on how to generate a default
# footer and what special commands can be used inside the footer. See also
# section "Doxygen usage" for information on how to generate the default footer
# that doxygen normally uses.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
# sheet that is used by each HTML page. It can be used to fine-tune the look of
# the HTML output. If left blank doxygen will generate a default style sheet.
# See also section "Doxygen usage" for information on how to generate the style
# sheet that doxygen normally uses.
# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
# it is more robust and this tag (HTML_STYLESHEET) will in the future become
# obsolete.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_STYLESHEET =
# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
# cascading style sheets that are included after the standard style sheets
# created by doxygen. Using this option one can overrule certain style aspects.
# This is preferred over using HTML_STYLESHEET since it does not replace the
# standard style sheet and is therefor more robust against future updates.
# Doxygen will copy the style sheet files to the output directory.
# Note: The order of the extra stylesheet files is of importance (e.g. the last
# stylesheet in the list overrules the setting of the previous ones in the
# list). For an example see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_STYLESHEET =
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
# that these files will be copied to the base HTML output directory. Use the
# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
# files will be copied as-is; there are no commands or markers available.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_FILES =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
# will adjust the colors in the stylesheet and background images according to
# this color. Hue is specified as an angle on a colorwheel, see
# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
# purple, and 360 is red again.
# Minimum value: 0, maximum value: 359, default value: 220.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_HUE = 220
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
# in the HTML output. For a value of 0 the output will use grayscales only. A
# value of 255 will produce the most vivid colors.
# Minimum value: 0, maximum value: 255, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_SAT = 100
# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
# luminance component of the colors in the HTML output. Values below 100
# gradually make the output lighter, whereas values above 100 make the output
# darker. The value divided by 100 is the actual gamma applied, so 80 represents
# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
# change the gamma.
# Minimum value: 40, maximum value: 240, default value: 80.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_GAMMA = 80
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting this
# to NO can help when comparing the output of multiple runs.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_TIMESTAMP = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_DYNAMIC_SECTIONS = NO
# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
# shown in the various tree structured indices initially; the user can expand
# and collapse entries dynamically later on. Doxygen will expand the tree to
# such a level that at most the specified number of entries are visible (unless
# a fully collapsed tree already exceeds this amount). So setting the number of
# entries 1 will produce a full collapsed tree by default. 0 is a special value
# representing an infinite number of entries and will result in a full expanded
# tree by default.
# Minimum value: 0, maximum value: 9999, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_INDEX_NUM_ENTRIES = 100
# If the GENERATE_DOCSET tag is set to YES, additional index files will be
# generated that can be used as input for Apple's Xcode 3 integrated development
# environment (see: http://developer.apple.com/tools/xcode/), introduced with
# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
# Makefile in the HTML output directory. Running make will produce the docset in
# that directory and running make install will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
# for more information.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_DOCSET = NO
# This tag determines the name of the docset feed. A documentation feed provides
# an umbrella under which multiple documentation sets from a single provider
# (such as a company or product suite) can be grouped.
# The default value is: Doxygen generated docs.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_FEEDNAME = "Doxygen generated docs"
# This tag specifies a string that should uniquely identify the documentation
# set bundle. This should be a reverse domain-name style string, e.g.
# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_BUNDLE_ID = org.doxygen.Project
# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
# the documentation publisher. This should be a reverse domain-name style
# string, e.g. com.mycompany.MyDocSet.documentation.
# The default value is: org.doxygen.Publisher.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
# The default value is: Publisher.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_NAME = Publisher
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
# Windows.
#
# The HTML Help Workshop contains a compiler that can convert all HTML output
# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
# files are now used as the Windows 98 help format, and will replace the old
# Windows help format (.hlp) on all Windows platforms in the future. Compressed
# HTML files also contain an index, a table of contents, and you can search for
# words in the documentation. The HTML workshop also contains a viewer for
# compressed HTML files.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_HTMLHELP = NO
# The CHM_FILE tag can be used to specify the file name of the resulting .chm
# file. You can add a path in front of the file if the result should not be
# written to the html output directory.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_FILE =
# The HHC_LOCATION tag can be used to specify the location (absolute path
# including file name) of the HTML help compiler ( hhc.exe). If non-empty
# doxygen will try to run the HTML help compiler on the generated index.hhp.
# The file has to be specified with full path.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
HHC_LOCATION =
# The GENERATE_CHI flag controls if a separate .chi index file is generated (
# YES) or that it should be included in the master .chm file ( NO).
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
GENERATE_CHI = NO
# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
# and project file content.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_INDEX_ENCODING =
# The BINARY_TOC flag controls whether a binary table of contents is generated (
# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it
# enables the Previous and Next buttons.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
BINARY_TOC = NO
# The TOC_EXPAND flag can be set to YES to add extra items for group members to
# the table of contents of the HTML help documentation and to the tree view.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
TOC_EXPAND = NO
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
# (.qch) of the generated HTML documentation.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_QHP = YES
# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
# the file name of the resulting .qch file. The path specified is relative to
# the HTML output folder.
# This tag requires that the tag GENERATE_QHP is set to YES.
QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace
# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_NAMESPACE = @Plugin-SymbolicName@
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
# Help Project output. For more information please see Qt Help Project / Virtual
# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
# folders).
# The default value is: doc.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_VIRTUAL_FOLDER = bundle
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
# filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_NAME = @PLUGIN_QHP_CUST_FILTER_NAME@
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_ATTRS = @PLUGIN_QHP_CUST_FILTER_ATTRS@
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS = @PLUGIN_QHP_SECT_FILTER_ATTRS@
# The QHG_LOCATION tag can be used to specify the location of Qt's
# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
# generated .qhp file.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHG_LOCATION =
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
# generated, together with the HTML files, they form an Eclipse help plugin. To
# install this plugin and make it available under the help contents menu in
# Eclipse, the contents of the directory containing the HTML and XML files needs
# to be copied into the plugins directory of eclipse. The name of the directory
# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
# After copying Eclipse needs to be restarted before the help appears.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_ECLIPSEHELP = NO
# A unique identifier for the Eclipse help plugin. When installing the plugin
# the directory name containing the HTML and XML files should also have this
# name. Each documentation set should have its own identifier.
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
ECLIPSE_DOC_ID = org.doxygen.Project
# If you want full control over the layout of the generated HTML pages it might
# be necessary to disable the index and replace it with your own. The
# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
# of each HTML page. A value of NO enables the index and the value YES disables
# it. Since the tabs in the index contain the same information as the navigation
# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
DISABLE_INDEX = YES
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
# structure should be generated to display hierarchical information. If the tag
# value is set to YES, a side panel will be generated containing a tree-like
# index structure (just like the one that is generated for HTML Help). For this
# to work a browser that supports JavaScript, DHTML, CSS and frames is required
# (i.e. any modern browser). Windows users are probably better off using the
# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
# further fine-tune the look of the index. As an example, the default style
# sheet generated by doxygen has an example that shows how to put an image at
# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
# the same information as the tab index, you could consider setting
# DISABLE_INDEX to YES when enabling this option.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_TREEVIEW = NO
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
# doxygen will group on one line in the generated HTML documentation.
#
# Note that a value of 0 will completely suppress the enum values from appearing
# in the overview section.
# Minimum value: 0, maximum value: 20, default value: 4.
# This tag requires that the tag GENERATE_HTML is set to YES.
ENUM_VALUES_PER_LINE = 4
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
# to set the initial width (in pixels) of the frame in which the tree is shown.
# Minimum value: 0, maximum value: 1500, default value: 250.
# This tag requires that the tag GENERATE_HTML is set to YES.
TREEVIEW_WIDTH = 250
# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
# external symbols imported via tag files in a separate window.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
EXT_LINKS_IN_WINDOW = NO
# Use this tag to change the font size of LaTeX formulas included as images in
# the HTML documentation. When you change the font size after a successful
# doxygen run you need to manually remove any form_*.png images from the HTML
# output directory to force them to be regenerated.
# Minimum value: 8, maximum value: 50, default value: 10.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_FONTSIZE = 10
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not
# supported properly for IE 6.0, but are supported on all modern browsers.
#
# Note that when changing this option you need to delete any form_*.png files in
# the HTML output directory before the changes have effect.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_TRANSPARENT = YES
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
# http://www.mathjax.org) which uses client side Javascript for the rendering
# instead of using prerendered bitmaps. Use this if you do not have LaTeX
# installed or if you want to formulas look prettier in the HTML output. When
# enabled you may also need to install MathJax separately and configure the path
# to it using the MATHJAX_RELPATH option.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
USE_MATHJAX = NO
# When MathJax is enabled you can set the default output format to be used for
# the MathJax output. See the MathJax site (see:
# http://docs.mathjax.org/en/latest/output.html) for more details.
# Possible values are: HTML-CSS (which is slower, but has the best
# compatibility), NativeMML (i.e. MathML) and SVG.
# The default value is: HTML-CSS.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_FORMAT = HTML-CSS
# When MathJax is enabled you need to specify the location relative to the HTML
# output directory using the MATHJAX_RELPATH option. The destination directory
# should contain the MathJax.js script. For instance, if the mathjax directory
# is located at the same level as the HTML output directory, then
# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
# Content Delivery Network so you can quickly see the result without installing
# MathJax. However, it is strongly recommended to install a local copy of
# MathJax from http://www.mathjax.org before deployment.
# The default value is: http://cdn.mathjax.org/mathjax/latest.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
# extension names that should be enabled during MathJax rendering. For example
# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_EXTENSIONS =
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
# of code that will be used on startup of the MathJax code. See the MathJax site
# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
# example see the documentation.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_CODEFILE =
# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
# the HTML output. The underlying search engine uses javascript and DHTML and
# should work on any modern browser. Note that when using HTML help
# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
# there is already a search function so this one should typically be disabled.
# For large projects the javascript based search engine can be slow, then
# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
# search using the keyboard; to jump to the search box use <access key> + S
# (what the <access key> is depends on the OS and browser, but it is typically
# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
# key> to jump into the search results window, the results can be navigated
# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
# the search. The filter options can be selected when the cursor is inside the
# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
# to select a filter and <Enter> or <escape> to activate or cancel the filter
# option.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
SEARCHENGINE = NO
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
# implemented using a web server instead of a web client using Javascript. There
# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
# setting. When disabled, doxygen will generate a PHP script for searching and
# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
# and searching needs to be provided by external tools. See the section
# "External Indexing and Searching" for details.
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
SERVER_BASED_SEARCH = NO
# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
# script for searching. Instead the search results are written to an XML file
# which needs to be processed by an external indexer. Doxygen will invoke an
# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
# search results.
#
# Doxygen ships with an example indexer ( doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: http://xapian.org/).
#
# See the section "External Indexing and Searching" for details.
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH = NO
# The SEARCHENGINE_URL should point to a search engine hosted by a web server
# which will return the search results when EXTERNAL_SEARCH is enabled.
#
# Doxygen ships with an example indexer ( doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: http://xapian.org/). See the section "External Indexing and
# Searching" for details.
# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHENGINE_URL =
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
# search data is written to a file for indexing by an external tool. With the
# SEARCHDATA_FILE tag the name of this file can be specified.
# The default file is: searchdata.xml.
# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHDATA_FILE = searchdata.xml
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
# projects and redirect the results back to the right project.
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH_ID =
# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
# projects other than the one defined by this configuration file, but that are
# all added to the same external search index. Each project needs to have a
# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
# to a relative location where the documentation can be found. The format is:
# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
# The default value is: YES.
GENERATE_LATEX = NO
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked.
#
# Note that when enabling USE_PDFLATEX this option is only used for generating
# bitmaps for formulas in the HTML output, but not in the Makefile that is
# written to the output directory.
# The default file is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_CMD_NAME = latex
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
# index for LaTeX.
# The default file is: makeindex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
MAKEINDEX_CMD_NAME = makeindex
# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
# documents. This may be useful for small projects and may help to save some
# trees in general.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used by the
# printer.
# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
# 14 inches) and executive (7.25 x 10.5 inches).
# The default value is: a4.
# This tag requires that the tag GENERATE_LATEX is set to YES.
PAPER_TYPE = a4wide
# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
# that should be included in the LaTeX output. To get the times font for
# instance you can specify
# EXTRA_PACKAGES=times
# If left blank no extra packages will be included.
# This tag requires that the tag GENERATE_LATEX is set to YES.
EXTRA_PACKAGES =
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
# generated LaTeX document. The header should contain everything until the first
# chapter. If it is left blank doxygen will generate a standard header. See
# section "Doxygen usage" for information on how to let doxygen write the
# default header to a separate file.
#
# Note: Only use a user-defined header if you know what you are doing! The
# following commands have a special meaning inside the header: $title,
# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
# $projectbrief, $projectlogo. Doxygen will replace $title with the empy string,
# for the replacement values of the other commands the user is refered to
# HTML_HEADER.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HEADER =
# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
# generated LaTeX document. The footer should contain everything after the last
# chapter. If it is left blank doxygen will generate a standard footer. See
# LATEX_HEADER for more information on how to generate a default footer and what
# special commands can be used inside the footer.
#
# Note: Only use a user-defined footer if you know what you are doing!
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_FOOTER =
# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the LATEX_OUTPUT output
# directory. Note that the files will be copied as-is; there are no commands or
# markers available.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_EXTRA_FILES =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
# contain links (just like the HTML output) instead of page references. This
# makes the output suitable for online browsing using a PDF viewer.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.
PDF_HYPERLINKS = NO
# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
# the PDF file directly from the LaTeX files. Set this option to YES to get a
# higher quality PDF documentation.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.
USE_PDFLATEX = NO
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
# command to the generated LaTeX files. This will instruct LaTeX to keep running
# if errors occur, instead of asking the user for help. This option is also used
# when generating formulas in HTML.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BATCHMODE = NO
# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
# index chapters (such as File Index, Compound Index, etc.) in the output.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HIDE_INDICES = NO
# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
# code with syntax highlighting in the LaTeX output.
#
# Note that which sources are shown also depends on other settings such as
# SOURCE_BROWSER.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_SOURCE_CODE = NO
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
# bibliography, e.g. plainnat, or ieeetr. See
# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
# The default value is: plain.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BIB_STYLE = plain
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
# RTF output is optimized for Word 97 and may not look too pretty with other RTF
# readers/editors.
# The default value is: NO.
GENERATE_RTF = NO
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: rtf.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_OUTPUT = rtf
# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
# documents. This may be useful for small projects and may help to save some
# trees in general.
# The default value is: NO.
# This tag requires that the tag GENERATE_RTF is set to YES.
COMPACT_RTF = NO
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
# contain hyperlink fields. The RTF file will contain links (just like the HTML
# output) instead of page references. This makes the output suitable for online
# browsing using Word or some other Word compatible readers that support those
# fields.
#
# Note: WordPad (write) and others do not support links.
# The default value is: NO.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's config
# file, i.e. a series of assignments. You only have to provide replacements,
# missing definitions are set to their default value.
#
# See also section "Doxygen usage" for information on how to generate the
# default style sheet that doxygen normally uses.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an RTF document. Syntax is
# similar to doxygen's config file. A template extensions file can be generated
# using doxygen -e rtf extensionFile.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# Configuration options related to the man page output
#---------------------------------------------------------------------------
# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
# classes and files.
# The default value is: NO.
GENERATE_MAN = NO
# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it. A directory man3 will be created inside the directory specified by
# MAN_OUTPUT.
# The default directory is: man.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_OUTPUT = man
# The MAN_EXTENSION tag determines the extension that is added to the generated
# man pages. In case the manual section does not start with a number, the number
# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
# optional.
# The default value is: .3.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_EXTENSION = .3
# The MAN_SUBDIR tag determines the name of the directory created within
# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
# MAN_EXTENSION with the initial . removed.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_SUBDIR =
# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
# will generate one additional man file for each entity documented in the real
# man page(s). These additional files only source the real man page, but without
# them the man command would be unable to find the correct page.
# The default value is: NO.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_LINKS = NO
#---------------------------------------------------------------------------
# Configuration options related to the XML output
#---------------------------------------------------------------------------
# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
# captures the structure of the code including all documentation.
# The default value is: NO.
GENERATE_XML = NO
# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: xml.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_OUTPUT = xml
# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
# listings (including syntax highlighting and cross-referencing information) to
# the XML output. Note that enabling this will significantly increase the size
# of the XML output.
# The default value is: YES.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
# that can be used to generate PDF.
# The default value is: NO.
GENERATE_DOCBOOK = NO
# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
# front of it.
# The default directory is: docbook.
# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
DOCBOOK_OUTPUT = docbook
# If the DOCBOOK_PROGRAMLISTING tag is set to YES doxygen will include the
# program listings (including syntax highlighting and cross-referencing
# information) to the DOCBOOK output. Note that enabling this will significantly
# increase the size of the DOCBOOK output.
# The default value is: NO.
# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
DOCBOOK_PROGRAMLISTING = NO
#---------------------------------------------------------------------------
# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
# Definitions (see http://autogen.sf.net) file that captures the structure of
# the code including all documentation. Note that this feature is still
# experimental and incomplete at the moment.
# The default value is: NO.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# Configuration options related to the Perl module output
#---------------------------------------------------------------------------
# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
# file that captures the structure of the code including all documentation.
#
# Note that this feature is still experimental and incomplete at the moment.
# The default value is: NO.
GENERATE_PERLMOD = NO
# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
# output from the Perl module output.
# The default value is: NO.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_LATEX = NO
# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
# formatted so it can be parsed by a human reader. This is useful if you want to
# understand what is going on. On the other hand, if this tag is set to NO the
# size of the Perl module output will be much smaller and Perl will parse it
# just the same.
# The default value is: YES.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_PRETTY = YES
# The names of the make variables in the generated doxyrules.make file are
# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
# so different doxyrules.make files included by the same Makefile don't
# overwrite each other's variables.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
# C-preprocessor directives found in the sources and include files.
# The default value is: YES.
ENABLE_PREPROCESSING = YES
# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
# in the source code. If set to NO only conditional compilation will be
# performed. Macro expansion can be done in a controlled way by setting
# EXPAND_ONLY_PREDEF to YES.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
MACRO_EXPANSION = YES
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
# the macro expansion is limited to the macros specified with the PREDEFINED and
# EXPAND_AS_DEFINED tags.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES the includes files in the
# INCLUDE_PATH will be searched if a #include is found.
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by the
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
# directories. If left blank, the patterns specified with FILE_PATTERNS will be
# used.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that are
# defined before the preprocessor is started (similar to the -D option of e.g.
# gcc). The argument of the tag is a list of macros of the form: name or
# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
# is assumed. To prevent a macro definition from being undefined via #undef or
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
# macro definition that is found in the sources will be used. Use the PREDEFINED
# tag if you want to use a different macro definition that overrules the
# definition found in the source code.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
# remove all references to function-like macros that are alone on a line, have
# an all uppercase name, and do not end with a semicolon. Such function macros
# are typically used for boiler-plate code, and will confuse the parser if not
# removed.
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration options related to external references
#---------------------------------------------------------------------------
# The TAGFILES tag can be used to specify one or more tag files. For each tag
# file the location of the external documentation should be added. The format of
# a tag file without this location is as follows:
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
# TAGFILES = file1=loc1 "file2 = loc2" ...
# where loc1 and loc2 can be relative or absolute paths or URLs. See the
# section "Linking to external documentation" for more information about the use
# of tag files.
# Note: Each tag file must have a unique name (where the name does NOT include
# the path). If a tag file is not located in the directory in which doxygen is
# run, you must also specify the path to the tagfile here.
TAGFILES = @PLUGIN_DOXYGEN_TAGFILES@
# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
# tag file that is based on the input files it reads. See section "Linking to
# external documentation" for more information about the usage of tag files.
GENERATE_TAGFILE = "@PLUGIN_DOXYGEN_OUTPUT_DIR@/@PROJECT_NAME@.tag"
# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
# class index. If set to NO only the inherited external classes will be listed.
# The default value is: NO.
ALLEXTERNALS = NO
# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
# the modules index. If set to NO, only the current project's groups will be
# listed.
# The default value is: YES.
EXTERNAL_GROUPS = YES
# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
# the related pages index. If set to NO, only the current project's pages will
# be listed.
# The default value is: YES.
EXTERNAL_PAGES = YES
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of 'which perl').
-# The default file (with absolute path) is: /usr/bin/perl.
-
-PERL_PATH = /usr/bin/perl
-
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
# NO turns the diagrams off. Note that this option also works with HAVE_DOT
# disabled, but it is recommended to install and use dot, since it yields more
# powerful graphs.
# The default value is: YES.
CLASS_DIAGRAMS = YES
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see:
-# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
# You can include diagrams made with dia in doxygen documentation. Doxygen will
# then run dia to produce the diagram and insert it in the documentation. The
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
# If left empty dia is assumed to be found in the default search path.
DIA_PATH =
# If set to YES, the inheritance and collaboration graphs will hide inheritance
# and usage relations if the target is undocumented or is not a class.
# The default value is: YES.
HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz (see:
# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
# Bell Labs. The other options in this section have no effect if this option is
# set to NO
# The default value is: NO.
HAVE_DOT = NO
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
# to run in parallel. When set to 0 doxygen will base this on the number of
# processors available in the system. You can set it explicitly to a value
# larger than 0 to get control over the balance between CPU load and processing
# speed.
# Minimum value: 0, maximum value: 32, default value: 0.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_NUM_THREADS = 0
# When you want a differently looking font in the dot files that doxygen
# generates you can specify the font name using DOT_FONTNAME. You need to make
# sure dot is able to find the font, which can be done by putting it in a
# standard location or by setting the DOTFONTPATH environment variable or by
# setting DOT_FONTPATH to the directory containing the font.
# The default value is: Helvetica.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTNAME = Helvetica
# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
# dot graphs.
# Minimum value: 4, maximum value: 24, default value: 10.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTSIZE = 10
# By default doxygen will tell dot to use the default font as specified with
# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
# the path where dot can find it using this tag.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTPATH =
# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
# each documented class showing the direct and indirect inheritance relations.
# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
CLASS_GRAPH = YES
# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
# graph for each documented class showing the direct and indirect implementation
# dependencies (inheritance, containment, and class references variables) of the
# class with other documented classes.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
COLLABORATION_GRAPH = YES
# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
# groups, showing the direct groups dependencies.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GROUP_GRAPHS = YES
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
UML_LOOK = NO
# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
# class node. If there are many fields or methods and many nodes the graph may
# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
# number of items for each type to make the size more manageable. Set this to 0
# for no limit. Note that the threshold may be exceeded by 50% before the limit
# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
# but if the number exceeds 15, the total amount of fields shown is limited to
# 10.
# Minimum value: 0, maximum value: 100, default value: 10.
# This tag requires that the tag HAVE_DOT is set to YES.
UML_LIMIT_NUM_FIELDS = 10
# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
# collaboration graphs will show the relations between templates and their
# instances.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
TEMPLATE_RELATIONS = YES
# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
# YES then doxygen will generate a graph for each documented file showing the
# direct and indirect include dependencies of the file with other documented
# files.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDE_GRAPH = YES
# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
# set to YES then doxygen will generate a graph for each documented file showing
# the direct and indirect include dependencies of the file with other documented
# files.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDED_BY_GRAPH = YES
# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
# dependency graph for every global function or class method.
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable call graphs for selected
# functions only using the \callgraph command.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
CALL_GRAPH = NO
# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
# dependency graph for every global function or class method.
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable caller graphs for selected
# functions only using the \callergraph command.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
CALLER_GRAPH = NO
# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
# hierarchy of all classes instead of a textual one.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GRAPHICAL_HIERARCHY = YES
# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
# dependencies a directory has on other directories in a graphical way. The
# dependency relations are determined by the #include relations between the
# files in the directories.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot.
# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
# to make the SVG files visible in IE 9+ (other browsers do not have this
# requirement).
# Possible values are: png, jpg, gif and svg.
# The default value is: png.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_IMAGE_FORMAT = png
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
# enable generation of interactive SVG images that allow zooming and panning.
#
# Note that this requires a modern browser other than Internet Explorer. Tested
# and working are Firefox, Chrome, Safari, and Opera.
# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
# the SVG files visible. Older versions of IE do not have SVG support.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
INTERACTIVE_SVG = NO
# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_PATH =
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the \dotfile
# command).
# This tag requires that the tag HAVE_DOT is set to YES.
DOTFILE_DIRS =
# The MSCFILE_DIRS tag can be used to specify one or more directories that
# contain msc files that are included in the documentation (see the \mscfile
# command).
MSCFILE_DIRS =
# The DIAFILE_DIRS tag can be used to specify one or more directories that
# contain dia files that are included in the documentation (see the \diafile
# command).
DIAFILE_DIRS =
# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
# path where java can find the plantuml.jar file. If left blank, it is assumed
# PlantUML is not used or called during a preprocessing step. Doxygen will
# generate a warning when it encounters a \startuml command in this case and
# will not generate output for the diagram.
# This tag requires that the tag HAVE_DOT is set to YES.
PLANTUML_JAR_PATH =
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
# that will be shown in the graph. If the number of nodes in a graph becomes
# larger than this value, doxygen will truncate the graph, which is visualized
# by representing a node as a red box. Note that doxygen if the number of direct
# children of the root node in a graph is already larger than
# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
# Minimum value: 0, maximum value: 10000, default value: 50.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_GRAPH_MAX_NODES = 50
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
# generated by dot. A depth value of 3 means that only nodes reachable from the
# root by following a path via at most 3 edges will be shown. Nodes that lay
# further from the root node will be omitted. Note that setting this option to 1
# or 2 may greatly reduce the computation time needed for large code bases. Also
# note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
# Minimum value: 0, maximum value: 1000, default value: 0.
# This tag requires that the tag HAVE_DOT is set to YES.
MAX_DOT_GRAPH_DEPTH = 0
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
# background. This is disabled by default, because dot on Windows does not seem
# to support this out of the box.
#
# Warning: Depending on the platform used, enabling this option may lead to
# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
# read).
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_TRANSPARENT = NO
# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
# makes dot run faster, but since only newer versions of dot (>1.8.10) support
# this, this feature is disabled by default.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_MULTI_TARGETS = YES
# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
# explaining the meaning of the various boxes and arrows in the dot generated
# graphs.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GENERATE_LEGEND = YES
# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
# files that are used to generate the various graphs.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_CLEANUP = YES
diff --git a/Documentation/doxygen_users_guide.conf.in b/Documentation/doxygen_users_guide.conf.in
index dd75b7738c..4cc098ed88 100644
--- a/Documentation/doxygen_users_guide.conf.in
+++ b/Documentation/doxygen_users_guide.conf.in
@@ -1,2347 +1,2332 @@
# Doxyfile 1.8.8
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a double hash (##) is considered a comment and is placed in
# front of the TAG it is preceding.
#
# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
# TAG = value [value, ...]
# For lists, items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (\" \").
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the config file
# that follow. The default is UTF-8 which is also the encoding used for all text
# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
# for the list of possible encodings.
# The default value is: UTF-8.
DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
# double-quotes, unless you are using Doxywizard) that should identify the
# project for which the documentation is generated. This name is used in the
# title of most generated pages and in a few other places.
# The default value is: My Project.
PROJECT_NAME = MITK
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = @MITK_VERSION_STRING@
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF = "Medical Imaging Interaction Toolkit"
# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
# the documentation. The maximum height of the logo should not exceed 55 pixels
# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
# to the output directory.
PROJECT_LOGO =
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
-OUTPUT_DIRECTORY = @MITK_DOXYGEN_OUTPUT_DIR@/Guides/Users_Guide/
+OUTPUT_DIRECTORY = "@MITK_DOXYGEN_OUTPUT_DIR@/Guides/Users_Guide/"
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
# will distribute the generated files over these directories. Enabling this
# option can be useful when feeding doxygen a huge amount of source files, where
# putting all generated files in the same directory would otherwise causes
# performance problems for the file system.
# The default value is: NO.
CREATE_SUBDIRS = NO
# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
# characters to appear in the names of generated files. If set to NO, non-ASCII
# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
# U+3044.
# The default value is: NO.
ALLOW_UNICODE_NAMES = NO
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
# Ukrainian and Vietnamese.
# The default value is: English.
OUTPUT_LANGUAGE = English
# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
# descriptions after the members that are listed in the file and class
# documentation (similar to Javadoc). Set to NO to disable this.
# The default value is: YES.
BRIEF_MEMBER_DESC = YES
# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
# description of a member or function before the detailed description
#
# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
# The default value is: YES.
REPEAT_BRIEF = YES
# This tag implements a quasi-intelligent brief description abbreviator that is
# used to form the text in various listings. Each string in this list, if found
# as the leading text of the brief description, will be stripped from the text
# and the result, after processing the whole list, is used as the annotated
# text. Otherwise, the brief description is used as-is. If left blank, the
# following values are used ($name is automatically replaced with the name of
# the entity):The $name class, The $name widget, The $name file, is, provides,
# specifies, contains, represents, a, an and the.
ABBREVIATE_BRIEF =
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# doxygen will generate a detailed section even if there is only a brief
# description.
# The default value is: NO.
ALWAYS_DETAILED_SEC = NO
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
# The default value is: NO.
INLINE_INHERITED_MEMB = NO
# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
# before files name in the file list and in the header files. If set to NO the
# shortest path that makes the file name unique will be used
# The default value is: YES.
FULL_PATH_NAMES = NO
# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
# Stripping is only done if one of the specified strings matches the left-hand
# part of the path. The tag can be used to show relative paths in the file list.
# If left blank the directory from which doxygen is run is used as the path to
# strip.
#
# Note that you can specify absolute paths here, but also relative paths, which
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
STRIP_FROM_PATH =
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
# header file to include in order to use a class. If left blank only the name of
# the header file containing the class definition is used. Otherwise one should
# specify the list of include paths that are normally passed to the compiler
# using the -I flag.
STRIP_FROM_INC_PATH =
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
# less readable) file names. This can be useful is your file systems doesn't
# support long names like on DOS, Mac, or CD-ROM.
# The default value is: NO.
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
# first line (until the first dot) of a Javadoc-style comment as the brief
# description. If set to NO, the Javadoc-style will behave just like regular Qt-
# style comments (thus requiring an explicit @brief command for a brief
# description.)
# The default value is: NO.
JAVADOC_AUTOBRIEF = NO
# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
# line (until the first dot) of a Qt-style comment as the brief description. If
# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
# requiring an explicit \brief command for a brief description.)
# The default value is: NO.
QT_AUTOBRIEF = NO
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
# a brief description. This used to be the default behavior. The new default is
# to treat a multi-line C++ comment block as a detailed description. Set this
# tag to YES if you prefer the old behavior instead.
#
# Note that setting this tag to YES also means that rational rose comments are
# not recognized any more.
# The default value is: NO.
MULTILINE_CPP_IS_BRIEF = NO
# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
# documentation from any documented member that it re-implements.
# The default value is: YES.
INHERIT_DOCS = YES
# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
# new page for each member. If set to NO, the documentation of a member will be
# part of the file/class/namespace that contains it.
# The default value is: NO.
SEPARATE_MEMBER_PAGES = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
# uses this value to replace tabs by spaces in code fragments.
# Minimum value: 1, maximum value: 16, default value: 4.
TAB_SIZE = 8
# This tag can be used to specify a number of aliases that act as commands in
# the documentation. An alias has the form:
# name=value
# For example adding
# "sideeffect=@par Side Effects:\n"
# will allow you to put the command \sideeffect (or @sideeffect) in the
# documentation, which will result in a user-defined paragraph with heading
# "Side Effects:". You can put \n's in the value part of an alias to insert
# newlines.
ALIASES = "FIXME=\par Fix Me's:\n" \
"BlueBerry=\if BLUEBERRY" \
"endBlueBerry=\endif" \
"bundlemainpage{1}=\page \1" \
"embmainpage{1}=\page \1" \
"github{2}=<a href=\"https://github.com/MITK/MITK/blob/master/\1\">\2</a>" \
"deprecatedSince{1}=\xrefitem deprecatedSince\1 \" Deprecated as of \1\" \"Functions deprecated as of \1\" " \
"minimumCMakeVersion=@MITK_CMAKE_MINIMUM_REQUIRED_VERSION@" \
"minimumQt5Version=@MITK_QT5_MINIMUM_VERSION@" \
"imageMacro{3}=\image html \1 \2 \n \image latex \1 \2 width=\3cm" \
"developersguidemainpage{1}=\page \1 " \
"usersguidemainpage{1}=\mainpage " \
"nondependentPluginLink{3}= \ref \1 \"\3\" "
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
# will allow you to use the command class in the itcl::class meaning.
TCL_SUBST =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For
# instance, some of the names that are used will be different. The list of all
# members will be omitted, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_FOR_C = NO
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
# Python sources only. Doxygen will then generate output that is more tailored
# for that language. For instance, namespaces will be presented as packages,
# qualified scopes will look different, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_JAVA = NO
# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
# sources. Doxygen will then generate output that is tailored for Fortran.
# The default value is: NO.
OPTIMIZE_FOR_FORTRAN = NO
# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
# sources. Doxygen will then generate output that is tailored for VHDL.
# The default value is: NO.
OPTIMIZE_OUTPUT_VHDL = NO
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
# using this tag. The format is ext=language, where ext is a file extension, and
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
# Fortran. In the later case the parser tries to guess whether the code is fixed
# or free formatted code, this is the default for Fortran type files), VHDL. For
# instance to make doxygen treat .inc files as Fortran files (default is PHP),
# and .f files as C (default is Fortran), use: inc=Fortran f=C.
#
# Note For files without extension you can use no_extension as a placeholder.
#
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
# the files are not read by doxygen.
EXTENSION_MAPPING =
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
# according to the Markdown format, which allows for more readable
# documentation. See http://daringfireball.net/projects/markdown/ for details.
# The output of markdown processing is further processed by doxygen, so you can
# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
# case of backward compatibilities issues.
# The default value is: YES.
MARKDOWN_SUPPORT = YES
# When enabled doxygen tries to link words that correspond to documented
# classes, or namespaces to their corresponding documentation. Such a link can
# be prevented in individual cases by by putting a % sign in front of the word
# or globally by setting AUTOLINK_SUPPORT to NO.
# The default value is: YES.
AUTOLINK_SUPPORT = YES
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
# to include (a tag file for) the STL sources as input, then you should set this
# tag to YES in order to let doxygen match functions declarations and
# definitions whose arguments contain STL classes (e.g. func(std::string);
# versus func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
# The default value is: NO.
BUILTIN_STL_SUPPORT = YES
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
# The default value is: NO.
CPP_CLI_SUPPORT = NO
# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
# will parse them like normal C++ but will assume all classes use public instead
# of private inheritance when no explicit protection keyword is present.
# The default value is: NO.
SIP_SUPPORT = NO
# For Microsoft's IDL there are propget and propput attributes to indicate
# getter and setter methods for a property. Setting this option to YES will make
# doxygen to replace the get and set methods by a property in the documentation.
# This will only work if the methods are indeed getting or setting a simple
# type. If this is not the case, or you want to show the methods anyway, you
# should set this option to NO.
# The default value is: YES.
IDL_PROPERTY_SUPPORT = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
# The default value is: NO.
DISTRIBUTE_GROUP_DOC = YES
# Set the SUBGROUPING tag to YES to allow class member groups of the same type
# (for instance a group of public functions) to be put as a subgroup of that
# type (e.g. under the Public Functions section). Set it to NO to prevent
# subgrouping. Alternatively, this can be done per class using the
# \nosubgrouping command.
# The default value is: YES.
SUBGROUPING = YES
# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
# are shown inside the group in which they are included (e.g. using \ingroup)
# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
# and RTF).
#
# Note that this feature does not work in combination with
# SEPARATE_MEMBER_PAGES.
# The default value is: NO.
INLINE_GROUPED_CLASSES = NO
# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
# with only public data fields or simple typedef fields will be shown inline in
# the documentation of the scope in which they are defined (i.e. file,
# namespace, or group documentation), provided this scope is documented. If set
# to NO, structs, classes, and unions are shown on a separate page (for HTML and
# Man pages) or section (for LaTeX and RTF).
# The default value is: NO.
INLINE_SIMPLE_STRUCTS = NO
# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
# enum is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
# namespace, or class. And the struct will be named TypeS. This can typically be
# useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name.
# The default value is: NO.
TYPEDEF_HIDES_STRUCT = NO
# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
# cache is used to resolve symbols given their name and scope. Since this can be
# an expensive process and often the same symbol appears multiple times in the
# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
# doxygen will become slower. If the cache is too large, memory is wasted. The
# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
# symbols. At the end of a run doxygen will report the cache usage and suggest
# the optimal cache size from a speed point of view.
# Minimum value: 0, maximum value: 9, default value: 0.
LOOKUP_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
# documentation are documented, even if no documentation was available. Private
# class members and static file members will be hidden unless the
# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
# Note: This will also disable the warnings about undocumented members that are
# normally produced when WARNINGS is set to YES.
# The default value is: NO.
EXTRACT_ALL = YES
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
# be included in the documentation.
# The default value is: NO.
EXTRACT_PRIVATE = NO
# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
# scope will be included in the documentation.
# The default value is: NO.
EXTRACT_PACKAGE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
# included in the documentation.
# The default value is: NO.
EXTRACT_STATIC = YES
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
# locally in source files will be included in the documentation. If set to NO
# only classes defined in header files are included. Does not have any effect
# for Java sources.
# The default value is: YES.
EXTRACT_LOCAL_CLASSES = @MITK_DOXYGEN_INTERNAL_DOCS@
# This flag is only useful for Objective-C code. When set to YES local methods,
# which are defined in the implementation section but not in the interface are
# included in the documentation. If set to NO only methods in the interface are
# included.
# The default value is: NO.
EXTRACT_LOCAL_METHODS = NO
# If this flag is set to YES, the members of anonymous namespaces will be
# extracted and appear in the documentation as a namespace called
# 'anonymous_namespace{file}', where file will be replaced with the base name of
# the file that contains the anonymous namespace. By default anonymous namespace
# are hidden.
# The default value is: NO.
EXTRACT_ANON_NSPACES = NO
# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
# undocumented members inside documented classes or files. If set to NO these
# members will be included in the various overviews, but no documentation
# section is generated. This option has no effect if EXTRACT_ALL is enabled.
# The default value is: NO.
HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy. If set
# to NO these classes will be included in the various overviews. This option has
# no effect if EXTRACT_ALL is enabled.
# The default value is: NO.
HIDE_UNDOC_CLASSES = NO
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
# (class|struct|union) declarations. If set to NO these declarations will be
# included in the documentation.
# The default value is: NO.
HIDE_FRIEND_COMPOUNDS = @MITK_DOXYGEN_HIDE_FRIEND_COMPOUNDS@
# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
# documentation blocks found inside the body of a function. If set to NO these
# blocks will be appended to the function's detailed documentation block.
# The default value is: NO.
HIDE_IN_BODY_DOCS = NO
# The INTERNAL_DOCS tag determines if documentation that is typed after a
# \internal command is included. If the tag is set to NO then the documentation
# will be excluded. Set it to YES to include the internal documentation.
# The default value is: NO.
INTERNAL_DOCS = @MITK_DOXYGEN_INTERNAL_DOCS@
# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
# names in lower-case letters. If set to YES upper-case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# and Mac users are advised to set this option to NO.
# The default value is: system dependent.
CASE_SENSE_NAMES = YES
# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
# their full class and namespace scopes in the documentation. If set to YES the
# scope will be hidden.
# The default value is: NO.
HIDE_SCOPE_NAMES = NO
# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
# the files that are included by a file in the documentation of that file.
# The default value is: YES.
SHOW_INCLUDE_FILES = YES
# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
# grouped member an include statement to the documentation, telling the reader
# which file to include in order to use the member.
# The default value is: NO.
SHOW_GROUPED_MEMB_INC = NO
# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
# files with double quotes in the documentation rather than with sharp brackets.
# The default value is: NO.
FORCE_LOCAL_INCLUDES = NO
# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
# documentation for inline members.
# The default value is: YES.
INLINE_INFO = YES
# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
# (detailed) documentation of file and class members alphabetically by member
# name. If set to NO the members will appear in declaration order.
# The default value is: YES.
SORT_MEMBER_DOCS = YES
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
# descriptions of file, namespace and class members alphabetically by member
# name. If set to NO the members will appear in declaration order. Note that
# this will also influence the order of the classes in the class list.
# The default value is: NO.
SORT_BRIEF_DOCS = NO
# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
# (brief and detailed) documentation of class members so that constructors and
# destructors are listed first. If set to NO the constructors will appear in the
# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
# member documentation.
# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
# detailed member documentation.
# The default value is: NO.
SORT_MEMBERS_CTORS_1ST = NO
# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
# of group names into alphabetical order. If set to NO the group names will
# appear in their defined order.
# The default value is: NO.
SORT_GROUP_NAMES = NO
# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
# fully-qualified names, including namespaces. If set to NO, the class list will
# be sorted only by class name, not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
# Note: This option applies only to the class list, not to the alphabetical
# list.
# The default value is: NO.
SORT_BY_SCOPE_NAME = YES
# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
# type resolution of all parameters of a function it will reject a match between
# the prototype and the implementation of a member function even if there is
# only one candidate or it is obvious which candidate to choose by doing a
# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
# accept a match between prototype and implementation in such cases.
# The default value is: NO.
STRICT_PROTO_MATCHING = NO
# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
# todo list. This list is created by putting \todo commands in the
# documentation.
# The default value is: YES.
GENERATE_TODOLIST = @MITK_DOXYGEN_GENERATE_TODOLIST@
# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
# test list. This list is created by putting \test commands in the
# documentation.
# The default value is: YES.
GENERATE_TESTLIST = YES
# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
# list. This list is created by putting \bug commands in the documentation.
# The default value is: YES.
GENERATE_BUGLIST = @MITK_DOXYGEN_GENERATE_BUGLIST@
# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
# the deprecated list. This list is created by putting \deprecated commands in
# the documentation.
# The default value is: YES.
GENERATE_DEPRECATEDLIST= @MITK_DOXYGEN_GENERATE_DEPRECATEDLIST@
# The ENABLED_SECTIONS tag can be used to enable conditional documentation
# sections, marked by \if <section_label> ... \endif and \cond <section_label>
# ... \endcond blocks.
ENABLED_SECTIONS = @MITK_DOXYGEN_ENABLED_SECTIONS@
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
# initial value of a variable or macro / define can have for it to appear in the
# documentation. If the initializer consists of more lines than specified here
# it will be hidden. Use a value of 0 to hide initializers completely. The
# appearance of the value of individual variables and macros / defines can be
# controlled using \showinitializer or \hideinitializer command in the
# documentation regardless of this setting.
# Minimum value: 0, maximum value: 10000, default value: 30.
MAX_INITIALIZER_LINES = 0
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
# the bottom of the documentation of classes and structs. If set to YES the list
# will mention the files that were used to generate the documentation.
# The default value is: YES.
SHOW_USED_FILES = YES
# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
# will remove the Files entry from the Quick Index and from the Folder Tree View
# (if specified).
# The default value is: YES.
SHOW_FILES = YES
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
# page. This will remove the Namespaces entry from the Quick Index and from the
# Folder Tree View (if specified).
# The default value is: YES.
SHOW_NAMESPACES = YES
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
# doxygen should invoke to get the current version for each file (typically from
# the version control system). Doxygen will invoke the program by executing (via
# popen()) the command command input-file, where command is the value of the
# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
# by doxygen. Whatever the program writes to standard output is used as the file
# version. For an example see the documentation.
FILE_VERSION_FILTER =
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
# output files in an output format independent way. To create the layout file
# that represents doxygen's defaults, run doxygen with the -l option. You can
# optionally specify a file name after the option, if omitted DoxygenLayout.xml
# will be used as the name of the layout file.
#
# Note that if you run doxygen from a directory containing a file called
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.
LAYOUT_FILE =
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
# extension is automatically appended if omitted. This requires the bibtex tool
# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
# For LaTeX the style of the bibliography can be controlled using
# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
# search path. See also \cite for info how to create references.
CITE_BIB_FILES =
#---------------------------------------------------------------------------
# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
# The QUIET tag can be used to turn on/off the messages that are generated to
# standard output by doxygen. If QUIET is set to YES this implies that the
# messages are off.
# The default value is: NO.
QUIET = NO
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
# this implies that the warnings are on.
#
# Tip: Turn warnings on while writing the documentation.
# The default value is: YES.
WARNINGS = YES
# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
# will automatically be disabled.
# The default value is: YES.
WARN_IF_UNDOCUMENTED = YES
# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some parameters
# in a documented function, or documenting parameters that don't exist or using
# markup commands wrongly.
# The default value is: YES.
WARN_IF_DOC_ERROR = YES
# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
# are documented, but have no documentation for their parameters or return
# value. If set to NO doxygen will only warn about wrong or incomplete parameter
# documentation, but not about the absence of documentation.
# The default value is: NO.
WARN_NO_PARAMDOC = NO
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
# can produce. The string should contain the $file, $line, and $text tags, which
# will be replaced by the file and line number from which the warning originated
# and the warning text. Optionally the format may contain $version, which will
# be replaced by the version of the file (if it could be obtained via
# FILE_VERSION_FILTER)
# The default value is: $file:$line: $text.
WARN_FORMAT = "$file:$line: $text"
# The WARN_LOGFILE tag can be used to specify a file to which warning and error
# messages should be written. If left blank the output is written to standard
# error (stderr).
WARN_LOGFILE =
#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag is used to specify the files and/or directories that contain
# documented source files. You may enter file names like myfile.cpp or
# directories like /usr/src/myproject. Separate the files or directories with
# spaces.
# Note: If this tag is empty the current directory is searched.
INPUT = @USERS_GUIDE_INPUT@
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
# documentation (see: http://www.gnu.org/software/libiconv) for the list of
# possible encodings.
# The default value is: UTF-8.
INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
# *.h) to filter out the source-files in the directories. If left blank the
# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
# *.qsf, *.as and *.js.
FILE_PATTERNS = *.dox \
*.md
# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
# The default value is: NO.
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
#
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
# The default value is: NO.
EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories.
#
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS = modules.dox \
*/Plugins/*/documentation/doxygen/*
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
#
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*
EXCLUDE_SYMBOLS =
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
# that contain example code fragments that are included (see the \include
# command).
EXAMPLE_PATH =
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
# *.h) to filter out the source-files in the directories. If left blank all
# files are included.
EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude commands
# irrespective of the value of the RECURSIVE tag.
# The default value is: NO.
EXAMPLE_RECURSIVE = YES
# The IMAGE_PATH tag can be used to specify one or more files or directories
# that contain images that are to be included in the documentation (see the
# \image command).
-IMAGE_PATH = @MITK_SOURCE_DIR@/Documentation/Doxygen/UserManual/ \
- @MITK_SOURCE_DIR@/Plugins/ \
- @MITK_SOURCE_DIR@/Examples/Plugins/
+IMAGE_PATH = "@MITK_SOURCE_DIR@/Documentation/Doxygen/UserManual/" \
+ "@MITK_SOURCE_DIR@/Plugins/" \
+ "@MITK_SOURCE_DIR@/Examples/Plugins/"
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
# by executing (via popen()) the command:
#
# <filter> <input-file>
#
# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
# name of an input file. Doxygen will then use the output that the filter
# program writes to standard output. If FILTER_PATTERNS is specified, this tag
# will be ignored.
#
# Note that the filter must not add or remove lines; it is applied before the
# code is scanned, but not when the output code is generated. If lines are added
# or removed, the anchors will not be placed correctly.
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis. Doxygen will compare the file name with each pattern and apply the
# filter if there is a match. The filters are a list of the form: pattern=filter
# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
# patterns match the file name, INPUT_FILTER is applied.
FILTER_PATTERNS = *.cmake=@CMakeDoxygenFilter_EXECUTABLE@
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER ) will also be used to filter the input files that are used for
# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
# The default value is: NO.
FILTER_SOURCE_FILES = NO
# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
# it is also possible to disable source filtering for a specific pattern using
# *.ext= (so without naming a filter).
# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
FILTER_SOURCE_PATTERNS =
# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
# is part of the input, its contents will be placed on the main page
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.
USE_MDFILE_AS_MAINPAGE =
#---------------------------------------------------------------------------
# Configuration options related to source browsing
#---------------------------------------------------------------------------
# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
# generated. Documented entities will be cross-referenced with these sources.
#
# Note: To get rid of all source code in the generated output, make sure that
# also VERBATIM_HEADERS is set to NO.
# The default value is: NO.
SOURCE_BROWSER = YES
# Setting the INLINE_SOURCES tag to YES will include the body of functions,
# classes and enums directly into the documentation.
# The default value is: NO.
INLINE_SOURCES = NO
# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
# special comment blocks from generated source code fragments. Normal C, C++ and
# Fortran comments will always remain visible.
# The default value is: YES.
STRIP_CODE_COMMENTS = YES
# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
# function all documented functions referencing it will be listed.
# The default value is: NO.
REFERENCED_BY_RELATION = YES
# If the REFERENCES_RELATION tag is set to YES then for each documented function
# all documented entities called/used by that function will be listed.
# The default value is: NO.
REFERENCES_RELATION = YES
# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
# link to the documentation.
# The default value is: YES.
REFERENCES_LINK_SOURCE = YES
# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
# source code will show a tooltip with additional information such as prototype,
# brief description and links to the definition and documentation. Since this
# will make the HTML file larger and loading of large files a bit slower, you
# can opt to disable this feature.
# The default value is: YES.
# This tag requires that the tag SOURCE_BROWSER is set to YES.
SOURCE_TOOLTIPS = YES
# If the USE_HTAGS tag is set to YES then the references to source code will
# point to the HTML generated by the htags(1) tool instead of doxygen built-in
# source browser. The htags tool is part of GNU's global source tagging system
# (see http://www.gnu.org/software/global/global.html). You will need version
# 4.8.6 or higher.
#
# To use it do the following:
# - Install the latest version of global
# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
# - Make sure the INPUT points to the root of the source tree
# - Run doxygen as normal
#
# Doxygen will invoke htags (and that will in turn invoke gtags), so these
# tools must be available from the command line (i.e. in the search path).
#
# The result: instead of the source browser generated by doxygen, the links to
# source code will now point to the output of htags.
# The default value is: NO.
# This tag requires that the tag SOURCE_BROWSER is set to YES.
USE_HTAGS = NO
# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
# verbatim copy of the header file for each class for which an include is
# specified. Set to NO to disable this.
# See also: Section \class.
# The default value is: YES.
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
# compounds will be generated. Enable this if the project contains a lot of
# classes, structs, unions or interfaces.
# The default value is: YES.
ALPHABETICAL_INDEX = YES
# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
# which the alphabetical index list will be split.
# Minimum value: 1, maximum value: 20, default value: 5.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
COLS_IN_ALPHA_INDEX = 3
# In case all classes in a project start with a common prefix, all classes will
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
# can be used to specify a prefix (or a list of prefixes) that should be ignored
# while generating the index headers.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the HTML output
#---------------------------------------------------------------------------
# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
# The default value is: YES.
GENERATE_HTML = NO
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: html.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_OUTPUT = html
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
# generated HTML page (for example: .htm, .php, .asp).
# The default value is: .html.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FILE_EXTENSION = .html
# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
# each generated HTML page. If the tag is left blank doxygen will generate a
# standard header.
#
# To get valid HTML the header file that includes any scripts and style sheets
# that doxygen needs, which is dependent on the configuration options used (e.g.
# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
# default header using
# doxygen -w html new_header.html new_footer.html new_stylesheet.css
# YourConfigFile
# and then modify the file new_header.html. See also section "Doxygen usage"
# for information on how to generate the default header that doxygen normally
# uses.
# Note: The header is subject to change so you typically have to regenerate the
# default header when upgrading to a newer version of doxygen. For a description
# of the possible markers and block names see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
# generated HTML page. If the tag is left blank doxygen will generate a standard
# footer. See HTML_HEADER for more information on how to generate a default
# footer and what special commands can be used inside the footer. See also
# section "Doxygen usage" for information on how to generate the default footer
# that doxygen normally uses.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
# sheet that is used by each HTML page. It can be used to fine-tune the look of
# the HTML output. If left blank doxygen will generate a default style sheet.
# See also section "Doxygen usage" for information on how to generate the style
# sheet that doxygen normally uses.
# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
# it is more robust and this tag (HTML_STYLESHEET) will in the future become
# obsolete.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_STYLESHEET =
# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
# cascading style sheets that are included after the standard style sheets
# created by doxygen. Using this option one can overrule certain style aspects.
# This is preferred over using HTML_STYLESHEET since it does not replace the
# standard style sheet and is therefor more robust against future updates.
# Doxygen will copy the style sheet files to the output directory.
# Note: The order of the extra stylesheet files is of importance (e.g. the last
# stylesheet in the list overrules the setting of the previous ones in the
# list). For an example see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_STYLESHEET = @MITK_DOXYGEN_STYLESHEET@
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
# that these files will be copied to the base HTML output directory. Use the
# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
# files will be copied as-is; there are no commands or markers available.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_FILES =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
# will adjust the colors in the stylesheet and background images according to
# this color. Hue is specified as an angle on a colorwheel, see
# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
# purple, and 360 is red again.
# Minimum value: 0, maximum value: 359, default value: 220.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_HUE = 220
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
# in the HTML output. For a value of 0 the output will use grayscales only. A
# value of 255 will produce the most vivid colors.
# Minimum value: 0, maximum value: 255, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_SAT = 100
# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
# luminance component of the colors in the HTML output. Values below 100
# gradually make the output lighter, whereas values above 100 make the output
# darker. The value divided by 100 is the actual gamma applied, so 80 represents
# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
# change the gamma.
# Minimum value: 40, maximum value: 240, default value: 80.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_GAMMA = 80
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting this
# to NO can help when comparing the output of multiple runs.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_TIMESTAMP = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_DYNAMIC_SECTIONS = @MITK_DOXYGEN_HTML_DYNAMIC_SECTIONS@
# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
# shown in the various tree structured indices initially; the user can expand
# and collapse entries dynamically later on. Doxygen will expand the tree to
# such a level that at most the specified number of entries are visible (unless
# a fully collapsed tree already exceeds this amount). So setting the number of
# entries 1 will produce a full collapsed tree by default. 0 is a special value
# representing an infinite number of entries and will result in a full expanded
# tree by default.
# Minimum value: 0, maximum value: 9999, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_INDEX_NUM_ENTRIES = 100
# If the GENERATE_DOCSET tag is set to YES, additional index files will be
# generated that can be used as input for Apple's Xcode 3 integrated development
# environment (see: http://developer.apple.com/tools/xcode/), introduced with
# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
# Makefile in the HTML output directory. Running make will produce the docset in
# that directory and running make install will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
# for more information.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_DOCSET = NO
# This tag determines the name of the docset feed. A documentation feed provides
# an umbrella under which multiple documentation sets from a single provider
# (such as a company or product suite) can be grouped.
# The default value is: Doxygen generated docs.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_FEEDNAME = "Doxygen generated docs"
# This tag specifies a string that should uniquely identify the documentation
# set bundle. This should be a reverse domain-name style string, e.g.
# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_BUNDLE_ID = org.doxygen.Project
# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
# the documentation publisher. This should be a reverse domain-name style
# string, e.g. com.mycompany.MyDocSet.documentation.
# The default value is: org.doxygen.Publisher.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
# The default value is: Publisher.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_NAME = Publisher
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
# Windows.
#
# The HTML Help Workshop contains a compiler that can convert all HTML output
# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
# files are now used as the Windows 98 help format, and will replace the old
# Windows help format (.hlp) on all Windows platforms in the future. Compressed
# HTML files also contain an index, a table of contents, and you can search for
# words in the documentation. The HTML workshop also contains a viewer for
# compressed HTML files.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_HTMLHELP = NO
# The CHM_FILE tag can be used to specify the file name of the resulting .chm
# file. You can add a path in front of the file if the result should not be
# written to the html output directory.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_FILE =
# The HHC_LOCATION tag can be used to specify the location (absolute path
# including file name) of the HTML help compiler ( hhc.exe). If non-empty
# doxygen will try to run the HTML help compiler on the generated index.hhp.
# The file has to be specified with full path.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
HHC_LOCATION =
# The GENERATE_CHI flag controls if a separate .chi index file is generated (
# YES) or that it should be included in the master .chm file ( NO).
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
GENERATE_CHI = NO
# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
# and project file content.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_INDEX_ENCODING =
# The BINARY_TOC flag controls whether a binary table of contents is generated (
# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it
# enables the Previous and Next buttons.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
BINARY_TOC = NO
# The TOC_EXPAND flag can be set to YES to add extra items for group members to
# the table of contents of the HTML help documentation and to the tree view.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
TOC_EXPAND = NO
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
# (.qch) of the generated HTML documentation.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_QHP = @MITK_DOXYGEN_GENERATE_QHP@
# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
# the file name of the resulting .qch file. The path specified is relative to
# the HTML output folder.
# This tag requires that the tag GENERATE_QHP is set to YES.
QCH_FILE = @MITK_DOXYGEN_QCH_FILE@
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace
# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_NAMESPACE = "org.mitk"
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
# Help Project output. For more information please see Qt Help Project / Virtual
# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
# folders).
# The default value is: doc.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_VIRTUAL_FOLDER = MITK
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
# filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
# The QHG_LOCATION tag can be used to specify the location of Qt's
# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
# generated .qhp file.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHG_LOCATION = @QT_HELPGENERATOR_EXECUTABLE@
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
# generated, together with the HTML files, they form an Eclipse help plugin. To
# install this plugin and make it available under the help contents menu in
# Eclipse, the contents of the directory containing the HTML and XML files needs
# to be copied into the plugins directory of eclipse. The name of the directory
# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
# After copying Eclipse needs to be restarted before the help appears.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_ECLIPSEHELP = NO
# A unique identifier for the Eclipse help plugin. When installing the plugin
# the directory name containing the HTML and XML files should also have this
# name. Each documentation set should have its own identifier.
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
ECLIPSE_DOC_ID = org.doxygen.Project
# If you want full control over the layout of the generated HTML pages it might
# be necessary to disable the index and replace it with your own. The
# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
# of each HTML page. A value of NO enables the index and the value YES disables
# it. Since the tabs in the index contain the same information as the navigation
# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
DISABLE_INDEX = NO
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
# structure should be generated to display hierarchical information. If the tag
# value is set to YES, a side panel will be generated containing a tree-like
# index structure (just like the one that is generated for HTML Help). For this
# to work a browser that supports JavaScript, DHTML, CSS and frames is required
# (i.e. any modern browser). Windows users are probably better off using the
# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
# further fine-tune the look of the index. As an example, the default style
# sheet generated by doxygen has an example that shows how to put an image at
# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
# the same information as the tab index, you could consider setting
# DISABLE_INDEX to YES when enabling this option.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_TREEVIEW = YES
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
# doxygen will group on one line in the generated HTML documentation.
#
# Note that a value of 0 will completely suppress the enum values from appearing
# in the overview section.
# Minimum value: 0, maximum value: 20, default value: 4.
# This tag requires that the tag GENERATE_HTML is set to YES.
ENUM_VALUES_PER_LINE = 4
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
# to set the initial width (in pixels) of the frame in which the tree is shown.
# Minimum value: 0, maximum value: 1500, default value: 250.
# This tag requires that the tag GENERATE_HTML is set to YES.
TREEVIEW_WIDTH = 300
# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
# external symbols imported via tag files in a separate window.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
EXT_LINKS_IN_WINDOW = NO
# Use this tag to change the font size of LaTeX formulas included as images in
# the HTML documentation. When you change the font size after a successful
# doxygen run you need to manually remove any form_*.png images from the HTML
# output directory to force them to be regenerated.
# Minimum value: 8, maximum value: 50, default value: 10.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_FONTSIZE = 10
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not
# supported properly for IE 6.0, but are supported on all modern browsers.
#
# Note that when changing this option you need to delete any form_*.png files in
# the HTML output directory before the changes have effect.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_TRANSPARENT = YES
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
# http://www.mathjax.org) which uses client side Javascript for the rendering
# instead of using prerendered bitmaps. Use this if you do not have LaTeX
# installed or if you want to formulas look prettier in the HTML output. When
# enabled you may also need to install MathJax separately and configure the path
# to it using the MATHJAX_RELPATH option.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
USE_MATHJAX = NO
# When MathJax is enabled you can set the default output format to be used for
# the MathJax output. See the MathJax site (see:
# http://docs.mathjax.org/en/latest/output.html) for more details.
# Possible values are: HTML-CSS (which is slower, but has the best
# compatibility), NativeMML (i.e. MathML) and SVG.
# The default value is: HTML-CSS.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_FORMAT = HTML-CSS
# When MathJax is enabled you need to specify the location relative to the HTML
# output directory using the MATHJAX_RELPATH option. The destination directory
# should contain the MathJax.js script. For instance, if the mathjax directory
# is located at the same level as the HTML output directory, then
# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
# Content Delivery Network so you can quickly see the result without installing
# MathJax. However, it is strongly recommended to install a local copy of
# MathJax from http://www.mathjax.org before deployment.
# The default value is: http://cdn.mathjax.org/mathjax/latest.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
# extension names that should be enabled during MathJax rendering. For example
# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_EXTENSIONS =
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
# of code that will be used on startup of the MathJax code. See the MathJax site
# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
# example see the documentation.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_CODEFILE =
# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
# the HTML output. The underlying search engine uses javascript and DHTML and
# should work on any modern browser. Note that when using HTML help
# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
# there is already a search function so this one should typically be disabled.
# For large projects the javascript based search engine can be slow, then
# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
# search using the keyboard; to jump to the search box use <access key> + S
# (what the <access key> is depends on the OS and browser, but it is typically
# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
# key> to jump into the search results window, the results can be navigated
# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
# the search. The filter options can be selected when the cursor is inside the
# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
# to select a filter and <Enter> or <escape> to activate or cancel the filter
# option.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
SEARCHENGINE = YES
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
# implemented using a web server instead of a web client using Javascript. There
# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
# setting. When disabled, doxygen will generate a PHP script for searching and
# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
# and searching needs to be provided by external tools. See the section
# "External Indexing and Searching" for details.
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
SERVER_BASED_SEARCH = NO
# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
# script for searching. Instead the search results are written to an XML file
# which needs to be processed by an external indexer. Doxygen will invoke an
# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
# search results.
#
# Doxygen ships with an example indexer ( doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: http://xapian.org/).
#
# See the section "External Indexing and Searching" for details.
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH = NO
# The SEARCHENGINE_URL should point to a search engine hosted by a web server
# which will return the search results when EXTERNAL_SEARCH is enabled.
#
# Doxygen ships with an example indexer ( doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: http://xapian.org/). See the section "External Indexing and
# Searching" for details.
# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHENGINE_URL =
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
# search data is written to a file for indexing by an external tool. With the
# SEARCHDATA_FILE tag the name of this file can be specified.
# The default file is: searchdata.xml.
# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHDATA_FILE = searchdata.xml
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
# projects and redirect the results back to the right project.
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH_ID =
# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
# projects other than the one defined by this configuration file, but that are
# all added to the same external search index. Each project needs to have a
# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
# to a relative location where the documentation can be found. The format is:
# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
# The default value is: YES.
GENERATE_LATEX = YES
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked.
#
# Note that when enabling USE_PDFLATEX this option is only used for generating
# bitmaps for formulas in the HTML output, but not in the Makefile that is
# written to the output directory.
# The default file is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_CMD_NAME = latex
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
# index for LaTeX.
# The default file is: makeindex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
MAKEINDEX_CMD_NAME = makeindex
# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
# documents. This may be useful for small projects and may help to save some
# trees in general.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used by the
# printer.
# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
# 14 inches) and executive (7.25 x 10.5 inches).
# The default value is: a4.
# This tag requires that the tag GENERATE_LATEX is set to YES.
PAPER_TYPE = a4wide
# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
# that should be included in the LaTeX output. To get the times font for
# instance you can specify
# EXTRA_PACKAGES=times
# If left blank no extra packages will be included.
# This tag requires that the tag GENERATE_LATEX is set to YES.
EXTRA_PACKAGES = amssymb
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
# generated LaTeX document. The header should contain everything until the first
# chapter. If it is left blank doxygen will generate a standard header. See
# section "Doxygen usage" for information on how to let doxygen write the
# default header to a separate file.
#
# Note: Only use a user-defined header if you know what you are doing! The
# following commands have a special meaning inside the header: $title,
# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
# $projectbrief, $projectlogo. Doxygen will replace $title with the empy string,
# for the replacement values of the other commands the user is refered to
# HTML_HEADER.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HEADER =
# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
# generated LaTeX document. The footer should contain everything after the last
# chapter. If it is left blank doxygen will generate a standard footer. See
# LATEX_HEADER for more information on how to generate a default footer and what
# special commands can be used inside the footer.
#
# Note: Only use a user-defined footer if you know what you are doing!
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_FOOTER =
# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the LATEX_OUTPUT output
# directory. Note that the files will be copied as-is; there are no commands or
# markers available.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_EXTRA_FILES =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
# contain links (just like the HTML output) instead of page references. This
# makes the output suitable for online browsing using a PDF viewer.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.
PDF_HYPERLINKS = YES
# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
# the PDF file directly from the LaTeX files. Set this option to YES to get a
# higher quality PDF documentation.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.
USE_PDFLATEX = YES
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
# command to the generated LaTeX files. This will instruct LaTeX to keep running
# if errors occur, instead of asking the user for help. This option is also used
# when generating formulas in HTML.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BATCHMODE = YES
# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
# index chapters (such as File Index, Compound Index, etc.) in the output.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HIDE_INDICES = NO
# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
# code with syntax highlighting in the LaTeX output.
#
# Note that which sources are shown also depends on other settings such as
# SOURCE_BROWSER.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_SOURCE_CODE = NO
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
# bibliography, e.g. plainnat, or ieeetr. See
# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
# The default value is: plain.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BIB_STYLE = plain
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
# RTF output is optimized for Word 97 and may not look too pretty with other RTF
# readers/editors.
# The default value is: NO.
GENERATE_RTF = NO
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: rtf.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_OUTPUT = rtf
# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
# documents. This may be useful for small projects and may help to save some
# trees in general.
# The default value is: NO.
# This tag requires that the tag GENERATE_RTF is set to YES.
COMPACT_RTF = NO
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
# contain hyperlink fields. The RTF file will contain links (just like the HTML
# output) instead of page references. This makes the output suitable for online
# browsing using Word or some other Word compatible readers that support those
# fields.
#
# Note: WordPad (write) and others do not support links.
# The default value is: NO.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's config
# file, i.e. a series of assignments. You only have to provide replacements,
# missing definitions are set to their default value.
#
# See also section "Doxygen usage" for information on how to generate the
# default style sheet that doxygen normally uses.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an RTF document. Syntax is
# similar to doxygen's config file. A template extensions file can be generated
# using doxygen -e rtf extensionFile.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# Configuration options related to the man page output
#---------------------------------------------------------------------------
# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
# classes and files.
# The default value is: NO.
GENERATE_MAN = NO
# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it. A directory man3 will be created inside the directory specified by
# MAN_OUTPUT.
# The default directory is: man.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_OUTPUT = man
# The MAN_EXTENSION tag determines the extension that is added to the generated
# man pages. In case the manual section does not start with a number, the number
# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
# optional.
# The default value is: .3.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_EXTENSION = .3
# The MAN_SUBDIR tag determines the name of the directory created within
# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
# MAN_EXTENSION with the initial . removed.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_SUBDIR =
# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
# will generate one additional man file for each entity documented in the real
# man page(s). These additional files only source the real man page, but without
# them the man command would be unable to find the correct page.
# The default value is: NO.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_LINKS = NO
#---------------------------------------------------------------------------
# Configuration options related to the XML output
#---------------------------------------------------------------------------
# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
# captures the structure of the code including all documentation.
# The default value is: NO.
GENERATE_XML = NO
# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: xml.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_OUTPUT = xml
# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
# listings (including syntax highlighting and cross-referencing information) to
# the XML output. Note that enabling this will significantly increase the size
# of the XML output.
# The default value is: YES.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
# that can be used to generate PDF.
# The default value is: NO.
GENERATE_DOCBOOK = NO
# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
# front of it.
# The default directory is: docbook.
# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
DOCBOOK_OUTPUT = docbook
# If the DOCBOOK_PROGRAMLISTING tag is set to YES doxygen will include the
# program listings (including syntax highlighting and cross-referencing
# information) to the DOCBOOK output. Note that enabling this will significantly
# increase the size of the DOCBOOK output.
# The default value is: NO.
# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
DOCBOOK_PROGRAMLISTING = NO
#---------------------------------------------------------------------------
# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
# Definitions (see http://autogen.sf.net) file that captures the structure of
# the code including all documentation. Note that this feature is still
# experimental and incomplete at the moment.
# The default value is: NO.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# Configuration options related to the Perl module output
#---------------------------------------------------------------------------
# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
# file that captures the structure of the code including all documentation.
#
# Note that this feature is still experimental and incomplete at the moment.
# The default value is: NO.
GENERATE_PERLMOD = NO
# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
# output from the Perl module output.
# The default value is: NO.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_LATEX = NO
# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
# formatted so it can be parsed by a human reader. This is useful if you want to
# understand what is going on. On the other hand, if this tag is set to NO the
# size of the Perl module output will be much smaller and Perl will parse it
# just the same.
# The default value is: YES.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_PRETTY = YES
# The names of the make variables in the generated doxyrules.make file are
# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
# so different doxyrules.make files included by the same Makefile don't
# overwrite each other's variables.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
# C-preprocessor directives found in the sources and include files.
# The default value is: YES.
ENABLE_PREPROCESSING = YES
# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
# in the source code. If set to NO only conditional compilation will be
# performed. Macro expansion can be done in a controlled way by setting
# EXPAND_ONLY_PREDEF to YES.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
MACRO_EXPANSION = YES
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
# the macro expansion is limited to the macros specified with the PREDEFINED and
# EXPAND_AS_DEFINED tags.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES the includes files in the
# INCLUDE_PATH will be searched if a #include is found.
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by the
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
# directories. If left blank, the patterns specified with FILE_PATTERNS will be
# used.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that are
# defined before the preprocessor is started (similar to the -D option of e.g.
# gcc). The argument of the tag is a list of macros of the form: name or
# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
# is assumed. To prevent a macro definition from being undefined via #undef or
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
# macro definition that is found in the sources will be used. Use the PREDEFINED
# tag if you want to use a different macro definition that overrules the
# definition found in the source code.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
# remove all references to function-like macros that are alone on a line, have
# an all uppercase name, and do not end with a semicolon. Such function macros
# are typically used for boiler-plate code, and will confuse the parser if not
# removed.
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration options related to external references
#---------------------------------------------------------------------------
# The TAGFILES tag can be used to specify one or more tag files. For each tag
# file the location of the external documentation should be added. The format of
# a tag file without this location is as follows:
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
# TAGFILES = file1=loc1 "file2 = loc2" ...
# where loc1 and loc2 can be relative or absolute paths or URLs. See the
# section "Linking to external documentation" for more information about the use
# of tag files.
# Note: Each tag file must have a unique name (where the name does NOT include
# the path). If a tag file is not located in the directory in which doxygen is
# run, you must also specify the path to the tagfile here.
TAGFILES = @BLUEBERRY_DOXYGEN_TAGFILE@
# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
# tag file that is based on the input files it reads. See section "Linking to
# external documentation" for more information about the usage of tag files.
GENERATE_TAGFILE = @MITK_DOXYGEN_TAGFILE_NAME@
# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
# class index. If set to NO only the inherited external classes will be listed.
# The default value is: NO.
ALLEXTERNALS = NO
# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
# the modules index. If set to NO, only the current project's groups will be
# listed.
# The default value is: YES.
EXTERNAL_GROUPS = NO
# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
# the related pages index. If set to NO, only the current project's pages will
# be listed.
# The default value is: YES.
EXTERNAL_PAGES = YES
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of 'which perl').
-# The default file (with absolute path) is: /usr/bin/perl.
-
-PERL_PATH = /usr/bin/perl
-
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
# NO turns the diagrams off. Note that this option also works with HAVE_DOT
# disabled, but it is recommended to install and use dot, since it yields more
# powerful graphs.
# The default value is: YES.
CLASS_DIAGRAMS = YES
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see:
-# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
# You can include diagrams made with dia in doxygen documentation. Doxygen will
# then run dia to produce the diagram and insert it in the documentation. The
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
# If left empty dia is assumed to be found in the default search path.
DIA_PATH =
# If set to YES, the inheritance and collaboration graphs will hide inheritance
# and usage relations if the target is undocumented or is not a class.
# The default value is: YES.
HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz (see:
# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
# Bell Labs. The other options in this section have no effect if this option is
# set to NO
# The default value is: NO.
HAVE_DOT = @HAVE_DOT@
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
# to run in parallel. When set to 0 doxygen will base this on the number of
# processors available in the system. You can set it explicitly to a value
# larger than 0 to get control over the balance between CPU load and processing
# speed.
# Minimum value: 0, maximum value: 32, default value: 0.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_NUM_THREADS = @MITK_DOXYGEN_DOT_NUM_THREADS@
# When you want a differently looking font in the dot files that doxygen
# generates you can specify the font name using DOT_FONTNAME. You need to make
# sure dot is able to find the font, which can be done by putting it in a
# standard location or by setting the DOTFONTPATH environment variable or by
# setting DOT_FONTPATH to the directory containing the font.
# The default value is: Helvetica.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTNAME = Helvetica
# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
# dot graphs.
# Minimum value: 4, maximum value: 24, default value: 10.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTSIZE = 10
# By default doxygen will tell dot to use the default font as specified with
# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
# the path where dot can find it using this tag.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTPATH =
# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
# each documented class showing the direct and indirect inheritance relations.
# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
CLASS_GRAPH = YES
# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
# graph for each documented class showing the direct and indirect implementation
# dependencies (inheritance, containment, and class references variables) of the
# class with other documented classes.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
COLLABORATION_GRAPH = YES
# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
# groups, showing the direct groups dependencies.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GROUP_GRAPHS = YES
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
UML_LOOK = @MITK_DOXYGEN_UML_LOOK@
# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
# class node. If there are many fields or methods and many nodes the graph may
# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
# number of items for each type to make the size more manageable. Set this to 0
# for no limit. Note that the threshold may be exceeded by 50% before the limit
# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
# but if the number exceeds 15, the total amount of fields shown is limited to
# 10.
# Minimum value: 0, maximum value: 100, default value: 10.
# This tag requires that the tag HAVE_DOT is set to YES.
UML_LIMIT_NUM_FIELDS = 10
# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
# collaboration graphs will show the relations between templates and their
# instances.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
TEMPLATE_RELATIONS = YES
# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
# YES then doxygen will generate a graph for each documented file showing the
# direct and indirect include dependencies of the file with other documented
# files.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDE_GRAPH = NO
# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
# set to YES then doxygen will generate a graph for each documented file showing
# the direct and indirect include dependencies of the file with other documented
# files.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDED_BY_GRAPH = NO
# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
# dependency graph for every global function or class method.
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable call graphs for selected
# functions only using the \callgraph command.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
CALL_GRAPH = NO
# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
# dependency graph for every global function or class method.
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable caller graphs for selected
# functions only using the \callergraph command.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
CALLER_GRAPH = NO
# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
# hierarchy of all classes instead of a textual one.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GRAPHICAL_HIERARCHY = NO
# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
# dependencies a directory has on other directories in a graphical way. The
# dependency relations are determined by the #include relations between the
# files in the directories.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot.
# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
# to make the SVG files visible in IE 9+ (other browsers do not have this
# requirement).
# Possible values are: png, jpg, gif and svg.
# The default value is: png.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_IMAGE_FORMAT = png
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
# enable generation of interactive SVG images that allow zooming and panning.
#
# Note that this requires a modern browser other than Internet Explorer. Tested
# and working are Firefox, Chrome, Safari, and Opera.
# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
# the SVG files visible. Older versions of IE do not have SVG support.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
INTERACTIVE_SVG = NO
# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_PATH = @DOXYGEN_DOT_PATH@
+DOT_PATH = "@DOXYGEN_DOT_PATH@"
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the \dotfile
# command).
# This tag requires that the tag HAVE_DOT is set to YES.
DOTFILE_DIRS =
# The MSCFILE_DIRS tag can be used to specify one or more directories that
# contain msc files that are included in the documentation (see the \mscfile
# command).
MSCFILE_DIRS =
# The DIAFILE_DIRS tag can be used to specify one or more directories that
# contain dia files that are included in the documentation (see the \diafile
# command).
DIAFILE_DIRS =
# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
# path where java can find the plantuml.jar file. If left blank, it is assumed
# PlantUML is not used or called during a preprocessing step. Doxygen will
# generate a warning when it encounters a \startuml command in this case and
# will not generate output for the diagram.
# This tag requires that the tag HAVE_DOT is set to YES.
PLANTUML_JAR_PATH =
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
# that will be shown in the graph. If the number of nodes in a graph becomes
# larger than this value, doxygen will truncate the graph, which is visualized
# by representing a node as a red box. Note that doxygen if the number of direct
# children of the root node in a graph is already larger than
# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
# Minimum value: 0, maximum value: 10000, default value: 50.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_GRAPH_MAX_NODES = 50
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
# generated by dot. A depth value of 3 means that only nodes reachable from the
# root by following a path via at most 3 edges will be shown. Nodes that lay
# further from the root node will be omitted. Note that setting this option to 1
# or 2 may greatly reduce the computation time needed for large code bases. Also
# note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
# Minimum value: 0, maximum value: 1000, default value: 0.
# This tag requires that the tag HAVE_DOT is set to YES.
MAX_DOT_GRAPH_DEPTH = 0
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
# background. This is disabled by default, because dot on Windows does not seem
# to support this out of the box.
#
# Warning: Depending on the platform used, enabling this option may lead to
# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
# read).
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_TRANSPARENT = NO
# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
# makes dot run faster, but since only newer versions of dot (>1.8.10) support
# this, this feature is disabled by default.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_MULTI_TARGETS = NO
# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
# explaining the meaning of the various boxes and arrows in the dot generated
# graphs.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GENERATE_LEGEND = YES
# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
# files that are used to generate the various graphs.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_CLEANUP = YES
diff --git a/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureSerializer.h b/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureSerializer.h
index 7c1bb24c8d..b941ed6178 100644
--- a/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureSerializer.h
+++ b/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureSerializer.h
@@ -1,34 +1,37 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkExampleDataStructureSerializer_h_included
#define mitkExampleDataStructureSerializer_h_included
#include "mitkBaseDataSerializer.h"
namespace mitk
{
/**
\brief Serializes mitk::ExampleDataStructure for mitk::SceneIO
*/
class ExampleDataStructureSerializer : public BaseDataSerializer
{
public:
mitkClassMacro(ExampleDataStructureSerializer, BaseDataSerializer);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) std::string Serialize() override;
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+
+ std::string Serialize() override;
protected:
ExampleDataStructureSerializer();
~ExampleDataStructureSerializer() override;
};
} // namespace
#endif
diff --git a/Examples/FirstSteps/NewModule/include/mitkExampleDataStructure.h b/Examples/FirstSteps/NewModule/include/mitkExampleDataStructure.h
index f57170f12b..4906fb2e0b 100644
--- a/Examples/FirstSteps/NewModule/include/mitkExampleDataStructure.h
+++ b/Examples/FirstSteps/NewModule/include/mitkExampleDataStructure.h
@@ -1,83 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_ExampleDataStructure_H
#define _MITK_ExampleDataStructure_H
#include <MitkNewModuleExports.h>
#include "mitkBaseData.h"
namespace mitk
{
/**
* \brief Example Data Structure
*
* This class is an example of deriving your own data structure based on mitk::BaseData .
*/
class MITKNEWMODULE_EXPORT ExampleDataStructure : public BaseData
{
public:
// virtual methods that need to be implemented
void UpdateOutputInformation() override;
void SetRequestedRegionToLargestPossibleRegion() override;
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
bool VerifyRequestedRegion() override;
void SetRequestedRegion(const itk::DataObject *) override;
// Macros
mitkClassMacro(ExampleDataStructure, BaseData);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
////////////////// Interface ///////////////////
// Get macros
itkGetMacro(Data, std::string);
itkGetConstMacro(Data, std::string);
// Set macros
itkSetMacro(Data, std::string);
/**
* \brief Append a string to the data string
*
* Takes a string that is appended to the data string.
*
* \param input string to be appended
*/
void AppendAString(const std::string input);
protected:
ExampleDataStructure();
~ExampleDataStructure() override;
// this string is the data stored in this example data structure
std::string m_Data;
private:
};
/**
* \brief Returns true if the example data structures are considered equal.
*
* They are considered equal if their string is equal
*/
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide,
mitk::ExampleDataStructure *rightHandSide,
mitk::ScalarType eps,
bool verbose);
} // namespace mitk
#endif /* _MITK_ExampleDataStructure_H */
diff --git a/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/IChangeText.h b/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/IChangeText.h
index 257f2e59fa..02e034cafc 100644
--- a/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/IChangeText.h
+++ b/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/IChangeText.h
@@ -1,31 +1,31 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef ICHANGETEXT_H_
#define ICHANGETEXT_H_
#include <berryObject.h>
#include "org_mitk_example_gui_extensionpointdefinition_Export.h"
struct org_mitk_example_gui_extensionpointdefinition_EXPORT IChangeText : public virtual berry::Object
{
- berryObjectMacro(IChangeText)
+ berryObjectMacro(IChangeText);
~IChangeText() override;
virtual QString ChangeText(const QString &s) = 0;
};
Q_DECLARE_INTERFACE(IChangeText, "org.mitk.example.IChangeText")
#endif /*ICHANGETEXT_H_*/
diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceModifier.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceModifier.h
index 7b0ad620be..5220a7d395 100644
--- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceModifier.h
+++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceModifier.h
@@ -1,113 +1,114 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKSurfaceModifier_H_HEADER_INCLUDED_
#define MITKSurfaceModifier_H_HEADER_INCLUDED_
// mitk headers
#include <mitkCommon.h>
#include <mitkPointSet.h>
#include <mitkSurface.h>
// itk headers
#include <itkMersenneTwisterRandomVariateGenerator.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
class vtkPolyDataNormals;
namespace mitk
{
/** Documentation
* @brief This class offer some methods to modify a surface.
*/
class SurfaceModifier : public itk::Object
{
public:
mitkClassMacroItkParent(SurfaceModifier, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** @brief Adds gaussian noise to a surface (means to all vertexes).
* @param maxNoiseVectorLenght Limits the length of the noise vector of each vertex. Value -1 disables the limit.
* Default value is also -1.
*/
bool PerturbeSurface(mitk::Surface::Pointer surface,
double varianceX,
double varianceY,
double varianceZ,
double maxNoiseVectorLenght = -1);
/** @brief Adds gaussian noise to a part of the vertexes of the surface.
@param outlierChance The chance to perturbe a vertex. Consequently this is also approximately the percentage of
vertexes that will be perturbed.
*/
bool AddOutlierToSurface(
mitk::Surface::Pointer surface, double varianceX, double varianceY, double varianceZ, double outlierChance);
/** @brief Transforms a surface with a given transform. This method transforms the vertexes which means manipulating
* the vtkPolyData.
* In some cases this is needed, for example if you want to use the transformed polydata later on.
*/
bool TransformSurface(mitk::Surface::Pointer surface,
itk::Matrix<double, 3, 3> TransformationR,
itk::Vector<double, 3> TransformationT);
/** @brief Transforms a surface with a given transform (uses the center of gravity of the surface as origin). This
* method transforms the vertexes which means manipulating the vtkPolyData.
* In some cases this is needed, for example if you want to use the transformed polydata later on.
* @param OverallTransformationR Returns the overall transformation in world coordinates. (rotation)
* @param OverallTransformationT Returns the overall transformation in world coordinates. (translation)
*/
bool TransformSurfaceCoGCoordinates(mitk::Surface::Pointer surface,
itk::Matrix<double, 3, 3> TransformationR,
itk::Vector<double, 3> TransformationT,
itk::Matrix<double, 3, 3> &OverallTransformationR,
itk::Vector<double, 3> &OverallTransformationT);
/** @brief Moves the surface (respectively its center of gravity) to the center of the coordinate system. */
bool MoveSurfaceToCenter(mitk::Surface::Pointer surface);
/** @brief Moves the surface (respectively its center of gravity) to the center of the coordinate system.
@param TransformR (return value) returns the rotation of the transform which was applied to the surface to move
it to the origin.
@param TransformT (return value) returns the translation of the transform which was applied to the surface to
move it to the origin.
*/
bool MoveSurfaceToCenter(mitk::Surface::Pointer surface,
itk::Matrix<double, 3, 3> &TransformR,
itk::Vector<double, 3> &TransformT);
/** @brief Creates a deep copy (clone) of the given surface and returns it */
mitk::Surface::Pointer DeepCopy(mitk::Surface::Pointer surface);
protected:
SurfaceModifier();
~SurfaceModifier() override;
mitk::Point3D PerturbePoint(
mitk::Point3D point, double varianceX, double varianceY, double varianceZ);
/** @brief perturbes a point along the given axis */
mitk::Point3D PerturbePointAlongAxis(mitk::Point3D point, mitk::Vector3D axis, double variance);
mitk::Point3D TransformPoint(mitk::Point3D point,
itk::Matrix<double, 3, 3> TransformationR,
itk::Vector<double, 3> TransformationT);
mitk::Point3D GetCenterOfGravity(mitk::Surface::Pointer surface);
itk::Statistics::MersenneTwisterRandomVariateGenerator::Pointer m_myRandomGenerator;
};
} // namespace mitk
#endif /* MITKSurfaceModifier_H_HEADER_INCLUDED_ */
diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceToPointSetFilter.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceToPointSetFilter.h
index 6d1c0d5823..d71d4c7e9c 100644
--- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceToPointSetFilter.h
+++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceToPointSetFilter.h
@@ -1,52 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKSURFACETOPOINTSETFILTER_H_HEADER_INCLUDED_
#define MITKSURFACETOPOINTSETFILTER_H_HEADER_INCLUDED_
// mitk headers
#include "mitkSurface.h"
#include <mitkPointSetSource.h>
namespace mitk
{
/** Documentation
* @brief This filter converts the input surface into a point set. The output point set contains every point exactly
* one time
* (no dublicated points like in the stl-format).
*/
class SurfaceToPointSetFilter : public mitk::PointSetSource
{
public:
mitkClassMacro(SurfaceToPointSetFilter, mitk::PointSetSource);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
using Superclass::SetInput;
void SetInput(mitk::Surface::Pointer m_InputSurface);
std::string GetErrorMessage();
protected:
SurfaceToPointSetFilter();
~SurfaceToPointSetFilter() override;
/** @brief method generating the output of this filter. Called in the updated process of the pipeline. */
void GenerateData() override;
//############### members ########################
mitk::Surface::Pointer m_InputSurface;
std::string m_ErrorMessage;
};
} // namespace mitk
#endif /* MITKSURFACETODISTANCEIMAGEFILTER_H_HEADER_INCLUDED_ */
diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkTargetPointsCalculator.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkTargetPointsCalculator.h
index 0a0babc2a6..398484ec5f 100644
--- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkTargetPointsCalculator.h
+++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkTargetPointsCalculator.h
@@ -1,95 +1,96 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKTARGETPOINTSCALCULATOR_H_HEADER_INCLUDED_
#define MITKTARGETPOINTSCALCULATOR_H_HEADER_INCLUDED_
// mitk headers
#include "mitkCommon.h"
#include "mitkImage.h"
#include "mitkPointSet.h"
#include "mitkSurface.h"
// itk headers
#include "itkObject.h"
#include <itkObjectFactory.h>
namespace mitk
{
/**
* @brief This class offers methods to automatically calculate target points inside a (closed) surface.
*/
class TargetPointsCalculator : public itk::Object
{
public:
mitkClassMacroItkParent(TargetPointsCalculator, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** @brief identifier for target point calculation method */
enum TargetPointCalculationMethod {
EvenlyDistributedTargetPoints,
OneTargetPointInCenterOfGravity
};
/** @brief Sets the method for the target point calculation. Default value is EvenlyDistributedTargetPoints. */
void SetTargetPointCalculationMethod(TargetPointCalculationMethod method);
/** @brief Sets the inter point distance (in mm), which is a parameter for the evenly distributed target points.
* This parameter is only used if the method is set to EvenlyDistributedTargetPoints. Default value is 20.
*/
void SetInterPointDistance(int d);
/** @brief Sets the input surface. This parameter must be set before calculation is started. */
void SetInput(mitk::Surface::Pointer input);
/** @brief Calculates the target points.
* @return Returns true if calculation was successful. False if not, you can get an error message in this case.
*/
bool DoCalculate();
/** @return Returns the calculated target points. Returns null if no target points are calculated yet. */
mitk::PointSet::Pointer GetOutput();
/** @return Returns the last error message. Returns an empty string if there was no error yet. */
std::string GetErrorMessage();
protected:
TargetPointsCalculator();
~TargetPointsCalculator() override;
typedef itk::Image<unsigned char, 3> ImageType;
int m_InterPointDistance;
mitk::PointSet::Pointer m_Output;
mitk::Surface::Pointer m_Input;
std::string m_ErrorMessage;
TargetPointCalculationMethod m_Method;
mitk::Image::Pointer CreateBinaryImage();
mitk::PointSet::Pointer CreateTargetPoints(mitk::Image::Pointer binaryImage);
bool isInside(ImageType::Pointer currentImageAsitkImage, mitk::Point3D p);
int RoundUpToGatter(int i, int gatter);
int RoundUpToCentimeters(int i);
mitk::PointSet::Pointer CreateTargetPointInCOG(mitk::Surface::Pointer surface);
};
}
#endif
diff --git a/Examples/Tutorial/QtTesting.cpp b/Examples/Tutorial/QtTesting.cpp
deleted file mode 100644
index dad5e46090..0000000000
--- a/Examples/Tutorial/QtTesting.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/*============================================================================
-
-The Medical Imaging Interaction Toolkit (MITK)
-
-Copyright (c) German Cancer Research Center (DKFZ)
-All rights reserved.
-
-Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.
-
-============================================================================*/
-#include <QApplication>
-#include <QTimer>
-
-#include <iostream>
-#include <stdlib.h>
-
-int QtTesting(void)
-{
- // QtTestingClass *qttestingclass = new QtTestingClass;
- std::cout << "Testing ... " << std::endl;
- auto timer = new QTimer(QApplication::instance());
- timer->setSingleShot(true);
- QObject::connect(timer, SIGNAL(timeout()), QApplication::instance(), SLOT(quit()));
- timer->start(2000); // 2 seconds single-shot timer
- QApplication::instance()->exec();
- return EXIT_SUCCESS;
-}
diff --git a/Examples/Tutorial/QtTesting.h b/Examples/Tutorial/QtTesting.h
deleted file mode 100644
index 66c4a6f467..0000000000
--- a/Examples/Tutorial/QtTesting.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*============================================================================
-
-The Medical Imaging Interaction Toolkit (MITK)
-
-Copyright (c) German Cancer Research Center (DKFZ)
-All rights reserved.
-
-Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.
-
-============================================================================*/
-
-//#include <QObject>
-
-int QtTesting(void);
-
-// class QtTestingClass : public QObject
-//{
-// Q_OBJECT
-// public:
-// QtTestingClass( QObject * parent = 0, const char * name = 0 );
-//
-//}
diff --git a/Examples/Tutorial/Step1/Step1.cpp b/Examples/Tutorial/Step1/Step1.cpp
index c0fe5e65a5..c203119b7f 100644
--- a/Examples/Tutorial/Step1/Step1.cpp
+++ b/Examples/Tutorial/Step1/Step1.cpp
@@ -1,93 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "QmitkRegisterClasses.h"
#include "QmitkRenderWindow.h"
#include <mitkStandaloneDataStorage.h>
#include <QApplication>
#include <itksys/SystemTools.hxx>
#include <mitkIOUtil.h>
//##Documentation
//## @brief Load image (nrrd format) and display it in a 2D view
int main(int argc, char *argv[])
{
QApplication qtapplication(argc, argv);
if (argc < 2)
{
fprintf(stderr, "Usage: %s [filename] \n\n", itksys::SystemTools::GetFilenameName(argv[0]).c_str());
return 1;
}
// Register Qmitk-dependent global instances
QmitkRegisterClasses();
//*************************************************************************
// Part I: Basic initialization
//*************************************************************************
// Create a DataStorage
// The DataStorage manages all data objects. It is used by the
// rendering mechanism to render all data objects
// We use the standard implementation mitk::StandaloneDataStorage.
mitk::StandaloneDataStorage::Pointer ds = mitk::StandaloneDataStorage::New();
//*************************************************************************
// Part II: Create some data by reading a file
//*************************************************************************
// Load datanode (eg. many image formats, surface formats, etc.)
mitk::IOUtil::Load(argv[1], *ds);
//*************************************************************************
// Part IV: Create window and pass the datastorage to it
//*************************************************************************
// Create a RenderWindow
QmitkRenderWindow renderWindow;
// Tell the RenderWindow which (part of) the datastorage to render
renderWindow.GetRenderer()->SetDataStorage(ds);
// Initialize the RenderWindow
auto geo = ds->ComputeBoundingGeometry3D(ds->GetAll());
mitk::RenderingManager::GetInstance()->InitializeViews(geo);
// mitk::RenderingManager::GetInstance()->InitializeViews();
// Select a slice
mitk::SliceNavigationController::Pointer sliceNaviController = renderWindow.GetSliceNavigationController();
if (sliceNaviController)
sliceNaviController->GetSlice()->SetPos(0);
//*************************************************************************
// Part V: Qt-specific initialization
//*************************************************************************
renderWindow.show();
renderWindow.resize(256, 256);
-// for testing
-#include "QtTesting.h"
- if (strcmp(argv[argc - 1], "-testing") != 0)
- return qtapplication.exec();
- else
- return QtTesting();
-
- // cleanup: Remove References to DataStorage. This will delete the object
- ds = nullptr;
+ return qtapplication.exec();
}
/**
\example Step1.cpp
*/
diff --git a/Examples/Tutorial/Step1/files.cmake b/Examples/Tutorial/Step1/files.cmake
index f737b9bdaa..8568729050 100644
--- a/Examples/Tutorial/Step1/files.cmake
+++ b/Examples/Tutorial/Step1/files.cmake
@@ -1,4 +1,3 @@
set(CPP_FILES
Step1.cpp
- ../QtTesting.cpp
- )
+)
diff --git a/Examples/Tutorial/Step10/Step10.h b/Examples/Tutorial/Step10/Step10.h
index 2db8c12516..b1f4b82646 100644
--- a/Examples/Tutorial/Step10/Step10.h
+++ b/Examples/Tutorial/Step10/Step10.h
@@ -1,49 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkSmartPointer.h"
#include "mitkCommon.h"
#include "mitkDataInteractor.h"
#include <mitkPointSet.h>
namespace mitk
{
class ExampleInteractor : public DataInteractor
{
public:
mitkClassMacro(ExampleInteractor, DataInteractor);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
protected : ExampleInteractor();
virtual ~ExampleInteractor();
virtual void ConnectActionsAndFunctions();
/**
* Derived function.
* Is executed when config object is set / changed.
* Here it is used to read out the parameters set in the configuration file,
* and set the member variables accordingly.
*/
virtual void ConfigurationChanged();
private:
bool AddPoint(StateMachineAction *, InteractionEvent *); // function to add new points
bool EnoughPoints(StateMachineAction *,
InteractionEvent *); // function changes color of pointset to indicate, it is full
bool CheckPoint(const InteractionEvent *interactionEvent); // function checks if the clicked point is valid
PointSet::Pointer m_PointSet;
int m_NumberOfPoints;
int m_MaximalNumberOfPoints;
};
}
diff --git a/Examples/Tutorial/Step2/Step2.cpp b/Examples/Tutorial/Step2/Step2.cpp
index 8de4088bed..690cecd5b4 100644
--- a/Examples/Tutorial/Step2/Step2.cpp
+++ b/Examples/Tutorial/Step2/Step2.cpp
@@ -1,98 +1,93 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "QmitkRegisterClasses.h"
#include "QmitkRenderWindow.h"
#include <mitkStandaloneDataStorage.h>
#include <QApplication>
#include <itksys/SystemTools.hxx>
#include <mitkIOUtil.h>
//##Documentation
//## @brief Load one or more data sets (many image, surface
//## and other formats) and display it in a 2D view
int main(int argc, char *argv[])
{
QApplication qtapplication(argc, argv);
if (argc < 2)
{
fprintf(
stderr, "Usage: %s [filename1] [filename2] ...\n\n", itksys::SystemTools::GetFilenameName(argv[0]).c_str());
return 1;
}
// Register Qmitk-dependent global instances
QmitkRegisterClasses();
//*************************************************************************
// Part I: Basic initialization
//*************************************************************************
// Create a data storage object. We will use it as a singleton
mitk::StandaloneDataStorage::Pointer storage = mitk::StandaloneDataStorage::New();
//*************************************************************************
// Part II: Create some data by reading files
//*************************************************************************
int i;
for (i = 1; i < argc; ++i)
{
// For testing
if (strcmp(argv[i], "-testing") == 0)
continue;
//*********************************************************************
// Part III: Put the data into the datastorage
//*********************************************************************
// Add the node to the DataStorage
mitk::IOUtil::Load(argv[i], *storage);
}
//*************************************************************************
// Part IV: Create window and pass the datastorage to it
//*************************************************************************
// Create a RenderWindow
QmitkRenderWindow renderWindow;
// Tell the RenderWindow which (part of) the datastorage to render
renderWindow.GetRenderer()->SetDataStorage(storage);
// Initialize the RenderWindow
auto geo = storage->ComputeBoundingGeometry3D(storage->GetAll());
mitk::RenderingManager::GetInstance()->InitializeViews(geo);
// Select a slice
mitk::SliceNavigationController::Pointer sliceNaviController = renderWindow.GetSliceNavigationController();
if (sliceNaviController)
sliceNaviController->GetSlice()->SetPos(2);
//*************************************************************************
// Part V: Qt-specific initialization
//*************************************************************************
renderWindow.show();
renderWindow.resize(256, 256);
-// for testing
-#include "QtTesting.h"
- if (strcmp(argv[argc - 1], "-testing") != 0)
- return qtapplication.exec();
- else
- return QtTesting();
+ return qtapplication.exec();
}
/**
\example Step2.cpp
*/
diff --git a/Examples/Tutorial/Step2/files.cmake b/Examples/Tutorial/Step2/files.cmake
index 228aaba31f..d062a05faa 100644
--- a/Examples/Tutorial/Step2/files.cmake
+++ b/Examples/Tutorial/Step2/files.cmake
@@ -1,4 +1,3 @@
set(CPP_FILES
Step2.cpp
- ../QtTesting.cpp
- )
+)
diff --git a/Examples/Tutorial/Step3/Step3.cpp b/Examples/Tutorial/Step3/Step3.cpp
index 6e5015d309..dd50e6d8d4 100644
--- a/Examples/Tutorial/Step3/Step3.cpp
+++ b/Examples/Tutorial/Step3/Step3.cpp
@@ -1,159 +1,154 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "QmitkRegisterClasses.h"
#include "QmitkRenderWindow.h"
#include <mitkIOUtil.h>
#include <mitkProperties.h>
#include <mitkRenderingManager.h>
#include <mitkStandaloneDataStorage.h>
#include <mitkTransferFunction.h>
#include <mitkTransferFunctionProperty.h>
#include <itksys/SystemTools.hxx>
#include <QApplication>
//##Documentation
//## @brief Change the type of display to 3D
//##
//## As in Step2, load one or more data sets (many image, surface
//## and other formats), but display it in a 3D view.
//## The QmitkRenderWindow is now used for displaying a 3D view, by
//## setting the used mapper-slot to Standard3D.
//## Since volume-rendering is a (rather) slow procedure, the default
//## is that images are not displayed in the 3D view. For this example,
//## we want volume-rendering, thus we switch it on by setting
//## the Boolean-property "volumerendering" to "true".
int main(int argc, char *argv[])
{
QApplication qtapplication(argc, argv);
if (argc < 2)
{
fprintf(
stderr, "Usage: %s [filename1] [filename2] ...\n\n", itksys::SystemTools::GetFilenameName(argv[0]).c_str());
return 1;
}
// Register Qmitk-dependent global instances
QmitkRegisterClasses();
//*************************************************************************
// Part I: Basic initialization
//*************************************************************************
// Create a DataStorage
mitk::StandaloneDataStorage::Pointer ds = mitk::StandaloneDataStorage::New();
//*************************************************************************
// Part II: Create some data by reading files
//*************************************************************************
int i;
for (i = 1; i < argc; ++i)
{
// For testing
if (strcmp(argv[i], "-testing") == 0)
continue;
//*********************************************************************
// Part III: Put the data into the datastorage
//*********************************************************************
// Load datanode (eg. many image formats, surface formats, etc.)
mitk::StandaloneDataStorage::SetOfObjects::Pointer dataNodes = mitk::IOUtil::Load(argv[i], *ds);
if (dataNodes->empty())
{
fprintf(stderr, "Could not open file %s \n\n", argv[i]);
exit(2);
}
mitk::DataNode::Pointer node = dataNodes->at(0);
// *********************************************************
// ********************* START OF NEW PART 1 (Step 3a) *****
// *********************************************************
//*********************************************************************
// Part IV: We want all images to be volume-rendered
//*********************************************************************
// Check if the data is an image by dynamic_cast-ing the data
// contained in the node. Warning: dynamic_cast's are rather slow,
// do not use it too often!
mitk::Image::Pointer image = dynamic_cast<mitk::Image *>(node->GetData());
if (image.IsNotNull())
{
// Set the property "volumerendering" to the Boolean value "true"
node->SetProperty("volumerendering", mitk::BoolProperty::New(true));
// Create a transfer function to assign optical properties (color and opacity) to grey-values of the data
mitk::TransferFunction::Pointer tf = mitk::TransferFunction::New();
tf->InitializeByMitkImage(image);
// Set the color transfer function AddRGBPoint(double x, double r, double g, double b)
tf->GetColorTransferFunction()->AddRGBPoint(tf->GetColorTransferFunction()->GetRange()[0], 1.0, 0.0, 0.0);
tf->GetColorTransferFunction()->AddRGBPoint(tf->GetColorTransferFunction()->GetRange()[1], 1.0, 1.0, 0.0);
// Set the piecewise opacity transfer function AddPoint(double x, double y)
tf->GetScalarOpacityFunction()->AddPoint(0, 0);
tf->GetScalarOpacityFunction()->AddPoint(tf->GetColorTransferFunction()->GetRange()[1], 1);
node->SetProperty("TransferFunction", mitk::TransferFunctionProperty::New(tf.GetPointer()));
}
// *********************************************************
// ******************* END OF NEW PART 1 (Step 3a) *********
// *********************************************************
}
//*************************************************************************
// Part V: Create window and pass the tree to it
//*************************************************************************
// Create a renderwindow
QmitkRenderWindow renderWindow;
// Tell the renderwindow which (part of) the datastorage to render
renderWindow.GetRenderer()->SetDataStorage(ds);
// *********************************************************
// ****************** START OF NEW PART 2 (Step 3b) ********
// *********************************************************
// Use it as a 3D view!
renderWindow.GetRenderer()->SetMapperID(mitk::BaseRenderer::Standard3D);
// Reposition the camera to include all visible actors
renderWindow.GetRenderer()->GetVtkRenderer()->ResetCamera();
// *********************************************************
// ******************* END OF NEW PART 2 (Step 3b) *********
// *********************************************************
//*************************************************************************
// Part VI: Qt-specific initialization
//*************************************************************************
renderWindow.show();
renderWindow.resize(256, 256);
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
-// for testing
-#include "QtTesting.h"
- if (strcmp(argv[argc - 1], "-testing") != 0)
- return qtapplication.exec();
- else
- return QtTesting();
+ return qtapplication.exec();
}
/**
\example Step3.cpp
*/
diff --git a/Examples/Tutorial/Step3/files.cmake b/Examples/Tutorial/Step3/files.cmake
index 92387dd3f9..30d2410c08 100644
--- a/Examples/Tutorial/Step3/files.cmake
+++ b/Examples/Tutorial/Step3/files.cmake
@@ -1,4 +1,3 @@
set(CPP_FILES
Step3.cpp
- ../QtTesting.cpp
- )
+)
diff --git a/Examples/Tutorial/Step4/Step4.cpp b/Examples/Tutorial/Step4/Step4.cpp
index 36e6888a4c..236d2200c0 100644
--- a/Examples/Tutorial/Step4/Step4.cpp
+++ b/Examples/Tutorial/Step4/Step4.cpp
@@ -1,169 +1,164 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "QmitkRegisterClasses.h"
#include "QmitkRenderWindow.h"
#include "QmitkSliceWidget.h"
#include "mitkNodePredicateDataType.h"
#include "mitkProperties.h"
#include "mitkRenderingManager.h"
#include "mitkStandaloneDataStorage.h"
#include <mitkIOUtil.h>
#include <QApplication>
#include <QHBoxLayout>
#include <itksys/SystemTools.hxx>
#include <mitkImage.h>
//##Documentation
//## @brief Use several views to explore data
//##
//## As in Step2 and Step3, load one or more data sets (many image,
//## surface and other formats), but create 3 views on the data.
//## The QmitkRenderWindow is used for displaying a 3D view as in Step3,
//## but without volume-rendering.
//## Furthermore, we create two 2D views for slicing through the data.
//## We use the class QmitkSliceWidget, which is based on the class
//## QmitkRenderWindow, but additionally provides sliders
//## to slice through the data. We create two instances of
//## QmitkSliceWidget, one for axial and one for sagittal slicing.
//## The two slices are also shown at their correct position in 3D as
//## well as intersection-line, each in the other 2D view.
int main(int argc, char *argv[])
{
QApplication qtapplication(argc, argv);
if (argc < 2)
{
fprintf(
stderr, "Usage: %s [filename1] [filename2] ...\n\n", itksys::SystemTools::GetFilenameName(argv[0]).c_str());
return 1;
}
// Register Qmitk-dependent global instances
QmitkRegisterClasses();
//*************************************************************************
// Part I: Basic initialization
//*************************************************************************
// Create a DataStorage
mitk::StandaloneDataStorage::Pointer ds = mitk::StandaloneDataStorage::New();
//*************************************************************************
// Part II: Create some data by reading files
//*************************************************************************
int i;
for (i = 1; i < argc; ++i)
{
// For testing
if (strcmp(argv[i], "-testing") == 0)
continue;
//*********************************************************************
// Part III: Put the data into the datastorage
//*********************************************************************
// Load datanode (eg. many image formats, surface formats, etc.)
mitk::IOUtil::Load(argv[i], *ds);
}
//*************************************************************************
// Part IV: Create windows and pass the tree to it
//*************************************************************************
// Create toplevel widget with horizontal layout
QWidget toplevelWidget;
QHBoxLayout layout;
layout.setSpacing(2);
layout.setMargin(0);
toplevelWidget.setLayout(&layout);
//*************************************************************************
// Part IVa: 3D view
//*************************************************************************
// Create a renderwindow
QmitkRenderWindow renderWindow(&toplevelWidget);
layout.addWidget(&renderWindow);
// Tell the renderwindow which (part of) the datastorage to render
renderWindow.GetRenderer()->SetDataStorage(ds);
// Use it as a 3D view
renderWindow.GetRenderer()->SetMapperID(mitk::BaseRenderer::Standard3D);
// Reposition the camera to include all visible actors
renderWindow.GetRenderer()->GetVtkRenderer()->ResetCamera();
// *******************************************************
// ****************** START OF NEW PART ******************
// *******************************************************
//*************************************************************************
// Part IVb: 2D view for slicing axially
//*************************************************************************
// Create QmitkSliceWidget, which is based on the class
// QmitkRenderWindow, but additionally provides sliders
QmitkSliceWidget view2(&toplevelWidget);
layout.addWidget(&view2);
view2.SetLevelWindowEnabled(true);
// Tell the QmitkSliceWidget which (part of) the tree to render.
// By default, it slices the data axially
view2.SetDataStorage(ds);
// Get the image from the data storage. A predicate (mitk::NodePredicateBase)
// is used to get only nodes of the type mitk::Image.
mitk::DataStorage::SetOfObjects::ConstPointer rs = ds->GetSubset(mitk::TNodePredicateDataType<mitk::Image>::New());
view2.SetData(rs->Begin(), mitk::SliceNavigationController::Axial);
// We want to see the position of the slice in 2D and the
// slice itself in 3D: add it to the datastorage!
ds->Add(view2.GetRenderer()->GetCurrentWorldPlaneGeometryNode());
//*************************************************************************
// Part IVc: 2D view for slicing sagitally
//*************************************************************************
// Create QmitkSliceWidget, which is based on the class
// QmitkRenderWindow, but additionally provides sliders
QmitkSliceWidget view3(&toplevelWidget);
layout.addWidget(&view3);
view3.SetDataStorage(ds);
// Tell the QmitkSliceWidget which (part of) the datastorage to render
// and to slice sagitally
view3.SetData(rs->Begin(), mitk::SliceNavigationController::Sagittal);
// We want to see the position of the slice in 2D and the
// slice itself in 3D: add it to the datastorage!
ds->Add(view3.GetRenderer()->GetCurrentWorldPlaneGeometryNode());
// *******************************************************
// ******************* END OF NEW PART *******************
// *******************************************************
//*************************************************************************
// Part V: Qt-specific initialization
//*************************************************************************
toplevelWidget.show();
-// for testing
-#include "QtTesting.h"
- if (strcmp(argv[argc - 1], "-testing") != 0)
- return qtapplication.exec();
- else
- return QtTesting();
+ return qtapplication.exec();
}
/**
\example Step4.cpp
*/
diff --git a/Examples/Tutorial/Step4/files.cmake b/Examples/Tutorial/Step4/files.cmake
index 97d991f251..f092ddd9de 100644
--- a/Examples/Tutorial/Step4/files.cmake
+++ b/Examples/Tutorial/Step4/files.cmake
@@ -1,4 +1,3 @@
set(CPP_FILES
Step4.cpp
- ../QtTesting.cpp
- )
+)
diff --git a/Examples/Tutorial/Step5/Step5.cpp b/Examples/Tutorial/Step5/Step5.cpp
index f6f81e571d..6e3204d641 100644
--- a/Examples/Tutorial/Step5/Step5.cpp
+++ b/Examples/Tutorial/Step5/Step5.cpp
@@ -1,208 +1,203 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "QmitkRegisterClasses.h"
#include "QmitkRenderWindow.h"
#include "QmitkSliceWidget.h"
#include "mitkNodePredicateDataType.h"
#include "mitkProperties.h"
#include "mitkRenderingManager.h"
#include "mitkStandaloneDataStorage.h"
#include "mitkPointSet.h"
// NEW INCLUDE
#include "mitkPointSetDataInteractor.h"
#include <QApplication>
#include <QHBoxLayout>
#include <itksys/SystemTools.hxx>
#include <mitkIOUtil.h>
//##Documentation
//## @brief Interactively add points
//##
//## As in Step4, load one or more data sets (many image,
//## surface and other formats) and create 3 views on the data.
//## Additionally, we want to interactively add points. A node containing
//## a PointSet as data is added to the data tree and a PointSetDataInteractor
//## is associated with the node, which handles the interaction. The
//## @em interaction @em pattern is defined in a state-machine, stored in an
//## external XML file. Thus, we need to load a state-machine
//## The interaction patterns defines the @em events,
//## on which the interactor reacts (e.g., which mouse buttons are used to
//## set a point), the @em transition to the next state (e.g., the initial
//## may be "empty point set") and associated @a actions (e.g., add a point
//## at the position where the mouse-click occured).
int main(int argc, char *argv[])
{
QApplication qtapplication(argc, argv);
if (argc < 2)
{
fprintf(
stderr, "Usage: %s [filename1] [filename2] ...\n\n", itksys::SystemTools::GetFilenameName(argv[0]).c_str());
return 1;
}
// Register Qmitk-dependent global instances
QmitkRegisterClasses();
//*************************************************************************
// Part I: Basic initialization
//*************************************************************************
// Create a DataStorage
mitk::StandaloneDataStorage::Pointer ds = mitk::StandaloneDataStorage::New();
//*************************************************************************
// Part II: Create some data by reading files
//*************************************************************************
int i;
for (i = 1; i < argc; ++i)
{
// For testing
if (strcmp(argv[i], "-testing") == 0)
continue;
// Load datanode (eg. many image formats, surface formats, etc.)
mitk::StandaloneDataStorage::SetOfObjects::Pointer dataNodes = mitk::IOUtil::Load(argv[i], *ds);
//*********************************************************************
// Part III: Put the data into the datastorage
//*********************************************************************
// Add the node to the DataStorage
if (dataNodes->empty())
{
fprintf(stderr, "Could not open file %s \n\n", argv[i]);
exit(2);
}
}
//*************************************************************************
// Part V: Create windows and pass the tree to it
//*************************************************************************
// Create toplevel widget with horizontal layout
QWidget toplevelWidget;
QHBoxLayout layout;
layout.setSpacing(2);
layout.setMargin(0);
toplevelWidget.setLayout(&layout);
//*************************************************************************
// Part Va: 3D view
//*************************************************************************
// Create a renderwindow
QmitkRenderWindow renderWindow(&toplevelWidget);
layout.addWidget(&renderWindow);
// Tell the renderwindow which (part of) the tree to render
renderWindow.GetRenderer()->SetDataStorage(ds);
// Use it as a 3D view
renderWindow.GetRenderer()->SetMapperID(mitk::BaseRenderer::Standard3D);
// Reposition the camera to include all visible actors
renderWindow.GetRenderer()->GetVtkRenderer()->ResetCamera();
//*************************************************************************
// Part Vb: 2D view for slicing axially
//*************************************************************************
// Create QmitkSliceWidget, which is based on the class
// QmitkRenderWindow, but additionally provides sliders
QmitkSliceWidget view2(&toplevelWidget);
layout.addWidget(&view2);
// Tell the QmitkSliceWidget which (part of) the tree to render.
// By default, it slices the data axially
view2.SetDataStorage(ds);
mitk::DataStorage::SetOfObjects::ConstPointer rs = ds->GetSubset(mitk::TNodePredicateDataType<mitk::Image>::New());
view2.SetData(rs->Begin(), mitk::SliceNavigationController::Axial);
// We want to see the position of the slice in 2D and the
// slice itself in 3D: add it to the tree!
ds->Add(view2.GetRenderer()->GetCurrentWorldPlaneGeometryNode());
//*************************************************************************
// Part Vc: 2D view for slicing sagitally
//*************************************************************************
// Create QmitkSliceWidget, which is based on the class
// QmitkRenderWindow, but additionally provides sliders
QmitkSliceWidget view3(&toplevelWidget);
layout.addWidget(&view3);
// Tell the QmitkSliceWidget which (part of) the tree to render
// and to slice sagitall
view3.SetDataStorage(ds);
view3.SetData(rs->Begin(), mitk::SliceNavigationController::Sagittal);
// We want to see the position of the slice in 2D and the
// slice itself in 3D: add it to the tree!
ds->Add(view3.GetRenderer()->GetCurrentWorldPlaneGeometryNode());
// *******************************************************
// ****************** START OF NEW PART ******************
// *******************************************************
//*************************************************************************
// Part VI: For allowing to interactively add points ...
//*************************************************************************
// ATTENTION: It is very important that the renderer already know their DataStorage,
// because registerig DataInteractors with the render windows is done automatically
// and only works if the BaseRenderer and the DataStorage know each other.
// Create PointSet and a node for it
mitk::PointSet::Pointer pointSet = mitk::PointSet::New();
mitk::DataNode::Pointer pointSetNode = mitk::DataNode::New();
// Store the point set in the DataNode
pointSetNode->SetData(pointSet);
// Add the node to the tree
ds->Add(pointSetNode);
// Create PointSetDataInteractor
mitk::PointSetDataInteractor::Pointer interactor = mitk::PointSetDataInteractor::New();
// Set the StateMachine pattern that describes the flow of the interactions
interactor->LoadStateMachine("PointSet.xml");
// Set the configuration file, which describes the user interactions that trigger actions
// in this file SHIFT + LeftClick triggers add Point, but by modifying this file,
// it could as well be changes to any other user interaction.
interactor->SetEventConfig("PointSetConfig.xml");
// Assign the pointSetNode to the interactor,
// alternatively one could also add the DataInteractor to the pointSetNode using the SetDataInteractor() method.
interactor->SetDataNode(pointSetNode);
// *******************************************************
// ******************* END OF NEW PART *******************
// *******************************************************
//*************************************************************************
// Part VII: Qt-specific initialization
//*************************************************************************
toplevelWidget.show();
-// For testing
-#include "QtTesting.h"
- if (strcmp(argv[argc - 1], "-testing") != 0)
- return qtapplication.exec();
- else
- return QtTesting();
+ return qtapplication.exec();
}
/**
\example Step5.cpp
*/
diff --git a/Examples/Tutorial/Step5/files.cmake b/Examples/Tutorial/Step5/files.cmake
index 37b77371cc..61cbad6823 100644
--- a/Examples/Tutorial/Step5/files.cmake
+++ b/Examples/Tutorial/Step5/files.cmake
@@ -1,4 +1,3 @@
set(CPP_FILES
Step5.cpp
- ../QtTesting.cpp
- )
+)
diff --git a/Examples/Tutorial/Step6/Step6main.cpp b/Examples/Tutorial/Step6/Step6main.cpp
index e6c2c61f3a..119da5e240 100644
--- a/Examples/Tutorial/Step6/Step6main.cpp
+++ b/Examples/Tutorial/Step6/Step6main.cpp
@@ -1,47 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "QmitkRegisterClasses.h"
#include "Step6.h"
#include "mitkDataStorage.h"
#include <QApplication>
#include <itksys/SystemTools.hxx>
int main(int argc, char *argv[])
{
QApplication qtapplication(argc, argv);
if (argc < 2)
{
fprintf(
stderr, "Usage: %s [filename1] [filename2] ...\n\n", itksys::SystemTools::GetFilenameName(argv[0]).c_str());
return 1;
}
// Register Qmitk-dependent global instances
QmitkRegisterClasses();
Step6 mainWidget(argc, argv, nullptr);
mainWidget.Initialize();
mainWidget.show();
-// for testing
-#include "QtTesting.h"
- if (strcmp(argv[argc - 1], "-testing") != 0)
- return qtapplication.exec();
- else
- return QtTesting();
+ return qtapplication.exec();
}
/**
\example Step6main.cpp
*/
diff --git a/Examples/Tutorial/Step6/files.cmake b/Examples/Tutorial/Step6/files.cmake
index 51e4db2011..f3137dce13 100644
--- a/Examples/Tutorial/Step6/files.cmake
+++ b/Examples/Tutorial/Step6/files.cmake
@@ -1,12 +1,11 @@
set(CPP_FILES
Step6.cpp
Step6RegionGrowing1.cpp
Step6RegionGrowing2.cpp
Step6RegionGrowing3.cpp
Step6main.cpp
- ../QtTesting.cpp
- )
+)
set(MOC_H_FILES
Step6.h
- )
+)
diff --git a/Examples/Tutorial/Step7/Step7main.cpp b/Examples/Tutorial/Step7/Step7main.cpp
index fb44f54b43..e6139d294e 100644
--- a/Examples/Tutorial/Step7/Step7main.cpp
+++ b/Examples/Tutorial/Step7/Step7main.cpp
@@ -1,47 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "QmitkRegisterClasses.h"
#include "Step7.h"
#include <QApplication>
#include <itksys/SystemTools.hxx>
int main(int argc, char *argv[])
{
QApplication qtapplication(argc, argv);
if (argc < 2)
{
fprintf(
stderr, "Usage: %s [filename1] [filename2] ...\n\n", itksys::SystemTools::GetFilenameName(argv[0]).c_str());
return 1;
}
// Register Qmitk-dependent global instances
QmitkRegisterClasses();
Step7 mainWidget(argc, argv, nullptr);
mainWidget.Initialize();
mainWidget.show();
-// for testing
-#include "QtTesting.h"
- if (strcmp(argv[argc - 1], "-testing") != 0)
- return qtapplication.exec();
- else
- return QtTesting();
+ return qtapplication.exec();
}
/**
\example Step7main.cpp
*/
diff --git a/Examples/Tutorial/Step7/files.cmake b/Examples/Tutorial/Step7/files.cmake
index 72cf47060e..136d4ba66f 100644
--- a/Examples/Tutorial/Step7/files.cmake
+++ b/Examples/Tutorial/Step7/files.cmake
@@ -1,14 +1,13 @@
set(CPP_FILES
Step7.cpp
Step7main.cpp
../Step6/Step6RegionGrowing1.cpp
../Step6/Step6RegionGrowing2.cpp
../Step6/Step6RegionGrowing3.cpp
../Step6/Step6.cpp
- ../QtTesting.cpp
- )
+)
set(MOC_H_FILES
../Step6/Step6.h
Step7.h
- )
+)
diff --git a/Examples/Tutorial/Step8/Step8main.cpp b/Examples/Tutorial/Step8/Step8main.cpp
index ecf82688a9..c1f72618a6 100644
--- a/Examples/Tutorial/Step8/Step8main.cpp
+++ b/Examples/Tutorial/Step8/Step8main.cpp
@@ -1,46 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "QmitkRegisterClasses.h"
#include "Step8.h"
#include <QApplication>
#include <itksys/SystemTools.hxx>
int main(int argc, char *argv[])
{
QApplication qtapplication(argc, argv);
if (argc < 2)
{
fprintf(
stderr, "Usage: %s [filename1] [filename2] ...\n\n", itksys::SystemTools::GetFilenameName(argv[0]).c_str());
return 1;
}
// Register Qmitk-dependent global instances
QmitkRegisterClasses();
Step8 mainWidget(argc, argv, nullptr);
mainWidget.Initialize();
mainWidget.show();
-// for testing
-#include "QtTesting.h"
- if (strcmp(argv[argc - 1], "-testing") != 0)
- return qtapplication.exec();
- else
- return QtTesting();
+ return qtapplication.exec();
}
/**
\example Step8main.cpp
*/
diff --git a/Examples/Tutorial/Step8/files.cmake b/Examples/Tutorial/Step8/files.cmake
index 1be2ec21f7..1570dd9dda 100644
--- a/Examples/Tutorial/Step8/files.cmake
+++ b/Examples/Tutorial/Step8/files.cmake
@@ -1,16 +1,15 @@
set(CPP_FILES
Step8.cpp
Step8main.cpp
../Step6/Step6RegionGrowing1.cpp
../Step6/Step6RegionGrowing2.cpp
../Step6/Step6RegionGrowing3.cpp
../Step6/Step6.cpp
../Step7/Step7.cpp
- ../QtTesting.cpp
- )
+)
set(MOC_H_FILES
../Step6/Step6.h
../Step7/Step7.h
Step8.h
- )
+)
diff --git a/Modules/AlgorithmsExt/include/itkIntelligentBinaryClosingFilter.h b/Modules/AlgorithmsExt/include/itkIntelligentBinaryClosingFilter.h
index 9d8c9f519d..4025246aec 100644
--- a/Modules/AlgorithmsExt/include/itkIntelligentBinaryClosingFilter.h
+++ b/Modules/AlgorithmsExt/include/itkIntelligentBinaryClosingFilter.h
@@ -1,133 +1,134 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __itkIntelligentBinaryClosingFilter_h
#define __itkIntelligentBinaryClosingFilter_h
#if defined(_MSC_VER)
#pragma warning(disable : 4786)
#endif
#include <itkBinaryBallStructuringElement.h>
#include <itkBinaryDilateImageFilter.h>
#include <itkBinaryErodeImageFilter.h>
#include <itkConnectedComponentImageFilter.h>
#include <itkConnectedComponentImageFilter.h>
#include <itkGrayscaleDilateImageFilter.h>
#include <itkImageRegionIterator.h>
#include <itkImageToImageFilter.h>
#include <itkRelabelComponentImageFilter.h>
#include <itkSubtractImageFilter.h>
namespace itk
{
/** \class itkIntelligentBinaryClosingFilter
* WARNING: This filtezr needs at least ITK version 3.2
* or above to run and compile!!!
* */
template <class TInputImage, class TOutputImage>
class ITK_EXPORT IntelligentBinaryClosingFilter : public ImageToImageFilter<TInputImage, TOutputImage>
{
public:
/** Standard "Self" typedef. */
typedef IntelligentBinaryClosingFilter Self;
/** The type of input image. */
typedef TInputImage InputImageType;
/** Dimension of the input and output images. */
itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
/** The type of output image. */
typedef TOutputImage OutputImageType;
/** Standard super class typedef support. */
typedef ImageToImageFilter<InputImageType, OutputImageType> Superclass;
/** Smart pointer typedef support */
typedef SmartPointer<Self> Pointer;
/** Run-time type information (and related methods) */
itkTypeMacro(IntelligentBinaryClosingFilter, ImageToImageFilter);
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Standard process object method. This filter is not multithreaded. */
void GenerateData() override;
/** Overloaded to link the input to this filter with the input of the
mini-pipeline */
void SetInput(const InputImageType *input) override
{
// processObject is not const-correct so a const_cast is needed here
this->ProcessObject::SetNthInput(0, const_cast<InputImageType *>(input));
m_DilateImageFilter->SetInput(input);
}
using Superclass::SetInput;
void SetInput(unsigned int i, const TInputImage *image) override
{
if (i != 0)
{
itkExceptionMacro(<< "Filter has only one input.");
}
else
{
this->SetInput(image);
}
}
itkGetMacro(ClosingRadius, float);
itkSetMacro(ClosingRadius, float);
itkGetMacro(SurfaceRatio, float);
itkSetMacro(SurfaceRatio, float);
protected:
IntelligentBinaryClosingFilter();
~IntelligentBinaryClosingFilter() override {}
void PrintSelf(std::ostream &os, Indent indent) const override;
private:
typedef typename InputImageType::PixelType InputPixelType;
typedef BinaryBallStructuringElement<InputPixelType, ImageDimension> StructuringElementType;
typedef BinaryErodeImageFilter<InputImageType, InputImageType, StructuringElementType> BinaryErodeImageFilterType;
typedef BinaryDilateImageFilter<InputImageType, InputImageType, StructuringElementType> BinaryDilateImageFilterType;
typedef SubtractImageFilter<InputImageType, InputImageType, InputImageType> SubtractImageFilterType;
typedef ConnectedComponentImageFilter<InputImageType, OutputImageType> ConnectedComponentImageFilterType;
typedef RelabelComponentImageFilter<OutputImageType, OutputImageType> RelabelComponentImageFilterType;
typedef GrayscaleDilateImageFilter<OutputImageType, OutputImageType, StructuringElementType>
DilateComponentImageFilterType;
typedef ImageRegionIterator<InputImageType> InputIteratorType;
typedef ImageRegionConstIterator<InputImageType> ConstInputIteratorType;
typedef ImageRegionIterator<OutputImageType> OutputIteratorType;
typename BinaryErodeImageFilterType::Pointer m_ErodeImageFilter;
typename BinaryDilateImageFilterType::Pointer m_DilateImageFilter;
typename SubtractImageFilterType::Pointer m_SubtractImageFilter;
typename ConnectedComponentImageFilterType::Pointer m_ConnectedComponentImageFilter;
typename RelabelComponentImageFilterType::Pointer m_RelabelComponentImageFilter;
typename DilateComponentImageFilterType::Pointer m_BorderDetectionDilateFilter;
// typename BinaryDilateImageFilterType::Pointer m_BorderAdjacencyDilateFilter;
float m_ClosingRadius;
float m_SurfaceRatio;
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkIntelligentBinaryClosingFilter.txx"
#endif
#endif // IntelligentBinaryClosingFilter_h
diff --git a/Modules/AlgorithmsExt/include/mitkAnisotropicIterativeClosestPointRegistration.h b/Modules/AlgorithmsExt/include/mitkAnisotropicIterativeClosestPointRegistration.h
index 21f4d6ab49..0d79522b13 100644
--- a/Modules/AlgorithmsExt/include/mitkAnisotropicIterativeClosestPointRegistration.h
+++ b/Modules/AlgorithmsExt/include/mitkAnisotropicIterativeClosestPointRegistration.h
@@ -1,308 +1,309 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __ANISOTROPICITERATIVECLOSESTPOINTREGISTRATION_H__
#define __ANISOTROPICITERATIVECLOSESTPOINTREGISTRATION_H__
// MITK
#include <mitkCommon.h>
#include <mitkVector.h>
// EXPORTS
#include "MitkAlgorithmsExtExports.h"
// STL
#include <vector>
// ITK
#include <itkMatrix.h>
// forward declarations
class vtkPoints;
class vtkKdTreePointLocator;
namespace mitk
{
class Surface;
class WeightedPointTransform;
/**
* \ingroup AnisotropicRegistration
*
* @brief Implementation of the anisotropic iterative closest point (A-ICP)
* algoritm.
*
* This class implements the anisotropic interative closest point (A-ICP)
* algorithm presented in L. Maier-Hein et al. in "Convergent Iterative
* Closest-Point Algorithm to Accomodate Anisotropic and Inhomogenous
* Localization Error.", IEEE T Pattern Anal 34 (8), 1520-1532, 2012.
* The algorithm computes the optimal transformation to align two surfaces.
* In addition to the surfaces a list of covariance matrices is used as
* input for every surface. Each covariance matrix represents the error of
* a specific vertex in the Surface. The covariance matrices
* for each surface can be defined by the user, or calculated
* by the CovarianceMatrixCalculator. In addition a trimmed algorithm version
* is provided to compute the registration of partial overlapping surfaces.
* The algorithm needs a clean surface non manifold edges and without duplicated
* vertices. In addition vtkCleanPolyData can be used to ensure a correct
* Surface representation.
*
* \note The correspondence search is accelerated when OpenMP is enabled.
*
* \b Example:
*
*
* \code
* typedef itk::Matrix < double, 3, 3 > Matrix3x3;
* typedef itk::Vector < double, 3 > Vector3;
* typedef std::vector < Matrix3x3 > CovarianceMatrixList;
*
* // compute the covariance matrices
* mitk::CovarianceMatrixCalculator::Pointer matrixCalculator =
* mitk::CovarianceMatrixCalculator::New();
*
* // compute the covariance matrices for the moving surface (X)
* matrixCalculator->SetInputSurface(movingSurface);
* matrixCalculator->ComputeCovarianceMatrices();
* CovarianceMatrixList sigmas_X = matrixCalculator->GetCovarianceMatrices();
* double meanVarX = matrixCalculator->GetMeanVariance();
*
* // compute the covariance matrices for the fixed surface (Y)
* matrixCalculator->SetInputSurface(fixedSurface);
* matrixCalculator->ComputeCovarianceMatrices();
* CovarianceMatrixList sigmas_Y = matrixCalculator->GetCovarianceMatrices();
* double meanVarY = matrixCalculator->GetMeanVariance();
*
* // the FRE normalization factor
* double normalizationFactor = sqrt( meanVarX + meanVarY);
*
* // A-ICP algorithm
* mitk::AnisotropicIterativeClosestPointRegistration::Pointer aICP =
* mitk::AnisotropicIterativeClosestPointRegistration::New();
*
* // set up parameters
* aICP->SetMovingSurface(movingSurface);
* aICP->SetFixedSurface(fixedSurface);
* aICP->SetCovarianceMatricesMovingSurface(sigmas_X);
* aICP->SetCovarianceMatricesFixedSurface(sigmas_Y);
* aICP->SetFRENormalizationFactor(normalizationFactor);
*
* // Trimming is enabled if a fator > 0.0 is set.
* // 40 percent of the moving point set
* // will be used for registration in this example.
* // To disable trimming set the trim factor back to 0.0
* aICP->SetTrimmFactor(0.4);
*
* // run the algorithm
* aICP->Update();
*
* // retrieve the computed transformation
* Matrix3x3 rotation = aICP->GetRotation();
* Vector3 translation = aICP->GetTranslation();
* \endcode
*
*/
class MITKALGORITHMSEXT_EXPORT AnisotropicIterativeClosestPointRegistration : public itk::Object
{
protected:
/** Definition of a 3x3 covariance matrix.*/
typedef itk::Matrix<double, 3, 3> CovarianceMatrix;
/** Definition of a list of covariance matrices.*/
typedef std::vector<CovarianceMatrix> CovarianceMatrixList;
/** Definition of a translation vector.*/
typedef mitk::Vector3D Translation;
/** Definition of a 3x3 rotation matrix.*/
typedef CovarianceMatrix Rotation;
/** Definition of a correspondeces, index and distance.*/
typedef std::pair<unsigned int, double> Correspondence;
/** Definition of a list of correspondences.*/
typedef std::vector<Correspondence> CorrespondenceList;
AnisotropicIterativeClosestPointRegistration();
~AnisotropicIterativeClosestPointRegistration() override;
/** Max amount of iterations. Default is 1000.*/
unsigned int m_MaxIterations;
/** Threshold used for termination. Default is 1.0e-6.*/
double m_Threshold;
/** Normalization factor for the feducial registration error. default is 0.0.*/
double m_FRENormalizationFactor;
/** Search radius for the correspondence search. Default is 30.*/
double m_SearchRadius;
/** The maximum number of iterations in the weighted point based
* registration. Default is 1000.
*/
double m_MaxIterationsInWeightedPointTransform;
/** The fiducial registration error (FRE).*/
double m_FRE;
/** Trimmfactor for partial overlapping registration. Default is 0.*/
double m_TrimmFactor;
/** Amount of iterations used by the algorithm.*/
unsigned int m_NumberOfIterations;
/** Moving surface that is transformed on the fixed surface.*/
itk::SmartPointer<Surface> m_MovingSurface;
/** The fixed / target surface.*/
itk::SmartPointer<Surface> m_FixedSurface;
/** The weighted point based registration algorithm.*/
itk::SmartPointer<WeightedPointTransform> m_WeightedPointTransform;
/** The covariance matrices belonging to the moving surface (X).*/
CovarianceMatrixList m_CovarianceMatricesMovingSurface;
/** The covariance matrices belonging to the moving surface (Y).*/
CovarianceMatrixList m_CovarianceMatricesFixedSurface;
/** The computed 3x1 translation vector.*/
Translation m_Translation;
/** The computed 3x3 rotation matrix.*/
Rotation m_Rotation;
/**
* Method that computes the correspondences between the moving point set X
* and the fixed point set Y. The distances between the points
* are weighted with weight matrices that are computed from the covariances
* along the surfaces axes. This method implements the runtime optimization
* presented by L. Maier-Hein et al.. The correspondences are computed with
* the help of a kd tree. The correspondences are searched in a given radius
* in the euklidian space. Every correspondence found in this radius is
* weighted based on the covariance matrices and the best weighting will be
* used as a correspondence.
*
* @param X The moving point set.
* @param Z The returned correspondences from the fixed point set.
* @param Y The fixed point set saved in a kd tree.
* @param sigma_X Covariance matrices belonging to the moving point set.
* @param sigma_Y Covariance matrices belonging to the fixed point set.
* @param sigma_Z Covariance matrices belonging to the correspondences found.
* @param correspondences Saved correspondences, in a pair containing the
* their index in Y and distance.
* @param radius The search radius used in in kd tree.
*
*/
void ComputeCorrespondences(vtkPoints *X,
vtkPoints *Z,
vtkKdTreePointLocator *Y,
const CovarianceMatrixList &sigma_X,
const CovarianceMatrixList &sigma_Y,
CovarianceMatrixList &sigma_Z,
CorrespondenceList &correspondences,
const double radius);
public:
- mitkClassMacroItkParent(AnisotropicIterativeClosestPointRegistration, itk::Object) itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacroItkParent(AnisotropicIterativeClosestPointRegistration, itk::Object);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Set the maximum amount of iterations used by the algorithm. */
- itkSetMacro(MaxIterations, unsigned int)
+ itkSetMacro(MaxIterations, unsigned int);
/** Set the threshold used to terminate the algorithm.*/
- itkSetMacro(Threshold, double)
+ itkSetMacro(Threshold, double);
/** Set the normalization factor for the fiducial registration error (FRE).
* The normalization factor is computed with the help of the mean variance
* of both CovarianceMatrixList that can be obtained when the covariance
* matrices are calculated with the CovarianceMatrixCalculator:
*
* \code{.cpp}
* double FRENormalizationFactor = sqrt ( MeanVarianceX + MeanVarianceY );
* \endcode
*
* if no FRE normalization is used the normalization factor is set to 1.0
* as default value.
*/
- itkSetMacro(FRENormalizationFactor, double)
+ itkSetMacro(FRENormalizationFactor, double);
/** Set search radius for the correspondence search.*/
- itkSetMacro(SearchRadius, double)
+ itkSetMacro(SearchRadius, double);
/** Set the maximim number of iterations used by the point based registration
* algorithm.
*/
- itkSetMacro(MaxIterationsInWeightedPointTransform, double)
+ itkSetMacro(MaxIterationsInWeightedPointTransform, double);
/** Get the fiducial registration error (FRE).*/
- itkGetMacro(FRE, double)
+ itkGetMacro(FRE, double);
/** Get the number of iterations used by the algorithm.*/
- itkGetMacro(NumberOfIterations, unsigned int)
+ itkGetMacro(NumberOfIterations, unsigned int);
/**
* Factor that trimms the point set in percent for
* partial overlapping surfaces. E.g. 0.4 will use 40 precent
* of the point set. To enable the trimmed version a
* factor > 0 and < 1 must be set. The default value is 0.0.
*/
- itkSetMacro(TrimmFactor, double)
+ itkSetMacro(TrimmFactor, double);
/**
* Set moving surface that includes the point set (X).
*/
- itkSetMacro(MovingSurface, itk::SmartPointer<Surface>)
+ itkSetMacro(MovingSurface, itk::SmartPointer<Surface>);
/**
* Set fixed surface that includes the point set (Y).
*/
- itkSetMacro(FixedSurface, itk::SmartPointer<Surface>)
+ itkSetMacro(FixedSurface, itk::SmartPointer<Surface>);
/**
* Returns the 3x1 translation vector computed by the algorithm.
*/
- itkGetConstReferenceMacro(Translation, Translation)
+ itkGetConstReferenceMacro(Translation, Translation);
/**
* Returns the 3x3 rotation matrix computed by the algorithm.
*/
- itkGetConstReferenceMacro(Rotation, Rotation)
+ itkGetConstReferenceMacro(Rotation, Rotation);
/**
* Set the covariance matrices of the moving surface. The algorithm
* need the same amount of covariance and points available in the surface.
* The covariance matrix for every vertex in a Surface can be calculated by
* the CovarianceMatrixCalculator. It is also possible to define
* arbitrary matrices by hand.
*/
void SetCovarianceMatricesMovingSurface(CovarianceMatrixList &list)
{
m_CovarianceMatricesMovingSurface = list;
}
/**
* Set the covariance matrices of the fixed surface. The algorithm
* need the same amount of covariance and points available in the surface.
* The covariance matrix for every vertex in a Surface can be calculated by
* the CovarianceMatrixCalculator. It is also possible to define
* arbitrary matrices by hand.
*/
void SetCovarianceMatricesFixedSurface(CovarianceMatrixList &list) { m_CovarianceMatricesFixedSurface = list; }
/**
* This method executes the algorithm.
*
* @warning The algorithm is only a simple calculation filter and can not be
* used in a mitk filter pipline.
*
* @throws Exception if the search radius was doubled more than 20 times to
* prevent endless loops. Re-run the with a different search radius that
* will find the correspondences.
*/
void Update();
};
}
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkAutoCropImageFilter.h b/Modules/AlgorithmsExt/include/mitkAutoCropImageFilter.h
index d7efd03bf1..a91826b90c 100644
--- a/Modules/AlgorithmsExt/include/mitkAutoCropImageFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkAutoCropImageFilter.h
@@ -1,120 +1,122 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkAutoCropImageFilter_h_
#define __mitkAutoCropImageFilter_h_
#include "MitkAlgorithmsExtExports.h"
#include "mitkCommon.h"
#include "mitkImageTimeSelector.h"
#include "mitkSubImageSelector.h"
#include <itkImage.h>
#include <itkImageRegion.h>
namespace mitk
{
/**
*
* @brief Shrink the image borders to a minimum considering a background color.
*
* This filter determines the smallest bounding box of all pixels different
* from the background, and returns an output image which has been cropped to this size.
* The box calculated this way is not the smallest possible box, but the box with the
* smallest sides perpendicular to the world coordinate system.
*
* The filter works on 3D and 4D image data. For the 4D case, the smallest box is
* calculated with side lengths as the maximum of single side lengths from all time steps.
*
* 2D images are not supported, and will never be.
*
* It is also possible to set the region to be cropped manually using the
* SetCroppingRegion() method.
*
* A margin can be set to enlarge the cropped region with a constant factor in all
* directions around the smallest possible.
*
*
* @ingroup Process
*
* @author Thomas Boettger; revised by Tobias Schwarz and Daniel Stein
*
*/
class MITKALGORITHMSEXT_EXPORT AutoCropImageFilter : public SubImageSelector
{
public:
typedef itk::ImageRegion<3> RegionType;
mitkClassMacro(AutoCropImageFilter, SubImageSelector);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
- itkGetConstMacro(BackgroundValue, float);
+ itkCloneMacro(Self);
+
+ itkGetConstMacro(BackgroundValue, float);
itkSetMacro(BackgroundValue, float);
itkGetConstMacro(MarginFactor, float);
itkSetMacro(MarginFactor, float);
itkGetMacro(CroppingRegion, RegionType);
// Use this method to manually set a region
void SetCroppingRegion(RegionType overrideRegion);
virtual const PixelType GetOutputPixelType();
protected:
// default constructor
AutoCropImageFilter();
// default destructor
~AutoCropImageFilter() override;
// This method calculates the actual smallest box
void ComputeNewImageBounds();
// Crops the image using the itk::RegionOfInterestImageFilter and creates the new output image
template <typename TPixel, unsigned int VImageDimension>
void ITKCrop3DImage(itk::Image<TPixel, VImageDimension> *inputItkImage, unsigned int timestep);
// Here, the output image is initialized by the input and the newly calculated region
void GenerateOutputInformation() override;
// Purposely not implemented
void GenerateInputRequestedRegion() override;
// Crops the image on all time steps
void GenerateData() override;
float m_BackgroundValue;
RegionType m_CroppingRegion;
float m_MarginFactor;
typedef itk::Image<float, 3> ImageType;
typedef ImageType::Pointer ImagePointer;
RegionType::SizeType m_RegionSize;
RegionType::IndexType m_RegionIndex;
mitk::ImageTimeSelector::Pointer m_TimeSelector;
mitk::SlicedData::RegionType m_InputRequestedRegion;
itk::TimeStamp m_TimeOfHeaderInitialization;
bool m_OverrideCroppingRegion;
};
} // namespace mitk
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkBoundingObjectCutAndCast.h b/Modules/AlgorithmsExt/include/mitkBoundingObjectCutAndCast.h
index 98c41a604b..9733475d51 100644
--- a/Modules/AlgorithmsExt/include/mitkBoundingObjectCutAndCast.h
+++ b/Modules/AlgorithmsExt/include/mitkBoundingObjectCutAndCast.h
@@ -1,55 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BOUNDINGOBJECTCUTANDCAST_H_HEADER_INCLUDED_C10B22CD
#define BOUNDINGOBJECTCUTANDCAST_H_HEADER_INCLUDED_C10B22CD
#include "mitkBoundingObjectCutter.h"
#include "mitkCommon.h"
#include "mitkBoundingObjectCutter.txx"
namespace mitk
{
//##Documentation
//## @brief Cuts an Boundingobject out of an mitk Image
//##
//## Input Parameters are a mitk::BoundingObject and optionally an mitk::Image
//## if no mitk::Image is provided, the resulting image will have m_InsideValue as pixelvalue on inside pixel,
//## otherwise it will have the pixelvalue of the input image.
//## Pixel on the outside of the BoundingObject will have a pixelvalue of m_OutsideValue
//## \todo What Image resolution/spacing should be used, if no input image is given?
//## @ingroup Process
template <typename TPixel>
class BoundingObjectCutAndCast : public BoundingObjectCutter
{
public:
mitkClassMacro(BoundingObjectCutAndCast, BoundingObjectCutter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef TPixel PixelType;
protected:
BoundingObjectCutAndCast();
virtual ~BoundingObjectCutAndCast();
virtual const std::type_info &GetOutputPixelType();
virtual void ComputeData(mitk::Image *input3D, int boTimeStep);
};
} // namespace mitk
#ifndef MITK_MANUAL_INSTANTIATION
#include "mitkBoundingObjectCutAndCast.txx" // because it is a template
#endif
#endif /* BOUNDINGOBJECTCUTANDCAST_H_HEADER_INCLUDED_C10B22CD */
diff --git a/Modules/AlgorithmsExt/include/mitkBoundingObjectCutter.h b/Modules/AlgorithmsExt/include/mitkBoundingObjectCutter.h
index 08b5e37b9f..57d98b6ea5 100644
--- a/Modules/AlgorithmsExt/include/mitkBoundingObjectCutter.h
+++ b/Modules/AlgorithmsExt/include/mitkBoundingObjectCutter.h
@@ -1,140 +1,141 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BOUNDINGOBJECTCUTTER_H_HEADER_INCLUDED_C10B22CD
#define BOUNDINGOBJECTCUTTER_H_HEADER_INCLUDED_C10B22CD
#include "MitkAlgorithmsExtExports.h"
#include "itkImage.h"
#include "mitkBoundingObject.h"
#include "mitkCommon.h"
#include "mitkImageTimeSelector.h"
#include "mitkImageToImageFilter.h"
namespace mitk
{
//##Documentation
//## @brief Cuts an Boundingobject out of an mitk Image
//##
//## Input Parameters are a mitk::BoundingObject and optionally an mitk::Image
//## if no mitk::Image is provided, the resulting image will have m_InsideValue as pixelvalue on inside pixel,
//## otherwise it will have the pixelvalue of the input image.
//## Pixel on the outside of the BoundingObject will have a pixelvalue of m_OutsideValue
//## \todo What Image resolution/spacing should be used, if no input image is given?
//## @ingroup Process
class MITKALGORITHMSEXT_EXPORT BoundingObjectCutter : public ImageToImageFilter
{
public:
mitkClassMacro(BoundingObjectCutter, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void SetBoundingObject(const mitk::BoundingObject *boundingObject);
const mitk::BoundingObject *GetBoundingObject() const;
//##Description
//## @brief Set for inside pixels, used when m_UseInsideValue is @a true
itkSetMacro(InsideValue, ScalarType);
itkGetMacro(InsideValue, ScalarType);
//##Description
//## @brief Set value for outside pixels, used when m_AutoOutsideValue is \a false
itkSetMacro(OutsideValue, ScalarType);
itkGetMacro(OutsideValue, ScalarType);
itkSetMacro(UseInsideValue, bool);
itkGetMacro(UseInsideValue, bool);
itkBooleanMacro(UseInsideValue);
//##Description
//## @brief If set to \a true the minimum of the ouput pixel type is
//## used as outside value.
itkSetMacro(AutoOutsideValue, bool);
itkGetMacro(AutoOutsideValue, bool);
itkBooleanMacro(AutoOutsideValue);
itkGetMacro(InsidePixelCount, unsigned int);
itkGetMacro(OutsidePixelCount, unsigned int);
itkSetMacro(UseWholeInputRegion, bool);
itkGetMacro(UseWholeInputRegion, bool);
protected:
BoundingObjectCutter();
~BoundingObjectCutter() override;
virtual const PixelType GetOutputPixelType();
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
template <typename TPixel, unsigned int VImageDimension, typename TOutputPixel>
friend void CutImageWithOutputTypeSelect(itk::Image<TPixel, VImageDimension> *inputItkImage,
mitk::BoundingObjectCutter *cutter,
int boTimeStep,
TOutputPixel *dummy);
template <typename TPixel, unsigned int VImageDimension, typename TOutputPixel>
friend void CutImageWithOutputTypeSelect(itk::VectorImage<TPixel, VImageDimension> *inputItkImage,
mitk::BoundingObjectCutter *cutter,
int boTimeStep,
TOutputPixel *dummy);
template <typename TPixel, unsigned int VImageDimension>
friend void CutImage(itk::Image<TPixel, VImageDimension> *itkImage,
mitk::BoundingObjectCutter *cutter,
int boTimeStep);
template <typename TPixel, unsigned int VImageDimension>
friend void CutImage(itk::VectorImage<TPixel, VImageDimension> *itkImage,
mitk::BoundingObjectCutter *cutter,
int boTimeStep);
virtual void ComputeData(mitk::Image *input3D, int boTimeStep);
//##Description
//## @brief BoundingObject that will be cut
mitk::BoundingObject::Pointer m_BoundingObject;
//##Description
//## @brief Value for inside pixels, used when m_UseInsideValue is @a true
//##
//## \sa m_UseInsideValue
ScalarType m_InsideValue;
//##Description
//## @brief Value for outside pixels (default: 0)
//##
//## Used only if m_AutoOutsideValue is \a false.
ScalarType m_OutsideValue;
//##Description
//## @brief If \a true the minimum of the ouput pixel type is
//## used as outside value (default: \a false)
bool m_AutoOutsideValue;
//##Description
//## @brief Use m_InsideValue for inside pixels (default: \a false)
//##
//## If @a true, pixels that are inside m_BoundingObject
//## will get m_InsideValue in the cutting process
//## If @a false, they keep their original value.
//## \sa m_InsideValue
bool m_UseInsideValue;
unsigned int m_OutsidePixelCount;
unsigned int m_InsidePixelCount;
//##Description
//## @brief Region of input needed for cutting
mitk::SlicedData::RegionType m_InputRequestedRegion;
//##Description
//## @brief Time when Header was last initialized
itk::TimeStamp m_TimeOfHeaderInitialization;
mitk::ImageTimeSelector::Pointer m_InputTimeSelector;
mitk::ImageTimeSelector::Pointer m_OutputTimeSelector;
bool m_UseWholeInputRegion;
};
} // namespace mitk
#endif /* BOUNDINGOBJECTCUTTER_H_HEADER_INCLUDED_C10B22CD */
diff --git a/Modules/AlgorithmsExt/include/mitkBoundingObjectToSegmentationFilter.h b/Modules/AlgorithmsExt/include/mitkBoundingObjectToSegmentationFilter.h
index d7f917a5fe..8e4b6ae65c 100644
--- a/Modules/AlgorithmsExt/include/mitkBoundingObjectToSegmentationFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkBoundingObjectToSegmentationFilter.h
@@ -1,40 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKBOUNDINGOBJECTTOSEGMENTATIONFILTER_H
#define MITKBOUNDINGOBJECTTOSEGMENTATIONFILTER_H
#include <mitkBoundingObjectGroup.h>
#include <mitkImageToImageFilter.h>
#include <MitkAlgorithmsExtExports.h>
namespace mitk
{
class MITKALGORITHMSEXT_EXPORT BoundingObjectToSegmentationFilter : public ImageToImageFilter
{
public:
mitkClassMacro(BoundingObjectToSegmentationFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void SetBoundingObject(mitk::BoundingObject::Pointer boundingObject);
protected:
BoundingObjectToSegmentationFilter();
~BoundingObjectToSegmentationFilter() override;
void GenerateData() override;
mitk::BoundingObjectGroup::Pointer m_boundingObjectGroup;
}; // class
} // namespace
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkCovarianceMatrixCalculator.h b/Modules/AlgorithmsExt/include/mitkCovarianceMatrixCalculator.h
index 92856ab4b6..f169c576e2 100644
--- a/Modules/AlgorithmsExt/include/mitkCovarianceMatrixCalculator.h
+++ b/Modules/AlgorithmsExt/include/mitkCovarianceMatrixCalculator.h
@@ -1,116 +1,118 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __MITK_COVARIANCEMATRIXCALCULATOR_H__
#define __MITK_COVARIANCEMATRIXCALCULATOR_H__
// exports
#include "MitkAlgorithmsExtExports.h"
#include <mitkCommon.h>
#include <itkMatrix.h>
#include <itkObjectFactory.h>
#include <vector>
namespace mitk
{
// forward declarations
class Surface;
struct CovarianceMatrixCalculatorData;
/**
* \ingroup AnisotropicRegistration
*
* @brief Class that computes the covariance matrices for every point in a
* {@link Surface} used in the A-ICP algorithm.
*
* Computes a covariance matrix for every vertex in a given {@link Surface}
* based on it's direct neighbours and saves them into a CovarianceMatrixList.
* The Class implements the CM_PCA method presented by
* L. Maier-Hein et al. in "Convergent Iterative Closest-Point Algorithm
* to Accomodate Anisotropic and Inhomogenous Localization Error.",
* IEEE T Pattern Anal 34 (8), 1520-1532, 2012. The algorithm needs
* a clean Surface with non manifold edges and no duplicated vertices. To
* ensure a clean Surface representation use vtkCleanPolyData.
*/
class MITKALGORITHMSEXT_EXPORT CovarianceMatrixCalculator : public itk::Object
{
private:
/** Pimpl to hold private data.*/
CovarianceMatrixCalculatorData *d;
protected:
// local typedefs
/** Definition of the covariance matrix.*/
typedef itk::Matrix<double, 3, 3> CovarianceMatrix;
/** Definition of a list of covariance matrices */
typedef std::vector<CovarianceMatrix> CovarianceMatrixList;
typedef double Vertex[3];
/** List that stores the computed covariance matrices. */
CovarianceMatrixList m_CovarianceMatrixList;
/** This method projects all surrounding vertices of given vertex in a Surface
* in the normal direction onto a plane and computes a primary component
* analysis on the projected vertices. In the next step a orthonormal
* system is created.
*
* @param The index of the input Vertex in the Surface.
* @param The normal of the input Vertex.
* @param Output CovarianceMatrix of the principal component analysis.
* @param Output. Variances along the axes of the createt Orthonormal system.
* @param Output. The current Vertex in the surface
*
*/
void ComputeOrthonormalCoordinateSystem(
const int index, Vertex normal, CovarianceMatrix &principalComponents, Vertex variances, Vertex curVertex);
CovarianceMatrixCalculator();
~CovarianceMatrixCalculator() override;
public:
- mitkClassMacroItkParent(CovarianceMatrixCalculator, itk::Object) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacroItkParent(CovarianceMatrixCalculator, itk::Object);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
- /** Sets the scaling factor for the voronoi area.
- * @param factor The scaling factor.
- */
- void SetVoronoiScalingFator(const double factor);
+ /** Sets the scaling factor for the voronoi area.
+ * @param factor The scaling factor.
+ */
+ void SetVoronoiScalingFator(const double factor);
/** Enables/disables the covariance matrix normalization.
* @param state Enables the covariance matrix normalization.
*/
void EnableNormalization(bool state);
/** Returns the mean of variance of all computed covariance matrices.
* @return The mean variance.
*/
double GetMeanVariance() const;
/** Returns a reference to the CovarianceMatrixList with the computed covariance matrices.
* @return A CovarianceMatrixList.
*/
const CovarianceMatrixList &GetCovarianceMatrices() const;
/** Sets the input {@link Surface} for which the covariance matrices will be calculated.
* @param input A {@link Surface}.
*/
void SetInputSurface(Surface *input);
/** Method that computes the covariance matrices for the input surface.
* @throws std::exception If the input surface is not set.
*/
void ComputeCovarianceMatrices();
};
}
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkCropTimestepsImageFilter.h b/Modules/AlgorithmsExt/include/mitkCropTimestepsImageFilter.h
index d7bd4f4423..6390dfb533 100644
--- a/Modules/AlgorithmsExt/include/mitkCropTimestepsImageFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkCropTimestepsImageFilter.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkCropTimestepsImageFilter_h
#define mitkCropTimestepsImageFilter_h
#include "MitkAlgorithmsExtExports.h"
#include <mitkSubImageSelector.h>
namespace mitk
{
/** \brief Crops timesteps at 2D+t and 3D+t images
* \details The filter is able to crop timesteps in front and/or at the end.
* Internally, a new image is created with the remaining volumes. The geometries and properties of
* the input image are transferred to the output image.
*/
class MITKALGORITHMSEXT_EXPORT CropTimestepsImageFilter : public SubImageSelector
{
public:
- mitkClassMacro(CropTimestepsImageFilter, SubImageSelector)
- itkFactorylessNewMacro(Self)
+ mitkClassMacro(CropTimestepsImageFilter, SubImageSelector);
+ itkFactorylessNewMacro(Self);
/*!
* \brief Sets the input image
* \pre the image has 4 Dimensions
* \pre the image has >1 timestep
* \pre the image is valid (valid geometry and volume)
*/
void SetInput(const InputImageType* image) override;
void SetInput(unsigned int index, const InputImageType* image) override;
/*!
* \brief The last timestep to retain
* \details Set to the maximum timestep of the input as default
* \note if the last timestep is larger than the maximum timestep of the input,
* it is corrected to the maximum timestep.
* \exception if (LowerBoundaryTimestep > UpperBoundaryTimestep)
*/
itkSetMacro(UpperBoundaryTimestep, unsigned int);
itkGetConstMacro(UpperBoundaryTimestep, unsigned int);
/*!
* \brief The first timestep to retain
* \details Set to 0 as default
* \exception if (LowerBoundaryTimestep > UpperBoundaryTimestep)
*/
itkSetMacro(LowerBoundaryTimestep, unsigned int);
itkGetConstMacro(LowerBoundaryTimestep, unsigned int);
private:
using Superclass::SetInput;
CropTimestepsImageFilter() = default;
~CropTimestepsImageFilter() override = default;
void GenerateData() override;
void VerifyInputInformation() override;
void VerifyInputImage(const mitk::Image* inputImage) const;
void GenerateOutputInformation() override;
mitk::SlicedData::RegionType ComputeDesiredRegion() const;
mitk::TimeGeometry::Pointer AdaptTimeGeometry(mitk::TimeGeometry::ConstPointer sourceGeometry, unsigned int startTimestep, unsigned int endTimestep) const;
unsigned int m_UpperBoundaryTimestep = std::numeric_limits<unsigned int>::max();
unsigned int m_LowerBoundaryTimestep = 0;
mitk::SlicedData::RegionType m_DesiredRegion;
};
}
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkGeometryClipImageFilter.h b/Modules/AlgorithmsExt/include/mitkGeometryClipImageFilter.h
index 43c9ecc227..077ba6ba26 100644
--- a/Modules/AlgorithmsExt/include/mitkGeometryClipImageFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkGeometryClipImageFilter.h
@@ -1,180 +1,182 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKGEOMETRYCLIPIMAGEFILTER_H_HEADER_INCLUDED_C1F48A22
#define MITKGEOMETRYCLIPIMAGEFILTER_H_HEADER_INCLUDED_C1F48A22
#include "MitkAlgorithmsExtExports.h"
#include "mitkCommon.h"
#include "mitkGeometryData.h"
#include "mitkImageTimeSelector.h"
#include "mitkImageToImageFilter.h"
namespace itk
{
template <class TPixel, unsigned int VImageDimension>
class ITK_EXPORT Image;
}
namespace mitk
{
//##Documentation
//## @brief Filter for clipping an image with a PlaneGeometry
//##
//## The given geometry for clipping can be either a PlaneGeometry
//## or a TimeGeometry containing multiple instances
//## of PlaneGeometry
//##
//## \todo add AutoOrientLabels, which makes the "left" side (minimum X value) side of the image get one defined
//label.
//## left-most because vtkPolyDataNormals uses the same definition and this filter is used for visualization of
//## front/back side of curved planes
//##
//## @ingroup Process
class MITKALGORITHMSEXT_EXPORT GeometryClipImageFilter : public ImageToImageFilter
{
public:
mitkClassMacro(GeometryClipImageFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/**
* Set the geometry to be used for clipping
*
* The given geometry for clipping must be a PlaneGeometry.
*/
void SetClippingGeometry(const mitk::BaseGeometry *aClippingGeometry);
/**
* Set the geometry to be used for clipping
*
* The given geometry for clipping must a
* TimeGeometry containing multiple instances
* of PlaneGeometry
*/
void SetClippingGeometry(const mitk::TimeGeometry *aClippingGeometry);
const mitk::BaseGeometry *GetClippingGeometry() const;
const mitk::TimeGeometry *GetClippingTimeGeometry() const;
//##Description
//## @brief Get whether the part above or below the geometry
//## shall be clipped (default: @a true)
itkGetConstMacro(ClipPartAboveGeometry, bool);
//## @brief Set whether the part above or below the geometry
//## shall be clipped (default: @a true)
itkSetMacro(ClipPartAboveGeometry, bool);
//## @brief Set whether the part above or below the geometry
//## shall be clipped (default: @a true)
itkBooleanMacro(ClipPartAboveGeometry);
//##Description
//## @brief Set value for outside pixels (default: 0),
//## used when m_AutoOutsideValue is \a false
itkSetMacro(OutsideValue, ScalarType);
itkGetConstMacro(OutsideValue, ScalarType);
//##Description
//## @brief If set to \a true the minimum of the ouput pixel type is
//## used as outside value (default: \a false)
itkSetMacro(AutoOutsideValue, bool);
itkGetConstMacro(AutoOutsideValue, bool);
itkBooleanMacro(AutoOutsideValue);
itkSetMacro(AutoOrientLabels, bool);
itkGetConstMacro(AutoOrientLabels, bool);
//##Description
//## @brief If set to \a true both sides of the clipping
//## geometry will be labeld using m_AboveGeometryLabel and
//## m_BelowGeometryLabel
itkSetMacro(LabelBothSides, bool);
itkGetConstMacro(LabelBothSides, bool);
itkBooleanMacro(LabelBothSides);
//##Description
//## @brief Set for voxels above the clipping geometry.
//## This value is only used, if m_LabelBothSides is set to true.
itkSetMacro(AboveGeometryLabel, ScalarType);
itkGetConstMacro(AboveGeometryLabel, ScalarType);
//##Description
//## @brief Set for voxels below the clipping geometry.
//## This value is only used, if m_LabelBothSides is set to true.
itkSetMacro(BelowGeometryLabel, ScalarType);
itkGetConstMacro(BelowGeometryLabel, ScalarType);
protected:
GeometryClipImageFilter();
~GeometryClipImageFilter() override;
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
template <typename TPixel, unsigned int VImageDimension>
friend void _InternalComputeClippedImage(itk::Image<TPixel, VImageDimension> *itkImage,
mitk::GeometryClipImageFilter *geometryClipper,
const mitk::PlaneGeometry *clippingPlaneGeometry);
mitk::BaseGeometry::ConstPointer m_ClippingGeometry;
mitk::GeometryData::Pointer m_ClippingGeometryData;
mitk::TimeGeometry::ConstPointer m_TimeClippingGeometry;
mitk::ImageTimeSelector::Pointer m_InputTimeSelector;
mitk::ImageTimeSelector::Pointer m_OutputTimeSelector;
//##Description
//## @brief Defines whether the part above or below the geometry
//## shall be clipped (default: @a true)
bool m_ClipPartAboveGeometry;
//##Description
//## @brief Value for outside pixels (default: 0)
//##
//## Used only if m_AutoOutsideValue is \a false.
ScalarType m_OutsideValue;
//##Description
//## @brief If \a true the minimum of the ouput pixel type is
//## used as outside value (default: \a false)
bool m_AutoOutsideValue;
//##Description
//## @brief If \a true all pixels above and below the geometry
//## are labeled with m_AboveGeometryLabel and m_BelowGeometryLabel
bool m_LabelBothSides;
/**
* \brief Orient above like vtkPolyDataNormals does with AutoOrientNormals
*/
bool m_AutoOrientLabels;
//##Description
//## @brief Is used for labeling all pixels above the geometry
//## when m_LabelBothSides is on
ScalarType m_AboveGeometryLabel;
//##Description
//## @brief Is used for labeling all pixels below the geometry
//## when m_LabelBothSides is on
ScalarType m_BelowGeometryLabel;
//##Description
//## @brief Time when Header was last initialized
itk::TimeStamp m_TimeOfHeaderInitialization;
};
} // namespace mitk
#endif /* MITKGEOMETRYCLIPIMAGEFILTER_H_HEADER_INCLUDED_C1F48A22 */
diff --git a/Modules/AlgorithmsExt/include/mitkGeometryDataSource.h b/Modules/AlgorithmsExt/include/mitkGeometryDataSource.h
index abb36d621c..998763c461 100644
--- a/Modules/AlgorithmsExt/include/mitkGeometryDataSource.h
+++ b/Modules/AlgorithmsExt/include/mitkGeometryDataSource.h
@@ -1,67 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKGEOMETRYDATASOURCE_H_HEADER_INCLUDED_C10B4740
#define MITKGEOMETRYDATASOURCE_H_HEADER_INCLUDED_C10B4740
#include "MitkAlgorithmsExtExports.h"
#include "mitkBaseDataSource.h"
namespace mitk
{
class GeometryData;
/**
* @brief Superclass of all classes generating GeometryData (instances of class
* GeometryData) as output.
*
* In itk and vtk the generated result of a ProcessObject is only guaranteed
* to be up-to-date, when Update() of the ProcessObject or the generated
* DataObject is called immediately before access of the data stored in the
* DataObject. This is also true for subclasses of mitk::BaseProcess and thus
* for mitk::GeometryDataSource.
* @ingroup Process
*/
class MITKALGORITHMSEXT_EXPORT GeometryDataSource : public BaseDataSource
{
public:
- mitkClassMacro(GeometryDataSource, BaseDataSource) itkNewMacro(Self)
+ mitkClassMacro(GeometryDataSource, BaseDataSource);
+ itkNewMacro(Self);
typedef mitk::GeometryData OutputType;
mitkBaseDataSourceGetOutputDeclarations
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer
MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
protected:
GeometryDataSource();
~GeometryDataSource() override;
};
} // namespace mitk
#endif /* MITKGEOMETRYDATASOURCE_H_HEADER_INCLUDED_C10B4740 */
diff --git a/Modules/AlgorithmsExt/include/mitkHeightFieldSurfaceClipImageFilter.h b/Modules/AlgorithmsExt/include/mitkHeightFieldSurfaceClipImageFilter.h
index edf48162fc..794d86185f 100644
--- a/Modules/AlgorithmsExt/include/mitkHeightFieldSurfaceClipImageFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkHeightFieldSurfaceClipImageFilter.h
@@ -1,147 +1,149 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKHEIGHTFIELDSURFACECLIPIMAGEFILTER_H_HEADER_INCLUDED
#define MITKHEIGHTFIELDSURFACECLIPIMAGEFILTER_H_HEADER_INCLUDED
#include "MitkAlgorithmsExtExports.h"
#include "mitkCommon.h"
#include "mitkGeometry3D.h"
#include "mitkImageTimeSelector.h"
#include "mitkImageToImageFilter.h"
#include "mitkSurface.h"
namespace itk
{
template <class TPixel, unsigned int VImageDimension>
class ITK_EXPORT Image;
}
namespace mitk
{
/**
* \brief Filter for clipping an image with an height-field represented by
* an mitk::Surface.
*
* The filter assumes that the surface represents a height field as seen from
* the plane defined by (1.0/0.0/0.0), (0.0/1.0/0.0). All voxels lying on one
* side of the height field will be clipped, i.e., set to 0. In addition, any
* voxels which are out of bounds when projected on this plane will be clipped
* as well.
*
* \ingroup Process
*/
class MITKALGORITHMSEXT_EXPORT HeightFieldSurfaceClipImageFilter : public ImageToImageFilter
{
public:
typedef std::vector<mitk::Surface *> ClippingPlaneList;
mitkClassMacro(HeightFieldSurfaceClipImageFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/** \brief Set/Get the surface defining a height field as a triangle mesh */
void SetClippingSurface(Surface *clippingSurface);
/** \brief Set/Get the surfaces defining a height field as a triangle mesh */
void SetClippingSurfaces(ClippingPlaneList planeList);
/** \brief Set/Get the surface defining a height field as a triangle mesh */
const Surface *GetClippingSurface() const;
enum
{
CLIPPING_MODE_CONSTANT = 0,
CLIPPING_MODE_MULTIPLYBYFACTOR,
CLIPPING_MODE_MULTIPLANE
};
/** \brief Specifies whether clipped part of the image shall be replaced
* by a constant or multiplied by a user-set factor */
void SetClippingMode(int mode);
/** \brief Specifies whether clipped part of the image shall be replaced
* by a constant or multiplied by a user-set factor */
int GetClippingMode();
/** \brief Specifies whether clipped part of the image shall be replaced
* by a constant or multiplied by a user-set factor */
void SetClippingModeToConstant();
/** \brief Specifies whether clipped part of the image shall be replaced
* by a constant or multiplied by a user-set factor */
void SetClippingModeToMultiplyByFactor();
void SetClippingModeToMultiPlaneValue();
/** \brief Set/Get constant gray-value for clipping in CONSTANT mode */
itkSetMacro(ClippingConstant, ScalarType);
/** \brief Set/Get constant gray-value for clipping in CONSTANT mode */
itkGetConstMacro(ClippingConstant, ScalarType);
/** \brief Set/Get multiplaction factor for clipping in MULTIPLYBYFACTOR mode */
itkSetMacro(MultiplicationFactor, ScalarType);
/** \brief Set/Get multiplaction factor for clipping in MULTIPLYBYFACTOR mode */
itkGetConstMacro(MultiplicationFactor, ScalarType);
/** \brief Set/Get x-resolution of height-field sampling (default: 256). */
itkSetMacro(HeightFieldResolutionX, unsigned int);
/** \brief Set/Get x-resolution of height-field sampling (default: 256). */
itkGetConstMacro(HeightFieldResolutionX, unsigned int);
/** \brief Set/Get y-resolution of height-field sampling (default: 256). */
itkSetMacro(HeightFieldResolutionY, unsigned int);
/** \brief Set/Get y-resolution of height-field sampling (default: 256). */
itkGetConstMacro(HeightFieldResolutionY, unsigned int);
protected:
HeightFieldSurfaceClipImageFilter();
~HeightFieldSurfaceClipImageFilter() override;
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
template <typename TPixel, unsigned int VImageDimension>
void _InternalComputeClippedImage(itk::Image<TPixel, VImageDimension> *itkImage,
HeightFieldSurfaceClipImageFilter *clipImageFilter,
vtkPolyData *clippingPolyData,
AffineTransform3D *imageToPlaneTransform);
ImageTimeSelector::Pointer m_InputTimeSelector;
ImageTimeSelector::Pointer m_OutputTimeSelector;
int m_ClippingMode;
ScalarType m_ClippingConstant;
ScalarType m_MultiplicationFactor;
unsigned m_MultiPlaneValue;
unsigned int m_HeightFieldResolutionX;
unsigned int m_HeightFieldResolutionY;
double m_MaxHeight;
/** \brief Time when Header was last initialized */
itk::TimeStamp m_TimeOfHeaderInitialization;
};
} // namespace mitk
#endif /* MITKHEIGHTFIELDSURFACECLIPIMAGEFILTER_H_HEADER_INCLUDED */
diff --git a/Modules/AlgorithmsExt/include/mitkImageToUnstructuredGridFilter.h b/Modules/AlgorithmsExt/include/mitkImageToUnstructuredGridFilter.h
index 97b2342d62..b1bc92ae77 100644
--- a/Modules/AlgorithmsExt/include/mitkImageToUnstructuredGridFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkImageToUnstructuredGridFilter.h
@@ -1,99 +1,100 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITKIMAGETOUNSTRUCTUREDGRIDFILTER_h__
#define _MITKIMAGETOUNSTRUCTUREDGRIDFILTER_h__
#include <MitkAlgorithmsExtExports.h>
#include <mitkCommon.h>
#include <mitkImage.h>
#include <mitkUnstructuredGrid.h>
#include <mitkUnstructuredGridSource.h>
namespace mitk
{
/**
* @brief Converts an Image into an UnstructuredGrid represented by Points.
* The filter uses a Threshold to extract every pixel, with value higher than
* the threshold, as point.
* If no threshold is set, every pixel is extracted as a point.
*/
class MITKALGORITHMSEXT_EXPORT ImageToUnstructuredGridFilter : public UnstructuredGridSource
{
public:
- mitkClassMacro(ImageToUnstructuredGridFilter, UnstructuredGridSource) itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(ImageToUnstructuredGridFilter, UnstructuredGridSource);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** This method is called by Update(). */
void GenerateData() override;
/** Initializes the output information */
void GenerateOutputInformation() override;
/** Returns a const reference to the input image */
const mitk::Image *GetInput(void) const;
mitk::Image *GetInput(void);
/** Set the source image. As input every mitk 3D image can be used. */
using itk::ProcessObject::SetInput;
virtual void SetInput(const mitk::Image *image);
/**
* Set the threshold for extracting points. Every pixel, which value
* is higher than this value, will be a point.
*/
void SetThreshold(double threshold);
/** Returns the threshold */
double GetThreshold();
/** Returns the number of extracted points after edge detection */
- itkGetMacro(NumberOfExtractedPoints, int)
+ itkGetMacro(NumberOfExtractedPoints, int);
protected :
/** Constructor */
ImageToUnstructuredGridFilter();
/** Destructor */
~ImageToUnstructuredGridFilter() override;
/**
* Access method for extracting the points from the input image
*/
template <typename TPixel, unsigned int VImageDimension>
void ExtractPoints(const itk::Image<TPixel, VImageDimension> *image);
/** The number of points extracted by the filter */
int m_NumberOfExtractedPoints;
private:
/**
* Geometry of the input image, needed to tranform the image points
* into world points
*/
mitk::BaseGeometry *m_Geometry;
/** Threshold for extracting the points */
double m_Threshold;
/** The output of the filter, which contains the extracted points */
mitk::UnstructuredGrid::Pointer m_UnstructGrid;
};
} // namespace mitk
#endif //_MITKIMAGETOUNSTRUCTUREDGRIDFILTER_h__
diff --git a/Modules/AlgorithmsExt/include/mitkLabeledImageToSurfaceFilter.h b/Modules/AlgorithmsExt/include/mitkLabeledImageToSurfaceFilter.h
index 26d4385f40..7de8540968 100644
--- a/Modules/AlgorithmsExt/include/mitkLabeledImageToSurfaceFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkLabeledImageToSurfaceFilter.h
@@ -1,159 +1,161 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _mitk_labeled_image_to_surface_filter__h_
#define _mitk_labeled_image_to_surface_filter__h_
#include "MitkAlgorithmsExtExports.h"
#include <map>
#include <mitkImageToSurfaceFilter.h>
#include <vtkImageData.h>
namespace mitk
{
/**
* Calculates surfaces for labeled images.
* If you have a labeled image containing 5 different labeled regions
* plus the background, this class creates 5 surface representations
* from the regions. Each surface is assigned to one output of the
* filter. You can figure out, which label corresponds to which
* output using the GetLabelForNthOutput() method.
* If you want to calculate a surface representation only for one
* specific label, you may call GenerateAllLabelsOff() and set the
* desired label by SetLabel(label).
*/
class MITKALGORITHMSEXT_EXPORT LabeledImageToSurfaceFilter : public ImageToSurfaceFilter
{
public:
mitkClassMacro(LabeledImageToSurfaceFilter, ImageToSurfaceFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
typedef int LabelType;
typedef std::map<LabelType, unsigned long> LabelMapType;
typedef std::map<unsigned int, LabelType> IdxToLabelMapType;
/**
* Set whether you want to extract all (true) or only
* a specific label (false)
* @param _arg true by default
*/
itkSetMacro(GenerateAllLabels, bool);
/**
* @returns if all labels or only a specific label should be
* extracted.
*/
itkGetMacro(GenerateAllLabels, bool);
itkBooleanMacro(GenerateAllLabels);
/**
* Set the label you want to extract. This method only has an effect,
* if GenerateAllLabels() is set to false
* @param _arg the label to extract, by default 1
*/
itkSetMacro(Label, LabelType);
/**
* Returns the label you want to extract. This method only has an effect,
* if GenerateAllLabels() is set to false
* @returns _arg the label to extract, by default 1
*/
itkGetMacro(Label, LabelType);
/**
* Set the label of the background. No surface will be generated for this label!
* @param _arg the label of the background, by default 0
*/
itkSetMacro(BackgroundLabel, LabelType);
/**
* Returns the label of the background. No surface will be generated for this label!
* @returns the label of the background, by default 0
*/
itkGetMacro(BackgroundLabel, LabelType);
/**
* Set standard deviation for Gaussian Filter.
* @param _arg by default 1.5
*/
itkSetMacro(GaussianStandardDeviation, double);
/**
* Returns the standard deviation of the Gaussian filter which will be
* used when filter is enabled.
*/
itkGetMacro(GaussianStandardDeviation, double);
/**
* Lets you retrieve the label which was used for generating the Nth output of this filter.
* If GenerateAllLabels() is set to false, this filter only knows about the label provided
* via SetLabel(). All other labels in the image are not known.
* @param i the index of the Nth output.
* @returns the label used for calculating the Nth output of the filter. If i is out of
* range, itk::NumericLimits<LabelType>::max() is returned.
*/
LabelType GetLabelForNthOutput(const unsigned int &i);
/**
* Lets you retrieve the volume in milliliters of the region used to generate the Nth output.
* @param i the index of the Nth output.
* @returns the volume of the region used to generate the Nth output of the filter. If
* i is out of range, 0.0 is returned.
*/
mitk::ScalarType GetVolumeForNthOutput(const unsigned int &i);
/**
* Lets you retrieve the volume in milliliters of the region with the given label. If
* GenerateAllLabels is set to false, you may only call this method for the label provided
* using the SetLabel() method.
* @param label the label of the region you want to get the volume of
* @returns the volume of the region with the given label. If
* label is invalid, 0.0 is returned.
*/
mitk::ScalarType GetVolumeForLabel(const LabelType &label);
protected:
double m_GaussianStandardDeviation;
bool m_GenerateAllLabels;
LabelType m_Label;
LabelType m_BackgroundLabel;
LabelMapType m_AvailableLabels;
IdxToLabelMapType m_IdxToLabels;
void GenerateData() override;
void GenerateOutputInformation() override;
virtual void CreateSurface(int time, vtkImageData *vtkimage, mitk::Surface *surface, LabelType label);
virtual LabelMapType GetAvailableLabels();
LabeledImageToSurfaceFilter();
~LabeledImageToSurfaceFilter() override;
private:
virtual void CreateSurface(int time, vtkImageData *vtkimage, mitk::Surface *surface, const ScalarType threshold);
};
} // end of namespace mitk
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkMaskAndCutRoiImageFilter.h b/Modules/AlgorithmsExt/include/mitkMaskAndCutRoiImageFilter.h
index a510e16ba9..a008e0385d 100644
--- a/Modules/AlgorithmsExt/include/mitkMaskAndCutRoiImageFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkMaskAndCutRoiImageFilter.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKMASKANDCUTROIIMAGEFILTER_H
#define MITKMASKANDCUTROIIMAGEFILTER_H
#include "MitkAlgorithmsExtExports.h"
#include "mitkImageToImageFilter.h"
#include "itkRegionOfInterestImageFilter.h"
#include "mitkAutoCropImageFilter.h"
#include "mitkBoundingObject.h"
#include "mitkDataNode.h"
#include "mitkMaskImageFilter.h"
namespace mitk
{
/**
\brief Cuts a region of interest (ROI) out of an image
In the first step, this filter reduces the image region of the given ROI to a minimum. Using this region, a subvolume
ist cut out of the given input image.
The ROI is then used to mask the subvolume. Pixel inside the ROI will have their original value, pixel outside will be
replaced by m_OutsideValue
*/
class MITKALGORITHMSEXT_EXPORT MaskAndCutRoiImageFilter : public ImageToImageFilter
{
typedef itk::Image<short, 3> ItkImageType;
typedef itk::Image<unsigned char, 3> ItkMaskType;
typedef itk::ImageRegion<3> RegionType;
typedef itk::RegionOfInterestImageFilter<ItkImageType, ItkImageType> ROIFilterType;
public:
mitkClassMacro(MaskAndCutRoiImageFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkGetMacro(MaxValue, mitk::ScalarType);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkGetMacro(MaxValue, mitk::ScalarType);
itkGetMacro(MinValue, mitk::ScalarType);
void SetRegionOfInterest(mitk::BaseData *roi);
// void SetRegionOfInterest(Image::Pointer image);
// void SetRegionOfInterest(BoundingObject::Pointer boundingObject);
// void SetRegionOfInterestByNode(mitk::DataNode::Pointer node);
// temporary fix for bug #
mitk::Image::Pointer GetOutput();
protected:
MaskAndCutRoiImageFilter();
~MaskAndCutRoiImageFilter() override;
void GenerateData() override;
ROIFilterType::Pointer m_RoiFilter;
mitk::AutoCropImageFilter::Pointer m_CropFilter;
mitk::MaskImageFilter::Pointer m_MaskFilter;
// needed for temporary fix
mitk::Image::Pointer m_outputImage;
mitk::ScalarType m_MaxValue;
mitk::ScalarType m_MinValue;
}; // class
} // namespace
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkMaskImageFilter.h b/Modules/AlgorithmsExt/include/mitkMaskImageFilter.h
index 61b046a75a..7f64f80b7a 100644
--- a/Modules/AlgorithmsExt/include/mitkMaskImageFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkMaskImageFilter.h
@@ -1,109 +1,111 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKMASKIMAGEFILTER_H_HEADER_INCLUDED_C1F48A22
#define MITKMASKIMAGEFILTER_H_HEADER_INCLUDED_C1F48A22
#include "MitkAlgorithmsExtExports.h"
#include "mitkCommon.h"
#include "mitkImageTimeSelector.h"
#include "mitkImageToImageFilter.h"
#include "itkImage.h"
namespace mitk
{
//##Documentation
//## @brief
//## @ingroup Process
class MITKALGORITHMSEXT_EXPORT MaskImageFilter : public ImageToImageFilter
{
public:
mitkClassMacro(MaskImageFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
void SetMask(const mitk::Image *mask);
const mitk::Image *GetMask() const;
/**
* get/set the min Value of the original image in the masked area
**/
itkGetMacro(MinValue, mitk::ScalarType);
itkSetMacro(MinValue, mitk::ScalarType);
/**
* get/set the max Value of the original image in the masked area
**/
itkGetMacro(MaxValue, mitk::ScalarType);
itkSetMacro(MaxValue, mitk::ScalarType);
/**
* This value is used as outside value. This only works
* if OverrideOutsideValue is set to true. Default is 0.
**/
itkSetMacro(OutsideValue, mitk::ScalarType);
/**
* This value is used as outside value. This only works
* if OverrideOutsideValue is set to true. Default is 0.
*/
itkGetMacro(OutsideValue, mitk::ScalarType);
/**
* If OverrideOutsideValue is set to false, this minimum
* of the pixel type of the output image is taken as outside
* value. If set to true, the value set via SetOutsideValue is
* used as background.
*/
itkSetMacro(OverrideOutsideValue, bool);
/**
* If OverrideOutsideValue is set to false, this minimum
* of the pixel type of the output image is taken as outside
* value. If set to true, the value set via SetOutsideValue is
* used as background.
*/
itkGetMacro(OverrideOutsideValue, bool);
itkBooleanMacro(OverrideOutsideValue);
protected:
MaskImageFilter();
~MaskImageFilter() override;
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
template <typename TPixel, unsigned int VImageDimension>
void InternalComputeMask(itk::Image<TPixel, VImageDimension> *itkImage);
mitk::Image::Pointer m_Mask;
mitk::ImageTimeSelector::Pointer m_InputTimeSelector;
mitk::ImageTimeSelector::Pointer m_MaskTimeSelector;
mitk::ImageTimeSelector::Pointer m_OutputTimeSelector;
//##Description
//## @brief Time when Header was last initialized
itk::TimeStamp m_TimeOfHeaderInitialization;
mitk::ScalarType m_OutsideValue;
mitk::ScalarType m_MinValue;
mitk::ScalarType m_MaxValue;
bool m_OverrideOutsideValue;
};
} // namespace mitk
#endif /* MITKMASKIMAGEFILTER_H_HEADER_INCLUDED_C1F48A22 */
diff --git a/Modules/AlgorithmsExt/include/mitkMovieGeneratorWin32.h b/Modules/AlgorithmsExt/include/mitkMovieGeneratorWin32.h
index fe00eb848f..5537e2f6e4 100755
--- a/Modules/AlgorithmsExt/include/mitkMovieGeneratorWin32.h
+++ b/Modules/AlgorithmsExt/include/mitkMovieGeneratorWin32.h
@@ -1,77 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MovieGeneratorWin32WIN32_H_HEADER_INCLUDED
#define MovieGeneratorWin32WIN32_H_HEADER_INCLUDED
#include "MitkAlgorithmsExtExports.h"
#include "mitkMovieGenerator.h"
#include <comdef.h>
#include <memory.h>
#include <string.h>
#include <tchar.h>
#include <vfw.h>
#pragma message(" _Adding library: vfw32.lib")
#pragma comment(lib, "vfw32.lib")
namespace mitk
{
class MITKALGORITHMSEXT_EXPORT MovieGeneratorWin32 : public MovieGenerator
{
public:
mitkClassMacro(MovieGeneratorWin32, MovieGenerator);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
virtual void SetFileName(const char *fileName);
protected:
MovieGeneratorWin32();
//! reads out size of current OpenGL context and stores it
void InitBitmapHeader();
//! called directly before the first frame is added
virtual bool InitGenerator();
//! used to add a frame
virtual bool AddFrame(void *data);
//! called after the last frame is added
virtual bool TerminateGenerator();
//! name of output file
_bstr_t m_sFile;
//! structure contains information for a single stream
BITMAPINFOHEADER m_bih;
//! last error string
_bstr_t m_sError;
private:
//! frame counter
long m_lFrame;
//! file interface pointer
PAVIFILE m_pAVIFile;
//! Address of the stream interface
PAVISTREAM m_pStream;
//! Address of the compressed video stream
PAVISTREAM m_pStreamCompressed;
};
} // namespace mitk
#endif /* MovieGeneratorWin32WIN32_H_HEADER_INCLUDED */
diff --git a/Modules/AlgorithmsExt/include/mitkNonBlockingAlgorithm.h b/Modules/AlgorithmsExt/include/mitkNonBlockingAlgorithm.h
index c280fa5ec2..9ea599e365 100644
--- a/Modules/AlgorithmsExt/include/mitkNonBlockingAlgorithm.h
+++ b/Modules/AlgorithmsExt/include/mitkNonBlockingAlgorithm.h
@@ -1,251 +1,251 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_NON_BLOCKING_ALGORITHM_H_INCLUDED_DFARdfWN1tr
#define MITK_NON_BLOCKING_ALGORITHM_H_INCLUDED_DFARdfWN1tr
#include "MitkAlgorithmsExtExports.h"
#include <itkFastMutexLock.h>
#include <itkImage.h>
#include <itkMacro.h>
#include <itkMultiThreader.h>
#include <itkObjectFactory.h>
#include "mitkCommon.h"
#include "mitkDataStorage.h"
#include "mitkProperties.h"
#include "mitkPropertyList.h"
#include "mitkSmartPointerProperty.h"
#include "mitkWeakPointer.h"
#include "mitkImage.h"
#include "mitkSurface.h"
#include <stdexcept>
#include <string>
/// from itkNewMacro(), additionally calls Initialize(), because this couldn't be done from the constructor of
/// NonBlockingAlgorithm
/// (you can't call virtual functions from the constructor of the superclass)
#define mitkAlgorithmNewMacro(classname) \
\
static Pointer \
New(void) \
{ \
classname *rawPtr = new classname(); \
Pointer smartPtr = rawPtr; \
rawPtr->UnRegister(); \
rawPtr->Initialize(); \
return smartPtr; \
\
} \
\
virtual::itk::LightObject::Pointer \
CreateAnother(void) const override \
\
{ \
Pointer smartPtr = classname::New(); \
::itk::LightObject::Pointer lightPtr = smartPtr.GetPointer(); \
smartPtr->Initialize(this); \
return lightPtr; \
\
}
namespace mitk
{
/*!
Invokes ResultsAvailable with each new result
<b>done</b> centralize use of itk::MultiThreader in this class
@todo do the property-handling in this class
@todo process "incoming" events in this class
@todo sollen segmentierungs-dinger von mitk::ImageSource erben? Ivo fragen, wie das mit AllocateOutputs, etc.
gehen soll
eine ImageSourceAlgorithm koennte dann die noetigen Methoden wie GenerateData(), GetOutput() ueberschreiben,
so
dass von dort aus die Methoden von NonBlockingAlgorithm aufgerufen werden.
Erben v.a. um die Output-Sachen zu uebernehmen, die Anpassungen das einfuehren einer Zwischenklasse, um die
Interaces zu verheiraten.
*/
class MITKALGORITHMSEXT_EXPORT NonBlockingAlgorithm : public itk::Object
{
public:
// for threading
class MITKALGORITHMSEXT_EXPORT ThreadParameters
{
public:
itk::SmartPointer<NonBlockingAlgorithm> m_Algorithm;
};
- mitkClassMacroItkParent(NonBlockingAlgorithm, itk::Object)
+ mitkClassMacroItkParent(NonBlockingAlgorithm, itk::Object);
- void SetDataStorage(DataStorage &storage);
+ void SetDataStorage(DataStorage &storage);
DataStorage *GetDataStorage();
// parameter setting
/// For any kind of normal types
template <typename T>
void SetParameter(const char *parameter, const T &value)
{
// MITK_INFO << "SetParameter(" << parameter << ") " << typeid(T).name() << std::endl;
// m_ParameterListMutex->Lock();
m_Parameters->SetProperty(parameter, GenericProperty<T>::New(value));
// m_ParameterListMutex->Unlock();
}
/// For any kind of smart pointers
template <typename T>
void SetPointerParameter(const char *parameter, const itk::SmartPointer<T> &value)
{
// MITK_INFO << this << "->SetParameter smartpointer(" << parameter << ") " << typeid(itk::SmartPointer<T>).name()
// << std::endl;
m_ParameterListMutex->Lock();
m_Parameters->SetProperty(parameter, SmartPointerProperty::New(value.GetPointer()));
m_ParameterListMutex->Unlock();
}
// virtual void SetParameter( const char*, mitk::BaseProperty* ); // for "number of iterations", ...
// create some property observing to inform algorithm object about changes
// perhaps some TriggerParameter(string) macro that creates an observer for changes in a specific property like
// "2ndPoint" for LineAlgorithms
/// For any kind of BaseData, like Image, Surface, etc. Will be stored inside some SmartPointerProperty
void SetPointerParameter(const char *parameter, BaseData *value);
/// For any kind of ITK images (C pointers)
template <typename TPixel, unsigned int VImageDimension>
void SetItkImageAsMITKImagePointerParameter(const char *parameter, itk::Image<TPixel, VImageDimension> *itkImage)
{
// MITK_INFO << "SetParameter ITK image(" << parameter << ") " << typeid(itk::Image<TPixel,
// VImageDimension>).name() << std::endl;
// create an MITK image for that
mitk::Image::Pointer mitkImage = mitk::Image::New();
mitkImage = ImportItkImage(itkImage);
SetPointerParameter(parameter, mitkImage);
}
/// For any kind of ITK images (smartpointers)
template <typename TPixel, unsigned int VImageDimension>
void SetItkImageAsMITKImagePointerParameter(const char *parameter,
const itk::SmartPointer<itk::Image<TPixel, VImageDimension>> &itkImage)
{
// MITK_INFO << "SetParameter ITK image(" << parameter << ") " << typeid(itk::SmartPointer<itk::Image<TPixel,
// VImageDimension> >).name() << std::endl;
// create an MITK image for that
mitk::Image::Pointer mitkImage = mitk::Image::New();
mitkImage = ImportItkImage(itkImage);
SetPointerParameter(parameter, mitkImage);
}
// parameter getting
template <typename T>
void GetParameter(const char *parameter, T &value) const
{
// MITK_INFO << "GetParameter normal(" << parameter << ") " << typeid(T).name() << std::endl;
// m_ParameterListMutex->Lock();
BaseProperty *p = m_Parameters->GetProperty(parameter);
GenericProperty<T> *gp = dynamic_cast<GenericProperty<T> *>(p);
if (gp)
{
value = gp->GetValue();
// m_ParameterListMutex->Unlock();
return;
}
// m_ParameterListMutex->Unlock();
std::string error("There is no parameter \"");
error += parameter;
error += '"';
throw std::invalid_argument(error);
}
template <typename T>
void GetPointerParameter(const char *parameter, itk::SmartPointer<T> &value) const
{
// MITK_INFO << this << "->GetParameter smartpointer(" << parameter << ") " << typeid(itk::SmartPointer<T>).name()
// << std::endl;
// m_ParameterListMutex->Lock();
BaseProperty *p = m_Parameters->GetProperty(parameter);
if (p)
{
SmartPointerProperty *spp = dynamic_cast<SmartPointerProperty *>(p);
if (spp)
{
T *t = dynamic_cast<T *>(spp->GetSmartPointer().GetPointer());
value = t;
// m_ParameterListMutex->Unlock();
return;
}
}
// m_ParameterListMutex->Unlock();
std::string error("There is no parameter \"");
error += parameter;
error += '"';
throw std::invalid_argument(error);
}
// start/stop functions
virtual void Reset();
void StartAlgorithm(); // for those who want to trigger calculations on their own
// --> need for an OPTION: manual/automatic starting
void StartBlockingAlgorithm(); // for those who want to trigger calculations on their own
void StopAlgorithm();
void TriggerParameterModified(const itk::EventObject &);
void ThreadedUpdateSuccessful(const itk::EventObject &);
void ThreadedUpdateFailed(const itk::EventObject &);
protected:
NonBlockingAlgorithm(); // use smart pointers
~NonBlockingAlgorithm() override;
void DefineTriggerParameter(const char *);
void UnDefineTriggerParameter(const char *);
virtual void Initialize(const NonBlockingAlgorithm *other = nullptr);
virtual bool ReadyToRun();
virtual bool ThreadedUpdateFunction(); // will be called from a thread after calling StartAlgorithm
virtual void ThreadedUpdateSuccessful(); // will be called after the ThreadedUpdateFunction() returned
virtual void ThreadedUpdateFailed(); // will when ThreadedUpdateFunction() returns false
PropertyList::Pointer m_Parameters;
WeakPointer<DataStorage> m_DataStorage;
private:
static ITK_THREAD_RETURN_TYPE StaticNonBlockingAlgorithmThread(void *param);
typedef std::map<std::string, unsigned long> MapTypeStringUInt;
MapTypeStringUInt m_TriggerPropertyConnections;
itk::FastMutexLock::Pointer m_ParameterListMutex;
int m_ThreadID;
int m_UpdateRequests;
ThreadParameters m_ThreadParameters;
itk::MultiThreader::Pointer m_MultiThreader;
bool m_KillRequest;
};
} // namespace
#include "mitkNonBlockingAlgorithmEvents.h"
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkPadImageFilter.h b/Modules/AlgorithmsExt/include/mitkPadImageFilter.h
index ef72e58eea..90e92cdd07 100644
--- a/Modules/AlgorithmsExt/include/mitkPadImageFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkPadImageFilter.h
@@ -1,66 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPADIMAGEFILTER_H_HEADER_INCLUDED
#define MITKPADIMAGEFILTER_H_HEADER_INCLUDED
#include "MitkAlgorithmsExtExports.h"
#include "mitkCommon.h"
#include "mitkImageTimeSelector.h"
#include "mitkImageToImageFilter.h"
#include "itkImage.h"
namespace mitk
{
/**
* \brief PadImageFilter class pads the first input image to the size of the second input image.
* Two Images have to be set.
* The first image is the image to pad. The second image defines the pad size.
* It is also possible to use an included binary filter.
*
* \ingroup Process
*/
class MITKALGORITHMSEXT_EXPORT PadImageFilter : public ImageToImageFilter
{
public:
mitkClassMacro(PadImageFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/** \brief Sets the intensity of the pixel to pad */
itkSetMacro(PadConstant, int);
/** \brief sets the binary filter ON or OFF */
itkSetMacro(BinaryFilter, bool);
/** \brief Sets the lower threshold of the included binary filter */
itkSetMacro(LowerThreshold, int);
/** \brief Sets the upper threshold of the included binary filter */
itkSetMacro(UpperThreshold, int);
protected:
PadImageFilter();
~PadImageFilter() override;
void GenerateData() override;
private:
bool m_BinaryFilter;
int m_PadConstant, m_LowerThreshold, m_UpperThreshold;
};
} // namespace mitk
#endif /* MITKPADIMAGEFILTER_H_HEADER_INCLUDED */
diff --git a/Modules/AlgorithmsExt/include/mitkPlaneLandmarkProjector.h b/Modules/AlgorithmsExt/include/mitkPlaneLandmarkProjector.h
index 253e1672e9..1fd5325e45 100644
--- a/Modules/AlgorithmsExt/include/mitkPlaneLandmarkProjector.h
+++ b/Modules/AlgorithmsExt/include/mitkPlaneLandmarkProjector.h
@@ -1,55 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPLANELANDMARKPROJECTOR_H_HEADER_INCLUDED_C1C68A2C
#define MITKPLANELANDMARKPROJECTOR_H_HEADER_INCLUDED_C1C68A2C
#include "MitkAlgorithmsExtExports.h"
#include "mitkLandmarkProjector.h"
#include "mitkPointSet.h"
namespace mitk
{
//##Documentation
//## @brief Thin-plate-spline-based landmark-based curved geometry
//##
//## @ingroup Geometry
class MITKALGORITHMSEXT_EXPORT PlaneLandmarkProjector : public LandmarkProjector
{
public:
mitkClassMacro(PlaneLandmarkProjector, LandmarkProjector);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
//##Documentation
//## @brief Set the plane-geometry to project the target-landmarks on.
//##
itkSetConstObjectMacro(ProjectionPlane, mitk::PlaneGeometry);
//##Documentation
//## @brief Get the plane-geometry to project the target-landmarks on.
//##
itkGetConstObjectMacro(ProjectionPlane, mitk::PlaneGeometry);
void ProjectLandmarks(const mitk::PointSet::DataType::PointsContainer *targetLandmarks) override;
protected:
PlaneLandmarkProjector();
~PlaneLandmarkProjector() override;
void ComputeCompleteAbstractTransform() override;
mitk::PlaneGeometry::ConstPointer m_ProjectionPlane;
};
} // namespace mitk
#endif /* MITKPLANELANDMARKPROJECTOR_H_HEADER_INCLUDED_C1C68A2C */
diff --git a/Modules/AlgorithmsExt/include/mitkPointLocator.h b/Modules/AlgorithmsExt/include/mitkPointLocator.h
index 304dcdfa79..47f79e7c9c 100644
--- a/Modules/AlgorithmsExt/include/mitkPointLocator.h
+++ b/Modules/AlgorithmsExt/include/mitkPointLocator.h
@@ -1,216 +1,218 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_POINT_LOCATOR__H__
#define _MITK_POINT_LOCATOR__H__
#include "MitkAlgorithmsExtExports.h"
#include <itkObject.h>
#include "mitkPointSet.h"
#include <vtkPoints.h>
// forward declarations
class vtkPointSet;
class ANNkd_tree;
namespace mitk
{
/**
* Convenience wrapper around ANN to provide fast nearest neighbour searches.
* Usage: set your points via SetPoints( vtkPointSet* Points ) or SetPoints(mitk::PointSet*).
* Then, you may query the closest point to an arbitrary coordinate by FindClosestPoint().
* There is no further call to update etc. needed.
* Currently only calls for 1 nearest neighbour are supported. Feel free to add functions
* for K nearest neighbours.
* NOTE: At least 1 point must be contained in the point set.
*/
class MITKALGORITHMSEXT_EXPORT PointLocator : public itk::Object
{
public:
mitkClassMacroItkParent(PointLocator, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
typedef int IdType;
typedef ScalarType DistanceType;
typedef float PixelType;
typedef double CoordRepType;
typedef itk::DefaultStaticMeshTraits<PixelType, 3, 2, CoordRepType, CoordRepType, PixelType> MeshTraits;
typedef itk::PointSet<PixelType, 3, MeshTraits> ITKPointSet;
/**
* Sets the point which will be used for nearest-neighbour searches. Note
* there must be at least one point in the point set.
* @param points the point set containing points for nearest neighbours searches.
*/
void SetPoints(vtkPointSet *points);
/**
* Sets the point which will be used for nearest-neighbour searches. Note
* there must be at least one point in the point set.
* @param points the point set containing points for nearest neighbours searches.
*/
void SetPoints(mitk::PointSet *points);
/**
* Sets the point which will be used for nearest-neighbour searches. Note
* there must be at least one point in the point set.
* @param pointSet the point set containing points for nearest neighbours searches.
*/
void SetPoints(ITKPointSet *pointSet);
/**
* Finds the nearest neighbour in the point set previously defined by SetPoints().
* The Id of the point is returned. Please note, that there is no case, in which
* no point is found, since as a precondition at least one point has to be contained
* in the point set.
* @param point the query point, for whom the nearest neighbour will be determined
* @returns the id of the nearest neighbour of the given point. The id corresponds to the id
* which is given in the original point set.
*/
IdType FindClosestPoint(const double point[3]);
/**
* Finds the nearest neighbour in the point set previously defined by SetPoints().
* The Id of the point is returned. Please note, that there is no case, in which
* no point is found, since as a precondition at least one point has to be contained
* in the point set.
* @param x the x coordinated of the query point, for whom the nearest neighbour will be determined
* @param y the x coordinated of the query point, for whom the nearest neighbour will be determined
* @param z the x coordinated of the query point, for whom the nearest neighbour will be determined
* @returns the id of the nearest neighbour of the given point. The id corresponds to the id
* which is given in the original point set.
*/
IdType FindClosestPoint(double x, double y, double z);
/**
* Finds the nearest neighbour in the point set previously defined by SetPoints().
* The Id of the point is returned. Please note, that there is no case, in which
* no point is found, since as a precondition at least one point has to be contained
* in the point set.
* @param point the query point, for whom the nearest neighbour will be determined
* @returns the id of the nearest neighbour of the given point. The id corresponds to the id
* which is given in the original point set.
*/
IdType FindClosestPoint(mitk::PointSet::PointType point);
/**
* Finds the nearest neighbour in the point set previously defined by SetPoints().
* The minimal distance between this point and the closest point of the point set is returned.
* Please note, that there is no case, in which
* no point is found, since as a precondition at least one point has to be contained
* in the point set.
* @param point the query point, for whom the minimal distance will be determined
* @returns the distance in world coordinates between the nearest point in point set and the given point
*/
DistanceType GetMinimalDistance(mitk::PointSet::PointType point);
/**
* Finds the nearest neighbour in the point set previously defined by SetPoints().
* The Index and minimal distance between this point and the closest point of the point set is returned.
* Please note, that there is no case, in which
* no point is found, since as a precondition at least one point has to be contained
* in the point set.
* @param point the query point, for whom the minimal distance will be determined
* @returns the index of and distance (in world coordinates) between the nearest point in point set and the given
* point
*/
bool FindClosestPointAndDistance(mitk::PointSet::PointType point, IdType *id, DistanceType *dist);
protected:
//
// Definition of a vector of ids
//
typedef std::vector<IdType> IdVectorType;
//
// ANN related typedefs, to prevent ANN from being in the global include path.
// Please note, that these line are prone to failure, if the point type in
// ANN changes. Please note also, that these typedefs are only used in the header
// file. The implementation always refers to the original types
//
typedef double *MyANNpoint;
typedef int MyANNidx;
typedef double MyANNdist;
typedef MyANNpoint *MyANNpointArray;
typedef MyANNidx *MyANNidxArray;
typedef MyANNdist *MyANNdistArray;
/**
* constructor
*/
PointLocator();
/**
* destructor
*/
~PointLocator() override;
/**
* Initializes the ann search tree using previously defined points
*/
void InitANN();
/**
* releases all memory occupied by the ann search tree and internal point set arrays
*/
void DestroyANN();
/**
* Finds the nearest neighbour in the point set previously defined by SetPoints().
* The Id of the point is returned. Please note, that there is no case, in which
* no point is found, since as a precondition at least one point has to be contained
* in the point set.
* @param point the query point, for whom the nearest neighbour will be determined
* @returns the id of the nearest neighbour of the given point. The id corresponds to the id
* which is given in the original point set.
*/
IdType FindClosestANNPoint(const MyANNpoint &point);
/**
* Finds the minimal distance between the given point and a point in the previously defined point set.
* The distance is returned. Please note, that there is no case, in which
* no distance is found, since as a precondition at least one point has to be contained
* in the point set.
* @param point the query point, for whom the minimal distance to a point in the previously defined point set will
* be determined
* @returns the squared distance in world coordinates between the given point and the nearest neighbour.
*/
DistanceType GetMinimalDistance(const MyANNpoint &point);
bool m_SearchTreeInitialized;
IdVectorType m_IndexToPointIdContainer;
vtkPoints *m_VtkPoints;
mitk::PointSet *m_MitkPoints;
ITKPointSet *m_ItkPoints;
//
// ANN related variables
//
unsigned int m_ANNK;
unsigned int m_ANNDimension;
double m_ANNEpsilon;
MyANNpointArray m_ANNDataPoints;
MyANNpoint m_ANNQueryPoint;
MyANNidxArray m_ANNPointIndexes;
MyANNdistArray m_ANNDistances;
ANNkd_tree *m_ANNTree;
};
}
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkSegmentationSink.h b/Modules/AlgorithmsExt/include/mitkSegmentationSink.h
index 7570aa039e..8a0b0ab3e9 100644
--- a/Modules/AlgorithmsExt/include/mitkSegmentationSink.h
+++ b/Modules/AlgorithmsExt/include/mitkSegmentationSink.h
@@ -1,44 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_SEGMENTATION_SINK_H_INCLUDET_WAD
#define MITK_SEGMENTATION_SINK_H_INCLUDET_WAD
#include "mitkNonBlockingAlgorithm.h"
#include <MitkAlgorithmsExtExports.h>
namespace mitk
{
class MITKALGORITHMSEXT_EXPORT SegmentationSink : public NonBlockingAlgorithm
{
public:
- mitkClassMacro(SegmentationSink, NonBlockingAlgorithm) mitkAlgorithmNewMacro(SegmentationSink);
+ mitkClassMacro(SegmentationSink, NonBlockingAlgorithm);
+ mitkAlgorithmNewMacro(SegmentationSink);
protected:
SegmentationSink(); // use smart pointers
~SegmentationSink() override;
void Initialize(const NonBlockingAlgorithm *other = nullptr) override;
bool ReadyToRun() override;
bool ThreadedUpdateFunction() override; // will be called from a thread after calling StartAlgorithm
void InsertBelowGroupNode(mitk::DataNode *node);
DataNode *LookForPointerTargetBelowGroupNode(const char *name);
DataNode *GetGroupNode();
private:
};
} // namespace
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkUnstructuredGridClusteringFilter.h b/Modules/AlgorithmsExt/include/mitkUnstructuredGridClusteringFilter.h
index f833f00408..4a76d324a7 100644
--- a/Modules/AlgorithmsExt/include/mitkUnstructuredGridClusteringFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkUnstructuredGridClusteringFilter.h
@@ -1,125 +1,128 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITKUNSTRUCTUREDGRIDCLUSTERINGFILTER_h__
#define _MITKUNSTRUCTUREDGRIDCLUSTERINGFILTER_h__
#include <MitkAlgorithmsExtExports.h>
#include <mitkCommon.h>
#include <mitkUnstructuredGrid.h>
#include <mitkUnstructuredGridToUnstructuredGridFilter.h>
#include <vtkIdList.h>
#include <vtkPoints.h>
#include <vtkSmartPointer.h>
namespace mitk
{
/**
* @brief This filter uses the DBSCAN algorithm for clustering an
* mitk::UnstructuredGrid. "MinPts" defines the number of neighbours which are
* required to be a kernel point if a point is in range of a kernel point
* but hasnt enough neighbours this point is added to the cluster but is a
* density reachable point and the cluster ends at this point. "eps" is the
* range in which the neighbours are searched. If "Meshing" is set the
* clusteres UnstructuredGrid is meshed and visible in 2D renderwindows.
*
* DBSCAN algorithm:
*
* DBSCAN(D, eps, MinPts)
* C = 0
* for each unvisited point P in dataset D
* mark P as visited
* N = D.regionQuery(P, eps)
* if sizeof(N) < MinPts
* mark P as NOISE
* else
* C = next cluster
* expandCluster(P, N, C, eps, MinPts)
*
* expandCluster(P, N, C, eps, MinPts)
* add P to cluster C
* for each point P' in N
* if P' is not visited
* mark P' as visited
* N' = D.regionQuery(P', eps)
* if sizeof(N') >= MinPts
* N = N joined with N'
* if P' is not yet member of any cluster
* add P' to cluster C
*/
class MITKALGORITHMSEXT_EXPORT UnstructuredGridClusteringFilter : public UnstructuredGridToUnstructuredGridFilter
{
public:
- mitkClassMacro(UnstructuredGridClusteringFilter, UnstructuredGridToUnstructuredGridFilter)
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(UnstructuredGridClusteringFilter, UnstructuredGridToUnstructuredGridFilter);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Sets the distance for the neighbour search */
- itkSetMacro(eps, double) itkGetMacro(eps, double)
+ itkSetMacro(eps, double);
+ itkGetMacro(eps, double);
/** Sets the number of required neighbours */
- itkSetMacro(MinPts, int) itkGetMacro(MinPts, int)
+ itkSetMacro(MinPts, int);
+ itkGetMacro(MinPts, int);
/** If activated the clusteres UnstructuredGrid is meshed */
- itkSetMacro(Meshing, bool)
+ itkSetMacro(Meshing, bool);
/** Returns all clusters as UnstructuredGrids which were found */
virtual std::vector<mitk::UnstructuredGrid::Pointer> GetAllClusters();
/** Returns the number of the clusters which were found */
virtual int GetNumberOfFoundClusters();
protected:
/** Constructor */
UnstructuredGridClusteringFilter();
/** Destructor */
~UnstructuredGridClusteringFilter() override;
/** Defines the output of the filter */
void GenerateOutputInformation() override;
/** Is called by the Update() method */
void GenerateData() override;
private:
/** Used for the DBSCAN algorithm to expand a cluster and add more points to it */
void ExpandCluster(int id, vtkIdList *pointIDs, vtkPoints *cluster, vtkPoints *inpPoints);
/** The result main Cluster */
mitk::UnstructuredGrid::Pointer m_UnstructGrid;
/** All clusters which were found */
std::vector<vtkSmartPointer<vtkPoints>> m_Clusters;
/** The distances of the points from the input UnstructuredGrid*/
std::vector<vtkSmartPointer<vtkDoubleArray>> m_DistanceArrays;
/** The range for the neighbout search */
double m_eps;
/** The number of the required neighbours */
int m_MinPts;
/** Activates the meshing for the UnstructuredGrid clusters*/
bool m_Meshing;
/** If its activated the distance of the clusters is used instead of the
* size */
bool m_DistCalc;
};
} // namespace mitk
#endif //_MITKUNSTRUCTUREDGRIDCLUSTERINGFILTER_h__
diff --git a/Modules/AlgorithmsExt/include/mitkUnstructuredGridToUnstructuredGridFilter.h b/Modules/AlgorithmsExt/include/mitkUnstructuredGridToUnstructuredGridFilter.h
index d24477e8f2..929df3abb2 100644
--- a/Modules/AlgorithmsExt/include/mitkUnstructuredGridToUnstructuredGridFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkUnstructuredGridToUnstructuredGridFilter.h
@@ -1,62 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITKUNSTRUCTUREDGRIDTOUNSTRUCTUREDGRID_h__
#define _MITKUNSTRUCTUREDGRIDTOUNSTRUCTUREDGRID_h__
#include <MitkAlgorithmsExtExports.h>
#include <mitkCommon.h>
#include <mitkImage.h>
#include <mitkUnstructuredGrid.h>
#include <mitkUnstructuredGridSource.h>
namespace mitk
{
class MITKALGORITHMSEXT_EXPORT UnstructuredGridToUnstructuredGridFilter : public UnstructuredGridSource
{
public:
- mitkClassMacro(UnstructuredGridToUnstructuredGridFilter, UnstructuredGridSource) itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(UnstructuredGridToUnstructuredGridFilter, UnstructuredGridSource);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Initializes the output information */
void GenerateOutputInformation() override;
/** Returns a const reference to the input image */
const mitk::UnstructuredGrid *GetInput(void);
virtual const mitk::UnstructuredGrid *GetInput(unsigned int idx);
/** Set the source grid. As input every mitk unstructured grid can be used. */
using itk::ProcessObject::SetInput;
virtual void SetInput(const UnstructuredGrid *grid);
virtual void SetInput(unsigned int idx, const UnstructuredGrid *grid);
virtual void CreateOutputsForAllInputs(unsigned int idx);
protected:
/** Constructor */
UnstructuredGridToUnstructuredGridFilter();
/** Destructor */
~UnstructuredGridToUnstructuredGridFilter() override;
private:
/** The output of the filter */
mitk::UnstructuredGrid::Pointer m_UnstructGrid;
};
} // namespace mitk
#endif //_MITKUNSTRUCTUREDGRIDTOUNSTRUCTUREDGRID_h__
diff --git a/Modules/AlgorithmsExt/include/mitkWeightedPointTransform.h b/Modules/AlgorithmsExt/include/mitkWeightedPointTransform.h
index bb34dfba25..61f43b27c5 100644
--- a/Modules/AlgorithmsExt/include/mitkWeightedPointTransform.h
+++ b/Modules/AlgorithmsExt/include/mitkWeightedPointTransform.h
@@ -1,248 +1,248 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __WEIGHTEDPOINTTRANSFORM_H__
#define __WEIGHTEDPOINTTRANSFORM_H__
// EXPORTS
#include "MitkAlgorithmsExtExports.h"
// ITK
#include <itkMatrix.h>
#include <itkVariableSizeMatrix.h>
#include <mitkCommon.h>
#include <mitkPointSet.h>
#include <vector>
#include <vtkSmartPointer.h>
// forward declarations
class vtkPoints;
class vtkLandmarkTransform;
namespace mitk
{
/**
* \ingroup AnisotropicRegistration
*
* @brief This class implements an extension of the
* weighted point based registration algorithm
* from A. Danilchenko, R. Balachandran and J. M. Fitzpatrick.
*
* The class implements an extension of the weighted point based registration
* from A. Danilchenko et al.
* presented by L. Maier-Hein et al. in "Convergent Iterative Closest-Point Algorithm
* to Accomodate Anisotropic and Inhomogenous Localization Error.",
* IEEE T Pattern Anal 34 (8), 1520-1532, 2012. The extension computes, in order
* to ensure the convergence of the algorithm, an isotropic estimation
* by an unweighted point based registration algorithm as an initial estimate.
* The implemantion was originally ported to C/C++ by A. Franz.
*
* \note Some methods are accelerated when OpenMP is enabled.
*
*/
class MITKALGORITHMSEXT_EXPORT WeightedPointTransform : public itk::Object
{
/** Definition of a 3x3 matrix.*/
typedef itk::Matrix<double, 3, 3> Matrix3x3;
/** Definition of a 3x3 Weighting matrix.*/
typedef Matrix3x3 WeightMatrix;
/** Definition of a Rotation matrix.*/
typedef Matrix3x3 Rotation;
/** Definition of a translation vector.*/
typedef itk::Vector<double, 3> Translation;
/** Definition of a weight matrix list.*/
typedef std::vector<WeightMatrix> WeightMatrixList;
/** Definition of a covariance matrix list.*/
typedef std::vector<Matrix3x3> CovarianceMatrixList;
public:
mitkClassMacroItkParent(WeightedPointTransform, itk::Object);
itkFactorylessNewMacro(Self);
- itkCloneMacro(Self)
+ itkCloneMacro(Self);
/** @brief Method which registers both point sets. */
void ComputeTransformation();
/** @brief Sets the threshold of the registration. Default value is 0.0001.*/
- itkSetMacro(Threshold, double)
+ itkSetMacro(Threshold, double);
/** @brief Sets the maximum number of iterations of the registration.
* Default value is 1000.
*/
- itkSetMacro(MaxIterations, double)
+ itkSetMacro(MaxIterations, double);
/** @return Returns the number of iterations of the last run
* of the registration algorithm. Returns -1 if there was no
* run of the registration yet.
*/
itkGetMacro(Iterations, int);
/** @return Returns the FRE of the last run of the registration algorithm.
* Returns -1 if there was no run of the registration yet.
*/
itkGetMacro(FRE, double);
/** @brief Sets the FRE normalization factor. Default value is 1.0. */
itkSetMacro(FRENormalizationFactor, double);
/** @return Returns the current FRE normalization factor.*/
itkGetMacro(FRENormalizationFactor, double);
/** Sets the moving point set used for the registration.
* @param p The input point set.
*/
void SetMovingPointSet(vtkSmartPointer<vtkPoints> p);
/**
* Set the list of 3x3 covariance matrices belonging to the moving point set.
* @param matrices List of covariance matrices.
*/
void SetCovarianceMatricesMoving(const CovarianceMatrixList &matrices);
/** Sets the fixed point set used for the registration.
* @param p The input point set.
*/
void SetFixedPointSet(vtkSmartPointer<vtkPoints> p);
/**
* Set the list of 3x3 covariance matrices belonging to the fixed point set.
* @param matrices List of covariance matrices.
*/
void SetCovarianceMatricesFixed(const CovarianceMatrixList &matrices);
/**
* The translation vector computed by the algorithm.
* @return 3x1 translation vector.
*/
const Translation &GetTransformT() const { return m_Translation; }
/**
* The rotation matrix computed by the algorithm.
*/
const Rotation &GetTransformR() const { return m_Rotation; }
protected:
WeightedPointTransform();
~WeightedPointTransform() override;
/** Threshold used to terminate the algorithm.*/
double m_Threshold;
/** Max allowed iterations used by the algorithm.*/
int m_MaxIterations;
/** The amount of iterations needed by the algorithm.*/
int m_Iterations;
/** The fiducial registration error (FRE) used in the algorithm.*/
double m_FRE;
/** Normalization factor for the FRE.*/
double m_FRENormalizationFactor;
/** Isotropic point based registration used for initial estimate.*/
vtkSmartPointer<vtkLandmarkTransform> m_LandmarkTransform;
/** The fixed point set (Y).*/
vtkSmartPointer<vtkPoints> m_FixedPointSet;
/** Moving point set (X).*/
vtkSmartPointer<vtkPoints> m_MovingPointSet;
/** Covariance matrices of the moving point set (Sigma_X).*/
CovarianceMatrixList m_CovarianceMatricesMoving;
/** Covariance matrices of the moving point set (Sigma_Y).*/
CovarianceMatrixList m_CovarianceMatricesFixed;
/** 3x1 translation vector.*/
Translation m_Translation;
/** 3x3 rotation matrix.*/
Rotation m_Rotation;
/**
* original matlab-function:
*
* Constructs the C matrix of the linear version of the registration
* problem, Cq = e, where q = [delta_angle(1:3),delta_translation(1:3)] and
* e is produced by e_maker(X,Y,W)
*
* Authors: JM Fitzpatrick and R Balachandran
* Creation: February 2009
*
* --------------------------------------------
*
* converted to C++ by Alfred Franz in March/April 2010
*/
void C_maker(vtkPoints *X, const WeightMatrixList &W, itk::VariableSizeMatrix<double> &returnValue);
/**
* original matlab-function:
*
* Constructs the e vector of the linear version of the registration
* problem, Cq = e, where q = [delta_angle(1:3),delta_translation(1:3)] and
* C is produced by C_maker(X,W)
*
* Authors: JM Fitzpatrick and R Balachandran
* Creation: February 2009
*
* --------------------------------------------
*
* converted to C++ by Alfred Franz in March/April 2010
*/
void E_maker(vtkPoints *X, vtkPoints *Y, const WeightMatrixList &W, vnl_vector<double> &returnValue);
/**
* This method computes the change in a root mean squared
* sense between the previous and the actual iteration.
* The computed value is used as a termination constraint of the algorithm and
* compared against the threshold.
*
* @param X The moving point set in the previous iteration step.
* @param X_new The moving point set in the actual step.
*
* @return The computed change between the two point sets.
*/
double CalculateConfigChange(vtkPoints *X, vtkPoints *X_new);
/**
* @brief This method performs a variant of the weighted point register algorithm presented by
* A. Danilchenko, R. Balachandran and J. M. Fitzpatrick in January 2010. (Modified in January 2011)
* converted to C++ by Alfred Franz in March/April 2010
*
* @param X (input) the moving point set
* @param Y (input) the fixed (static) point set
* @param Sigma_X (input) a 3-by-3-by-N array, each page containing the weighting matrix for the Nth pair
* of points in X
* @param Sigma_Y (input) a 3-by-3-by-N array, each page containing the weighting matrix for the Nth pair
* of points in Y
* @param Threshold (input) the relative size of the change to the moving set above which the iteration
* continues
* @param MaxIterations (input) the maximum number of iterations allowed
* @param Threshold (input) the threshold used to terminate the algorithm
* @param TransformationR (output) this variable will hold the computed rotation matrix
* @param TransformationT (output) this variable will hold the computed translation vector
* @param FRE (output) this variable will hold the computed rotation FRE of the transformation
* @param n (output) this variable will hold the number of iterations used by the algorithm
*/
void WeightedPointRegister(vtkPoints *X,
vtkPoints *Y,
const CovarianceMatrixList &Sigma_X,
const CovarianceMatrixList &Sigma_Y,
double Threshold,
int MaxIterations,
Rotation &TransformationR,
Translation &TransformationT,
double &FRE,
int &n);
};
}
#endif
diff --git a/Modules/Annotation/include/mitkColorBarAnnotation.h b/Modules/Annotation/include/mitkColorBarAnnotation.h
index 43b6886aa5..d70f925819 100644
--- a/Modules/Annotation/include/mitkColorBarAnnotation.h
+++ b/Modules/Annotation/include/mitkColorBarAnnotation.h
@@ -1,93 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef COLORBARAnnotation_H
#define COLORBARAnnotation_H
#include "MitkAnnotationExports.h"
#include <mitkLocalStorageHandler.h>
#include <mitkVtkAnnotation.h>
#include <vtkLookupTable.h>
#include <vtkSmartPointer.h>
class vtkScalarBarActor;
namespace mitk
{
/** \brief Displays configurable scales on the renderwindow. The scale is determined by the image spacing. */
class MITKANNOTATION_EXPORT ColorBarAnnotation : public mitk::VtkAnnotation
{
public:
class LocalStorage : public mitk::Annotation::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkScalarBarActor> m_ScalarBarActor;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage();
};
mitkClassMacro(ColorBarAnnotation, mitk::VtkAnnotation);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void SetDrawAnnotations(bool annotations);
bool GetDrawAnnotations() const;
void SetOrientationToHorizontal();
void SetOrientationToVertical();
void SetOrientation(int orientation);
int GetOrientation() const;
void SetMaxNumberOfColors(int numberOfColors);
int GetMaxNumberOfColors() const;
void SetNumberOfLabels(int numberOfLabels);
int GetNumberOfLabels() const;
void SetLookupTable(vtkSmartPointer<vtkLookupTable> table);
vtkSmartPointer<vtkLookupTable> GetLookupTable() const;
void SetDrawTickLabels(bool ticks);
bool GetDrawTickLabels() const;
void SetAnnotationTextScaling(bool scale);
bool GetAnnotationTextScaling() const;
protected:
/** \brief The LocalStorageHandler holds all LocalStorages for the render windows. */
mutable mitk::LocalStorageHandler<LocalStorage> m_LSH;
vtkProp *GetVtkProp(BaseRenderer *renderer) const override;
void UpdateVtkAnnotation(BaseRenderer *renderer) override;
/** \brief explicit constructor which disallows implicit conversions */
explicit ColorBarAnnotation();
/** \brief virtual destructor in order to derive from this class */
~ColorBarAnnotation() override;
private:
/** \brief copy constructor */
ColorBarAnnotation(const ColorBarAnnotation &);
/** \brief assignment operator */
ColorBarAnnotation &operator=(const ColorBarAnnotation &);
};
} // namespace mitk
#endif // COLORBARAnnotation_H
diff --git a/Modules/Annotation/include/mitkLabelAnnotation3D.h b/Modules/Annotation/include/mitkLabelAnnotation3D.h
index 1d3b74ff9e..cb8a244bdd 100644
--- a/Modules/Annotation/include/mitkLabelAnnotation3D.h
+++ b/Modules/Annotation/include/mitkLabelAnnotation3D.h
@@ -1,108 +1,109 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef LabelAnnotation3D_H
#define LabelAnnotation3D_H
#include "MitkAnnotationExports.h"
#include <mitkLocalStorageHandler.h>
#include <mitkVtkAnnotation3D.h>
#include <vtkSmartPointer.h>
class vtkStringArray;
class vtkPolyDataMapper;
class vtkPolyData;
class vtkActor2D;
class vtkProperty2D;
class vtkPointSetToLabelHierarchy;
class vtkLabelPlacementMapper;
class vtkIntArray;
namespace mitk
{
class PointSet;
/** \brief Can display a high amount of 3D labels to a PointSet */
class MITKANNOTATION_EXPORT LabelAnnotation3D : public mitk::VtkAnnotation3D
{
public:
/** \brief Internal class holding the vtkActor, etc. for each of the render windows */
class LocalStorage : public mitk::Annotation::BaseLocalStorage
{
public:
vtkSmartPointer<vtkPolyData> m_Points;
vtkSmartPointer<vtkActor2D> m_LabelsActor;
vtkSmartPointer<vtkIntArray> m_Sizes;
vtkSmartPointer<vtkStringArray> m_Labels;
vtkSmartPointer<vtkLabelPlacementMapper> m_LabelMapper;
vtkSmartPointer<vtkPointSetToLabelHierarchy> m_PointSetToLabelHierarchyFilter;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage();
};
mitkClassMacro(LabelAnnotation3D, mitk::VtkAnnotation3D);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** \brief Set the vector of labels that are shown to each corresponding point3D. The size has to be equal to the
provided LabelCoordinates. */
void SetLabelVector(const std::vector<std::string> &LabelVector);
/** \brief Optional: Provide a vector of priorities. The labels with higher priorities will be visible in lower LOD
*/
void SetPriorityVector(const std::vector<int> &PriorityVector);
/** \brief Coordinates of the labels */
void SetLabelCoordinates(itk::SmartPointer<PointSet> LabelCoordinates);
void PointSetModified(const itk::Object *, const itk::EventObject &);
protected:
/** \brief The LocalStorageHandler holds all LocalStorages for the render windows. */
mutable mitk::LocalStorageHandler<LocalStorage> m_LSH;
vtkProp *GetVtkProp(BaseRenderer *renderer) const override;
void UpdateVtkAnnotation(mitk::BaseRenderer *renderer) override;
/** \brief explicit constructor which disallows implicit conversions */
explicit LabelAnnotation3D();
/** \brief virtual destructor in order to derive from this class */
~LabelAnnotation3D() override;
private:
/** \brief The char arrays in this vector are displayed at the corresponding coordinates.*/
std::vector<std::string> m_LabelVector;
/** \brief values in this array set a priority to each label. Higher priority labels are not covert by labels with
* lower priority.*/
std::vector<int> m_PriorityVector;
/** \brief The coordinates of the labels. Indices must match the labelVector and the priorityVector.*/
itk::SmartPointer<PointSet> m_LabelCoordinates;
unsigned long m_PointSetModifiedObserverTag;
/** \brief copy constructor */
LabelAnnotation3D(const LabelAnnotation3D &);
/** \brief assignment operator */
LabelAnnotation3D &operator=(const LabelAnnotation3D &);
};
} // namespace mitk
#endif // LabelAnnotation3D_H
diff --git a/Modules/Annotation/include/mitkLogoAnnotation.h b/Modules/Annotation/include/mitkLogoAnnotation.h
index 9c59473958..38e3ec644e 100644
--- a/Modules/Annotation/include/mitkLogoAnnotation.h
+++ b/Modules/Annotation/include/mitkLogoAnnotation.h
@@ -1,100 +1,101 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef LOGOAnnotation_H
#define LOGOAnnotation_H
#include "MitkAnnotationExports.h"
#include <mitkLocalStorageHandler.h>
#include <mitkVtkAnnotation.h>
#include <vtkSmartPointer.h>
class mitkVtkLogoRepresentation;
class vtkImageData;
class vtkImageReader2Factory;
class vtkImageImport;
namespace mitk
{
/** \brief Displays a logo on the renderwindow */
class MITKANNOTATION_EXPORT LogoAnnotation : public mitk::VtkAnnotation
{
public:
class LocalStorage : public mitk::Annotation::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkImageData> m_LogoImage;
vtkSmartPointer<mitkVtkLogoRepresentation> m_LogoRep;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage();
};
mitkClassMacro(LogoAnnotation, mitk::VtkAnnotation);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
vtkSmartPointer<vtkImageReader2Factory> m_readerFactory;
void SetLogoImage(vtkSmartPointer<vtkImageData> logo);
void SetLogoImagePath(std::string text);
std::string GetLogoImagePath() const;
void LoadLogoImageFromPath();
/** \brief The relative offset to the corner position */
void SetOffsetVector(const Point2D &OffsetVector);
Point2D GetOffsetVector() const;
/** \brief The corner where the logo is displayed.
0 = Bottom left
1 = Bottom right
2 = Top right
3 = Top left
4 = Center*/
void SetCornerPosition(const int &corner);
int GetCornerPosition() const;
void SetRelativeSize(const float &size);
float GetRelativeSize() const;
protected:
/** \brief The LocalStorageHandler holds all LocalStorages for the render windows. */
mutable mitk::LocalStorageHandler<LocalStorage> m_LSH;
vtkProp *GetVtkProp(BaseRenderer *renderer) const override;
void UpdateVtkAnnotation(mitk::BaseRenderer *renderer) override;
/** \brief explicit constructor which disallows implicit conversions */
explicit LogoAnnotation();
/** \brief virtual destructor in order to derive from this class */
~LogoAnnotation() override;
private:
vtkSmartPointer<vtkImageData> m_UpdatedLogoImage;
vtkSmartPointer<vtkImageImport> m_VtkImageImport;
/** \brief copy constructor */
LogoAnnotation(const LogoAnnotation &);
/** \brief assignment operator */
LogoAnnotation &operator=(const LogoAnnotation &);
};
} // namespace mitk
#endif // LOGOAnnotation_H
diff --git a/Modules/Annotation/include/mitkScaleLegendAnnotation.h b/Modules/Annotation/include/mitkScaleLegendAnnotation.h
index f7c4e34454..1c822f478f 100644
--- a/Modules/Annotation/include/mitkScaleLegendAnnotation.h
+++ b/Modules/Annotation/include/mitkScaleLegendAnnotation.h
@@ -1,102 +1,103 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef SCALELEGENDAnnotation_H
#define SCALELEGENDAnnotation_H
#include "MitkAnnotationExports.h"
#include <mitkLocalStorageHandler.h>
#include <mitkVtkAnnotation.h>
#include <vtkSmartPointer.h>
class vtkLegendScaleActor;
namespace mitk
{
/** \brief Displays configurable scales on the renderwindow. The scale is determined by the image spacing. */
class MITKANNOTATION_EXPORT ScaleLegendAnnotation : public mitk::VtkAnnotation
{
public:
class LocalStorage : public mitk::Annotation::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkLegendScaleActor> m_legendScaleActor;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage();
};
mitkClassMacro(ScaleLegendAnnotation, mitk::VtkAnnotation);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void SetRightAxisVisibility(bool visibility);
bool GetRightAxisVisibility() const;
void SetLeftAxisVisibility(bool visibility);
bool GetLeftAxisVisibility() const;
void SetTopAxisVisibility(bool visibility);
bool GetTopAxisVisibility() const;
void SetBottomAxisVisibility(bool visibility);
bool GetBottomAxisVisibility() const;
void SetLegendVisibility(bool visibility);
bool GetLegendVisibility() const;
void SetRightBorderOffset(int offset);
int GetRightBorderOffset() const;
void SetLeftBorderOffset(int offset);
int GetLeftBorderOffset() const;
void SetTopBorderOffset(int offset);
int GetTopBorderOffset() const;
void SetBottomBorderOffset(int offset);
int GetBottomBorderOffset() const;
void SetFontFactor(double fontFactor);
double GetFontFactor() const;
void SetCornerOffsetFactor(double offsetFactor);
double GetCornerOffsetFactor() const;
protected:
/** \brief The LocalStorageHandler holds all LocalStorages for the render windows. */
mutable mitk::LocalStorageHandler<LocalStorage> m_LSH;
vtkProp *GetVtkProp(BaseRenderer *renderer) const override;
void UpdateVtkAnnotation(BaseRenderer *renderer) override;
/** \brief explicit constructor which disallows implicit conversions */
explicit ScaleLegendAnnotation();
/** \brief virtual destructor in order to derive from this class */
~ScaleLegendAnnotation() override;
private:
/** \brief copy constructor */
ScaleLegendAnnotation(const ScaleLegendAnnotation &);
/** \brief assignment operator */
ScaleLegendAnnotation &operator=(const ScaleLegendAnnotation &);
};
} // namespace mitk
#endif // SCALELEGENDAnnotation_H
diff --git a/Modules/Annotation/include/mitkTextAnnotation2D.h b/Modules/Annotation/include/mitkTextAnnotation2D.h
index 03df61c8fe..c4bd78a977 100644
--- a/Modules/Annotation/include/mitkTextAnnotation2D.h
+++ b/Modules/Annotation/include/mitkTextAnnotation2D.h
@@ -1,82 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef TEXTAnnotation2D_H
#define TEXTAnnotation2D_H
#include "MitkAnnotationExports.h"
#include <mitkLocalStorageHandler.h>
#include <mitkVtkAnnotation2D.h>
#include <vtkSmartPointer.h>
class vtkTextActor;
class vtkPropAssembly;
namespace mitk
{
/** \brief Displays text on the renderwindow */
class MITKANNOTATION_EXPORT TextAnnotation2D : public mitk::VtkAnnotation2D
{
public:
class LocalStorage : public mitk::Annotation::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkTextActor> m_TextActor;
vtkSmartPointer<vtkTextProperty> m_TextProp;
vtkSmartPointer<vtkTextActor> m_STextActor;
vtkSmartPointer<vtkTextProperty> m_STextProp;
vtkSmartPointer<vtkPropAssembly> m_Assembly;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage();
};
mitkClassMacro(TextAnnotation2D, mitk::VtkAnnotation2D);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
Annotation::Bounds GetBoundsOnDisplay(BaseRenderer *renderer) const override;
void SetBoundsOnDisplay(BaseRenderer *renderer, const Bounds &bounds) override;
protected:
/** \brief The LocalStorageHandler holds all LocalStorages for the render windows. */
mutable mitk::LocalStorageHandler<LocalStorage> m_LSH;
vtkProp *GetVtkProp(BaseRenderer *renderer) const override;
vtkActor2D *GetVtkActor2D(BaseRenderer *renderer) const override;
void UpdateVtkAnnotation2D(mitk::BaseRenderer *renderer) override;
/** \brief explicit constructor which disallows implicit conversions */
explicit TextAnnotation2D();
/** \brief virtual destructor in order to derive from this class */
~TextAnnotation2D() override;
private:
/** \brief copy constructor */
TextAnnotation2D(const TextAnnotation2D &);
/** \brief assignment operator */
TextAnnotation2D &operator=(const TextAnnotation2D &);
};
} // namespace mitk
#endif // TEXTAnnotation2D_H
diff --git a/Modules/Annotation/include/mitkTextAnnotation3D.h b/Modules/Annotation/include/mitkTextAnnotation3D.h
index 310f17c0e4..79301558da 100644
--- a/Modules/Annotation/include/mitkTextAnnotation3D.h
+++ b/Modules/Annotation/include/mitkTextAnnotation3D.h
@@ -1,80 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef TextAnnotation3D_H
#define TextAnnotation3D_H
#include "MitkAnnotationExports.h"
#include <mitkLocalStorageHandler.h>
#include <mitkVtkAnnotation3D.h>
class vtkFollower;
class vtkVectorText;
class vtkTextActor3D;
namespace mitk
{
/** \brief Displays at 3D position, always facing the camera */
class MITKANNOTATION_EXPORT TextAnnotation3D : public mitk::VtkAnnotation3D
{
public:
/** \brief Internal class holding the mapper, actor, etc. for each of the render windows */
/**
* To render the Annotation on transveral, coronal, and sagittal, the update method
* is called for each renderwindow. For performance reasons, the corresponding data
* for each view is saved in the internal helper class LocalStorage.
* This allows rendering n views with just 1 mitkAnnotation using n vtkMapper.
* */
class LocalStorage : public mitk::Annotation::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkFollower> m_follower;
vtkSmartPointer<vtkVectorText> m_textSource;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage();
};
mitkClassMacro(TextAnnotation3D, mitk::VtkAnnotation3D);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
protected :
/** \brief The LocalStorageHandler holds all LocalStorages for the render windows. */
mutable mitk::LocalStorageHandler<LocalStorage> m_LSH;
vtkProp *GetVtkProp(BaseRenderer *renderer) const override;
void UpdateVtkAnnotation(mitk::BaseRenderer *renderer) override;
/** \brief explicit constructor which disallows implicit conversions */
explicit TextAnnotation3D();
/** \brief virtual destructor in order to derive from this class */
~TextAnnotation3D() override;
private:
/** \brief copy constructor */
TextAnnotation3D(const TextAnnotation3D &);
/** \brief assignment operator */
TextAnnotation3D &operator=(const TextAnnotation3D &);
};
} // namespace mitk
#endif // TextAnnotation3D_H
diff --git a/Modules/Annotation/test/files.cmake b/Modules/Annotation/test/files.cmake
index 8b6efdd163..a9960f8d92 100644
--- a/Modules/Annotation/test/files.cmake
+++ b/Modules/Annotation/test/files.cmake
@@ -1,18 +1,11 @@
-
set(MODULE_TESTS
- mitkAnnotationTest.cpp
-)
-
-if(MITK_ENABLE_RENDERING_TESTING)
-set(MODULE_TESTS
- ${MODULE_TESTS}
+ mitkAnnotationTest.cpp
mitkManualPlacementAnnotationRendererTest.cpp
mitkColorBarAnnotationTest.cpp
mitkLabelAnnotation3DTest.cpp
mitkLogoAnnotationTest.cpp
mitkLayoutAnnotationRendererTest.cpp
mitkScaleLegendAnnotationTest.cpp
mitkTextAnnotation2DTest.cpp
mitkTextAnnotation3DTest.cpp
)
-endif()
diff --git a/Modules/BasicImageProcessing/CMakeLists.txt b/Modules/BasicImageProcessing/CMakeLists.txt
index 6302c23500..b4e12f4b38 100644
--- a/Modules/BasicImageProcessing/CMakeLists.txt
+++ b/Modules/BasicImageProcessing/CMakeLists.txt
@@ -1,8 +1,8 @@
MITK_CREATE_MODULE(
- DEPENDS MitkCore MitkMatchPointRegistration MitkMatchPointRegistrationIO
+ DEPENDS MitkCore MitkMatchPointRegistration
PACKAGE_DEPENDS
PUBLIC
PRIVATE ITK|ITKIOImageBase+ITKIOGDCM
)
add_subdirectory(MiniApps)
diff --git a/Modules/BoundingShape/include/mitkBoundingShapeCropper.h b/Modules/BoundingShape/include/mitkBoundingShapeCropper.h
index aea59e9b9f..04b0254dea 100644
--- a/Modules/BoundingShape/include/mitkBoundingShapeCropper.h
+++ b/Modules/BoundingShape/include/mitkBoundingShapeCropper.h
@@ -1,144 +1,145 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BOUNDINGSHAPECROPPER_H
#define BOUNDINGSHAPECROPPER_H
#include "MitkBoundingShapeExports.h"
#include "mitkBoundingShapeCropper.h"
#include "mitkCommon.h"
#include "mitkGeometryData.h"
#include "mitkImageAccessByItk.h"
#include "mitkImageTimeSelector.h"
#include "mitkImageToImageFilter.h"
#include "itkImage.h"
namespace mitk
{
/** Documentation
* @brief Crops or masks an Boundingbox defined by GeometryData out of an mitk Image
*
* Input Parameters are a mitk::GeometryData and an mitk::Image
* Masking: Pixel on the outside of the bounding box will have a pixelvalue of m_OutsideValue
* Cropping: Output image has the same size as the bounding box
*/
//## @ingroup Process
class MITKBOUNDINGSHAPE_EXPORT BoundingShapeCropper : public ImageToImageFilter
{
public:
mitkClassMacro(BoundingShapeCropper, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* @brief Set geometry of the bounding object
*/
void SetGeometry(const mitk::GeometryData *geometry);
/**
* @brief Get geometry of the bounding object
*/
// const mitk::GeometryData* GetGeometryData() const;
/**
* @brief Sets and Gets the outside value for masking
*/
itkSetMacro(OutsideValue, ScalarType);
itkGetMacro(OutsideValue, ScalarType);
/**
* @brief Sets and Gets whether a masking or cropping needs to be performed
*/
itkSetMacro(UseWholeInputRegion, bool);
itkGetMacro(UseWholeInputRegion, bool);
/**
* @brief Sets and Gets the current timestep for images with 4 dimensons
*/
itkSetMacro(CurrentTimeStep, ScalarType);
itkGetMacro(CurrentTimeStep, ScalarType);
/**
*@brief Sets and Gets whether only one timestep is cropped / masked
*/
itkSetMacro(UseCropTimeStepOnly, bool);
itkGetMacro(UseCropTimeStepOnly, bool);
protected:
BoundingShapeCropper();
~BoundingShapeCropper() override;
virtual const PixelType GetOutputPixelType();
/**
* @brief Reimplemented from ImageToImageFilter
*/
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
/**
* @brief Template Function for cropping and masking images with scalar pixel type
*/
template <typename TPixel, unsigned int VImageDimension>
void CutImage(itk::Image<TPixel, VImageDimension> *inputItkImage, int timeStep);
/**
*@brief Process the image and create the output
**/
virtual void ComputeData(mitk::Image *input3D, int boTimeStep);
// virtual void ComputeData(mitk::LabelSetImage* image, int boTimeStep);
private:
/**
*@brief GeometryData Type to capsulate all necessary components of the bounding object
**/
mitk::GeometryData::Pointer m_Geometry;
/**
* @brief scalar value for outside pixels (default: 0)
*/
ScalarType m_OutsideValue;
/**
* @brief Use m_UseCropTimeStepOnly for only cropping a single time step(default: \a false)
*/
bool m_UseCropTimeStepOnly;
/**
* @brief Current time step displayed
*/
int m_CurrentTimeStep;
/**
* @brief Use m_UseWholeInputRegion for deciding whether a cropping or masking will be performed
*/
bool m_UseWholeInputRegion;
/**
* @brief Select single input image in a timeseries
*/
mitk::ImageTimeSelector::Pointer m_InputTimeSelector;
/**
* @brief Select single output image in a timeseries
*/
mitk::ImageTimeSelector::Pointer m_OutputTimeSelector;
/**
* @brief Region of input needed for cutting
*/
typedef itk::ImageRegion<5> RegionType;
mitk::SlicedData::RegionType m_InputRequestedRegion;
/**
* @brief Time when Header was last initialized
**/
itk::TimeStamp m_TimeOfHeaderInitialization;
};
} // namespace mitk
#endif /* BOUNDINGSHAPECROPPER_H */
diff --git a/Modules/BoundingShape/include/mitkBoundingShapeInteractor.h b/Modules/BoundingShape/include/mitkBoundingShapeInteractor.h
index eababab05d..bedca93e42 100644
--- a/Modules/BoundingShape/include/mitkBoundingShapeInteractor.h
+++ b/Modules/BoundingShape/include/mitkBoundingShapeInteractor.h
@@ -1,135 +1,136 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkBoundingShapeInteractor_h
#define mitkBoundingShapeInteractor_h
#include <mitkDataInteractor.h>
#include <mitkEventConfig.h>
#include <mitkGeometry3D.h>
#include <usServiceRegistration.h>
#include <MitkBoundingShapeExports.h>
namespace mitk
{
// create events for interactions
#pragma GCC visibility push(default)
- itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent)
+ itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent);
#pragma GCC visibility pop
- /**
- * @brief Basic interaction methods for mitk::GeometryData
- *
- * Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
- *
- * \ingroup Interaction
- */
- class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor : public DataInteractor
+ /**
+ * @brief Basic interaction methods for mitk::GeometryData
+ *
+ * Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
+ *
+ * \ingroup Interaction
+ */
+ class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor : public DataInteractor
{
public:
mitkClassMacro(BoundingShapeInteractor, DataInteractor);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
- void SetDataNode(DataNode *dataNode) override;
+ void SetDataNode(DataNode *dataNode) override;
void SetRotationEnabled(bool rotationEnabled);
protected:
BoundingShapeInteractor();
~BoundingShapeInteractor() override;
/**
* Here actions strings from the loaded state machine pattern are mapped to functions of
* the DataInteractor. These functions are called when an action from the state machine pattern is executed.
*/
void ConnectActionsAndFunctions() override;
/**
* @brief Called when a DataNode has been set/changed.
*/
void DataNodeChanged() override;
void HandlePositionChanged(const InteractionEvent *interactionEvent, Point3D &center);
/**
* @brief Checks if the mouse pointer is over the object.
*/
virtual bool CheckOverObject(const InteractionEvent *);
/**
* @brief Checks if the mouse pointer is over one of the assigned handles.
*/
virtual bool CheckOverHandles(const InteractionEvent *interactionEvent);
/**
* @brief Called if the mouse pointer is over the object indicated by a color change
*/
virtual void SelectObject(StateMachineAction *, InteractionEvent *);
/**
* @brief Called if the mouse pointer leaves the area of the object
*/
virtual void DeselectObject(StateMachineAction *, InteractionEvent *);
/**
* @brief Called if the mouse pointer is over one of the handles indicated by a color change
*/
virtual void SelectHandle(StateMachineAction *, InteractionEvent *);
/**
* @brief Performs a translation of the object relative to the mouse movement
*/
virtual void TranslateObject(StateMachineAction *, InteractionEvent *);
/**
* @brief Performs a object shape change by influencing the scaling of the initial bounding box
*/
virtual void ScaleObject(StateMachineAction *, InteractionEvent *);
- /**
- * @brief Performs a rotation of the object relative to the mouse movement
- */
- // virtual void RotateObject(StateMachineAction*, InteractionEvent* interactionEvent); /* not implemented */
-
/**
* @brief Initializes the movement, stores starting position
*/
+
virtual void InitInteraction(StateMachineAction *, InteractionEvent *interactionEvent);
+
/**
* @brief Deselects all Handles at the end of interaction
*/
virtual void DeselectHandles(StateMachineAction *, InteractionEvent *interactionEvent);
+
/**
* @brief Restore default properties of bounding box and handles
*/
virtual void RestoreNodeProperties();
+
/**
* @brief Initializes member variables.
*/
bool InitMembers(InteractionEvent *interactionEvent);
private:
/**
* @brief Enables default crosshair properties
*/
void EnableCrosshairNavigation();
+
/**
* @brief Sets limited crosshair properties (disable crosshair movement)
*/
void DisableCrosshairNavigation();
class Impl;
Impl *m_Impl;
};
}
#endif
diff --git a/Modules/BoundingShape/include/mitkBoundingShapeObjectFactory.h b/Modules/BoundingShape/include/mitkBoundingShapeObjectFactory.h
index d9ed224c45..32d137ba62 100644
--- a/Modules/BoundingShape/include/mitkBoundingShapeObjectFactory.h
+++ b/Modules/BoundingShape/include/mitkBoundingShapeObjectFactory.h
@@ -1,48 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkBoundingShapeObjectFactory_h
#define mitkBoundingShapeObjectFactory_h
#include <MitkBoundingShapeExports.h>
#include <mitkCoreObjectFactoryBase.h>
namespace mitk
{
class MITKBOUNDINGSHAPE_EXPORT BoundingShapeObjectFactory : public CoreObjectFactoryBase
{
public:
- mitkClassMacro(BoundingShapeObjectFactory, CoreObjectFactoryBase) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(BoundingShapeObjectFactory, CoreObjectFactoryBase);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
Mapper::Pointer CreateMapper(DataNode *node, MapperSlotId slotId) override;
void SetDefaultProperties(DataNode *node) override;
const char *GetFileExtensions() override;
CoreObjectFactoryBase::MultimapType GetFileExtensionsMap() override;
const char *GetSaveFileExtensions() override;
CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap() override;
const char *GetDescription() const override;
protected:
BoundingShapeObjectFactory();
~BoundingShapeObjectFactory() override;
void CreateFileExtensionsMap();
private:
MultimapType m_FileExtensionsMap;
MultimapType m_SaveFileExtensionsMap;
};
MITKBOUNDINGSHAPE_EXPORT void RegisterBoundingShapeObjectFactory();
}
#endif
diff --git a/Modules/BoundingShape/include/mitkBoundingShapeVtkMapper2D.h b/Modules/BoundingShape/include/mitkBoundingShapeVtkMapper2D.h
index fd4a687dfd..f3eebac5e3 100644
--- a/Modules/BoundingShape/include/mitkBoundingShapeVtkMapper2D.h
+++ b/Modules/BoundingShape/include/mitkBoundingShapeVtkMapper2D.h
@@ -1,82 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkBoundingShapeVtkMapper2D_h
#define mitkBoundingShapeVtkMapper2D_h
#include <mitkVtkMapper.h>
#include <MitkBoundingShapeExports.h>
#include <vtkActor2D.h>
#include <vtkCutter.h>
#include <vtkPlane.h>
#include <vtkPolyDataMapper2D.h>
#include <vtkPropAssembly.h>
#include <vtkSmartPointer.h>
#include <vtkSphereSource.h>
namespace mitk
{
class MITKBOUNDINGSHAPE_EXPORT BoundingShapeVtkMapper2D final : public VtkMapper
{
class LocalStorage : public Mapper::BaseLocalStorage
{
public:
LocalStorage();
~LocalStorage() override;
bool IsUpdateRequired(mitk::BaseRenderer *renderer, mitk::Mapper *mapper, mitk::DataNode *dataNode);
vtkSmartPointer<vtkActor> m_Actor;
vtkSmartPointer<vtkActor2D> m_HandleActor;
vtkSmartPointer<vtkActor2D> m_SelectedHandleActor;
vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
vtkSmartPointer<vtkPolyDataMapper2D> m_HandleMapper;
vtkSmartPointer<vtkPolyDataMapper2D> m_SelectedHandleMapper;
vtkSmartPointer<vtkCutter> m_Cutter;
vtkSmartPointer<vtkPlane> m_CuttingPlane;
unsigned int m_LastSliceNumber;
std::vector<vtkSmartPointer<vtkSphereSource>> m_Handles;
vtkSmartPointer<vtkPropAssembly> m_PropAssembly;
double m_ZoomFactor;
private:
LocalStorage(const LocalStorage &);
LocalStorage &operator=(const LocalStorage &);
};
public:
static void SetDefaultProperties(DataNode *node, BaseRenderer *renderer = nullptr, bool overwrite = false);
mitkClassMacro(BoundingShapeVtkMapper2D, VtkMapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void ApplyColorAndOpacityProperties(BaseRenderer *, vtkActor *) override;
vtkProp *GetVtkProp(BaseRenderer *renderer) override;
private:
BoundingShapeVtkMapper2D();
~BoundingShapeVtkMapper2D() override;
BoundingShapeVtkMapper2D(const Self &);
Self &operator=(const Self &);
void GenerateDataForRenderer(BaseRenderer *renderer) override;
void Update(mitk::BaseRenderer *renderer) override;
class Impl;
Impl *m_Impl;
};
}
#endif
diff --git a/Modules/BoundingShape/include/mitkBoundingShapeVtkMapper3D.h b/Modules/BoundingShape/include/mitkBoundingShapeVtkMapper3D.h
index 955b4bd0f8..4e800576b0 100644
--- a/Modules/BoundingShape/include/mitkBoundingShapeVtkMapper3D.h
+++ b/Modules/BoundingShape/include/mitkBoundingShapeVtkMapper3D.h
@@ -1,52 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkBoundingShapeVtkMapper3D_h
#define mitkBoundingShapeVtkMapper3D_h
#include <MitkBoundingShapeExports.h>
#include <mitkVtkMapper.h>
#include <vtkPropAssembly.h>
#include <vtkSmartPointer.h>
#include <vtkSphereSource.h>
namespace mitk
{
class MITKBOUNDINGSHAPE_EXPORT BoundingShapeVtkMapper3D : public VtkMapper
{
public:
static void SetDefaultProperties(DataNode *node, BaseRenderer *renderer = nullptr, bool overwrite = false);
- mitkClassMacro(BoundingShapeVtkMapper3D, VtkMapper) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(BoundingShapeVtkMapper3D, VtkMapper);
+
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
void ApplyColorAndOpacityProperties(BaseRenderer *, vtkActor *) override;
void ApplyBoundingShapeProperties(BaseRenderer *renderer, vtkActor *);
vtkProp *GetVtkProp(BaseRenderer *renderer) override;
// virtual void UpdateVtkTransform(mitk::BaseRenderer* renderer) override;
protected:
void GenerateDataForRenderer(BaseRenderer *renderer) override;
private:
BoundingShapeVtkMapper3D();
~BoundingShapeVtkMapper3D() override;
BoundingShapeVtkMapper3D(const Self &);
Self &operator=(const Self &);
class Impl;
Impl *m_Impl;
};
}
#endif
diff --git a/Modules/CEST/include/mitkCESTImageNormalizationFilter.h b/Modules/CEST/include/mitkCESTImageNormalizationFilter.h
index 3814a174f1..1da0835b2e 100644
--- a/Modules/CEST/include/mitkCESTImageNormalizationFilter.h
+++ b/Modules/CEST/include/mitkCESTImageNormalizationFilter.h
@@ -1,84 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkCESTImageNormalizationFilter_h
#define __mitkCESTImageNormalizationFilter_h
#include <MitkCESTExports.h>
// MITK
#include "mitkImageToImageFilter.h"
namespace mitk
{
/** \brief Normalization filter for CEST images.
*
* This filter can be used to normalize CEST images, it only works with 4D images and assumes that the input
* mitk::Image has a property called mitk::CustomTagParser::m_OffsetsPropertyName, whith offsets separated by
* spaces. The number of offsets has to match the number of timesteps.
*
* Each timestep with a corresponding offset greater than 299 or less than -299 will be interpreted as normalization (M0) image.
* If only one M0 image is present normalization will be done by dividing the voxel value by the corresponding
* M0 voxel value. If multiple M0 images are present normalization between any two M0 images will be done by
* dividing by a linear interpolation between the two.
* The M0 images themselves will be removed from the result.
* The output image will have the same 3D geometry as the input image, a time geometry only consisting of non M0 images and a double pixel type.
*/
class MITKCEST_EXPORT CESTImageNormalizationFilter : public ImageToImageFilter
{
public:
mitkClassMacro(CESTImageNormalizationFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
protected:
/*!
\brief standard constructor
*/
CESTImageNormalizationFilter();
/*!
\brief standard destructor
*/
~CESTImageNormalizationFilter() override;
/*!
\brief Method generating the output information of this filter (e.g. image dimension, image type, etc.).
The interface ImageToImageFilter requires this implementation. Everything is taken from the input image.
*/
void GenerateOutputInformation() override;
/*!
\brief Method generating the output of this filter. Called in the updated process of the pipeline.
This method generates the normalized output image.
*/
void GenerateData() override;
/** Internal templated method that normalizes across timesteps
*/
template <typename TPixel, unsigned int VImageDimension>
void NormalizeTimeSteps(const itk::Image<TPixel, VImageDimension>* image);
/// Offsets without M0s
std::string m_RealOffsets;
/// non M0 indices
std::vector< unsigned int > m_NonM0Indices;
};
/** This helper function can be used to check if an image was already normalized.
* The function assumes that an image that is not normalized is indicated by the following properties:
* - mitk::Image has a property called mitk::CEST_PROPERTY_NAME_OFFSETS, with offsets separated by spaces.
* - The number of offsets has to match the number of timesteps.
* - At least one of the offsets is a normalization (M0) image. M0 are indicated by offsets greater than 299 or less than -299.
*/
MITKCEST_EXPORT bool IsNotNormalizedCESTImage(const Image* cestImage);
} // END mitk namespace
#endif
diff --git a/Modules/CameraCalibration/mitkCameraIntrinsics.h b/Modules/CameraCalibration/mitkCameraIntrinsics.h
index ea2eea8c55..a6004b8960 100644
--- a/Modules/CameraCalibration/mitkCameraIntrinsics.h
+++ b/Modules/CameraCalibration/mitkCameraIntrinsics.h
@@ -1,141 +1,141 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkCameraIntrinsics_h
#define mitkCameraIntrinsics_h
#include <mitkCommon.h>
#include <mitkNumericTypes.h>
#include <itkDataObject.h>
#include <itkFastMutexLock.h>
#include <vnl/vnl_matrix_fixed.h>
#include "mitkXMLSerializable.h"
#include <MitkCameraCalibrationExports.h>
#include "opencv2/core.hpp"
int mitkCameraIntrinsicsTest(int, char* []);
namespace mitk
{
///
/// \brief class representing camera intrinsics and related functions
///
class MITKCAMERACALIBRATION_EXPORT CameraIntrinsics: virtual public itk::Object,
virtual public mitk::XMLSerializable
{
public:
///
/// for testing purposes
///
friend int mitkCameraIntrinsicsTest(int argc, char* argv[]);
///
/// smartpointer typedefs
///
mitkClassMacroItkParent(CameraIntrinsics, itk::Object);
///
/// the static new function
///
itkFactorylessNewMacro(Self);
///
/// make a clone of this intrinsics
///
- itkCloneMacro(Self)
+ itkCloneMacro(Self);
///
/// copy information from other to this
///
void Copy(const CameraIntrinsics* other);
///
/// checks two intrinsics for equality
///
bool Equals( const CameraIntrinsics* other ) const;
///
/// \return the intrinsic parameter matrix as a 3x3 vnl matrix
///
vnl_matrix_fixed<mitk::ScalarType, 3, 3> GetVnlCameraMatrix() const;
///
/// \return the intrinsic parameter matrix as a 3x4 vnl matrix
/// (the last column only containing zeros)
///
vnl_matrix_fixed<mitk::ScalarType, 3, 4> GetVnlCameraMatrix3x4() const;
///
/// \return true if the intrinsics are set (some plausibility checks
/// may be done here)
///
bool IsValid() const;
void SetValid(bool valid);
cv::Mat GetCameraMatrix() const;
cv::Mat GetDistorsionCoeffs();
cv::Mat GetDistorsionCoeffs() const;
void ToXML(TiXmlElement* elem) const override;
std::string ToString() const;
std::string GetString();
double GetFocalLengthX() const;
double GetFocalLengthY() const;
double GetPrincipalPointX() const;
double GetPrincipalPointY() const;
mitk::Point4D GetDistorsionCoeffsAsPoint4D() const;
mitk::Point3D GetFocalPoint() const;
mitk::Point3D GetPrincipalPoint() const;
vnl_vector_fixed<mitk::ScalarType, 2> GetFocalPointAsVnlVector() const;
vnl_vector_fixed<mitk::ScalarType, 2> GetPrincipalPointAsVnlVector() const;
///
/// set a new camera matrix utilizing a vnl matrix
///
void SetCameraMatrix( const vnl_matrix_fixed<mitk::ScalarType, 3, 3>&
_CameraMatrix );
void SetIntrinsics( const cv::Mat& _CameraMatrix
, const cv::Mat& _DistorsionCoeffs);
void SetFocalLength( double x, double y );
void SetPrincipalPoint( double x, double y );
void SetDistorsionCoeffs( double k1, double k2, double p1, double p2 );
void SetIntrinsics( const mitk::Point3D& focalPoint,
const mitk::Point3D& principalPoint,
const mitk::Point4D& distortionCoefficients);
void FromXML(TiXmlElement* elem) override;
void FromGMLCalibrationXML(TiXmlElement* elem);
std::string ToOctaveString(const std::string& varName="CameraIntrinsics");
~CameraIntrinsics() override;
protected:
CameraIntrinsics();
CameraIntrinsics(const CameraIntrinsics& other);
cv::Mat m_CameraMatrix;
cv::Mat m_DistorsionCoeffs;
bool m_Valid;
itk::FastMutexLock::Pointer m_Mutex;
private:
itk::LightObject::Pointer InternalClone() const override;
};
} // namespace mitk
MITKCAMERACALIBRATION_EXPORT std::ostream& operator<<
(std::ostream& os, mitk::CameraIntrinsics::Pointer p);
#endif // mitkCameraIntrinsics_h
diff --git a/Modules/CameraCalibration/mitkCameraIntrinsicsProperty.h b/Modules/CameraCalibration/mitkCameraIntrinsicsProperty.h
index 955b31a504..d44adbea92 100644
--- a/Modules/CameraCalibration/mitkCameraIntrinsicsProperty.h
+++ b/Modules/CameraCalibration/mitkCameraIntrinsicsProperty.h
@@ -1,72 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKCAMERAINTRINSICSPROPERTY_H
#define MITKCAMERAINTRINSICSPROPERTY_H
#include "mitkBaseProperty.h"
#include "mitkCameraIntrinsics.h"
namespace mitk {
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4522)
#endif
class MITKCAMERACALIBRATION_EXPORT CameraIntrinsicsProperty : public BaseProperty
{
public:
typedef mitk::CameraIntrinsics::Pointer ValueType;
mitkClassMacro(CameraIntrinsicsProperty, BaseProperty);
- itkFactorylessNewMacro(Self)
+ itkFactorylessNewMacro(Self);
+
itkCloneMacro(Self)
mitkNewMacro1Param(CameraIntrinsicsProperty, mitk::CameraIntrinsics::Pointer);
itkSetMacro(Value, mitk::CameraIntrinsics::Pointer );
itkGetConstMacro(Value, mitk::CameraIntrinsics::Pointer );
std::string GetValueAsString() const override;
using BaseProperty::operator=;
protected:
mitk::CameraIntrinsics::Pointer m_Value;
CameraIntrinsicsProperty();
CameraIntrinsicsProperty(const CameraIntrinsicsProperty&);
CameraIntrinsicsProperty( mitk::CameraIntrinsics::Pointer value );
private:
// purposely not implemented
CameraIntrinsicsProperty& operator=(const CameraIntrinsicsProperty&);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty& property) const override;
bool Assign(const BaseProperty& property) override;
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
} // namespace mitk
#endif // MITKCAMERAINTRINSICSPROPERTY_H
diff --git a/Modules/CameraCalibration/mitkNavigationDataHandEyeCalibrationFilter.h b/Modules/CameraCalibration/mitkNavigationDataHandEyeCalibrationFilter.h
index 0440f5ea29..e65dfc6b51 100644
--- a/Modules/CameraCalibration/mitkNavigationDataHandEyeCalibrationFilter.h
+++ b/Modules/CameraCalibration/mitkNavigationDataHandEyeCalibrationFilter.h
@@ -1,92 +1,93 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKNavigationDataHandEyeCalibrationFilter_H_HEADER_INCLUDED_
#define MITKNavigationDataHandEyeCalibrationFilter_H_HEADER_INCLUDED_
#include "mitkNavigationDataToNavigationDataFilter.h"
#include "mitkNavigationData.h"
#include "mitkBaseData.h"
#include "mitkTransform.h"
#include "itkQuaternionRigidTransform.h"
namespace mitk {
/**
* \brief IGT filter applying a Hand-Eye transformation to a given BaseData according to the current NavigationDataTransformation.
* The resulting BaseData is then given in tracking coordinates.
*
* Inputs: NavigationData(s), object(s) to transform (BaseData), hand-eye transformation (itk::QuaternionRigidTransform)
*
* Derived from NavigationDataToNavigationDataFilter
*
* \ingroup IGT
*/
class MITKCAMERACALIBRATION_EXPORT NavigationDataHandEyeCalibrationFilter : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro(NavigationDataHandEyeCalibrationFilter, NavigationDataToNavigationDataFilter);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/*!
\brief transformation type for itk::QuaternionRigidTransforms
*/
typedef itk::QuaternionRigidTransform<ScalarType> QuaternionRigidTransformType;
/**
* \brief Set the object that will be transformed to tracking coordinates using the current NavigationData
* and the given transformation of the HandEyeCalibration
*
* \param index index corresponding to the NavigationData and hand-eye transformation to be applied to this BaseData
* \param data BaseData to be associated to the index
*/
void SetObjectToTransform(unsigned int index, BaseData* data);
/**
* \brief Set the transformation of the HandEyeCalibration that should be applied to the BaseData
* with the current transformation of the Navigation Data
*
* \param index index corresponding to the NavigationData applied with this hand-eye transformation
* \param handEyeTransform transformation of a previously performed hand-eye calibration corresponding to the NavigationData
* at index
*/
void SetHandEyeTransformation(unsigned int index, Transform::Pointer handEyeTransform);
/*
* \brief Transfer the information from the input to the associated BaseData
*/
void GenerateData() override;
protected:
/**
* \brief Constructor
**/
NavigationDataHandEyeCalibrationFilter();
/**
* \brief Destructor
**/
~NavigationDataHandEyeCalibrationFilter() override;
/**
* \brief Map of the BaseDatas that should be transformed.
*/
std::map<int,BaseData::Pointer> m_ObjectsToTransform;
/**
* \brief Map of the hand-eye transformations that should be applied to the BaseDatas
*/
std::map<int,Transform::Pointer> m_HandEyeTransformations;
};
} // namespace mitk
#endif /* MITKNavigationDataHandEyeCalibrationFilter_H_HEADER_INCLUDED_ */
diff --git a/Modules/Classification/CLCore/include/mitkAbstractClassifier.h b/Modules/Classification/CLCore/include/mitkAbstractClassifier.h
index 8233082aaa..d35f62d2b9 100644
--- a/Modules/Classification/CLCore/include/mitkAbstractClassifier.h
+++ b/Modules/Classification/CLCore/include/mitkAbstractClassifier.h
@@ -1,195 +1,195 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkAbstractClassifier_h
#define mitkAbstractClassifier_h
#include <MitkCLCoreExports.h>
#include <mitkBaseData.h>
// Eigen
#include <Eigen/Dense>
// STD Includes
// MITK includes
#include <mitkConfigurationHolder.h>
namespace mitk
{
class MITKCLCORE_EXPORT AbstractClassifier : public BaseData
{
public:
- mitkClassMacro(AbstractClassifier,BaseData)
+ mitkClassMacro(AbstractClassifier,BaseData);
///
/// @brief Build a forest of trees from the training set (X, y).
/// @param X, The training input samples. Matrix of shape = [n_samples, n_features]
/// @param Y, The target values (class labels in classification, real numbers in regression). Matrix of shape = [n_samples, 1]
///
virtual void Train(const Eigen::MatrixXd &X, const Eigen::MatrixXi &Y) = 0;
///
/// @brief Predict class for X.
/// @param X, The input samples.
/// @return The predicted classes. Y matrix of shape = [n_samples, 1]
///
virtual Eigen::MatrixXi Predict(const Eigen::MatrixXd &X) = 0;
///
/// @brief GetPointWiseWeightCopy
/// @return return label matrix of shape = [n_samples , 1]
///
Eigen::MatrixXi & GetLabels()
{
return m_OutLabel;
}
protected:
Eigen::MatrixXi m_OutLabel;
public:
// * --------------- *
// PointWiseWeight
// * --------------- *
///
/// @brief SupportsPointWiseWeight
/// @return True if the classifier supports pointwise weighting else false
///
virtual bool SupportsPointWiseWeight() = 0;
///
/// @brief GetPointWiseWeightCopy
/// @return Create and return a copy of W
///
virtual Eigen::MatrixXd & GetPointWiseWeight()
{
return m_PointWiseWeight;
}
///
/// @brief SetPointWiseWeight
/// @param W, The pointwise weights. W matrix of shape = [n_samples, 1]
///
virtual void SetPointWiseWeight(const Eigen::MatrixXd& W)
{
this->m_PointWiseWeight = W;
}
///
/// @brief UsePointWiseWeight
/// @param toggle weighting on/off
///
virtual void UsePointWiseWeight(bool value)
{
this->m_IsUsingPointWiseWeight = value;
}
///
/// @brief IsUsingPointWiseWeight
/// @return true if pointewise weighting is enabled.
///
virtual bool IsUsingPointWiseWeight()
{
return this->m_IsUsingPointWiseWeight;
}
protected:
Eigen::MatrixXd m_PointWiseWeight;
bool m_IsUsingPointWiseWeight;
// * --------------- *
// PointWiseProbabilities
// * --------------- *
public:
///
/// @brief SupportsPointWiseProbability
/// @return True if the classifier supports pointwise class probability calculation else false
///
virtual bool SupportsPointWiseProbability() = 0;
///
/// @brief GetPointWiseWeightCopy
/// @return return probability matrix
///
virtual Eigen::MatrixXd & GetPointWiseProbabilities()
{
return m_OutProbability;
}
///
/// \brief UsePointWiseProbabilities
/// \param value
///
virtual void UsePointWiseProbability(bool value)
{
m_IsUsingPointWiseProbability = value;
}
///
/// \brief IsUsingPointWiseProbabilities
/// \return
///
virtual bool IsUsingPointWiseProbability()
{
return m_IsUsingPointWiseProbability;
}
protected:
Eigen::MatrixXd m_OutProbability;
bool m_IsUsingPointWiseProbability;
private:
void MethodForBuild();
public:
void SetNthItems(const char *val, unsigned int idx);
std::string GetNthItems(unsigned int idx) const;
void SetItemList(std::vector<std::string>);
std::vector<std::string> GetItemList() const;
#ifndef DOXYGEN_SKIP
void SetRequestedRegionToLargestPossibleRegion() override{}
bool RequestedRegionIsOutsideOfTheBufferedRegion() override{return true;}
bool VerifyRequestedRegion() override{return false;}
void SetRequestedRegion(const itk::DataObject* /*data*/) override{}
// Override
bool IsEmpty() const override
{
if(IsInitialized() == false)
return true;
const TimeGeometry* timeGeometry = const_cast<AbstractClassifier*>(this)->GetUpdatedTimeGeometry();
if(timeGeometry == nullptr)
return true;
return false;
}
#endif // Skip Doxygen
};
}
#endif //mitkAbstractClassifier_h
diff --git a/Modules/Classification/CLCore/include/mitkAbstractGlobalImageFeature.h b/Modules/Classification/CLCore/include/mitkAbstractGlobalImageFeature.h
index 6017dbba27..a8fcb05fac 100644
--- a/Modules/Classification/CLCore/include/mitkAbstractGlobalImageFeature.h
+++ b/Modules/Classification/CLCore/include/mitkAbstractGlobalImageFeature.h
@@ -1,291 +1,291 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkAbstractGlobalImageFeature_h
#define mitkAbstractGlobalImageFeature_h
#include <MitkCLCoreExports.h>
#include <mitkBaseData.h>
#include <mitkImage.h>
#include <mitkCommandLineParser.h>
#include <mitkIntensityQuantifier.h>
// STD Includes
// Eigen
#include <Eigen/Dense>
// MITK includes
#include <mitkConfigurationHolder.h>
namespace mitk
{
/**
*
*
* ## Histogram Configuration ##
* Most Feature Generation Classes that use histograms use the same parameters and
* initialization logic. In general, all information can be passed either by the corresponding
* Setter (which does not differenciate between global setting and feature specific setting) and
* a parameter object which can be obtained from the command line arguments, for example.
*
* If the image values are used for the initializiation of the histogram, it can be defined
* whether the whole image is used or only the masked areas to find minima and maxima. This is
* done by the option <b>SetIgnoreMask</b> or the corrsponding options
* <b>-NAME::ignore-mask-for-histogram</b> and <b>-ignore-mask-for-histogram</b>. If these are
* true, the whole image is used for the calculation.
*
* Depending on the passed arguments, different initialization methods are used. The initialization
* is in the following order:
* - If <b>Minimum Intensity</b>, <b>Maximum Intensity</b>, and <b>Binsize</b>: The histogram is
* initialized between the minimum and maximum intensity. the number of bins is determined by the
* binsize. If the distance between minimum and maximum is not a multiple of the binsize, the maximum
* is increase so that it is.
* - <b>Minimum Intensity</b>, <b>Bins</b>, and <b>Binsize</b>: The histogram is initialized with the
* given binsize, and the intensity range from the minimum to \f$maximum = minimum + binsize*bins\f$.
* - <b>Minimum Intensity</b>, <b>Maximum Intensity</b>, and <b>Bins</b>: The histogram is initialized
* between the given minimum and maximum intensity. The binsize is calculated so that the number
* of bins is equal to the given number of bins.
* - <b>Binsize</b>, and <b>Minimum Intensity</b>: The maximum is set to the maximum that
* occur in the given image. Depending if the mask is considered or not, either only masked voxels or
* the whole image is used for the calculation. The initialization is then equal as if the minimum
* and maximum would have been given right from the beginning.
* - <b>Binsize</b>, and <b>Maximum Intensity</b>: The minimum intensity is set to the minimum that
* occur in the given image. Depending if the mask is considered or not, either only masked voxels or
* the whole image is used for the calculation. The initialization is then equal as if the minimum
* and maximum would have been given right from the beginning.
* - <b>Binsize</b>: The maximum and the minimum intensity is set to the minimum and maximum that
* occur in the given image. Depending if the mask is considered or not, either only masked voxels or
* the whole image is used for the calculation. The initialization is then equal as if the minimum
* and maximum would have been given right from the beginning.
* - <b>Bins</b>, and <b>Minimum Intensity</b>: The maximum is calculated from the image. Depending
* if the mask is considered or not, either only masked voxels or the whole image is used for the calculation. The histogram is
* then initialized as if these values would have been given as minimum and maximum intensity.
* - <b>Bins</b>, and <b>Maximum Intensity</b>: The minimum is calculated from the image. Depending
* if the mask is considered or not, either only masked voxels or the whole image is used for the calculation. The histogram is
* then initialized as if these values would have been given as minimum and maximum intensity.
* - <b>Bins</b>: The minimum and the maximum is calculated from the image. Depending
* if the mask is considered or not, either only masked voxels or * the whole image is used for the calculation. The histogram is
* then initialized as if these values would have been given as minimum and maximum intensity.
* - <b>No Parameter given</b>:The minimum and maximum intensity from the whole image or masked image is calculated and
* the histogram then initialized to this with a standard number of bins (Is set by each filter on its own.)
*
* ### Remark about command line parameter####
* There are generally two options to set a parameter via the command line. A global one that works for
* all filters that use histograms and a local one that set this parameter specific for this filter. The
* local parameters start with the filter name (Indiciated by NAME) followed by two colons, for example
* <b>vol::min</b> to set the minimum intensity for the volume filter. The global parameter is overwritten
* by the local parameter, if it is specified. Otherwise, it is still valid. If this prevents the specification
* of an histogram initialization method (for example, because the binsize is globally specified but the histogram
* should be initialized using a fixed numbe of bins), the parameter <b>NAME::ignore-global-histogram</b> can be passed.
* Then, all global histogram parameters are ignored and only local ones are used.
*
* The maximum intensity can be set by different command line parameters: global for all filters that use histograms
* by <b>-minimum-intensity</b> and <b>-minimum</b>. Alternative it can be set only for this filter by
* <b>-NAME::minimum</b> and <b>-NAME::min</b>.
*
* The minimum intensity can be set by different command line parameters: global for all filters that use histograms
* by <b>-maximum-intensity</b> and <b>-maximum</b>. Alternative it can be set only for this filter by
* <b>\NAME::maximum</b> and <b>NAME::max</b>.
*
* The binsize can be set by different command line parameters: global for all filters that use histograms
* by <b>-binsize</b>. Alternative it can be set only for this filter by
* <b>\NAME::binsize</b>.
*
* The number of bins can be set by different command line parameters: global for all filters that use histograms
* by <b>-bins</b>. Alternative it can be set only for this filter by
* <b>\NAME::bins</b>.
* ### Note to the developers ###
* All features are supposed to work the same way if a histogram is used somewhere in
* the code. For this, each derived class that makes use of a histogram should use
* the Quantifier object. In order to use this object correctly, the AddArguments-Function should
* contain the line <b>AddQuantifierArguments(parser);</b>, the CalculateFeaturesUsingParameters function
* should contain the line <b>InitializeQuantifierFromParameters(feature, mask);</b> and the CalculateFeatures function
* sould contain the line <b>InitializeQuantifier(image, mask);</b>. These function
* calls ensure that the necessary options are given to the configuration file, and that the initialization
* of the quantifier is done correctly. This ensures an consistend behavior over all FeatureGeneration Classes.
*
*/
class MITKCLCORE_EXPORT AbstractGlobalImageFeature : public BaseData
{
public:
- mitkClassMacro(AbstractGlobalImageFeature, BaseData)
+ mitkClassMacro(AbstractGlobalImageFeature, BaseData);
typedef std::vector< std::pair<std::string, double> > FeatureListType;
typedef std::vector< std::string> FeatureNameListType;
typedef std::map<std::string, us::Any> ParameterTypes;
/**
* \brief Calculates the feature of this abstact interface. Does not necessarily considers the parameter settings.
*/
virtual FeatureListType CalculateFeatures(const Image::Pointer & feature, const Image::Pointer &mask) = 0;
/**
* \brief Calculates the given feature Slice-wise. Might not be availble for an individual filter!
*/
FeatureListType CalculateFeaturesSlicewise(const Image::Pointer & feature, const Image::Pointer &mask, int sliceID);
/**
* \brief Calculates the feature of this abstact interface. Does not necessarily considers the parameter settings.
*/
virtual void CalculateFeaturesSliceWiseUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, int sliceID, FeatureListType &featureList);
/**
* \brief Calculates the feature of this abstact interface. Does not necessarily considers the parameter settings.
*/
virtual void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) = 0;
/**
* \brief Returns a list of the names of all features that are calculated from this class
*/
virtual FeatureNameListType GetFeatureNames() = 0;
/**
* \brief Adds an additional Separator to the name of the feature, which encodes the used parameters
*/
virtual std::string GetCurrentFeatureEncoding();
/**
* \brief Returns a string that encodes the feature class name.
*
* This Feature returns a string that should be put before every other feature
* value. It has the format [<Prefix>::]<Feature Class Name>::[<Parameter Encoding>::].
* The options <Prefix> and <Parameter Encoding> are only added, if the corresponding
* options are set.
*/
std::string FeatureDescriptionPrefix();
itkSetMacro(Prefix, std::string);
itkSetMacro(ShortName, std::string);
itkSetMacro(LongName, std::string);
itkSetMacro(FeatureClassName, std::string);
itkSetMacro(Direction, int);
void SetParameter(ParameterTypes param) { m_Parameter=param; };
itkGetConstMacro(Prefix, std::string);
itkGetConstMacro(ShortName, std::string);
itkGetConstMacro(LongName, std::string);
itkGetConstMacro(FeatureClassName, std::string);
itkGetConstMacro(Parameter, ParameterTypes);
itkSetMacro(UseQuantifier, bool);
itkGetConstMacro(UseQuantifier, bool);
itkSetMacro(Quantifier, IntensityQuantifier::Pointer);
itkGetMacro(Quantifier, IntensityQuantifier::Pointer);
itkGetConstMacro(Direction, int);
itkSetMacro(MinimumIntensity, double);
itkSetMacro(UseMinimumIntensity, bool);
itkSetMacro(MaximumIntensity, double);
itkSetMacro(UseMaximumIntensity, bool);
itkGetConstMacro(MinimumIntensity, double);
itkGetConstMacro(UseMinimumIntensity, bool);
itkGetConstMacro(MaximumIntensity, double);
itkGetConstMacro(UseMaximumIntensity, bool);
itkSetMacro(Binsize, double);
itkSetMacro(UseBinsize, bool);
itkGetConstMacro(Binsize, double);
itkGetConstMacro(UseBinsize, bool);
itkSetMacro(MorphMask, mitk::Image::Pointer);
itkGetConstMacro(MorphMask, mitk::Image::Pointer);
itkSetMacro(Bins, int);
itkSetMacro(UseBins, bool);
itkGetConstMacro(UseBins, bool);
itkGetConstMacro(Bins, int);
itkSetMacro(IgnoreMask, bool);
itkGetConstMacro(IgnoreMask, bool);
itkSetMacro(EncodeParameters, bool);
itkGetConstMacro(EncodeParameters, bool);
std::string GetOptionPrefix() const
{
if (m_Prefix.length() > 0)
return m_Prefix + "::" + m_ShortName;
return m_ShortName;
}
virtual void AddArguments(mitkCommandLineParser &parser) = 0;
std::vector<double> SplitDouble(std::string str, char delimiter);
void AddQuantifierArguments(mitkCommandLineParser &parser);
void InitializeQuantifierFromParameters(const Image::Pointer & feature, const Image::Pointer &mask,unsigned int defaultBins = 256);
void InitializeQuantifier(const Image::Pointer & feature, const Image::Pointer &mask, unsigned int defaultBins = 256);
std::string QuantifierParameterString();
public:
//#ifndef DOXYGEN_SKIP
void SetRequestedRegionToLargestPossibleRegion() override {};
bool RequestedRegionIsOutsideOfTheBufferedRegion() override { return true; };
bool VerifyRequestedRegion() override { return false; };
void SetRequestedRegion (const itk::DataObject * /*data*/) override {};
// Override
bool IsEmpty() const override
{
if(IsInitialized() == false)
return true;
const TimeGeometry* timeGeometry = const_cast<AbstractGlobalImageFeature*>(this)->GetUpdatedTimeGeometry();
if(timeGeometry == nullptr)
return true;
return false;
}
private:
std::string m_Prefix; // Prefix before all input parameters
std::string m_ShortName; // Name of all variables
std::string m_LongName; // Long version of the name (For turning on)
std::string m_FeatureClassName;
ParameterTypes m_Parameter; // Parameter setting
bool m_UseQuantifier = false;
IntensityQuantifier::Pointer m_Quantifier;
double m_MinimumIntensity = 0;
bool m_UseMinimumIntensity = false;
double m_MaximumIntensity = 100;
bool m_UseMaximumIntensity = false;
bool m_EncodeParameters = false;
double m_Binsize = 1;
bool m_UseBinsize = false;
int m_Bins = 256;
bool m_UseBins = true;
int m_Direction = 0;
bool m_IgnoreMask = false;
bool m_CalculateWithParameter = false;
mitk::Image::Pointer m_MorphMask = nullptr;
//#endif // Skip Doxygen
};
}
#endif //mitkAbstractGlobalImageFeature_h
diff --git a/Modules/Classification/CLCore/include/mitkIntensityQuantifier.h b/Modules/Classification/CLCore/include/mitkIntensityQuantifier.h
index d94494c598..88dd5b694f 100644
--- a/Modules/Classification/CLCore/include/mitkIntensityQuantifier.h
+++ b/Modules/Classification/CLCore/include/mitkIntensityQuantifier.h
@@ -1,91 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkIntensityQuantifier_h
#define mitkIntensityQuantifier_h
#include <MitkCLCoreExports.h>
#include <mitkBaseData.h>
#include <mitkImage.h>
namespace mitk
{
class MITKCLCORE_EXPORT IntensityQuantifier : public BaseData
{
public:
- mitkClassMacro(IntensityQuantifier, BaseData)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(IntensityQuantifier, BaseData);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
IntensityQuantifier();
void InitializeByMinimumMaximum(double minimum, double maximum, unsigned int bins);
void InitializeByBinsizeAndBins(double minimum, unsigned int bins, double binsize);
void InitializeByBinsizeAndMaximum(double minimum, double maximum, double binsize);
void InitializeByImage(mitk::Image::Pointer image, unsigned int bins);
void InitializeByImageAndMaximum(mitk::Image::Pointer image, double maximum, unsigned int bins);
void InitializeByImageAndMinimum(mitk::Image::Pointer image, double minimum, unsigned int bins);
void InitializeByImageRegion(mitk::Image::Pointer image, mitk::Image::Pointer mask, unsigned int bins);
void InitializeByImageRegionAndMinimum(mitk::Image::Pointer image, mitk::Image::Pointer mask, double minimum, unsigned int bins);
void InitializeByImageRegionAndMaximum(mitk::Image::Pointer image, mitk::Image::Pointer mask, double maximum, unsigned int bins);
void InitializeByImageAndBinsize(mitk::Image::Pointer image, double binsize);
void InitializeByImageAndBinsizeAndMinimum(mitk::Image::Pointer image, double minimum, double binsize);
void InitializeByImageAndBinsizeAndMaximum(mitk::Image::Pointer image, double maximum, double binsize);
void InitializeByImageRegionAndBinsize(mitk::Image::Pointer image, mitk::Image::Pointer mask, double binsize);
void InitializeByImageRegionAndBinsizeAndMinimum(mitk::Image::Pointer image, mitk::Image::Pointer mask, double minimum, double binsize);
void InitializeByImageRegionAndBinsizeAndMaximum(mitk::Image::Pointer image, mitk::Image::Pointer mask, double maximum, double binsize);
unsigned int IntensityToIndex(double intensity);
double IndexToMinimumIntensity(unsigned int index);
double IndexToMeanIntensity(unsigned int index);
double IndexToMaximumIntensity(unsigned int index);
itkGetConstMacro(Initialized, bool);
itkGetConstMacro(Bins, unsigned int);
itkGetConstMacro(Binsize, double);
itkGetConstMacro(Minimum, double);
itkGetConstMacro(Maximum, double);
public:
//#ifndef DOXYGEN_SKIP
void SetRequestedRegionToLargestPossibleRegion() override {};
bool RequestedRegionIsOutsideOfTheBufferedRegion() override { return true; };
bool VerifyRequestedRegion() override { return false; };
void SetRequestedRegion (const itk::DataObject * /*data*/) override {};
// Override
bool IsEmpty() const override
{
if(IsInitialized() == false)
return true;
const TimeGeometry* timeGeometry = const_cast<IntensityQuantifier*>(this)->GetUpdatedTimeGeometry();
if(timeGeometry == nullptr)
return true;
return false;
}
private:
bool m_Initialized;
unsigned int m_Bins;
double m_Binsize;
double m_Minimum;
double m_Maximum;
};
}
#endif //mitkIntensityQuantifier_h
diff --git a/Modules/Classification/CLLibSVM/include/mitkLibSVMClassifier.h b/Modules/Classification/CLLibSVM/include/mitkLibSVMClassifier.h
index 67ca8c2343..05aa634cb3 100644
--- a/Modules/Classification/CLLibSVM/include/mitkLibSVMClassifier.h
+++ b/Modules/Classification/CLLibSVM/include/mitkLibSVMClassifier.h
@@ -1,76 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkLibSVMClassifier_h
#define mitkLibSVMClassifier_h
#include <MitkCLLibSVMExports.h>
#include <mitkAbstractClassifier.h>
-namespace LibSVM
-{
- struct svm_parameter;
- struct svm_problem;
- struct svm_node;
- struct svm_model;
-}
+struct svm_parameter;
+struct svm_problem;
+struct svm_node;
+struct svm_model;
namespace mitk
{
class MITKCLLIBSVM_EXPORT LibSVMClassifier : public AbstractClassifier
{
public:
- mitkClassMacro(LibSVMClassifier,AbstractClassifier)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(LibSVMClassifier,AbstractClassifier);
+
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
LibSVMClassifier();
~LibSVMClassifier() override;
void Train(const Eigen::MatrixXd &X, const Eigen::MatrixXi &Y) override;
Eigen::MatrixXi Predict(const Eigen::MatrixXd &X) override;
bool SupportsPointWiseWeight() override{return true;}
bool SupportsPointWiseProbability() override{return false;}
void PrintParameter(std::ostream & str);
void ConvertParameter();
void SetSvmType(int val);
void SetProbability(int val);
void SetShrinking(int val);
void SetNrWeight(int val);
void SetNu(double val);
void SetP(double val);
void SetEps(double val);
void SetC(double val);
void SetCacheSize(double val);
void SetKernelType(int val);
void SetDegree(int val);
void SetGamma(double val);
void SetCoef0(double val);
private:
- void ReadXValues(LibSVM::svm_problem * problem, LibSVM::svm_node** xSpace, const Eigen::MatrixXd &X);
- void ReadYValues(LibSVM::svm_problem * problem, const Eigen::MatrixXi &Y);
- void ReadWValues(LibSVM::svm_problem * problem);
+ void ReadXValues(svm_problem * problem, svm_node** xSpace, const Eigen::MatrixXd &X);
+ void ReadYValues(svm_problem * problem, const Eigen::MatrixXi &Y);
+ void ReadWValues(svm_problem * problem);
- LibSVM::svm_model* m_Model;
- LibSVM::svm_parameter * m_Parameter;
+ svm_model* m_Model;
+ svm_parameter * m_Parameter;
};
}
#endif //mitkLibSVMClassifier_h
diff --git a/Modules/Classification/CLLibSVM/src/mitkLibSVMClassifier.cpp b/Modules/Classification/CLLibSVM/src/mitkLibSVMClassifier.cpp
index 0e251333f6..67f335c458 100644
--- a/Modules/Classification/CLLibSVM/src/mitkLibSVMClassifier.cpp
+++ b/Modules/Classification/CLLibSVM/src/mitkLibSVMClassifier.cpp
@@ -1,339 +1,336 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include <mitkLibSVMClassifier.h>
#include <mitkConfigurationHolder.h>
-namespace LibSVM
-{
-#include "svm.h"
-}
+#include <svm.h>
#include <mitkExceptionMacro.h>
mitk::LibSVMClassifier::LibSVMClassifier():
m_Model(nullptr),m_Parameter(nullptr)
{
- this->m_Parameter = new LibSVM::svm_parameter();
+ this->m_Parameter = new svm_parameter();
}
mitk::LibSVMClassifier::~LibSVMClassifier()
{
if (m_Model)
{
- LibSVM::svm_free_and_destroy_model(&m_Model);
+ svm_free_and_destroy_model(&m_Model);
}
if( m_Parameter)
- LibSVM::svm_destroy_param(m_Parameter);
+ svm_destroy_param(m_Parameter);
}
void mitk::LibSVMClassifier::Train(const Eigen::MatrixXd &X, const Eigen::MatrixXi &Y)
{
this->SetPointWiseWeight(Eigen::MatrixXd(Y.rows(),1));
this->UsePointWiseWeight(false);
- LibSVM::svm_node *xSpace;
- LibSVM::svm_problem problem;
+ svm_node *xSpace;
+ svm_problem problem;
ConvertParameter();
ReadYValues(&problem, Y);
ReadXValues(&problem, &xSpace,X);
ReadWValues(&problem);
const char * error_msg = nullptr;
- error_msg = LibSVM::svm_check_parameter(&problem, m_Parameter);
+ error_msg = svm_check_parameter(&problem, m_Parameter);
if (error_msg)
{
- LibSVM::svm_destroy_param(m_Parameter);
+ svm_destroy_param(m_Parameter);
free(problem.y);
free(problem.x);
free(xSpace);
mitkThrow() << "Error: " << error_msg;
}
- m_Model = LibSVM::svm_train(&problem, m_Parameter);
+ m_Model = svm_train(&problem, m_Parameter);
// free(problem.y);
// free(problem.x);
// free(xSpace);
}
Eigen::MatrixXi mitk::LibSVMClassifier::Predict(const Eigen::MatrixXd &X)
{
if ( ! m_Model)
{
mitkThrow() << "No Model is trained. Train or load a model before predicting new values.";
}
auto noOfPoints = static_cast<int>(X.rows());
auto noOfFeatures = static_cast<int>(X.cols());
Eigen::MatrixXi result(noOfPoints,1);
- auto * xVector = static_cast<LibSVM::svm_node *>(malloc(sizeof(LibSVM::svm_node) * (noOfFeatures+1)));
+ auto * xVector = static_cast<svm_node *>(malloc(sizeof(svm_node) * (noOfFeatures+1)));
for (int point = 0; point < noOfPoints; ++point)
{
for (int feature = 0; feature < noOfFeatures; ++feature)
{
xVector[feature].index = feature+1;
xVector[feature].value = X(point, feature);
}
xVector[noOfFeatures].index = -1;
- result(point,0) = LibSVM::svm_predict(m_Model,xVector);
+ result(point,0) = svm_predict(m_Model,xVector);
}
free(xVector);
return result;
}
void mitk::LibSVMClassifier::ConvertParameter()
{
// Get the proerty // Some defaults
if(!this->GetPropertyList()->Get("classifier.svm.svm-type",this->m_Parameter->svm_type)) this->m_Parameter->svm_type = 0;
if(!this->GetPropertyList()->Get("classifier.svm.kernel-type",this->m_Parameter->kernel_type)) this->m_Parameter->kernel_type = 2;
if(!this->GetPropertyList()->Get("classifier.svm.degree",this->m_Parameter->degree)) this->m_Parameter->degree = 3;
if(!this->GetPropertyList()->Get("classifier.svm.gamma",this->m_Parameter->gamma)) this->m_Parameter->gamma = 0; // 1/n_features;
if(!this->GetPropertyList()->Get("classifier.svm.coef0",this->m_Parameter->coef0)) this->m_Parameter->coef0 = 0;
if(!this->GetPropertyList()->Get("classifier.svm.nu",this->m_Parameter->nu)) this->m_Parameter->nu = 0.5;
if(!this->GetPropertyList()->Get("classifier.svm.cache-size",this->m_Parameter->cache_size)) this->m_Parameter->cache_size = 100.0;
if(!this->GetPropertyList()->Get("classifier.svm.c",this->m_Parameter->C)) this->m_Parameter->C = 1.0;
if(!this->GetPropertyList()->Get("classifier.svm.eps",this->m_Parameter->eps)) this->m_Parameter->eps = 1e-3;
if(!this->GetPropertyList()->Get("classifier.svm.p",this->m_Parameter->p)) this->m_Parameter->p = 0.1;
if(!this->GetPropertyList()->Get("classifier.svm.shrinking",this->m_Parameter->shrinking)) this->m_Parameter->shrinking = 1;
if(!this->GetPropertyList()->Get("classifier.svm.probability",this->m_Parameter->probability)) this->m_Parameter->probability = 0;
if(!this->GetPropertyList()->Get("classifier.svm.nr-weight",this->m_Parameter->nr_weight)) this->m_Parameter->nr_weight = 0;
//options:
//-s svm_type : set type of SVM (default 0)
// 0 -- C-SVC
// 1 -- nu-SVC
// 2 -- one-class SVM
// 3 -- epsilon-SVR
// 4 -- nu-SVR
//-t kernel_type : set type of kernel function (default 2)
// 0 -- linear: u'*v
// 1 -- polynomial: (gamma*u'*v + coef0)^degree
// 2 -- radial basis function: exp(-gamma*|u-v|^2)
// 3 -- sigmoid: tanh(gamma*u'*v + coef0)
//-d degree : set degree in kernel function (default 3)
//-g gamma : set gamma in kernel function (default 1/num_features)
//-r coef0 : set coef0 in kernel function (default 0)
//-c cost : set the parameter C of C-SVC, epsilon-SVR, and nu-SVR (default 1)
//-n nu : set the parameter nu of nu-SVC, one-class SVM, and nu-SVR (default 0.5)
//-p epsilon : set the epsilon in loss function of epsilon-SVR (default 0.1)
//-m cachesize : set cache memory size in MB (default 100)
//-e epsilon : set tolerance of termination criterion (default 0.001)
//-h shrinking: whether to use the shrinking heuristics, 0 or 1 (default 1)
//-b probability_estimates: whether to train a SVC or SVR model for probability estimates, 0 or 1 (default 0)
//-wiweight: set the parameter C of class i to weight*C, for C-SVC (default 1)
// this->m_Parameter->weight_label = nullptr;
// this->m_Parameter->weight = 1;
}
/* these are for training only */
//int *weight_label; /* for C_SVC */
//double* weight; /* for C_SVC */
void mitk::LibSVMClassifier::SetProbability(int val)
{
this->GetPropertyList()->SetIntProperty("classifier.svm.probability",val);
}
void mitk::LibSVMClassifier::SetShrinking(int val)
{
this->GetPropertyList()->SetIntProperty("classifier.svm.shrinking",val);
}
void mitk::LibSVMClassifier::SetNrWeight(int val)
{
this->GetPropertyList()->SetIntProperty("classifier.svm.nr_weight",val);
}
void mitk::LibSVMClassifier::SetNu(double val)
{
this->GetPropertyList()->SetDoubleProperty("classifier.svm.nu",val);
}
void mitk::LibSVMClassifier::SetP(double val)
{
this->GetPropertyList()->SetDoubleProperty("classifier.svm.p",val);
}
void mitk::LibSVMClassifier::SetEps(double val)
{
this->GetPropertyList()->SetDoubleProperty("classifier.svm.eps",val);
}
void mitk::LibSVMClassifier::SetC(double val)
{
this->GetPropertyList()->SetDoubleProperty("classifier.svm.c",val);
}
void mitk::LibSVMClassifier::SetCacheSize(double val)
{
this->GetPropertyList()->SetDoubleProperty("classifier.svm.cache-size",val);
}
void mitk::LibSVMClassifier::SetSvmType(int val)
{
this->GetPropertyList()->SetIntProperty("classifier.svm.svm-type",val);
}
void mitk::LibSVMClassifier::SetKernelType(int val)
{
this->GetPropertyList()->SetIntProperty("classifier.svm.kernel-type",val);
}
void mitk::LibSVMClassifier::SetDegree(int val)
{
this->GetPropertyList()->SetIntProperty("classifier.svm.degree",val);
}
void mitk::LibSVMClassifier::SetGamma(double val)
{
this->GetPropertyList()->SetDoubleProperty("classifier.svm.gamma",val);
}
void mitk::LibSVMClassifier::SetCoef0(double val)
{
this->GetPropertyList()->SetDoubleProperty("classifier.svm.coef0",val);
}
void mitk::LibSVMClassifier::PrintParameter(std::ostream & str)
{
if(this->m_Parameter == nullptr)
{
MITK_WARN("LibSVMClassifier") << "Parameters are not initialized. Please call ConvertParameter() first!";
return;
}
this->ConvertParameter();
// Get the proerty // Some defaults
if(!this->GetPropertyList()->Get("classifier.svm.svm-type",this->m_Parameter->svm_type))
str << "classifier.svm.svm-type\tNOT SET (default " << this->m_Parameter->svm_type << ")" << "\n";
else
str << "classifier.svm.svm-type\t" << this->m_Parameter->svm_type << "\n";
if(!this->GetPropertyList()->Get("classifier.svm.kernel-type",this->m_Parameter->kernel_type))
str << "classifier.svm.kernel-type\tNOT SET (default " << this->m_Parameter->kernel_type << ")" << "\n";
else
str << "classifier.svm.kernel-type\t" << this->m_Parameter->kernel_type << "\n";
if(!this->GetPropertyList()->Get("classifier.svm.degree",this->m_Parameter->degree))
str << "classifier.svm.degree\t\tNOT SET (default " << this->m_Parameter->degree << ")" << "\n";
else
str << "classifier.svm.degree\t\t" << this->m_Parameter->degree << "\n";
if(!this->GetPropertyList()->Get("classifier.svm.gamma",this->m_Parameter->gamma))
str << "classifier.svm.gamma\t\tNOT SET (default " << this->m_Parameter->gamma << ")" << "\n";
else
str << "classifier.svm.gamma\t\t" << this->m_Parameter->gamma << "\n";
if(!this->GetPropertyList()->Get("classifier.svm.coef0",this->m_Parameter->coef0))
str << "classifier.svm.coef0\t\tNOT SET (default " << this->m_Parameter->coef0 << ")" << "\n";
else
str << "classifier.svm.coef0\t\t" << this->m_Parameter->coef0 << "\n";
if(!this->GetPropertyList()->Get("classifier.svm.nu",this->m_Parameter->nu))
str << "classifier.svm.nu\t\tNOT SET (default " << this->m_Parameter->nu << ")" << "\n";
else
str << "classifier.svm.nu\t\t" << this->m_Parameter->nu << "\n";
if(!this->GetPropertyList()->Get("classifier.svm.cache-size",this->m_Parameter->cache_size))
str << "classifier.svm.cache-size\tNOT SET (default " << this->m_Parameter->cache_size << ")" << "\n";
else
str << "classifier.svm.cache-size\t" << this->m_Parameter->cache_size << "\n";
if(!this->GetPropertyList()->Get("classifier.svm.c",this->m_Parameter->C))
str << "classifier.svm.c\t\tNOT SET (default " << this->m_Parameter->C << ")" << "\n";
else
str << "classifier.svm.c\t\t" << this->m_Parameter->C << "\n";
if(!this->GetPropertyList()->Get("classifier.svm.eps",this->m_Parameter->eps))
str << "classifier.svm.eps\t\tNOT SET (default " << this->m_Parameter->eps << ")" << "\n";
else
str << "classifier.svm.eps\t\t" << this->m_Parameter->eps << "\n";
if(!this->GetPropertyList()->Get("classifier.svm.p",this->m_Parameter->p))
str << "classifier.svm.p\t\tNOT SET (default " << this->m_Parameter->p << ")" << "\n";
else
str << "classifier.svm.p\t\t" << this->m_Parameter->p << "\n";
if(!this->GetPropertyList()->Get("classifier.svm.shrinking",this->m_Parameter->shrinking))
str << "classifier.svm.shrinking\tNOT SET (default " << this->m_Parameter->shrinking << ")" << "\n";
else
str << "classifier.svm.shrinking\t" << this->m_Parameter->shrinking << "\n";
if(!this->GetPropertyList()->Get("classifier.svm.probability",this->m_Parameter->probability))
str << "classifier.svm.probability\tNOT SET (default " << this->m_Parameter->probability << ")" << "\n";
else
str << "classifier.svm.probability\t" << this->m_Parameter->probability << "\n";
if(!this->GetPropertyList()->Get("classifier.svm.nr-weight",this->m_Parameter->nr_weight))
str << "classifier.svm.nr-weight\tNOT SET (default " << this->m_Parameter->nr_weight << ")" << "\n";
else
str << "classifier.svm.nr-weight\t" << this->m_Parameter->nr_weight << "\n";
}
// Trying to assign from matrix to noOfPoints
-void mitk::LibSVMClassifier::ReadXValues(LibSVM::svm_problem * problem, LibSVM::svm_node** xSpace, const Eigen::MatrixXd &X)
+void mitk::LibSVMClassifier::ReadXValues(svm_problem * problem, svm_node** xSpace, const Eigen::MatrixXd &X)
{
auto noOfPoints = static_cast<int>(X.rows());
auto features = static_cast<int>(X.cols());
- problem->x = static_cast<LibSVM::svm_node **>(malloc(sizeof(LibSVM::svm_node *) * noOfPoints));
- (*xSpace) = static_cast<LibSVM::svm_node *> (malloc(sizeof(LibSVM::svm_node) * noOfPoints * (features+1)));
+ problem->x = static_cast<svm_node **>(malloc(sizeof(svm_node *) * noOfPoints));
+ (*xSpace) = static_cast<svm_node *> (malloc(sizeof(svm_node) * noOfPoints * (features+1)));
for (int row = 0; row < noOfPoints; ++row)
{
for (int col = 0; col < features; ++col)
{
(*xSpace)[row*features + col].index = col;
(*xSpace)[row*features + col].value = X(row,col);
}
(*xSpace)[row*features + features].index = -1;
problem->x[row] = &((*xSpace)[row*features]);
}
}
-void mitk::LibSVMClassifier::ReadYValues(LibSVM::svm_problem * problem, const Eigen::MatrixXi &Y)
+void mitk::LibSVMClassifier::ReadYValues(svm_problem * problem, const Eigen::MatrixXi &Y)
{
problem->l = static_cast<int>(Y.rows());
problem->y = static_cast<double *>(malloc(sizeof(double) * problem->l));
for (int i = 0; i < problem->l; ++i)
{
problem->y[i] = Y(i,0);
}
}
-void mitk::LibSVMClassifier::ReadWValues(LibSVM::svm_problem * problem)
+void mitk::LibSVMClassifier::ReadWValues(svm_problem * problem)
{
Eigen::MatrixXd & W = this->GetPointWiseWeight();
int noOfPoints = problem->l;
problem->W = static_cast<double *>(malloc(sizeof(double) * noOfPoints));
if (IsUsingPointWiseWeight())
{
for (int i = 0; i < noOfPoints; ++i)
{
problem->W[i] = W(i,0);
}
} else
{
for (int i = 0; i < noOfPoints; ++i)
{
problem->W[i] = 1;
}
}
}
diff --git a/Modules/Classification/CLUtilities/include/itkLabelSampler.h b/Modules/Classification/CLUtilities/include/itkLabelSampler.h
index becc49b016..f2312c54a8 100644
--- a/Modules/Classification/CLUtilities/include/itkLabelSampler.h
+++ b/Modules/Classification/CLUtilities/include/itkLabelSampler.h
@@ -1,81 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef itLabelSampler_h
#define itLabelSampler_h
#include "itkImageToImageFilter.h"
namespace itk
{
template< class TImage>
class LabelSampler:public ImageToImageFilter< TImage, TImage >
{
public:
/** Standard class typedefs. */
typedef LabelSampler Self;
typedef ImageToImageFilter< TImage, TImage > Superclass;
typedef SmartPointer< Self > Pointer;
typedef std::map<int,int> outmap;
/** Method for creation through the object factory. */
- itkNewMacro(Self)
-
- /** Run-time type information (and related methods). */
- itkTypeMacro(Self, ImageToImageFilter)
-
- itkSetMacro(AcceptRate, double)
- itkSetMacro(Label, int)
- itkGetMacro(LabelVoxelCountMap, outmap)
- itkGetMacro(NumberOfSampledVoxels,int)
+ itkNewMacro(Self); /** Run-time type information (and related methods). */
+ itkTypeMacro(Self, ImageToImageFilter);
+ itkSetMacro(AcceptRate, double);
+ itkSetMacro(Label, int);
+ itkGetMacro(LabelVoxelCountMap, outmap);
+ itkGetMacro(NumberOfSampledVoxels,int);
int GetLabelVoxelCount(int label)
{
if(m_LabelVoxelCountMap.empty())
return 0;
return m_LabelVoxelCountMap[label];
}
protected:
LabelSampler()
:m_Label(-1)
,m_AcceptRate(1.0)
,m_UseLabelVoxelCount(false)
{
this->SetNumberOfRequiredInputs(1);
this->SetNumberOfRequiredOutputs(1);
}
~LabelSampler(){}
/** Does the real work. */
virtual void GenerateData();
private:
LabelSampler(const Self &); //purposely not implemented
void operator=(const Self &); //purposely not implemented
int m_Label;
int m_NumberOfSampledVoxels;
double m_AcceptRate;
bool m_UseLabelVoxelCount;
std::map<int,int> m_LabelVoxelCountMap;
};
} //namespace ITK
#ifndef ITK_MANUAL_INSTANTIATION
#include <../src/Algorithms/itkLabelSampler.cpp>
#endif
#endif // itLabelSampler_h
diff --git a/Modules/Classification/CLUtilities/include/itkSmoothedClassProbabilites.h b/Modules/Classification/CLUtilities/include/itkSmoothedClassProbabilites.h
index a34ac291dc..4b0308bb84 100644
--- a/Modules/Classification/CLUtilities/include/itkSmoothedClassProbabilites.h
+++ b/Modules/Classification/CLUtilities/include/itkSmoothedClassProbabilites.h
@@ -1,63 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef itSmoothedClassProbabilites_h
#define itSmoothedClassProbabilites_h
#include "itkImageToImageFilter.h"
namespace itk
{
template< class TImage>
class SmoothedClassProbabilites:public ImageToImageFilter< TImage, TImage >
{
public:
/** Standard class typedefs. */
typedef SmoothedClassProbabilites Self;
typedef ImageToImageFilter< TImage, TImage > Superclass;
typedef SmartPointer< Self > Pointer;
/** Method for creation through the object factory. */
- itkNewMacro(Self)
-
- /** Run-time type information (and related methods). */
- itkTypeMacro(SmoothedClassProbabilites, ImageToImageFilter)
-
- itkSetMacro(Sigma, double)
+ itkNewMacro(Self); /** Run-time type information (and related methods). */
+ itkTypeMacro(SmoothedClassProbabilites, ImageToImageFilter);
+ itkSetMacro(Sigma, double);
void SetMaskImage(TImage * mask){m_MaskImage = mask;}
protected:
SmoothedClassProbabilites(){}
~SmoothedClassProbabilites(){}
/** Does the real work. */
virtual void GenerateData();
private:
//LabelSampler(const Self &); //purposely not implemented
//void operator=(const Self &); //purposely not implemented
double m_Sigma;
TImage * m_MaskImage;
};
} //namespace ITK
#ifndef ITK_MANUAL_INSTANTIATION
#include <../src/Algorithms/itkSmoothedClassProbabilites.cpp>
#endif
#endif // itLabelSampler_h
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix.h b/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix.h
index 22b4562701..122350b4d4 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFCooccurenceMatrix_h
#define mitkGIFCooccurenceMatrix_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
class MITKCLUTILITIES_EXPORT GIFCooccurenceMatrix : public AbstractGlobalImageFeature
{
/**
* \brief Calculates features based on the co-occurence matrix.
*
* This filter calculates features based on the Co-Occurence Matrix.
*
* \warning{ This is a legacy class only. If possible, avoid to use it. Use
* GIFCooccurenceMatrix2 instead.}
*/
public:
- mitkClassMacro(GIFCooccurenceMatrix,AbstractGlobalImageFeature)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(GIFCooccurenceMatrix,AbstractGlobalImageFeature);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
GIFCooccurenceMatrix();
/**
* \brief Calculates the Cooccurence-Matrix based features for this class.
*/
FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override;
/**
* \brief Returns a list of the names of all features that are calculated from this class
*/
FeatureNameListType GetFeatureNames() override;
itkGetConstMacro(Range,double);
itkSetMacro(Range, double);
void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override;
void AddArguments(mitkCommandLineParser &parser) override;
struct GIFCooccurenceMatrixConfiguration
{
double range;
unsigned int direction;
double MinimumIntensity;
bool UseMinimumIntensity;
double MaximumIntensity;
bool UseMaximumIntensity;
int Bins;
};
private:
double m_Range;
};
}
#endif //mitkGIFCooccurenceMatrix_h
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix2.h b/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix2.h
index deee5936a0..79852f8a0e 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix2.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix2.h
@@ -1,174 +1,174 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFCooccurenceMatrix2_h
#define mitkGIFCooccurenceMatrix2_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
#include <Eigen/src/Core/Array.h>
namespace mitk
{
/**
* \brief Calculates features based on the co-occurence matrix.
*
* The co-occurence matrix describes the relations between voxels in a specific direction. The elements \f$m_{i,k} \f$ of the
* matrix count how often a voxel with the intensity \f$i \f$ has a neighbour in a certain direction with the intensity \f$ k \f$.
* The direction for each matrix is given by a directed vector \f$ \overrightarrow{d} \f$.
*
* It is important to calculate the matrices for all possible directions in order to obtain a rotation invariant feature.
* For the 3D case, this means that there are 26 possible directions. Using the symmetrical properties of the co-occurence
* matrix, it is then possible to calculate the features in all directions looking at 13 different directions.
*
* The standard length of the vector is 1, e.g. looking at direct neighbours. It is possible to look at more
* distance neighbours. This is achieved using the parameter <b>range</b> which defines the distance between
* two neighbouring voxels in number of voxels. The default value for this is 1. It can be changes using the Method
* SetRange() or by passing the option <b>cooc2::range</b>.
*
* There are two possible ways of combining the information obtained from the multiple directions. The first option
* is to calculate a common matrix for all directions and then use this matrix to calculate the describing features.
* The second method is to calculate a matrix for each direction, obtain the features and then report the mean and
* standard value of these features. Both mehtods are calcuated by this filters and reported, distinguisehd by either
* an "Overall" if a single matrix is used, a "Mean" for the mean Value, or an "Std.Dev." for the standard deviation.
*
* The connected areas are based on the binned image, the binning parameters can be set via the default
* parameters as described in AbstractGlobalImageFeature. The intensity used for the calculation is
* always equal to the bin number. It is also possible to determine the
* dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature.
* No other options are possible beside these two options.
*
* This feature calculator is activated by the option <b>-cooccurence2</b> or <b>-cooc2</b>.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image. All voxels with the value 1 are treated as masked.
*
* The following features are defined. We always give the notation for the overall matrix feature
* although those for the mean and std.dev. are basically equal. In the name, <Range> is replace
* by the distance of the neighbours. For the definitions of the feature, the probability of each
* intensity pair (i,k) \f$ p_{i,k} = \frac{m_{i,k}}{\sum_i \sum_k m_{i,k}} \f$.
*
* In addition, the marginal sum \f$ p_{i,\cdot} = p_{\cdot,k=i} = \sum_k p_{i,k} \f$, which is
* identical for both axis due to the symetrical nature of the matrix. Furthermore, the diagonal and
* cross diagnoal features are used:
* \f[ p_{i-k}(l) = \sum_i \sum_k p_{i,k} \delta(l - \| i -k \| ) \enspace \enspace l = 0, \dots, N_g -1 \f]
* \f[ p_{i+k}(l) = \sum_i \sum_k p_{i,k} \delta(l - ( i + k ) ) \enspace \enspace l = 2, \dots, 2 N_g \f]
* Here, \f$ \delta(x) \f$ is the dirac function, which is one for \f$x=0 \f$ and zero otherwise.
* - <b>Co-occurenced Based Features (<Range>)::Overall Joint Maximum</b>:
* \f[ \textup{Joint Maximum}= \textup{max}(p_{i,k}) \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Joint Average</b>:
* \f[ \textup{Joint Average} = \mu_{ja} = \sum_i \sum_k i p_{i,k} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Joint Variance</b>:
* \f[ \textup{Joint Variance} = \sum_i \sum_k (i - \mu_{ja})^2 p_{i,k} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Joint Entropy</b>:
* \f[ \textup{Joint Entropy} = e_j = - \sum_i \sum_k p_{i,k} \textup{log}_2 p_{i,k} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Row Maximum</b>:
* \f[ \textup{Row Maximum}= \textup{max}(p_{i,\cdot}) \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Row Average</b>:
* \f[ \textup{Row Average} = \mu_{ra} = \sum_i i p_{i,\cdot} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Row Variance</b>:
* \f[ \textup{Row Variance} = \sigma^2_{i, \cdot} = \sum_i (i - \mu_{ra})^2 p_{i,\cdot} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Row Entropy</b>:
* \f[ \textup{Row Entropy} = e_r = - \sum_i p_{i,\cdot} \textup{log}_2 p_{i,\cdot} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall First Row-Column Entropy</b>:
* \f[ \textup{First Row-Column Entropy} = e_1 = - \sum_i \sum_k p_{i,k} \textup{log}_2 ( p_{i,\cdot} p_{\cdot,k}) \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Second Row-Column Entropy</b>:
* \f[ \textup{Second Row-Column Entropy} = e_2 = - \sum_i \sum_k p_{i,\cdot} p_{\cdot,k} \textup{log}_2 ( p_{i,\cdot} p_{\cdot,k}) \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Difference Average</b>:
* \f[ \textup{Difference Average} = \mu_{da} = \sum_l l p_{i-k}(l) \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Difference Variance</b>:
* \f[ \textup{Difference Variance} = \sum_l (i - \mu_{da})^2 p_{i-k}(l) \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Difference Entropy</b>:
* \f[ \textup{Difference Entropy} = - \sum_l p_{i-k}(l) \textup{log}_2 p_{i-k}(l) \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Sum Average</b>:
* \f[ \textup{Sum Average} = \mu_{sa} = \sum_l l p_{i+k}(l) \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Sum Variance</b>:
* \f[ \textup{Sum Variance} = \sum_l (i - \mu_{sa})^2 p_{i+k}(l) \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Sum Entropy</b>:
* \f[ \textup{Sum Entropy} = - \sum_l p_{i+k}(l) \textup{log}_2 p_{i+k}(l) \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Angular Second Moment</b>:
* \f[ \textup{Angular Second Moment} = \sum_i \sum_k p^2_{i,k} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Contrast</b>:
* \f[ \textup{Contrast} = \sum_i \sum_k (i-k)^2 p_{i,k} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Dissimilarity</b>:
* \f[ \textup{Dissimilarity} = \sum_i \sum_k \| i-k\| p^2_{i,k} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Inverse Difference</b>:
* \f[ \textup{Inverse Difference} = \sum_i \sum_k \frac{p_{i,k}}{1+\| i-k\|} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Inverse Difference Normalized</b>:
* \f[ \textup{Inverse Difference Normalized} = \sum_i \sum_k \frac{p_{i,k}}{1+\frac{\| i-k\|}{N_g}} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Inverse Difference Moment</b>:
* \f[ \textup{Inverse Difference Moment} = \sum_i \sum_k \frac{p_{i,k}}{1+ ( i-k )^2} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Inverse Difference Moment Normalized</b>:
* \f[ \textup{Inverse Difference Moment Normalized} = \sum_i \sum_k \frac{p_{i,k}}{1+\frac{( i-k ) ^2}{N_g}} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Inverse Variance</b>:
* \f[ \textup{Inverse Difference Moment Normalized} = \sum_i \sum_k \frac{p_{i,k}}{(i-k)^2} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Correlation</b>:
* \f[ \textup{Correlation} = \frac{1}{\sigma^2_{i,\cdot}} \sum_i \sum_k (i - \mu_{ra})(k - \mu_{ra}) p_{i,k} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Autocorrelation</b>:
* \f[ \textup{Autocorrelation} = \sum_i \sum_k i k p_{i,k} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Cluster Tendency</b>:
* \f[ \textup{Cluster Tendency} = \sum_i \sum_k (i + k - 2\mu_{ra})^2 p_{i,k} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Cluster Shade</b>:
* \f[ \textup{Cluster Shade} = \sum_i \sum_k (i + k - 2\mu_{ra})^3 p_{i,k} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Cluster Prominence</b>:
* \f[ \textup{Cluster Prominence} = \sum_i \sum_k (i + k - 2\mu_{ra})^4 p_{i,k} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall First Measure of Information Correlation</b>:
* \f[ \textup{First Measure of Information Correlation} = \frac{ e_j- e_1}{e_r} \f]
* - <b>Co-occurenced Based Features (<Range>)::Overall Second Measure of Information Correlation</b>:
* \f[ \textup{Second Measure of Information Correlation} = \sqrt{1- \exp(-2 (e_2 - e_j)} \f]
*/
class MITKCLUTILITIES_EXPORT GIFCooccurenceMatrix2 : public AbstractGlobalImageFeature
{
public:
mitkClassMacro(GIFCooccurenceMatrix2, AbstractGlobalImageFeature);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
GIFCooccurenceMatrix2();
/**
* \brief Calculates the Cooccurence-Matrix based features for this class.
*/
FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override;
/**
* \brief Returns a list of the names of all features that are calculated from this class
*/
FeatureNameListType GetFeatureNames() override;
void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override;
void AddArguments(mitkCommandLineParser &parser) override;
std::string GetCurrentFeatureEncoding() override;
itkGetConstMacro(Range,double);
itkSetMacro(Range, double);
struct GIFCooccurenceMatrix2Configuration
{
double range;
unsigned int direction;
double MinimumIntensity;
double MaximumIntensity;
int Bins;
std::string prefix;
};
private:
double m_Range;
};
}
#endif //mitkGIFCooccurenceMatrix2_h
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFCurvatureStatistic.h b/Modules/Classification/CLUtilities/include/mitkGIFCurvatureStatistic.h
index ef67ea062c..c99fc58d7d 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFCurvatureStatistic.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFCurvatureStatistic.h
@@ -1,104 +1,104 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFCurvatureStatistic_h
#define mitkGIFCurvatureStatistic_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
/**
* \brief Calculates features based on the co-occurence matrix.
*
* The Curvature is a measure for the bending of a surface and is therefore a measure for the description of the
* surface of an segmentation.
*
* THe curvature is calculated for each point of the surface of the given object and then a combined measure is
* produced. It measures the divergence of the orientation of an curve from the
* tangent of the curve. There are multiple ways to calculate the Curvature:
*
* <b> Gaussian Curvature</b>: The discrete gaussian curvature (K) is computed as \f$K(\textup{Corner Point v}) = 2 * \pi - \sum_{\textup{Neighoubring Voxel Surfaces f of v}} (\textup{Angle}_f \textup{at} v) \f$.
* <b> Mean Curvature</b>:The mean curvature (H) is computed as \f$H(\textup{Corner Point v}) = \textup{average over edges e neighbouring v of H(e)} \f$.
* with \f$H(edge e) = length(e)*dihedral_angle(e)\f$
* <b>Maximum</b> (\f$k_max\f$) and <b>Minimum</b> (\f$k_min\f$) Principal Curvatures
* \f$k_max = H + sqrt(H^2 - K)\f$
* \f$k_min = H - sqrt(H^2 - K)\f$
* Excepting spherical and planar surfaces which have equal principal curvatures,
* the curvature at a point on a surface varies with the direction one "sets off"
* from the point. For all directions, the curvature will pass through two extrema:
* a minimum (\f$k_min\f$) and a maximum (\f$k_max\f$) which occur at mutually orthogonal
* directions to each other.
*
* This method does not take any parameters.
*
* This feature calculator is activated by the option <b>-curvature</b> or <b>-cur</b>.
*
* The features are calculated based on a mask, which is converted into a mesh.
*
* The following features are defined. All features are calculated for all four possible
* curvation calculation methods (Gaussian, Mean, Minimum, Maximum). The principal way
* of calculating these features is the same, the used curvation is indicated by <name> in the
* feature name:
*
* - <b>Curvature Feature::Minimum <name> Curvature</b>:
* The minimum curvature for the whole given mask
* - <b>Curvature Feature::Maximum <name> Curvature</b>:
* The maximum curvature for the whole given mask
* - <b>Curvature Feature::Mean <name> Curvature</b>:
* The mean curvature for the whole given mask
* - <b>Curvature Feature::Standard Deviation <name> Curvature</b>:
* The standard deviation curvature for the whole given mask
* - <b>Curvature Feature::Skewness <name> Curvature</b>:
* The skewness curvature for the whole given mask
* - <b>Curvature Feature::Mean Positive <name> Curvature</b>:
* The mean curvature of all positive curvatures from the whole given mask
* - <b>Curvature Feature::Standard Deviation Positive <name> Curvature</b>:
* The Standard Deviation curvature of all positive curvatures from the whole given mask
* - <b>Curvature Feature::Skewness Positive <name> Curvature</b>:
* The Skewness curvature of all positive curvatures from the whole given mask
* - <b>Curvature Feature::Mean Negative <name> Curvature</b>:
* The mean curvature of all Negative curvatures from the whole given mask
* - <b>Curvature Feature::Standard Deviation Negative <name> Curvature</b>:
* The Standard Deviation curvature of all Negative curvatures from the whole given mask
* - <b>Curvature Feature::Skewness Negative <name> Curvature</b>:
* The Skewness curvature of all Negative curvatures from the whole given mask
*/
class MITKCLUTILITIES_EXPORT GIFCurvatureStatistic : public AbstractGlobalImageFeature
{
public:
- mitkClassMacro(GIFCurvatureStatistic,AbstractGlobalImageFeature)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(GIFCurvatureStatistic,AbstractGlobalImageFeature);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
GIFCurvatureStatistic();
/**
* \brief Calculates the Cooccurence-Matrix based features for this class.
*/
FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override;
/**
* \brief Returns a list of the names of all features that are calculated from this class
*/
FeatureNameListType GetFeatureNames() override;
void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override;
void AddArguments(mitkCommandLineParser &parser) override;
private:
};
}
#endif //mitkGIFCurvatureStatistic_h
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderHistogramStatistics.h b/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderHistogramStatistics.h
index 318ff1bf6e..7e8dc8da19 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderHistogramStatistics.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderHistogramStatistics.h
@@ -1,126 +1,126 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFFirstOrderHistogramStatistics_h
#define mitkGIFFirstOrderHistogramStatistics_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
/**
* \brief Calulates first order features based on a histogram.
*
* This class can be used to calculate first order features based on a histogram.
* For each feature, two variations are given, once the value of the feature that is
* obtained if the mean intensity of the histogram bins is used and the
* histogram bin that corresponds to the feature value. See AbstractGlobalImageFeature for more
* information on the histogram initialization. The histogram gives a probability \f$p_i\f$ for the
* intensity \f$x_i\f$ that is linked to the bin \f$i\f$. The histogram bins start at index 1.
*
* This feature calculator is activated by the option "<b>-first-order-histogram</b>" or "<b>-foh</b>".
* Beside the options for the histogram definitions, which are given in the description of AbstractGlobalImageFeature , no
* additional parameters are available.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image and all voxels with an value of 1
* are treated as masked.
*
* The resulting features are:
* - <b>First Order Histogram::Mean Value</b>: The mean intensity of all voxels, calulated by \f$ \mu_x = \sum p_i x_i\f$.
* - <b>First Order Histogram::Variance Value</b> The variance intensity is calculated as : \f$ \sigma^2 = \sum p_i (x_i - \mu_x)^2\f$.
* - <b>First Order Histogram::Skewness Value</b>: \f[ skewness = \frac{\sum p_i (x_i - \mu_x)^3}{\sigma^3} \f]
* - <b>First Order Histogram::Excess Kurtosis Value</b>: \f[ skewness = \frac{\sum p_i (x_i - \mu_x)^4}{\sigma^4} - 3 \f]
* - <b>First Order Histogram::Median Value</b>: The median intensity value based on the histogram values.
* - <b>First Order Histogram::Minimum Value</b>: The minimum observed intensity value.
* - <b>First Order Histogram::Percentile 10 Value</b>: The intensity that is equal or greater than 10% of all observed intensities.
* - <b>First Order Histogram::Percentile 90 Value</b>: The intensity that is equal or greater than 90% of all observed intensities.
* - <b>First Order Histogram::Maximum Value</b>: The maximum observerd intensity value.
* - <b>First Order Histogram::Mode Value</b>: The most common intensity value, i.e. the value of the bin with the highest probability.
* - <b>First Order Histogram::Interquantile Range Value</b>: The intensity difference between Percentile 75% (\f$ P75\f$) and Percentile 25% (\f$ P25\f$).
* - <b>First Order Histogram::Range Value</b>: The difference between the observed maximum and minimum intensity.
* - <b>First Order Histogram::Mean Absolute Deviation Value</b>: \f[ \textup{mean absolute deviation} = \sum p_i \left \| (x_i - \mu_x) \right \| \f]
* - <b>First Order Histogram::Robust Mean Value</b>: The mean of all intensities between the 10% and 90% quantile.
* - <b>First Order Histogram::Robust Mean Absolute Deviation Value</b>: The Mean absolute deviation for all values between the 10% and 90% quantile. It is based on the robust mean value.
* - <b>First Order Histogram::Median Absolute Deviation Value</b>: \f[ \textup{mean absolute deviation} = \sum p_i \left \| (x_i - \textup{median}) \right \| \f]
* - <b>First Order Histogram::Coefficient of Variation Value</b>: \f[ \frac{\sigma_x}{\mu_x} \f]
* - <b>First Order Histogram::Quantile coefficient of Dispersion Value</b>: \f[ \textup{Quantile coefficient of Dispersion} = \frac{P75 - P25}{P75 + P25} \f]
* - <b>First Order Histogram::Entropy Value</b>: The entropy is only based on histogram bins with a probability greater than 0.0000001: \f[ \textup{entropy} = - \sum p_i \textup{log}_2 p_i \f]
* - <b>First Order Histogram::Uniformity Value</b>: \f$ \sum p_i^2 \f$
* - <b>First Order Histogram::Mean Index</b>: The mean index of all voxels, calulated by \f$ \mu_i = \sum p_i i\f$.
* - <b>First Order Histogram::Variance Index</b>: The variance index is calculated as : \f$ \sigma_i^2 = \sum p_i (i - \mu_i)^2\f$.
* - <b>First Order Histogram::Skewness Index</b>: \f[ skewness = \frac{\sum p_i (i - \mu_i)^3}{\sigma_i^3} \f]
* - <b>First Order Histogram::Excess Kurtosis Index</b>: \f[ skewness = \frac{\sum p_i (i - \mu_i)^4}{\sigma_i^4} - 3 \f]
* - <b>First Order Histogram::Median Index</b>: The median index value based on the histogram values.
* - <b>First Order Histogram::Minimum Index</b>: The index of the minimum observed intensity value.
* - <b>First Order Histogram::Percentile 10 Index</b>: The index oft the intensity that is equal or greater than 10% of all observed intensities.
* - <b>First Order Histogram::Percentile 90 Index</b>: The index of the intensity that is equal or greater than 90% of all observed intensities.
* - <b>First Order Histogram::Maximum Index</b>: The index of the maximum observerd intensity value.
* - <b>First Order Histogram::Mode Index</b>: The index of the most common intensity value, i.e. the index of the bin with the highest probability.
* - <b>First Order Histogram::Interquantile Range Index</b>: The index difference between Percentile 75% (\f$ P75\f$) and Percentile 25% (\f$ P25\f$).
* - <b>First Order Histogram::Range Index</b>: The index difference between the index of the observed maximum and minimum intensity.
* - <b>First Order Histogram::Mean Absolute Deviation Index</b>: \f[ \textup{mean absolute deviation} = \sum p_i \left \| (i - \mu_i) \right \| \f]
* - <b>First Order Histogram::Robust Mean Absolute Deviation Index</b>: The Mean absolute deviation for all values between the 10% and 90% quantile. It is based on the robust mean value.
* - <b>First Order Histogram::Median Absolute Deviation Index</b>: \f[ \textup{mean absolute deviation} = \sum p_i \left \| (i - \textup{median}) \right \| \f]
* - <b>First Order Histogram::Coefficient of Variation Index</b>: \f[ \frac{\sigma_i}{\mu_i} \f]
* - <b>First Order Histogram::Quantile coefficient of Dispersion Index</b>: \f[ \textup{Quantile coefficient of Dispersion} = \frac{P75 - P25}{P75 + P25} \f]
* - <b>First Order Histogram::Entropy Index</b>: The entropy is only based on histogram bins with a probability greater than 0.0000001: \f$ \textup{entropy} = - \sum p_i \textup{log}_2 p_i \f$. Note that this is the same as the entropy value.
* - <b>First Order Histogram::Uniformity Index</b>: \f$ \sum p_i^2 \f$. Note that this is the same as the uniformity value.
* - <b>First Order Histogram::Maximum Gradient</b>: The maximum difference between the probability of three neighbouring bins. For bins at the edge of the histogram, only two bins are used for the calulation.
* - <b>First Order Histogram::Maximum Gradient Index</b>: The index of the bin that belongs to the maximum gradient.
* - <b>First Order Histogram::Minimum Gradient</b>: The minimum difference between the probability of three neighbouring bins. For bins at the edge of the histogram, only two bins are used for the calulation.
* - <b>First Order Histogram::Minimum Gradient Index</b>:The index of the bin that belongs to the minimum gradient.
* - <b>First Order Histogram::Robust Mean Index</b>: The mean index of all intensities between the 10% and 90% quantile.
* - <b>First Order Histogram::Number of Bins</b>: The number of bins in the histogram. This is rather for control, as this parameter is likely to be determined by the configuration rather than the image.
* - <b>First Order Histogram::Bin Size</b>: The binsize of the bins from the histogram. This is rather for control, as this parameter is likely to be determined by the configuration rather than the image.
*/
class MITKCLUTILITIES_EXPORT GIFFirstOrderHistogramStatistics : public AbstractGlobalImageFeature
{
public:
- mitkClassMacro(GIFFirstOrderHistogramStatistics,AbstractGlobalImageFeature)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(GIFFirstOrderHistogramStatistics,AbstractGlobalImageFeature);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
GIFFirstOrderHistogramStatistics();
/**
* \brief Calculates the Cooccurence-Matrix based features for this class.
*/
FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override;
/**
* \brief Returns a list of the names of all features that are calculated from this class
*/
FeatureNameListType GetFeatureNames() override;
itkGetConstMacro(Range,double);
itkSetMacro(Range, double);
void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override;
void AddArguments(mitkCommandLineParser &parser) override;
std::string GetCurrentFeatureEncoding() override;
struct ParameterStruct {
double MinimumIntensity;
double MaximumIntensity;
int Bins;
std::string prefix;
};
private:
double m_Range;
};
}
#endif //mitkGIFFirstOrderHistogramStatistics_h
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderNumericStatistics.h b/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderNumericStatistics.h
index d0b671a0cb..ae3ca44567 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderNumericStatistics.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderNumericStatistics.h
@@ -1,152 +1,152 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFFirstNumericOrderStatistics_h
#define mitkGIFFirstNumericOrderStatistics_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
class MITKCLUTILITIES_EXPORT GIFFirstOrderNumericStatistics : public AbstractGlobalImageFeature
{
public:
/**
* \brief Calculates first order statistics of the given image.
*
* The first order statistics for the intensity distribution within a given Region of Interest (ROI)
* is caluclated. The ROI is defined using a mask.
*
* The features are calculated on a quantified image. If the bin-size is too big, the obtained values
* can be errornous and missleading. It is therefore important to use enough bins. The binned approach is
* used in order to avoid floating-point related errors.
*
* This feature calculator is activated by the option <b>-first-order</b> or <b>-fo</b>.
*
* The connected areas are based on the binned image, the binning parameters can be set via the default
* parameters as described in AbstractGlobalImageFeature. It is also possible to determine the
* dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature.
* No other options are possible beside these two options.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image. All voxels with the value 1 are treated as masked.
*
* The following features are then defined using the (binned) voxel intensity \f$ x_i \f$ of each voxel, the probability
* an intensity \f$ p_x \f$, and the overall number of voxels within the mask \f$ N_v \f$:
* - <b>First Order::Mean</b>: The mean intensity within the ROI
* \f[ \textup{Mean}= \mu = \frac{1}{N_v} \sum x_i \f]
* - <b>First Order::Unbiased Variance</b>: An unbiased estimation of the variance:
* \f[ \textup{Unbiased Variance} = \frac{1}{N_v - 1} \sum \left( x_i - \mu \right)^2 \f]
* - <b>First Order::Biased Variance</b>: An biased estimation of the variance. If not specified otherwise, this is
* used as the variance:
* \f[ \textup{Biased Variance} = \sigma^2 = \frac{1}{N_v} \sum \left( x_i - \mu \right)^2 \f]
* - <b>First Order::Unbiased Standard Deviation</b>: Estimation of diversity within the intensity values
* \f[ \textup{Unbiased Standard Deviation} = \sqrt{\frac{1}{N_v-1} \sum \left( x_i - \mu \right)^2} \f]
* - <b>First Order::Biased Standard Deviation</b>: Estimation of diversity within the intensity values
* \f[ \textup{Biased Standard Deviation} = \sigma = \sqrt{\frac{1}{N_v} \sum \left( x_i - \mu \right)^2} \f]
* - <b>First Order::Skewness</b>:
* \f[ \textup{Skewness} = \frac{\frac{1}{N_v} \sum \left( x_i - \mu \right)^3}{\sigma^3} \f]
* - <b>First Order::Kurtosis</b>: The kurtosis is a measurement of the peakness of the given
* distirbution:
* \f[ \textup{Kurtosis} = \frac{\frac{1}{N_v} \sum \left( x_i - \mu \right)^4}{\sigma^4} \f]
* - <b>First Order::Excess Kurtosis</b>: The kurtosis is a measurement of the peakness of the given
* distirbution. The excess kurtosis is similar to the kurtosis, but is corrected by a fisher correction,
* ensuring that a gaussian distribution has an excess kurtosis of 0.
* \f[ \textup{Excess Kurtosis} = \frac{\frac{1}{N_v} \sum \left( x_i - \mu \right)^4}{\sigma^4} - 3 \f]
* - <b>First Order::Median</b>: The median is defined as the median of the all intensities in the ROI.
* - <b>First Order::Minimum</b>: The minimum is defined as the minimum of the all intensities in the ROI.
* - <b>First Order::05th Percentile</b>: \f$ P_{5\%} \f$ The 5% percentile. 5% of all voxel do have this or a lower intensity.
* - <b>First Order::10th Percentile</b>: \f$ P_{10\%} \f$ The 10% percentile. 10% of all voxel do have this or a lower intensity.
* - <b>First Order::15th Percentile</b>: \f$ P_{15\%} \f$ The 15% percentile. 15% of all voxel do have this or a lower intensity.
* - <b>First Order::20th Percentile</b>: \f$ P_{20\%} \f$ The 20% percentile. 20% of all voxel do have this or a lower intensity.
* - <b>First Order::25th Percentile</b>: \f$ P_{25\%} \f$ The 25% percentile. 25% of all voxel do have this or a lower intensity.
* - <b>First Order::30th Percentile</b>: \f$ P_{30\%} \f$ The 30% percentile. 30% of all voxel do have this or a lower intensity.
* - <b>First Order::35th Percentile</b>: \f$ P_{35\%} \f$ The 35% percentile. 35% of all voxel do have this or a lower intensity.
* - <b>First Order::40th Percentile</b>: \f$ P_{40\%} \f$ The 40% percentile. 40% of all voxel do have this or a lower intensity.
* - <b>First Order::45th Percentile</b>: \f$ P_{45\%} \f$ The 45% percentile. 45% of all voxel do have this or a lower intensity.
* - <b>First Order::50th Percentile</b>: \f$ P_{50\%} \f$ The 50% percentile. 50% of all voxel do have this or a lower intensity.
* - <b>First Order::55th Percentile</b>: \f$ P_{55\%} \f$ The 55% percentile. 55% of all voxel do have this or a lower intensity.
* - <b>First Order::60th Percentile</b>: \f$ P_{60\%} \f$ The 60% percentile. 60% of all voxel do have this or a lower intensity.
* - <b>First Order::65th Percentile</b>: \f$ P_{65\%} \f$ The 65% percentile. 65% of all voxel do have this or a lower intensity.
* - <b>First Order::70th Percentile</b>: \f$ P_{70\%} \f$ The 70% percentile. 70% of all voxel do have this or a lower intensity.
* - <b>First Order::75th Percentile</b>: \f$ P_{75\%} \f$ The 75% percentile. 75% of all voxel do have this or a lower intensity.
* - <b>First Order::80th Percentile</b>: \f$ P_{80\%} \f$ The 80% percentile. 80% of all voxel do have this or a lower intensity.
* - <b>First Order::85th Percentile</b>: \f$ P_{85\%} \f$ The 85% percentile. 85% of all voxel do have this or a lower intensity.
* - <b>First Order::90th Percentile</b>: \f$ P_{90\%} \f$ The 90% percentile. 90% of all voxel do have this or a lower intensity.
* - <b>First Order::95th Percentile</b>: \f$ P_{95\%} \f$ The 95% percentile. 95% of all voxel do have this or a lower intensity.
* - <b>First Order::Maximum</b>: The maximum is defined as the minimum of the all intensities in the ROI.
* - <b>First Order::Range</b>: The range of intensity values is defined as the difference between the maximum
* and minimum intensity in the ROI.
* - <b>First Order::Interquartile Range</b>: The difference between the 75% and 25% quantile.
* - <b>First Order::Mean Absolute Deviation</b>: The mean absolute deviation gives the mean distance of each
* voxel intensity to the overal mean intensity and is a measure of the dispersion of the intensity form the
* mean value:
* \f[ \textup{Mean Absolute Deviation} = \frac{1}{N_v} \sum \left \| x_i - \mu \right \| \f]
* - <b>First Order::Robust Mean</b>: The mean intensity within the ROI for all voxels between the 10% and 90% quantile:
* \f[ \textup{Robust Mean}= \mu_R = \frac{1}{N_{vr}} \sum x_i \f]
* - <b>First Order::Robust Mean Absolute Deviation</b>: The absolute deviation of all intensities within the ROI for
* all voxels between the 10% and 90% quantilefrom the robust mean intensity:
* \f[ \textup{Robust Mean Absolute Deviation}= \mu_R = \frac{1}{N_{vr}} \sum \left \| x_i - \mu_R \right \| \f]
* - <b>First Order::Median Absolute Deviation</b>: Similar to the mean absolute deviation, but uses the median
* instead of the mean to measure the center of the distribution.
* - <b>First Order::Coefficient Of Variation</b>: Measures the dispersion of the intensity distribution:
* \f[ \textup{Coefficient Of Variation} = \frac{sigma}{\mu} \f]
* - <b>First Order::Quantile Coefficient Of Dispersion</b>: A robust alternative to teh coefficient of variance:
* \f[ \textup{Quantile Coefficient Of Dispersion} = \frac{P_{75\%} - P_{25\%} }{P_{75\%} + P_{25\%}} \f]
* - <b>First Order::Energy</b>: The intensity energy:
* \f[ \textup{Energy} = \sum x_i ^2 \f]
* - <b>First Order::Root Mean Square</b>: Root mean square is an important measure for the error.
* \f[ \textup{Root Mean Square} = \sqrt{\frac{\sum x_i ^2}{N_v}} \f]
* - <b>First Order::Uniformity</b>:
* \f[ \textup{Uniformity} = \sum p_x^2 \f]
* - <b>First Order::Entropy</b>:
* \f[ \textup{Entropy} = - \sum p_x \textup{log}_2(p_x) \f]
* - <b>First Order::Entropy</b>:
* \f[ \textup{Entropy} = - \sum p_x \textup{log}_2(p_x) \f]
* - <b>First Order::Covered Image Intensity Range</b>: Percentage of the image intensity range (maximum - minimum in whole
* image) that is covered by the ROI.
* - <b>First Order::Sum</b>: The sum of all intensities. It is correlated to the mean intensity.
* \f[ \textup{Sum} = \sum x_i \f]
* - <b>First Order::Mode</b>: The most common intensity.
* - <b>First Order::Mode Probability</b>: The likelihood of the most common intensity.
* - <b>First Order::Number Of Voxels</b>: \f$ N_v \f$ the number of voxels covered by the ROI.
* - <b>First Order::Image Dimension</b>: The dimensionality of the image (e.g. 2D, 3D, etc.).
* - <b>First Order::Number Of Voxels</b>: The product of all spacing along all dimensions. In 3D, this is equal to the
* volume.
* - <b>First Order::Number Of Voxels</b>: The volume of a single voxel. If the dimensionality is only 2D, this is the
* surface of an voxel.
*/
- mitkClassMacro(GIFFirstOrderNumericStatistics,AbstractGlobalImageFeature)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(GIFFirstOrderNumericStatistics,AbstractGlobalImageFeature);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
GIFFirstOrderNumericStatistics();
/**
* \brief Calculates the First Order Features based on a binned version of the image.
*/
FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override;
/**
* \brief Returns a list of the names of all features that are calculated from this class
*/
FeatureNameListType GetFeatureNames() override;
std::string GetCurrentFeatureEncoding() override;
void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override;
void AddArguments(mitkCommandLineParser &parser) override;
};
}
#endif //mitkGIFFirstNumericOrderStatistics_h
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderStatistics.h b/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderStatistics.h
index 6802dbf026..ea3951b622 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderStatistics.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderStatistics.h
@@ -1,160 +1,160 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFFirstOrderStatistics_h
#define mitkGIFFirstOrderStatistics_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
class MITKCLUTILITIES_EXPORT GIFFirstOrderStatistics : public AbstractGlobalImageFeature
{
public:
/**
* \brief Calculates first order statistics of the given image.
*
* The first order statistics for the intensity distribution within a given Region of Interest (ROI)
* is caluclated. The ROI is defined using a mask.
*
* The features are calculated on a quantified image. If the bin-size is too big, the obtained values
* can be errornous and missleading. It is therefore important to use enough bins. The binned approach is
* used in order to avoid floating-point related errors.
*
* This feature calculator is activated by the option <b>-first-order</b> or <b>-fo</b>.
*
* The connected areas are based on the binned image, the binning parameters can be set via the default
* parameters as described in AbstractGlobalImageFeature. It is also possible to determine the
* dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature.
* No other options are possible beside these two options.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image. All voxels with the value 1 are treated as masked.
*
* The following features are then defined using the (binned) voxel intensity \f$ x_i \f$ of each voxel, the probability
* an intensity \f$ p_x \f$, and the overall number of voxels within the mask \f$ N_v \f$:
* - <b>First Order::Mean</b>: The mean intensity within the ROI
* \f[ \textup{Mean}= \mu = \frac{1}{N_v} \sum x_i \f]
* - <b>First Order::Unbiased Variance</b>: An unbiased estimation of the variance:
* \f[ \textup{Unbiased Variance} = \frac{1}{N_v - 1} \sum \left( x_i - \mu \right)^2 \f]
* - <b>First Order::Biased Variance</b>: An biased estimation of the variance. If not specified otherwise, this is
* used as the variance:
* \f[ \textup{Biased Variance} = \sigma^2 = \frac{1}{N_v} \sum \left( x_i - \mu \right)^2 \f]
* - <b>First Order::Unbiased Standard Deviation</b>: Estimation of diversity within the intensity values
* \f[ \textup{Unbiased Standard Deviation} = \sqrt{\frac{1}{N_v-1} \sum \left( x_i - \mu \right)^2} \f]
* - <b>First Order::Biased Standard Deviation</b>: Estimation of diversity within the intensity values
* \f[ \textup{Biased Standard Deviation} = \sigma = \sqrt{\frac{1}{N_v} \sum \left( x_i - \mu \right)^2} \f]
* - <b>First Order::Skewness</b>:
* \f[ \textup{Skewness} = \frac{\frac{1}{N_v} \sum \left( x_i - \mu \right)^3}{\sigma^3} \f]
* - <b>First Order::Kurtosis</b>: The kurtosis is a measurement of the peakness of the given
* distirbution:
* \f[ \textup{Kurtosis} = \frac{\frac{1}{N_v} \sum \left( x_i - \mu \right)^4}{\sigma^4} \f]
* - <b>First Order::Excess Kurtosis</b>: The kurtosis is a measurement of the peakness of the given
* distirbution. The excess kurtosis is similar to the kurtosis, but is corrected by a fisher correction,
* ensuring that a gaussian distribution has an excess kurtosis of 0.
* \f[ \textup{Excess Kurtosis} = \frac{\frac{1}{N_v} \sum \left( x_i - \mu \right)^4}{\sigma^4} - 3 \f]
* - <b>First Order::Median</b>: The median is defined as the median of the all intensities in the ROI.
* - <b>First Order::Minimum</b>: The minimum is defined as the minimum of the all intensities in the ROI.
* - <b>First Order::05th Percentile</b>: \f$ P_{5\%} \f$ The 5% percentile. 5% of all voxel do have this or a lower intensity.
* - <b>First Order::10th Percentile</b>: \f$ P_{10\%} \f$ The 10% percentile. 10% of all voxel do have this or a lower intensity.
* - <b>First Order::15th Percentile</b>: \f$ P_{15\%} \f$ The 15% percentile. 15% of all voxel do have this or a lower intensity.
* - <b>First Order::20th Percentile</b>: \f$ P_{20\%} \f$ The 20% percentile. 20% of all voxel do have this or a lower intensity.
* - <b>First Order::25th Percentile</b>: \f$ P_{25\%} \f$ The 25% percentile. 25% of all voxel do have this or a lower intensity.
* - <b>First Order::30th Percentile</b>: \f$ P_{30\%} \f$ The 30% percentile. 30% of all voxel do have this or a lower intensity.
* - <b>First Order::35th Percentile</b>: \f$ P_{35\%} \f$ The 35% percentile. 35% of all voxel do have this or a lower intensity.
* - <b>First Order::40th Percentile</b>: \f$ P_{40\%} \f$ The 40% percentile. 40% of all voxel do have this or a lower intensity.
* - <b>First Order::45th Percentile</b>: \f$ P_{45\%} \f$ The 45% percentile. 45% of all voxel do have this or a lower intensity.
* - <b>First Order::50th Percentile</b>: \f$ P_{50\%} \f$ The 50% percentile. 50% of all voxel do have this or a lower intensity.
* - <b>First Order::55th Percentile</b>: \f$ P_{55\%} \f$ The 55% percentile. 55% of all voxel do have this or a lower intensity.
* - <b>First Order::60th Percentile</b>: \f$ P_{60\%} \f$ The 60% percentile. 60% of all voxel do have this or a lower intensity.
* - <b>First Order::65th Percentile</b>: \f$ P_{65\%} \f$ The 65% percentile. 65% of all voxel do have this or a lower intensity.
* - <b>First Order::70th Percentile</b>: \f$ P_{70\%} \f$ The 70% percentile. 70% of all voxel do have this or a lower intensity.
* - <b>First Order::75th Percentile</b>: \f$ P_{75\%} \f$ The 75% percentile. 75% of all voxel do have this or a lower intensity.
* - <b>First Order::80th Percentile</b>: \f$ P_{80\%} \f$ The 80% percentile. 80% of all voxel do have this or a lower intensity.
* - <b>First Order::85th Percentile</b>: \f$ P_{85\%} \f$ The 85% percentile. 85% of all voxel do have this or a lower intensity.
* - <b>First Order::90th Percentile</b>: \f$ P_{90\%} \f$ The 90% percentile. 90% of all voxel do have this or a lower intensity.
* - <b>First Order::95th Percentile</b>: \f$ P_{95\%} \f$ The 95% percentile. 95% of all voxel do have this or a lower intensity.
* - <b>First Order::Maximum</b>: The maximum is defined as the minimum of the all intensities in the ROI.
* - <b>First Order::Range</b>: The range of intensity values is defined as the difference between the maximum
* and minimum intensity in the ROI.
* - <b>First Order::Interquartile Range</b>: The difference between the 75% and 25% quantile.
* - <b>First Order::Mean Absolute Deviation</b>: The mean absolute deviation gives the mean distance of each
* voxel intensity to the overal mean intensity and is a measure of the dispersion of the intensity form the
* mean value:
* \f[ \textup{Mean Absolute Deviation} = \frac{1}{N_v} \sum \left \| x_i - \mu \right \| \f]
* - <b>First Order::Robust Mean</b>: The mean intensity within the ROI for all voxels between the 10% and 90% quantile:
* \f[ \textup{Robust Mean}= \mu_R = \frac{1}{N_{vr}} \sum x_i \f]
* - <b>First Order::Robust Mean Absolute Deviation</b>: The absolute deviation of all intensities within the ROI for
* all voxels between the 10% and 90% quantilefrom the robust mean intensity:
* \f[ \textup{Robust Mean Absolute Deviation}= \mu_R = \frac{1}{N_{vr}} \sum \left \| x_i - \mu_R \right \| \f]
* - <b>First Order::Median Absolute Deviation</b>: Similar to the mean absolute deviation, but uses the median
* instead of the mean to measure the center of the distribution.
* - <b>First Order::Coefficient Of Variation</b>: Measures the dispersion of the intensity distribution:
* \f[ \textup{Coefficient Of Variation} = \frac{sigma}{\mu} \f]
* - <b>First Order::Quantile Coefficient Of Dispersion</b>: A robust alternative to teh coefficient of variance:
* \f[ \textup{Quantile Coefficient Of Dispersion} = \frac{P_{75\%} - P_{25\%} }{P_{75\%} + P_{25\%}} \f]
* - <b>First Order::Energy</b>: The intensity energy:
* \f[ \textup{Energy} = \sum x_i ^2 \f]
* - <b>First Order::Root Mean Square</b>: Root mean square is an important measure for the error.
* \f[ \textup{Root Mean Square} = \sqrt{\frac{\sum x_i ^2}{N_v}} \f]
* - <b>First Order::Uniformity</b>:
* \f[ \textup{Uniformity} = \sum p_x^2 \f]
* - <b>First Order::Entropy</b>:
* \f[ \textup{Entropy} = - \sum p_x \textup{log}_2(p_x) \f]
* - <b>First Order::Entropy</b>:
* \f[ \textup{Entropy} = - \sum p_x \textup{log}_2(p_x) \f]
* - <b>First Order::Covered Image Intensity Range</b>: Percentage of the image intensity range (maximum - minimum in whole
* image) that is covered by the ROI.
* - <b>First Order::Sum</b>: The sum of all intensities. It is correlated to the mean intensity.
* \f[ \textup{Sum} = \sum x_i \f]
* - <b>First Order::Mode</b>: The most common intensity.
* - <b>First Order::Mode Probability</b>: The likelihood of the most common intensity.
* - <b>First Order::Number Of Voxels</b>: \f$ N_v \f$ the number of voxels covered by the ROI.
* - <b>First Order::Image Dimension</b>: The dimensionality of the image (e.g. 2D, 3D, etc.).
* - <b>First Order::Number Of Voxels</b>: The product of all spacing along all dimensions. In 3D, this is equal to the
* volume.
* - <b>First Order::Number Of Voxels</b>: The volume of a single voxel. If the dimensionality is only 2D, this is the
* surface of an voxel.
*/
- mitkClassMacro(GIFFirstOrderStatistics,AbstractGlobalImageFeature)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(GIFFirstOrderStatistics,AbstractGlobalImageFeature);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
GIFFirstOrderStatistics();
/**
* \brief Calculates the First Order Features based on a binned version of the image.
*/
FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override;
/**
* \brief Returns a list of the names of all features that are calculated from this class
*/
FeatureNameListType GetFeatureNames() override;
std::string GetCurrentFeatureEncoding() override;
void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override;
void AddArguments(mitkCommandLineParser &parser) override;
struct ParameterStruct {
double MinimumIntensity;
double MaximumIntensity;
int Bins;
std::string prefix;
};
};
}
#endif //mitkGIFFirstOrderStatistics_h
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelDistanceZone.h b/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelDistanceZone.h
index 6b30c3b84c..36382c6b7f 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelDistanceZone.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelDistanceZone.h
@@ -1,190 +1,190 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFGreyLevelDistanceZone_h
#define mitkGIFGreyLevelDistanceZone_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
#include <Eigen/src/Core/Array.h>
namespace mitk
{
struct GreyLevelDistanceZoneFeatures
{
GreyLevelDistanceZoneFeatures() :
SmallDistanceEmphasis(0),
LargeDistanceEmphasis(0),
LowGreyLevelEmphasis(0),
HighGreyLevelEmphasis(0),
SmallDistanceLowGreyLevelEmphasis(0),
SmallDistanceHighGreyLevelEmphasis(0),
LargeDistanceLowGreyLevelEmphasis(0),
LargeDistanceHighGreyLevelEmphasis(0),
GreyLevelNonUniformity(0),
GreyLevelNonUniformityNormalized(0),
ZoneDistanceNonUniformity(0),
ZoneDistanceNoneUniformityNormalized(0),
ZonePercentage(0),
GreyLevelMean(0),
GreyLevelVariance(0),
ZoneDistanceMean(0),
ZoneDistanceVariance(0),
ZoneDistanceEntropy(0)
{
}
public:
double SmallDistanceEmphasis;
double LargeDistanceEmphasis;
double LowGreyLevelEmphasis;
double HighGreyLevelEmphasis;
double SmallDistanceLowGreyLevelEmphasis;
double SmallDistanceHighGreyLevelEmphasis;
double LargeDistanceLowGreyLevelEmphasis;
double LargeDistanceHighGreyLevelEmphasis;
double GreyLevelNonUniformity;
double GreyLevelNonUniformityNormalized;
double ZoneDistanceNonUniformity;
double ZoneDistanceNoneUniformityNormalized;
double ZonePercentage;
double GreyLevelMean;
double GreyLevelVariance;
double ZoneDistanceMean;
double ZoneDistanceVariance;
double ZoneDistanceEntropy;
};
class MITKCLUTILITIES_EXPORT GIFGreyLevelDistanceZone : public AbstractGlobalImageFeature
{
/**
* \brief Calculates the Grey Level Distance Zone
*
* This class can be used to calculate Grey Level Distance Zone as presented in Thibault et al. 2014.
*
* The basic idea behind the Grey Level Distance Zone based features is to count the connected areas
* with a given intensity value \f$x_i\f$ and a given distance to the border of each segmentation \f$d_i\f$.
* Several features are then calculated based on a matrix, that gives the number of occurence for each
* combination of \f$x_i\f$ and \f$ d_i \f$ as \f$m_{x,d}\f$.
*
* This feature calculator is activated by the option <b>-grey-level-distance-zone</b> or <b>-gldz</b>.
*
* The connected areas are based on the binned image, the binning parameters can be set via the default
* parameters as described in AbstractGlobalImageFeature. It is also possible to determine the
* dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature.
* No other options are possible beside these two options.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image. It is expected that the image contains only voxels with value 0 and 1,
* of which all voxels with an value equal to one are treated as masked.
*
* The features depend on the distance to the border of the segmentation ROI. In some cases, the border
* definition might be different from the definition of the masked area, for example, if small openings
* in the mask should not influence the distance. Due to that, it is possible to submit a second mask,
* named Morphological Mask to the features that is then used to calculate the distance of each voxel to
* border of the segmented area. The morpological mask can be either set by the function call SetMorphMask()
* or by the corresponding global option. (Not parsed by the filter itself, but by the command line tool).
*
* Beside the complete matrix, which is represented by its individual elements \f$m_{x,d}\f$, som eadditional
* values are used for the definition. \f$N_g\f$ is the number of discrete grey levels, \f$ N_d\f$ the number
* (or maximum value) of possible distances, and \f$N_s\f$ the total number of zones.
* \f$m_{x,d}\f$ gives the number of connected areas with the discrete
* grey level x and distance to the boarder of d. Corresponding, \f$p_{x,d} = \frac{m_{x,d}}{N_s} gives the relativ
* probability of this matrix cell. \f$ \f$N_v\f$ is the number of voxels. In addition, the marginal
* sums \f$m_{x,\cdot} = m_x = \sum_d m_{x,d} \f$ , representing the sum of all zones with a given intensity, and
* sums \f$m_{\cdot, d} = m_d = \sum_x m_{x,d} \f$ , representing the sum of all zones with a given distance, are used.
* The distance are given as the number of voxels to the border and the voxel intensity is given as the
* bin number of the binned image, starting with 1.
*
* The following features are then defined:
* - <b>Grey Level Distance Zone::Small Distance Emphasis</b>:
* \f[ \textup{Small Distance Emphasis}= \frac{1}{N_s} \sum_d \frac{m_d}{d^2} \f]
* - <b>Grey Level Distance Zone::Large Distance Emphasis</b>:
* \f[ \textup{Large Distance Emphasis}= \frac{1}{N_s} \sum_d d^2 m_d \f]
* - <b>Grey Level Distance Zone::Low Grey Level Emphasis</b>:
* \f[ \textup{Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \frac{m_x}{x^2} \f]
* - <b>Grey Level Distance Zone::High Grey Level Emphasis</b>:
* \f[ \textup{High Grey Level Emphasis}= \frac{1}{N_s} \sum_x x^2 m_x \f]
* - <b>Grey Level Distance Zone::Small Distance Low Grey Level Emphasis</b>:
* \f[ \textup{Small Distance Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_d \frac{ m_{x,d}}{x^2 d^2}\f]
* - <b>Grey Level Distance Zone::Small Distance High Grey Level Emphasis</b>:
* \f[ \textup{Small Distance High Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_d \frac{x^2 m_{x,d}}{d^2}\f]
* - <b>Grey Level Distance Zone::Large Distance Low Grey Level Emphasis</b>:
* \f[ \textup{Large Distance Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_d \frac{d^2 m_{x,d}}{x^2}\f]
* - <b>Grey Level Distance Zone::Large Distance High Grey Level Emphasis</b>:
* \f[ \textup{Large Distance High Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_d \x^2 d^2 m_{x,d} \f]
* - <b>Grey Level Distance Zone::Grey Level Non-Uniformity</b>:
* \f[ \textup{Grey Level Non-Uniformity}= \frac{1}{N_s} \sum_x m_x^2 \f]
* - <b>Grey Level Distance Zone::Grey Level Non-Uniformity Normalized</b>:
* \f[ \textup{Grey Level Non-Uniformity Normalized}= \frac{1}{N_s^2} \sum_x m_x^2 \f]
* - <b>Grey Level Distance Zone::Zone Distance Non-Uniformity</b>:
* \f[ \textup{Grey Level Non-Uniformity}= \frac{1}{N_s} \sum_d m_d^2 \f]
* - <b>Grey Level Distance Zone::Zone Distance Non-Uniformity Normalized</b>:
* \f[ \textup{Grey Level Non-Uniformity Normalized}= \frac{1}{N_s^2} \sum_d m_d^2 \f]
* - <b>Grey Level Distance Zone::Zone Percentage</b>: The ratio of zones to the possible zones:
* \f[ \textup{Zone Percentage}= \frac{N_s}{N_v} \f]
* - <b>Grey Level Distance Zone::Grey Level Mean</b>:
* \f[ \textup{Grey Level Mean}= \mu_x = \sum_x \sum_d x p_{x,d} \f]
* - <b>Grey Level Distance Zone::Grey Level Variance</b>:
* \f[ \textup{Grey Level Variance} = \sum_x \sum_d \left(x - \mu_x \right)^2 p_{x,d} \f]
* - <b>Grey Level Distance Zone::Zone Distance Mean</b>:
* \f[ \textup{Zone Distance Mean}= \mu_d = \sum_x \sum_d d p_{x,d} \f]
* - <b>Grey Level Distance Zone::Zone Distance Variance</b>:
* \f[ \textup{Zone Distance Variance} = \sum_x \sum_d \left(d - \mu_d \right)^2 p_{x,d} \f]
* - <b>Grey Level Distance Zone::Zone Distance Entropy </b>:
* \f[ \textup{Zone Distance Entropy} = - \sum_x \sum_d p_{x,d} \textup{log}_2 ( p_{x,d} ) \f]
* - <b>Grey Level Distance Zone::Grey Level Entropy </b>:
* \f[ \textup{Grey Level Entropy} = - \sum_x \sum_d p_{x,d} \textup{log}_2 ( p_{x,d} ) \f]
*/
public:
mitkClassMacro(GIFGreyLevelDistanceZone, AbstractGlobalImageFeature);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
GIFGreyLevelDistanceZone();
/**
* \brief Calculates the Cooccurence-Matrix based features for this class.
*/
FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override;
/**
* \brief Returns a list of the names of all features that are calculated from this class
*/
FeatureNameListType GetFeatureNames() override;
void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override;
void AddArguments(mitkCommandLineParser &parser) override;
std::string GetCurrentFeatureEncoding() override;
struct GIFGreyLevelDistanceZoneConfiguration
{
mitk::Image::Pointer distanceMask;
mitk::IntensityQuantifier::Pointer Quantifier;
unsigned int direction;
double MinimumIntensity;
double MaximumIntensity;
int Bins;
std::string prefix;
};
private:
};
}
#endif //mitkGIFGreyLevelDistanceZone_h
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelRunLength.h b/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelRunLength.h
index f2f7efd85e..84a57b3bea 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelRunLength.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelRunLength.h
@@ -1,131 +1,131 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFGreyLevelRunLength_h
#define mitkGIFGreyLevelRunLength_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
/**
* \brief Calculates the Run Length based features.
*
* Grey Level Run Length based features are calcualted using the Run-Length-Matrix and were originally
* defined by Galloway (1975). The basic idea behind this feature is to measure the length of
* lines with similar intensity in an image. This allows to asses line-based structures in an image.
* For this, the Run-Length-Matrix created that gives the number of lines \f$ m_{x,l} \f$ with the intensity \f$ x \f$ and
* the length of \f$ l \f$ with the given intensity.
*
* The image is quantified prior to the calculation of the features. This reduces the number of
* available intensity values. Instead of using the pure intensity value, the features are
* calculated using the number of the bins as intensity value \f$ x_i \f$. The parameter of the
* quantification of the image can be controlled using the general binning parameters as defined
* in AbstractGlobalImageFeature.
*
* By default, the calculation is based on a 26 neighourhood for 3D and a 8 neighbourhood in 2D. It is further
* possible to exclude directions from the calculation, e.g. calculating the feature in 2D, even if a
* 3D image is passed. This is controlled by determine the
* dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature.
* No other options are possible beside these two options.
*
* This feature calculator is activated by the option <b>-run-length</b> or <b>-rl</b>.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the same type as the input image. All voxels with a value greater 0.5 are treated as masked.
*
* Several values are definied for the definition of the features. \f$ N_v \f$ is the number of masked voxels,
* \f$N_s \f$ is the number of different lines, \f$ m_{x,\cdot} = \sum_l m{x,l} \f$ is the number of all lines
* with a given intensity value, and likewise \f$ m_{\cdot, l} = \sum_x m{x,l} \f$ is the number of all lines
* with a given length. There are two options how to make this feature orientation-invariant. Either calculating a
* single matrix for all directions and then extracting the features or by calculating a matrix per direction,
* calculating all features and then reporting the mean and standard deviation for each feature. The result
* of the first option is given with the extension "Comb.", the results for the second with "Std." and "Means".
* All three options are always calculated, although we state only one in the following list:
* - <b>Run Length::Short run emphasis Comb.</b>:
* \f[ \textup{Short run emphasis}= \frac{1}{N_s} \sum_l { \frac{m_{\cdot, l}}{l^2} } \f]
* - <b>Run Length::Long run emphasis Comb.</b>:
* \f[ \textup{Long run emphasis}= \frac{1}{N_s} \sum_l { m_{\cdot, l} l^2} \f]
* - <b>Run Length::Low grey level run emphasis Comb.</b>:
* \f[ \textup{Low grey level run emphasis}= \frac{1}{N_s} \sum_x { \frac{m_{x,\cdot}}{x^2} } \f]
* - <b>Run Length::High grey level run emphasis Comb.</b>:
* \f[ \textup{High grey level run emphasis}= \frac{1}{N_s} \sum_x { m_{x,\cdot} x^2} \f]
* - <b>Run Length::Short run low grey level emphasis Comb.</b>:
* \f[ \textup{Short run low grey level emphasis}= \frac{1}{N_s} \sum_x \sum_l { \frac{m_{x,l}}{x^2 l^2} } \f]
* - <b>Run Length::Short run high grey level emphasis Comb.</b>:
* \f[ \textup{Short run high grey level emphasis}= \frac{1}{N_s} \sum_x \sum_l { \frac{x^2 m_{x,s}}{l^2} } \f]
* - <b>Run Length::Long run low grey level emphasis Comb.</b>:
* \f[ \textup{Long run low grey level emphasis}= \frac{1}{N_s} \sum_x \sum_l { \frac{l^2 m_{x,l}}{x^2} } \f]
* - <b>Run Length::Long run high grey level emphasis Comb.</b>:
* \f[ \textup{Long run high grey level emphasis}= \frac{1}{N_s} \sum_x \sum_l { x^2 l^2 m_{x,l} } \f]
* - <b>Run Length::Grey level nonuniformity Comb.</b>:
* \f[ \textup{Grey level nonuniformity}= \frac{1}{N_s} \sum_x m_{x,\cdot}^2 \f]
* - <b>Run Length::Grey level nonuniformity normalized Comb.</b>:
* \f[ \textup{Grey level nonuniformity normalized}= \frac{1}{N_s^2} \sum_x m_{x,\cdot}^2 \f]
* - <b>Run Length::Run length nonuniformity</b>:
* \f[ \textup{Run length nonuniformity}= \frac{1}{N_s} \sum_l m_{\cdot, l}^2 \f]
* - <b>Run Length::Run length nonuniformity normalized</b>:
* \f[ \textup{Run length nonuniformity normalized}= \frac{1}{N_s^2} \sum_l m_{\cdot, l}^2 \f]
* - <b>Run Length::Run percentage</b>: The ratio of realized runs to the theoretical limit of zones:
* \f[ \textup{Run percentage}= \frac{N_s}{N_v} \f]
* - <b>Run Length::Grey level variance</b>:
* \f[ \textup{Grey level variance} = \frac{1}{N_s} \sum_x (x -mu_x)^2 m_{x, \cdot} \f]
* - <b>Run Length::Run length variance</b>:
* \f[ \textup{Run length variance} = \frac{1}{N_s} \sum_l (l -mu_l)^2 m_{\cdot, l} \f]
* - <b>Run Length::Run length entropy</b>: This feature would be equivalent with
* the Grey Level Entropy, which is therefore not included. It is based on the likelihood
* for a given intensity- size combination \f$ p_{x,s} = \frac{m_{x,s}}{N_s} \f$. :
* \f[ \textup{Run length entropy} = \sum_x \sum_s p_{x,s} \textup{log}_2 \left( p{_x,s} \right) \f]
* - <b>Run Length::Number of runs</b>: The overall number of realized runs:
* \f[ \textup{Number of runs} = \sum m_{x, l} \f]
*/
class MITKCLUTILITIES_EXPORT GIFGreyLevelRunLength : public AbstractGlobalImageFeature
{
public:
- mitkClassMacro(GIFGreyLevelRunLength,AbstractGlobalImageFeature)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(GIFGreyLevelRunLength,AbstractGlobalImageFeature);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
GIFGreyLevelRunLength();
/**
* \brief Calculates the Cooccurence-Matrix based features for this class.
*/
FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override;
/**
* \brief Returns a list of the names of all features that are calculated from this class
*/
FeatureNameListType GetFeatureNames() override;
void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override;
void AddArguments(mitkCommandLineParser &parser) override;
std::string GetCurrentFeatureEncoding() override;
struct ParameterStruct
{
unsigned int m_Direction;
double MinimumIntensity;
double MaximumIntensity;
int Bins;
std::string featurePrefix;
};
private:
};
}
#endif //mitkGIFGreyLevelRunLength_h
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelSizeZone.h b/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelSizeZone.h
index 9359425da4..018a090c71 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelSizeZone.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelSizeZone.h
@@ -1,127 +1,127 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFGreyLevelSizeZone_h
#define mitkGIFGreyLevelSizeZone_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
#include <Eigen/src/Core/Array.h>
namespace mitk
{
class MITKCLUTILITIES_EXPORT GIFGreyLevelSizeZone : public AbstractGlobalImageFeature
{
/**
* \brief Calculates the Grey level size zone based features.
*
* Grey level size zone based features are similar to Grey Level Cooccurence features. But instead
* of measuring the similarity within a given neighbourhood, the size of areas with the same intensity
* is assessed. For this, a matrix is created that gives the number of areas \f$ m_{x,s} \f$ with the intensity \f$ x \f$ and
* the size of \f$ s \f$. Each area is specified as connected voxels with the given intensity.
*
* The image is quantified prior to the calculation of the features. This reduces the number of
* available intensity values. Instead of using the pure intensity value, the features are
* calculated using the number of the bins as intensity value \f$ x_i \f$. The parameter of the
* quantification of the image can be controlled using the general binning parameters as defined
* in AbstractGlobalImageFeature.
*
* By default, the calculation is based on a 26 neighourhood for 3D and a 8 neighbourhood in 2D. It is further
* possible to exclude directions from the calculation, e.g. calculating the feature in 2D, even if a
* 3D image is passed. This is controlled by determine the
* dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature.
* No other options are possible beside these two options.
*
* This feature calculator is activated by the option <b>-grey-level-sizezone</b> or <b>-glsz</b>.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image. All voxels with the value 1 are treated as masked.
*
* Several values are definied for the definition of the features. \f$ N_v \f$ is the number of masked voxels,
* \f$N_s \f$ is the number of different zones, \f$ m_{x,\cdot} = \sum_s m{x,s} \f$ is the number of all areas
* with a given intensity value, and likewise \f$ m_{\cdot, s} = \sum_x m{x,s} \f$ is the number of all areas
* with a given size. The features are then defined as:
* - <b>Grey Level Size Zone::Small Zone Emphasis</b>:
* \f[ \textup{Small Zone Emphasis}= \frac{1}{N_s} \sum_s { \frac{m_{\cdot, s}}{s^2} } \f]
* - <b>Grey Level Size Zone::Large Zone Emphasis</b>:
* \f[ \textup{Large Zone Emphasis}= \frac{1}{N_s} \sum_s { m_{\cdot, s} s^2} \f]
* - <b>Grey Level Size Zone::Low Grey Level Zone Emphasis</b>:
* \f[ \textup{Low Grey Level Zone Emphasis}= \frac{1}{N_s} \sum_x { \frac{m_{x,\cdot}}{x^2} } \f]
* - <b>Grey Level Size Zone::High Grey Level Zone Emphasis</b>:
* \f[ \textup{High Grey Level Zone Emphasis}= \frac{1}{N_s} \sum_x { m_{x,\cdot} x^2} \f]
* - <b>Grey Level Size Zone::Small Zone Low Grey Level Emphasis</b>:
* \f[ \textup{Small Zone Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_s { \frac{m_{x,s}}{x^2 s^2} } \f]
* - <b>Grey Level Size Zone::Small Zone High Grey Level Emphasis</b>:
* \f[ \textup{Small Zone High Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_s { \frac{x^2 m_{x,s}}{s^2} } \f]
* - <b>Grey Level Size Zone::Large Zone Low Grey Level Emphasis</b>:
* \f[ \textup{Large Zone Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_s { \frac{s^2 m_{x,s}}{x^2} } \f]
* - <b>Grey Level Size Zone::Large Zone High Grey Level Emphasis</b>:
* \f[ \textup{Large Zone High Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_s { x^2 s^2 m_{x,s} } \f]
* - <b>Grey Level Size Zone::Grey Level Non-Uniformity</b>:
* \f[ \textup{Grey Level Non-Uniformity}= \frac{1}{N_s} \sum_x m_{x,\cdot}^2 \f]
* - <b>Grey Level Size Zone::Grey Level Non-Uniformity Normalized</b>:
* \f[ \textup{Grey Level Non-Uniformity Normalized}= \frac{1}{N_s^2} \sum_x m_{x,\cdot}^2 \f]
* - <b>Grey Level Size Zone::Zone Size Non-Uniformity</b>:
* \f[ \textup{Zone Size Non-Uniformity}= \frac{1}{N_s} \sum_s m_{\cdot, s}^2 \f]
* - <b>Grey Level Size Zone::Zone Size Non-Uniformity Normalized</b>:
* \f[ \textup{Zone Size Non-Uniformity Normalized}= \frac{1}{N_s^2} \sum_s m_{\cdot, s}^2 \f]
* - <b>Grey Level Size Zone::Zone Percentage</b>: The ratio of realized areas to the theoretical limit of zones:
* \f[ \textup{Zone Percentage}= \frac{N_s}{N_v} \f]
* - <b>Grey Level Size Zone::Grey Level Mean</b>:
* \f[ \textup{Grey Level Mean} = \mu_x = \frac{1}{N_s} \sum_x x m_{x, \cdot} \f]
* - <b>Grey Level Size Zone::Grey Level Variance</b>:
* \f[ \textup{Grey Level Variance} = \frac{1}{N_s} \sum_x (x -mu_x)^2 m_{x, \cdot} \f]
* - <b>Grey Level Size Zone::Zone Size Mean</b>:
* \f[ \textup{Zone Size Mean} = \mu_s = \frac{1}{N_s} \sum_s s m_{\cdot, s} \f]
* - <b>Grey Level Size Zone::Grey Level Variance</b>:
* \f[ \textup{Grey Level Variance} = \frac{1}{N_s} \sum_s (s -mu_s)^2 m_{\cdot, s} \f]
* - <b>Grey Level Size Zone::Zone Size Entropy</b>: This feature would be equivalent with
* the Grey Level Entropy, which is therefore not included. It is based on the likelihood
* for a given intensity- size combination \f$ p_{x,s} = \frac{m_{x,s}}{N_s} \f$. :
* \f[ \textup{Zone Size Entropy} = \sum_x \sum_s p_{x,s} \textup{log}_2 \left( p{_x,s} \right) \f]
*/
public:
mitkClassMacro(GIFGreyLevelSizeZone, AbstractGlobalImageFeature);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
GIFGreyLevelSizeZone();
/**
* \brief Calculates the Cooccurence-Matrix based features for this class.
*/
FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override;
/**
* \brief Returns a list of the names of all features that are calculated from this class
*/
FeatureNameListType GetFeatureNames() override;
void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override;
void AddArguments(mitkCommandLineParser &parser) override;
std::string GetCurrentFeatureEncoding() override;
struct GIFGreyLevelSizeZoneConfiguration
{
unsigned int direction;
double MinimumIntensity;
double MaximumIntensity;
int Bins;
std::string prefix;
};
};
}
#endif //mitkGIFGreyLevelSizeZone_h
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFImageDescriptionFeatures.h b/Modules/Classification/CLUtilities/include/mitkGIFImageDescriptionFeatures.h
index 68656016dc..7e295a0e7f 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFImageDescriptionFeatures.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFImageDescriptionFeatures.h
@@ -1,87 +1,87 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFImageDescriptionFeatures_h
#define mitkGIFImageDescriptionFeatures_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
/**
* \brief Calculates simple features that describe the given image / mask
*
* This class can be used to calculated simple image describing features that
* can be used to compare different images.
*
* This feature calculator is activated by the option "<b>-image-diagnostic</b>" or "<b>-id</b>".
* There are no parameters to further define the behavior of this feature calculator.
*
* The paramters for this image are calculated from two images, a mask and an intenstiy
* image. It is assumed that the mask is
* of the type of an unsigned short image and all voxels with an value larger or equal
* to one are treated as masked. (Standard MITK mask)
*
* The definition of X, Y, and Z axis depends on the image format and does not necessarily
* correlates with axial, coronal, and sagittal.
*
* The features of this calculator are:
* - <b>Diagnostic::Dimension X</b>: The number of voxels in the intensity image along the first image dimension.
* - <b>Diagnostic::Image Dimension Y</b>: The number of voxels in the intensity image along the second image dimension.
* - <b>Diagnostic::Image Dimension Z</b>: The number of voxels in the intensity image along the third image dimension.
* - <b>Diagnostic::Image Spacing X</b>: The spacing of the intensity image in the first image dimension.
* - <b>Diagnostic::Image Spacing Y</b>: The spacing of the intensity image in the second image dimension.
* - <b>Diagnostic::Image Spacing Z</b>: The spacing of the intensity image in the third image dimension.
* - <b>Diagnostic::Image Mean intensity</b>: The mean intensity of the whole image.
* - <b>Diagnostic::Image Minimum intensity</b>: The minimum intensity that occurs in the whole image.
* - <b>Diagnostic::Image Maximum intensity</b>: The maximum intensity that occurs in the whole image.
* - <b>Diagnostic::Mask Dimension X</b>: The number of voxels in the mask image along the first image dimension.
* - <b>Diagnostic::Mask Dimension Y</b>: The number of voxels in the mask image along the second image dimension.
* - <b>Diagnostic::Mask Dimension Z</b>: The number of voxels in the mask image along the third image dimension.
* - <b>Diagnostic::Mask bounding box X</b>: The distance between the maximum and minimum position of a masked voxel along the first axis.
* - <b>Diagnostic::Mask bounding box X</b>: The distance between the maximum and minimum position of a masked voxel along the second axis.
* - <b>Diagnostic::Mask bounding box X</b>: The distance between the maximum and minimum position of a masked voxel along the third axis.
* - <b>Diagnostic::Mask Spacing X</b>: The spacing of the mask image in the first image dimension.
* - <b>Diagnostic::Mask Spacing Y</b>: The spacing of the mask image in the second image dimension.
* - <b>Diagnostic::Mask Spacing Z</b>: The spacing of the mask image in the third image dimension.
* - <b>Diagnostic::Mask Voxel count</b>: The number of voxels that are masked.
* - <b>Diagnostic::Mask Mean intensity</b>: The mean intensity of all voxel that are masked. Also depends on the intensity image.
* - <b>Diagnostic::Mask Minimum intensity</b> The minimum masked intensity in the intensity image.
* - <b>Diagnostic::Mask Maximum intensity</b> The maximum masked intensity in the intensity image.
*/
class MITKCLUTILITIES_EXPORT GIFImageDescriptionFeatures : public AbstractGlobalImageFeature
{
public:
- mitkClassMacro(GIFImageDescriptionFeatures,AbstractGlobalImageFeature)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(GIFImageDescriptionFeatures,AbstractGlobalImageFeature);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
GIFImageDescriptionFeatures();
/**
* \brief Calculates the Cooccurence-Matrix based features for this class.
*/
FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &mask) override;
/**
* \brief Returns a list of the names of all features that are calculated from this class
*/
FeatureNameListType GetFeatureNames() override;
void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override;
void AddArguments(mitkCommandLineParser &parser) override;
};
}
#endif //mitkGIFImageDescriptionFeatures_h
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFIntensityVolumeHistogramFeatures.h b/Modules/Classification/CLUtilities/include/mitkGIFIntensityVolumeHistogramFeatures.h
index 0727f3db54..aab89fedd2 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFIntensityVolumeHistogramFeatures.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFIntensityVolumeHistogramFeatures.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFIntensityVolumeHistogramFeatures_h
#define mitkGIFIntensityVolumeHistogramFeatures_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
/**
* \brief Calculates the Intensity Volume Histogram features
*
* This class can be used to calculate the volume histogram and features that are calculated from
* it. It is based on the intensity-volume histogram (IVH) which describes the relation between the
* grey level index i (and the corresponding intensity \f§x_i\f$) and the volume fraction \f$f\f$ that
* with an intensity that is equal or greater than \f$x_i\f$. This feature is original proposed in
* El Naqa et al. Exploring feature-based approaches in PET images for prediciting cancer treatment outcomes.
* Pattern recognition 2009.
*
* This feature calculator is activated by the option "<b>-intensity-volume-histogram</b>" or "<b>-ivoh</b>".
* Beside the configuration of the histogram, which follows the describtion given in AbstractGlobalImageFeature
* there are no additional parameters to configure this feature. Remark that, different from other features,
* the number of bins is 1000 by default and not 256.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image and all voxels with an value of greater than zero
* are treated as masked.
*
* The resulting features are:
* - <b>Intensity Volume Histogram::Volume fration at 0.10 intensity</b>: The volume fraction with an intensity
* of greater or equal to 10% of the maximum intensity.
* - <b>Intensity Volume Histogram::Volume fration at 0.90 intensity</b>: The volume fraction with an intensity
* of greater or equal to 90% of the maximum intensity.
* - <b>Intensity Volume Histogram::Intensity at 0.10 volume</b>: The highest intensity so that at least
* 10% of the masked image area has the same or higher intensity.
* - <b>Intensity Volume Histogram::Intensity at 0.90 volume</b>: The highest intensity so that at least
* 10% of the masked image area has the same or higher intensity.
* - <b>Intensity Volume Histogram::Difference volume fration at 0.10 and 0.90 intensity</b>: The difference
* between the volume fraction at 10% intensity and 90% intensity.
* - <b>Intensity Volume Histogram::Difference intensity at 0.10 and 0.90 volume</b>: The intensity difference
* between the intenstiy of 90% of the volume and 10% volume.
* - <b>Intensity Volume Histogram::Area under IVH curve</b>: If the IVH is interpreted as curve, this value represents
* the area under the curve. It is calculated using the bin indexes rather than the intensity values.
*/
class MITKCLUTILITIES_EXPORT GIFIntensityVolumeHistogramFeatures : public AbstractGlobalImageFeature
{
public:
mitkClassMacro(GIFIntensityVolumeHistogramFeatures, AbstractGlobalImageFeature);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
GIFIntensityVolumeHistogramFeatures();
/**
* \brief Calculates the Cooccurence-Matrix based features for this class.
*/
FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override;
/**
* \brief Returns a list of the names of all features that are calculated from this class
*/
FeatureNameListType GetFeatureNames() override;
void AddArguments(mitkCommandLineParser &parser) override;
void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override;
std::string GetCurrentFeatureEncoding() override;
private:
};
}
#endif //mitkGIFIntensityVolumeHistogramFeatures_h
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFLocalIntensity.h b/Modules/Classification/CLUtilities/include/mitkGIFLocalIntensity.h
index d93788ccd0..feba7bb47a 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFLocalIntensity.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFLocalIntensity.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFLocalIntensity_h
#define mitkGIFLocalIntensity_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
/**
* \brief Calculates the local intensity features
*
* This class can be used to calcualte the local intensity. The local intensity is defined as the
* mean intensity in a cube with the volume \f$ 1 \textup{cm}^3\f$ which correspond to a radius
* of approximate 0.62 cm.
*
* This feature calculator is activated by the option <b>-local-intensity</b> or <b>-loci</b>.
*
* The range that is used to calculate the local intensity can be set using the function <b>SetRange</b>.
* To set it with parameters set the option <b>loci::range</b> which expects an float value that is
* interpreted as mm length of the radius. The default value is 6.2.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image and all voxels with an value of greater than zero
* are treated as masked.
*
* The resulting features are:
* - <b>Local Intensity::Local Intensity Peak</b>: This value is defined as the local intensity of the
* voxel with the highest intensity. If there are multiple voxels with the highest intensity, the mean
* of all local intensites of these voxels are reported.
* - <b>Local Intensity::Global Intensity Peak</b>: This value is defined as the highest local intensity
* that occur for all voxels within the mask.
*/
class MITKCLUTILITIES_EXPORT GIFLocalIntensity : public AbstractGlobalImageFeature
{
public:
mitkClassMacro(GIFLocalIntensity, AbstractGlobalImageFeature);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
GIFLocalIntensity();
/**
* \brief Calculates the Cooccurence-Matrix based features for this class.
*/
FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override;
/**
* \brief Returns a list of the names of all features that are calculated from this class
*/
FeatureNameListType GetFeatureNames() override;
void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override;
void AddArguments(mitkCommandLineParser &parser) override;
std::string GetCurrentFeatureEncoding() override;
itkGetConstMacro(Range, double);
itkSetMacro(Range, double);
private:
double m_Range;
};
}
#endif //mitkGIFLocalIntensity_h
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyLevelDifference.h b/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyLevelDifference.h
index 5e7c3a22ec..9e477d91bd 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyLevelDifference.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyLevelDifference.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFNeighbourhoodGreyLevelDifference_h
#define mitkGIFNeighbourhoodGreyLevelDifference_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
class MITKCLUTILITIES_EXPORT GIFNeighbourhoodGreyLevelDifference : public AbstractGlobalImageFeature
{
public:
- mitkClassMacro(GIFNeighbourhoodGreyLevelDifference,AbstractGlobalImageFeature)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(GIFNeighbourhoodGreyLevelDifference,AbstractGlobalImageFeature);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
GIFNeighbourhoodGreyLevelDifference();
/**
* \brief Calculates the Cooccurence-Matrix based features for this class.
*/
FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override;
/**
* \brief Returns a list of the names of all features that are calculated from this class
*/
FeatureNameListType GetFeatureNames() override;
itkGetConstMacro(Range,double);
itkSetMacro(Range, double);
itkGetConstMacro(UseCtRange, bool);
itkSetMacro(UseCtRange, bool);
void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override;
void AddArguments(mitkCommandLineParser &parser) override;
struct ParameterStruct
{
bool m_UseCtRange;
double m_Range;
unsigned int m_Direction;
};
private:
double m_Range;
bool m_UseCtRange;
};
}
#endif //mitkGIFNeighbourhoodGreyLevelDifference_h
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyToneDifferenceFeatures.h b/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyToneDifferenceFeatures.h
index a7980483a1..0929738d37 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyToneDifferenceFeatures.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyToneDifferenceFeatures.h
@@ -1,95 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFNeighbourhoodGreyToneDifferenceFeatures_h
#define mitkGIFNeighbourhoodGreyToneDifferenceFeatures_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
/**
* \brief Calculates the Neighbourhood Grey Tone Difference Features.
*
* This class can be used to calculate Neighbourhood Grey Tone Difference Features which have been introduced in
* Amadasun and King: Textural features corresponding to textural properties. IEEE Transactions on Systems, Man and Cybernetricy, 1989.
*
* The Neighbourhood Grey Tone Difference (NGTD) is based on a table and is calcualted using
* a defined neighbourhood for each voxel. Within this neighbourhood, the mean intensity of the neighbouring
* voxel is calculated \f$A_i\f$, i.e. the mean intensity of the neighbourhood excluding the center voxel.
* Based on this a table with four columns is calculated. The first column represents the voxel
* value, or in our implementation, the histogram bin index \f$i\f$. The second column represents the
* number of voxel with this intensity value \f$n_i\f$. The proability for each intensity value \f$p_i\f$, which
* is equal to the bin probability. And the sum of the absolut differences of the intensity of all voxels with this
* intensity and the mean intensity of their neighbourhood: \f[s_i = \sum \left \| i- A_i \right \| \f].
* Additional \f$ N_v\f$ is the number of voxels, \f$ N_g \f$ the number of bins, and \f$N_{g,p}\f$ the number of
* bins with a non-zero probability.
*
* This feature calculator is activated by the option <b>-neighbourhood-grey-tone-difference</b> or <b>-ngtd</b>.
*
* The range that is used to calculate the local intensity can be set using the function <b>SetRange</b>.
* To set it with parameters set the option <b>ngtd::range</b> which expects an int value n that is
* interpreted as voxel count. The neighbourhood includes symetrical n voxels additional
* to the center voxel in each directions. The default value for this parameter is 1.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image and all voxels with an value of greater than zero
* are treated as masked.
*
* For the definition of the features we use the sum, this is always the sum over the bins of the histogram.
* If the denominator of a feature evaluates to zero, the feature is defined as zero.
* The resulting features are:
* - <b>Neighbourhood Grey Tone Difference::Coarsness</b>: The coarsness is defined as :
* \f[ \textup{Coarsness}= \frac{1}{\sum p_i s_i} \f]
* - <b>Neighbourhood Grey Tone Difference::Contrast</b>: The contrast is defined as :
* \f[ \textup{contrast}= \left( \frac{1}{N_{g,p} ( N_{g,p} - 1) } \sum_i \sum_j p_i p_j (i-j)^2 \right) \left( \frac{1}{N_v} \sum s_i \right) \f]
* - <b>Neighbourhood Grey Tone Difference::Busyness</b>: for all bins with a non-zero probability
* \f[ \textup{busyness} = \frac{\sum p_i s_i}{\sum_i \sum_j \left \| i p_i - j p_j \right \| } \f]
* - <b>Neighbourhood Grey Tone Difference::Complexity</b>: for all bins with a non-zero probability
* \f[ \textup{complexity} = \frac{1}{N_v} \sum_i \sum_j \left \| i - j \right \| \frac{p_i s_i + p_j s_j}{p_i + p_j} \f]
* - <b>Neighbourhood Grey Tone Difference::Strength</b>: for all bins with a non-zero probability
* \f[ \textup{strength} = \frac{\sum_i \sum_j (p_i + p_j) (i + j)^2}{\sum_i s_i } \f]
*/
class MITKCLUTILITIES_EXPORT GIFNeighbourhoodGreyToneDifferenceFeatures : public AbstractGlobalImageFeature
{
public:
mitkClassMacro(GIFNeighbourhoodGreyToneDifferenceFeatures, AbstractGlobalImageFeature);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
GIFNeighbourhoodGreyToneDifferenceFeatures();
/**
* \brief Calculates the Cooccurence-Matrix based features for this class.
*/
FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override;
/**
* \brief Returns a list of the names of all features that are calculated from this class
*/
FeatureNameListType GetFeatureNames() override;
std::string GetCurrentFeatureEncoding() override;
void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override;
void AddArguments(mitkCommandLineParser &parser) override;
itkSetMacro(Range, int);
itkGetConstMacro(Range, int);
private:
int m_Range;
};
}
#endif //mitkGIFNeighbourhoodGreyToneDifferenceFeatures_h
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFNeighbouringGreyLevelDependenceFeatures.h b/Modules/Classification/CLUtilities/include/mitkGIFNeighbouringGreyLevelDependenceFeatures.h
index fa2fe13988..7731056524 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFNeighbouringGreyLevelDependenceFeatures.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFNeighbouringGreyLevelDependenceFeatures.h
@@ -1,164 +1,164 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFNeighbouringGreyLevelDependenceFeatures_h
#define mitkGIFNeighbouringGreyLevelDependenceFeatures_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
#include <Eigen/src/Core/Array.h>
namespace mitk
{
/**
* \brief Calculates the Neighbouring Grey Level Dependence Features
*
* The Neighbouring Grey Level Dependence Features were proposed by Sun and Wee (1983) and
* capture the coarsness of the image texture. They are rotational invariant.
*
* The features are calculated on a matrix \f$ m \f$. To obtain the matrix, a neighbourhood
* around each feature is calculated and the number of voxels within the neighbourhood that
* are greater than the center voxel plus \f$ \alpha \f$ is counted. This is called the
* number of dependence voxels. The matrix gives the
* number of voxels with an intesity \f$ x \f$ and $\f d \f$ dependence neighbourhood voxels.
*
* The image is quantified prior to the calculation of the features. This reduces the number of
* available intensity values. Instead of using the pure intensity value, the features are
* calculated using the number of the bins as intensity value \f$ x_i \f$. The parameter of the
* quantification of the image can be controlled using the general binning parameters as defined
* in AbstractGlobalImageFeature.
*
* By default, the calculation is based on a 26 neighourhood for 3D and a 8 neighbourhood in 2D. It is further
* possible to exclude directions from the calculation, e.g. calculating the feature in 2D, even if a
* 3D image is passed. This is controlled by determine the
* dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature.
*
* In addition to this, the size of the neighbourhood can be controlled by setting the parameter
* <b>ngld::range</b>. By default it is one. To pass more than one range, separate the ranges with
* a semicolon. E.g. 1;2;3 would calculate the features for the ranges 1, 2, and 3.
*
* This feature calculator is activated by the option <b>-neighbouring-grey-level-dependence</b>
* or <b>-ngld</b>.
*
* The features are calculated based on a mask. It is assumed that the mask is
* a unsigned short image. All voxels with a value greater 0 are treated as masked.
*
* Several values are definied for the definition of the features. \f$ N_v \f$ is the number of masked voxels,
* \f$N_s \f$ is the number of neighbourhoods, \f$ m_{x,\cdot} = \sum_d m{x,d} \f$ is the number of neighbourhoods
* with a given intensity value, and likewise \f$ m_{\cdot, d} = \sum_x m{x,d} \f$ is the number of neighbourhoods
* with a given number of dependence features:
* - <b>Neighbouring Grey Level Dependence::Low Dependence Emphasis</b>:
* \f[ \textup{Low dependence emphasis}= \frac{1}{N_s} \sum_d { \frac{m_{\cdot, d}}{d^2} } \f]
* - <b>Neighbouring Grey Level Dependence::High Dependence Emphasis</b>:
* \f[ \textup{High dependence emphasis}= \frac{1}{N_s} \sum_d { m_{\cdot, d} d^2} \f]
* - <b>Neighbouring Grey Level Dependence::Low Grey Level Count Emphasis</b>:
* \f[ \textup{Low grey level count emphasis}= \frac{1}{N_s} \sum_x { \frac{m_{x,\cdot}}{x^2} } \f]
* - <b>Neighbouring Grey Level Dependence::High Grey Level Count Emphasis</b>:
* \f[ \textup{High grey level count emphasis}= \frac{1}{N_s} \sum_x { m_{x,\cdot} x^2} \f]
* - <b>Neighbouring Grey Level Dependence::Low Dependence Low Grey Level Emphasis</b>:
* \f[ \textup{Low Dependence Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_d { \frac{m_{x,d}}{x^2 d^2} } \f]
* - <b>Neighbouring Grey Level Dependence::Low Dependence High Grey Level Emphasis</b>:
* \f[ \textup{Low dependence high grey level emphasis}= \frac{1}{N_s} \sum_x \sum_d { \frac{x^2 m_{x,d}}{d^2} } \f]
* - <b>Neighbouring Grey Level Dependence::High Dependence Low Grey Level Emphasis</b>:
* \f[ \textup{High Dependence Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_d { \frac{d^2 m_{x,d}}{x^2} } \f]
* - <b>Neighbouring Grey Level Dependence::High Dependence High Grey Level Emphasis</b>:
* \f[ \textup{High dependence high grey level emphasis}= \frac{1}{N_s} \sum_x \sum_d { x^2 d^2 m_{x,d} } \f]
* - <b>Neighbouring Grey Level Dependence::Grey level nonuniformity</b>:
* \f[ \textup{Grey level nonuniformity}= \frac{1}{N_s} \sum_x m_{x,\cdot}^2 \f]
* - <b>Neighbouring Grey Level Dependence::Grey level nonuniformity normalized</b>:
* \f[ \textup{Grey level nonuniformity normalized}= \frac{1}{N_s^2} \sum_x m_{x,\cdot}^2 \f]
* - <b>Neighbouring Grey Level Dependence::Dependence Count Nonuniformity</b>:
* \f[ \textup{Dependence count nonuniformity}= \frac{1}{N_s} \sum_d m_{\cdot, d}^2 \f]
* - <b>Neighbouring Grey Level Dependence::Dependence Count Nonuniformity Normalized</b>:
* \f[ \textup{Dependence count nonuniformity normalized}= \frac{1}{N_s^2} \sum_d m_{\cdot, d}^2 \f]
* - <b>Neighbouring Grey Level Dependence::DEpendence Count Percentage</b> THe number of realized
* neighbourhoods relativ to the theoretical maximum of realized neighbourhoods. This feature is always
* one for this implementation as partial neighbourhoods are still considered.
* - <b>Neighbouring Grey Level Dependence::Grey Level Mean</b>: The mean value of all grey level.
* \f[ \textup{Grey Level Mean} = \mu_x = \frac{1}{N_s} \sum_x x m_{x,\cdot} \f]
* - <b>Neighbouring Grey Level Dependence::Grey Level Variance</b>:
* \f[ \textup{Grey level variance} = \frac{1}{N_s} \sum_x (x -mu_x)^2 m_{x, \cdot} \f]
* - <b>Neighbouring Grey Level Dependence::Dependence Count Mean</b>: The mean value of all dependence counts.
* \f[ \textup{Dependence count mean} = \mu_d = \frac{1}{N_s} \sum_d d m_{\cdot,d} \f]
* - <b>Neighbouring Grey Level Dependence::Dependence Count Variance</b>:
* \f[ \textup{Dependence count variance} = \frac{1}{N_s} \sum_d (d -mu_d)^2 m_{\cdot, d} \f]
* - <b>Neighbouring Grey Level Dependence::Dependence Count Entropy</b>: This feature would be equivalent with
* the Grey Level Entropy, which is therefore not included. It is based on the likelihood
* for a given intensity- size combination \f$ p_{x,d} = \frac{m_{x,d}}{N_s} \f$. :
* \f[ \textup{Dependence count entropy} = \sum_x \sum_d p_{x,d} \textup{log}_2 \left( p_{x,d} \right) \f]
* - <b>Neighbouring Grey Level Dependence::Dependence Count Energy</b>: This feature would be equivalent with
* the Grey Level Energy, which is therefore not included. It is based on the likelihood
* for a given intensity- size combination \f$ p_{x,d} = \frac{m_{x,d}}{N_s} \f$. :
* \f[ \textup{Dependence count energy} = \sum_x \sum_d p_{x,d}^2 \f]
* - <b>Neighbouring Grey Level Dependence::Expected Neighbourhood Size</b>: The expected size of a
* full neighbourhood. It depends on the dimension of the area that is looked at.
* - <b>Neighbouring Grey Level Dependence::Average Neighbourhood Size</b>: The feature calculation
* allows to consider partially masked neighbourhoods. Due to that, some neighbourhoods might be smaller.
* This feature gives not the theoretical neighbourhood size but the average realized neighbourhood sizes.
* - <b>Neighbouring Grey Level Dependence::Average Incomplete Neighbourhood Size</b>: Gives the average
* size of all neighbourhoods that are not complete.
* - <b>Neighbouring Grey Level Dependence::Percentage of complete Neighbourhoods</b>: Gives the percentage
* of all complete neighbourhoods from all realized neighbourhoods.
* - <b>Neighbouring Grey Level Dependence::Percentage of Dependence Neighbour Voxels</b>: Gives the
* percentage of voxels in all neighbourhoods compared to the expected number of voxels.
*/
class MITKCLUTILITIES_EXPORT GIFNeighbouringGreyLevelDependenceFeature : public AbstractGlobalImageFeature
{
public:
- mitkClassMacro(GIFNeighbouringGreyLevelDependenceFeature, AbstractGlobalImageFeature)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(GIFNeighbouringGreyLevelDependenceFeature, AbstractGlobalImageFeature);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
GIFNeighbouringGreyLevelDependenceFeature();
/**
* \brief Calculates the Cooccurence-Matrix based features for this class.
*/
FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override;
/**
* \brief Returns a list of the names of all features that are calculated from this class
*/
FeatureNameListType GetFeatureNames() override;
std::string GetCurrentFeatureEncoding() override;
itkGetConstMacro(Range,double);
itkSetMacro(Range, double);
itkGetConstMacro(Alpha, int);
itkSetMacro(Alpha, int);
void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override;
void AddArguments(mitkCommandLineParser &parser) override;
struct GIFNeighbouringGreyLevelDependenceFeatureConfiguration
{
double range;
unsigned int direction;
int alpha;
double MinimumIntensity;
double MaximumIntensity;
int Bins;
std::string FeatureEncoding;
};
private:
double m_Range;
int m_Alpha;
};
}
#endif //mitkGIFNeighbouringGreyLevelDependenceFeature_h
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFVolumetricDensityStatistics.h b/Modules/Classification/CLUtilities/include/mitkGIFVolumetricDensityStatistics.h
index fa7fe1bab8..3c29b8452c 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFVolumetricDensityStatistics.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFVolumetricDensityStatistics.h
@@ -1,128 +1,128 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFVolumetricDensityStatistics_h
#define mitkGIFVolumetricDensityStatistics_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
/**
* \brief Calculates Volumetric Density Features
*
* These features characterize the compactness of the volume and shape by comparing the volumes
* of different volume and shape estimation methods.
*
* This feature calculator is activated by the option <b>-volume-density</b> or <b>-volden</b>.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image. All voxels with the value equal or greater than 1 are treated as masked.
*
* The volume and surface are compared to the volume \f$ V \f$ and surface \f$ A \f$ that is calculated
* directly from the mask. The following features are then defined:
* - <b>Morphological Density::Volume density axis-aligned bounding box</b>: The axis-aligned bounding
* box is defined as the minimum axis aligned box in 3D space that encloses all masked voxels.
* It is calculated by using the maximum spacial extension of the mask. Based on the volume of the
* bounding box, \f$ V_{aabb} \f$, the feature is defined as:
* \f[ \textup{Volume density axis-aligned bounding box}= \frac{V}{V_{aabb}} \f]
* - <b>Morphological Density::Surface density axis-aligned bounding box</b>: As for the previous
* feature, the axis-aligned bounding box is compared to the mask, this time using the surface of the
* bounding box \f$ A_{aabb} \f$:
* \f[ \textup{Surface density axis-aligned bounding box}= \frac{A}{A_{aabb}} \f]
* - <b>Morphological Density::Volume density oriented minimum bounding box</b>: A three-dimensional
* bounding box is defined using the box with the minimum volume. We do not use an estimation
* for this feature, which makes the calculation of this feature slow. Based on the volume of the
* bounding box, \f$ V_{ombb} \f$, the feature is defined as:
* \f[ \textup{Volume density oriented minimum bounding box}= \frac{V}{V_{ombb}} \f]
* - <b>Morphological Density::Surface density axis-aligned bounding box</b>: As for the previous
* feature, theminimum oriented bounding box is compared to the mask, this time using the surface of the
* bounding box \f$ A_{ombb} \f$:
* \f[ \textup{Surface density axis-aligned bounding box}= \frac{A}{A_{ombb}} \f]
* - <b>Morphological Density::Volume density approx. enclosing ellipsoid</b>: Using a Principal Component Analysis (PCA)
* of the spacial coordinates gives the three main axis of the mask. They correspond to the length of
* a eclipse enclosing the mask. The length of the axis of the eclipse are given by the eigenvalues of the
* decomposition: \f$ a = 2 \sqrt{\lambda_1} \f$, \f$ b = 2 \sqrt{\lambda_2} \f$, and \f$ c = 2 \sqrt{\lambda_3} \f$
* with \f$\lambda_x\f$ being the sorted eigenvalues (higher number indicates larger values). The volume
* of the enclosing eclipse can be estimated by \f$ V_{aee} = 4 \pi a b c \f$:
* \f[ \textup{Volume density approx. enclosing ellipsoid}= \frac{V}{V_{aee}} \f]
* - <b>Morphological Density::Surface density approx. enclosing ellipsoid</b>: As for the previous
* feature, the surface of the enclosing ellipsoid is used. To simplify the calulation of it, an approximation (20 iterations)
* for the surface is used (\f$ \alpha = \sqrt{1-\frac{b^2}{a^2}} \f$, \f$ \beta = \sqrt{1-\frac{c^2}{a^2}} \f$):
* \f[ A_{aee} = 2 \pi a b \frac{\alpha^2 + \beta^2}{\alpha \beta} \sum_v^\infty \frac{(a \beta)^v}{1-a v^2} \f]
* \f[ \textup{Surface density approx. enclosing ellipsoid}= \frac{A}{A_{aee}} \f]
* - <b>Morphological Density::Volume density approx. minimum volume enclosing ellipsoid</b>:
* The volume is compared to the volume of the minimum enclosing ellipsoid. While this ellipsoid can be
* found by brute-force calculation, this is quite time-consuming. It is therefore estimated using
* Khachiyan's Algorithm (Khachiyan, Rounding of Polytopes in the Real Number Model of Computation. Mathematics of Operations Research 1996)
* The so-found ellipsoid is described by the lengths \f$a, b, c \f$ of its axis. The volume is then
* defined as \f$ V_{mvee} = 4 \pi a b c \f$ and the feature given by:
* \f[ \textup{Volume density approx. minimum volume enclosing ellipsoid}= \frac{V}{V_{mvee}} \f]
* - <b>Morphological Density::Surface density approx. minimum volume enclosing ellipsoid</b>: As for the previous
* feature, the surface of the minimum volume enclosing ellipsoid is used. To simplify the calulation of it,
* an approximation with 20 iterations instead of infinite iterations is used for the calculation of the
* the surface (\f$ \alpha = \sqrt{1-\frac{b^2}{a^2}} \f$, \f$ \beta = \sqrt{1-\frac{c^2}{a^2}} \f$):
* \f[ A_{mvee} = 2 \pi a b \frac{\alpha^2 + \beta^2}{\alpha \beta} \sum_v^\infty \frac{(a \beta)^v}{1-a v^2} \f]
* \f[ \textup{Surface density approx. minimum volume enclosing ellipsoid}= \frac{A}{A_{mvee}} \f]
* - <b>Morphological Density::Volume density convex hull</b>: The volume of the density
* hull is calculated using a convex mesh and then calculating the volume of this mesh \f$V_{convex} \f$.
* The feature is then calculated using:
* \f[ \textup{Volume density convex hull}= \frac{V}{V_{convex}} \f]
* - <b>Morphological Density::Surface density convex hull</b>: The surface of the density
* hull is calculated using a convex mesh and then calculating the surface of this mesh \f$A_{convex} \f$.
* The feature is then calculated using:
* \f[ \textup{Volume density convex hull}= \frac{A}{A_{convex}} \f]
* - <b>Morphological Density::Volume integrated intensity</b>: Integrated intensity is the
* average intensity times the volume. It is often used in conjunction with PET-images, where
* this feature is also called "total legion glycolysis". It is defined using the volume \f$V \f$, the
* number of masked voxels \f$ N_v \f$ and the intensity of each voxel \f$ x_i \f$:
* \f[ \textup{Volume integrated intensity}= V \frac{1}{N_v} \sum x_i \f]
* - <b>Morphological Density::Volume Moran's I index</b>: Moran's I index is an measure for
* the spacial autocorrelation. It is defined using the inverse spacial distance between two voxels \f$i, j \f$ \f$w_{ij} \f$,
* the number of masked voxels \f$ N_v \f$, the intensity of each voxel \f$ x_i \f$,
* and the mean intensity of all masked voxels \f$ \mu = \frac{1}{N_v} sum x_i \f$:
* \f[ \textup{Volume Moran's I index}= \frac{N_v}{\sum_i \sum_j w_{ij}} \frac{\sum_i \sum_j (x_i - \mu) (x_j -\mu)}{\sum_i (x_i - \mu)^2 } \enspace \enspace {; i \neq j} \f]
* - <b>Morphological Density::Volume Geary's C measure</b>: Geary's C meansure is similar to Moran's I index.
* However, it is more sensitive to grey level differences and spacial autocorrelation:
* the spacial autocorrelation. It is defined using the inverse spacial distance between two voxels \f$i, j \f$ \f$w_{ij} \f$,
* the number of masked voxels \f$ N_v \f$, the intensity of each voxel \f$ x_i \f$,
* and the mean intensity of all masked voxels \f$ \mu = \frac{1}{N_v} sum x_i \f$:
* \f[ \textup{Volume Geary's C measure}= \frac{N_v - 1}{2 \sum_i \sum_j w_{ij}} \frac{ \sum_i \sum_j w_{ij} (x_i - x_j)^2 }{\sum_i (x_i - \mu)^2 } \enspace \enspace {; i \neq j} \f]
*/
class MITKCLUTILITIES_EXPORT GIFVolumetricDensityStatistics : public AbstractGlobalImageFeature
{
public:
- mitkClassMacro(GIFVolumetricDensityStatistics,AbstractGlobalImageFeature)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(GIFVolumetricDensityStatistics,AbstractGlobalImageFeature);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
GIFVolumetricDensityStatistics();
/**
* \brief Calculates the Cooccurence-Matrix based features for this class.
*/
FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override;
/**
* \brief Returns a list of the names of all features that are calculated from this class
*/
FeatureNameListType GetFeatureNames() override;
void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override;
void AddArguments(mitkCommandLineParser &parser) override;
private:
};
}
#endif //mitkGIFVolumetricDensityStatistics_h
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFVolumetricStatistics.h b/Modules/Classification/CLUtilities/include/mitkGIFVolumetricStatistics.h
index 8f18867bca..9dc8ebda77 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFVolumetricStatistics.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFVolumetricStatistics.h
@@ -1,133 +1,133 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFVolumetricStatistics_h
#define mitkGIFVolumetricStatistics_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
/**
* \brief Calulates simpel shape-related features.
*
* This class can be used to calculate simple, shape-related features describing
* a given segmentation. There are no parameters that can be externaly set.
*
* This feature calculator is activated by the option "<b>-volume</b>" or "<b>-vol</b>"
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image and all voxels with an value larger or equal
* to one are treated as masked. (Standard MITK mask)
*
* Some of the features are calculated twice using different methods. For voxel-
* based approaches, the corresponding parameter is calcualted using the voxel,
* for example the volume is then calculated by multiplying the volume of a
* single volume with the number of voxels in the mask. In the second method, the
* mesh based appraoch, a mesh is created prior to the feature calculation which
* is then done using the features.
*
* Another difference between two features might be the evaluation of invalid
* values within the image. There are two possibilities: By default, only those
* voxels are used with an valid intensity value, i.e. where the value is not
* infinite or NaN. The second possibility is not correcting for these voxels
* and only looking at the mask. Features that use these method are marked as
* "(uncorrected)"
*
* The resulting features are:
* - <b>Volumetric Features:: Voxel Volume</b>: \f$ V_{single\_voxel} \f$ , the volume of an single volume, calculated as the
* multiplication of the voxel spacing in all directions.
* - <b>Volumetric Features:: Volume (voxel based)</b>: \f$ V_{voxel} \f$, the volume of the masked area. Calulated by
* multiplying the numer of voxels with the Voxel Volume.
* - <b>Volumetric Features:: Volume (mesh based)</b>: \f$ V_{shape} \f$, The volume based on the mesh-representation of
* the mask.
* - <b>Volumetric Features:: Surface (voxel based)</b>: \f$ A_{voxel} \f$, the surface of the given mask. It is calulated
* by summing the surfaces between a masked and an unmasked voxel.
* - <b>Volumetric Features:: Surface (mesh based)</b>: \f$ A_{mesh} \f$, the surface of the given mask calculated using
* the mask representation
* - <b>Volumetric Features:: Surface to volume ration (voxel based)</b>: The ratio between voxel based surface and voxel based
* volume given as: \f[ F_{av\_voxel}=\frac{A_{voxel}}{V_{voxel}} \f]
* - <b>Volumetric Features:: Surface to volume ration (mesh based)</b>: The ratio between voxel based surface and voxel based
* volume given as: \f[ F_{av\_mesh}=\frac{A_{mesh}}{V_{mesh}} \f]
* - <b>Volumetric Features:: Compactness 1 (voxel based)</b>:
* - <b>Volumetric Features:: Compactness 1 (mesh based)</b>:
The compatness is a measure how spheric a shape is given.
* Compactness 1 is defined as:
* \f[ F_{compactness\_1} = \frac{V}{\pi^{1/2} A^{3/2}}\f]
* - <b>Volumetric Features:: Compactness 1 old (voxel based)</b>:
* - <b>Volumetric Features:: Compactness 1 old (mesh based)</b>: Some implementations use a slightly different definition of
* compactness 1. Although this is most likely an error and leads to an non-dimensionless feature,
* this defition is still calculated as:
* \f[ F_{compactness\_1\_old} = \frac{V}{\pi^{1/2} A^{2/3}}\f]
* - <b>Volumetric Features:: Compactness 2 (voxel based)</b>:
* - <b>Volumetric Features:: Compactness 2 (mesh based)</b>: The compatness is a measure how spheric a shape is given.
* Compactness 2 is defined as:
* \f[ F_{compactness\_1} = 36 \pi \frac{V^2}{A^3}\f]
* - <b>Volumetric Features::Sphericity (voxel based)</b>:
* - <b>Volumetric Features::Sphericity (mesh based)</b>: Sphericity is measure of how sphere-like a shape is:
* \f[ F_{sphericity} = \frac{(36 \pi V^2)^{1/3}}{A} \f]
* - <b>Volumetric Features::Asphericity (voxel based)</b>:
* - <b>Volumetric Features::Asphericity (mesh based)</b>: Sphericity is measure of how sphere-like a shape is:
* \f[ F_{asphericity} = \left(\frac{1}{36 \pi }\frac{(A^3}{V^2}\right)^{1/3} - 1 \f]
* - <b>Volumetric Features::Spherical disproportion (voxel based)</b>:
* - <b>Volumetric Features::Spherical disproportion (mesh based)</b>: Sphericity is measure of how sphere-like a shape is:
* \f[ F_{spherical\_disproportion} = \frac{A}{4\pi R^2}= \frac{A}{\left(36\pi V^2\right)^{1/3}} \f]
* - <b>Volumetric Features:: Maximum 3D diameter</b>: This is the largest distance between the centers of two voxels that
* are masked.
* - <b>Volumetric Features::Bounding box volume</b>: The bounding box volume is the volume of the smallest axis-aligned box
* that encapuslates all voxel centres.
* - <b>Volumetric Features::Centre of mass shift</b>:
* - <b>Volumetric Features::Centre of mass shift (uncorrected)</b>: This is the distance between two centres of mass,
* namely the geometric centre and the weighted centre. The geometric centre is the mean position
* of all masked voxels, and the weighted centre is the mean position if the position of each
* voxel is weighted according to its intensity.
* - <b>Volumetric Features::PCA Major Axis length</b>:
* - <b>Volumetric Features::PCA Major Axis length (uncorrected)</b>: A Principal component analysis (PCA) of the masekd voxel
* positions will give the main orientation and elongation of the masked area. The resulting
* eigenvectors of the PCA are sorted so that \f$ \lambda_{major}\geq \lambda_{minor} \geq \lambda_{least}\f$.
* The major axis length is defined as:
* \f[ F_{pca\_major} = 4 \sqrt{\lambda_{major}} \f]
* - <b>Volumetric Features::PCA Minor axis length</b>:
* - <b>Volumetric Features::PCA Minor axis length</b>: The Minor axis length is defined as:
* \f[ F_{pca\_minor} = 4 \sqrt{\lambda_{minor}} \f]
* - <b>Volumetric Features::PCA Least axis length</b>:
* - <b>Volumetric Features::PCA Least axis length</b>: The Minor axis length is defined as:
* \f[ F_{pca\_Least} = 4 \sqrt{\lambda_{Least}} \f]
*/
class MITKCLUTILITIES_EXPORT GIFVolumetricStatistics : public AbstractGlobalImageFeature
{
public:
- mitkClassMacro(GIFVolumetricStatistics,AbstractGlobalImageFeature)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(GIFVolumetricStatistics,AbstractGlobalImageFeature);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
GIFVolumetricStatistics();
/**
* \brief Calculates the Cooccurence-Matrix based features for this class.
*/
FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override;
/**
* \brief Returns a list of the names of all features that are calculated from this class
*/
FeatureNameListType GetFeatureNames() override;
void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override;
void AddArguments(mitkCommandLineParser &parser) override;
private:
};
}
#endif //mitkGIFVolumetricStatistics_h
diff --git a/Modules/Classification/CLUtilities/include/mitkRandomImageSampler.h b/Modules/Classification/CLUtilities/include/mitkRandomImageSampler.h
index f060f3aef3..b48b7c63c8 100644
--- a/Modules/Classification/CLUtilities/include/mitkRandomImageSampler.h
+++ b/Modules/Classification/CLUtilities/include/mitkRandomImageSampler.h
@@ -1,117 +1,116 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkRandomImageSampler_h
#define __mitkRandomImageSampler_h
#include "MitkCLUtilitiesExports.h"
//MITK
#include <mitkImage.h>
#include "mitkImageToImageFilter.h"
#include <itkImage.h>
namespace mitk
{
enum RandomImageSamplerMode
{
SINGLE_ACCEPTANCE_RATE,
CLASS_DEPENDEND_ACCEPTANCE_RATE,
SINGLE_NUMBER_OF_ACCEPTANCE,
CLASS_DEPENDEND_NUMBER_OF_ACCEPTANCE
};
class MITKCLUTILITIES_EXPORT RandomImageSampler : public ImageToImageFilter
{
public:
mitkClassMacro( RandomImageSampler , ImageToImageFilter );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
-
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
itkSetMacro(SamplingMode, RandomImageSamplerMode);
itkGetConstMacro(SamplingMode, RandomImageSamplerMode);
itkSetMacro(AcceptanceRate, double);
itkGetConstMacro(AcceptanceRate, double);
//itkSetMacro(AcceptanceRateVector, std::vector<double>);
void SetAcceptanceRateVector(std::vector<double> arg)
{
m_AcceptanceRateVector = arg;
}
itkGetConstMacro(AcceptanceRateVector, std::vector<double>);
itkSetMacro(NumberOfSamples, unsigned int);
itkGetConstMacro(NumberOfSamples, unsigned int);
//itkSetMacro(NumberOfSamplesVector, std::vector<unsigned int>);
void SetNumberOfSamplesVector(std::vector<unsigned int> arg)
{
m_NumberOfSamplesVector = arg;
}
itkGetConstMacro(NumberOfSamplesVector, std::vector<unsigned int>);
private:
/*!
\brief standard constructor
*/
RandomImageSampler();
/*!
\brief standard destructor
*/
~RandomImageSampler() override;
/*!
\brief Method generating the output information of this filter (e.g. image dimension, image type, etc.).
The interface ImageToImageFilter requires this implementation. Everything is taken from the input image.
*/
void GenerateOutputInformation() override;
/*!
\brief Method generating the output of this filter. Called in the updated process of the pipeline.
This method generates the smoothed output image.
*/
void GenerateData() override;
/*!
\brief Internal templated method calling the ITK bilteral filter. Here the actual filtering is performed.
*/
template<typename TPixel, unsigned int VImageDimension>
void ItkImageProcessing(const itk::Image<TPixel, VImageDimension>* itkImage);
/*!
\brief Internal templated method calling the ITK bilteral filter. Here the actual filtering is performed.
*/
template<typename TPixel, unsigned int VImageDimension>
void ItkImageProcessingClassDependendSampling(const itk::Image<TPixel, VImageDimension>* itkImage);
/*!
\brief Internal templated method calling the ITK bilteral filter. Here the actual filtering is performed.
*/
template<typename TPixel, unsigned int VImageDimension>
void ItkImageProcessingFixedNumberSampling(const itk::Image<TPixel, VImageDimension>* itkImage);
/*!
\brief Internal templated method calling the ITK bilteral filter. Here the actual filtering is performed.
*/
template<typename TPixel, unsigned int VImageDimension>
void ItkImageProcessingClassDependendNumberSampling(const itk::Image<TPixel, VImageDimension>* itkImage);
double m_AcceptanceRate;
std::vector<double> m_AcceptanceRateVector;
unsigned int m_NumberOfSamples;
std::vector<unsigned int> m_NumberOfSamplesVector;
RandomImageSamplerMode m_SamplingMode;
};
} //END mitk namespace
#endif
diff --git a/Modules/Classification/CLVigraRandomForest/include/itkHessianMatrixEigenvalueImageFilter.h b/Modules/Classification/CLVigraRandomForest/include/itkHessianMatrixEigenvalueImageFilter.h
index 6e0c39e814..e6b028b2cd 100644
--- a/Modules/Classification/CLVigraRandomForest/include/itkHessianMatrixEigenvalueImageFilter.h
+++ b/Modules/Classification/CLVigraRandomForest/include/itkHessianMatrixEigenvalueImageFilter.h
@@ -1,56 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef ITKHESSIANMATRIXEIGENVALUEIMAGEFILTER_H
#define ITKHESSIANMATRIXEIGENVALUEIMAGEFILTER_H
#include <itkImageToImageFilter.h>
namespace itk
{
template< class TInputImageType, class TOutputImageType = TInputImageType, class TMaskImageType = itk::Image<short,3> >
class HessianMatrixEigenvalueImageFilter
: public itk::ImageToImageFilter<TInputImageType, TOutputImageType>
{
public:
typedef HessianMatrixEigenvalueImageFilter< TInputImageType, TOutputImageType > Self;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
typedef ImageToImageFilter< TInputImageType, TOutputImageType > Superclass;
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void SetImageMask(TMaskImageType * maskimage);
- itkSetMacro(Sigma,double)
- itkGetMacro(Sigma,double)
+ itkSetMacro(Sigma,double);
+
+ itkGetMacro(Sigma,double);
private:
typename TMaskImageType::Pointer m_ImageMask;
double m_Sigma;
void GenerateData() override;
void GenerateOutputInformation() override;
HessianMatrixEigenvalueImageFilter();
~HessianMatrixEigenvalueImageFilter() override;
};
}
#ifndef ITK_MANUAL_INSTANTIATION
#include "../src/Algorithm/itkHessianMatrixEigenvalueImageFilter.cpp"
#endif
#endif
diff --git a/Modules/Classification/CLVigraRandomForest/include/itkStructureTensorEigenvalueImageFilter.h b/Modules/Classification/CLVigraRandomForest/include/itkStructureTensorEigenvalueImageFilter.h
index 8eb29af6a9..734fb0ca00 100644
--- a/Modules/Classification/CLVigraRandomForest/include/itkStructureTensorEigenvalueImageFilter.h
+++ b/Modules/Classification/CLVigraRandomForest/include/itkStructureTensorEigenvalueImageFilter.h
@@ -1,61 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef ITKSTRUCTURETENSOREIGENVALUEIMAGEFILTER_H
#define ITKSTRUCTURETENSOREIGENVALUEIMAGEFILTER_H
#include <itkImageToImageFilter.h>
namespace itk
{
template< class TInputImageType,
class TOutputImageType = TInputImageType,
class TMaskImageType = itk::Image<short,3> >
class StructureTensorEigenvalueImageFilter
: public itk::ImageToImageFilter<TInputImageType, TOutputImageType>
{
public:
typedef StructureTensorEigenvalueImageFilter< TInputImageType, TOutputImageType > Self;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
typedef ImageToImageFilter< TInputImageType, TOutputImageType > Superclass;
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void SetImageMask(TMaskImageType * maskimage);
- itkSetMacro(InnerScale,double)
- itkGetMacro(InnerScale,double)
+ itkSetMacro(InnerScale,double);
- itkSetMacro(OuterScale,double)
- itkGetMacro(OuterScale,double)
+ itkGetMacro(InnerScale,double);
+
+ itkSetMacro(OuterScale,double);
+
+ itkGetMacro(OuterScale,double);
private:
typename TMaskImageType::Pointer m_ImageMask;
double m_InnerScale, m_OuterScale;
void GenerateData() override;
void GenerateOutputInformation() override;
StructureTensorEigenvalueImageFilter();
~StructureTensorEigenvalueImageFilter() override;
};
}
#ifndef ITK_MANUAL_INSTANTIATION
#include "../src/Algorithm/itkStructureTensorEigenvalueImageFilter.cpp"
#endif
#endif
diff --git a/Modules/Classification/CLVigraRandomForest/include/mitkPURFClassifier.h b/Modules/Classification/CLVigraRandomForest/include/mitkPURFClassifier.h
index a7ef6a2da4..4eadac9ea3 100644
--- a/Modules/Classification/CLVigraRandomForest/include/mitkPURFClassifier.h
+++ b/Modules/Classification/CLVigraRandomForest/include/mitkPURFClassifier.h
@@ -1,91 +1,93 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPURFClassifier_h
#define mitkPURFClassifier_h
#include <MitkCLVigraRandomForestExports.h>
#include <mitkAbstractClassifier.h>
//#include <vigra/multi_array.hxx>
#include <vigra/random_forest.hxx>
#include <mitkBaseData.h>
namespace mitk
{
class MITKCLVIGRARANDOMFOREST_EXPORT PURFClassifier : public AbstractClassifier
{
public:
- mitkClassMacro(PURFClassifier, AbstractClassifier)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(PURFClassifier, AbstractClassifier);
+
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
PURFClassifier();
~PURFClassifier() override;
void Train(const Eigen::MatrixXd &X, const Eigen::MatrixXi &Y) override;
Eigen::MatrixXi Predict(const Eigen::MatrixXd &X) override;
Eigen::MatrixXi PredictWeighted(const Eigen::MatrixXd &X);
bool SupportsPointWiseWeight() override;
bool SupportsPointWiseProbability() override;
void ConvertParameter();
vigra::ArrayVector<double> CalculateKappa(const Eigen::MatrixXd & X_in, const Eigen::MatrixXi &Y_in);
void SetRandomForest(const vigra::RandomForest<int> & rf);
const vigra::RandomForest<int> & GetRandomForest() const;
void UsePointWiseWeight(bool) override;
void SetMaximumTreeDepth(int);
void SetMinimumSplitNodeSize(int);
void SetPrecision(double);
void SetSamplesPerTree(double);
void UseSampleWithReplacement(bool);
void SetTreeCount(int);
void SetWeightLambda(double);
void PrintParameter(std::ostream &str = std::cout);
void SetClassProbabilities(Eigen::VectorXd probabilities);
Eigen::VectorXd GetClassProbabilites();
private:
// *-------------------
// * THREADING
// *-------------------
struct TrainingData;
struct PredictionData;
struct EigenToVigraTransform;
struct Parameter;
vigra::MultiArrayView<2, double> m_Probabilities;
Eigen::MatrixXd m_TreeWeights;
Eigen::VectorXd m_ClassProbabilities;
Parameter * m_Parameter;
vigra::RandomForest<int> m_RandomForest;
static ITK_THREAD_RETURN_TYPE TrainTreesCallback(void *);
static ITK_THREAD_RETURN_TYPE PredictCallback(void *);
static ITK_THREAD_RETURN_TYPE PredictWeightedCallback(void *);
static void VigraPredictWeighted(PredictionData *data, vigra::MultiArrayView<2, double> & X, vigra::MultiArrayView<2, int> & Y, vigra::MultiArrayView<2, double> & P);
};
}
#endif //mitkPURFClassifier_h
diff --git a/Modules/Classification/CLVigraRandomForest/include/mitkVigraRandomForestClassifier.h b/Modules/Classification/CLVigraRandomForest/include/mitkVigraRandomForestClassifier.h
index ed0f459f72..b167df6c1e 100644
--- a/Modules/Classification/CLVigraRandomForest/include/mitkVigraRandomForestClassifier.h
+++ b/Modules/Classification/CLVigraRandomForest/include/mitkVigraRandomForestClassifier.h
@@ -1,90 +1,92 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkVigraRandomForestClassifier_h
#define mitkVigraRandomForestClassifier_h
#include <MitkCLVigraRandomForestExports.h>
#include <mitkAbstractClassifier.h>
//#include <vigra/multi_array.hxx>
#include <vigra/random_forest.hxx>
#include <mitkBaseData.h>
namespace mitk
{
class MITKCLVIGRARANDOMFOREST_EXPORT VigraRandomForestClassifier : public AbstractClassifier
{
public:
- mitkClassMacro(VigraRandomForestClassifier, AbstractClassifier)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(VigraRandomForestClassifier, AbstractClassifier);
+
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
VigraRandomForestClassifier();
~VigraRandomForestClassifier() override;
void Train(const Eigen::MatrixXd &X, const Eigen::MatrixXi &Y) override;
void OnlineTrain(const Eigen::MatrixXd &X, const Eigen::MatrixXi &Y);
Eigen::MatrixXi Predict(const Eigen::MatrixXd &X) override;
Eigen::MatrixXi PredictWeighted(const Eigen::MatrixXd &X);
bool SupportsPointWiseWeight() override;
bool SupportsPointWiseProbability() override;
void ConvertParameter();
void SetRandomForest(const vigra::RandomForest<int> & rf);
const vigra::RandomForest<int> & GetRandomForest() const;
void UsePointWiseWeight(bool) override;
void SetMaximumTreeDepth(int);
void SetMinimumSplitNodeSize(int);
void SetPrecision(double);
void SetSamplesPerTree(double);
void UseSampleWithReplacement(bool);
void SetTreeCount(int);
void SetWeightLambda(double);
void SetTreeWeights(Eigen::MatrixXd weights);
void SetTreeWeight(int treeId, double weight);
Eigen::MatrixXd GetTreeWeights() const;
void PrintParameter(std::ostream &str = std::cout);
private:
// *-------------------
// * THREADING
// *-------------------
struct TrainingData;
struct PredictionData;
struct EigenToVigraTransform;
struct Parameter;
vigra::MultiArrayView<2, double> m_Probabilities;
Eigen::MatrixXd m_TreeWeights;
Parameter * m_Parameter;
vigra::RandomForest<int> m_RandomForest;
static ITK_THREAD_RETURN_TYPE TrainTreesCallback(void *);
static ITK_THREAD_RETURN_TYPE PredictCallback(void *);
static ITK_THREAD_RETURN_TYPE PredictWeightedCallback(void *);
static void VigraPredictWeighted(PredictionData *data, vigra::MultiArrayView<2, double> & X, vigra::MultiArrayView<2, int> & Y, vigra::MultiArrayView<2, double> & P);
};
}
#endif //mitkVigraRandomForestClassifier_h
diff --git a/Modules/Classification/CLVigraRandomForest/include/mitkVigraRandomForestClassifierSerializer.h b/Modules/Classification/CLVigraRandomForest/include/mitkVigraRandomForestClassifierSerializer.h
index 72321b015f..2cfbb81799 100644
--- a/Modules/Classification/CLVigraRandomForest/include/mitkVigraRandomForestClassifierSerializer.h
+++ b/Modules/Classification/CLVigraRandomForest/include/mitkVigraRandomForestClassifierSerializer.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKVIGRARANDOMFORESTCLASSIFIERSERIALIZER_H
#define MITKVIGRARANDOMFORESTCLASSIFIERSERIALIZER_H
#include <mitkBaseDataSerializer.h>
#include <MitkCLVigraRandomForestExports.h>
namespace mitk
{
class MITKCLVIGRARANDOMFOREST_EXPORT VigraRandomForestClassifierSerializer : public BaseDataSerializer
{
public:
mitkClassMacro(VigraRandomForestClassifierSerializer, BaseDataSerializer);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
std::string Serialize() override;
protected:
VigraRandomForestClassifierSerializer();
~VigraRandomForestClassifierSerializer() override;
};
}
#endif // MITKCONTOURMODELSETSERIALIZER_H
diff --git a/Modules/Classification/DataCollection/DataHolder/mitkDataCollection.h b/Modules/Classification/DataCollection/DataHolder/mitkDataCollection.h
index 495bca62e2..19620e97a9 100644
--- a/Modules/Classification/DataCollection/DataHolder/mitkDataCollection.h
+++ b/Modules/Classification/DataCollection/DataHolder/mitkDataCollection.h
@@ -1,286 +1,287 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifdef _MSC_VER
# pragma warning (disable : 4996)
#endif
#ifndef mitkDataCollection_H_
#define mitkDataCollection_H_
//#include <itkLightObject.h>
//#include <itkDataObject.h>
//#include "itkObjectFactory.h"
//#include "mitkCommon.h"
#include <mitkImage.h>
#include <mitkDataNode.h>
#include<mitkBaseData.h>
#include <MitkDataCollectionExports.h>
/**
* \brief DataCollection - Class to facilitate loading/accessing structured data
*
* Data is grouped into a collection that may contain further (sub) collections or images.
*
* Exemplary structure
*
* Collection (e.g. Patient)
* |
* |-- Sub-Collection1 (e.g. follow-up 1)
* | |
* | |-- DataItem (e.g. T1)
* | |-- DataItem (e.g. T2)
* |
* |-- Sub-Collection2 (e.g. follow-up 2)
* | |
* | |-- DataItem (e.g. T1)
* | |-- DataItem (e.g. T2)
*
*/
namespace mitk
{
class MITKDATACOLLECTION_EXPORT DataCollection : public BaseData
{
public:
- mitkClassMacro(DataCollection, BaseData)
+ mitkClassMacro(DataCollection, BaseData);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
// Needed methods from Basedata
void UpdateOutputInformation() override;
void SetRequestedRegionToLargestPossibleRegion() override;
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
bool VerifyRequestedRegion() override;
void SetRequestedRegion(const itk::DataObject *) override;
void Init(std::string name);
/**
* @brief AddData Add a data item
* @param data Images/Fibers/DataCollections
* @param name name that allows identifying this data (e.g. a category T2, Segmentation , etc ...)
* @param description
* @return
*/
size_t AddData(DataObject::Pointer data, std::string name, std::string filePath = "");
/**
* @brief SetName - Sets name of DataCollection
* @param name
*/
void SetName(std::string name);
std::string GetName() const;
std::string GetDataFilePath(size_t index) const;
/**
* @brief NameToIndex - Get index from data item name
* @param name
* @return
*/
size_t NameToIndex(std::string name);
/**
* @brief IndexToName - Get name from index
* @param index
* @return
*/
std::string IndexToName(size_t index) const;
/**
* @brief HasElement - check if element with this name exists in collection
* @param name
* @return
*/
bool HasElement(std::string name);
/**
* @brief HasElement - check if element with this index exists in collection
* @param index
* @return
*/
bool HasElement(size_t index);
/**
* @brief Size - number of data items in collection
* @return
*/
size_t Size() const;
/**
* @brief SetData - set/update data item by index
* @param data
* @param index
*/
void SetData(itk::DataObject::Pointer data, size_t index);
/**
* @brief SetData - set/update data item by name
* @param data
* @param name
*/
void SetData(itk::DataObject::Pointer data, std::string name);
/**
* @brief GetData Get original data by index
*
* To ensure a mitk::Image is returned use \ref mitk::GetMitkImage
*
* @param index
* @return
*/
itk::DataObject::Pointer GetData(size_t index);
/**
* @brief GetData Get original data by name
*
* To ensure a mitk::Image is returned use \ref mitk::GetMitkImage
*
* @param name
* @return
*/
itk::DataObject::Pointer GetData(std::string name);
/**
* @brief GetMitkImage - casts data to mitk::Image and returns it
*
* \note returns nullptr is object is no mitk::Image or itk::Image
*
* @param index
* @return
*/
mitk::Image::Pointer GetMitkImage(size_t index);
/**
* @brief GetMitkImage - casts data to mitk::Image and returns it
*
* \note returns nullptr is object is no mitk::Image or itk::Image
*
* @param name
* @return
*/
mitk::Image::Pointer GetMitkImage(std::string name);
/**
* @brief GetMitkImage - casts data to privided itk::Image pointer
*/
template <class ImageType>
ImageType GetItkImage(size_t index, ImageType* itkImage);
/**
* @brief GetMitkImage - casts data to privided itk::Image pointer
*/
template <class ImageType>
ImageType GetItkImage(std::string name, ImageType* itkImage);
itk::DataObject::Pointer& operator[](size_t index);
itk::DataObject::Pointer& operator[](std::string &name);
/**
* @brief SetNameForIndex - sets name for given data item by index
* @param index
* @param name
*/
void SetNameForIndex(size_t index, std::string &name);
/**
* @brief SetXMLFile - sets xml file to which data collection is saved
*/
void SetXMLFile(std::string absoluteXMlFile);
/**
* @brief SetXMLFile - gets xml file to which data collection is supposed to be saved
*/
std::string GetXMLFile();
/**
* @brief SetParent - sets the parent collection
* @param parent
*/
void SetParent(mitk::DataCollection* parent);
/**
* @brief GetParent - returns the parent collection if available else null is returned
* @return
*/
mitk::DataCollection* GetParent();
/**
* @brief RemoveIndex - removes element at index
* @param index
* @return
*/
bool RemoveIndex(size_t index);
/**
* @brief RemoveElement - removes element with name
* @param name
* @return
*/
bool RemoveElement(std::string& name);
/**
* @brief Clear - clears the data collection
*/
void Clear() override;
/**
* @brief GetDataNode - returns data node containing data at index
* @param index
* @return
*/
mitk::DataNode::Pointer GetDataNode(size_t index);
/**
* @brief GetDataNode - returns data node containing data with name
* @param name
* @return
*/
mitk::DataNode::Pointer GetDataNode(std::string name);
/**
* @brief GetProbabilityMap - returns vectorimage generated out of images with names in the probabilityNamesVector
* @param probabilityNamesVector
* @return
*/
mitk::Image::Pointer GetProbabilityMap(std::vector<std::string> probabilityNamesVector);
protected:
DataCollection();
~DataCollection() override;
private:
// DATA
std::string m_Name;
std::vector<itk::DataObject::Pointer> m_DataVector;
std::vector<std::string> m_NameVector;
std::vector<std::string> m_FilePathVector;
std::map<std::string, size_t> m_DataNames;
mitk::DataCollection * m_Parent;
std::string m_XMLFile; // is only filled for the hightest layer when loading a data collection
};
} // end namespace
#endif
diff --git a/Modules/Classification/DataCollection/DataHolder/mitkDataCollectionUtility.h b/Modules/Classification/DataCollection/DataHolder/mitkDataCollectionUtility.h
index f37349505d..f51e4ed2ab 100644
--- a/Modules/Classification/DataCollection/DataHolder/mitkDataCollectionUtility.h
+++ b/Modules/Classification/DataCollection/DataHolder/mitkDataCollectionUtility.h
@@ -1,77 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkDataCollectionUtilit_h
#define mitkDataCollectionUtilit_h
#include <mitkDataCollection.h>
/**
\brief Follow Up Storage - Class to facilitate loading/accessing structured follow-up data
Data is into a collection that may contain further (sub) collections or images.
*/
namespace mitk
{
class DataCollectionUtility
{
public:
template <class OriginImageType, class TargetImageType>
static void EnsureImageInCollection(mitk::DataCollection::Pointer collection, std::string origin, std::string target);
static void Compile()
{
mitk::DataCollection::Pointer col = mitk::DataCollection::New();
std::string blub = "haha";
typedef itk::Image<double, 3> ImType;
EnsureImageInCollection<ImType, ImType>(col, blub, blub);
};
} // end namespace
template <class OriginImageType, class TargetImageType>
void
mitk::DataCollectionUtility::EnsureDataImageInCollection(mitk::DataCollection::Pointer collection, std::string origin, std::string target)
{
typedef typename TargetImageType FeatureImage;
typedef typename OriginImageType LabelImage;
if (collection->HasElement(origin))
{
LabelImage::Pointer originImage = dynamic_cast<LabelImage*>(collection->GetData(origin).GetPointer());
if (!collection->HasElement(target) && originImage.IsNotNull())
{
FeatureImage::Pointer image = FeatureImage::New();
image->SetRegions(originImage->GetLargestPossibleRegion());
image->SetSpacing(originImage->GetSpacing());
image->SetOrigin(originImage->GetOrigin());
image->SetDirection(originImage->GetDirection());
image->Allocate();
collection->AddData(dynamic_cast<itk::DataObject*>(image.GetPointer()),target,"");
}
}
for (std::size_t i = 0; i < collection->Size();++i)
{
mitk::DataCollection* newCol = dynamic_cast<mitk::DataCollection*>(collection->GetData(i).GetPointer());
if (newCol != 0)
{
EnsureDataImageInCollection(newCol, origin, target);
}
}
};
-
-#include <Iterators/mitkDataCollectionImageIterator.cxx>
#endif //mitkDataCollectionUtilit_h
diff --git a/Modules/Classification/DataCollection/Iterators/mitkDataCollectionImageIterator.cxx b/Modules/Classification/DataCollection/Iterators/mitkDataCollectionImageIterator.cxx
index feac5a2bdb..8cc871e573 100644
--- a/Modules/Classification/DataCollection/Iterators/mitkDataCollectionImageIterator.cxx
+++ b/Modules/Classification/DataCollection/Iterators/mitkDataCollectionImageIterator.cxx
@@ -1,230 +1,222 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkDataCollectionImageIterator_CXX
-#define mitkDataCollectionImageIterator_CXX
-
-#include <Iterators/mitkDataCollectionImageIterator.h>
-#include <mitkImageCast.h>
-
template <typename TDataType, int TImageDimension>
mitk::DataCollectionImageIterator<TDataType, TImageDimension>::
DataCollectionImageIterator(DataCollection::Pointer collection, std::string imageName) :
m_Collection(collection), m_ImageName(imageName), m_IsAtEnd(false),
m_IteratingImages(true), m_CurrentIndex(0),
m_CurrentElement(0), m_CurrentCollectionIterator(nullptr)
{
ToBegin();
}
template <typename TDataType, int TImageDimension>
void
mitk::DataCollectionImageIterator<TDataType, TImageDimension>::
ToBegin()
{
m_IsAtEnd = false;
m_IteratingImages = false;
m_CurrentIndex = 0;
m_CurrentElement = 0;
m_ImageIndex = 0;
if (m_Collection->HasElement(m_ImageName))
{
{
mitk::Image *image = dynamic_cast<mitk::Image*>(m_Collection->GetData(m_ImageName).GetPointer());
//TODO: check whether image is valid... image != 0 if empty smart pointer was inserted into collection!!!!
if (image != nullptr)
{
typename ImageType::Pointer itkImage = ImageType::New();
mitk::CastToItkImage(image, itkImage);
itk::DataObject::Pointer itkObject = dynamic_cast<itk::DataObject* >(itkImage.GetPointer());
m_Collection->SetData(itkObject, m_ImageName);
}
}
ImageType * image = dynamic_cast<ImageType*>(m_Collection->GetData(m_ImageName).GetPointer());
if (image != nullptr)
{
m_IteratingImages = true;
m_CurrentIterator = ImageIterator(image, image->GetLargestPossibleRegion());
}
}
if (!m_IteratingImages)
{
if (m_CurrentCollectionIterator != nullptr)
{
delete m_CurrentCollectionIterator;
m_CurrentCollectionIterator = nullptr;
}
m_CurrentElement = 0;
m_CurrentCollectionIterator = GetNextDataCollectionIterator(m_CurrentElement);
if (m_CurrentCollectionIterator == nullptr)
{
m_IsAtEnd = true;
} else
{
m_CurrentIterator = m_CurrentCollectionIterator->GetImageIterator();
}
}
}
template <typename TDataType, int TImageDimension>
bool
mitk::DataCollectionImageIterator<TDataType, TImageDimension>::
IsAtEnd()
{
return m_IsAtEnd;
}
template <typename TDataType, int TImageDimension>
void
mitk::DataCollectionImageIterator<TDataType, TImageDimension>::
operator++()
{
++m_CurrentIndex;
++m_CurrentIterator;
if (m_CurrentIterator.IsAtEnd())
{
++m_ImageIndex;
NextObject();
}
}
template <typename TDataType, int TImageDimension>
void
mitk::DataCollectionImageIterator<TDataType, TImageDimension>::
operator++(int)
{
++m_CurrentIndex;
++m_CurrentIterator;
if (m_CurrentIterator.IsAtEnd())
{
++m_ImageIndex;
NextObject();
}
}
template <typename TDataType, int TImageDimension>
mitk::DataCollectionImageIterator<TDataType, TImageDimension>*
mitk::DataCollectionImageIterator<TDataType, TImageDimension>::
GetNextDataCollectionIterator(size_t start)
{
DataCollectionImageIterator<TDataType, TImageDimension>* iterator = nullptr;
size_t index =start;
while (index < m_Collection->Size() && iterator == nullptr)
{
DataCollection* collection;
collection = dynamic_cast<DataCollection*>(m_Collection->GetData(index).GetPointer());
if (collection != nullptr)
{
iterator = new DataCollectionImageIterator<TDataType, TImageDimension>(collection, m_ImageName);
if (iterator->IsAtEnd())
{
delete iterator;
iterator = nullptr;
++index;
}
}
else
{
++index;
}
}
m_CurrentElement = index;
return iterator;
}
template <typename TDataType, int TImageDimension>
TDataType
mitk::DataCollectionImageIterator<TDataType, TImageDimension>::
GetVoxel()
{
return m_CurrentIterator.Get();
}
template <typename TDataType, int TImageDimension>
void
mitk::DataCollectionImageIterator<TDataType, TImageDimension>::
SetVoxel(TDataType value)
{
m_CurrentIterator.Set(value);
}
template <typename TDataType, int TImageDimension>
size_t
mitk::DataCollectionImageIterator<TDataType, TImageDimension>::
GetIndex()
{
return m_CurrentIndex;
}
template <typename TDataType, int TImageDimension>
std::string
mitk::DataCollectionImageIterator<TDataType, TImageDimension>::
GetFilePrefix()
{
if (m_IteratingImages)
{
return m_ImageName;
}
else
{
return m_Collection->IndexToName(m_CurrentElement) + "/" + m_CurrentCollectionIterator->GetFilePrefix();
}
}
template <typename TDataType, int TImageDimension>
void mitk::DataCollectionImageIterator<TDataType, TImageDimension>::NextObject()
{
if (m_IteratingImages)
{
if (m_CurrentCollectionIterator != nullptr)
{
delete m_CurrentCollectionIterator;
m_CurrentCollectionIterator = nullptr;
}
m_IteratingImages = false;
m_CurrentElement = 0;
m_CurrentCollectionIterator = GetNextDataCollectionIterator(m_CurrentElement);
if (m_CurrentCollectionIterator == nullptr)
{
m_IsAtEnd = true;
return;
}
}
else
{
m_CurrentCollectionIterator->NextObject();
if (m_CurrentCollectionIterator->IsAtEnd()) //Current collection is finished iterated
{
delete m_CurrentCollectionIterator;
m_CurrentCollectionIterator = GetNextDataCollectionIterator(m_CurrentElement+1);
}
if (m_CurrentCollectionIterator == nullptr) //If no collection is known
{
m_IsAtEnd = true;
return;
}
}
m_CurrentIterator = m_CurrentCollectionIterator->GetImageIterator();
}
template <typename TDataType, int TImageDimension>
typename mitk::DataCollectionImageIterator<TDataType, TImageDimension>::ImageIterator
mitk::DataCollectionImageIterator<TDataType, TImageDimension>::GetImageIterator()
{
return m_CurrentIterator;
};
-
-#endif // mitkDataCollectionImageIterator_CXX
diff --git a/Modules/Classification/DataCollection/Iterators/mitkDataCollectionImageIterator.h b/Modules/Classification/DataCollection/Iterators/mitkDataCollectionImageIterator.h
index d830007408..7ca7ce88a0 100644
--- a/Modules/Classification/DataCollection/Iterators/mitkDataCollectionImageIterator.h
+++ b/Modules/Classification/DataCollection/Iterators/mitkDataCollectionImageIterator.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkDataCollectionImageIterator_H
#define mitkDataCollectionImageIterator_H
-
+#include <mitkImageCast.h>
#include <mitkDataCollection.h>
#include <itkImageRegionIterator.h>
/**
\brief Follow Up Storage - Class to facilitate loading/accessing structured follow-up data
Data is into a collection that may contain further (sub) collections or images.
*/
namespace mitk
{
template <typename TDataType, int ImageDimension>
class DataCollectionImageIterator
{
public:
typedef itk::Image<TDataType, ImageDimension> ImageType;
typedef typename ImageType::Pointer ImagePointerType;
typedef itk::ImageRegionIterator<ImageType> ImageIterator;
DataCollectionImageIterator(DataCollection::Pointer collection, std::string imageName);
void ToBegin();
bool IsAtEnd();
void operator++();
// TODO refactor implementation
void operator++(int);
TDataType GetVoxel();
void SetVoxel(TDataType value);
size_t GetIndex();
size_t GetImageIndex () { return m_ImageIndex;}
std::string GetFilePrefix();
void NextObject();
ImageIterator GetImageIterator();
private:
DataCollectionImageIterator<TDataType, ImageDimension>* GetNextDataCollectionIterator(size_t start);
// DATA
DataCollection::Pointer m_Collection;
std::string m_ImageName;
bool m_IsAtEnd;
bool m_IteratingImages;
size_t m_CurrentIndex;
size_t m_ImageIndex;
size_t m_CurrentElement;
DataCollectionImageIterator<TDataType, ImageDimension>* m_CurrentCollectionIterator;
ImageIterator m_CurrentIterator;
};
} // end namespace
#include <Iterators/mitkDataCollectionImageIterator.cxx>
#endif //mitkDataCollectionImageIterator_H
diff --git a/Modules/ContourModel/Algorithms/mitkContourModelSetSource.h b/Modules/ContourModel/Algorithms/mitkContourModelSetSource.h
index 63b55e2446..fdbae8156f 100644
--- a/Modules/ContourModel/Algorithms/mitkContourModelSetSource.h
+++ b/Modules/ContourModel/Algorithms/mitkContourModelSetSource.h
@@ -1,60 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_ContourModelSetSource_H
#define _MITK_ContourModelSetSource_H
#include "mitkBaseDataSource.h"
#include "mitkContourModelSet.h"
#include <MitkContourModelExports.h>
namespace mitk
{
/**
* @brief Superclass of all classes generating ContourModels.
* @ingroup MitkContourModelModule
*/
class MITKCONTOURMODEL_EXPORT ContourModelSetSource : public BaseDataSource
{
public:
- mitkClassMacro(ContourModelSetSource, BaseDataSource) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(ContourModelSetSource, BaseDataSource);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef ContourModelSet OutputType;
typedef OutputType::Pointer OutputTypePointer;
mitkBaseDataSourceGetOutputDeclarations
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer
MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
protected:
ContourModelSetSource();
~ContourModelSetSource() override;
};
}
#endif // #_MITK_CONTOURMODEL_SOURCE_H
diff --git a/Modules/ContourModel/Algorithms/mitkContourModelSource.h b/Modules/ContourModel/Algorithms/mitkContourModelSource.h
index 25a4f1044c..d5f27dd296 100644
--- a/Modules/ContourModel/Algorithms/mitkContourModelSource.h
+++ b/Modules/ContourModel/Algorithms/mitkContourModelSource.h
@@ -1,60 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_CONTOURMODEL_SOURCE_H
#define _MITK_CONTOURMODEL_SOURCE_H
#include "mitkBaseDataSource.h"
#include "mitkContourModel.h"
#include <MitkContourModelExports.h>
namespace mitk
{
/**
* @brief Superclass of all classes generating ContourModels.
* @ingroup MitkContourModelModule
*/
class MITKCONTOURMODEL_EXPORT ContourModelSource : public BaseDataSource
{
public:
- mitkClassMacro(ContourModelSource, BaseDataSource) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(ContourModelSource, BaseDataSource);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self)
typedef ContourModel OutputType;
typedef OutputType::Pointer OutputTypePointer;
mitkBaseDataSourceGetOutputDeclarations
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer
MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
protected:
ContourModelSource();
~ContourModelSource() override;
};
}
#endif // #_MITK_CONTOURMODEL_SOURCE_H
diff --git a/Modules/ContourModel/Algorithms/mitkContourModelSubDivisionFilter.h b/Modules/ContourModel/Algorithms/mitkContourModelSubDivisionFilter.h
index 99b55df34f..9858d16ad7 100644
--- a/Modules/ContourModel/Algorithms/mitkContourModelSubDivisionFilter.h
+++ b/Modules/ContourModel/Algorithms/mitkContourModelSubDivisionFilter.h
@@ -1,73 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _mitkContourModelSubDivisionFilter_h__
#define _mitkContourModelSubDivisionFilter_h__
#include "mitkCommon.h"
#include "mitkContourModel.h"
#include "mitkContourModelSource.h"
#include <MitkContourModelExports.h>
namespace mitk
{
/**
*
* \brief This filter interpolates a subdivision curve between control points of the contour.
* For inserting subpoints Dyn-Levin-Gregory (DLG) interpolation scheme is used.
* Interpolating a cruve subdivision is done by:
* F2i = Ci
* F2i+1 = -1/16Ci-1 + 9/16Ci + 9/16Ci+1 - 1/16Ci+2
*
* The number of interpolation iterations can be set via SetNumberOfIterations(int) which are 4 by dafault.
*
* @ingroup MitkContourModelModule
*/
class MITKCONTOURMODEL_EXPORT ContourModelSubDivisionFilter : public ContourModelSource
{
public:
mitkClassMacro(ContourModelSubDivisionFilter, ContourModelSource);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef ContourModel OutputType;
typedef OutputType::Pointer OutputTypePointer;
typedef mitk::ContourModel InputType;
/**
* \brief Set the number of iterations for inserting new interpolated control points.
*
*/
void SetNumberOfIterations(int iterations) { this->m_InterpolationIterations = iterations; }
using Superclass::SetInput;
virtual void SetInput(const InputType *input);
virtual void SetInput(unsigned int idx, const InputType *input);
const InputType *GetInput(void);
const InputType *GetInput(unsigned int idx);
protected:
ContourModelSubDivisionFilter();
~ContourModelSubDivisionFilter() override;
void GenerateOutputInformation() override{};
void GenerateData() override;
int m_InterpolationIterations;
};
}
#endif
diff --git a/Modules/ContourModel/Algorithms/mitkContourModelToPointSetFilter.h b/Modules/ContourModel/Algorithms/mitkContourModelToPointSetFilter.h
index 2826f963b8..2fb6157853 100644
--- a/Modules/ContourModel/Algorithms/mitkContourModelToPointSetFilter.h
+++ b/Modules/ContourModel/Algorithms/mitkContourModelToPointSetFilter.h
@@ -1,51 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _mitkContourModelToPointSetFilter_h__
#define _mitkContourModelToPointSetFilter_h__
#include "mitkCommon.h"
#include "mitkContourModel.h"
#include "mitkPointSet.h"
#include "mitkPointSetSource.h"
#include <MitkContourModelExports.h>
namespace mitk
{
/**
*
* @brief Converts a contour set to a point set.
*
* The resulting pointset consists of sample points of all the contours
*
* @ingroup MitkContourModelModule
*/
class MITKCONTOURMODEL_EXPORT ContourModelToPointSetFilter : public PointSetSource
{
public:
- mitkClassMacro(ContourModelToPointSetFilter, PointSetSource) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(ContourModelToPointSetFilter, PointSetSource);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef PointSet OutputType;
typedef OutputType::Pointer OutputTypePointer;
typedef mitk::ContourModel InputType;
protected:
ContourModelToPointSetFilter();
~ContourModelToPointSetFilter() override;
void GenerateOutputInformation() override {}
void GenerateData() override;
};
}
#endif
diff --git a/Modules/ContourModel/Algorithms/mitkContourModelToSurfaceFilter.h b/Modules/ContourModel/Algorithms/mitkContourModelToSurfaceFilter.h
index 14d61561e6..552168ded6 100644
--- a/Modules/ContourModel/Algorithms/mitkContourModelToSurfaceFilter.h
+++ b/Modules/ContourModel/Algorithms/mitkContourModelToSurfaceFilter.h
@@ -1,55 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_CONTOURMODEL_TO_Surface_FILTER_H_
#define _MITK_CONTOURMODEL_TO_Surface_FILTER_H_
#include "mitkCommon.h"
#include <MitkContourModelExports.h>
#include "mitkContourModel.h"
#include "mitkContourModelSource.h"
#include <mitkSurfaceSource.h>
namespace mitk
{
class MITKCONTOURMODEL_EXPORT ContourModelToSurfaceFilter : public SurfaceSource
{
public:
/** Standard class typedefs. */
mitkClassMacro(ContourModelToSurfaceFilter, SurfaceSource);
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef mitk::Surface OutputType;
typedef mitk::ContourModel InputType;
void GenerateOutputInformation() override;
/** Set/Get the image input of this process object. */
using Superclass::SetInput;
virtual void SetInput(const InputType *input);
virtual void SetInput(unsigned int idx, const InputType *input);
const InputType *GetInput(void);
const InputType *GetInput(unsigned int idx);
protected:
ContourModelToSurfaceFilter();
~ContourModelToSurfaceFilter() override;
void GenerateData() override;
};
}
#endif
diff --git a/Modules/ContourModel/Algorithms/mitkContourModelUtils.h b/Modules/ContourModel/Algorithms/mitkContourModelUtils.h
index aa3553da6d..2c06664812 100644
--- a/Modules/ContourModel/Algorithms/mitkContourModelUtils.h
+++ b/Modules/ContourModel/Algorithms/mitkContourModelUtils.h
@@ -1,91 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkContourModelUtils_h
#define mitkContourModelUtils_h
#include <mitkContourModel.h>
#include <mitkImage.h>
#include <vtkSmartPointer.h>
#include <MitkContourModelExports.h>
namespace mitk
{
/**
* \brief Helpful methods for working with contours and images
*
*
*/
class MITKCONTOURMODEL_EXPORT ContourModelUtils : public itk::Object
{
public:
- mitkClassMacroItkParent(ContourModelUtils, itk::Object)
+ mitkClassMacroItkParent(ContourModelUtils, itk::Object);
/**
\brief Projects a contour onto an image point by point. Converts from world to index coordinates.
\param correctionForIpSegmentation adds 0.5 to x and y index coordinates (difference between ipSegmentation and
MITK contours)
*/
static ContourModel::Pointer ProjectContourTo2DSlice(Image *slice,
ContourModel *contourIn3D,
bool correctionForIpSegmentation,
bool constrainToInside);
/**
\brief Projects a slice index coordinates of a contour back into world coordinates.
\param correctionForIpSegmentation subtracts 0.5 to x and y index coordinates (difference between ipSegmentation
and MITK contours)
*/
static ContourModel::Pointer BackProjectContourFrom2DSlice(const BaseGeometry *sliceGeometry,
ContourModel *contourIn2D,
bool correctionForIpSegmentation = false);
/**
\brief Fill a contour in a 2D slice with a specified pixel value at time step 0.
*/
static void FillContourInSlice(ContourModel *projectedContour,
Image *sliceImage,
mitk::Image::Pointer workingImage,
int paintingPixelValue = 1);
/**
\brief Fill a contour in a 2D slice with a specified pixel value at a given time step.
*/
static void FillContourInSlice(ContourModel *projectedContour,
unsigned int timeStep,
Image *sliceImage,
mitk::Image::Pointer workingImage,
int paintingPixelValue = 1);
/**
\brief Fills a image (filledImage) into another image (resultImage) by incorporating the rules of LabelSet-Images
*/
static void FillSliceInSlice(vtkSmartPointer<vtkImageData> filledImage,
vtkSmartPointer<vtkImageData> resultImage,
mitk::Image::Pointer image,
int paintingPixelValue);
/**
\brief Move the contour in time step 0 to to a new contour model at the given time step.
*/
static ContourModel::Pointer MoveZerothContourTimeStep(const ContourModel *contour, unsigned int timeStep);
protected:
ContourModelUtils();
~ContourModelUtils() override;
};
}
#endif
diff --git a/Modules/ContourModel/Algorithms/mitkContourObjectFactory.h b/Modules/ContourModel/Algorithms/mitkContourObjectFactory.h
index a30e99d3cf..e8f53b5e9c 100644
--- a/Modules/ContourModel/Algorithms/mitkContourObjectFactory.h
+++ b/Modules/ContourModel/Algorithms/mitkContourObjectFactory.h
@@ -1,47 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef SEGMENTATIONOBJECTFACTORY_H_INCLUDED
#define SEGMENTATIONOBJECTFACTORY_H_INCLUDED
#include "mitkCoreObjectFactoryBase.h"
#include <MitkContourModelExports.h>
namespace mitk
{
class MITKCONTOURMODEL_EXPORT ContourObjectFactory : public CoreObjectFactoryBase
{
public:
mitkClassMacro(ContourObjectFactory, CoreObjectFactoryBase);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) Mapper::Pointer
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self) Mapper::Pointer
CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
void SetDefaultProperties(mitk::DataNode *node) override;
const char *GetFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap() override;
const char *GetSaveFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap() override;
/** \deprecatedSince{2013_09} */
DEPRECATED(void RegisterIOFactories());
protected:
ContourObjectFactory();
~ContourObjectFactory() override;
void CreateFileExtensionsMap();
MultimapType m_FileExtensionsMap;
MultimapType m_SaveFileExtensionsMap;
private:
};
}
#endif
diff --git a/Modules/ContourModel/Algorithms/mitkImageToContourModelFilter.h b/Modules/ContourModel/Algorithms/mitkImageToContourModelFilter.h
index 25ab1ca25a..f7b7947b9f 100644
--- a/Modules/ContourModel/Algorithms/mitkImageToContourModelFilter.h
+++ b/Modules/ContourModel/Algorithms/mitkImageToContourModelFilter.h
@@ -1,68 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _mitkImageToContourModelFilter_h__
#define _mitkImageToContourModelFilter_h__
#include "mitkCommon.h"
#include "mitkContourModel.h"
#include "mitkContourModelSource.h"
#include <MitkContourModelExports.h>
#include <mitkImage.h>
namespace mitk
{
/**
*
* \brief Base class for all filters with mitk::Image as input and mitk::ContourModel
*
* @ingroup MitkContourModelModule
*/
class MITKCONTOURMODEL_EXPORT ImageToContourModelFilter : public ContourModelSource
{
public:
mitkClassMacro(ImageToContourModelFilter, ContourModelSource);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef mitk::Image InputType;
using Superclass::SetInput;
virtual void SetInput(const InputType *input);
virtual void SetInput(unsigned int idx, const InputType *input);
const InputType *GetInput(void);
const InputType *GetInput(unsigned int idx);
void SetContourValue(float contourValue);
float GetContourValue();
protected:
ImageToContourModelFilter();
~ImageToContourModelFilter() override;
void GenerateData() override;
template <typename TPixel, unsigned int VImageDimension>
void Itk2DContourExtraction(const itk::Image<TPixel, VImageDimension> *sliceImage);
private:
const BaseGeometry *m_SliceGeometry;
float m_ContourValue;
};
}
#endif
diff --git a/Modules/ContourModel/DataManagement/mitkContourElement.h b/Modules/ContourModel/DataManagement/mitkContourElement.h
index f2e8562df0..ed4342255b 100644
--- a/Modules/ContourModel/DataManagement/mitkContourElement.h
+++ b/Modules/ContourModel/DataManagement/mitkContourElement.h
@@ -1,235 +1,237 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _mitkContourElement_H_
#define _mitkContourElement_H_
#include "mitkCommon.h"
#include <MitkContourModelExports.h>
#include <mitkNumericTypes.h>
//#include <ANN/ANN.h>
#include <deque>
namespace mitk
{
/** \brief Represents a contour in 3D space.
A ContourElement is consisting of linked vertices implicitely defining the contour.
They are stored in a double ended queue making it possible to add vertices at front and
end of the contour and to iterate in both directions.
To mark a vertex as a special one it can be set as a control point.
\Note It is highly not recommend to use this class directly as no secure mechanism is used here.
Use mitk::ContourModel instead providing some additional features.
*/
class MITKCONTOURMODEL_EXPORT ContourElement : public itk::LightObject
{
public:
mitkClassMacroItkParent(ContourElement, itk::LightObject);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
// Data container representing vertices
/** \brief Represents a single vertex of contour.
*/
struct ContourModelVertex
{
ContourModelVertex(mitk::Point3D &point, bool active = false) : IsControlPoint(active), Coordinates(point) {}
ContourModelVertex(const ContourModelVertex &other)
: IsControlPoint(other.IsControlPoint), Coordinates(other.Coordinates)
{
}
/** \brief Treat point special. */
bool IsControlPoint;
/** \brief Coordinates in 3D space. */
mitk::Point3D Coordinates;
};
// END Data container representing vertices
typedef ContourModelVertex VertexType;
typedef std::deque<VertexType *> VertexListType;
typedef VertexListType::iterator VertexIterator;
typedef VertexListType::const_iterator ConstVertexIterator;
// start of inline methods
/** \brief Return a const iterator a the front.
*/
virtual ConstVertexIterator ConstIteratorBegin() { return this->m_Vertices->begin(); }
/** \brief Return a const iterator a the end.
*/
virtual ConstVertexIterator ConstIteratorEnd() { return this->m_Vertices->end(); }
/** \brief Return an iterator a the front.
*/
virtual VertexIterator IteratorBegin() { return this->m_Vertices->begin(); }
/** \brief Return an iterator a the end.
*/
virtual VertexIterator IteratorEnd() { return this->m_Vertices->end(); }
/** \brief Returns the number of contained vertices.
*/
virtual int GetSize() { return this->m_Vertices->size(); }
// end of inline methods
/** \brief Add a vertex at the end of the contour
\param point - coordinates in 3D space.
\param isControlPoint - is the vertex a special control point.
*/
virtual void AddVertex(mitk::Point3D &point, bool isControlPoint);
/** \brief Add a vertex at the end of the contour
\param vertex - a contour element vertex.
*/
virtual void AddVertex(VertexType &vertex);
/** \brief Add a vertex at the front of the contour
\param point - coordinates in 3D space.
\param isControlPoint - is the vertex a control point.
*/
virtual void AddVertexAtFront(mitk::Point3D &point, bool isControlPoint);
/** \brief Add a vertex at the front of the contour
\param vertex - a contour element vertex.
*/
virtual void AddVertexAtFront(VertexType &vertex);
/** \brief Add a vertex at a given index of the contour
\param point - coordinates in 3D space.
\param isControlPoint - is the vertex a special control point.
\param index - the index to be inserted at.
*/
virtual void InsertVertexAtIndex(mitk::Point3D &point, bool isControlPoint, int index);
/** \brief Set coordinates a given index.
\param pointId Index of vertex.
\param point Coordinates.
*/
virtual void SetVertexAt(int pointId, const mitk::Point3D &point);
/** \brief Set vertex a given index.
\param pointId Index of vertex.
\param vertex Vertex.
*/
virtual void SetVertexAt(int pointId, const VertexType *vertex);
/** \brief Returns the vertex a given index
\param index
*/
virtual VertexType *GetVertexAt(int index);
/** \brief Returns the approximate nearest vertex a given posoition in 3D space
\param point - query position in 3D space.
\param eps - the error bound for search algorithm.
*/
virtual VertexType *GetVertexAt(const mitk::Point3D &point, float eps);
/** \brief Returns the index of the given vertex within the contour.
\param vertex - the vertex to be searched.
\return index of vertex. -1 if not found.
*/
virtual int GetIndex(const VertexType *vertex);
/** \brief Returns the container of the vertices.
*/
VertexListType *GetVertexList();
/** \brief Returns whether the contour element is empty.
*/
bool IsEmpty();
/** \brief Returns if the conour is closed or not.
*/
virtual bool IsClosed();
/** \brief Returns whether a given point is near a contour, according to eps.
\param point - query position in 3D space.
\param eps - the error bound for search algorithm.
*/
virtual bool IsNearContour(const mitk::Point3D &point, float eps);
/** \brief Close the contour.
Connect first with last element.
*/
virtual void Close();
/** \brief Open the contour.
Disconnect first and last element.
*/
virtual void Open();
/** \brief Set the contours IsClosed property.
\param isClosed - true = closed; false = open;
*/
virtual void SetClosed(bool isClosed);
/** \brief Concatenate the contuor with a another contour.
All vertices of the other contour will be added after last vertex.
\param other - the other contour
\param check - set it true to avoid intersections
*/
void Concatenate(mitk::ContourElement *other, bool check);
/** \brief Remove the given vertex from the container if exists.
\param vertex - the vertex to be removed.
*/
virtual bool RemoveVertex(const VertexType *vertex);
/** \brief Remove a vertex at given index within the container if exists.
\param index - the index where the vertex should be removed.
*/
virtual bool RemoveVertexAt(int index);
/** \brief Remove the approximate nearest vertex at given position in 3D space if one exists.
\param point - query point in 3D space.
\param eps - error bound for search algorithm.
*/
virtual bool RemoveVertexAt(mitk::Point3D &point, float eps);
/** \brief Clear the storage container.
*/
virtual void Clear();
/** \brief Returns the approximate nearest vertex a given posoition in 3D space
\param point - query position in 3D space.
\param eps - the error bound for search algorithm.
*/
VertexType *BruteForceGetVertexAt(const mitk::Point3D &point, float eps);
/** \brief Returns the approximate nearest vertex a given posoition in 3D space
\param point - query position in 3D space.
\param eps - the error bound for search algorithm.
*/
// VertexType* OptimizedGetVertexAt(const mitk::Point3D &point, float eps);
VertexListType *GetControlVertices();
/** \brief Uniformly redistribute control points with a given period (in number of vertices)
\param vertex - the vertex around which the redistribution is done.
\param period - number of vertices between control points.
*/
void RedistributeControlVertices(const VertexType *vertex, int period);
protected:
mitkCloneMacro(Self);
ContourElement();
ContourElement(const mitk::ContourElement &other);
~ContourElement() override;
VertexListType *m_Vertices; // double ended queue with vertices
bool m_IsClosed;
};
} // namespace mitk
#endif // _mitkContourElement_H_
diff --git a/Modules/ContourModel/DataManagement/mitkContourModel.h b/Modules/ContourModel/DataManagement/mitkContourModel.h
index 3055adb48f..3620737c86 100644
--- a/Modules/ContourModel/DataManagement/mitkContourModel.h
+++ b/Modules/ContourModel/DataManagement/mitkContourModel.h
@@ -1,450 +1,452 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_CONTOURMODEL_H_
#define _MITK_CONTOURMODEL_H_
#include "mitkBaseData.h"
#include "mitkCommon.h"
#include <MitkContourModelExports.h>
#include <mitkContourElement.h>
namespace mitk
{
/**
\brief ContourModel is a structure of linked vertices defining a contour in 3D space.
The vertices are stored in a mitk::ContourElement is stored for each timestep.
The contour line segments are implicitly defined by the given linked vertices.
By default two control points are are linked by a straight line.It is possible to add
vertices at front and end of the contour and to iterate in both directions.
Points are specified containing coordinates and additional (data) information,
see mitk::ContourElement.
For accessing a specific vertex either an index or a position in 3D Space can be used.
The vertices are best accessed by using a VertexIterator.
Interaction with the contour is thus available without any mitk interactor class using the
api of ContourModel. It is possible to shift single vertices also as shifting the whole
contour.
A contour can be either open like a single curved line segment or
closed. A closed contour can for example represent a jordan curve.
\section mitkContourModelDisplayOptions Display Options
The default mappers for this data structure are mitk::ContourModelGLMapper2D and
mitk::ContourModelMapper3D. See these classes for display options which can
can be set via properties.
*/
class MITKCONTOURMODEL_EXPORT ContourModel : public BaseData
{
public:
mitkClassMacro(ContourModel, BaseData);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/*+++++++++++++++ typedefs +++++++++++++++++++++++++++++++*/
typedef mitk::ContourElement::VertexType VertexType;
typedef mitk::ContourElement::VertexListType VertexListType;
typedef mitk::ContourElement::VertexIterator VertexIterator;
typedef mitk::ContourElement::ConstVertexIterator ConstVertexIterator;
typedef std::vector<mitk::ContourElement::Pointer> ContourModelSeries;
/*+++++++++++++++ END typedefs ++++++++++++++++++++++++++++*/
/** \brief Possible interpolation of the line segments between control points */
enum LineSegmentInterpolation
{
LINEAR,
B_SPLINE
};
/*++++++++++++++++ inline methods +++++++++++++++++++++++*/
/** \brief Get the current selected vertex.
*/
VertexType *GetSelectedVertex() { return this->m_SelectedVertex; }
/** \brief Deselect vertex.
*/
void Deselect() { this->m_SelectedVertex = nullptr; }
/** \brief Set selected vertex as control point
*/
void SetSelectedVertexAsControlPoint(bool isControlPoint = true)
{
if (this->m_SelectedVertex)
{
m_SelectedVertex->IsControlPoint = isControlPoint;
this->Modified();
}
}
/** \brief Set the interpolation of the line segments between control points.
*/
void SetLineSegmentInterpolation(LineSegmentInterpolation interpolation)
{
this->m_lineInterpolation = interpolation;
this->Modified();
}
/** \brief Get the interpolation of the line segments between control points.
*/
LineSegmentInterpolation GetLineSegmentInterpolation() { return this->m_lineInterpolation; }
/*++++++++++++++++ END inline methods +++++++++++++++++++++++*/
/** \brief Add a vertex to the contour at given timestep.
The vertex is added at the end of contour.
\param vertex - coordinate representation of a control point
\param timestep - the timestep at which the vertex will be add ( default 0)
@Note Adding a vertex to a timestep which exceeds the timebounds of the contour
will not be added, the TimeGeometry will not be expanded.
*/
void AddVertex(mitk::Point3D &vertex, int timestep = 0);
/** \brief Add a vertex to the contour at given timestep.
The vertex is added at the end of contour.
\param vertex - coordinate representation of a control point
\param timestep - the timestep at which the vertex will be add ( default 0)
@Note Adding a vertex to a timestep which exceeds the timebounds of the contour
will not be added, the TimeGeometry will not be expanded.
*/
void AddVertex(VertexType &vertex, int timestep = 0);
/** \brief Add a vertex to the contour at given timestep.
The vertex is added at the end of contour.
\param vertex - coordinate representation of a control point
\param timestep - the timestep at which the vertex will be add ( default 0)
@Note Adding a vertex to a timestep which exceeds the timebounds of the contour
will not be added, the TimeSlicedGeometry will not be expanded.
*/
void AddVertex(const VertexType *vertex, int timestep = 0);
/** \brief Add a vertex to the contour.
\param vertex - coordinate representation of a control point
\param timestep - the timestep at which the vertex will be add ( default 0)
\param isControlPoint - specifies the vertex to be handled in a special way (e.g. control points
will be rendered).
@Note Adding a vertex to a timestep which exceeds the timebounds of the contour
will not be added, the TimeGeometry will not be expanded.
*/
void AddVertex(mitk::Point3D &vertex, bool isControlPoint, int timestep = 0);
/** \brief Add a vertex to the contour at given timestep AT THE FRONT of the contour.
The vertex is added at the FRONT of contour.
\param vertex - coordinate representation of a control point
\param timestep - the timestep at which the vertex will be add ( default 0)
@Note Adding a vertex to a timestep which exceeds the timebounds of the contour
will not be added, the TimeGeometry will not be expanded.
*/
void AddVertexAtFront(mitk::Point3D &vertex, int timestep = 0);
/** \brief Add a vertex to the contour at given timestep AT THE FRONT of the contour.
The vertex is added at the FRONT of contour.
\param vertex - coordinate representation of a control point
\param timestep - the timestep at which the vertex will be add ( default 0)
@Note Adding a vertex to a timestep which exceeds the timebounds of the contour
will not be added, the TimeGeometry will not be expanded.
*/
void AddVertexAtFront(VertexType &vertex, int timestep = 0);
/** \brief Add a vertex to the contour at given timestep AT THE FRONT of the contour.
\param vertex - coordinate representation of a control point
\param timestep - the timestep at which the vertex will be add ( default 0)
\param isControlPoint - specifies the vertex to be handled in a special way (e.g. control points
will be rendered).
@Note Adding a vertex to a timestep which exceeds the timebounds of the contour
will not be added, the TimeGeometry will not be expanded.
*/
void AddVertexAtFront(mitk::Point3D &vertex, bool isControlPoint, int timestep = 0);
/** \brief Insert a vertex at given index.
*/
void InsertVertexAtIndex(mitk::Point3D &vertex, int index, bool isControlPoint = false, int timestep = 0);
/** \brief Set a coordinates for point at given index.
*/
bool SetVertexAt(int pointId, const mitk::Point3D &point, unsigned int timestep = 0);
/** \brief Set a coordinates for point at given index.
*/
bool SetVertexAt(int pointId, const VertexType *vertex, unsigned int timestep = 0);
/** \brief Return if the contour is closed or not.
*/
bool IsClosed(int timestep = 0) const;
/** \brief Concatenate two contours.
The starting control point of the other will be added at the end of the contour.
\pararm timestep - the timestep at which the vertex will be add ( default 0)
\pararm check - check for intersections ( default false)
*/
void Concatenate(mitk::ContourModel *other, int timestep = 0, bool check = false);
/** \brief Returns a const VertexIterator at the start element of the contour.
@throw mitk::Exception if the timestep is invalid.
*/
VertexIterator Begin(int timestep = 0) const;
/** \brief Returns a const VertexIterator at the start element of the contour.
@throw mitk::Exception if the timestep is invalid.
*/
VertexIterator IteratorBegin(int timestep = 0) const;
/** \brief Returns a const VertexIterator at the end element of the contour.
@throw mitk::Exception if the timestep is invalid.
*/
VertexIterator End(int timestep = 0) const;
/** \brief Returns a const VertexIterator at the end element of the contour.
@throw mitk::Exception if the timestep is invalid.
*/
VertexIterator IteratorEnd(int timestep = 0) const;
/** \brief Close the contour.
The last control point will be linked with the first point.
*/
virtual void Close(int timestep = 0);
/** \brief Set isClosed to false contour.
The link between the last control point the first point will be removed.
*/
virtual void Open(int timestep = 0);
/** \brief Set closed property to given boolean.
false - The link between the last control point the first point will be removed.
true - The last control point will be linked with the first point.
*/
virtual void SetClosed(bool isClosed, int timestep = 0);
/** \brief Returns the number of vertices at a given timestep.
\param timestep - default = 0
*/
int GetNumberOfVertices(int timestep = 0) const;
/** \brief Returns whether the contour model is empty at a given timestep.
\pararm timestep - default = 0
*/
virtual bool IsEmpty(int timestep) const;
/** \brief Returns whether the contour model is empty.
*/
bool IsEmpty() const override;
/** \brief Returns the vertex at the index position within the container.
*/
virtual const VertexType *GetVertexAt(int index, int timestep = 0) const;
/** \brief Remove a vertex at given timestep within the container.
\return index of vertex. -1 if not found.
*/
int GetIndex(const VertexType *vertex, int timestep = 0);
/** \brief Check if there isn't something at this timestep.
*/
bool IsEmptyTimeStep(unsigned int t) const override;
/** \brief Check if mouse cursor is near the contour.
*/
virtual bool IsNearContour(mitk::Point3D &point, float eps, int timestep);
/** \brief Mark a vertex at an index in the container as selected.
*/
bool SelectVertexAt(int index, int timestep = 0);
/** \brief Mark a vertex at an index in the container as control point.
*/
bool SetControlVertexAt(int index, int timestep = 0);
/** \brief Mark a vertex at a given position in 3D space.
\param point - query point in 3D space
\param eps - radius for nearest neighbour search (error bound).
\param timestep - search at this timestep
@return true = vertex found; false = no vertex found
*/
bool SelectVertexAt(mitk::Point3D &point, float eps, int timestep = 0);
/*
\pararm point - query point in 3D space
\pararm eps - radius for nearest neighbour search (error bound).
\pararm timestep - search at this timestep
@return true = vertex found; false = no vertex found
*/
bool SetControlVertexAt(mitk::Point3D &point, float eps, int timestep = 0);
/** \brief Remove a vertex at given index within the container.
@return true = the vertex was successfuly removed; false = wrong index.
*/
bool RemoveVertexAt(int index, int timestep = 0);
/** \brief Remove a vertex at given timestep within the container.
@return true = the vertex was successfuly removed.
*/
bool RemoveVertex(const VertexType *vertex, int timestep = 0);
/** \brief Remove a vertex at a query position in 3D space.
The vertex to be removed will be search by nearest neighbour search.
Note that possibly no vertex at this position and eps is stored inside
the contour.
@return true = the vertex was successfuly removed; false = no vertex found.
*/
bool RemoveVertexAt(mitk::Point3D &point, float eps, int timestep = 0);
/** \brief Shift the currently selected vertex by a translation vector.
\param translate - the translation vector.
*/
void ShiftSelectedVertex(mitk::Vector3D &translate);
/** \brief Shift the whole contour by a translation vector at given timestep.
\param translate - the translation vector.
\param timestep - at this timestep the contour will be shifted.
*/
void ShiftContour(mitk::Vector3D &translate, int timestep = 0);
/** \brief Clear the storage container at given timestep.
All control points are removed at
timestep.
*/
virtual void Clear(int timestep);
/** \brief Initialize all data objects
*/
void Initialize() override;
/** \brief Initialize object with specs of other contour.
Note: No data will be copied.
*/
void Initialize(mitk::ContourModel &other);
/*++++++++++++++++++ method inherit from base data +++++++++++++++++++++++++++*/
/**
\brief Inherit from base data - no region support available for contourModel objects.
*/
void SetRequestedRegionToLargestPossibleRegion() override;
/**
\brief Inherit from base data - no region support available for contourModel objects.
*/
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
/**
\brief Inherit from base data - no region support available for contourModel objects.
*/
bool VerifyRequestedRegion() override;
/**
\brief Get the updated geometry with recomputed bounds.
*/
virtual const mitk::BaseGeometry *GetUpdatedGeometry(int t = 0);
/**
\brief Get the BaseGeometry for timestep t.
*/
virtual mitk::BaseGeometry *GetGeometry(int t = 0) const;
/**
\brief Inherit from base data - no region support available for contourModel objects.
*/
void SetRequestedRegion(const itk::DataObject *data) override;
/**
\brief Expand the timebounds of the TimeGeometry to given number of timesteps.
*/
void Expand(unsigned int timeSteps) override;
/**
\brief Update the OutputInformation of a ContourModel object
The BoundingBox of the contour will be updated, if necessary.
*/
void UpdateOutputInformation() override;
/**
\brief Clear the storage container.
The object is set to initial state. All control points are removed and the number of
timesteps are set to 1.
*/
void Clear() override;
/**
\brief overwrite if the Data can be called by an Interactor (StateMachine).
*/
void ExecuteOperation(Operation *operation) override;
/** \brief Redistributes ontrol vertices with a given period (as number of vertices)
\param period - the number of vertices between control points.
\param timestep - at this timestep all lines will be rebuilt.
*/
virtual void RedistributeControlVertices(int period, int timestep);
protected:
mitkCloneMacro(Self);
ContourModel();
ContourModel(const mitk::ContourModel &other);
~ContourModel() override;
// inherit from BaseData. called by Clear()
void ClearData() override;
// inherit from BaseData. Initial state of a contour with no vertices and a single timestep.
void InitializeEmpty() override;
// Shift a vertex
void ShiftVertex(VertexType *vertex, mitk::Vector3D &vector);
// Storage with time resolved support.
ContourModelSeries m_ContourSeries;
// The currently selected vertex.
VertexType *m_SelectedVertex;
// The interpolation of the line segment between control points.
LineSegmentInterpolation m_lineInterpolation;
// only update the bounding geometry if necessary
bool m_UpdateBoundingBox;
};
itkEventMacro(ContourModelEvent, itk::AnyEvent);
itkEventMacro(ContourModelShiftEvent, ContourModelEvent);
itkEventMacro(ContourModelSizeChangeEvent, ContourModelEvent);
itkEventMacro(ContourModelAddEvent, ContourModelSizeChangeEvent);
itkEventMacro(ContourModelRemoveEvent, ContourModelSizeChangeEvent);
itkEventMacro(ContourModelExpandTimeBoundsEvent, ContourModelEvent);
itkEventMacro(ContourModelClosedEvent, ContourModelEvent);
}
#endif
diff --git a/Modules/ContourModel/DataManagement/mitkContourModelSet.h b/Modules/ContourModel/DataManagement/mitkContourModelSet.h
index fcfaaf0a2f..d23664374e 100644
--- a/Modules/ContourModel/DataManagement/mitkContourModelSet.h
+++ b/Modules/ContourModel/DataManagement/mitkContourModelSet.h
@@ -1,118 +1,120 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _mitkContourModelSet_H_
#define _mitkContourModelSet_H_
#include "mitkCommon.h"
#include <MitkContourModelExports.h>
#include "mitkContourModel.h"
#include <deque>
namespace mitk
{
/** \brief
*/
class MITKCONTOURMODEL_EXPORT ContourModelSet : public mitk::BaseData
{
public:
mitkClassMacro(ContourModelSet, mitk::BaseData);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
typedef std::deque<mitk::ContourModel::Pointer> ContourModelListType;
typedef ContourModelListType::iterator ContourModelSetIterator;
// start of inline methods
/** \brief Return an iterator a the front.
*/
virtual ContourModelSetIterator Begin() { return this->m_Contours.begin(); }
/** \brief Return an iterator a the front.
*/
virtual ContourModelSetIterator End() { return this->m_Contours.end(); }
/** \brief Returns the number of contained contours.
*/
virtual int GetSize() const { return this->m_Contours.size(); }
// end of inline methods
/** \brief Add a ContourModel to the container.
*/
virtual void AddContourModel(mitk::ContourModel &contourModel);
/** \brief Add a ContourModel to the container.
*/
virtual void AddContourModel(mitk::ContourModel::Pointer contourModel);
/** \brief Returns the ContourModel a given index
\param index
*/
virtual mitk::ContourModel *GetContourModelAt(int index) const;
/** \brief Returns the container of the contours.
*/
ContourModelListType *GetContourModelList();
/** \brief Returns a bool whether the container is empty or not.
*/
bool IsEmpty() const override;
/** \brief Remove the given ContourModel from the container if exists.
\param ContourModel - the ContourModel to be removed.
*/
virtual bool RemoveContourModel(mitk::ContourModel *contourModel);
/** \brief Remove a ContourModel at given index within the container if exists.
\param index - the index where the ContourModel should be removed.
*/
virtual bool RemoveContourModelAt(int index);
/** \brief Clear the storage container.
*/
void Clear() override;
//////////////// inherit from mitk::BaseData ////////////////////
/* NO support for regions ! */
void SetRequestedRegionToLargestPossibleRegion() override {}
bool RequestedRegionIsOutsideOfTheBufferedRegion() override { return false; }
bool VerifyRequestedRegion() override { return true; }
void SetRequestedRegion(const itk::DataObject *) override {}
/**
\brief Update the OutputInformation of a ContourModel object
The BoundingBox of the contour will be updated, if necessary.
*/
void UpdateOutputInformation() override;
//////////////// END inherit from mitk::BaseData ////////////////////
protected:
mitkCloneMacro(Self);
ContourModelSet();
ContourModelSet(const mitk::ContourModelSet &other);
~ContourModelSet() override;
// inherit from BaseData. Initial state with no contours and a single timestep.
void InitializeEmpty() override;
ContourModelListType m_Contours;
// only update the bounding geometry if necessary
bool m_UpdateBoundingBox;
};
} // namespace mitk
#endif // _mitkContourModelSet_H_
diff --git a/Modules/ContourModel/IO/mitkContourModelSerializer.h b/Modules/ContourModel/IO/mitkContourModelSerializer.h
index ebfe755dd7..876d12aa36 100644
--- a/Modules/ContourModel/IO/mitkContourModelSerializer.h
+++ b/Modules/ContourModel/IO/mitkContourModelSerializer.h
@@ -1,35 +1,36 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKCONTOURMODELSERIALIZER_H
#define MITKCONTOURMODELSERIALIZER_H
#include <MitkContourModelExports.h>
#include <mitkBaseDataSerializer.h>
namespace mitk
{
class MITKCONTOURMODEL_EXPORT ContourModelSerializer : public BaseDataSerializer
{
public:
mitkClassMacro(ContourModelSerializer, BaseDataSerializer);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
std::string Serialize() override;
protected:
ContourModelSerializer();
~ContourModelSerializer() override;
};
}
#endif // MITKCONTOURMODELSERIALIZER_H
diff --git a/Modules/ContourModel/IO/mitkContourModelSetSerializer.h b/Modules/ContourModel/IO/mitkContourModelSetSerializer.h
index 2e08342128..fe40afd717 100644
--- a/Modules/ContourModel/IO/mitkContourModelSetSerializer.h
+++ b/Modules/ContourModel/IO/mitkContourModelSetSerializer.h
@@ -1,35 +1,36 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKCONTOURMODELSETSERIALIZER_H
#define MITKCONTOURMODELSETSERIALIZER_H
#include <MitkContourModelExports.h>
#include <mitkBaseDataSerializer.h>
namespace mitk
{
class MITKCONTOURMODEL_EXPORT ContourModelSetSerializer : public BaseDataSerializer
{
public:
mitkClassMacro(ContourModelSetSerializer, BaseDataSerializer);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
std::string Serialize() override;
protected:
ContourModelSetSerializer();
~ContourModelSetSerializer() override;
};
}
#endif // MITKCONTOURMODELSETSERIALIZER_H
diff --git a/Modules/ContourModel/Rendering/mitkContourModelGLMapper2D.h b/Modules/ContourModel/Rendering/mitkContourModelGLMapper2D.h
index eaefdbf00e..247c597406 100644
--- a/Modules/ContourModel/Rendering/mitkContourModelGLMapper2D.h
+++ b/Modules/ContourModel/Rendering/mitkContourModelGLMapper2D.h
@@ -1,65 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_ContourModelGLMapper2D_H_
#define MITK_ContourModelGLMapper2D_H_
#include "mitkCommon.h"
#include "mitkContourModel.h"
#include "mitkContourModelGLMapper2DBase.h"
#include <MitkContourModelExports.h>
namespace mitk
{
class BaseRenderer;
class ContourModel;
/**
* @brief OpenGL-based mapper to display a mitk::Contour object in a 2D render window
*
*
* @ingroup MitkContourModelModule
*/
class MITKCONTOURMODEL_EXPORT ContourModelGLMapper2D : public ContourModelGLMapper2DBase
{
public:
mitkClassMacro(ContourModelGLMapper2D, ContourModelGLMapper2DBase);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/**
* reimplemented from Baseclass
*/
void MitkRender(BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) override;
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
LocalStorageHandler<BaseLocalStorage> m_LSH;
protected:
ContourModelGLMapper2D();
~ContourModelGLMapper2D() override;
mitk::ContourModel::Pointer m_SubdivisionContour;
bool m_InitSubdivisionCurve;
private:
/**
* return a refernce of the rendered data object
*/
ContourModel *GetInput(void);
};
} // namespace mitk
#endif
diff --git a/Modules/ContourModel/Rendering/mitkContourModelMapper2D.h b/Modules/ContourModel/Rendering/mitkContourModelMapper2D.h
index ea4b0e2f2f..537dacd17f 100644
--- a/Modules/ContourModel/Rendering/mitkContourModelMapper2D.h
+++ b/Modules/ContourModel/Rendering/mitkContourModelMapper2D.h
@@ -1,94 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_CONTOURMODEL_MAPPER_H_
#define _MITK_CONTOURMODEL_MAPPER_H_
#include "mitkCommon.h"
#include <MitkContourModelExports.h>
#include "mitkBaseRenderer.h"
#include "mitkVtkMapper.h"
#include "mitkContourModel.h"
//#include "mitkContourModelToVtkPolyDataFilter.h"
#include <vtkActor.h>
#include <vtkPolyData.h>
#include <vtkPolyDataMapper.h>
#include <vtkProp.h>
#include <vtkSmartPointer.h>
namespace mitk
{
class MITKCONTOURMODEL_EXPORT ContourModelMapper2D : public VtkMapper
{
public:
/** Standard class typedefs. */
mitkClassMacro(ContourModelMapper2D, VtkMapper);
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const mitk::ContourModel *GetInput(void);
/** \brief Checks whether this mapper needs to update itself and generate
* data. */
void Update(mitk::BaseRenderer *renderer) override;
/*+++ methods of MITK-VTK rendering pipeline +++*/
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
/*+++ END methods of MITK-VTK rendering pipeline +++*/
class MITKCONTOURMODEL_EXPORT LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkActor> m_Actor;
/** \brief Mapper of a 2D render window. */
vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
// mitk::ContourModelToVtkPolyDataFilter::Pointer m_contourToPolyData;
vtkSmartPointer<vtkPolyData> m_OutlinePolyData;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage() override {}
};
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
/** \brief Get the LocalStorage corresponding to the current renderer. */
LocalStorage *GetLocalStorage(mitk::BaseRenderer *renderer);
/** \brief Set the default properties for general image rendering. */
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
protected:
ContourModelMapper2D();
~ContourModelMapper2D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
virtual vtkSmartPointer<vtkPolyData> CreateVtkPolyDataFromContour(mitk::ContourModel *inputContour,
mitk::BaseRenderer *renderer);
virtual void ApplyContourProperties(mitk::BaseRenderer *renderer);
};
}
#endif
diff --git a/Modules/ContourModel/Rendering/mitkContourModelMapper3D.h b/Modules/ContourModel/Rendering/mitkContourModelMapper3D.h
index 03ae5176cb..452bb233d6 100644
--- a/Modules/ContourModel/Rendering/mitkContourModelMapper3D.h
+++ b/Modules/ContourModel/Rendering/mitkContourModelMapper3D.h
@@ -1,97 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_CONTOURMODEL_MAPPER_3D_H_
#define _MITK_CONTOURMODEL_MAPPER_3D_H_
#include "mitkCommon.h"
#include <MitkContourModelExports.h>
#include "mitkBaseRenderer.h"
#include "mitkVtkMapper.h"
#include "mitkContourModel.h"
//#include "mitkContourModelToVtkPolyDataFilter.h"
#include <vtkActor.h>
#include <vtkPolyData.h>
#include <vtkPolyDataMapper.h>
#include <vtkProp.h>
#include <vtkSmartPointer.h>
#include <vtkTubeFilter.h>
namespace mitk
{
class MITKCONTOURMODEL_EXPORT ContourModelMapper3D : public VtkMapper
{
public:
/** Standard class typedefs. */
mitkClassMacro(ContourModelMapper3D, VtkMapper);
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const mitk::ContourModel *GetInput(void);
/** \brief Checks whether this mapper needs to update itself and generate
* data. */
void Update(mitk::BaseRenderer *renderer) override;
/*+++ methods of MITK-VTK rendering pipeline +++*/
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
/*+++ END methods of MITK-VTK rendering pipeline +++*/
class MITKCONTOURMODEL_EXPORT LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkActor> m_Actor;
/** \brief Mapper of a 2D render window. */
vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
vtkSmartPointer<vtkTubeFilter> m_TubeFilter;
// mitk::ContourModelToVtkPolyDataFilter::Pointer m_contourToPolyData;
vtkSmartPointer<vtkPolyData> m_OutlinePolyData;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage() override {}
};
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
/** \brief Get the LocalStorage corresponding to the current renderer. */
LocalStorage *GetLocalStorage(mitk::BaseRenderer *renderer);
/** \brief Set the default properties for general image rendering. */
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
protected:
ContourModelMapper3D();
~ContourModelMapper3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
virtual vtkSmartPointer<vtkPolyData> CreateVtkPolyDataFromContour(mitk::ContourModel *inputContour);
virtual void ApplyContourProperties(mitk::BaseRenderer *renderer);
};
}
#endif
diff --git a/Modules/ContourModel/Rendering/mitkContourModelSetGLMapper2D.h b/Modules/ContourModel/Rendering/mitkContourModelSetGLMapper2D.h
index fbe0edb10e..c84f56f416 100644
--- a/Modules/ContourModel/Rendering/mitkContourModelSetGLMapper2D.h
+++ b/Modules/ContourModel/Rendering/mitkContourModelSetGLMapper2D.h
@@ -1,64 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_ContourModelSetGLMapper2D_H_
#define MITK_ContourModelSetGLMapper2D_H_
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkContourModelGLMapper2DBase.h"
#include "mitkContourModelSet.h"
#include <MitkContourModelExports.h>
namespace mitk
{
class BaseRenderer;
class ContourModel;
/**
* @brief OpenGL-based mapper to display a mitk::ContourModelSet object containing several contours in a 2D render
* window
*
*
* @ingroup MitkContourModelModule
*/
class MITKCONTOURMODEL_EXPORT ContourModelSetGLMapper2D : public ContourModelGLMapper2DBase
{
public:
mitkClassMacro(ContourModelSetGLMapper2D, ContourModelGLMapper2DBase);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/**
* reimplemented from Baseclass
*/
void MitkRender(mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) override;
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
LocalStorageHandler<BaseLocalStorage> m_LSH;
protected:
ContourModelSetGLMapper2D();
~ContourModelSetGLMapper2D() override;
private:
/**
* return a reference of the rendered data object
*/
ContourModelSet *GetInput(void);
};
} // namespace mitk
#endif
diff --git a/Modules/ContourModel/Rendering/mitkContourModelSetMapper3D.h b/Modules/ContourModel/Rendering/mitkContourModelSetMapper3D.h
index 23332c6ba3..da76d1ed03 100644
--- a/Modules/ContourModel/Rendering/mitkContourModelSetMapper3D.h
+++ b/Modules/ContourModel/Rendering/mitkContourModelSetMapper3D.h
@@ -1,95 +1,96 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_CONTOURMODELSET_MAPPER_3D_H_
#define _MITK_CONTOURMODELSET_MAPPER_3D_H_
#include "mitkCommon.h"
#include <MitkContourModelExports.h>
#include "mitkBaseRenderer.h"
#include "mitkVtkMapper.h"
#include "mitkContourModel.h"
#include "mitkContourModelSet.h"
#include "mitkContourModelToSurfaceFilter.h"
#include <vtkActor.h>
#include <vtkAssembly.h>
#include <vtkPolyData.h>
#include <vtkPolyDataMapper.h>
#include <vtkProp.h>
#include <vtkSmartPointer.h>
#include <vtkTubeFilter.h>
namespace mitk
{
class MITKCONTOURMODEL_EXPORT ContourModelSetMapper3D : public VtkMapper
{
public:
/** Standard class typedefs. */
mitkClassMacro(ContourModelSetMapper3D, VtkMapper);
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const mitk::ContourModelSet *GetInput(void);
/** \brief Checks whether this mapper needs to update itself and generate
* data. */
void Update(mitk::BaseRenderer *renderer) override;
/*+++ methods of MITK-VTK rendering pipeline +++*/
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
/*+++ END methods of MITK-VTK rendering pipeline +++*/
class MITKCONTOURMODEL_EXPORT LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/** \brief Assembly of contours. */
vtkSmartPointer<vtkAssembly> m_Assembly;
mitk::ContourModelToSurfaceFilter::Pointer m_contourToPolyData;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage() override {}
};
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
/** \brief Get the LocalStorage corresponding to the current renderer. */
LocalStorage *GetLocalStorage(mitk::BaseRenderer *renderer);
/** \brief Set the default properties for general image rendering. */
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
protected:
ContourModelSetMapper3D();
~ContourModelSetMapper3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
virtual vtkSmartPointer<vtkPolyData> CreateVtkPolyDataFromContour(mitk::ContourModel *inputContour,
mitk::BaseRenderer *renderer);
virtual void ApplyContourProperties(mitk::BaseRenderer *renderer);
virtual void ApplyContourModelSetProperties(BaseRenderer *renderer);
};
}
#endif
diff --git a/Modules/Core/include/itkImportMitkImageContainer.h b/Modules/Core/include/itkImportMitkImageContainer.h
index 9104e3dc08..59f79e4ab4 100644
--- a/Modules/Core/include/itkImportMitkImageContainer.h
+++ b/Modules/Core/include/itkImportMitkImageContainer.h
@@ -1,101 +1,102 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __itkImportMitkImageContainer_h
#define __itkImportMitkImageContainer_h
#include <itkImportImageContainer.h>
#include <mitkImageAccessorBase.h>
#include <mitkImageDataItem.h>
namespace itk
{
/** \class ImportMitkImageContainer
* Defines an itk::Image front-end to an mitk::Image. This container
* conforms to the ImageContainerInterface. This is a full-fleged Object,
* so there is modification time, debug, and reference count information.
*
* Template parameters for ImportMitkImageContainer:
*
* TElementIdentifier =
* An INTEGRAL type for use in indexing the imported buffer.
*
* TElement =
* The element type stored in the container.
*/
template <typename TElementIdentifier, typename TElement>
class ImportMitkImageContainer : public ImportImageContainer<TElementIdentifier, TElement>
{
public:
/** Standard class typedefs. */
typedef ImportMitkImageContainer Self;
typedef Object Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
/** Save the template parameters. */
typedef TElementIdentifier ElementIdentifier;
typedef TElement Element;
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Standard part of every itk Object. */
itkTypeMacro(ImportMitkImageContainer, ImportImageContainer);
///** Get the pointer from which the image data is imported. */
// TElement *GetImportPointer() {return m_ImportPointer;};
/** \brief Set the mitk::ImageDataItem to be imported */
// void SetImageDataItem(mitk::ImageDataItem* imageDataItem);
void SetImageAccessor(mitk::ImageAccessorBase *imageAccess, size_t noBytes);
protected:
ImportMitkImageContainer();
~ImportMitkImageContainer() override;
/** PrintSelf routine. Normally this is a protected internal method. It is
* made public here so that Image can call this method. Users should not
* call this method but should call Print() instead. */
void PrintSelf(std::ostream &os, Indent indent) const override;
private:
ImportMitkImageContainer(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
// mitk::ImageDataItem::Pointer m_ImageDataItem;
mitk::ImageAccessorBase *m_imageAccess;
};
} // end namespace itk
// Define instantiation macro for this template.
#define ITK_TEMPLATE_ImportMitkImageContainer(_, EXPORT, x, y) \
namespace itk \
{ \
_(2(class EXPORT ImportMitkImageContainer<ITK_TEMPLATE_2 x>)) \
namespace Templates \
{ \
typedef ImportMitkImageContainer<ITK_TEMPLATE_2 x> ImportMitkImageContainer##y; \
} \
}
//#if ITK_TEMPLATE_EXPLICIT
//# include "Templates/itkImportMitkImageContainer+-.h"
//#endif
#if ITK_TEMPLATE_TXX
#include "itkImportMitkImageContainer.txx"
#endif
#endif
diff --git a/Modules/Core/include/itkMITKScalarImageToHistogramGenerator.h b/Modules/Core/include/itkMITKScalarImageToHistogramGenerator.h
index e211d7ab73..4072eba611 100644
--- a/Modules/Core/include/itkMITKScalarImageToHistogramGenerator.h
+++ b/Modules/Core/include/itkMITKScalarImageToHistogramGenerator.h
@@ -1,89 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __itkMITKScalarImageToHistogramGenerator_h
#define __itkMITKScalarImageToHistogramGenerator_h
#include <itkImageToListSampleAdaptor.h>
#include <itkObject.h>
#include <itkSampleToHistogramFilter.h>
namespace itk
{
namespace Statistics
{
template <class TImageType, class TMeasurementType = typename TImageType::PixelType>
class MITKScalarImageToHistogramGenerator : public Object
{
public:
/** Standard typedefs */
typedef MITKScalarImageToHistogramGenerator Self;
typedef Object Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
/** Run-time type information (and related methods). */
itkTypeMacro(MITKScalarImageToHistogramGenerator, Object);
/** standard New() method support */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef TImageType ImageType;
typedef itk::Statistics::ImageToListSampleAdaptor<ImageType> AdaptorType;
typedef typename AdaptorType::Pointer AdaptorPointer;
typedef typename ImageType::PixelType PixelType;
typedef itk::Statistics::Histogram<TMeasurementType, itk::Statistics::DenseFrequencyContainer2> HistogramType;
typedef itk::Statistics::SampleToHistogramFilter<AdaptorType, HistogramType> GeneratorType;
typedef typename GeneratorType::Pointer GeneratorPointer;
typedef typename HistogramType::Pointer HistogramPointer;
typedef typename HistogramType::ConstPointer HistogramConstPointer;
public:
/** Triggers the Computation of the histogram */
void Compute(void);
/** Connects the input image for which the histogram is going to be computed */
void SetInput(const ImageType *);
/** Return the histogram. o
\warning This output is only valid after the Compute() method has been invoked
\sa Compute */
const HistogramType *GetOutput() const;
/** Set number of histogram bins */
void SetNumberOfBins(unsigned int numberOfBins);
/** Set marginal scale value to be passed to the histogram generator */
void SetMarginalScale(double marginalScale);
protected:
MITKScalarImageToHistogramGenerator();
~MITKScalarImageToHistogramGenerator() override{};
void PrintSelf(std::ostream &os, Indent indent) const override;
private:
AdaptorPointer m_ImageToListAdaptor;
GeneratorPointer m_HistogramGenerator;
};
} // end of namespace Statistics
} // end of namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkMITKScalarImageToHistogramGenerator.txx"
#endif
#endif
diff --git a/Modules/Core/include/itkVtkAbstractTransform.h b/Modules/Core/include/itkVtkAbstractTransform.h
index 57c5030125..54ff4715b7 100644
--- a/Modules/Core/include/itkVtkAbstractTransform.h
+++ b/Modules/Core/include/itkVtkAbstractTransform.h
@@ -1,99 +1,101 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKVTKABSTRACTTRANSFORM_H_HEADER_INCLUDED_C1C68A2C
#define MITKVTKABSTRACTTRANSFORM_H_HEADER_INCLUDED_C1C68A2C
#include "itkTransform.h"
#include <MitkCoreExports.h>
class vtkAbstractTransform;
namespace itk
{
//##Documentation
//## @brief Adapter from vtkAbstractTransform to itk::Transform<TScalarType, 3, 3>
//## @ingroup Geometry
template <class TScalarType>
class VtkAbstractTransform : public itk::Transform<TScalarType, 3, 3>
{
public:
typedef VtkAbstractTransform Self;
typedef Transform<TScalarType, 3, 3> Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
typedef typename Superclass::OutputPointType OutputPointType;
typedef typename Superclass::OutputVectorType OutputVectorType;
typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
typedef typename Superclass::InputPointType InputPointType;
typedef typename Superclass::InputVectorType InputVectorType;
typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
typedef typename Superclass::ParametersType ParametersType;
typedef typename Superclass::JacobianType JacobianType;
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
//##Documentation
//## @brief Get the vtkAbstractTransform (stored in m_VtkAbstractTransform)
virtual vtkAbstractTransform *GetVtkAbstractTransform() const;
//##Documentation
//## @brief Get the inverse vtkAbstractTransform (stored in m_InverseVtkAbstractTransform)
virtual vtkAbstractTransform *GetInverseVtkAbstractTransform() const;
//##Documentation
//## @brief Set the vtkAbstractTransform (stored in m_VtkAbstractTransform)
virtual void SetVtkAbstractTransform(vtkAbstractTransform *aVtkAbstractTransform);
using Superclass::TransformVector;
using Superclass::TransformCovariantVector;
OutputPointType TransformPoint(const InputPointType &) const override;
OutputVectorType TransformVector(const InputVectorType &) const override;
OutputVnlVectorType TransformVector(const InputVnlVectorType &) const override;
OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &) const override;
virtual InputPointType BackTransform(const OutputPointType &point) const;
virtual InputVectorType BackTransform(const OutputVectorType &vector) const;
virtual InputVnlVectorType BackTransform(const OutputVnlVectorType &vector) const;
virtual InputCovariantVectorType BackTransform(const OutputCovariantVectorType &vector) const;
void SetParameters(const ParametersType &) override;
void SetFixedParameters(const ParametersType &) override;
void ComputeJacobianWithRespectToParameters(const InputPointType &, JacobianType &) const override;
void ComputeJacobianWithRespectToPosition(const InputPointType &, JacobianType &) const override;
unsigned long GetMTime() const override;
protected:
VtkAbstractTransform();
~VtkAbstractTransform() override;
//##Documentation
//## @brief Instance of the vtkAbstractTransform
vtkAbstractTransform *m_VtkAbstractTransform;
//##Documentation
//## @brief Instance of the vtkAbstractTransform
vtkAbstractTransform *m_InverseVtkAbstractTransform;
mutable unsigned long m_LastVtkAbstractTransformTimeStamp;
};
} // namespace itk
#ifndef MITK_MANUAL_INSTANTIATION
#include "itkVtkAbstractTransform.txx"
#endif
#endif /* MITKVTKABSTRACTTRANSFORM_H_HEADER_INCLUDED_C1C68A2C */
diff --git a/Modules/Core/include/mitkAbstractTransformGeometry.h b/Modules/Core/include/mitkAbstractTransformGeometry.h
index 30ffb262a1..611fcf7524 100644
--- a/Modules/Core/include/mitkAbstractTransformGeometry.h
+++ b/Modules/Core/include/mitkAbstractTransformGeometry.h
@@ -1,232 +1,234 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKVTKABSTRACTTRANSFORMPLANEGEOMETRY_H_HEADER_INCLUDED_C1C68A2C
#define MITKVTKABSTRACTTRANSFORMPLANEGEOMETRY_H_HEADER_INCLUDED_C1C68A2C
#include "mitkPlaneGeometry.h"
#include <MitkCoreExports.h>
#include "itkVtkAbstractTransform.h"
class vtkAbstractTransform;
namespace mitk
{
//##Documentation
//## @brief Describes a geometry defined by an vtkAbstractTransform and a plane
//##
//## vtkAbstractTransform is the most general transform in vtk (superclass for
//## all vtk geometric transformations). It defines an arbitrary 3D transformation,
//## i.e., a transformation of 3D space into 3D space. In contrast,
//## AbstractTransformGeometry (since it is a subclass of PlaneGeometry) describes a
//## 2D manifold in 3D space. The 2D manifold is defined as the manifold that results
//## from transforming a rectangle (given in m_Plane as a PlaneGeometry) by the
//## vtkAbstractTransform (given in m_VtkAbstractTransform).
//## The PlaneGeometry m_Plane is used to define the parameter space. 2D coordinates are
//## first mapped by the PlaneGeometry and the resulting 3D coordinates are put into
//## the vtkAbstractTransform.
//## @note This class is the superclass of concrete geometries. Since there is no
//## write access to the vtkAbstractTransform and m_Plane, this class is somehow
//## abstract. For full write access from extern, use ExternAbstractTransformGeometry.
//## @note The bounds of the PlaneGeometry are used as the parametric bounds.
//## @sa ExternAbstractTransformGeometry
//## @ingroup Geometry
class MITKCORE_EXPORT AbstractTransformGeometry : public PlaneGeometry
{
public:
mitkClassMacro(AbstractTransformGeometry, PlaneGeometry);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
//##Documentation
//## @brief Get the vtkAbstractTransform (stored in m_VtkAbstractTransform)
virtual vtkAbstractTransform *GetVtkAbstractTransform() const;
unsigned long GetMTime() const override;
//##Documentation
//## @brief Get the rectangular area that is used for transformation by
//## m_VtkAbstractTransform and therewith defines the 2D manifold described by
//## AbstractTransformGeometry
itkGetConstObjectMacro(Plane, PlaneGeometry);
/**
* \brief projects the given point onto the curved plane
*/
bool Project(const mitk::Point3D &pt3d_mm, mitk::Point3D &projectedPt3d_mm) const override;
/**
* \brief projects a given vector starting from given point onto the curved plane
* \warning no satisfiyng implementation existing yet
*/
bool Project(const mitk::Point3D &atPt3d_mm,
const mitk::Vector3D &vec3d_mm,
mitk::Vector3D &projectedVec3d_mm) const override;
/**
* \brief projects a given vector starting from standard point onto the curved plane
* \warning no satisfying implementation existing yet
*/
bool Project(const mitk::Vector3D &vec3d_mm, mitk::Vector3D &projectedVec3d_mm) const override;
bool Map(const mitk::Point3D &pt3d_mm, mitk::Point2D &pt2d_mm) const override;
void Map(const mitk::Point2D &pt2d_mm, mitk::Point3D &pt3d_mm) const override;
bool Map(const mitk::Point3D &atPt3d_mm,
const mitk::Vector3D &vec3d_mm,
mitk::Vector2D &vec2d_mm) const override;
void Map(const mitk::Point2D &atPt2d_mm,
const mitk::Vector2D &vec2d_mm,
mitk::Vector3D &vec3d_mm) const override;
void IndexToWorld(const mitk::Point2D &pt_units, mitk::Point2D &pt_mm) const override;
void WorldToIndex(const mitk::Point2D &pt_mm, mitk::Point2D &pt_units) const override;
//##Documentation
//## @brief Convert (continuous or discrete) index coordinates of a \em vector
//## \a vec_units to world coordinates (in mm)
//## @deprecated First parameter (Point2D) is not used. If possible, please use void IndexToWorld(const
// mitk::Vector2D& vec_units, mitk::Vector2D& vec_mm) const.
//## For further information about coordinates types, please see the Geometry documentation
void IndexToWorld(const mitk::Point2D &atPt2d_units,
const mitk::Vector2D &vec_units,
mitk::Vector2D &vec_mm) const override;
//##Documentation
//## @brief Convert (continuous or discrete) index coordinates of a \em vector
//## \a vec_units to world coordinates (in mm)
//## For further information about coordinates types, please see the Geometry documentation
void IndexToWorld(const mitk::Vector2D &vec_units, mitk::Vector2D &vec_mm) const override;
//##Documentation
//## @brief Convert world coordinates (in mm) of a \em vector
//## \a vec_mm to (continuous!) index coordinates.
//## @deprecated First parameter (Point2D) is not used. If possible, please use void WorldToIndex(const
// mitk::Vector2D& vec_mm, mitk::Vector2D& vec_units) const.
//## For further information about coordinates types, please see the Geometry documentation
void WorldToIndex(const mitk::Point2D &atPt2d_mm,
const mitk::Vector2D &vec_mm,
mitk::Vector2D &vec_units) const override;
//##Documentation
//## @brief Convert world coordinates (in mm) of a \em vector
//## \a vec_mm to (continuous!) index coordinates.
//## For further information about coordinates types, please see the Geometry documentation
void WorldToIndex(const mitk::Vector2D &vec_mm, mitk::Vector2D &vec_units) const override;
bool IsAbove(const Point3D &pt3d_mm, bool considerBoundingBox = false) const override;
virtual mitk::ScalarType GetParametricExtentInMM(int direction) const;
virtual const itk::Transform<mitk::ScalarType, 3, 3> *GetParametricTransform() const;
//##Documentation
//## @brief Change the parametric bounds to @a oversampling times
//## the bounds of m_Plane.
//##
//## The change is done once (immediately). Later changes of the bounds
//## of m_Plane will not influence the parametric bounds. (Consequently,
//## there is no method to get the oversampling.)
virtual void SetOversampling(mitk::ScalarType oversampling);
//##Documentation
//## @brief Calculates the standard part of a BaseGeometry
//## (IndexToWorldTransform and bounding box) around the
//## curved geometry. Has to be implemented in subclasses.
//##
//## \sa SetFrameGeometry
virtual void CalculateFrameGeometry();
//##Documentation
//## @brief Set the frame geometry which is used as the standard
//## part of an BaseGeometry (IndexToWorldTransform and bounding box)
//##
//## Maybe used as a hint within which the interpolation shall occur
//## by concrete sub-classes.
//## \sa CalculateFrameGeometry
virtual void SetFrameGeometry(const mitk::BaseGeometry *frameGeometry);
itk::LightObject::Pointer InternalClone() const override;
//##Documentation
//## @brief Get the parametric bounding-box
//##
//## See AbstractTransformGeometry for an example usage of this.
itkGetConstObjectMacro(ParametricBoundingBox, BoundingBox);
//##Documentation
//## @brief Get the parametric bounds
//##
//## See AbstractTransformGeometry for an example usage of this.
const BoundingBox::BoundsArrayType &GetParametricBounds() const;
//##Documentation
//## @brief Get the parametric extent
//##
//## See AbstractTransformGeometry for an example usage of this.
mitk::ScalarType GetParametricExtent(int direction) const;
protected:
AbstractTransformGeometry();
AbstractTransformGeometry(const AbstractTransformGeometry &other);
~AbstractTransformGeometry() override;
//##Documentation
//## @brief Set the vtkAbstractTransform (stored in m_VtkAbstractTransform)
//##
//## Protected in this class, made public in ExternAbstractTransformGeometry.
virtual void SetVtkAbstractTransform(vtkAbstractTransform *aVtkAbstractTransform);
//##Documentation
//## @brief Set the rectangular area that is used for transformation by
//## m_VtkAbstractTransform and therewith defines the 2D manifold described by
//## ExternAbstractTransformGeometry
//##
//## Protected in this class, made public in ExternAbstractTransformGeometry.
//## @note The bounds of the PlaneGeometry are used as the parametric bounds.
//## @note The PlaneGeometry is cloned, @em not linked/referenced.
virtual void SetPlane(const mitk::PlaneGeometry *aPlane);
//##Documentation
//## @brief The rectangular area that is used for transformation by
//## m_VtkAbstractTransform and therewith defines the 2D manifold described by
//## AbstractTransformGeometry.
mitk::PlaneGeometry::Pointer m_Plane;
itk::VtkAbstractTransform<ScalarType>::Pointer m_ItkVtkAbstractTransform;
mitk::BaseGeometry::Pointer m_FrameGeometry;
//##Documentation
//## @brief Set the parametric bounds
//##
//## Protected in this class, made public in some sub-classes, e.g.,
//## ExternAbstractTransformGeometry.
virtual void SetParametricBounds(const BoundingBox::BoundsArrayType &bounds);
mutable mitk::BoundingBox::Pointer m_ParametricBoundingBox;
//##Documentation
//## @brief PreSetSpacing
//##
//## These virtual function allows a different beahiour in subclasses.
//## Do implement them in every subclass of BaseGeometry. If not needed, use
//## {Superclass::PreSetSpacing();};
void PreSetSpacing(const mitk::Vector3D &aSpacing) override { Superclass::PreSetSpacing(aSpacing); };
};
} // namespace mitk
#endif /* MITKVTKABSTRACTTRANSFORMPLANEGEOMETRY_H_HEADER_INCLUDED_C1C68A2C */
diff --git a/Modules/Core/include/mitkAnnotationProperty.h b/Modules/Core/include/mitkAnnotationProperty.h
index b8fcb0eb8a..f42bbf4151 100644
--- a/Modules/Core/include/mitkAnnotationProperty.h
+++ b/Modules/Core/include/mitkAnnotationProperty.h
@@ -1,77 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKANNOTATIONPROPERTY_H_HEADER_INCLUDED
#define MITKANNOTATIONPROPERTY_H_HEADER_INCLUDED
#include "mitkBaseProperty.h"
#include "mitkNumericTypes.h"
#include <MitkCoreExports.h>
#include <itkConfigure.h>
#include <string>
namespace mitk
{
/**
* \brief Property for annotations
* \ingroup DataManagement
*/
class MITKCORE_EXPORT AnnotationProperty : public BaseProperty
{
public:
mitkClassMacro(AnnotationProperty, BaseProperty);
typedef std::string ValueType;
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self)
mitkNewMacro2Param(AnnotationProperty, const char *, const Point3D &);
mitkNewMacro2Param(AnnotationProperty, const std::string &, const Point3D &);
mitkNewMacro4Param(AnnotationProperty, const char *, ScalarType, ScalarType, ScalarType);
mitkNewMacro4Param(AnnotationProperty, const std::string &, ScalarType, ScalarType, ScalarType);
itkGetStringMacro(Label);
itkSetStringMacro(Label);
const Point3D &GetPosition() const;
void SetPosition(const Point3D &position);
std::string GetValueAsString() const override;
virtual BaseProperty &operator=(const BaseProperty &other) { return Superclass::operator=(other); }
using BaseProperty::operator=;
protected:
std::string m_Label;
Point3D m_Position;
AnnotationProperty();
AnnotationProperty(const char *label, const Point3D &position);
AnnotationProperty(const std::string &label, const Point3D &position);
AnnotationProperty(const char *label, ScalarType x, ScalarType y, ScalarType z);
AnnotationProperty(const std::string &label, ScalarType x, ScalarType y, ScalarType z);
AnnotationProperty(const AnnotationProperty &other);
private:
// purposely not implemented
AnnotationProperty &operator=(const AnnotationProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
};
} // namespace mitk
#endif /* MITKANNOTATIONPROPERTY_H_HEADER_INCLUDED */
diff --git a/Modules/Core/include/mitkArbitraryTimeGeometry.h b/Modules/Core/include/mitkArbitraryTimeGeometry.h
index fd63631f6d..d86baa7636 100644
--- a/Modules/Core/include/mitkArbitraryTimeGeometry.h
+++ b/Modules/Core/include/mitkArbitraryTimeGeometry.h
@@ -1,244 +1,244 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef ArbitraryTimeGeometry_h
#define ArbitraryTimeGeometry_h
//MITK
#include <mitkTimeGeometry.h>
#include <mitkCommon.h>
#include <MitkCoreExports.h>
namespace mitk
{
/**
* \brief Organizes geometries over arbitrary defined time steps
*
* For this TimeGeometry implementation it is assumed that
* the durations of the time steps are arbitrary and may differ.
* The geometries of the time steps are independent,
* and not linked to each other. Since the timeBounds of the
* geometries are different for each time step it is not possible
* to set the same geometry to different time steps. Instead
* copies should be used.
* @remark The lower time bound of a succeeding time step may not be smaller
* than the upper time bound of its predecessor. Thus the list of time points is
* always sorted by its lower time bounds.
* @remark For the conversion between time step and time point the following assumption
* is used.:\n
* time step -> time point: time point is the lower time bound of the geometry indicated by step.\n
* time point -> time step: associated time step is last step which lower time bound is smaller or equal then the time
* point.
*
* \addtogroup geometry
*/
class MITKCORE_EXPORT ArbitraryTimeGeometry : public TimeGeometry
{
public:
mitkClassMacro(ArbitraryTimeGeometry, TimeGeometry);
ArbitraryTimeGeometry();
typedef ArbitraryTimeGeometry self;
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* \brief Returns the number of time steps.
*
* Returns the number of time steps for which
* geometries are saved. The number of time steps
* is also the upper bound of the time steps. The
* minimum time steps is always 0.
*/
TimeStepType CountTimeSteps() const override;
/**
* \brief Returns the first time point for which the time geometry instance is valid.
*
* Returns the first valid time point for this geometry. It is the lower time bound of
* the first step. The time point is given in ms.
*/
TimePointType GetMinimumTimePoint() const override;
/**
* \brief Returns the last time point for which the time geometry instance is valid
*
* Gives the last time point for which a valid geometry is saved in
* this time geometry. It is the upper time bound of the last step.
* The time point is given in ms.
*/
TimePointType GetMaximumTimePoint() const override;
/**
* \brief Returns the first time point for which the time geometry instance is valid.
*
* Returns the first valid time point for the given TimeStep. The time point
* is given in ms.
*/
TimePointType GetMinimumTimePoint(TimeStepType step) const override;
/**
* \brief Returns the last time point for which the time geometry instance is valid
*
* Gives the last time point for the Geometry specified by the given TimeStep. The time point is given in ms.
*/
TimePointType GetMaximumTimePoint(TimeStepType step) const override;
/**
* \brief Get the time bounds (in ms)
* it returns GetMinimumTimePoint() and GetMaximumTimePoint() results as bounds.
*/
TimeBounds GetTimeBounds() const override;
/**
* \brief Get the time bounds for the given TimeStep (in ms)
*/
TimeBounds GetTimeBounds(TimeStepType step) const override;
/**
* \brief Tests if a given time point is covered by this time geometry instance
*
* Returns true if a geometry can be returned for the given time
* point (so it is within GetTimeBounds() and fails if not.
* The time point must be given in ms.
*/
bool IsValidTimePoint(TimePointType timePoint) const override;
/**
* \brief Test for the given time step if a geometry is availible
*
* Returns true if a geometry is defined for the given time step.
* Otherwise false is returned.
* The time step is defined as positiv number.
*/
bool IsValidTimeStep(TimeStepType timeStep) const override;
/**
* \brief Converts a time step to a time point
*
* Converts a time step to a time point by using the time steps lower
* time bound.
* If the original time steps does not point to a valid geometry,
* a time point is calculated that also does not point to a valid
* geometry, but no exception is raised.
*/
TimePointType TimeStepToTimePoint(TimeStepType timeStep) const override;
/**
* \brief Converts a time point to the corresponding time step
*
* Converts a time point to a time step in a way that
* the new time step indicates the same geometry as the time point.
* The associated time step is the last step which lower time bound
* is smaller or equal then the time point.
* If a negative invalid time point is given always time step 0 is
* returned. If a positive invalid time point is given the last time
* step will be returned. This is also true for time points that are
* exactly on the upper time bound.
*/
TimeStepType TimePointToTimeStep(TimePointType timePoint) const override;
/**
* \brief Returns the geometry which corresponds to the given time step
*
* Returns a clone of the geometry which defines the given time step. If
* the given time step is invalid an null-pointer is returned.
*/
BaseGeometry::Pointer GetGeometryCloneForTimeStep(TimeStepType timeStep) const override;
/**
* \brief Returns the geometry which corresponds to the given time point
*
* Returns the geometry which defines the given time point. If
* the given time point is invalid an null-pointer is returned.
*
* If the returned geometry is changed this will affect the saved
* geometry.
*/
BaseGeometry::Pointer GetGeometryForTimePoint(TimePointType timePoint) const override;
/**
* \brief Returns the geometry which corresponds to the given time step
*
* Returns the geometry which defines the given time step. If
* the given time step is invalid an null-pointer is returned.
*
* If the returned geometry is changed this will affect the saved
* geometry.
*/
BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const override;
/**
* \brief Tests if all necessary informations are set and the object is valid
*/
bool IsValid() const override;
/**
* \brief Initializes a new object with one time steps which contains an empty geometry.
*/
void Initialize() override;
/**
* \brief Expands the time geometry to the given number of time steps.
*
* Initializes the new time steps with empty geometries. This default geometries will behave like
* ProportionalTimeGeometry.
* Shrinking is not supported. The new steps will have the same duration like the last step before extension.
*/
void Expand(TimeStepType size) override;
/**
* \brief Replaces the geometry instances with clones of the passed geometry.
*
* Replaces the geometries of all time steps with clones of the passed
* geometry. Replacement strategy depends on the implementation of TimeGeometry
* sub class.
* @remark The time points itself stays untouched. Use this method if you want
* to change the spatial properties of a TimeGeometry and preserve the time
* "grid".
*/
void ReplaceTimeStepGeometries(const BaseGeometry *geometry) override;
/**
* \brief Sets the geometry for the given time step
*
* If passed time step is not valid. Nothing will be changed.
* @pre geometry must point to a valid instance.
*/
void SetTimeStepGeometry(BaseGeometry *geometry, TimeStepType timeStep) override;
/**
* \brief Makes a deep copy of the current object
*/
itk::LightObject::Pointer InternalClone() const override;
void ClearAllGeometries();
/** Append the passed geometry to the time geometry.
* @pre The passed geometry pointer must be valid.
* @pre The minimumTimePoint must not be smaller than the maximum time point of the currently last time step.
* Therefore time steps must not be overlapping in time.
* @pre minimumTimePoint must not be larger then maximumTimePoint.*/
void AppendNewTimeStep(BaseGeometry *geometry, TimePointType minimumTimePoint, TimePointType maximumTimePoint);
/** Same than AppendNewTimeStep. But clones geometry before adding it.*/
void AppendNewTimeStepClone(const BaseGeometry* geometry,
TimePointType minimumTimePoint,
TimePointType maximumTimePoint );
void ReserveSpaceForGeometries( TimeStepType numberOfGeometries );
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
protected:
~ArbitraryTimeGeometry() override;
std::vector<BaseGeometry::Pointer> m_GeometryVector;
std::vector<TimePointType> m_MinimumTimePoints;
std::vector<TimePointType> m_MaximumTimePoints;
}; // end class ArbitraryTimeGeometry
} // end namespace MITK
#endif // ArbitraryTimeGeometry_h
diff --git a/Modules/Core/include/mitkBaseController.h b/Modules/Core/include/mitkBaseController.h
index 111a514b36..5c823d4847 100644
--- a/Modules/Core/include/mitkBaseController.h
+++ b/Modules/Core/include/mitkBaseController.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BASECONTROLLER_H_HEADER_INCLUDED_C1E745A3
#define BASECONTROLLER_H_HEADER_INCLUDED_C1E745A3
#include "mitkEventStateMachine.h"
#include "mitkOperationActor.h"
#include "mitkStepper.h"
#include <MitkCoreExports.h>
#include <itkObjectFactory.h>
namespace mitk
{
class BaseRenderer;
//##Documentation
//## @brief Baseclass for renderer slice-/camera-control
//##
//## Tells the render (subclass of BaseRenderer) which slice (subclass
//## SliceNavigationController) or from which direction (subclass
//## CameraController) it has to render. Contains two Stepper for stepping
//## through the slices or through different camera views (e.g., for the
//## creation of a movie around the data), respectively, and through time, if
//## there is 3D+t data.
//## @note not yet implemented
//## @ingroup NavigationControl
class MITKCORE_EXPORT BaseController : public mitk::OperationActor, public itk::Object
{
public:
/** Standard class typedefs. */
mitkClassMacroItkParent(BaseController, mitk::OperationActor);
- itkFactorylessNewMacro(Self)
+ itkFactorylessNewMacro(Self);
/** Method for creation through ::New */
// mitkNewMacro(Self);
//##Documentation
//## @brief Get the Stepper through the slices
mitk::Stepper *GetSlice();
//##Documentation
//## @brief Get the Stepper through the time
mitk::Stepper *GetTime();
protected:
/**
* @brief Default Constructor
**/
BaseController();
/**
* @brief Default Destructor
**/
~BaseController() override;
void ExecuteOperation(Operation *) override;
//## @brief Stepper through the time
Stepper::Pointer m_Time;
//## @brief Stepper through the slices
Stepper::Pointer m_Slice;
unsigned long m_LastUpdateTime;
};
} // namespace mitk
#endif /* BASECONTROLLER_H_HEADER_INCLUDED_C1E745A3 */
diff --git a/Modules/Core/include/mitkBaseData.h b/Modules/Core/include/mitkBaseData.h
index fa2c6534b1..21177dffe6 100644
--- a/Modules/Core/include/mitkBaseData.h
+++ b/Modules/Core/include/mitkBaseData.h
@@ -1,417 +1,417 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BASEDATA_H_HEADER_INCLUDED_C1EBB6FA
#define BASEDATA_H_HEADER_INCLUDED_C1EBB6FA
#include <itkDataObject.h>
#include "mitkBaseProcess.h"
#include "mitkIdentifiable.h"
#include "mitkIPropertyOwner.h"
#include "mitkOperationActor.h"
#include "mitkPropertyList.h"
#include "mitkTimeGeometry.h"
#include <MitkCoreExports.h>
namespace mitk
{
// class BaseProcess;
//##Documentation
//## @brief Base of all data objects
//##
//## Base of all data objects, e.g., images, contours, surfaces etc. Inherits
//## from itk::DataObject and thus can be included in a pipeline.
//## Inherits also from OperationActor and can be used as a destination for Undo
//## @ingroup Data
class MITKCORE_EXPORT BaseData
: public itk::DataObject, public OperationActor, public Identifiable, public IPropertyOwner
{
public:
- mitkClassMacroItkParent(BaseData, itk::DataObject)
+ mitkClassMacroItkParent(BaseData, itk::DataObject);
// IPropertyProvider
BaseProperty::ConstPointer GetConstProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = true) const override;
std::vector<std::string> GetPropertyKeys(const std::string &contextName = "", bool includeDefaultContext = false) const override;
std::vector<std::string> GetPropertyContextNames() const override;
// IPropertyOwner
BaseProperty * GetNonConstProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = true) override;
void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName = "", bool fallBackOnDefaultContext = false) override;
void RemoveProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = false) override;
/**
* \brief Return the TimeGeometry of the data as const pointer.
*
* \warning No update will be called. Use GetUpdatedGeometry() if you cannot
* be sure that the geometry is up-to-date.
*
* Normally used in GenerateOutputInformation of subclasses of BaseProcess.
*/
const mitk::TimeGeometry *GetTimeGeometry() const
{
return m_TimeGeometry.GetPointer();
}
/**
* \brief Return the TimeGeometry of the data as const pointer.
*
* \warning No update will be called. Use GetUpdatedGeometry() if you cannot
* be sure that the geometry is up-to-date.
*
* Normally used in GenerateOutputInformation of subclasses of BaseProcess.
* \deprecatedSince{2013_09} Please use GetTimeGeometry instead: For additional information see
* http://www.mitk.org/Development/Refactoring%20of%20the%20Geometry%20Classes%20-%20Part%201
*/
DEPRECATED(const mitk::TimeGeometry *GetTimeSlicedGeometry() const) { return GetTimeGeometry(); }
/**
* @brief Return the TimeGeometry of the data as pointer.
*
* \warning No update will be called. Use GetUpdatedGeometry() if you cannot
* be sure that the geometry is up-to-date.
*
* Normally used in GenerateOutputInformation of subclasses of BaseProcess.
*/
mitk::TimeGeometry *GetTimeGeometry() { return m_TimeGeometry.GetPointer(); }
/**
* @brief Return the TimeGeometry of the data.
*
* The method does not simply return the value of the m_TimeGeometry
* member. Before doing this, it makes sure that the TimeGeometry
* is up-to-date (by setting the update extent to largest possible and
* calling UpdateOutputInformation).
*/
const mitk::TimeGeometry *GetUpdatedTimeGeometry();
/**
* @brief Return the TimeGeometry of the data.
*
* The method does not simply return the value of the m_TimeGeometry
* member. Before doing this, it makes sure that the TimeGeometry
* is up-to-date (by setting the update extent to largest possible and
* calling UpdateOutputInformation).
* \deprecatedSince{2013_09} Please use GetUpdatedTimeGeometry instead: For additional information see
* http://www.mitk.org/Development/Refactoring%20of%20the%20Geometry%20Classes%20-%20Part%201
*/
DEPRECATED(const mitk::TimeGeometry *GetUpdatedTimeSliceGeometry()) { return GetUpdatedTimeGeometry(); }
/**
* \brief Expands the TimeGeometry to a number of TimeSteps.
*
* The method expands the TimeGeometry to the given number of TimeSteps,
* filling newly created elements with empty geometries. Sub-classes should override
* this method to handle the elongation of their data vectors, too.
* Note that a shrinking is neither possible nor intended.
*/
virtual void Expand(unsigned int timeSteps);
/**
* \brief Return the BaseGeometry of the data at time \a t.
*
* The method does not simply return
* m_TimeGeometry->GetGeometry(t).
* Before doing this, it makes sure that the BaseGeometry is up-to-date
* (by setting the update extent appropriately and calling
* UpdateOutputInformation).
*
* @todo Appropriate setting of the update extent is missing.
*/
const mitk::BaseGeometry *GetUpdatedGeometry(int t = 0);
//##Documentation
//## @brief Return the geometry, which is a TimeGeometry, of the data
//## as non-const pointer.
//##
//## \warning No update will be called. Use GetUpdatedGeometry() if you cannot
//## be sure that the geometry is up-to-date.
//##
//## Normally used in GenerateOutputInformation of subclasses of BaseProcess.
mitk::BaseGeometry *GetGeometry(int t = 0) const
{
if (m_TimeGeometry.IsNull())
return nullptr;
return m_TimeGeometry->GetGeometryForTimeStep(t);
}
//##Documentation
//## @brief Update the information for this BaseData (the geometry in particular)
//## so that it can be used as an output of a BaseProcess.
//##
//## This method is used in the pipeline mechanism to propagate information and
//## initialize the meta data associated with a BaseData. Any implementation
//## of this method in a derived class is assumed to call its source's
//## BaseProcess::UpdateOutputInformation() which determines modified
//## times, LargestPossibleRegions, and any extra meta data like spacing,
//## origin, etc. Default implementation simply call's it's source's
//## UpdateOutputInformation().
//## \note Implementations of this methods in derived classes must take care
//## that the geometry is updated by calling
//## GetTimeGeometry()->UpdateInformation()
//## \em after calling its source's BaseProcess::UpdateOutputInformation().
void UpdateOutputInformation() override;
//##Documentation
//## @brief Set the RequestedRegion to the LargestPossibleRegion.
//##
//## This forces a filter to produce all of the output in one execution
//## (i.e. not streaming) on the next call to Update().
void SetRequestedRegionToLargestPossibleRegion() override = 0;
//##Documentation
//## @brief Determine whether the RequestedRegion is outside of the BufferedRegion.
//##
//## This method returns true if the RequestedRegion
//## is outside the BufferedRegion (true if at least one pixel is
//## outside). This is used by the pipeline mechanism to determine
//## whether a filter needs to re-execute in order to satisfy the
//## current request. If the current RequestedRegion is already
//## inside the BufferedRegion from the previous execution (and the
//## current filter is up to date), then a given filter does not need
//## to re-execute
bool RequestedRegionIsOutsideOfTheBufferedRegion() override = 0;
//##Documentation
//## @brief Verify that the RequestedRegion is within the LargestPossibleRegion.
//##
//## If the RequestedRegion is not within the LargestPossibleRegion,
//## then the filter cannot possibly satisfy the request. This method
//## returns true if the request can be satisfied (even if it will be
//## necessary to process the entire LargestPossibleRegion) and
//## returns false otherwise. This method is used by
//## PropagateRequestedRegion(). PropagateRequestedRegion() throws a
//## InvalidRequestedRegionError exception if the requested region is
//## not within the LargestPossibleRegion.
bool VerifyRequestedRegion() override = 0;
//##Documentation
//## @brief Copy information from the specified data set.
//##
//## This method is part of the pipeline execution model. By default, a
//## BaseProcess will copy meta-data from the first input to all of its
//## outputs. See ProcessObject::GenerateOutputInformation(). Each
//## subclass of DataObject is responsible for being able to copy
//## whatever meta-data it needs from another DataObject.
//## The default implementation of this method copies the time sliced geometry
//## and the property list of an object. If a subclass overrides this
//## method, it should always call its superclass' version.
void CopyInformation(const itk::DataObject *data) override;
//##Documentation
//## @brief Check whether the data has been initialized, i.e.,
//## at least the Geometry and other header data has been set
//##
//## \warning Set to \a true by default for compatibility reasons.
//## Set m_Initialized=false in constructors of sub-classes that
//## support distinction between initialized and uninitialized state.
virtual bool IsInitialized() const;
//##Documentation
//## @brief Calls ClearData() and InitializeEmpty();
//## \warning Only use in subclasses that reimplemented these methods.
//## Just calling Clear from BaseData will reset an object to a not initialized,
//## invalid state.
virtual void Clear();
//##Documentation
//## @brief Check whether object contains data (at
//## a specified time), e.g., a set of points may be empty
//##
//## \warning Returns IsInitialized()==false by default for
//## compatibility reasons. Override in sub-classes that
//## support distinction between empty/non-empty state.
virtual bool IsEmptyTimeStep(unsigned int t) const;
//##Documentation
//## @brief Check whether object contains data (at
//## least at one point in time), e.g., a set of points
//## may be empty
//##
//## \warning Returns IsInitialized()==false by default for
//## compatibility reasons. Override in sub-classes that
//## support distinction between empty/non-empty state.
virtual bool IsEmpty() const;
//##Documentation
//## @brief Set the requested region from this data object to match the requested
//## region of the data object passed in as a parameter.
//##
//## This method is implemented in the concrete subclasses of BaseData.
void SetRequestedRegion(const itk::DataObject *data) override = 0;
//##Documentation
//##@brief overwrite if the Data can be called by an Interactor (StateMachine).
//##
//## Empty by default. Overwrite and implement all the necessary operations here
//## and get the necessary information from the parameter operation.
void ExecuteOperation(Operation *operation) override;
/**
* \brief Set the BaseGeometry of the data, which will be referenced (not copied!).
* Assumes the data object has only 1 time step ( is a 3D object ) and creates a
* new TimeGeometry which saves the given BaseGeometry. If an TimeGeometry has already
* been set for the object, it will be replaced after calling this function.
*
* @warning This method will normally be called internally by the sub-class of BaseData
* during initialization.
* \sa SetClonedGeometry
*/
virtual void SetGeometry(BaseGeometry *aGeometry3D);
/**
* \brief Set the TimeGeometry of the data, which will be referenced (not copied!).
*
* @warning This method will normally be called internally by the sub-class of BaseData
* during initialization.
* \sa SetClonedTimeGeometry
*/
virtual void SetTimeGeometry(TimeGeometry *geometry);
/**
* \brief Set a clone of the provided Geometry as Geometry of the data.
* Assumes the data object has only 1 time step ( is a 3D object ) and
* creates a new TimeGeometry. If an TimeGeometry has already
* been set for the object, it will be replaced after calling this function.
*
* \sa SetGeometry
*/
virtual void SetClonedGeometry(const BaseGeometry *aGeometry3D);
/**
* \brief Set a clone of the provided TimeGeometry as TimeGeometry of the data.
*
* \sa SetGeometry
*/
virtual void SetClonedTimeGeometry(const TimeGeometry *geometry);
//##Documentation
//## @brief Set a clone of the provided geometry as BaseGeometry of a given time step.
//##
//## \sa SetGeometry
virtual void SetClonedGeometry(const BaseGeometry *aGeometry3D, unsigned int time);
//##Documentation
//## @brief Get the data's property list
//## @sa GetProperty
//## @sa m_PropertyList
mitk::PropertyList::Pointer GetPropertyList() const;
//##Documentation
//## @brief Set the data's property list
//## @sa SetProperty
//## @sa m_PropertyList
void SetPropertyList(PropertyList *propertyList);
//##Documentation
//## @brief Get the property (instance of BaseProperty) with key @a propertyKey from the PropertyList,
//## and set it to this, respectively;
//## @sa GetPropertyList
//## @sa m_PropertyList
//## @sa m_MapOfPropertyLists
mitk::BaseProperty::Pointer GetProperty(const char *propertyKey) const;
void SetProperty(const char *propertyKey, BaseProperty *property);
//##Documentation
//## @brief Convenience method for setting the origin of
//## the BaseGeometry instances of all time steps
//##
//## \warning Geometries contained in the BaseGeometry will
//## \em not be changed, e.g. in case the BaseGeometry is a
//## SlicedGeometry3D the origin will \em not be propagated
//## to the contained slices. The sub-class SlicedData
//## does this for the case that the SlicedGeometry3D is
//## evenly spaced.
virtual void SetOrigin(const Point3D &origin);
/** \brief Get the process object that generated this data object.
*
* If there is no process object, then the data object has
* been disconnected from the pipeline, or the data object
* was created manually. (Note: we cannot use the GetObjectMacro()
* defined in itkMacro because the mutual dependency of
* DataObject and ProcessObject causes compile problems. Also,
* a forward reference smart pointer is returned, not a smart pointer,
* because of the circular dependency between the process and data object.)
*
* GetSource() returns a SmartPointer and not a WeakPointer
* because it is assumed the code calling GetSource() wants to hold a
* long term reference to the source. */
itk::SmartPointer<mitk::BaseDataSource> GetSource() const;
//##Documentation
//## @brief Get the number of time steps from the TimeGeometry
//## As the base data has not a data vector given by itself, the number
//## of time steps is defined over the time sliced geometry. In sub classes,
//## a better implementation could be over the length of the data vector.
unsigned int GetTimeSteps() const { return m_TimeGeometry->CountTimeSteps(); }
//##Documentation
//## @brief Get the modified time of the last change of the contents
//## this data object or its geometry.
unsigned long GetMTime() const override;
/**
* \sa itk::ProcessObject::Graft
*/
void Graft(const DataObject *) override;
protected:
BaseData();
BaseData(const BaseData &other);
~BaseData() override;
//##Documentation
//## \brief Initialize the TimeGeometry for a number of time steps.
//## The TimeGeometry is initialized empty and evenly timed.
//## In many cases it will be necessary to overwrite this in sub-classes.
virtual void InitializeTimeGeometry(unsigned int timeSteps = 1);
/**
* \brief Initialize the TimeGeometry for a number of time steps.
* The TimeGeometry is initialized empty and evenly timed.
* In many cases it will be necessary to overwrite this in sub-classes.
* \deprecatedSince{2013_09} Please use GetUpdatedTimeGeometry instead: For additional information see
* http://www.mitk.org/Development/Refactoring%20of%20the%20Geometry%20Classes%20-%20Part%201
*/
DEPRECATED(virtual void InitializeTimeSlicedGeometry(unsigned int timeSteps = 1))
{
InitializeTimeGeometry(timeSteps);
}
//##Documentation
//## @brief reset to non-initialized state, release memory
virtual void ClearData();
//##Documentation
//## @brief Pure virtual; Must be used in subclasses to get a data object to a
//## valid state. Should at least create one empty object and call
//## Superclass::InitializeTimeGeometry() to ensure an existing valid geometry
virtual void InitializeEmpty() {}
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
bool m_LastRequestedRegionWasOutsideOfTheBufferedRegion;
mutable unsigned int m_SourceOutputIndexDuplicate;
bool m_Initialized;
private:
//##Documentation
//## @brief PropertyList, f.e. to hold pic-tags, tracking-data,..
//##
PropertyList::Pointer m_PropertyList;
TimeGeometry::Pointer m_TimeGeometry;
};
} // namespace mitk
#endif /* BASEDATA_H_HEADER_INCLUDED_C1EBB6FA */
diff --git a/Modules/Core/include/mitkBaseDataSource.h b/Modules/Core/include/mitkBaseDataSource.h
index 1e8b6efbc7..3715224ce8 100644
--- a/Modules/Core/include/mitkBaseDataSource.h
+++ b/Modules/Core/include/mitkBaseDataSource.h
@@ -1,154 +1,154 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_BASE_DATA_SOURCE_H
#define MITK_BASE_DATA_SOURCE_H
#include <MitkCoreExports.h>
#include <itkProcessObject.h>
#include <mitkCommon.h>
#define mitkBaseDataSourceGetOutputDeclarations \
OutputType *GetOutput(); \
const OutputType *GetOutput() const; \
OutputType *GetOutput(DataObjectPointerArraySizeType idx); \
const OutputType *GetOutput(DataObjectPointerArraySizeType idx) const;
#define mitkBaseDataSourceGetOutputDefinitions(className) \
className::OutputType *className::GetOutput(void) \
{ \
return itkDynamicCastInDebugMode<OutputType *>(this->GetPrimaryOutput()); \
} \
const className::OutputType *className::GetOutput(void) const \
{ \
return itkDynamicCastInDebugMode<const OutputType *>(this->GetPrimaryOutput()); \
} \
className::OutputType *className::GetOutput(DataObjectPointerArraySizeType idx) \
{ \
OutputType *out = dynamic_cast<OutputType *>(this->ProcessObject::GetOutput(idx)); \
if (out == nullptr && this->ProcessObject::GetOutput(idx) != nullptr) \
{ \
itkWarningMacro(<< "Unable to convert output number " << idx << " to type " << typeid(OutputType).name()); \
} \
return out; \
} \
const className::OutputType *className::GetOutput(DataObjectPointerArraySizeType idx) const \
{ \
const OutputType *out = dynamic_cast<const OutputType *>(this->ProcessObject::GetOutput(idx)); \
if (out == nullptr && this->ProcessObject::GetOutput(idx) != nullptr) \
{ \
itkWarningMacro(<< "Unable to convert output number " << idx << " to type " << typeid(OutputType).name()); \
} \
return out; \
}
namespace mitk
{
class BaseData;
/**
* @brief Superclass of all classes generating some kind of mitk::BaseData.
*
* Superclass of all classes generating some kind of mitk::BaseData.
* In itk and vtk the generated result of a ProcessObject is only guaranteed
* to be up-to-date, when Update() of the ProcessObject or the generated
* DataObject is called immediately before access of the data stored in the
* DataObject. This is also true for subclasses of mitk::BaseProcess. But
* many of the subclasses of mitk::BaseProcess define additional access
* functions to the generated output that guarantee an up-to-date result, see
* for example mitk::ImageSource.
* @ingroup Process
*/
class MITKCORE_EXPORT BaseDataSource : public itk::ProcessObject
{
public:
- mitkClassMacroItkParent(BaseDataSource, itk::ProcessObject)
+ mitkClassMacroItkParent(BaseDataSource, itk::ProcessObject);
typedef BaseData OutputType;
typedef itk::DataObject::DataObjectIdentifierType DataObjectIdentifierType;
mitkBaseDataSourceGetOutputDeclarations
/** @brief Graft the specified BaseData onto this BaseDataSource's output.
*
* This method is used when a
* process object is implemented using a mini-pipeline which is
* defined in its GenerateData() method. The usage is:
*
* \code
* // setup the mini-pipeline to process the input to this filter
* firstFilterInMiniPipeline->SetInput( this->GetInput() );
* // setup the mini-pipeline to calculate the correct regions
* // and write to the appropriate bulk data block
* lastFilterInMiniPipeline->GraftOutput( this->GetOutput(0) );
*
* // execute the mini-pipeline
* lastFilterInMiniPipeline->Update();
*
* // graft the mini-pipeline output back onto this filter's output.
* // this is needed to get the appropriate regions passed back.
* this->GraftOutput( lastFilterInMiniPipeline->GetOutput(0) );
* \endcode
*/
virtual void
GraftOutput(OutputType *output);
/**
* Graft the specified base data object onto this BaseDataSource's named
* output. This is similar to the GraftOutput method except it
* allows you to specify which output is affected.
* See the GraftOutput for general usage information.
*/
virtual void GraftOutput(const DataObjectIdentifierType &key, OutputType *output);
/** @brief Graft the specified base data object onto this BaseDataSource's idx'th
* output.
*
* This is the similar to GraftOutput method except is
* allows you specify which output is affected. The specified index
* must be a valid output number (less than
* ProcessObject::GetNumberOfOutputs()). See the GraftOutput for
* general usage information.
*/
virtual void GraftNthOutput(unsigned int idx, OutputType *output);
/**
* @sa itk::ProcessObject::MakeOutput(DataObjectPointerArraySizeType)
*/
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override = 0;
/**
* @sa itk::ProcessObject::MakeOutput(const DataObjectIdentifierType&)
*/
DataObjectPointer MakeOutput(const DataObjectIdentifierType &name) override = 0;
/**
* @brief Access itk::ProcessObject::m_Updating
*
* m_Updating indicates when the pipeline is executing.
* It prevents infinite recursion when pipelines have loops.
* \sa itk::ProcessObject::m_Updating
**/
bool Updating() const;
protected:
BaseDataSource();
~BaseDataSource() override;
// purposely not implemented
static Pointer New();
};
} // namespace mitk
#endif /* MITK_BASE_DATA_SOURCE_H */
diff --git a/Modules/Core/include/mitkBaseDataTestImplementation.h b/Modules/Core/include/mitkBaseDataTestImplementation.h
index d22649a5db..4222e3140f 100644
--- a/Modules/Core/include/mitkBaseDataTestImplementation.h
+++ b/Modules/Core/include/mitkBaseDataTestImplementation.h
@@ -1,52 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BASEDATAIMPLEMENTATION_H_HEADER_INCLUDED
#define BASEDATAIMPLEMENTATION_H_HEADER_INCLUDED
#include "mitkBaseData.h"
namespace mitk
{
//##Documentation
//## @brief Implementation of BaseData (for testing)
//##
//## As BaseData is an abstract class, we need an implementation for testing its methods
//## @ingroup Data
class BaseDataTestImplementation : public BaseData
{
public:
mitkClassMacro(BaseDataTestImplementation, BaseData);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
void InitializeTimeGeometry(unsigned int timeSteps /* = 1 */) override
{
Superclass::InitializeTimeGeometry(timeSteps);
}
protected:
mitkCloneMacro(Self);
bool VerifyRequestedRegion() override { return false; };
bool RequestedRegionIsOutsideOfTheBufferedRegion() override { return false; };
void SetRequestedRegionToLargestPossibleRegion() override{};
void SetRequestedRegion(const itk::DataObject * /*data*/) override{};
BaseDataTestImplementation(){};
~BaseDataTestImplementation() override{};
};
} // namespace
#endif // BASEDATA_H_HEADER_INCLUDED
diff --git a/Modules/Core/include/mitkBaseGeometry.h b/Modules/Core/include/mitkBaseGeometry.h
index 59ce90af9b..7854b69e06 100644
--- a/Modules/Core/include/mitkBaseGeometry.h
+++ b/Modules/Core/include/mitkBaseGeometry.h
@@ -1,760 +1,761 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BaseGeometry_H_HEADER_INCLUDED
#define BaseGeometry_H_HEADER_INCLUDED
#include "mitkOperationActor.h"
#include <MitkCoreExports.h>
#include <mitkCommon.h>
#include "itkScalableAffineTransform.h"
#include "mitkNumericTypes.h"
#include <itkAffineGeometryFrame.h>
#include <itkBoundingBox.h>
#include <itkIndex.h>
#include <itkQuaternionRigidTransform.h>
#include <mitkAffineTransform3D.h>
#include <mitkGeometryTransformHolder.h>
#include <vtkTransform.h>
class vtkMatrix4x4;
class vtkMatrixToLinearTransform;
class vtkLinearTransform;
namespace mitk
{
//##Documentation
//## @brief Standard 3D-BoundingBox typedef
//##
//## Standard 3D-BoundingBox typedef to get rid of template arguments (3D, type).
typedef itk::BoundingBox<unsigned long, 3, ScalarType> BoundingBox;
//##Documentation
//## @brief Standard typedef for time-bounds
typedef itk::FixedArray<ScalarType, 2> TimeBounds;
typedef itk::FixedArray<ScalarType, 3> FixedArrayType;
typedef itk::AffineGeometryFrame<ScalarType, 3> AffineGeometryFrame3D;
//##Documentation
//## @brief BaseGeometry Describes the geometry of a data object
//##
//## The class holds
//## \li a bounding box which is axes-parallel in intrinsic coordinates
//## (often integer indices of pixels), to be accessed by
//## GetBoundingBox()
//## \li a transform to convert intrinsic coordinates into a
//## world-coordinate system with coordinates in millimeters
//## and milliseconds (all are floating point values), to
//## be accessed by GetIndexToWorldTransform()
//## \li an origin and spacing to define the geometry
//##
//## BaseGeometry and its sub-classes allow converting between
//## intrinsic coordinates (called index or unit coordinates)
//## and world-coordinates (called world or mm coordinates),
//## e.g. WorldToIndex.
//## In case you need integer index coordinates, provide an
//## mitk::Index3D (or itk::Index) as target variable to
//## WorldToIndex, otherwise you will get a continuous index
//## (floating point values).
//##
//## An important sub-class is SlicedGeometry3D, which descibes
//## data objects consisting of slices, e.g., objects of type Image.
//## Conversions between world coordinates (in mm) and unit coordinates
//## (e.g., pixels in the case of an Image) can be performed.
//##
//## For more information on related classes, see \ref Geometry.
//##
//## BaseGeometry instances referring to an Image need a slightly
//## different definition of corners, see SetImageGeometry. This
//## is usualy automatically called by Image.
//##
//## BaseGeometry have to be initialized in the method GenerateOutputInformation()
//## of BaseProcess (or CopyInformation/ UpdateOutputInformation of BaseData,
//## if possible, e.g., by analyzing pic tags in Image) subclasses. See also
//## itk::ProcessObject::GenerateOutputInformation(),
//## itk::DataObject::CopyInformation() and
//## itk::DataObject::UpdateOutputInformation().
//##
//## At least, it can return the bounding box of the data object.
//##
//## The BaseGeometry class is an abstract class. The most simple implementation
//## is the sublass Geometry3D.
//##
//## Rule: everything is in mm (ms) if not stated otherwise.
//## @ingroup Geometry
class MITKCORE_EXPORT BaseGeometry : public itk::Object, public OperationActor
{
public:
mitkClassMacroItkParent(BaseGeometry, itk::Object);
- itkCloneMacro(Self)
+ itkCloneMacro(Self);
// ********************************** TypeDef **********************************
typedef GeometryTransformHolder::TransformType TransformType;
typedef itk::BoundingBox<unsigned long, 3, ScalarType> BoundingBoxType;
typedef BoundingBoxType::BoundsArrayType BoundsArrayType;
typedef BoundingBoxType::Pointer BoundingBoxPointer;
// ********************************** Origin, Spacing **********************************
//##Documentation
//## @brief Get the origin, e.g. the upper-left corner of the plane
const Point3D GetOrigin() const;
//##Documentation
//## @brief Set the origin, i.e. the upper-left corner of the plane
//##
void SetOrigin(const Point3D &origin);
//##Documentation
//## @brief Get the spacing (size of a pixel).
//##
const mitk::Vector3D GetSpacing() const;
//##Documentation
//## @brief Set the spacing (m_Spacing).
//##
//##The spacing is also changed in the IndexToWorldTransform.
void SetSpacing(const mitk::Vector3D &aSpacing, bool enforceSetSpacing = false);
//##Documentation
//## @brief Get the origin as VnlVector
//##
//## \sa GetOrigin
VnlVector GetOriginVnl() const;
// ********************************** other functions **********************************
//##Documentation
//## @brief Get the DICOM FrameOfReferenceID referring to the
//## used world coordinate system
itkGetConstMacro(FrameOfReferenceID, unsigned int);
//##Documentation
//## @brief Set the DICOM FrameOfReferenceID referring to the
//## used world coordinate system
itkSetMacro(FrameOfReferenceID, unsigned int);
itkGetConstMacro(IndexToWorldTransformLastModified, unsigned long);
//##Documentation
//## @brief Overload of function Modified() to prohibit several calls of Modified() using the ModifiedLock class.
//##
//## For the use of Modified(), see class ModifiedLock.
void Modified() const override;
friend class ModifiedLock;
//##Documentation
//## @brief Is this BaseGeometry in a state that is valid?
//##
//## This function returns always true in the BaseGeometry class. Other implementations are possible in subclasses.
virtual bool IsValid() const;
// ********************************** Initialize **********************************
//##Documentation
//## @brief Initialize the BaseGeometry
void Initialize();
void InitializeGeometry(Self *newGeometry) const;
// ********************************** Transformations Set/Get **********************************
//##Documentation
//## @brief Get the transformation used to convert from index
//## to world coordinates
mitk::AffineTransform3D *GetIndexToWorldTransform();
//##Documentation
//## @brief Get the transformation used to convert from index
//## to world coordinates
const mitk::AffineTransform3D *GetIndexToWorldTransform() const;
//## @brief Set the transformation used to convert from index
//## to world coordinates. The spacing of the new transform is
//## copied to m_spacing.
void SetIndexToWorldTransform(mitk::AffineTransform3D *transform);
//##Documentation
//## @brief Convenience method for setting the ITK transform
//## (m_IndexToWorldTransform) via an vtkMatrix4x4.The spacing of
//## the new transform is copied to m_spacing.
//## \sa SetIndexToWorldTransform
void SetIndexToWorldTransformByVtkMatrix(vtkMatrix4x4 *vtkmatrix);
//## @brief Set the transformation used to convert from index
//## to world coordinates.This function keeps the original spacing.
void SetIndexToWorldTransformWithoutChangingSpacing(mitk::AffineTransform3D *transform);
//##Documentation
//## @brief Convenience method for setting the ITK transform
//## (m_IndexToWorldTransform) via an vtkMatrix4x4. This function keeps the original spacing.
//## \sa SetIndexToWorldTransform
void SetIndexToWorldTransformByVtkMatrixWithoutChangingSpacing(vtkMatrix4x4 *vtkmatrix);
//## Get the Vtk Matrix which describes the transform.
vtkMatrix4x4 *GetVtkMatrix();
//##Documentation
//## @brief Get the m_IndexToWorldTransform as a vtkLinearTransform
vtkLinearTransform *GetVtkTransform() const;
//##Documentation
//## @brief Set the transform to identity, the spacing to 1 and origin to 0
//##
void SetIdentity();
// ********************************** Transformations **********************************
//##Documentation
//## @brief Compose new IndexToWorldTransform with a given transform.
//##
//## This method composes m_IndexToWorldTransform with another transform,
//## modifying self to be the composition of self and other.
//## If the argument pre is true, then other is precomposed with self;
//## that is, the resulting transformation consists of first applying
//## other to the source, followed by self. If pre is false or omitted,
//## then other is post-composed with self; that is the resulting
//## transformation consists of first applying self to the source,
//## followed by other.
//## This method also changes m_spacing.
void Compose(const TransformType *other, bool pre = false);
//##Documentation
//## @brief Compose new IndexToWorldTransform with a given vtkMatrix4x4.
//##
//## Converts the vtkMatrix4x4 into a itk-transform and calls the previous method.
void Compose(const vtkMatrix4x4 *vtkmatrix, bool pre = false);
//##Documentation
//## @brief Translate the origin by a vector
//##
void Translate(const Vector3D &vector);
//##Documentation
//##@brief executes affine operations (translate, rotate, scale)
void ExecuteOperation(Operation *operation) override;
//##Documentation
//## @brief Convert world coordinates (in mm) of a \em point to (continuous!) index coordinates
//## \warning If you need (discrete) integer index coordinates (e.g., for iterating easily over an image),
//## use WorldToIndex(const mitk::Point3D& pt_mm, itk::Index<VIndexDimension> &index).
//## For further information about coordinates types, please see the Geometry documentation
void WorldToIndex(const mitk::Point3D &pt_mm, mitk::Point3D &pt_units) const;
//##Documentation
//## @brief Convert world coordinates (in mm) of a \em vector
//## \a vec_mm to (continuous!) index coordinates.
//## For further information about coordinates types, please see the Geometry documentation
void WorldToIndex(const mitk::Vector3D &vec_mm, mitk::Vector3D &vec_units) const;
//##Documentation
//## @brief Convert world coordinates (in mm) of a \em point to (discrete!) index coordinates.
//## This method rounds to integer indices!
//## For further information about coordinates types, please see the Geometry documentation
template <unsigned int VIndexDimension>
void WorldToIndex(const mitk::Point3D &pt_mm, itk::Index<VIndexDimension> &index) const
{
typedef itk::Index<VIndexDimension> IndexType;
mitk::Point3D pt_units;
this->WorldToIndex(pt_mm, pt_units);
int i, dim = index.GetIndexDimension();
if (dim > 3)
{
index.Fill(0);
dim = 3;
}
for (i = 0; i < dim; ++i)
{
index[i] = itk::Math::RoundHalfIntegerUp<typename IndexType::IndexValueType>(pt_units[i]);
}
}
//##Documentation
//## @brief Convert (continuous or discrete) index coordinates of a \em vector
//## \a vec_units to world coordinates (in mm)
//## For further information about coordinates types, please see the Geometry documentation
void IndexToWorld(const mitk::Vector3D &vec_units, mitk::Vector3D &vec_mm) const;
//##Documentation
//## @brief Convert (continuous or discrete) index coordinates of a \em point to world coordinates (in mm)
//## For further information about coordinates types, please see the Geometry documentation
void IndexToWorld(const mitk::Point3D &pt_units, mitk::Point3D &pt_mm) const;
//##Documentation
//## @brief Convert (discrete) index coordinates of a \em point to world coordinates (in mm)
//## For further information about coordinates types, please see the Geometry documentation
template <unsigned int VIndexDimension>
void IndexToWorld(const itk::Index<VIndexDimension> &index, mitk::Point3D &pt_mm) const
{
mitk::Point3D pt_units;
pt_units.Fill(0);
int i, dim = index.GetIndexDimension();
if (dim > 3)
{
dim = 3;
}
for (i = 0; i < dim; ++i)
{
pt_units[i] = index[i];
}
IndexToWorld(pt_units, pt_mm);
}
//##Documentation
//## @brief Convert (continuous or discrete) index coordinates of a \em vector
//## \a vec_units to world coordinates (in mm)
//## @deprecated First parameter (Point3D) is not used. If possible, please use void IndexToWorld(const
// mitk::Vector3D& vec_units, mitk::Vector3D& vec_mm) const.
//## For further information about coordinates types, please see the Geometry documentation
void IndexToWorld(const mitk::Point3D &atPt3d_units, const mitk::Vector3D &vec_units, mitk::Vector3D &vec_mm) const;
//##Documentation
//## @brief Convert world coordinates (in mm) of a \em vector
//## \a vec_mm to (continuous!) index coordinates.
//## @deprecated First parameter (Point3D) is not used. If possible, please use void WorldToIndex(const
// mitk::Vector3D& vec_mm, mitk::Vector3D& vec_units) const.
//## For further information about coordinates types, please see the Geometry documentation
void WorldToIndex(const mitk::Point3D &atPt3d_mm, const mitk::Vector3D &vec_mm, mitk::Vector3D &vec_units) const;
//##Documentation
//## @brief Deprecated for use with ITK version 3.10 or newer.
//## Convert ITK physical coordinates of a \em point (in mm,
//## but without a rotation) into MITK world coordinates (in mm)
//##
//## For more information, see WorldToItkPhysicalPoint.
template <class TCoordRep>
void ItkPhysicalPointToWorld(const itk::Point<TCoordRep, 3> &itkPhysicalPoint, mitk::Point3D &pt_mm) const
{
mitk::vtk2itk(itkPhysicalPoint, pt_mm);
}
//##Documentation
//## @brief Deprecated for use with ITK version 3.10 or newer.
//## Convert world coordinates (in mm) of a \em point to
//## ITK physical coordinates (in mm, but without a possible rotation)
//##
//## This method is useful if you have want to access an mitk::Image
//## via an itk::Image. ITK v3.8 and older did not support rotated (tilted)
//## images, i.e., ITK images are always parallel to the coordinate axes.
//## When accessing a (possibly rotated) mitk::Image via an itk::Image
//## the rotational part of the transformation in the BaseGeometry is
//## simply discarded; in other word: only the origin and spacing is
//## used by ITK, not the complete matrix available in MITK.
//## With WorldToItkPhysicalPoint you can convert an MITK world
//## coordinate (including the rotation) into a coordinate that
//## can be used with the ITK image as a ITK physical coordinate
//## (excluding the rotation).
template <class TCoordRep>
void WorldToItkPhysicalPoint(const mitk::Point3D &pt_mm, itk::Point<TCoordRep, 3> &itkPhysicalPoint) const
{
mitk::vtk2itk(pt_mm, itkPhysicalPoint);
}
// ********************************** BoundingBox **********************************
/** Get the bounding box */
itkGetConstObjectMacro(BoundingBox, BoundingBoxType);
// a bit of a misuse, but we want only doxygen to see the following:
#ifdef DOXYGEN_SKIP
//##Documentation
//## @brief Get bounding box (in index/unit coordinates)
itkGetConstObjectMacro(BoundingBox, BoundingBoxType);
//##Documentation
//## @brief Get bounding box (in index/unit coordinates) as a BoundsArrayType
const BoundsArrayType GetBounds() const;
#endif
const BoundsArrayType GetBounds() const;
//##Documentation
//## \brief Set the bounding box (in index/unit coordinates)
//##
//## Only possible via the BoundsArray to make clear that a
//## copy of the bounding-box is stored, not a reference to it.
void SetBounds(const BoundsArrayType &bounds);
//##Documentation
//## @brief Set the bounding box (in index/unit coordinates) via a float array
void SetFloatBounds(const float bounds[6]);
//##Documentation
//## @brief Set the bounding box (in index/unit coordinates) via a double array
void SetFloatBounds(const double bounds[6]);
//##Documentation
//## @brief Get a VnlVector along bounding-box in the specified
//## @a direction, length is spacing
//##
//## \sa GetAxisVector
VnlVector GetMatrixColumn(unsigned int direction) const;
//##Documentation
//## @brief Calculates a bounding-box around the geometry relative
//## to a coordinate system defined by a transform
//##
mitk::BoundingBox::Pointer CalculateBoundingBoxRelativeToTransform(const mitk::AffineTransform3D *transform) const;
//##Documentation
//## @brief Set the time bounds (in ms)
// void SetTimeBounds(const TimeBounds& timebounds);
// ********************************** Geometry **********************************
#ifdef DOXYGEN_SKIP
//##Documentation
//## @brief Get the extent of the bounding box (in index/unit coordinates)
//##
//## To access the extent in mm use GetExtentInMM
ScalarType GetExtent(unsigned int direction) const;
#endif
/** Get the extent of the bounding box */
ScalarType GetExtent(unsigned int direction) const;
//##Documentation
//## @brief Get the extent of the bounding-box in the specified @a direction in mm
//##
//## Equals length of GetAxisVector(direction).
ScalarType GetExtentInMM(int direction) const;
//##Documentation
//## @brief Get vector along bounding-box in the specified @a direction in mm
//##
//## The length of the vector is the size of the bounding-box in the
//## specified @a direction in mm
//## \sa GetMatrixColumn
Vector3D GetAxisVector(unsigned int direction) const;
//##Documentation
//## @brief Checks, if the given geometry can be converted to 2D without information loss
//## e.g. when a 2D image is saved, the matrix is usually cropped to 2x2, and when you load it back to MITK
//## it will be filled with standard values. This function checks, if information would be lost during this
//## procedure
virtual bool Is2DConvertable();
//##Documentation
//## @brief Get the center of the bounding-box in mm
//##
Point3D GetCenter() const;
//##Documentation
//## @brief Get the squared length of the diagonal of the bounding-box in mm
//##
double GetDiagonalLength2() const;
//##Documentation
//## @brief Get the length of the diagonal of the bounding-box in mm
//##
double GetDiagonalLength() const;
//##Documentation
//## @brief Get the position of the corner number \a id (in world coordinates)
//##
//## See SetImageGeometry for how a corner is defined on images.
Point3D GetCornerPoint(int id) const;
//##Documentation
//## @brief Get the position of a corner (in world coordinates)
//##
//## See SetImageGeometry for how a corner is defined on images.
Point3D GetCornerPoint(bool xFront = true, bool yFront = true, bool zFront = true) const;
//##Documentation
//## @brief Set the extent of the bounding-box in the specified @a direction in mm
//##
//## @note This changes the matrix in the transform, @a not the bounds, which are given in units!
void SetExtentInMM(int direction, ScalarType extentInMM);
//##Documentation
//## @brief Test whether the point \a p (world coordinates in mm) is
//## inside the bounding box
bool IsInside(const mitk::Point3D &p) const;
//##Documentation
//## @brief Test whether the point \a p ((continous!)index coordinates in units) is
//## inside the bounding box
bool IsIndexInside(const mitk::Point3D &index) const;
//##Documentation
//## @brief Convenience method for working with ITK indices
template <unsigned int VIndexDimension>
bool IsIndexInside(const itk::Index<VIndexDimension> &index) const
{
int i, dim = index.GetIndexDimension();
Point3D pt_index;
pt_index.Fill(0);
for (i = 0; i < dim; ++i)
{
pt_index[i] = index[i];
}
return IsIndexInside(pt_index);
}
// ********************************* Image Geometry ********************************
//##Documentation
//## @brief When switching from an Image Geometry to a normal Geometry (and the other way around), you have to
//change
// the origin as well (See Geometry Documentation)! This function will change the "isImageGeometry" bool flag and
// changes the origin respectively.
virtual void ChangeImageGeometryConsideringOriginOffset(const bool isAnImageGeometry);
//##Documentation
//## @brief Is this an ImageGeometry?
//##
//## For more information, see SetImageGeometry
itkGetConstMacro(ImageGeometry, bool)
//##Documentation
//## @brief Define that this BaseGeometry is refering to an Image
//##
//## A geometry referring to an Image needs a slightly different
//## definition of the position of the corners (see GetCornerPoint).
//## The position of a voxel is defined by the position of its center.
//## If we would use the origin (position of the (center of) the first
//## voxel) as a corner and display this point, it would seem to be
//## \em not at the corner but a bit within the image. Even worse for
//## the opposite corner of the image: here the corner would appear
//## outside the image (by half of the voxel diameter). Thus, we have
//## to correct for this and to be able to do that, we need to know
//## that the BaseGeometry is referring to an Image.
- itkSetMacro(ImageGeometry, bool) itkBooleanMacro(ImageGeometry)
+ itkSetMacro(ImageGeometry, bool);
+ itkBooleanMacro(ImageGeometry);
const GeometryTransformHolder *GetGeometryTransformHolder() const;
protected:
// ********************************** Constructor **********************************
BaseGeometry();
BaseGeometry(const BaseGeometry &other);
~BaseGeometry() override;
//##Documentation
//## @brief clones the geometry
//##
//## Overwrite in all sub-classes.
//## Normally looks like:
//## \code
//## Self::Pointer newGeometry = new Self(*this);
//## newGeometry->UnRegister();
//## return newGeometry.GetPointer();
//## \endcode
itk::LightObject::Pointer InternalClone() const override = 0;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
static const std::string GetTransformAsString(TransformType *transformType);
- itkGetConstMacro(NDimensions, unsigned int)
+ itkGetConstMacro(NDimensions, unsigned int);
bool IsBoundingBoxNull() const;
bool IsIndexToWorldTransformNull() const;
void SetVtkMatrixDeepCopy(vtkTransform *vtktransform);
void _SetSpacing(const mitk::Vector3D &aSpacing, bool enforceSetSpacing = false);
//##Documentation
//## @brief PreSetSpacing
//##
//## These virtual function allows a different beahiour in subclasses.
//## Do implement them in every subclass of BaseGeometry. If not needed, use
//## {Superclass::PreSetSpacing();};
virtual void PreSetSpacing(const mitk::Vector3D & /*aSpacing*/){};
//##Documentation
//## @brief CheckBounds
//##
//## This function is called in SetBounds. Assertions can be implemented in this function (see PlaneGeometry.cpp).
//## If you implement this function in a subclass, make sure, that all classes were your class inherits from
//## have an implementation of CheckBounds
//## (e.g. inheritance BaseGeometry <- A <- B. Implementation of CheckBounds in class B needs implementation in A as
// well!)
virtual void CheckBounds(const BoundsArrayType & /*bounds*/){};
//##Documentation
//## @brief CheckIndexToWorldTransform
//##
//## This function is called in SetIndexToWorldTransform. Assertions can be implemented in this function (see
// PlaneGeometry.cpp).
//## In Subclasses of BaseGeometry, implement own conditions or call Superclass::CheckBounds(bounds);.
virtual void CheckIndexToWorldTransform(mitk::AffineTransform3D * /*transform*/){};
private:
GeometryTransformHolder *m_GeometryTransform;
void InitializeGeometryTransformHolder(const BaseGeometry *otherGeometry);
//##Documentation
//## @brief Bounding Box, which is axes-parallel in intrinsic coordinates
//## (often integer indices of pixels)
BoundingBoxPointer m_BoundingBox;
unsigned int m_FrameOfReferenceID;
// mitk::TimeBounds m_TimeBounds;
static const unsigned int m_NDimensions = 3;
mutable TransformType::Pointer m_InvertedTransform;
mutable unsigned long m_IndexToWorldTransformLastModified;
bool m_ImageGeometry;
//##Documentation
//## @brief ModifiedLockFlag is used to prohibit the call of Modified()
//##
//## For the use of this Flag, see class ModifiedLock. This flag should only be set
//## by the ModifiedLock class!
bool m_ModifiedLockFlag;
//##Documentation
//## @brief ModifiedcalledFlag is used to collect calls of Modified().
//##
//## For the use of this Flag, see class ModifiedLock. This flag should only be set
//## by the Modified() function!
mutable bool m_ModifiedCalledFlag;
};
// ********************************** Equal Functions **********************************
//
// Static compare functions mainly for testing
//
/**
* @brief Equal A function comparing two geometries for beeing identical.
* @warning This method is deprecated and will not be available in the future. Use the \a bool mitk::Equal(const
* mitk::mitk::BaseGeometry& g1, const mitk::BaseGeometry& g2) instead.
*
* @ingroup MITKTestingAPI
*
* The function compares the spacing, origin, axisvectors, extents, the matrix of the
* IndexToWorldTransform (elementwise), the bounding (elementwise) and the ImageGeometry flag.
*
* The parameter eps is a tolarence value for all methods which are internally used for comparion.
* If you want to use different tolarance values for different parts of the geometry, feel free to use
* the other comparison methods and write your own implementation of Equal.
* @param rightHandSide Compare this against leftHandSide.
* @param leftHandSide Compare this against rightHandSide.
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return True, if all comparison are true. False in any other case.
*/
DEPRECATED(MITKCORE_EXPORT bool Equal(
const mitk::BaseGeometry *leftHandSide, const mitk::BaseGeometry *rightHandSide, ScalarType eps, bool verbose));
/**
* @brief Equal A function comparing two geometries for beeing identical.
*
* @ingroup MITKTestingAPI
*
* The function compares the spacing, origin, axisvectors, extents, the matrix of the
* IndexToWorldTransform (elementwise), the bounding (elementwise) and the ImageGeometry flag.
*
* The parameter eps is a tolarence value for all methods which are internally used for comparion.
* If you want to use different tolarance values for different parts of the geometry, feel free to use
* the other comparison methods and write your own implementation of Equal.
* @param rightHandSide Compare this against leftHandSide.
* @param leftHandSide Compare this against rightHandSide.
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return True, if all comparison are true. False in any other case.
*/
MITKCORE_EXPORT bool Equal(const mitk::BaseGeometry &leftHandSide,
const mitk::BaseGeometry &rightHandSide,
ScalarType eps,
bool verbose);
/**
* @brief Equal A function comparing two transforms (TransformType) for beeing identical.
* @warning This method is deprecated and will not be available in the future. Use the \a bool mitk::Equal(const
* mitk::mitk::BaseGeometry::TransformType& t1, const mitk::BaseGeometry::TransformType& t2) instead.
*
* @ingroup MITKTestingAPI
*
* The function compares the IndexToWorldTransform (elementwise).
*
* The parameter eps is a tolarence value for all methods which are internally used for comparion.
* @param rightHandSide Compare this against leftHandSide.
* @param leftHandSide Compare this against rightHandSide.
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return True, if all comparison are true. False in any other case.
*/
DEPRECATED(MITKCORE_EXPORT bool Equal(const mitk::BaseGeometry::TransformType *leftHandSide,
const mitk::BaseGeometry::TransformType *rightHandSide,
ScalarType eps,
bool verbose));
/**
* @brief Equal A function comparing two transforms (TransformType) for beeing identical.
*
* @ingroup MITKTestingAPI
*
* The function compares the IndexToWorldTransform (elementwise).
*
* The parameter eps is a tolarence value for all methods which are internally used for comparion.
* @param rightHandSide Compare this against leftHandSide.
* @param leftHandSide Compare this against rightHandSide.
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return True, if all comparison are true. False in any other case.
*/
MITKCORE_EXPORT bool Equal(const mitk::BaseGeometry::TransformType &leftHandSide,
const mitk::BaseGeometry::TransformType &rightHandSide,
ScalarType eps,
bool verbose);
/**
* @brief Equal A function comparing two bounding boxes (BoundingBoxType) for beeing identical.
* @warning This method is deprecated and will not be available in the future. Use the \a bool mitk::Equal(const
* mitk::mitk::BaseGeometry::BoundingBoxType& b1, const mitk::BaseGeometry::BoundingBoxType& b2) instead.
*
* @ingroup MITKTestingAPI
*
* The function compares the bounds (elementwise).
*
* The parameter eps is a tolarence value for all methods which are internally used for comparion.
* @param rightHandSide Compare this against leftHandSide.
* @param leftHandSide Compare this against rightHandSide.
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return True, if all comparison are true. False in any other case.
*/
DEPRECATED(MITKCORE_EXPORT bool Equal(const mitk::BaseGeometry::BoundingBoxType *leftHandSide,
const mitk::BaseGeometry::BoundingBoxType *rightHandSide,
ScalarType eps,
bool verbose));
/**
* @brief Equal A function comparing two bounding boxes (BoundingBoxType) for beeing identical.
*
* @ingroup MITKTestingAPI
*
* The function compares the bounds (elementwise).
*
* The parameter eps is a tolarence value for all methods which are internally used for comparion.
* @param rightHandSide Compare this against leftHandSide.
* @param leftHandSide Compare this against rightHandSide.
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return True, if all comparison are true. False in any other case.
*/
MITKCORE_EXPORT bool Equal(const mitk::BaseGeometry::BoundingBoxType &leftHandSide,
const mitk::BaseGeometry::BoundingBoxType &rightHandSide,
ScalarType eps,
bool verbose);
} // namespace mitk
#endif /* BaseGeometry_H_HEADER_INCLUDED */
diff --git a/Modules/Core/include/mitkBaseProperty.h b/Modules/Core/include/mitkBaseProperty.h
index 34a69994f7..fcad73663b 100644
--- a/Modules/Core/include/mitkBaseProperty.h
+++ b/Modules/Core/include/mitkBaseProperty.h
@@ -1,97 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BASEPROPERTY_H_HEADER_INCLUDED_C1F4DF54
#define BASEPROPERTY_H_HEADER_INCLUDED_C1F4DF54
#include <MitkCoreExports.h>
#include <itkObjectFactory.h>
#include <mitkCommon.h>
#include <string>
namespace mitk
{
/*! \brief Abstract base class for properties
\ingroup DataManagement
Base class for properties. Properties are arbitrary additional information
(to define a new type of information you have to define a subclass of
BaseProperty) that can be added to a PropertyList.
Concrete subclasses of BaseProperty should define Set-/Get-methods to assess
the property value, which should be stored by value (not by reference).
Subclasses must implement an operator==(const BaseProperty& property), which
is used by PropertyList to check whether a property has been changed.
*/
class MITKCORE_EXPORT BaseProperty : public itk::Object
{
public:
- mitkClassMacroItkParent(BaseProperty, itk::Object) itkCloneMacro(Self)
+ mitkClassMacroItkParent(BaseProperty, itk::Object);
+ itkCloneMacro(Self);
/*! @brief Subclasses must implement IsEqual(const BaseProperty&) to support comparison.
operator== which is used by PropertyList to check whether a property has been changed.
*/
bool
operator==(const BaseProperty &property) const;
/*! @brief Assigns property to this BaseProperty instance.
Subclasses must implement Assign(const BaseProperty&) and call the superclass
Assign method for proper handling of polymorphic assignments. The assignment
operator of the subclass should be disabled and the baseclass operator should
be made visible using "using" statements.
*/
BaseProperty &operator=(const BaseProperty &property);
/*! @brief Assigns property to this BaseProperty instance.
This method is identical to the assignment operator, except for the return type.
It allows to directly check if the assignemnt was successfull.
*/
bool AssignProperty(const BaseProperty &property);
virtual std::string GetValueAsString() const;
/**
* @brief Default return value if a property which can not be returned as string
*/
static const std::string VALUE_CANNOT_BE_CONVERTED_TO_STRING;
protected:
BaseProperty();
BaseProperty(const BaseProperty &other);
~BaseProperty() override;
private:
/*!
Override this method in subclasses to implement a meaningful comparison. The property
argument is guaranteed to be castable to the type of the implementing subclass.
*/
virtual bool IsEqual(const BaseProperty &property) const = 0;
/*!
Override this method in subclasses to implement a meaningful assignment. The property
argument is guaranteed to be castable to the type of the implementing subclass.
@warning This is not yet exception aware/safe and if this method returns false,
this property's state might be undefined.
@return True if the argument could be assigned to this property.
*/
virtual bool Assign(const BaseProperty &) = 0;
};
} // namespace mitk
#endif /* BASEPROPERTY_H_HEADER_INCLUDED_C1F4DF54 */
diff --git a/Modules/Core/include/mitkBaseRenderer.h b/Modules/Core/include/mitkBaseRenderer.h
index 60e88027d0..322bc8577d 100644
--- a/Modules/Core/include/mitkBaseRenderer.h
+++ b/Modules/Core/include/mitkBaseRenderer.h
@@ -1,532 +1,532 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BASERENDERER_H_HEADER_INCLUDED_C1CCA0F4
#define BASERENDERER_H_HEADER_INCLUDED_C1CCA0F4
#include "mitkCameraRotationController.h"
#include "mitkDataStorage.h"
#include "mitkPlaneGeometry.h"
#include "mitkPlaneGeometryData.h"
#include "mitkSliceNavigationController.h"
#include "mitkTimeGeometry.h"
#include "mitkBindDispatcherInteractor.h"
#include "mitkDispatcher.h"
#include <vtkRenderWindow.h>
#include <vtkRenderer.h>
#include <map>
#include <set>
// DEPRECATED
#include <mitkTimeSlicedGeometry.h>
namespace mitk
{
class NavigationController;
class SliceNavigationController;
class CameraRotationController;
class CameraController;
class DataStorage;
class Mapper;
class BaseLocalStorageHandler;
class KeyEvent;
//##Documentation
//## @brief Organizes the rendering process
//##
//## Organizes the rendering process. A Renderer contains a reference to a
//## DataStorage and asks the mappers of the data objects to render
//## the data into the renderwindow it is associated to.
//##
//## \#Render() checks if rendering is currently allowed by calling
//## RenderWindow::PrepareRendering(). Initialization of a rendering context
//## can also be performed in this method.
//##
//## The actual rendering code has been moved to \#Repaint()
//## Both \#Repaint() and \#Update() are declared protected now.
//##
//## Note: Separation of the Repaint and Update processes (rendering vs
//## creating a vtk prop tree) still needs to be worked on. The whole
//## rendering process also should be reworked to use VTK based classes for
//## both 2D and 3D rendering.
//## @ingroup Renderer
class MITKCORE_EXPORT BaseRenderer : public itk::Object
{
public:
typedef std::map<vtkRenderWindow *, BaseRenderer *> BaseRendererMapType;
static BaseRendererMapType baseRendererMap;
static BaseRenderer *GetInstance(vtkRenderWindow *renWin);
static void AddInstance(vtkRenderWindow *renWin, BaseRenderer *baseRenderer);
static void RemoveInstance(vtkRenderWindow *renWin);
static BaseRenderer *GetByName(const std::string &name);
static vtkRenderWindow *GetRenderWindowByName(const std::string &name);
#pragma GCC visibility push(default)
itkEventMacro(RendererResetEvent, itk::AnyEvent);
#pragma GCC visibility pop
/** Standard class typedefs. */
mitkClassMacroItkParent(BaseRenderer, itk::Object);
BaseRenderer(const char *name = nullptr, vtkRenderWindow *renWin = nullptr);
//##Documentation
//## @brief MapperSlotId defines which kind of mapper (e.g. 2D or 3D) should be used.
typedef int MapperSlotId;
enum StandardMapperSlot
{
Standard2D = 1,
Standard3D = 2
};
//##Documentation
//## @brief Possible view directions for render windows.
enum class ViewDirection
{
AXIAL = 0,
SAGITTAL,
CORONAL,
THREE_D
};
virtual void SetDataStorage(DataStorage *storage); ///< set the datastorage that will be used for rendering
//##Documentation
//## return the DataStorage that is used for rendering
virtual DataStorage::Pointer GetDataStorage() const { return m_DataStorage.GetPointer(); }
//##Documentation
//## @brief Access the RenderWindow into which this renderer renders.
vtkRenderWindow *GetRenderWindow() const { return m_RenderWindow; }
vtkRenderer *GetVtkRenderer() const { return m_VtkRenderer; }
//##Documentation
//## @brief Returns the Dispatcher which handles Events for this BaseRenderer
Dispatcher::Pointer GetDispatcher() const;
//##Documentation
//## @brief Default mapper id to use.
static const MapperSlotId defaultMapper;
//##Documentation
//## @brief Do the rendering and flush the result.
virtual void Paint();
//##Documentation
//## @brief Initialize the RenderWindow. Should only be called from RenderWindow.
virtual void Initialize();
//##Documentation
//## @brief Called to inform the renderer that the RenderWindow has been resized.
virtual void Resize(int w, int h);
//##Documentation
//## @brief Initialize the renderer with a RenderWindow (@a renderwindow).
virtual void InitRenderer(vtkRenderWindow *renderwindow);
//##Documentation
//## @brief Set the initial size. Called by RenderWindow after it has become
//## visible for the first time.
virtual void InitSize(int w, int h);
//##Documentation
//## @brief Draws a point on the widget.
//## Should be used during conferences to show the position of the remote mouse
virtual void DrawOverlayMouse(Point2D &p2d);
//##Documentation
//## @brief Set/Get the WorldGeometry (m_WorldGeometry) for 3D and 2D rendering, that describing the
//## (maximal) area to be rendered.
//##
//## Depending of the type of the passed BaseGeometry more or less information can be extracted:
//## \li if it is a PlaneGeometry (which is a sub-class of BaseGeometry), m_CurrentWorldPlaneGeometry is
//## also set to point to it. m_WorldTimeGeometry is set to nullptr.
//## \li if it is a TimeGeometry, m_WorldTimeGeometry is also set to point to it.
//## If m_WorldTimeGeometry contains instances of SlicedGeometry3D, m_CurrentWorldPlaneGeometry is set to
//## one of geometries stored in the SlicedGeometry3D according to the value of m_Slice; otherwise
//## a PlaneGeometry describing the top of the bounding-box of the BaseGeometry is set as the
//## m_CurrentWorldPlaneGeometry.
//## \li otherwise a PlaneGeometry describing the top of the bounding-box of the BaseGeometry
//## is set as the m_CurrentWorldPlaneGeometry. m_WorldTimeGeometry is set to nullptr.
//## @todo add calculation of PlaneGeometry describing the top of the bounding-box of the BaseGeometry
//## when the passed BaseGeometry is not sliced.
//## \sa m_WorldGeometry
//## \sa m_WorldTimeGeometry
//## \sa m_CurrentWorldPlaneGeometry
virtual void SetWorldGeometry3D(const BaseGeometry *geometry);
virtual void SetWorldTimeGeometry(const mitk::TimeGeometry *geometry);
/**
* \deprecatedSince{2013_09} Please use TimeGeometry instead of TimeSlicedGeometry. For more information see
* http://www.mitk.org/Development/Refactoring%20of%20the%20Geometry%20Classes%20-%20Part%201
*/
DEPRECATED(void SetWorldGeometry3D(TimeSlicedGeometry *geometry));
- itkGetConstObjectMacro(WorldTimeGeometry, TimeGeometry)
+ itkGetConstObjectMacro(WorldTimeGeometry, TimeGeometry);
//##Documentation
//## @brief Get the current 3D-worldgeometry (m_CurrentWorldGeometry) used for 3D-rendering
- itkGetConstObjectMacro(CurrentWorldGeometry, BaseGeometry)
+ itkGetConstObjectMacro(CurrentWorldGeometry, BaseGeometry);
//##Documentation
//## @brief Get the current 2D-worldgeometry (m_CurrentWorldPlaneGeometry) used for 2D-rendering
itkGetConstObjectMacro(CurrentWorldPlaneGeometry, PlaneGeometry)
/**
* \deprecatedSince{2014_10} Please use GetCurrentWorldPlaneGeometry
*/
DEPRECATED(const PlaneGeometry *GetCurrentWorldGeometry2D())
{
return GetCurrentWorldPlaneGeometry();
};
//##Documentation
//## Calculates the bounds of the DataStorage (if it contains any valid data),
//## creates a geometry from these bounds and sets it as world geometry of the renderer.
//##
//## Call this method to re-initialize the renderer to the current DataStorage
//## (e.g. after loading an additional dataset), to ensure that the view is
//## aligned correctly.
//## \warn This is not implemented yet.
virtual bool SetWorldGeometryToDataStorageBounds() { return false; }
//##Documentation
//## @brief Set/Get m_Slice which defines together with m_TimeStep the 2D geometry
//## stored in m_WorldTimeGeometry used as m_CurrentWorldPlaneGeometry
//##
//## \sa m_Slice
virtual void SetSlice(unsigned int slice);
- itkGetConstMacro(Slice, unsigned int)
+ itkGetConstMacro(Slice, unsigned int);
//##Documentation
//## @brief Set/Get m_TimeStep which defines together with m_Slice the 2D geometry
//## stored in m_WorldTimeGeometry used as m_CurrentWorldPlaneGeometry
//##
//## \sa m_TimeStep
virtual void SetTimeStep(unsigned int timeStep);
- itkGetConstMacro(TimeStep, unsigned int)
+ itkGetConstMacro(TimeStep, unsigned int);
//##Documentation
//## @brief Get the time-step of a BaseData object which
//## exists at the time of the currently displayed content
//##
//## Returns -1 or mitk::BaseData::m_TimeSteps if there
//## is no data at the current time.
//## \sa GetTimeStep, m_TimeStep
int GetTimeStep(const BaseData *data) const;
//##Documentation
//## @brief Get the time in ms of the currently displayed content
//##
//## \sa GetTimeStep, m_TimeStep
ScalarType GetTime() const;
//##Documentation
//## @brief SetWorldGeometry is called according to the geometrySliceEvent,
//## which is supposed to be a SliceNavigationController::GeometrySendEvent
virtual void SetGeometry(const itk::EventObject &geometrySliceEvent);
//##Documentation
//## @brief UpdateWorldGeometry is called to re-read the 2D geometry from the
//## slice navigation controller
virtual void UpdateGeometry(const itk::EventObject &geometrySliceEvent);
//##Documentation
//## @brief SetSlice is called according to the geometrySliceEvent,
//## which is supposed to be a SliceNavigationController::GeometrySliceEvent
virtual void SetGeometrySlice(const itk::EventObject &geometrySliceEvent);
//##Documentation
//## @brief SetTimeStep is called according to the geometrySliceEvent,
//## which is supposed to be a SliceNavigationController::GeometryTimeEvent
virtual void SetGeometryTime(const itk::EventObject &geometryTimeEvent);
//##Documentation
//## @brief Get a DataNode pointing to a data object containing the current 2D-worldgeometry
// m_CurrentWorldPlaneGeometry (for 2D rendering)
itkGetObjectMacro(CurrentWorldPlaneGeometryNode, DataNode)
/**
* \deprecatedSince{2014_10} Please use GetCurrentWorldPlaneGeometryNode
*/
DEPRECATED(DataNode *GetCurrentWorldGeometry2DNode())
{
return GetCurrentWorldPlaneGeometryNode();
};
//##Documentation
//## @brief Sets timestamp of CurrentWorldPlaneGeometry and forces so reslicing in that renderwindow
void SendUpdateSlice();
//##Documentation
//## @brief Get timestamp of last call of SetCurrentWorldPlaneGeometry
unsigned long GetCurrentWorldPlaneGeometryUpdateTime() { return m_CurrentWorldPlaneGeometryUpdateTime; }
/**
* \deprecatedSince{2014_10} Please use GetCurrentWorldPlaneGeometryUpdateTime
*/
DEPRECATED(unsigned long GetCurrentWorldGeometry2DUpdateTime())
{
return GetCurrentWorldPlaneGeometryUpdateTime();
};
//##Documentation
//## @brief Get timestamp of last change of current TimeStep
unsigned long GetTimeStepUpdateTime() { return m_TimeStepUpdateTime; }
//##Documentation
//## @brief Perform a picking: find the x,y,z world coordinate of a
//## display x,y coordinate.
//## @warning Has to be overwritten in subclasses for the 3D-case.
//##
//## Implemented here only for 2D-rendering
virtual void PickWorldPoint(const Point2D &diplayPosition, Point3D &worldPosition) const = 0;
/** \brief Determines the object (mitk::DataNode) closest to the current
* position by means of picking
*
* \warning Implementation currently empty for 2D rendering; intended to be
* implemented for 3D renderers */
virtual DataNode *PickObject(const Point2D & /*displayPosition*/, Point3D & /*worldPosition*/) const
{
return nullptr;
}
//##Documentation
//## @brief Get the MapperSlotId to use.
- itkGetMacro(MapperID, MapperSlotId) itkGetConstMacro(MapperID, MapperSlotId)
+ itkGetMacro(MapperID, MapperSlotId);
+ itkGetConstMacro(MapperID, MapperSlotId);
//##Documentation
//## @brief Set the MapperSlotId to use.
- itkSetMacro(MapperID, MapperSlotId)
+ itkSetMacro(MapperID, MapperSlotId);
virtual int *GetSize() const;
virtual int *GetViewportSize() const;
void SetSliceNavigationController(SliceNavigationController *SlicenavigationController);
- itkGetObjectMacro(CameraController, CameraController)
- itkGetObjectMacro(SliceNavigationController, SliceNavigationController)
- itkGetObjectMacro(CameraRotationController, CameraRotationController)
-
- itkGetMacro(EmptyWorldGeometry, bool)
+ itkGetObjectMacro(CameraController, CameraController);
+ itkGetObjectMacro(SliceNavigationController, SliceNavigationController);
+ itkGetObjectMacro(CameraRotationController, CameraRotationController);
+ itkGetMacro(EmptyWorldGeometry, bool);
//##Documentation
//## @brief Tells if the displayed region is shifted and rescaled if the render window is resized.
itkGetMacro(KeepDisplayedRegion, bool)
//##Documentation
//## @brief Tells if the displayed region should be shifted and rescaled if the render window is resized.
- itkSetMacro(KeepDisplayedRegion, bool)
+ itkSetMacro(KeepDisplayedRegion, bool);
//##Documentation
//## @brief get the name of the Renderer
//## @note
const char *GetName() const
{
return m_Name.c_str();
}
//##Documentation
//## @brief get the x_size of the RendererWindow
//## @note
int GetSizeX() const { return GetSize()[0]; }
//##Documentation
//## @brief get the y_size of the RendererWindow
//## @note
int GetSizeY() const { return GetSize()[1]; }
const double *GetBounds() const;
void RequestUpdate();
void ForceImmediateUpdate();
/** Returns number of mappers which are visible and have level-of-detail
* rendering enabled */
unsigned int GetNumberOfVisibleLODEnabledMappers() const;
//##Documentation
//## @brief This method converts a display point to the 3D world index
//## using the geometry of the renderWindow.
void DisplayToWorld(const Point2D &displayPoint, Point3D &worldIndex) const;
//##Documentation
//## @brief This method converts a display point to the 2D world index, mapped onto the display plane
//## using the geometry of the renderWindow.
void DisplayToPlane(const Point2D &displayPoint, Point2D &planePointInMM) const;
//##Documentation
//## @brief This method converts a 3D world index to the display point
//## using the geometry of the renderWindow.
void WorldToDisplay(const Point3D &worldIndex, Point2D &displayPoint) const;
//##Documentation
//## @brief This method converts a 3D world index to the point on the viewport
//## using the geometry of the renderWindow.
void WorldToView(const Point3D &worldIndex, Point2D &viewPoint) const;
//##Documentation
//## @brief This method converts a 2D plane coordinate to the display point
//## using the geometry of the renderWindow.
void PlaneToDisplay(const Point2D &planePointInMM, Point2D &displayPoint) const;
//##Documentation
//## @brief This method converts a 2D plane coordinate to the point on the viewport
//## using the geometry of the renderWindow.
void PlaneToView(const Point2D &planePointInMM, Point2D &viewPoint) const;
double GetScaleFactorMMPerDisplayUnit() const;
Point2D GetDisplaySizeInMM() const;
Point2D GetViewportSizeInMM() const;
Point2D GetOriginInMM() const;
itkGetConstMacro(ConstrainZoomingAndPanning, bool) virtual void SetConstrainZoomingAndPanning(bool constrain);
/**
* \brief Provides (1) world coordinates for a given mouse position and (2)
* translates mousePosition to Display coordinates
* \deprecated Map2DRendererPositionTo3DWorldPosition is deprecated. Please use DisplayToWorld instead.
*/
DEPRECATED(virtual Point3D Map2DRendererPositionTo3DWorldPosition(const Point2D &mousePosition) const);
protected:
~BaseRenderer() override;
//##Documentation
//## @brief Call update of all mappers. To be implemented in subclasses.
virtual void Update() = 0;
vtkRenderWindow *m_RenderWindow;
vtkRenderer *m_VtkRenderer;
//##Documentation
//## @brief MapperSlotId to use. Defines which kind of mapper (e.g., 2D or 3D) shoud be used.
MapperSlotId m_MapperID;
//##Documentation
//## @brief The DataStorage that is used for rendering.
DataStorage::Pointer m_DataStorage;
//##Documentation
//## @brief Timestamp of last call of Update().
unsigned long m_LastUpdateTime;
//##Documentation
//## @brief CameraController for 3D rendering
//## @note preliminary.
itk::SmartPointer<CameraController> m_CameraController;
SliceNavigationController::Pointer m_SliceNavigationController;
CameraRotationController::Pointer m_CameraRotationController;
//##Documentation
//## @brief Sets m_CurrentWorldPlaneGeometry
virtual void SetCurrentWorldPlaneGeometry(const PlaneGeometry *geometry2d);
/**
* \deprecatedSince{2014_10} Please use SetCurrentWorldPlaneGeometry
*/
DEPRECATED(void SetCurrentWorldGeometry2D(PlaneGeometry *geometry2d)) { SetCurrentWorldPlaneGeometry(geometry2d); };
//##Documentation
//## @brief Sets m_CurrentWorldGeometry
virtual void SetCurrentWorldGeometry(const BaseGeometry *geometry);
private:
//##Documentation
//## m_WorldTimeGeometry is set by SetWorldGeometry if the passed BaseGeometry is a
//## TimeGeometry (or a sub-class of it). If it contains instances of SlicedGeometry3D,
//## m_Slice and m_TimeStep (set via SetSlice and SetTimeStep, respectively) define
//## which 2D geometry stored in m_WorldTimeGeometry (if available)
//## is used as m_CurrentWorldPlaneGeometry.
//## \sa m_CurrentWorldPlaneGeometry
TimeGeometry::ConstPointer m_WorldTimeGeometry;
//##Documentation
//## Pointer to the current 3D-worldgeometry.
BaseGeometry::ConstPointer m_CurrentWorldGeometry;
//##Documentation
//## Pointer to the current 2D-worldgeometry. The 2D-worldgeometry
//## describes the maximal area (2D manifold) to be rendered in case we
//## are doing 2D-rendering.
//## It is const, since we are not allowed to change it (it may be taken
//## directly from the geometry of an image-slice and thus it would be
//## very strange when suddenly the image-slice changes its geometry).
PlaneGeometry::Pointer m_CurrentWorldPlaneGeometry;
//##Documentation
//## Defines together with m_Slice which 2D geometry stored in m_WorldTimeGeometry
//## is used as m_CurrentWorldPlaneGeometry: m_WorldTimeGeometry->GetPlaneGeometry(m_Slice, m_TimeStep).
//## \sa m_WorldTimeGeometry
unsigned int m_Slice;
//##Documentation
//## Defines together with m_TimeStep which 2D geometry stored in m_WorldTimeGeometry
//## is used as m_CurrentWorldPlaneGeometry: m_WorldTimeGeometry->GetPlaneGeometry(m_Slice, m_TimeStep).
//## \sa m_WorldTimeGeometry
unsigned int m_TimeStep;
//##Documentation
//## @brief timestamp of last call of SetWorldGeometry
itk::TimeStamp m_CurrentWorldPlaneGeometryUpdateTime;
//##Documentation
//## @brief timestamp of last change of the current time step
itk::TimeStamp m_TimeStepUpdateTime;
//##Documentation
//## @brief Helper class which establishes connection between Interactors and Dispatcher via a common DataStorage.
BindDispatcherInteractor *m_BindDispatcherInteractor;
//##Documentation
//## @brief Tells if the displayed region should be shifted or rescaled if the render window is resized.
bool m_KeepDisplayedRegion;
protected:
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
//##Documentation
//## Data object containing the m_CurrentWorldPlaneGeometry defined above.
PlaneGeometryData::Pointer m_CurrentWorldPlaneGeometryData;
//##Documentation
//## DataNode objects containing the m_CurrentWorldPlaneGeometryData defined above.
DataNode::Pointer m_CurrentWorldPlaneGeometryNode;
//##Documentation
//## @brief test only
unsigned long m_CurrentWorldPlaneGeometryTransformTime;
std::string m_Name;
double m_Bounds[6];
bool m_EmptyWorldGeometry;
typedef std::set<Mapper *> LODEnabledMappersType;
/** Number of mappers which are visible and have level-of-detail
* rendering enabled */
unsigned int m_NumberOfVisibleLODEnabledMappers;
// Local Storage Handling for mappers
protected:
std::list<mitk::BaseLocalStorageHandler *> m_RegisteredLocalStorageHandlers;
bool m_ConstrainZoomingAndPanning;
public:
void RemoveAllLocalStorages();
void RegisterLocalStorageHandler(mitk::BaseLocalStorageHandler *lsh);
void UnregisterLocalStorageHandler(mitk::BaseLocalStorageHandler *lsh);
};
} // namespace mitk
#endif /* BASERENDERER_H_HEADER_INCLUDED_C1CCA0F4 */
diff --git a/Modules/Core/include/mitkCameraRotationController.h b/Modules/Core/include/mitkCameraRotationController.h
index 7906c4b5d3..f1b8a19290 100644
--- a/Modules/Core/include/mitkCameraRotationController.h
+++ b/Modules/Core/include/mitkCameraRotationController.h
@@ -1,46 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef CAMERAROTATIONCONTROLLER_H_HEADER_INCLUDED_NXYCBIU
#define CAMERAROTATIONCONTROLLER_H_HEADER_INCLUDED_NXYCBIU
#include "mitkBaseController.h"
#include <MitkCoreExports.h>
class vtkCamera;
class vtkRenderWindow;
namespace mitk
{
class MITKCORE_EXPORT CameraRotationController : public BaseController
{
public:
mitkClassMacro(CameraRotationController, BaseController);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self)
// mitkNewMacro1Param(Self, const char *);
void RotateCamera();
void AcquireCamera();
void SetRenderWindow(vtkRenderWindow *renWin) { m_RenderWindow = renWin; }
protected:
CameraRotationController();
~CameraRotationController() override;
private:
int m_LastStepperValue;
vtkCamera *m_Camera;
vtkRenderWindow *m_RenderWindow;
};
}
#endif
diff --git a/Modules/Core/include/mitkClippingProperty.h b/Modules/Core/include/mitkClippingProperty.h
index 563bf84584..81b2dd3ebb 100644
--- a/Modules/Core/include/mitkClippingProperty.h
+++ b/Modules/Core/include/mitkClippingProperty.h
@@ -1,85 +1,87 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKCLIPPINGPROPERTY_H_HEADER_INCLUDED
#define MITKCLIPPINGPROPERTY_H_HEADER_INCLUDED
#include "mitkBaseProperty.h"
#include "mitkNumericTypes.h"
#include <MitkCoreExports.h>
#include <itkConfigure.h>
#include <string>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* \brief Property for clipping datasets; currently only
* clipping planes are possible
* \ingroup DataManagement
*/
class MITKCORE_EXPORT ClippingProperty : public BaseProperty
{
public:
mitkClassMacro(ClippingProperty, BaseProperty);
typedef std::string ValueType;
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self)
mitkNewMacro2Param(ClippingProperty, const Point3D &, const Vector3D &);
bool GetClippingEnabled() const;
void SetClippingEnabled(bool enabled);
const Point3D &GetOrigin() const;
void SetOrigin(const Point3D &origin);
const Vector3D &GetNormal() const;
void SetNormal(const Vector3D &normal);
std::string GetValueAsString() const override;
using BaseProperty::operator=;
protected:
bool m_ClippingEnabled;
Point3D m_Origin;
Vector3D m_Normal;
ClippingProperty();
ClippingProperty(const ClippingProperty &other);
ClippingProperty(const Point3D &origin, const Vector3D &normal);
private:
// purposely not implemented
ClippingProperty &operator=(const ClippingProperty &);
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
#endif /* MITKCLIPPINGPROPERTY_H_HEADER_INCLUDED */
diff --git a/Modules/Core/include/mitkColorProperty.h b/Modules/Core/include/mitkColorProperty.h
index c25ce0ef15..2de38d55e9 100644
--- a/Modules/Core/include/mitkColorProperty.h
+++ b/Modules/Core/include/mitkColorProperty.h
@@ -1,96 +1,96 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKCOLORPROPERTY_H_HEADER_INCLUDED_C17953D1
#define MITKCOLORPROPERTY_H_HEADER_INCLUDED_C17953D1
#include "mitkBaseProperty.h"
#include <MitkCoreExports.h>
#include <itkRGBPixel.h>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* @brief Color Standard RGB color typedef (float)
*
* Standard RGB color typedef to get rid of template argument (float).
* Color range is from 0.0f to 1.0f for each component.
*
* @ingroup Property
*/
typedef itk::RGBPixel<float> Color;
/**
* @brief The ColorProperty class RGB color property
* @ingroup DataManagement
*
* @note If you want to apply the mitk::ColorProperty to an mitk::Image
* make sure to set the mitk::RenderingModeProperty to a mode which
* supports color (e.g. LEVELWINDOW_COLOR). For an example how to use
* the mitk::ColorProperty see mitkImageVtkMapper2DColorTest.cpp in
* Core\Code\Rendering.
*/
class MITKCORE_EXPORT ColorProperty : public BaseProperty
{
protected:
mitk::Color m_Color;
ColorProperty();
ColorProperty(const ColorProperty &other);
ColorProperty(const float red, const float green, const float blue);
ColorProperty(const float color[3]);
ColorProperty(const mitk::Color &color);
public:
- mitkClassMacro(ColorProperty, BaseProperty)
-
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) mitkNewMacro1Param(ColorProperty, const float *);
+ mitkClassMacro(ColorProperty, BaseProperty);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self) mitkNewMacro1Param(ColorProperty, const float *);
mitkNewMacro1Param(ColorProperty, const mitk::Color &);
mitkNewMacro3Param(ColorProperty, const float, const float, const float);
typedef mitk::Color ValueType;
const mitk::Color &GetColor() const;
const mitk::Color &GetValue() const;
std::string GetValueAsString() const override;
void SetColor(const mitk::Color &color);
void SetValue(const mitk::Color &color);
void SetColor(float red, float green, float blue);
using BaseProperty::operator=;
private:
// purposely not implemented
ColorProperty &operator=(const ColorProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
#endif /* MITKCOLORPROPERTY_H_HEADER_INCLUDED_C17953D1 */
diff --git a/Modules/Core/include/mitkCommon.h b/Modules/Core/include/mitkCommon.h
index 1670f75c07..be1abe9faa 100644
--- a/Modules/Core/include/mitkCommon.h
+++ b/Modules/Core/include/mitkCommon.h
@@ -1,200 +1,200 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_COMMON_H_DEFINED
#define MITK_COMMON_H_DEFINED
#ifdef _MSC_VER
// This warns about truncation to 255 characters in debug/browse info
#pragma warning(disable : 4786)
#pragma warning(disable : 4068) /* disable unknown pragma warnings */
#endif
// add only those headers here that are really necessary for all classes!
#include "itkObject.h"
#include "mitkConfig.h"
#include "mitkExceptionMacro.h"
#include "mitkGetClassHierarchy.h"
#include "mitkLogMacros.h"
#ifndef MITK_UNMANGLE_IPPIC
#define mitkIpPicDescriptor mitkIpPicDescriptor
#endif
typedef unsigned int MapperSlotId;
/** From ITK 4.7 version, the TypeMacro overrides (by using the explicit attribute) the GetNameOfClass
* hence the SuperClass must provide one.
*
* If not, use the mitkClassMacroNoParent version
*/
#define mitkClassMacro(className, SuperClassName) \
typedef className Self; \
typedef SuperClassName Superclass; \
typedef itk::SmartPointer<Self> Pointer; \
typedef itk::SmartPointer<const Self> ConstPointer; \
static const char *GetStaticNameOfClass() { return #className; } \
virtual std::vector<std::string> GetClassHierarchy() const override { return mitk::GetClassHierarchy<Self>(); } \
- itkTypeMacro(className, SuperClassName)
+ itkTypeMacro(className, SuperClassName);
#define mitkClassMacroItkParent(className, SuperClassName) \
typedef className Self; \
typedef SuperClassName Superclass; \
typedef itk::SmartPointer<Self> Pointer; \
typedef itk::SmartPointer<const Self> ConstPointer; \
static const char *GetStaticNameOfClass() { return #className; } \
virtual std::vector<std::string> GetClassHierarchy() const { return mitk::GetClassHierarchy<Self>(); } \
- itkTypeMacro(className, SuperClassName)
+ itkTypeMacro(className, SuperClassName);
/** At version 4.7 provides two type macros, the normal one expects the Superclass to provide the
* GetNameOfClass explicitely, the NoParent deos not expect anything.
*/
#define mitkClassMacroNoParent(className) \
typedef className Self; \
typedef itk::SmartPointer<Self> Pointer; \
typedef itk::SmartPointer<const Self> ConstPointer; \
static const char *GetStaticNameOfClass() { return #className; } \
virtual std::vector<std::string> GetClassHierarchy() const { return mitk::GetClassHierarchy<Self>(); } \
itkTypeMacroNoParent(className)
/**
* Macro for Constructors with one parameter for classes derived from itk::Lightobject
**/
#define mitkNewMacro1Param(classname, type) \
\
static Pointer New(type _arg) \
\
{ \
Pointer smartPtr = new classname(_arg); \
smartPtr->UnRegister(); \
return smartPtr; \
}
/**
* Macro for Constructors with two parameters for classes derived from itk::Lightobject
**/
#define mitkNewMacro2Param(classname, typea, typeb) \
\
static Pointer New(typea _arga, typeb _argb) \
\
{ \
Pointer smartPtr = new classname(_arga, _argb); \
smartPtr->UnRegister(); \
return smartPtr; \
}
/**
* Macro for Constructors with three parameters for classes derived from itk::Lightobject
**/
#define mitkNewMacro3Param(classname, typea, typeb, typec) \
\
static Pointer New(typea _arga, typeb _argb, typec _argc) \
\
{ \
Pointer smartPtr = new classname(_arga, _argb, _argc); \
smartPtr->UnRegister(); \
return smartPtr; \
}
/**
* Macro for Constructors with four parameters for classes derived from itk::Lightobject
**/
#define mitkNewMacro4Param(classname, typea, typeb, typec, typed) \
\
static Pointer New(typea _arga, typeb _argb, typec _argc, typed _argd) \
\
{ \
Pointer smartPtr = new classname(_arga, _argb, _argc, _argd); \
smartPtr->UnRegister(); \
return smartPtr; \
}
/**
* Macro for Constructors with five parameters for classes derived from itk::Lightobject
**/
#define mitkNewMacro5Param(classname, typea, typeb, typec, typed, typee) \
\
static Pointer New(typea _arga, typeb _argb, typec _argc, typed _argd, typee _arge) \
\
{ \
Pointer smartPtr = new classname(_arga, _argb, _argc, _argd, _arge); \
smartPtr->UnRegister(); \
return smartPtr; \
}
/**
* Macro for Constructors with six parameters for classes derived from itk::Lightobject
**/
#define mitkNewMacro6Param(classname, typea, typeb, typec, typed, typee, typef) \
\
static Pointer New(typea _arga, typeb _argb, typec _argc, typed _argd, typee _arge, typef _argf) \
\
{ \
Pointer smartPtr = new classname(_arga, _argb, _argc, _argd, _arge, _argf); \
smartPtr->UnRegister(); \
return smartPtr; \
}
/** Get a smart const pointer to an object. Creates the member
* Get"name"() (e.g., GetPoints()). */
#define mitkGetObjectMacroConst(name, type) \
virtual type *Get##name() const \
{ \
itkDebugMacro("returning " #name " address " << this->m_##name); \
return this->m_##name.GetPointer(); \
}
/** Creates a Clone() method for "Classname". Returns a smartPtr of a clone of the
calling object*/
#define mitkCloneMacro(classname) \
virtual itk::LightObject::Pointer InternalClone() const override \
\
{ \
Pointer smartPtr = new classname(*this); \
smartPtr->UnRegister(); \
return smartPtr.GetPointer(); \
}
/** cross-platform deprecation macro
\todo maybe there is something in external toolkits (ITK, VTK,...) that we could reulse -- would be much preferable
*/
#ifdef MITK_NO_DEPRECATED_WARNINGS
#define DEPRECATED(func) func
#elif defined(__GNUC__)
#define DEPRECATED(...) __VA_ARGS__ __attribute__((deprecated))
#elif defined(_MSC_VER)
#define DEPRECATED(...) __declspec(deprecated)##__VA_ARGS__
#else
#pragma message("WARNING: You need to implement DEPRECATED for your compiler!")
#define DEPRECATED(func) func
#endif
/**
* Mark templates as exported to generate public RTTI symbols which are
* needed for GCC and Clang to support e.g. dynamic_cast between DSOs.
*/
#if defined(__clang__) || defined(__GNUC__)
#define MITK_EXPORT __attribute__((visibility("default")))
#define MITK_IMPORT __attribute__((visibility("default")))
#define MITK_LOCAL __attribute__((visibility("hidden")))
#elif defined(WIN32)
#define MITK_EXPORT __declspec(dllexport)
#define MITK_IMPORT __declspec(dllimport)
#define MITK_LOCAL
#else
#define MITK_EXPORT
#define MITK_IMPORT
#define MITK_LOCAL
#endif
#endif // MITK_COMMON_H_DEFINED
diff --git a/Modules/Core/include/mitkCompareImageDataFilter.h b/Modules/Core/include/mitkCompareImageDataFilter.h
index 69ba9a993c..ba19b64e8a 100644
--- a/Modules/Core/include/mitkCompareImageDataFilter.h
+++ b/Modules/Core/include/mitkCompareImageDataFilter.h
@@ -1,109 +1,108 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKCOMPAREIMAGEDATAFILTER_H
#define MITKCOMPAREIMAGEDATAFILTER_H
// MITK
#include "mitkImage.h"
#include "mitkImageToImageFilter.h"
// ITK
#include <itkImage.h>
namespace mitk
{
/**
* @brief A simple struct to hold the result of the comparison filter.
*/
struct CompareFilterResults
{
void PrintSelf()
{
if (!m_FilterCompleted)
{
MITK_INFO << "Comparison filter terminated due to an exception: \n " << m_ExceptionMessage;
return;
}
MITK_INFO << "Min. difference: " << m_MinimumDifference << "\n"
<< "Max. difference: " << m_MaximumDifference << "\n"
<< "Total difference: " << m_TotalDifference << "\n"
<< "Mean difference: " << m_MeanDifference << "\n"
<< "Number of pixels with differences: " << m_PixelsWithDifference;
}
double m_MinimumDifference;
double m_MaximumDifference;
double m_TotalDifference;
double m_MeanDifference;
size_t m_PixelsWithDifference;
bool m_FilterCompleted;
std::string m_ExceptionMessage;
};
/**
* @brief Filter for comparing two mitk::Image objects by pixel values
*
* The comparison is pixel-wise, the filter uses the itk::Testing::ComparisonImageFilter
* to find differences. The filter expects two images as input, provide them by using the SetInput( int, mitk::Image)
* method.
*/
class MITKCORE_EXPORT CompareImageDataFilter : public ImageToImageFilter
{
public:
- mitkClassMacro(CompareImageDataFilter, ImageToImageFilter)
-
- itkSimpleNewMacro(Self)
+ mitkClassMacro(CompareImageDataFilter, ImageToImageFilter);
+ itkSimpleNewMacro(Self);
/**
* @brief Get the result of the comparison
*
* The method compares only the number of pixels with differences. It returns true if the amount
* is under the specified threshold. To get the complete results, use the GetCompareResults method.
*
* Returns false also if the itk ComparisionImageFilter raises an exception during update.
*
* @param threshold Allowed amount of pixels with differences
*/
bool GetResult(size_t threshold = 0);
/**
* @brief Get the detailed results of the comparision run
*
* @sa CompareFilterResults
*/
CompareFilterResults GetCompareResults() { return m_CompareDetails; }
void SetTolerance(double eps) { m_Tolerance = eps; }
protected:
CompareImageDataFilter();
~CompareImageDataFilter() override {}
void GenerateData() override;
/*! \brief Method resets the compare detail memeber struct to its initial state */
void ResetCompareResultsToInitial();
/** ITK-like method which calls the ComparisionFilter on the two inputs of the filter */
template <typename TPixel, unsigned int VImageDimension>
void EstimateValueDifference(const itk::Image<TPixel, VImageDimension> *itkImage1,
const mitk::Image *referenceImage);
bool m_CompareResult;
CompareFilterResults m_CompareDetails;
double m_Tolerance;
};
} // end namespace mitk
#endif // MITKCompareImageDataFilter_H
diff --git a/Modules/Core/include/mitkConvert2Dto3DImageFilter.h b/Modules/Core/include/mitkConvert2Dto3DImageFilter.h
index 596b52d647..a7fd11a18b 100644
--- a/Modules/Core/include/mitkConvert2Dto3DImageFilter.h
+++ b/Modules/Core/include/mitkConvert2Dto3DImageFilter.h
@@ -1,61 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkConvert2Dto3DImageFilter_h
#define __mitkConvert2Dto3DImageFilter_h
// MITK
#include "mitkImageToImageFilter.h"
#include <itkImage.h>
#include <mitkImage.h>
namespace mitk
{
/** \brief Image Filter to convert 2D MITK images to 3D MITK images.
*
* A new 3D MITK image is created and all pixel and geometry information from
* the given 2D input image is copied. The resulting image 3D image has just one slice.
*
* This filter can be used when before saving a 2D image with 3D geometry information.
* By converting it to 3D with just one slice, the common formats (e.g. nrrd) allow
* a 3x3 transformation matrix.
*
* @ingroup Geometry
*/
class MITKCORE_EXPORT Convert2Dto3DImageFilter : public ImageToImageFilter
{
public:
mitkClassMacro(Convert2Dto3DImageFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
protected :
/*!
\brief standard constructor
*/
Convert2Dto3DImageFilter();
/*!
\brief standard destructor
*/
~Convert2Dto3DImageFilter() override;
/*!
\brief Method generating the output of this filter. Called in the updated process of the pipeline.
This method generates the smoothed output image.
*/
void GenerateData() override;
/*!
\brief Make a 2D image to a 3D image
*/
template <typename TPixel, unsigned int VImageDimension>
void ItkConvert2DTo3D(const itk::Image<TPixel, VImageDimension> *itkImage, mitk::Image::Pointer &mitkImage);
};
} // END mitk namespace
#endif
diff --git a/Modules/Core/include/mitkCoreObjectFactory.h b/Modules/Core/include/mitkCoreObjectFactory.h
index f433966fae..5ba7b0f3b9 100644
--- a/Modules/Core/include/mitkCoreObjectFactory.h
+++ b/Modules/Core/include/mitkCoreObjectFactory.h
@@ -1,139 +1,140 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef COREOBJECTFACTORY_H_INCLUDED
#define COREOBJECTFACTORY_H_INCLUDED
#include <set>
#include "mitkCoreObjectFactoryBase.h"
#include "mitkFileWriterWithInformation.h"
#include <MitkCoreExports.h>
namespace mitk
{
class Event;
class LegacyFileReaderService;
class LegacyFileWriterService;
class LegacyImageWriterService;
class MITKCORE_EXPORT CoreObjectFactory : public CoreObjectFactoryBase
{
public:
- mitkClassMacro(CoreObjectFactory, CoreObjectFactoryBase) itkFactorylessNewMacro(CoreObjectFactory)
+ mitkClassMacro(CoreObjectFactory, CoreObjectFactoryBase);
+ itkFactorylessNewMacro(CoreObjectFactory);
Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
void SetDefaultProperties(mitk::DataNode *node) override;
virtual void MapEvent(const mitk::Event *event, const int eventID);
virtual void RegisterExtraFactory(CoreObjectFactoryBase *factory);
virtual void UnRegisterExtraFactory(CoreObjectFactoryBase *factory);
static Pointer GetInstance();
~CoreObjectFactory() override;
/**
* @brief This method gets the supported (open) file extensions as string.
*
* This string can then used by the Qt QFileDialog widget.
*
* @return The c-string that contains the file extensions
* @deprecatedSince{2014_10} See mitk::FileReaderRegistry and QmitkIOUtil
*/
DEPRECATED(virtual const char *GetFileExtensions() override);
/**
* @brief get the defined (open) file extension map
*
* @return the defined (open) file extension map
* @deprecatedSince{2014_10} See mitk::FileReaderRegistry and QmitkIOUtil
*/
DEPRECATED(virtual MultimapType GetFileExtensionsMap() override);
/**
* @brief This method gets the supported (save) file extensions as string.
*
* This string can then used by the Qt QFileDialog widget.
*
* @return The c-string that contains the (save) file extensions
* @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil
*/
DEPRECATED(virtual const char *GetSaveFileExtensions() override);
/**
* @brief get the defined (save) file extension map
*
* @return the defined (save) file extension map
* @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil
*/
MultimapType GetSaveFileExtensionsMap() override;
/**
* @deprecatedSince{2014_10} See mitk::FileWriterRegistry
*/
DEPRECATED(virtual FileWriterList GetFileWriters());
/**
* @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil
*/
DEPRECATED(std::string GetDescriptionForExtension(const std::string &extension));
protected:
CoreObjectFactory();
/**
* @brief Merge the input map into the fileExtensionsMap. Duplicate entries are removed
*
* @param fileExtensionsMap the existing map, it contains value pairs like
* ("*.dcm", "DICOM files"),("*.dc3", "DICOM files").
* This map is extented/merged with the values from the input map.
* @param inputMap the input map, it contains value pairs like ("*.dcm",
* "DICOM files"),("*.dc3", "DICOM files") returned by the extra factories.
* @deprecatedSince{2014_10}
*/
void MergeFileExtensions(MultimapType &fileExtensionsMap, MultimapType inputMap);
/**
* @brief initialize the file extension entries for open and save
* @deprecatedSince{2014_10}
*/
void CreateFileExtensionsMap();
/**
* @deprecatedSince{2014_10}
*/
DEPRECATED(void CreateSaveFileExtensions());
typedef std::set<mitk::CoreObjectFactoryBase::Pointer> ExtraFactoriesContainer;
ExtraFactoriesContainer m_ExtraFactories;
FileWriterList m_FileWriters;
std::string m_FileExtensions;
MultimapType m_FileExtensionsMap;
std::string m_SaveFileExtensions;
MultimapType m_SaveFileExtensionsMap;
private:
void RegisterLegacyReaders(mitk::CoreObjectFactoryBase *factory);
void RegisterLegacyWriters(mitk::CoreObjectFactoryBase *factory);
void UnRegisterLegacyReaders(mitk::CoreObjectFactoryBase *factory);
void UnRegisterLegacyWriters(mitk::CoreObjectFactoryBase *factory);
std::map<mitk::CoreObjectFactoryBase *, std::list<mitk::LegacyFileReaderService *>> m_LegacyReaders;
std::map<mitk::CoreObjectFactoryBase *, std::list<mitk::LegacyFileWriterService *>> m_LegacyWriters;
};
} // namespace mitk
#endif
diff --git a/Modules/Core/include/mitkCoreObjectFactoryBase.h b/Modules/Core/include/mitkCoreObjectFactoryBase.h
index 47b1058770..52300916c9 100644
--- a/Modules/Core/include/mitkCoreObjectFactoryBase.h
+++ b/Modules/Core/include/mitkCoreObjectFactoryBase.h
@@ -1,91 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef COREOBJECTFACTORYBASE_H_INCLUDED
#define COREOBJECTFACTORYBASE_H_INCLUDED
// the mbilog header is necessary for CMake test drivers.
// Since the EXTRA_INCLUDE parameter of CREATE_TEST_SOURCELIST only
// allows one extra include file, we specify mitkLog.h here so it will
// be available to all classes implementing this interface.
#include "mitkLog.h"
#include "mitkFileWriterWithInformation.h"
#include "mitkMapper.h"
#include <MitkCoreExports.h>
#include <itkObjectFactoryBase.h>
#include <itkVersion.h>
namespace mitk
{
class DataNode;
//## @brief base-class for factories of certain mitk objects.
//## @ingroup Algorithms
//## This interface can be implemented by factories which add new mapper classes or extend the
//## data tree deserialization mechanism.
class MITKCORE_EXPORT CoreObjectFactoryBase : public itk::Object
{
public:
typedef std::list<mitk::FileWriterWithInformation::Pointer> FileWriterList;
typedef std::multimap<std::string, std::string> MultimapType;
- mitkClassMacroItkParent(CoreObjectFactoryBase, itk::Object)
+ mitkClassMacroItkParent(CoreObjectFactoryBase, itk::Object);
virtual Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId) = 0;
virtual void SetDefaultProperties(mitk::DataNode *node) = 0;
/**
* @deprecatedSince{2014_10} See mitk::FileReaderRegistry and QmitkIOUtil
*/
virtual const char *GetFileExtensions() = 0;
/**
* @deprecatedSince{2014_10} See mitk::FileReaderRegistry and QmitkIOUtil
*/
virtual MultimapType GetFileExtensionsMap() = 0;
/**
* @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil
*/
virtual const char *GetSaveFileExtensions() = 0;
/**
* @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil
*/
virtual MultimapType GetSaveFileExtensionsMap() = 0;
virtual const char *GetITKSourceVersion() const { return ITK_SOURCE_VERSION; }
virtual const char *GetDescription() const { return "Core Object Factory"; }
/**
* @deprecatedSince{2014_10} See mitk::FileWriterRegistry
*/
FileWriterList GetFileWriters() { return m_FileWriters; }
protected:
/**
* @brief create a string from a map that contains the file extensions
* @param fileExtensionsMap input map with the file extensions, e.g. ("*.dcm", "DICOM files")("*.dc3", "DICOM
* files")
* @param fileExtensions the converted output string, suitable for the QT QFileDialog widget
* e.g. "all (*.dcm *.DCM *.dc3 ... *.vti *.hdr *.nrrd *.nhdr );;ODF Images (*.odf *qbi)"
*
* @deprecatedSince{2014_10}
*/
static void CreateFileExtensions(MultimapType fileExtensionsMap, std::string &fileExtensions);
FileWriterList m_FileWriters;
friend class CoreObjectFactory;
};
}
#endif
diff --git a/Modules/Core/include/mitkDataInteractor.h b/Modules/Core/include/mitkDataInteractor.h
index 2bd7163aef..66dcb101d3 100644
--- a/Modules/Core/include/mitkDataInteractor.h
+++ b/Modules/Core/include/mitkDataInteractor.h
@@ -1,109 +1,113 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKDATAINTERACTOR_H_
#define MITKDATAINTERACTOR_H_
#include <MitkCoreExports.h>
#include <mitkCommon.h>
#include <mitkEventStateMachine.h>
#include <mitkWeakPointer.h>
#include <string>
namespace mitk
{
class DataNode;
- itkEventMacro(DataInteractorEvent, itk::AnyEvent)
+ itkEventMacro(DataInteractorEvent, itk::AnyEvent);
/** Triggered when interaction is started */
- itkEventMacro(StartInteraction, DataInteractorEvent)
+ itkEventMacro(StartInteraction, DataInteractorEvent);
/** Triggered when result is stored in mitk::DataNode */
- itkEventMacro(ResultReady, DataInteractorEvent)
+ itkEventMacro(ResultReady, DataInteractorEvent);
enum ProcessEventMode {
REGULAR = 0,
GRABINPUT = 1,
PREFERINPUT = 2,
CONNECTEDMOUSEACTION = 3
};
/**
* \brief Base class from with interactors that handle DataNodes are to be derived.
*
* Base class from with interactors that handle DataNodes are to be derived.
* Provides an interface that is relevant for the interactor to work together with the dispatcher.
* To implement a new interactor overwrite the ConnectActionsAndFunctions to connect the actions.
*/
class MITKCORE_EXPORT DataInteractor : public EventStateMachine
{
public:
// Predefined internal events/signals
static const std::string IntDeactivateMe;
static const std::string IntLeaveWidget;
static const std::string IntEnterWidget;
- mitkClassMacro(DataInteractor, EventStateMachine) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(DataInteractor, EventStateMachine);
+
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
DataNode *GetDataNode() const;
virtual void SetDataNode(DataNode *dataNode); // TODO: Remove virtual, use DataNodeChanged instead in subclasses
int GetLayer() const;
ProcessEventMode GetMode() const;
protected:
DataInteractor();
~DataInteractor() override;
/**
* @brief Overwrite this function to connect actions from StateMachine description with functions.
*
* Following example shows how to connect the 'addpoint' action from the StateMachine XML description using the
CONNECT_FUNCTION macro
* with the AddPoint() function in the TestInteractor.
* @code
* void mitk::TestInteractor::ConnectActionsAndFunctions()
{
CONNECT_FUNCTION("addpoint", AddPoint);
}
* @endcode
*/
void ConnectActionsAndFunctions() override;
/** \brief Is called when a DataNode is initially set or changed
* To be implemented by sub-classes for initialization code which require a DataNode.
* \note New DataInteractors usually are expected to have the focus, but this only works if they have the highest
* Layer,
* since empty DataNodes have a layer of -1, the DataNode must be filled here in order to get a layer assigned.
* \note Is also called when the DataNode is set to nullptr.
*/
virtual void DataNodeChanged();
/**
* @brief Sends StartInteraction event via the mitk::DataNode
*/
void virtual NotifyStart();
/**
* @brief NotifyResultReady Sends ResultReady event via the mitk::DataNode
*
* Use to get notfied when the mitk::DataNode is in a ready state for further processing.
*/
void virtual NotifyResultReady();
private:
WeakPointer<DataNode> m_DataNode;
};
}
#endif
diff --git a/Modules/Core/include/mitkDataNode.h b/Modules/Core/include/mitkDataNode.h
index b32e06ac08..fd6e62ef21 100644
--- a/Modules/Core/include/mitkDataNode.h
+++ b/Modules/Core/include/mitkDataNode.h
@@ -1,614 +1,614 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef DATATREENODE_H_HEADER_INCLUDED_C1E14338
#define DATATREENODE_H_HEADER_INCLUDED_C1E14338
#include "mitkBaseData.h"
//#include "mitkMapper.h"
#include "mitkDataInteractor.h"
#include "mitkIdentifiable.h"
#include "mitkIPropertyOwner.h"
#ifdef MBI_NO_STD_NAMESPACE
#define MBI_STD
#include <fstream.h>
#include <iostream.h>
#else
#define MBI_STD std
#include <fstream>
#include <iostream>
#endif
#include "mitkColorProperty.h"
#include "mitkPropertyList.h"
#include "mitkStringProperty.h"
//#include "mitkMapper.h"
#include "mitkGeometry3D.h"
#include "mitkLevelWindow.h"
#include <map>
#include <set>
class vtkLinearTransform;
namespace mitk
{
class BaseRenderer;
class Mapper;
/**
* \brief Class for nodes of the DataTree
*
* Contains the data (instance of BaseData), a list of mappers, which can
* draw the data, a transform (vtkTransform) and a list of properties
* (PropertyList).
* \ingroup DataManagement
*
* \todo clean up all the GetProperty methods. There are too many different flavours... Can most probably be reduced
* to
* <tt>bool GetProperty<type>(type&)</tt>
*
* \warning Change in semantics of SetProperty() since Aug 25th 2006. Check your usage of this method if you do
* more with properties than just call <tt>SetProperty( "key", new SomeProperty("value") )</tt>.
*/
class MITKCORE_EXPORT DataNode : public itk::DataObject, public IPropertyOwner
{
public:
typedef mitk::Geometry3D::Pointer Geometry3DPointer;
typedef std::vector<itk::SmartPointer<Mapper>> MapperVector;
typedef std::map<std::string, mitk::PropertyList::Pointer> MapOfPropertyLists;
typedef std::vector<MapOfPropertyLists::key_type> PropertyListKeyNames;
typedef std::set<std::string> GroupTagList;
/**
* \brief Definition of an itk::Event that is invoked when
* a DataInteractor is set on this DataNode.
*/
itkEventMacro(InteractorChangedEvent, itk::AnyEvent)
- mitkClassMacroItkParent(DataNode, itk::DataObject)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacroItkParent(DataNode, itk::DataObject);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
// IPropertyProvider
BaseProperty::ConstPointer GetConstProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = true) const override;
std::vector<std::string> GetPropertyKeys(const std::string &contextName = "", bool includeDefaultContext = false) const override;
std::vector<std::string> GetPropertyContextNames() const override;
// IPropertyOwner
BaseProperty * GetNonConstProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = true) override;
void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName = "", bool fallBackOnDefaultContext = false) override;
void RemoveProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = false) override;
mitk::Mapper *GetMapper(MapperSlotId id) const;
/**
* \brief Get the data object (instance of BaseData, e.g., an Image)
* managed by this DataNode
*/
BaseData *GetData() const;
/**
* \brief Get the transformation applied prior to displaying the data as
* a vtkTransform
* \deprecated use GetData()->GetGeometry()->GetVtkTransform() instead
*/
vtkLinearTransform *GetVtkTransform(int t = 0) const;
/**
* \brief Set the data object (instance of BaseData, e.g., an Image)
* managed by this DataNode
*
* Prior set properties are kept if previous data of the node already exists and has the same
* type as the new data to be set. Otherwise, the default properties are used.
* In case that previous data already exists, the property list of the data node is cleared
* before setting new default properties.
*
* \warning the actor-mode of the vtkInteractor does not work any more, if the transform of the
* data-tree-node is connected to the transform of the basedata via vtkTransform->SetInput.
*/
virtual void SetData(mitk::BaseData *baseData);
/**
* \brief Set the Interactor.
*/
virtual void SetDataInteractor(const DataInteractor::Pointer interactor);
virtual DataInteractor::Pointer GetDataInteractor() const;
mitk::DataNode &operator=(const DataNode &right);
mitk::DataNode &operator=(BaseData *right);
virtual void SetMapper(MapperSlotId id, mitk::Mapper *mapper);
void UpdateOutputInformation() override;
void SetRequestedRegionToLargestPossibleRegion() override;
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
bool VerifyRequestedRegion() override;
void SetRequestedRegion(const itk::DataObject *data) override;
void CopyInformation(const itk::DataObject *data) override;
/**
* \brief The "names" used for (renderer-specific) PropertyLists in GetPropertyList(string).
*
* All possible values for the "renderer" parameters of
* the diverse GetProperty/List() methods.
*/
PropertyListKeyNames GetPropertyListNames() const;
/**
* \brief Set the property (instance of BaseProperty) with key \a propertyKey in the PropertyList
* of the \a renderer (if nullptr, use BaseRenderer-independent PropertyList). This is set-by-value.
*
* \warning Change in semantics since Aug 25th 2006. Check your usage of this method if you do
* more with properties than just call <tt>SetProperty( "key", new SomeProperty("value") )</tt>.
*
* \sa GetProperty
* \sa m_PropertyList
* \sa m_MapOfPropertyLists
*/
void SetProperty(const char *propertyKey, BaseProperty *property, const mitk::BaseRenderer *renderer = nullptr);
/**
* \brief Replace the property (instance of BaseProperty) with key \a propertyKey in the PropertyList
* of the \a renderer (if nullptr, use BaseRenderer-independent PropertyList). This is set-by-reference.
*
* If \a renderer is \a nullptr the property is set in the BaseRenderer-independent
* PropertyList of this DataNode.
* \sa GetProperty
* \sa m_PropertyList
* \sa m_MapOfPropertyLists
*/
void ReplaceProperty(const char *propertyKey, BaseProperty *property, const mitk::BaseRenderer *renderer = nullptr);
/**
* \brief Add the property (instance of BaseProperty) if it does
* not exist (or always if\a overwrite is\a true)
* with key \a propertyKey in the PropertyList
* of the \a renderer (if nullptr, use BaseRenderer-independent
* PropertyList). This is set-by-value.
*
* For\a overwrite ==\a false the property is\em not changed
* if it already exists. For\a overwrite ==\a true the method
* is identical to SetProperty.
*
* \sa SetProperty
* \sa GetProperty
* \sa m_PropertyList
* \sa m_MapOfPropertyLists
*/
void AddProperty(const char *propertyKey,
BaseProperty *property,
const mitk::BaseRenderer *renderer = nullptr,
bool overwrite = false);
/**
* \brief Get the PropertyList of the \a renderer. If \a renderer is \a
* nullptr, the BaseRenderer-independent PropertyList of this DataNode
* is returned.
* \sa GetProperty
* \sa m_PropertyList
* \sa m_MapOfPropertyLists
*/
mitk::PropertyList *GetPropertyList(const mitk::BaseRenderer *renderer = nullptr) const;
mitk::PropertyList *GetPropertyList(const std::string &rendererName) const;
/**
* \brief Add values from another PropertyList.
*
* Overwrites values in m_PropertyList only when possible (i.e. when types are compatible).
* If you want to allow for object type changes (replacing a "visible":BoolProperty with "visible":IntProperty,
* set the \param replace.
*
* \param replace true: if \param pList contains a property "visible" of type ColorProperty and our m_PropertyList
* also has a "visible" property of a different type (e.g. BoolProperty), change the type, i.e. replace the objects
* behind the pointer.
*
* \sa SetProperty
* \sa ReplaceProperty
* \sa m_PropertyList
*/
void ConcatenatePropertyList(PropertyList *pList, bool replace = false);
/**
* \brief Get the property (instance of BaseProperty) with key \a propertyKey from the PropertyList
* of the \a renderer, if available there, otherwise use the BaseRenderer-independent PropertyList.
*
* If \a renderer is \a nullptr or the \a propertyKey cannot be found
* in the PropertyList specific to \a renderer or is disabled there, the BaseRenderer-independent
* PropertyList of this DataNode is queried.
*
* If \a fallBackOnDataProperties is true, the data property list is queried as a last resort.
*
* \sa GetPropertyList
* \sa m_PropertyList
* \sa m_MapOfPropertyLists
*/
mitk::BaseProperty *GetProperty(const char *propertyKey, const mitk::BaseRenderer *renderer = nullptr, bool fallBackOnDataProperties = true) const;
/**
* \brief Get the property of type T with key \a propertyKey from the PropertyList
* of the \a renderer, if available there, otherwise use the BaseRenderer-independent PropertyList.
*
* If \a renderer is \a nullptr or the \a propertyKey cannot be found
* in the PropertyList specific to \a renderer or is disabled there, the BaseRenderer-independent
* PropertyList of this DataNode is queried.
* \sa GetPropertyList
* \sa m_PropertyList
* \sa m_MapOfPropertyLists
*/
template <typename T>
bool GetProperty(itk::SmartPointer<T> &property,
const char *propertyKey,
const mitk::BaseRenderer *renderer = nullptr) const
{
property = dynamic_cast<T *>(GetProperty(propertyKey, renderer));
return property.IsNotNull();
}
/**
* \brief Get the property of type T with key \a propertyKey from the PropertyList
* of the \a renderer, if available there, otherwise use the BaseRenderer-independent PropertyList.
*
* If \a renderer is \a nullptr or the \a propertyKey cannot be found
* in the PropertyList specific to \a renderer or is disabled there, the BaseRenderer-independent
* PropertyList of this DataNode is queried.
* \sa GetPropertyList
* \sa m_PropertyList
* \sa m_MapOfPropertyLists
*/
template <typename T>
bool GetProperty(T *&property, const char *propertyKey, const mitk::BaseRenderer *renderer = nullptr) const
{
property = dynamic_cast<T *>(GetProperty(propertyKey, renderer));
return property != nullptr;
}
/**
* \brief Convenience access method for GenericProperty<T> properties
* (T being the type of the second parameter)
* \return \a true property was found
*/
template <typename T>
bool GetPropertyValue(const char *propertyKey, T &value, const mitk::BaseRenderer *renderer = nullptr) const
{
GenericProperty<T> *gp = dynamic_cast<GenericProperty<T> *>(GetProperty(propertyKey, renderer));
if (gp != nullptr)
{
value = gp->GetValue();
return true;
}
return false;
}
/// \brief Get a set of all group tags from this node's property list
GroupTagList GetGroupTags() const;
/**
* \brief Convenience access method for bool properties (instances of
* BoolProperty)
* \return \a true property was found
*/
bool GetBoolProperty(const char *propertyKey, bool &boolValue, const mitk::BaseRenderer *renderer = nullptr) const;
/**
* \brief Convenience access method for int properties (instances of
* IntProperty)
* \return \a true property was found
*/
bool GetIntProperty(const char *propertyKey, int &intValue, const mitk::BaseRenderer *renderer = nullptr) const;
/**
* \brief Convenience access method for float properties (instances of
* FloatProperty)
* \return \a true property was found
*/
bool GetFloatProperty(const char *propertyKey,
float &floatValue,
const mitk::BaseRenderer *renderer = nullptr) const;
/**
* \brief Convenience access method for double properties (instances of
* DoubleProperty)
*
* If there is no DoubleProperty for the given\c propertyKey argument, the method
* looks for a corresponding FloatProperty instance.
*
* \return \a true property was found
*/
bool GetDoubleProperty(const char *propertyKey,
double &doubleValue,
const mitk::BaseRenderer *renderer = nullptr) const;
/**
* \brief Convenience access method for string properties (instances of
* StringProperty)
* \return \a true property was found
*/
bool GetStringProperty(const char *propertyKey,
std::string &string,
const mitk::BaseRenderer *renderer = nullptr) const;
/**
* \brief Convenience access method for color properties (instances of
* ColorProperty)
* \return \a true property was found
*/
bool GetColor(float rgb[3], const mitk::BaseRenderer *renderer = nullptr, const char *propertyKey = "color") const;
/**
* \brief Convenience access method for level-window properties (instances of
* LevelWindowProperty)
* \return \a true property was found
*/
bool GetLevelWindow(mitk::LevelWindow &levelWindow,
const mitk::BaseRenderer *renderer = nullptr,
const char *propertyKey = "levelwindow") const;
/**
* \brief set the node as selected
*/
void SetSelected(bool selected, const mitk::BaseRenderer *renderer = nullptr);
/**
* \brief set the node as selected
* \return \a true node is selected
*/
bool IsSelected(const mitk::BaseRenderer *renderer = nullptr);
/**
* \brief Convenience access method for accessing the name of an object (instance of
* StringProperty with property-key "name")
* \return \a true property was found
*/
bool GetName(std::string &nodeName,
const mitk::BaseRenderer *renderer = nullptr,
const char *propertyKey = "name") const
{
return GetStringProperty(propertyKey, nodeName, renderer);
}
/**
* \brief Extra convenience access method for accessing the name of an object (instance of
* StringProperty with property-key "name").
*
* This method does not take the renderer specific
* propertylists into account, because the name of an object should never be renderer specific.
* \returns a std::string with the name of the object (content of "name" Property).
* If there is no "name" Property, an empty string will be returned.
*/
virtual std::string GetName() const
{
mitk::StringProperty *sp = dynamic_cast<mitk::StringProperty *>(this->GetProperty("name"));
if (sp == nullptr)
return "";
return sp->GetValue();
}
/** Value constant that is used indicate that node names are not set so far.*/
static std::string NO_NAME_VALUE()
{
return "No Name!";
}
/**
* \brief Extra convenience access method to set the name of an object.
*
* The name will be stored in the non-renderer-specific PropertyList in a StringProperty named "name".
*/
virtual void SetName(const char *name)
{
if (name == nullptr)
return;
this->SetProperty("name", StringProperty::New(name));
}
/**
* \brief Extra convenience access method to set the name of an object.
*
* The name will be stored in the non-renderer-specific PropertyList in a StringProperty named "name".
*/
virtual void SetName(const std::string name) { this->SetName(name.c_str()); }
/**
* \brief Convenience access method for visibility properties (instances
* of BoolProperty with property-key "visible")
* \return \a true property was found
* \sa IsVisible
*/
bool GetVisibility(bool &visible, const mitk::BaseRenderer *renderer, const char *propertyKey = "visible") const
{
return GetBoolProperty(propertyKey, visible, renderer);
}
/**
* \brief Convenience access method for opacity properties (instances of
* FloatProperty)
* \return \a true property was found
*/
bool GetOpacity(float &opacity, const mitk::BaseRenderer *renderer, const char *propertyKey = "opacity") const;
/**
* \brief Convenience access method for boolean properties (instances
* of BoolProperty). Return value is the value of the property. If the property is
* not found, the value of \a defaultIsOn is returned.
*
* Thus, the return value has a different meaning than in the
* GetBoolProperty method!
* \sa GetBoolProperty
*/
bool IsOn(const char *propertyKey, const mitk::BaseRenderer *renderer, bool defaultIsOn = true) const
{
if (propertyKey == nullptr)
return defaultIsOn;
GetBoolProperty(propertyKey, defaultIsOn, renderer);
return defaultIsOn;
}
/**
* \brief Convenience access method for visibility properties (instances
* of BoolProperty). Return value is the visibility. Default is
* visible==true, i.e., true is returned even if the property (\a
* propertyKey) is not found.
*
* Thus, the return value has a different meaning than in the
* GetVisibility method!
* \sa GetVisibility
* \sa IsOn
*/
bool IsVisible(const mitk::BaseRenderer *renderer,
const char *propertyKey = "visible",
bool defaultIsOn = true) const
{
return IsOn(propertyKey, renderer, defaultIsOn);
}
/**
* \brief Convenience method for setting color properties (instances of
* ColorProperty)
*/
void SetColor(const mitk::Color &color,
const mitk::BaseRenderer *renderer = nullptr,
const char *propertyKey = "color");
/**
* \brief Convenience method for setting color properties (instances of
* ColorProperty)
*/
void SetColor(float red,
float green,
float blue,
const mitk::BaseRenderer *renderer = nullptr,
const char *propertyKey = "color");
/**
* \brief Convenience method for setting color properties (instances of
* ColorProperty)
*/
void SetColor(const float rgb[3], const mitk::BaseRenderer *renderer = nullptr, const char *propertyKey = "color");
/**
* \brief Convenience method for setting visibility properties (instances
* of BoolProperty)
* \param visible If set to true, the data will be rendered. If false, the render will skip this data.
* \param renderer Specify a renderer if the visibility shall be specific to a renderer
* \param propertykey Can be used to specify a user defined name of the visibility propery.
*/
void SetVisibility(bool visible, const mitk::BaseRenderer *renderer = nullptr, const char *propertyKey = "visible");
/**
* \brief Convenience method for setting opacity properties (instances of
* FloatProperty)
*/
void SetOpacity(float opacity, const mitk::BaseRenderer *renderer = nullptr, const char *propertyKey = "opacity");
/**
* \brief Convenience method for setting level-window properties
* (instances of LevelWindowProperty)
*/
void SetLevelWindow(mitk::LevelWindow levelWindow,
const mitk::BaseRenderer *renderer = nullptr,
const char *propertyKey = "levelwindow");
/**
* \brief Convenience method for setting int properties (instances of
* IntProperty)
*/
void SetIntProperty(const char *propertyKey, int intValue, const mitk::BaseRenderer *renderer = nullptr);
/**
* \brief Convenience method for setting boolean properties (instances of
* BoolProperty)
*/
void SetBoolProperty(const char *propertyKey, bool boolValue, const mitk::BaseRenderer *renderer = nullptr);
/**
* \brief Convenience method for setting float properties (instances of
* FloatProperty)
*/
void SetFloatProperty(const char *propertyKey, float floatValue, const mitk::BaseRenderer *renderer = nullptr);
/**
* \brief Convenience method for setting double properties (instances of
* DoubleProperty)
*/
void SetDoubleProperty(const char *propertyKey, double doubleValue, const mitk::BaseRenderer *renderer = nullptr);
/**
* \brief Convenience method for setting string properties (instances of
* StringProperty)
*/
void SetStringProperty(const char *propertyKey, const char *string, const mitk::BaseRenderer *renderer = nullptr);
/**
* \brief Get the timestamp of the last change of the contents of this node or
* the referenced BaseData.
*/
unsigned long GetMTime() const override;
/**
* \brief Get the timestamp of the last change of the reference to the
* BaseData.
*/
unsigned long GetDataReferenceChangedTime() const { return m_DataReferenceChangedTime.GetMTime(); }
protected:
DataNode();
~DataNode() override;
/// Invoked when the property list was modified. Calls Modified() of the DataNode
virtual void PropertyListModified(const itk::Object *caller, const itk::EventObject &event);
/// \brief Mapper-slots
mutable MapperVector m_Mappers;
/**
* \brief The data object (instance of BaseData, e.g., an Image) managed
* by this DataNode
*/
BaseData::Pointer m_Data;
/**
* \brief BaseRenderer-independent PropertyList
*
* Properties herein can be overwritten specifically for each BaseRenderer
* by the BaseRenderer-specific properties defined in m_MapOfPropertyLists.
*/
PropertyList::Pointer m_PropertyList;
/// \brief Map associating each BaseRenderer with its own PropertyList
mutable MapOfPropertyLists m_MapOfPropertyLists;
DataInteractor::Pointer m_DataInteractor;
/// \brief Timestamp of the last change of m_Data
itk::TimeStamp m_DataReferenceChangedTime;
unsigned long m_PropertyListModifiedObserverTag;
};
#if (_MSC_VER > 1200) || !defined(_MSC_VER)
MITKCORE_EXPORT MBI_STD::istream &operator>>(MBI_STD::istream &i, DataNode::Pointer &dtn);
MITKCORE_EXPORT MBI_STD::ostream &operator<<(MBI_STD::ostream &o, DataNode::Pointer &dtn);
#endif
} // namespace mitk
#if ((defined(_MSC_VER)) && (_MSC_VER <= 1200))
MITKCORE_EXPORT MBI_STD::istream &operator>>(MBI_STD::istream &i, mitk::DataNode::Pointer &dtn);
MITKCORE_EXPORT MBI_STD::ostream &operator<<(MBI_STD::ostream &o, mitk::DataNode::Pointer &dtn);
#endif
#endif /* DATATREENODE_H_HEADER_INCLUDED_C1E14338 */
diff --git a/Modules/Core/include/mitkDataNodeSource.h b/Modules/Core/include/mitkDataNodeSource.h
index 25307fd6bf..5f55e1be01 100644
--- a/Modules/Core/include/mitkDataNodeSource.h
+++ b/Modules/Core/include/mitkDataNodeSource.h
@@ -1,70 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_DATA_TREE_NODE_SOURCE_H
#define _MITK_DATA_TREE_NODE_SOURCE_H
#include "itkProcessObject.h"
#include "mitkDataNode.h"
namespace mitk
{
/**
* @brief Superclass of all classes generating data tree nodes (instances of class
* mitk::DataNode) as output.
*
* In itk and vtk the generated result of a ProcessObject is only guaranteed
* to be up-to-date, when Update() of the ProcessObject or the generated
* DataObject is called immediately before access of the data stored in the
* DataObject. This is also true for subclasses of mitk::BaseProcess and thus
* for mitk::DataNodeSource.
* @ingroup Process
*/
class MITKCORE_EXPORT DataNodeSource : public itk::ProcessObject
{
public:
- mitkClassMacroItkParent(DataNodeSource, itk::ProcessObject)
+ mitkClassMacroItkParent(DataNodeSource, itk::ProcessObject);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
typedef mitk::DataNode OutputType;
typedef OutputType::Pointer OutputTypePointer;
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
DataObjectPointer MakeOutput(const DataObjectIdentifierType &name) override;
OutputType *GetOutput();
const OutputType *GetOutput() const;
OutputType *GetOutput(DataObjectPointerArraySizeType idx);
const OutputType *GetOutput(DataObjectPointerArraySizeType idx) const;
protected:
DataNodeSource();
~DataNodeSource() override;
};
}
#endif // #define _MITK_BASE_DATA_SOURCE_H
diff --git a/Modules/Core/include/mitkDisplayActionEventBroadcast.h b/Modules/Core/include/mitkDisplayActionEventBroadcast.h
index d374408426..d2470f5854 100644
--- a/Modules/Core/include/mitkDisplayActionEventBroadcast.h
+++ b/Modules/Core/include/mitkDisplayActionEventBroadcast.h
@@ -1,224 +1,224 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKDISPLAYACTIONEVENTBROADCAST_H
#define MITKDISPLAYACTIONEVENTBROADCAST_H
#include "mitkInteractionEventObserver.h"
#include <MitkCoreExports.h>
namespace mitk
{
/**
* @brief This class serves as an event state machine while simultaneously observing interaction events.
* It connects the actions from the event state machine .xml-file with concrete functions of this class.
*
* The observed interaction events are mouse events that trigger certain actions, according to an event configuration (e.g. PACS mode).
* These actions are defined and connected inside this broadcast class.
* They typically contain some preprocessing steps and use the results of the preprocessing to broadcast a specific display event.
*
* Any instance that wants to react on the invoked events can call 'AddObserver' on a specific broadcast instance,
* given an itkEventObject and an itkCommand.
*/
class MITKCORE_EXPORT DisplayActionEventBroadcast : public EventStateMachine, public InteractionEventObserver
{
public:
- mitkClassMacro(DisplayActionEventBroadcast, EventStateMachine)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(DisplayActionEventBroadcast, EventStateMachine);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* By this function this observer is notified about about every 'InteractionEvent'.
* The interaction event is passed to the state machine in order to use its infrastructure.
* For more information see @see InteractionEventObserver.
*
* @par interactionEvent The event that was observed and triggered this notification.
* @par isHandled Flag that indicates if a 'DataInteractor' has already handled the event.
*/
void Notify(InteractionEvent* interactionEvent, bool isHandled) override;
protected:
DisplayActionEventBroadcast();
~DisplayActionEventBroadcast() override;
/**
* @brief Connects the action names used in the state machine pattern with functions implemented within this InteractionEventObserver.
*/
void ConnectActionsAndFunctions() override;
/**
* @brief This function is executed when a config object is set / changed (via 'SetEventConfig' or 'AddEventConfig' in 'InteractionEventObserver').
* It is used to read out the parameters set in the configuration file and to set the member variables accordingly.
*/
void ConfigurationChanged() override;
/**
* @brief Filters the event resp. the sender of the event.
*
* @par interactionEvent The event whose sender has to be checked
* @par data node The data node is ignored in this specific implementation.
*
* @return True, if the sender of the event is a valid sender and the sending renderer is a 2D-renderer. False, if not.
*/
bool FilterEvents(InteractionEvent* interactionEvent, DataNode* dataNode) override;
//////////////////////////////////////////////////////////////////////////
// Functions to react to interaction events (actions)
//////////////////////////////////////////////////////////////////////////
/**
* @brief Check if the given interaction event is actually an 'InteractionPositionEvent'.
*
* @par interactionEvent The interaction event that is checked.
*
* @return True, if the given event can be dynamically cast to an 'InteractionPositionEvent'. False, if not.
*/
bool CheckPositionEvent(const InteractionEvent* interactionEvent);
bool CheckRotationPossible(const InteractionEvent* interactionEvent);
bool CheckSwivelPossible(const InteractionEvent* interactionEvent);
void Init(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void Move(StateMachineAction* stateMachineAction , InteractionEvent* interactionEvent);
void SetCrosshair(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void Zoom(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void Scroll(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void ScrollOneUp(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void ScrollOneDown(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void AdjustLevelWindow(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void StartRotation(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void EndRotation(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void Rotate(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void Swivel(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void IncreaseTimeStep(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void DecreaseTimeStep(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
private:
void UpdateStatusbar(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
bool GetBoolProperty(PropertyList::Pointer propertyList, const char* propertyName, bool defaultValue);
/**
* @brief Reference to the service registration of the observer.
* This is needed to unregister the observer on unload.
*/
us::ServiceRegistration<InteractionEventObserver> m_ServiceRegistration;
/**
* @brief Determines if this broadcast class reacts to events that already have been processed by a DataInteractor.
* The default value is false.
*/
bool m_AlwaysReact;
/**
* @brief Coordinate of the mouse pointer at beginning of an interaction (translated to mm unit).
*/
Point2D m_StartCoordinateInMM;
/**
* @brief Coordinate of the mouse pointer in the last step within an interaction.
*/
Point2D m_LastDisplayCoordinate;
/**
* @brief Coordinate of the mouse pointer in the last step within an interaction (translated to mm unit).
*/
Point2D m_LastCoordinateInMM;
/**
* \brief Current coordinates of the pointer.
*/
Point2D m_CurrentDisplayCoordinate;
/**
* @brief Defines the behavior at the end of a data set.
* If set to true, it will restart at end of data set from the beginning.
*/
bool m_AutoRepeat;
/**
* @brief Defines how many slices are scrolled per pixel that the mouse pointer was moved.
* By default the modifier is 4. This means that when the user moves the cursor by 4 pixels in Y-direction,
* the scene is scrolled by one slice. If the user has moved the the cursor by 20 pixels, the scene is
* scrolled by 5 slices.
*
* If the cursor has moved less than m_IndexToSliceModifier pixels, the scene is scrolled by one slice.
*/
int m_IndexToSliceModifier;
/**
* @brief Defines the scroll behavior.
* Default is up/down movement of pointer performs scrolling
*/
std::string m_ScrollDirection;
/**
* @brief Defines how the axis of interaction influences scroll behavior.
*/
bool m_InvertScrollDirection;
/**
* @brief Defines the zoom behavior.
* Default is up/down movement of pointer performs zooming
*/
std::string m_ZoomDirection;
/**
* @brief Defines how the axis of interaction influences zoom behavior.
*/
bool m_InvertZoomDirection;
/**
* @brief Factor to adjust zooming speed.
*/
float m_ZoomFactor;
/**
* @brief Defines how the axis of interaction influences move behavior.
*/
bool m_InvertMoveDirection;
/**
* @brief Defines the level-window behavior.
* Default is left/right movement of pointer modifies the level.
*/
std::string m_LevelDirection;
/**
* @brief Defines how the axis of interaction influences level-window behavior.
*/
bool m_InvertLevelWindowDirection;
/**
* @brief Determines if the angle between crosshair remains fixed when rotating.
*/
bool m_LinkPlanes;
typedef std::vector<SliceNavigationController*> SNCVector;
SNCVector m_RotatableSNCs;
SNCVector m_SNCsToBeRotated;
Point3D m_LastCursorPosition;
Point3D m_CenterOfRotation;
Point2D m_ReferenceCursor;
Vector3D m_RotationPlaneNormal;
Vector3D m_RotationPlaneXVector;
Vector3D m_RotationPlaneYVector;
Vector3D m_PreviousRotationAxis;
ScalarType m_PreviousRotationAngle;
};
} // end namespace
#endif // MITKDISPLAYACTIONEVENTBROADCAST_H
diff --git a/Modules/Core/include/mitkDisplayInteractor.h b/Modules/Core/include/mitkDisplayInteractor.h
index b4023c8829..6b35f4022c 100644
--- a/Modules/Core/include/mitkDisplayInteractor.h
+++ b/Modules/Core/include/mitkDisplayInteractor.h
@@ -1,279 +1,281 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkDisplayInteractor_h
#define mitkDisplayInteractor_h
#include "mitkInteractionEventObserver.h"
#include <MitkCoreExports.h>
namespace mitk
{
/**
*\class DisplayInteractor
*@brief Observer that manages the interaction with the display.
*
* This includes the interaction of Zooming, Panning, Scrolling and adjusting the LevelWindow.
*
* @ingroup Interaction
**/
/**
* Inherits from mitk::InteractionEventObserver since it doesn't alter any data (only their representation),
* and its actions cannot be associated with a DataNode. Also inherits from EventStateMachine
*/
class MITKCORE_EXPORT DisplayInteractor : public EventStateMachine, public InteractionEventObserver
{
public:
- mitkClassMacro(DisplayInteractor, EventStateMachine)
- itkFactorylessNewMacro(Self)
+ mitkClassMacro(DisplayInteractor, EventStateMachine);
+
+ itkFactorylessNewMacro(Self);
+
itkCloneMacro(Self)
/**
* By this function the Observer gets notified about new events.
* Here it is adapted to pass the events to the state machine in order to use
* its infrastructure.
* It also checks if event is to be accepted when it already has been processed by a DataInteractor.
*/
void Notify(InteractionEvent *interactionEvent, bool isHandled) override;
protected:
DisplayInteractor();
~DisplayInteractor() override;
/**
* Derived function.
* Connects the action names used in the state machine pattern with functions implemented within
* this InteractionEventObserver. This is only necessary here because the events are processed by the state machine.
*/
void ConnectActionsAndFunctions() override;
/**
* Derived function.
* Is executed when config object is set / changed.
* Here it is used to read out the parameters set in the configuration file,
* and set the member variables accordingly.
*/
void ConfigurationChanged() override;
/**
* Derived function.
* Is executed when config object is set / changed.
* Here it is used to read out the parameters set in the configuration file,
* and set the member variables accordingly.
*/
bool FilterEvents(InteractionEvent *interactionEvent, DataNode *dataNode) override;
virtual bool CheckPositionEvent(const InteractionEvent *interactionEvent);
virtual bool CheckRotationPossible(const InteractionEvent *interactionEvent);
virtual bool CheckSwivelPossible(const InteractionEvent *interactionEvent);
/**
* \brief Initializes an interaction, saves the pointers start position for further reference.
*/
virtual void Init(StateMachineAction *, InteractionEvent *);
/**
* \brief Performs panning of the data set in the render window.
*/
virtual void Move(StateMachineAction *, InteractionEvent *);
/**
* \brief Sets crosshair at clicked position*
*/
virtual void SetCrosshair(StateMachineAction *, InteractionEvent *);
/**
* \brief Increases the time step in 3d+t data
*/
virtual void IncreaseTimeStep(StateMachineAction *, InteractionEvent *);
/**
* \brief Decreases the time step in 3d+t data
*/
virtual void DecreaseTimeStep(StateMachineAction *, InteractionEvent *);
/**
* \brief Performs zooming relative to mouse/pointer movement.
*
* Behavior is determined by \see m_ZoomDirection and \see m_ZoomFactor.
*
*/
virtual void Zoom(StateMachineAction *, InteractionEvent *);
/**
* \brief Performs scrolling relative to mouse/pointer movement.
*
* Behavior is determined by \see m_ScrollDirection and \see m_AutoRepeat.
*
*/
virtual void Scroll(StateMachineAction *, InteractionEvent *);
/**
* \brief Scrolls one layer up
*/
virtual void ScrollOneDown(StateMachineAction *, InteractionEvent *);
/**
* \brief Scrolls one layer down
*/
virtual void ScrollOneUp(StateMachineAction *, InteractionEvent *);
/**
* \brief Adjusts the level windows relative to mouse/pointer movement.
*/
virtual void AdjustLevelWindow(StateMachineAction *, InteractionEvent *);
/**
* \brief Starts crosshair rotation
*/
virtual void StartRotation(StateMachineAction *, InteractionEvent *);
/**
* \brief Ends crosshair rotation
*/
virtual void EndRotation(StateMachineAction *, InteractionEvent *);
/**
* \brief
*/
virtual void Rotate(StateMachineAction *, InteractionEvent *event);
virtual void Swivel(StateMachineAction *, InteractionEvent *event);
/**
* \brief Updates the Statusbar information with the information about the clicked position
*/
virtual void UpdateStatusbar(StateMachineAction *, InteractionEvent *event);
/**
* \brief Method to retrieve bool-value for given property from string-property
* in given propertylist.
*/
bool GetBoolProperty(mitk::PropertyList::Pointer propertyList, const char *propertyName, bool defaultValue);
private:
/**
* @brief UpdateStatusBar
* @param image3D
* @param idx
* @param time
* @param component If the PixelType of image3D is a vector (for example a 2D velocity vector), then only one of the vector components can be
* displayed at once. Setting this parameter will determine which of the vector's components will be used to determine the displayed PixelValue.
* Set this to 0 for scalar images
*/
void UpdateStatusBar(itk::SmartPointer<mitk::Image> image3D, itk::Index<3> idx, TimeStepType time=0, int component=0);
/**
* \brief Coordinate of the pointer at begin of an interaction translated to mm unit
*/
mitk::Point2D m_StartCoordinateInMM;
/**
* \brief Coordinate of the pointer in the last step within an interaction.
*/
mitk::Point2D m_LastDisplayCoordinate;
/**
* \brief Coordinate of the pointer in the last step within an interaction translated to mm unit
*/
mitk::Point2D m_LastCoordinateInMM;
/**
* \brief Current coordinates of the pointer.
*/
mitk::Point2D m_CurrentDisplayCoordinate;
/**
* \brief Modifier that defines how many slices are scrolled per pixel that the mouse has moved
*
* This modifier defines how many slices the scene is scrolled per pixel that the mouse cursor has moved.
* By default the modifier is 4. This means that when the user moves the cursor by 4 pixels in Y-direction
* the scene is scrolled by one slice. If the user has moved the the cursor by 20 pixels, the scene is
* scrolled by 5 slices.
*
* If the cursor has moved less than m_IndexToSliceModifier pixels the scene is scrolled by one slice.
*/
int m_IndexToSliceModifier;
/** Defines behavior at end of data set.
* If set to true it will restart at end of data set from the beginning.
*/
bool m_AutoRepeat;
/**
* Defines scroll behavior.
* Default is up/down movement of pointer performs scrolling
*/
std::string m_ScrollDirection;
/**
* Defines how the axis of interaction influences scroll behavior.
*/
bool m_InvertScrollDirection;
/**
* Defines scroll behavior.
* Default is up/down movement of pointer performs zooming
*/
std::string m_ZoomDirection;
/**
* Defines how the axis of interaction influences zoom behavior.
*/
bool m_InvertZoomDirection;
/**
* Defines how the axis of interaction influences move behavior.
*/
bool m_InvertMoveDirection;
/**
* Defines level/window behavior.
* Default is left/right movement of pointer modifies the level.
*/
std::string m_LevelDirection;
/**
* Defines how the axis of interaction influences level/window behavior.
*/
bool m_InvertLevelWindowDirection;
/**
* Determines if the Observer reacts to events that already have been processed by a DataInteractor.
* The default value is false.
*/
bool m_AlwaysReact;
/**
* Factor to adjust zooming speed.
*/
float m_ZoomFactor;
///// Members to deal with rotating slices
/**
* @brief m_LinkPlanes Determines if angle between crosshair remains fixed when rotating
*/
bool m_LinkPlanes;
typedef std::vector<SliceNavigationController*> SNCVector;
SNCVector m_RotatableSNCs; /// all SNCs that currently have CreatedWorldGeometries, that can be rotated.
SNCVector m_SNCsToBeRotated; /// all SNCs that will be rotated (exceptions are the ones parallel to the one being clicked)
Point3D m_LastCursorPosition; /// used for calculation of the rotation angle
Point3D m_CenterOfRotation; /// used for calculation of the rotation angle
Point2D m_ReferenceCursor;
Vector3D m_RotationPlaneNormal;
Vector3D m_RotationPlaneXVector;
Vector3D m_RotationPlaneYVector;
Vector3D m_PreviousRotationAxis;
ScalarType m_PreviousRotationAngle;
};
}
#endif
diff --git a/Modules/Core/include/mitkEnumerationProperty.h b/Modules/Core/include/mitkEnumerationProperty.h
index 40c8975f6e..251f1cce82 100644
--- a/Modules/Core/include/mitkEnumerationProperty.h
+++ b/Modules/Core/include/mitkEnumerationProperty.h
@@ -1,198 +1,198 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkEnumerationProperty_h
#define mitkEnumerationProperty_h
#include <mitkBaseProperty.h>
#include <map>
#include <string>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4522) // "multiple assignment operators specified"
#endif
namespace mitk
{
/**
* This class may be used to store properties similar to enumeration values.
* Each enumeration value is identified by an id and a name. Note that both
* name and id must be unique. Add enumeration values before you use the
* Get/SetValue methods.
*
* To use this class, create a subclass that adds the possible enumeration
* values in its constructor. You should override AddEnum() as protected so
* that the user isn't able to add invalid enumeration values.
*
* As example see mitk::VtkRepresentationProperty or
* mitk::VtkInterpolationProperty.
*
* @ingroup DataManagement
*/
class MITKCORE_EXPORT EnumerationProperty : public BaseProperty
{
public:
- mitkClassMacro(EnumerationProperty, BaseProperty)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(EnumerationProperty, BaseProperty);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* Represents the unique id which is assigned to each enumeration name.
*/
typedef unsigned int IdType;
/**
* Type used to store a mapping from enumeration id to enumeration name.
*/
typedef std::map<IdType, std::string> EnumIdsContainerType;
/**
* Type used to store a mapping from enumeration name to enumeration id.
*/
typedef std::map<std::string, IdType> EnumStringsContainerType;
/**
* Type used for iterators over all defined enumeration values.
*/
typedef EnumIdsContainerType::const_iterator EnumConstIterator;
/**
* Adds an enumeration value into the enumeration. The name and id provided
* must be unique. This is checked while adding the new enumeration value.
* If it is not unique, false is returned. If addition was successful, true
* is returned.
* @param name The unique name of the enumeration value
* @param id The unique id of the enumeration value
* @returns True, if the name/id combination was successfully added to the
* enumeration values. Otherwise false.
*/
virtual bool AddEnum(const std::string &name, const IdType &id);
/**
* Sets the current value of the enumeration.
* @param name The name of the enumeration value to set
* @returns True if the value was successfully set. Otherwise false.
*/
virtual bool SetValue(const std::string &name);
/**
* Sets the current value of the enumeration.
* @param id The id of the enumeration value to set
* @returns True, if the value was successfully set. Otherwise false.
*/
virtual bool SetValue(const IdType &id);
/**
* Returns the id of the current enumeration value. If it was not set so far,
* the return value is unspecified.
*/
virtual IdType GetValueAsId() const;
/**
* Returns the name of the current enumeration value. If it was not set so far,
* the return value is unspecified.
*/
std::string GetValueAsString() const override;
/**
* Clears all enumerations including the current one.
*/
virtual void Clear();
/**
* Determines the number of enumeration values.
*/
virtual EnumIdsContainerType::size_type Size() const;
/**
* Provides access to the set of enumeration values. The name can be
* accessed with iterator->second, the id via iterator->first.
* @returns An iterator over all enumeration values.
*/
virtual EnumConstIterator Begin() const;
/**
* Specifies the end of the range of enumeration values.
* @returns An iterator pointing past the last enumeration values.
*/
virtual EnumConstIterator End() const;
/**
* Returns the name for the given id.
* @param id The id for which the name should be determined.
* If the id is invalid, the return value is unspecified.
* @returns The name of the determined enumeration value.
*/
virtual std::string GetEnumString(const IdType &id) const;
/**
* Returns the id for the given name.
* @param name The enumeration name for which the id should be determined.
* If the name is invalid, the return value is unspecified.
* @returns The id of the determined enumeration value.
*/
virtual IdType GetEnumId(const std::string &name) const;
/**
* Determines if a given id is valid.
* @param id The id to check
* @returns True if the given id is valid. Otherwise false.
*/
virtual bool IsValidEnumerationValue(const IdType &id) const;
/**
* Determines if a given name is valid.
* @param name The name to check
* @returns True if the given name is valid. Otherwise false.
*/
virtual bool IsValidEnumerationValue(const std::string &name) const;
const EnumIdsContainerType &GetEnumIds() const;
const EnumStringsContainerType &GetEnumStrings() const;
EnumIdsContainerType &GetEnumIds();
EnumStringsContainerType &GetEnumStrings();
using BaseProperty::operator=;
EnumerationProperty & operator=(const EnumerationProperty &) = delete;
protected:
/**
* Default constructor. The current value of the enumeration is undefined.
*/
EnumerationProperty();
EnumerationProperty(const EnumerationProperty &);
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
- mitkCloneMacro(Self)
+ mitkCloneMacro(Self);
private:
IdType m_CurrentValue;
typedef std::map<std::string, EnumIdsContainerType> IdMapForClassNameContainerType;
typedef std::map<std::string, EnumStringsContainerType> StringMapForClassNameContainerType;
EnumIdsContainerType m_IdMap;
EnumStringsContainerType m_NameMap;
};
}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#endif
diff --git a/Modules/Core/include/mitkEventStateMachine.h b/Modules/Core/include/mitkEventStateMachine.h
index feea8c476f..bbceab973f 100644
--- a/Modules/Core/include/mitkEventStateMachine.h
+++ b/Modules/Core/include/mitkEventStateMachine.h
@@ -1,264 +1,264 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKEVENTSTATEMACHINE_H_
#define MITKEVENTSTATEMACHINE_H_
#include "itkObject.h"
#include "mitkCommon.h"
#include "mitkInteractionEventHandler.h"
#include "mitkMessage.h"
#include <MitkCoreExports.h>
#include <string>
/**
* Macro that can be used to connect a StateMachineAction with a function.
* It assumes that there is a typedef Classname Self in classes that use
* this macro, as is provided by e.g. mitkClassMacro
*/
#define CONNECT_FUNCTION(a, f) \
::mitk::EventStateMachine::AddActionFunction( \
a, \
::mitk::MessageDelegate2<Self, ::mitk::StateMachineAction *, ::mitk::InteractionEvent *, void>(this, &Self::f));
#define CONNECT_CONDITION(a, f) \
::mitk::EventStateMachine::AddConditionFunction( \
a, ::mitk::MessageDelegate1<Self, const ::mitk::InteractionEvent *, bool>(this, &Self::f));
namespace us
{
class Module;
}
namespace mitk
{
class StateMachineTransition;
class StateMachineContainer;
class StateMachineAction;
class StateMachineCondition;
class InteractionEvent;
class StateMachineState;
class DataNode;
class UndoController;
/**
* \class TActionFunctor
* \brief Base class of ActionFunctors, to provide an easy to connect actions with functions.
*
* \deprecatedSince{2013_03} Use mitk::Message classes instead.
*/
class TActionFunctor
{
public:
virtual bool DoAction(StateMachineAction *, InteractionEvent *) = 0;
virtual ~TActionFunctor() {}
};
///**
// * \class TSpecificActionFunctor
// * Specific implementation of ActionFunctor class, implements a reference to the function which is to be executed.
// It
// takes two arguments:
// * StateMachineAction - the action by which the function call is invoked, InteractionEvent - the event that caused
// the
// transition.
// */
// template<class T>
// class DEPRECATED() TSpecificActionFunctor : public TActionFunctor
//{
// public:
// TSpecificActionFunctor(T* object, bool (T::*memberFunctionPointer)(StateMachineAction*, InteractionEvent*)) :
// m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
// {
// }
// virtual ~TSpecificActionFunctor()
// {
// }
// virtual bool DoAction(StateMachineAction* action, InteractionEvent* event) override
// {
// return (*m_Object.*m_MemberFunctionPointer)(action, event);// executes member function
// }
// private:
// T* m_Object;
// bool (T::*m_MemberFunctionPointer)(StateMachineAction*, InteractionEvent*);
//};
/**
* \class EventStateMachine
*
* \brief Super-class that provides the functionality of a StateMachine to DataInteractors.
*
* A state machine is created by loading a state machine pattern. It consists of states, transitions and action.
* The state represent the current status of the interaction, transitions are means to switch between states. Each
* transition
* is triggered by an event and it is associated with actions that are to be executed when the state change is
* performed.
*
*/
class MITKCORE_EXPORT EventStateMachine : public mitk::InteractionEventHandler
{
public:
- mitkClassMacro(EventStateMachine, InteractionEventHandler)
+ mitkClassMacro(EventStateMachine, InteractionEventHandler);
typedef std::map<std::string, TActionFunctor *> DEPRECATED(ActionFunctionsMapType);
typedef itk::SmartPointer<StateMachineState> StateMachineStateType;
/**
* @brief Loads XML resource
*
* Loads a XML resource file from the given module.
* Default is the Mitk module (core).
* The files have to be placed in the Resources/Interaction folder of their respective module.
**/
bool LoadStateMachine(const std::string &filename, const us::Module *module = nullptr);
/**
* Receives Event from Dispatcher.
* Event is mapped using the EventConfig Object to a variant, then it is checked if the StateMachine is listening
* for
* such an Event. If this is the case, the transition to the next state it performed and all actions associated with
* the transition executed,
* and true is returned to the caller.
* If the StateMachine can't handle this event false is returned.
* Attention:
* If a transition is associated with multiple actions - "true" is returned if one action returns true,
* and the event is treated as HANDLED even though some actions might not have been executed! So be sure that all
* actions that occur within
* one transitions have the same conditions.
*/
bool HandleEvent(InteractionEvent *event, DataNode *dataNode);
/**
* @brief Enables or disabled Undo.
**/
void EnableUndo(bool enable) { m_UndoEnabled = enable; }
/**
* @brief Enables/disables the state machine. In un-enabled state it won't react to any events.
**/
void EnableInteraction(bool enable) { m_IsActive = enable; }
protected:
EventStateMachine();
~EventStateMachine() override;
typedef MessageAbstractDelegate2<StateMachineAction *, InteractionEvent *, void> ActionFunctionDelegate;
typedef MessageAbstractDelegate1<const InteractionEvent *, bool> ConditionFunctionDelegate;
/**
* Connects action from StateMachine (String in XML file) with a function that is called when this action is to be
* executed.
*/
DEPRECATED(void AddActionFunction(const std::string &action, TActionFunctor *functor));
void AddActionFunction(const std::string &action, const ActionFunctionDelegate &delegate);
void AddConditionFunction(const std::string &condition, const ConditionFunctionDelegate &delegate);
StateMachineState *GetCurrentState() const;
/**
* @brief ResetToStartState Reset state machine to it initial starting state.
*/
void ResetToStartState();
/**
* Is called after loading a statemachine.
* Overwrite this function in specific interactor implementations.
* Connect actions and functions using the CONNECT_FUNCTION macro within this function.
*/
virtual void ConnectActionsAndFunctions();
virtual bool CheckCondition(const StateMachineCondition &condition, const InteractionEvent *interactionEvent);
/**
* Looks up function that is associated with action and executes it.
* To implement your own execution scheme overwrite this in your DataInteractor.
*/
virtual void ExecuteAction(StateMachineAction *action, InteractionEvent *interactionEvent);
/**
* Implements filter scheme for events.
* Standard implementation accepts events from 2d and 3d windows,
* and rejects events if DataNode is not visible.
* \return true if event is accepted, else false
*
* Overwrite this function to adapt for your own needs, for example to filter out events from
* 3d windows like this:
\code
bool mitk::EventStateMachine::FilterEvents(InteractionEvent* interactionEvent, DataNode*dataNode)
{
return interactionEvent->GetSender()->GetMapperID() == BaseRenderer::Standard2D; // only 2D mappers
}
\endcode
* or to enforce that the interactor only reacts when the corresponding DataNode is selected in the DataManager
view..
*/
virtual bool FilterEvents(InteractionEvent *interactionEvent, DataNode *dataNode);
/** \brief Sets the specified mouse cursor.
*
* Use this in subclasses instead of using QmitkApplicationCursor directly.
*/
void SetMouseCursor(const char *xpm[], int hotspotX, int hotspotY);
/** \brief Resets the mouse cursor (if modified by the SlicesCoordinator)
* to its original state.
*
* Should be used by subclasses and from external application instead
* of using QmitkApplicationCursor directly to avoid conflicts. */
void ResetMouseCursor();
/**
* \brief Returns the executable transition for the given event.
*
* This method takes a list of transitions that correspond to the given
* event from the current state.
*
* This method iterates through all transitions and checks all
* corresponding conditions. The results of each condition in stored in
* map, as other transitions may need the same condition again.
*
* As soon as a transition is found for which all conditions are
* fulfilled, this instance is returned.
*
* If a transition has no condition, it is automatically returned.
* If no executable transition is found, nullptr is returned.
*/
StateMachineTransition *GetExecutableTransition(InteractionEvent *event);
// Determines if state machine reacts to events
bool m_IsActive;
// Undo/Redo
UndoController *m_UndoController;
bool m_UndoEnabled;
private:
typedef std::map<std::string, ActionFunctionDelegate *> ActionDelegatesMapType;
typedef std::map<std::string, ConditionFunctionDelegate *> ConditionDelegatesMapType;
StateMachineContainer
*m_StateMachineContainer; // storage of all states, action, transitions on which the statemachine operates.
std::map<std::string, TActionFunctor *> m_ActionFunctionsMap; // stores association between action string
ActionDelegatesMapType m_ActionDelegatesMap;
ConditionDelegatesMapType m_ConditionDelegatesMap;
StateMachineStateType m_CurrentState;
bool m_MouseCursorSet;
};
} /* namespace mitk */
#endif /* MITKEVENTSTATEMACHINE_H_ */
diff --git a/Modules/Core/include/mitkExtractSliceFilter.h b/Modules/Core/include/mitkExtractSliceFilter.h
index 3c1c4af499..d687c5dedb 100644
--- a/Modules/Core/include/mitkExtractSliceFilter.h
+++ b/Modules/Core/include/mitkExtractSliceFilter.h
@@ -1,204 +1,205 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkExtractSliceFilter_h_Included
#define mitkExtractSliceFilter_h_Included
#include "MitkCoreExports.h"
#include "mitkImageToImageFilter.h"
#include <vtkAbstractTransform.h>
#include <vtkImageData.h>
#include <vtkImageReslice.h>
#include <vtkMatrix4x4.h>
#include <vtkPoints.h>
#include <vtkSmartPointer.h>
#include <vtkTransform.h>
namespace mitk
{
/**
\brief ExtractSliceFilter extracts a 2D abitrary oriented slice from a 3D volume.
The filter can reslice in all orthogonal planes such as sagittal, coronal and axial,
and is also able to reslice an arbitrary oriented oblique plane.
Curved planes are specified via an AbstractTransformGeometry as the input worldgeometry.
Additionally the filter extracts the specified component of a multi-component input image.
This is done only if the caller requests an mitk::Image output ('m_VtkOutputRequested' set to false).
The default component to be extracted is '0'.
The convenient workflow is:
1. Set an image as input.
2. Set the worldPlaneGeometry. This defines a grid where the slice is being extracted
3. And then start the pipeline.
There are a few more properties that can be set to modify the behavior of the slicing.
The properties are:
- interpolation mode either Nearestneighbor, Linear or Cubic.
- a transform this is a convenient way to adapt the reslice axis for the case
that the image is transformed e.g. rotated.
- time step the time step in a times volume.
- the component to extract from a multi-component input image
- vtkoutputrequested, to define whether an mitk::image should be initialized
- resample by geometry whether the resampling grid corresponds to the specs of the
worldgeometry or is directly derived from the input image
By default the properties are set to:
- interpolation mode Nearestneighbor.
- a transform nullptr (No transform is set).
- time step 0.
- component 0.
- resample by geometry false (Corresponds to input image).
*/
class MITKCORE_EXPORT ExtractSliceFilter : public ImageToImageFilter
{
public:
mitkClassMacro(ExtractSliceFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
mitkNewMacro1Param(Self, vtkImageReslice *);
/** \brief Set the axis where to reslice at.*/
void SetWorldGeometry(const PlaneGeometry *geometry)
{
this->m_WorldGeometry = geometry;
this->Modified();
}
/** \brief Set the time step in the 4D volume */
void SetTimeStep(unsigned int timestep) { m_TimeStep = timestep; }
unsigned int GetTimeStep() { return m_TimeStep; }
/** \brief Set the component of an image to be extracted */
void SetComponent(unsigned int component) { m_Component = component; }
/** \brief Set a transform for the reslice axes.
* This transform is needed if the image volume itself is transformed. (Effects the reslice axis)
*/
void SetResliceTransformByGeometry(const BaseGeometry *transform) { this->m_ResliceTransform = transform; }
/** \brief Resampling grid corresponds to: false->image true->worldgeometry*/
void SetInPlaneResampleExtentByGeometry(bool inPlaneResampleExtentByGeometry)
{
this->m_InPlaneResampleExtentByGeometry = inPlaneResampleExtentByGeometry;
}
/** \brief Sets the output dimension of the slice*/
void SetOutputDimensionality(unsigned int dimension) { this->m_OutputDimension = dimension; }
/** \brief Set the spacing in z direction manually.
* Required if the outputDimension is > 2.
*/
void SetOutputSpacingZDirection(double zSpacing) { this->m_ZSpacing = zSpacing; }
/** \brief Set the extent in pixel for direction z manualy.
Required if the output dimension is > 2.
*/
void SetOutputExtentZDirection(int zMin, int zMax)
{
this->m_ZMin = zMin;
this->m_ZMax = zMax;
}
/** \brief Get the bounding box of the slice [xMin, xMax, yMin, yMax, zMin, zMax]
* The method uses the input of the filter to calculate the bounds.
* It is recommended to use
* GetClippedPlaneBounds(const BaseGeometry*, const PlaneGeometry*, double*)
* if you are not sure about the input.
*/
bool GetClippedPlaneBounds(double bounds[6]);
/** \brief Get the bounding box of the slice [xMin, xMax, yMin, yMax, zMin, zMax]*/
bool GetClippedPlaneBounds(const BaseGeometry *boundingGeometry,
const PlaneGeometry *planeGeometry,
double *bounds);
/** \brief Get the spacing of the slice. returns mitk::ScalarType[2] */
mitk::ScalarType *GetOutputSpacing();
/** \brief Get Output as vtkImageData.
* Note:
* SetVtkOutputRequest(true) has to be called at least once before
* GetVtkOutput(). Otherwise the output is empty for the first update step.
*/
vtkImageData *GetVtkOutput()
{
m_VtkOutputRequested = true;
return m_Reslicer->GetOutput();
}
/** Set VtkOutPutRequest to suppress the convertion of the image.
* It is suggested to use this with GetVtkOutput().
* Note:
* SetVtkOutputRequest(true) has to be called at least once before
* GetVtkOutput(). Otherwise the output is empty for the first update step.
*/
void SetVtkOutputRequest(bool isRequested) { m_VtkOutputRequested = isRequested; }
/** \brief Get the reslices axis matrix.
* Note: the axis are recalculated when calling SetResliceTransformByGeometry.
*/
vtkMatrix4x4 *GetResliceAxes() { return this->m_Reslicer->GetResliceAxes(); }
void SetBackgroundLevel(double backgroundLevel) { m_BackgroundLevel = backgroundLevel; }
enum ResliceInterpolation
{
RESLICE_NEAREST = 0,
RESLICE_LINEAR = 1,
RESLICE_CUBIC = 3
};
void SetInterpolationMode(ExtractSliceFilter::ResliceInterpolation interpolation)
{
this->m_InterpolationMode = interpolation;
}
protected:
ExtractSliceFilter(vtkImageReslice *reslicer = nullptr);
~ExtractSliceFilter() override;
void GenerateData() override;
void GenerateOutputInformation() override;
void GenerateInputRequestedRegion() override;
const PlaneGeometry *m_WorldGeometry;
vtkSmartPointer<vtkImageReslice> m_Reslicer;
unsigned int m_TimeStep;
unsigned int m_OutputDimension;
double m_ZSpacing;
int m_ZMin;
int m_ZMax;
ResliceInterpolation m_InterpolationMode;
bool m_InPlaneResampleExtentByGeometry; // Resampling grid corresponds to: false->image true->worldgeometry
mitk::ScalarType *m_OutPutSpacing;
bool m_VtkOutputRequested;
double m_BackgroundLevel;
unsigned int m_Component;
private:
BaseGeometry::ConstPointer m_ResliceTransform;
/* Axis vectors of the relevant geometry. Set in GenerateOutputInformation() and also used in GenerateData().*/
Vector3D m_Right, m_Bottom;
/* Bounds of the relevant plane. Set in GenerateOutputInformation() and also used in GenerateData().*/
int m_XMin, m_XMax, m_YMin, m_YMax;
};
}
#endif // mitkExtractSliceFilter_h_Included
diff --git a/Modules/Core/include/mitkExtractSliceFilter2.h b/Modules/Core/include/mitkExtractSliceFilter2.h
index 6483f02503..60303f435c 100644
--- a/Modules/Core/include/mitkExtractSliceFilter2.h
+++ b/Modules/Core/include/mitkExtractSliceFilter2.h
@@ -1,79 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkExtractSliceFilter2_h
#define mitkExtractSliceFilter2_h
#include <mitkImageToImageFilter.h>
#include <mitkPlaneGeometry.h>
#include <MitkCoreExports.h>
namespace mitk
{
/** \brief Extract an arbitrarily oriented 2-d image from a 3-d image.
*
* Use ExtractSliceFilter2::SetOutputGeometry to specify the orientation of
* the 2-d output image.
*
* If a pixel of the 2-d output image isn't located within the bounds of the
* 3-d input image, it is set to the lowest possible pixel value.
*
* Cubic interpolation is considerably slow on the first update for a newly
* set input image. Subsequent filter updates with cubic interpolation are
* faster by several orders of magnitude as long as the input image was
* neither changed nor modified.
*
* This filter is completely based on ITK compared to the VTK-based
* mitk::ExtractSliceFilter. It is more robust, easy to use, and produces
* an mitk::Image with valid geometry. Generally it is not as fast as
* mitk::ExtractSliceFilter, though.
*/
class MITKCORE_EXPORT ExtractSliceFilter2 final : public ImageToImageFilter
{
public:
enum Interpolator
{
NearestNeighbor,
Linear,
Cubic
};
- mitkClassMacro(ExtractSliceFilter2, ImageToImageFilter)
- itkFactorylessNewMacro(Self)
+ mitkClassMacro(ExtractSliceFilter2, ImageToImageFilter);
+
+ itkFactorylessNewMacro(Self);
void SetInput(const InputImageType* image) override;
void SetInput(unsigned int index, const InputImageType* image) override;
const PlaneGeometry* GetOutputGeometry() const;
void SetOutputGeometry(PlaneGeometry::Pointer outputGeometry);
Interpolator GetInterpolator() const;
void SetInterpolator(Interpolator interpolator);
private:
using Superclass::SetInput;
ExtractSliceFilter2();
~ExtractSliceFilter2() override;
void AllocateOutputs() override;
// void BeforeThreadedGenerateData() override;
// void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId) override;
void GenerateData() override;
void VerifyInputInformation() override;
struct Impl;
Impl* m_Impl;
};
}
#endif
diff --git a/Modules/Core/include/mitkFloatPropertyExtension.h b/Modules/Core/include/mitkFloatPropertyExtension.h
index 71847c7572..1bb84055ef 100644
--- a/Modules/Core/include/mitkFloatPropertyExtension.h
+++ b/Modules/Core/include/mitkFloatPropertyExtension.h
@@ -1,57 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkFloatPropertyExtension_h
#define mitkFloatPropertyExtension_h
#include <MitkCoreExports.h>
#include <mitkPropertyExtension.h>
namespace mitk
{
/** \brief Property extension for mitk::FloatProperty.
*
* The property view uses this extension to configure the corresponding property editor.
*/
class MITKCORE_EXPORT FloatPropertyExtension : public PropertyExtension
{
public:
mitkClassMacro(FloatPropertyExtension, PropertyExtension);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) mitkNewMacro2Param(Self, float, float);
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
+ mitkNewMacro2Param(Self, float, float);
mitkNewMacro3Param(Self, float, float, float);
mitkNewMacro4Param(Self, float, float, float, int);
int GetDecimals() const;
void SetDecimals(int decimals);
float GetMaximum() const;
void SetMaximum(float maximum);
float GetMinimum() const;
void SetMinimum(float minimum);
float GetSingleStep() const;
void SetSingleStep(float singleStep);
private:
FloatPropertyExtension();
FloatPropertyExtension(float minimum, float maximum, float singleStep = 0.1f, int decimals = 2);
~FloatPropertyExtension() override;
struct Impl;
Impl *m_Impl;
};
}
#endif
diff --git a/Modules/Core/include/mitkGenericProperty.h b/Modules/Core/include/mitkGenericProperty.h
index 49fc8426a3..a697ce579e 100644
--- a/Modules/Core/include/mitkGenericProperty.h
+++ b/Modules/Core/include/mitkGenericProperty.h
@@ -1,138 +1,142 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKGENERICPROPERTY_H_HEADER_INCLUDED_C1061CEE
#define MITKGENERICPROPERTY_H_HEADER_INCLUDED_C1061CEE
#include <sstream>
#include <cstdlib>
#include <string>
#include "mitkBaseProperty.h"
#include "mitkNumericTypes.h"
#include <MitkCoreExports.h>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/*!
@ brief Template class for generating properties for int, float, bool, etc.
This class template can be instantiated for all classes/internal types that fulfills
these requirements:
- an operator<< so that the properties value can be put into a std::stringstream
- an operator== so that two properties can be checked for equality
Note: you must use the macro mitkSpecializeGenericProperty to provide specializations
for concrete types (e.g. BoolProperty). Please see mitkProperties.h for examples. If you
don't use the mitkSpecializeGenericProperty Macro, GetNameOfClass() returns a wrong name.
*/
template <typename T>
class MITK_EXPORT GenericProperty : public BaseProperty
{
public:
mitkClassMacro(GenericProperty, BaseProperty);
mitkNewMacro1Param(GenericProperty<T>, T);
- itkCloneMacro(Self)
+ itkCloneMacro(Self);
typedef T ValueType;
itkSetMacro(Value, T);
itkGetConstMacro(Value, T);
std::string GetValueAsString() const override
{
std::stringstream myStr;
myStr << GetValue();
return myStr.str();
}
using BaseProperty::operator=;
protected:
GenericProperty() {}
GenericProperty(T x) : m_Value(x) {}
GenericProperty(const GenericProperty &other) : BaseProperty(other), m_Value(other.m_Value) {}
T m_Value;
private:
// purposely not implemented
GenericProperty &operator=(const GenericProperty &);
itk::LightObject::Pointer InternalClone() const override
{
itk::LightObject::Pointer result(new Self(*this));
result->UnRegister();
return result;
}
bool IsEqual(const BaseProperty &other) const override
{
return (this->m_Value == static_cast<const Self &>(other).m_Value);
}
bool Assign(const BaseProperty &other) override
{
this->m_Value = static_cast<const Self &>(other).m_Value;
return true;
}
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
/**
* Generates a specialized subclass of mitk::GenericProperty.
* This way, GetNameOfClass() returns the value provided by PropertyName.
* Please see mitkProperties.h for examples.
* @param PropertyName the name of the subclass of GenericProperty
* @param Type the value type of the GenericProperty
* @param Export the export macro for DLL usage
*/
#define mitkDeclareGenericProperty(PropertyName, Type, Export) \
\
class Export PropertyName : public GenericProperty<Type> \
\
{ \
public: \
- mitkClassMacro(PropertyName, GenericProperty<Type>) itkFactorylessNewMacro(Self) itkCloneMacro(Self) \
- mitkNewMacro1Param(PropertyName, Type) using BaseProperty::operator=; \
+ mitkClassMacro(PropertyName, GenericProperty<Type>); \
+ itkFactorylessNewMacro(Self); \
+ itkCloneMacro(Self); \
+ mitkNewMacro1Param(PropertyName, Type); \
+ \
+ using BaseProperty::operator=; \
\
protected: \
PropertyName(); \
PropertyName(const PropertyName &); \
PropertyName(Type x); \
\
private: \
itk::LightObject::Pointer InternalClone() const override; \
};
#define mitkDefineGenericProperty(PropertyName, Type, DefaultValue) \
mitk::PropertyName::PropertyName() : Superclass(DefaultValue) {} \
mitk::PropertyName::PropertyName(const PropertyName &other) : GenericProperty<Type>(other) {} \
mitk::PropertyName::PropertyName(Type x) : Superclass(x) {} \
itk::LightObject::Pointer mitk::PropertyName::InternalClone() const \
{ \
itk::LightObject::Pointer result(new Self(*this)); \
result->UnRegister(); \
return result; \
}
#endif /* MITKGENERICPROPERTY_H_HEADER_INCLUDED_C1061CEE */
diff --git a/Modules/Core/include/mitkGeometry3D.h b/Modules/Core/include/mitkGeometry3D.h
index 08a4e12a87..b342f6aa25 100644
--- a/Modules/Core/include/mitkGeometry3D.h
+++ b/Modules/Core/include/mitkGeometry3D.h
@@ -1,76 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef GEOMETRY3D_H_HEADER_INCLUDED_C1EBD0AD
#define GEOMETRY3D_H_HEADER_INCLUDED_C1EBD0AD
#include "mitkNumericTypes.h"
#include <MitkCoreExports.h>
#include <mitkCommon.h>
#include "itkScalableAffineTransform.h"
#include <itkIndex.h>
#include "mitkBaseGeometry.h"
class vtkLinearTransform;
namespace mitk
{
//##Documentation
//## @brief Standard implementation of BaseGeometry.
//##
//## @ingroup Geometry
class MITKCORE_EXPORT Geometry3D : public BaseGeometry
{
public:
- mitkClassMacro(Geometry3D, mitk::BaseGeometry)
+ mitkClassMacro(Geometry3D, mitk::BaseGeometry);
- typedef itk::QuaternionRigidTransform<ScalarType> QuaternionTransformType;
+ typedef itk::QuaternionRigidTransform<ScalarType> QuaternionTransformType;
typedef QuaternionTransformType::VnlQuaternionType VnlQuaternionType;
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) mitkNewMacro1Param(Self, const Self &)
+ itkFactorylessNewMacro(Self);
+ mitkNewMacro1Param(Self, const Self&);
- itkCloneMacro(Self)
- // itkGetConstReferenceMacro(TimeBounds, TimeBounds);
+ itkCloneMacro(Self);
+ // itkGetConstReferenceMacro(TimeBounds, TimeBounds);
- // virtual void SetTimeBounds(const TimeBounds& timebounds);
+ // virtual void SetTimeBounds(const TimeBounds& timebounds);
- protected : Geometry3D();
+ protected : Geometry3D();
Geometry3D(const Geometry3D &);
//##Documentation
//## @brief clones the geometry
//##
//## Overwrite in all sub-classes.
//## Normally looks like:
//## \code
//## Self::Pointer newGeometry = new Self(*this);
//## newGeometry->UnRegister();
//## return newGeometry.GetPointer();
//## \endcode
itk::LightObject::Pointer InternalClone() const override;
~Geometry3D() override;
//##Documentation
//## @brief PreSetSpacing
//##
//## These virtual function allows a different beahiour in subclasses.
//## Do implement them in every subclass of BaseGeometry. If not needed, use
//## {Superclass::PreSetSpacing();};
void PreSetSpacing(const mitk::Vector3D &aSpacing) override { Superclass::PreSetSpacing(aSpacing); };
};
} // namespace mitk
#endif /* GEOMETRY3D_H_HEADER_INCLUDED_C1EBD0AD */
diff --git a/Modules/Core/include/mitkGeometryData.h b/Modules/Core/include/mitkGeometryData.h
index 101657b784..7836829dee 100644
--- a/Modules/Core/include/mitkGeometryData.h
+++ b/Modules/Core/include/mitkGeometryData.h
@@ -1,66 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKGEOMETRYDATA_H_HEADER_INCLUDED_C19C01E2
#define MITKGEOMETRYDATA_H_HEADER_INCLUDED_C19C01E2
#include "mitkBaseData.h"
namespace mitk
{
//##Documentation
//## @brief Data class only having a BaseGeometry but not containing
//## any specific data.
//##
//## Only implements pipeline methods which are abstract in BaseData.
//## @ingroup Geometry
class MITKCORE_EXPORT GeometryData : public BaseData
{
public:
mitkClassMacro(GeometryData, BaseData);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
void UpdateOutputInformation() override;
void SetRequestedRegionToLargestPossibleRegion() override;
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
bool VerifyRequestedRegion() override;
void SetRequestedRegion(const itk::DataObject *data) override;
void CopyInformation(const itk::DataObject *data) override;
protected:
GeometryData();
~GeometryData() override;
};
/**
* @brief Equal Compare two GeometryData objects for equality, returns true if found equal.
* @ingroup MITKTestingAPI
* @param rightHandSide GeometryData to compare.
* @param leftHandSide GeometryData to compare.
* @param eps Epsilon to use for floating point comparison. Most of the time mitk::eps will be sufficient.
* @param verbose Flag indicating if the method should give a detailed console output.
* @return True if every comparison is true, false in any other case.
*/
MITKCORE_EXPORT bool Equal(const mitk::GeometryData &leftHandSide,
const mitk::GeometryData &rightHandSide,
mitk::ScalarType eps,
bool verbose);
} // namespace mitk
#endif /* MITKGEOMETRYDATA_H_HEADER_INCLUDED_C19C01E2 */
diff --git a/Modules/Core/include/mitkGradientBackground.h b/Modules/Core/include/mitkGradientBackground.h
index d095a03c3d..6ec83c793b 100644
--- a/Modules/Core/include/mitkGradientBackground.h
+++ b/Modules/Core/include/mitkGradientBackground.h
@@ -1,101 +1,103 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGradientBackground_h
#define mitkGradientBackground_h
#include <itkObject.h>
#include <mitkColorProperty.h>
#include <mitkCommon.h>
#include <vtkSmartPointer.h>
class vtkRenderer;
class vtkRenderWindow;
namespace mitk
{
class RenderWindow;
/**
* Displays a color gradient in the background
* of a vtkRenderWindow.
* The gradient ist faked by displaying a non-interactable
* smoothly shaded plane in a separate layer behind the
* scene. After setting the renderwindow, the gradient may be
* activated by calling Enable()
* @deprecatedSince{2015_05} not used in renderwindows
*/
class MITKCORE_EXPORT GradientBackground : public itk::Object
{
public:
mitkClassMacroItkParent(GradientBackground, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/**
* Sets the renderwindow, in which the gradient background
* will be shown. Make sure, you have called this function
* before calling Enable()
*/
virtual void SetRenderWindow(vtkSmartPointer<vtkRenderWindow> renderWindow);
/**
* Returns the vtkRenderWindow, which is used
* for displaying the gradient background
*/
virtual vtkSmartPointer<vtkRenderWindow> GetRenderWindow();
/**
* Returns the renderer responsible for
* rendering the color gradient into the
* vtkRenderWindow
*/
virtual vtkSmartPointer<vtkRenderer> GetVtkRenderer();
/**
* Sets the gradient colors. The gradient
* will smoothly fade from color1 to color2
*/
virtual void SetGradientColors(double r1, double g1, double b1, double r2, double g2, double b2);
virtual void SetGradientColors(Color upper, Color lower);
virtual void SetUpperColor(double r, double g, double b);
virtual void SetLowerColor(double r, double g, double b);
virtual void SetUpperColor(Color upper);
virtual void SetLowerColor(Color lower);
/**
* Enables drawing of the color gradient background.
* If you want to disable it, call the Disable() function.
*/
virtual void Enable();
/**
* Disables drawing of the color gradient background.
* If you want to enable it, call the Enable() function.
*/
virtual void Disable();
/**
* Checks, if the gradient background is currently
* enabled (visible)
*/
virtual bool IsEnabled();
protected:
GradientBackground();
~GradientBackground() override;
vtkSmartPointer<vtkRenderWindow> m_RenderWindow;
vtkSmartPointer<vtkRenderer> m_Renderer;
};
} // end of namespace mitk
#endif // mitkGradientBackground_h
diff --git a/Modules/Core/include/mitkGroupTagProperty.h b/Modules/Core/include/mitkGroupTagProperty.h
index b99b1dde8a..6128ef2050 100644
--- a/Modules/Core/include/mitkGroupTagProperty.h
+++ b/Modules/Core/include/mitkGroupTagProperty.h
@@ -1,61 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef GROUPTAGPROPERTY_H_HEADER_INCLUDED_C1F4DF54
#define GROUPTAGPROPERTY_H_HEADER_INCLUDED_C1F4DF54
#include <mitkBaseProperty.h>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/*! @brief Property class that has no value.
@ingroup DataManagement
The GroupTag property is used to tag a datatree node to show, that it is member of a
group of datatree nodes. This can be used to build groups of datatreenodes without the
need to contain them in a specific hiearchic order in the datatree
*/
class MITKCORE_EXPORT GroupTagProperty : public BaseProperty
{
public:
mitkClassMacro(GroupTagProperty, BaseProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
using BaseProperty::operator=;
protected:
GroupTagProperty();
GroupTagProperty(const GroupTagProperty &);
private:
// purposely not implemented
GroupTagProperty &operator=(const GroupTagProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
#endif /* GROUPTAGPROPERTY_H_HEADER_INCLUDED_C1F4DF54 */
diff --git a/Modules/Core/include/mitkHistogramGenerator.h b/Modules/Core/include/mitkHistogramGenerator.h
index 887582b65c..a771515891 100644
--- a/Modules/Core/include/mitkHistogramGenerator.h
+++ b/Modules/Core/include/mitkHistogramGenerator.h
@@ -1,55 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef HISTOGRAM_GENERATOR_H_HEADER_INCLUDED
#define HISTOGRAM_GENERATOR_H_HEADER_INCLUDED
#include "mitkImage.h"
#include <itkHistogram.h>
#include <itkImage.h>
#include <itkObject.h>
namespace mitk
{
//##Documentation
//## @brief Provides an easy way to calculate an itk::Histogram for a mitk::Image
//##
class MITKCORE_EXPORT HistogramGenerator : public itk::Object
{
public:
mitkClassMacroItkParent(HistogramGenerator, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) typedef itk::Statistics::Histogram<double> HistogramType;
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self) typedef itk::Statistics::Histogram<double> HistogramType;
itkSetMacro(Image, mitk::Image::ConstPointer);
itkSetMacro(Size, int);
itkGetConstMacro(Size, int);
itkGetConstObjectMacro(Histogram, HistogramType);
// TODO: calculate if needed in GetHistogram()
void ComputeHistogram();
float GetMaximumFrequency() const;
static float CalculateMaximumFrequency(const HistogramType *histogram);
protected:
HistogramGenerator();
~HistogramGenerator() override;
mitk::Image::ConstPointer m_Image;
int m_Size;
HistogramType::ConstPointer m_Histogram;
};
} // namespace mitk
#endif /* HISTOGRAM_GENERATOR_H_HEADER_INCLUDED */
diff --git a/Modules/Core/include/mitkITKImageImport.h b/Modules/Core/include/mitkITKImageImport.h
index d0d1643a73..3d408f9bc5 100644
--- a/Modules/Core/include/mitkITKImageImport.h
+++ b/Modules/Core/include/mitkITKImageImport.h
@@ -1,199 +1,201 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKITKIMAGEIMPORT_H_HEADER_INCLUDED_C1E4861D
#define MITKITKIMAGEIMPORT_H_HEADER_INCLUDED_C1E4861D
#include "itkImageToImageFilterDetail.h"
#include "mitkImageSource.h"
#include <MitkCoreExports.h>
namespace mitk
{
/**
* @brief Pipelined import of itk::Image
*
* The image data contained in the itk::Image is referenced,
* not copied.
* The easiest way of use is by the function
* mitk::ImportItkImage
* \code
* mitkImage = mitk::ImportItkImage(itkImage);
* \endcode
* \sa ImportItkImage
* @ingroup Adaptor
*/
template <class TInputImage>
class MITK_EXPORT ITKImageImport : public ImageSource
{
public:
- mitkClassMacro(ITKImageImport, ImageSource) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(ITKImageImport, ImageSource);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/// \brief The type of the input image.
typedef TInputImage InputImageType;
typedef typename InputImageType::Pointer InputImagePointer;
typedef typename InputImageType::ConstPointer InputImageConstPointer;
typedef typename InputImageType::RegionType InputImageRegionType;
typedef typename InputImageType::PixelType InputImagePixelType;
/** ImageDimension constants */
itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
itkStaticConstMacro(RegionDimension, unsigned int, mitk::SlicedData::RegionDimension);
/** \brief Set the input itk::Image of this image importer. */
InputImageType *GetInput(void);
/** \brief Set the input itk::Image of this image importer. */
void SetInput(const InputImageType *);
using itk::ProcessObject::SetInput;
/**
* \brief Set the Geometry of the result image (optional)
*
* The Geometry has to fit the dimension and size of
* the input image. The Geometry will be cloned, not
* referenced!
*
* Providing the Geometry is optional.
* The default behavior is to set the geometry by
* the itk::Image::GetDirection() information.
*/
void SetGeometry(const BaseGeometry *geometry);
protected:
ITKImageImport();
~ITKImageImport() override;
void GenerateOutputInformation() override;
void GenerateInputRequestedRegion() override;
void GenerateData() override;
void SetNthOutput(DataObjectPointerArraySizeType num, itk::DataObject *output) override;
/** Typedef for the region copier function object that converts an
* output region to an input region. */
typedef itk::ImageToImageFilterDetail::ImageRegionCopier<itkGetStaticConstMacro(InputImageDimension),
itkGetStaticConstMacro(RegionDimension)>
OutputToInputRegionCopierType;
BaseGeometry::Pointer m_Geometry;
};
/**
* @brief Imports an itk::Image (with a specific type) as an mitk::Image.
* @ingroup Adaptor
*
* Instantiates instance of ITKImageImport.
* mitk::ITKImageImport does not cast pixel types etc., it just imports
* image data. If you get a compile error, try image.GetPointer().
*
* \param update: if \a true, fill mitk::Image, which will execute the
* up-stream pipeline connected to the input itk::Image. Otherwise you
* need to make sure that Update() is called on the mitk::Image before
* its data is being used, e.g., by connecting it to an mitk-pipeline
* and call Update of a downstream filter at some time.
* \sa itk::Image::CastToMitkImage
*/
template <typename ItkOutputImageType>
Image::Pointer ImportItkImage(const itk::SmartPointer<ItkOutputImageType> &itkimage,
const BaseGeometry *geometry = nullptr,
bool update = true);
/**
* @brief Imports an itk::Image (with a specific type) as an mitk::Image.
* @ingroup Adaptor
*
* Instantiates instance of ITKImageImport
* mitk::ITKImageImport does not cast pixel types etc., it just imports
* image data. If you get a compile error, try image.GetPointer().
*
* \param update: if \a true, fill mitk::Image, which will execute the
* up-stream pipeline connected to the input itk::Image. Otherwise you
* need to make sure that Update() is called on the mitk::Image before
* its data is being used, e.g., by connecting it to an mitk-pipeline
* and call Update of a downstream filter at some time.
*
*
* \note If the source (itk image) and the target (mitk image) do not share the same scope, the
* mitk::GrabItkImageMemory
* function
* has to be used instead. Otherwise the image memory managed by the itk image is lost at a scope level change. This
* affects especially the
* usage in combination with AccessByItk macros as in following example code
*
* \snippet Testing/mitkGrabItkImageMemoryTest.cpp OutOfScopeCall
*
* which calls an ITK-like filter
*
* \snippet Testing/mitkGrabItkImageMemoryTest.cpp ItkThresholdFilter
*
*
* \sa itk::Image::CastToMitkImage
* \sa GrabItkImageMemory
*/
template <typename ItkOutputImageType>
Image::Pointer ImportItkImage(const ItkOutputImageType *itkimage,
const BaseGeometry *geometry = nullptr,
bool update = true);
/**
* @brief Grabs the memory of an itk::Image (with a specific type)
* and puts it into an mitk::Image.
* @ingroup Adaptor
*
* The memory is managed by the mitk::Image after calling this
* function. The itk::Image remains valid until the mitk::Image
* decides to free the memory.
* \param update: if \a true, fill mitk::Image, which will execute the
* up-stream pipeline connected to the input itk::Image. Otherwise you
* need to make sure that Update() is called on the mitk::Image before
* its data is being used, e.g., by connecting it to an mitk-pipeline
* and call Update of a downstream filter at some time.
* \sa ImportItkImage
*/
template <typename ItkOutputImageType>
Image::Pointer GrabItkImageMemory(itk::SmartPointer<ItkOutputImageType> &itkimage,
mitk::Image *mitkImage = nullptr,
const BaseGeometry *geometry = nullptr,
bool update = true);
/**
* @brief Grabs the memory of an itk::Image (with a specific type)
* and puts it into an mitk::Image.
* @ingroup Adaptor
*
* The memory is managed by the mitk::Image after calling this
* function. The itk::Image remains valid until the mitk::Image
* decides to free the memory.
* \param update: if \a true, fill mitk::Image, which will execute the
* up-stream pipeline connected to the input itk::Image. Otherwise you
* need to make sure that Update() is called on the mitk::Image before
* its data is being used, e.g., by connecting it to an mitk-pipeline
* and call Update of a downstream filter at some time.
* \sa ImportItkImage
*/
template <typename ItkOutputImageType>
Image::Pointer GrabItkImageMemory(ItkOutputImageType *itkimage,
mitk::Image *mitkImage = nullptr,
const BaseGeometry *geometry = nullptr,
bool update = true);
} // namespace mitk
#ifndef MITK_MANUAL_INSTANTIATION
#include "mitkITKImageImport.txx"
#endif
#endif /* MITKITKIMAGEIMPORT_H_HEADER_INCLUDED_C1E4861D */
diff --git a/Modules/Core/include/mitkImage.h b/Modules/Core/include/mitkImage.h
index d83961b625..cdbbe2b5a7 100644
--- a/Modules/Core/include/mitkImage.h
+++ b/Modules/Core/include/mitkImage.h
@@ -1,790 +1,792 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKIMAGE_H_HEADER_INCLUDED_C1C2FCD2
#define MITKIMAGE_H_HEADER_INCLUDED_C1C2FCD2
#include "mitkBaseData.h"
#include "mitkImageAccessorBase.h"
#include "mitkImageDataItem.h"
#include "mitkImageDescriptor.h"
#include "mitkImageVtkAccessor.h"
#include "mitkLevelWindow.h"
#include "mitkPlaneGeometry.h"
#include "mitkSlicedData.h"
#include <MitkCoreExports.h>
#include <mitkProportionalTimeGeometry.h>
// DEPRECATED
#include <mitkTimeSlicedGeometry.h>
#ifndef __itkHistogram_h
#include <itkHistogram.h>
#endif
class vtkImageData;
namespace itk
{
template <class T>
class MutexLockHolder;
}
namespace mitk
{
class SubImageSelector;
class ImageTimeSelector;
class ImageStatisticsHolder;
//##Documentation
//## @brief Image class for storing images
//##
//## Can be asked for header information, the data vector,
//## the mitkIpPicDescriptor struct or vtkImageData objects. If not the complete
//## data is required, the appropriate SubImageSelector class should be used
//## for access.
//## Image organizes sets of slices (s x 2D), volumes (t x 3D) and channels (n
//## x ND). Channels are for different kind of data, e.g., morphology in
//## channel 0, velocities in channel 1. All channels must have the same Geometry! In
//## particular, the dimensions of all channels are the same, only the pixel-type
//## may differ between channels.
//##
//## For importing ITK images use of mitk::ITKImageImport is recommended, see
//## \ref Adaptor.
//##
//## For ITK v3.8 and older: Converting coordinates from the ITK physical
//## coordinate system (which does not support rotated images) to the MITK world
//## coordinate system should be performed via the BaseGeometry of the Image, see
//## BaseGeometry::WorldToItkPhysicalPoint.
//##
//## For more information, see \ref MitkImagePage .
//## @ingroup Data
class MITKCORE_EXPORT Image : public SlicedData
{
friend class SubImageSelector;
friend class ImageAccessorBase;
friend class ImageVtkAccessor;
friend class ImageVtkReadAccessor;
friend class ImageVtkWriteAccessor;
friend class ImageReadAccessor;
friend class ImageWriteAccessor;
public:
mitkClassMacro(Image, SlicedData);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/** Smart Pointer type to a ImageDataItem. */
typedef itk::SmartPointer<ImageDataItem> ImageDataItemPointer;
typedef itk::Statistics::Histogram<double> HistogramType;
typedef mitk::ImageStatisticsHolder *StatisticsHolderPointer;
//## @param ImportMemoryManagementType This parameter is evaluated when setting new data to an image.
//## The different options are:
//## CopyMemory: Data to be set is copied and assigned to a new memory block. Data memory block will be freed on
// deletion of mitk::Image.
//## MamageMemory: Data to be set will be referenced, and Data memory block will be freed on deletion of
//mitk::Image.
//## Reference Memory: Data to be set will be referenced, but Data memory block will not be freed on deletion of
// mitk::Image.
//## DontManageMemory = ReferenceMemory.
enum ImportMemoryManagementType
{
CopyMemory,
ManageMemory,
ReferenceMemory,
DontManageMemory = ReferenceMemory
};
//##Documentation
//## @brief Vector container of SmartPointers to ImageDataItems;
//## Class is only for internal usage to allow convenient access to all slices over iterators;
//## See documentation of ImageDataItem for details.
typedef std::vector<ImageDataItemPointer> ImageDataItemPointerArray;
public:
//##Documentation
//## @brief Returns the PixelType of channel @a n.
const mitk::PixelType GetPixelType(int n = 0) const;
//##Documentation
//## @brief Get dimension of the image
//##
unsigned int GetDimension() const;
//##Documentation
//## @brief Get the size of dimension @a i (e.g., i=0 results in the number of pixels in x-direction).
//##
//## @sa GetDimensions()
unsigned int GetDimension(int i) const;
/** @brief Get the data vector of the complete image, i.e., of all channels linked together.
If you only want to access a slice, volume at a specific time or single channel
use one of the SubImageSelector classes.
\deprecatedSince{2012_09} Please use image accessors instead: See Doxygen/Related-Pages/Concepts/Image. This method
can be replaced by ImageWriteAccessor::GetData() or ImageReadAccessor::GetData() */
DEPRECATED(virtual void *GetData());
public:
/** @brief Get the pixel value at one specific index position.
The pixel type is always being converted to double.
\deprecatedSince{2012_09} Please use image accessors instead: See Doxygen/Related-Pages/Concepts/Image. This method
can be replaced by a method from ImagePixelWriteAccessor or ImagePixelReadAccessor */
DEPRECATED(double GetPixelValueByIndex(const itk::Index<3> &position,
unsigned int timestep = 0,
unsigned int component = 0));
/** @brief Get the pixel value at one specific world position.
The pixel type is always being converted to double.
Please consider using image accessors instead: See Doxygen/Related-Pages/Concepts/Image. This method
can be replaced by a templated method from ImagePixelWriteAccessor or ImagePixelReadAccessor */
double GetPixelValueByWorldCoordinate(const mitk::Point3D &position,
unsigned int timestep = 0,
unsigned int component = 0);
//##Documentation
//## @brief Get a volume at a specific time @a t of channel @a n as a vtkImageData.
virtual vtkImageData *GetVtkImageData(int t = 0, int n = 0);
virtual const vtkImageData *GetVtkImageData(int t = 0, int n = 0) const;
//##Documentation
//## @brief Get the complete image, i.e., all channels linked together, as a @a mitkIpPicDescriptor.
//##
//## If you only want to access a slice, volume at a specific time or single channel
//## use one of the SubImageSelector classes.
// virtual mitkIpPicDescriptor* GetPic();
//##Documentation
//## @brief Check whether slice @a s at time @a t in channel @a n is set
bool IsSliceSet(int s = 0, int t = 0, int n = 0) const override;
//##Documentation
//## @brief Check whether volume at time @a t in channel @a n is set
bool IsVolumeSet(int t = 0, int n = 0) const override;
//##Documentation
//## @brief Check whether the channel @a n is set
bool IsChannelSet(int n = 0) const override;
//##Documentation
//## @brief Set @a data as slice @a s at time @a t in channel @a n. It is in
//## the responsibility of the caller to ensure that the data vector @a data
//## is really a slice (at least is not smaller than a slice), since there is
//## no chance to check this.
//##
//## The data is copied to an array managed by the image. If the image shall
//## reference the data, use SetImportSlice with ImportMemoryManagementType
//## set to ReferenceMemory. For importing ITK images use of mitk::
//## ITKImageImport is recommended.
//## @sa SetPicSlice, SetImportSlice, SetImportVolume
virtual bool SetSlice(const void *data, int s = 0, int t = 0, int n = 0);
//##Documentation
//## @brief Set @a data as volume at time @a t in channel @a n. It is in
//## the responsibility of the caller to ensure that the data vector @a data
//## is really a volume (at least is not smaller than a volume), since there is
//## no chance to check this.
//##
//## The data is copied to an array managed by the image. If the image shall
//## reference the data, use SetImportVolume with ImportMemoryManagementType
//## set to ReferenceMemory. For importing ITK images use of mitk::
//## ITKImageImport is recommended.
//## @sa SetPicVolume, SetImportVolume
virtual bool SetVolume(const void *data, int t = 0, int n = 0);
//##Documentation
//## @brief Set @a data in channel @a n. It is in
//## the responsibility of the caller to ensure that the data vector @a data
//## is really a channel (at least is not smaller than a channel), since there is
//## no chance to check this.
//##
//## The data is copied to an array managed by the image. If the image shall
//## reference the data, use SetImportChannel with ImportMemoryManagementType
//## set to ReferenceMemory. For importing ITK images use of mitk::
//## ITKImageImport is recommended.
//## @sa SetPicChannel, SetImportChannel
virtual bool SetChannel(const void *data, int n = 0);
//##Documentation
//## @brief Set @a data as slice @a s at time @a t in channel @a n. It is in
//## the responsibility of the caller to ensure that the data vector @a data
//## is really a slice (at least is not smaller than a slice), since there is
//## no chance to check this.
//##
//## The data is managed according to the parameter \a importMemoryManagement.
//## @sa SetPicSlice
virtual bool SetImportSlice(
void *data, int s = 0, int t = 0, int n = 0, ImportMemoryManagementType importMemoryManagement = CopyMemory);
//##Documentation
//## @brief Set @a data as volume at time @a t in channel @a n. It is in
//## the responsibility of the caller to ensure that the data vector @a data
//## is really a volume (at least is not smaller than a volume), since there is
//## no chance to check this.
//##
//## The data is managed according to the parameter \a importMemoryManagement.
//## @sa SetPicVolume
virtual bool SetImportVolume(void *data,
int t = 0,
int n = 0,
ImportMemoryManagementType importMemoryManagement = CopyMemory);
virtual bool SetImportVolume(const void *const_data, int t = 0, int n = 0);
//##Documentation
//## @brief Set @a data in channel @a n. It is in
//## the responsibility of the caller to ensure that the data vector @a data
//## is really a channel (at least is not smaller than a channel), since there is
//## no chance to check this.
//##
//## The data is managed according to the parameter \a importMemoryManagement.
//## @sa SetPicChannel
virtual bool SetImportChannel(void *data,
int n = 0,
ImportMemoryManagementType importMemoryManagement = CopyMemory);
//##Documentation
//## initialize new (or re-initialize) image information
//## @warning Initialize() by pic assumes a plane, evenly spaced geometry starting at (0,0,0).
virtual void Initialize(const mitk::PixelType &type,
unsigned int dimension,
const unsigned int *dimensions,
unsigned int channels = 1);
//##Documentation
//## initialize new (or re-initialize) image information by a BaseGeometry
//##
//## @param tDim defines the number of time steps for which the Image should be initialized
virtual void Initialize(const mitk::PixelType &type,
const mitk::BaseGeometry &geometry,
unsigned int channels = 1,
int tDim = 1);
/**
* initialize new (or re-initialize) image information by a TimeGeometry
*
* @param tDim defines the number of time steps for which the Image should be initialized
* \deprecatedSince{2013_09} Please use TimeGeometry instead of TimeSlicedGeometry. For more information see
* http://www.mitk.org/Development/Refactoring%20of%20the%20Geometry%20Classes%20-%20Part%201
*/
DEPRECATED(virtual void Initialize(const mitk::PixelType & /*type*/,
const mitk::TimeSlicedGeometry * /*geometry*/,
unsigned int /*channels = 1*/,
int /*tDim=1*/))
{
}
/**
* \brief Initialize new (or re-initialize) image information by a TimeGeometry
*
* \param tDim override time dimension if the value is bigger than 0 (Default -1)
*/
virtual void Initialize(const mitk::PixelType &type,
const mitk::TimeGeometry &geometry,
unsigned int channels = 1,
int tDim = -1);
//##Documentation
//## initialize new (or re-initialize) image information by a PlaneGeometry and number of slices
//##
//## Initializes the bounding box according to the width/height of the
//## PlaneGeometry and @a sDim via SlicedGeometry3D::InitializeEvenlySpaced.
//## The spacing is calculated from the PlaneGeometry.
//## \sa SlicedGeometry3D::InitializeEvenlySpaced
//## \deprecatedSince{2016_11} Use a left-handed or right-handed PlaneGeometry to define the
//## direction of the image stack instead of the flipped parameter
DEPRECATED(virtual void Initialize(const mitk::PixelType &type,
int sDim,
const mitk::PlaneGeometry &geometry2d,
bool flipped,
unsigned int channels = 1,
int tDim = 1));
virtual void Initialize(const mitk::PixelType &type,
int sDim,
const mitk::PlaneGeometry &geometry2d,
unsigned int channels = 1,
int tDim = 1);
//##Documentation
//## initialize new (or re-initialize) image information by another
//## mitk-image.
//## Only the header is used, not the data vector!
//##
virtual void Initialize(const mitk::Image *image);
virtual void Initialize(const mitk::ImageDescriptor::Pointer inDesc);
//##Documentation
//## initialize new (or re-initialize) image information by @a pic.
//## Dimensions and @a Geometry3D /@a PlaneGeometry are set according
//## to the tags in @a pic.
//## Only the header is used, not the data vector! Use SetPicVolume(pic)
//## to set the data vector.
//##
//## @param tDim override time dimension (@a n[3]) in @a pic (if >0)
//## @param sDim override z-space dimension (@a n[2]) in @a pic (if >0)
//## @warning Initialize() by pic assumes a plane, evenly spaced geometry starting at (0,0,0).
// virtual void Initialize(const mitkIpPicDescriptor* pic, int channels = 1, int tDim = -1, int sDim = -1);
//##Documentation
//## initialize new (or re-initialize) image information by @a vtkimagedata,
//## a vtk-image.
//## Only the header is used, not the data vector! Use
//## SetVolume(vtkimage->GetScalarPointer()) to set the data vector.
//##
//## @param tDim override time dimension in @a vtkimagedata (if >0 and <)
//## @param sDim override z-space dimension in @a vtkimagedata (if >0 and <)
//## @param pDim override y-space dimension in @a vtkimagedata (if >0 and <)
virtual void Initialize(vtkImageData *vtkimagedata, int channels = 1, int tDim = -1, int sDim = -1, int pDim = -1);
//##Documentation
//## initialize new (or re-initialize) image information by @a itkimage,
//## a templated itk-image.
//## Only the header is used, not the data vector! Use
//## SetVolume(itkimage->GetBufferPointer()) to set the data vector.
//##
//## @param tDim override time dimension in @a itkimage (if >0 and <)
//## @param sDim override z-space dimension in @a itkimage (if >0 and <)
template <typename itkImageType>
void InitializeByItk(const itkImageType *itkimage, int channels = 1, int tDim = -1, int sDim = -1)
{
if (itkimage == nullptr)
return;
MITK_DEBUG << "Initializing MITK image from ITK image.";
// build array with dimensions in each direction with at least 4 entries
m_Dimension = itkimage->GetImageDimension();
unsigned int i, *tmpDimensions = new unsigned int[m_Dimension > 4 ? m_Dimension : 4];
for (i = 0; i < m_Dimension; ++i)
tmpDimensions[i] = itkimage->GetLargestPossibleRegion().GetSize().GetSize()[i];
if (m_Dimension < 4)
{
unsigned int *p;
for (i = 0, p = tmpDimensions + m_Dimension; i < 4 - m_Dimension; ++i, ++p)
*p = 1;
}
// overwrite number of slices if sDim is set
if ((m_Dimension > 2) && (sDim >= 0))
tmpDimensions[2] = sDim;
// overwrite number of time points if tDim is set
if ((m_Dimension > 3) && (tDim >= 0))
tmpDimensions[3] = tDim;
// rough initialization of Image
// mitk::PixelType importType = ImportItkPixelType( itkimage::PixelType );
Initialize(
MakePixelType<itkImageType>(itkimage->GetNumberOfComponentsPerPixel()), m_Dimension, tmpDimensions, channels);
const typename itkImageType::SpacingType &itkspacing = itkimage->GetSpacing();
MITK_DEBUG << "ITK spacing " << itkspacing;
// access spacing of itk::Image
Vector3D spacing;
FillVector3D(spacing, itkspacing[0], 1.0, 1.0);
if (m_Dimension >= 2)
spacing[1] = itkspacing[1];
if (m_Dimension >= 3)
spacing[2] = itkspacing[2];
// access origin of itk::Image
Point3D origin;
const typename itkImageType::PointType &itkorigin = itkimage->GetOrigin();
MITK_DEBUG << "ITK origin " << itkorigin;
FillVector3D(origin, itkorigin[0], 0.0, 0.0);
if (m_Dimension >= 2)
origin[1] = itkorigin[1];
if (m_Dimension >= 3)
origin[2] = itkorigin[2];
// access direction of itk::Imagm_PixelType = new mitk::PixelType(type);e and include spacing
const typename itkImageType::DirectionType &itkdirection = itkimage->GetDirection();
MITK_DEBUG << "ITK direction " << itkdirection;
mitk::Matrix3D matrix;
matrix.SetIdentity();
unsigned int j, itkDimMax3 = (m_Dimension >= 3 ? 3 : m_Dimension);
// check if spacing has no zero entry and itkdirection has no zero columns
bool itkdirectionOk = true;
mitk::ScalarType columnSum;
for (j = 0; j < itkDimMax3; ++j)
{
columnSum = 0.0;
for (i = 0; i < itkDimMax3; ++i)
{
columnSum += fabs(itkdirection[i][j]);
}
if (columnSum < mitk::eps)
{
itkdirectionOk = false;
}
if ((spacing[j] < -mitk::eps) // (normally sized) negative value
&&
(j == 2) && (m_Dimensions[2] == 1))
{
// Negative spacings can occur when reading single DICOM slices with ITK via GDCMIO
// In these cases spacing is not determind by ITK correctly (because it distinguishes correctly
// between slice thickness and inter slice distance -- slice distance is meaningless for
// single slices).
// I experienced that ITK produced something meaningful nonetheless because is is
// evaluating the tag "(0018,0088) Spacing between slices" as a fallback. This tag is not
// reliable (http://www.itk.org/pipermail/insight-users/2005-September/014711.html)
// but gives at least a hint.
// In real world cases I experienced that this tag contained the correct inter slice distance
// with a negative sign, so we just invert such negative spacings.
MITK_WARN << "Illegal value of itk::Image::GetSpacing()[" << j << "]=" << spacing[j]
<< ". Using inverted value " << -spacing[j];
spacing[j] = -spacing[j];
}
else if (spacing[j] < mitk::eps) // value near zero
{
MITK_ERROR << "Illegal value of itk::Image::GetSpacing()[" << j << "]=" << spacing[j]
<< ". Using 1.0 instead.";
spacing[j] = 1.0;
}
}
if (itkdirectionOk == false)
{
MITK_ERROR << "Illegal matrix returned by itk::Image::GetDirection():" << itkdirection
<< " Using identity instead.";
for (i = 0; i < itkDimMax3; ++i)
for (j = 0; j < itkDimMax3; ++j)
if (i == j)
matrix[i][j] = spacing[j];
else
matrix[i][j] = 0.0;
}
else
{
for (i = 0; i < itkDimMax3; ++i)
for (j = 0; j < itkDimMax3; ++j)
matrix[i][j] = itkdirection[i][j] * spacing[j];
}
// re-initialize PlaneGeometry with origin and direction
PlaneGeometry *planeGeometry = static_cast<PlaneGeometry *>(GetSlicedGeometry(0)->GetPlaneGeometry(0));
planeGeometry->SetOrigin(origin);
planeGeometry->GetIndexToWorldTransform()->SetMatrix(matrix);
// re-initialize SlicedGeometry3D
SlicedGeometry3D *slicedGeometry = GetSlicedGeometry(0);
slicedGeometry->InitializeEvenlySpaced(planeGeometry, m_Dimensions[2]);
slicedGeometry->SetSpacing(spacing);
// re-initialize TimeGeometry
ProportionalTimeGeometry::Pointer timeGeometry = ProportionalTimeGeometry::New();
timeGeometry->Initialize(slicedGeometry, m_Dimensions[3]);
SetTimeGeometry(timeGeometry);
// clean-up
delete[] tmpDimensions;
this->Initialize();
}
//##Documentation
//## @brief Check whether slice @a s at time @a t in channel @a n is valid, i.e.,
//## is (or can be) inside of the image
virtual bool IsValidSlice(int s = 0, int t = 0, int n = 0) const;
//##Documentation
//## @brief Check whether volume at time @a t in channel @a n is valid, i.e.,
//## is (or can be) inside of the image
virtual bool IsValidVolume(int t = 0, int n = 0) const;
//##Documentation
//## @brief Check whether the channel @a n is valid, i.e.,
//## is (or can be) inside of the image
virtual bool IsValidChannel(int n = 0) const;
//##Documentation
//## @brief Returns true if an image is rotated, i.e. its geometry's
//## transformation matrix has nonzero elements besides the diagonal.
//## Non-diagonal elements are checked if larger then 1/1000 of the matrix' trace.
bool IsRotated() const;
//##Documentation
//## @brief Get the sizes of all dimensions as an integer-array.
//##
//## @sa GetDimension(int i);
unsigned int *GetDimensions() const;
ImageDescriptor::Pointer GetImageDescriptor() const { return m_ImageDescriptor; }
ChannelDescriptor GetChannelDescriptor(int id = 0) const { return m_ImageDescriptor->GetChannelDescriptor(id); }
/** \brief Sets a geometry to an image.
*/
void SetGeometry(BaseGeometry *aGeometry3D) override;
/**
* @warning for internal use only
*/
virtual ImageDataItemPointer GetSliceData(int s = 0,
int t = 0,
int n = 0,
void *data = nullptr,
ImportMemoryManagementType importMemoryManagement = CopyMemory) const;
/**
* @warning for internal use only
*/
virtual ImageDataItemPointer GetVolumeData(int t = 0,
int n = 0,
void *data = nullptr,
ImportMemoryManagementType importMemoryManagement = CopyMemory) const;
/**
* @warning for internal use only
*/
virtual ImageDataItemPointer GetChannelData(int n = 0,
void *data = nullptr,
ImportMemoryManagementType importMemoryManagement = CopyMemory) const;
/**
\brief (DEPRECATED) Get the minimum for scalar images
*/
DEPRECATED(ScalarType GetScalarValueMin(int t = 0) const);
/**
\brief (DEPRECATED) Get the maximum for scalar images
\warning This method is deprecated and will not be available in the future. Use the \a GetStatistics instead
*/
DEPRECATED(ScalarType GetScalarValueMax(int t = 0) const);
/**
\brief (DEPRECATED) Get the second smallest value for scalar images
\warning This method is deprecated and will not be available in the future. Use the \a GetStatistics instead
*/
DEPRECATED(ScalarType GetScalarValue2ndMin(int t = 0) const);
/**
\brief (DEPRECATED) Get the smallest value for scalar images, but do not recompute it first
\warning This method is deprecated and will not be available in the future. Use the \a GetStatistics instead
*/
DEPRECATED(ScalarType GetScalarValueMinNoRecompute(unsigned int t = 0) const);
/**
\brief (DEPRECATED) Get the second smallest value for scalar images, but do not recompute it first
\warning This method is deprecated and will not be available in the future. Use the \a GetStatistics instead
*/
DEPRECATED(ScalarType GetScalarValue2ndMinNoRecompute(unsigned int t = 0) const);
/**
\brief (DEPRECATED) Get the second largest value for scalar images
\warning This method is deprecated and will not be available in the future. Use the \a GetStatistics instead
*/
DEPRECATED(ScalarType GetScalarValue2ndMax(int t = 0) const);
/**
\brief (DEPRECATED) Get the largest value for scalar images, but do not recompute it first
\warning This method is deprecated and will not be available in the future. Use the \a GetStatistics instead
*/
DEPRECATED(ScalarType GetScalarValueMaxNoRecompute(unsigned int t = 0) const);
/**
\brief (DEPRECATED) Get the second largest value for scalar images, but do not recompute it first
\warning This method is deprecated and will not be available in the future. Use the \a GetStatistics instead
*/
DEPRECATED(ScalarType GetScalarValue2ndMaxNoRecompute(unsigned int t = 0) const);
/**
\brief (DEPRECATED) Get the count of voxels with the smallest scalar value in the dataset
\warning This method is deprecated and will not be available in the future. Use the \a GetStatistics instead
*/
DEPRECATED(ScalarType GetCountOfMinValuedVoxels(int t = 0) const);
/**
\brief (DEPRECATED) Get the count of voxels with the largest scalar value in the dataset
\warning This method is deprecated and will not be available in the future. Use the \a GetStatistics instead
*/
DEPRECATED(ScalarType GetCountOfMaxValuedVoxels(int t = 0) const);
/**
\brief (DEPRECATED) Get the count of voxels with the largest scalar value in the dataset
\warning This method is deprecated and will not be available in the future. Use the \a GetStatistics instead
*/
DEPRECATED(unsigned int GetCountOfMaxValuedVoxelsNoRecompute(unsigned int t = 0) const);
/**
\brief (DEPRECATED) Get the count of voxels with the smallest scalar value in the dataset
\warning This method is deprecated and will not be available in the future. Use the \a GetStatistics instead
*/
DEPRECATED(unsigned int GetCountOfMinValuedVoxelsNoRecompute(unsigned int t = 0) const);
/**
\brief Returns a pointer to the ImageStatisticsHolder object that holds all statistics information for the image.
All Get-methods for statistics properties formerly accessible directly from an Image object are now moved to the
new \a ImageStatisticsHolder object.
*/
StatisticsHolderPointer GetStatistics() const { return m_ImageStatistics; }
protected:
mitkCloneMacro(Self);
typedef itk::MutexLockHolder<itk::SimpleFastMutexLock> MutexHolder;
int GetSliceIndex(int s = 0, int t = 0, int n = 0) const;
int GetVolumeIndex(int t = 0, int n = 0) const;
void ComputeOffsetTable();
virtual bool IsValidTimeStep(int t) const;
void Expand(unsigned int timeSteps) override;
virtual ImageDataItemPointer AllocateSliceData(
int s = 0,
int t = 0,
int n = 0,
void *data = nullptr,
ImportMemoryManagementType importMemoryManagement = CopyMemory) const;
virtual ImageDataItemPointer AllocateVolumeData(
int t = 0, int n = 0, void *data = nullptr, ImportMemoryManagementType importMemoryManagement = CopyMemory) const;
virtual ImageDataItemPointer AllocateChannelData(
int n = 0, void *data = nullptr, ImportMemoryManagementType importMemoryManagement = CopyMemory) const;
Image();
Image(const Image &other);
~Image() override;
void Clear() override;
//## @warning Has to be called by every Initialize method!
void Initialize() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
mutable ImageDataItemPointerArray m_Channels;
mutable ImageDataItemPointerArray m_Volumes;
mutable ImageDataItemPointerArray m_Slices;
mutable itk::SimpleFastMutexLock m_ImageDataArraysLock;
unsigned int m_Dimension;
unsigned int *m_Dimensions;
ImageDescriptor::Pointer m_ImageDescriptor;
size_t *m_OffsetTable;
ImageDataItemPointer m_CompleteData;
// Image statistics Holder replaces the former implementation directly inside this class
friend class ImageStatisticsHolder;
StatisticsHolderPointer m_ImageStatistics;
private:
ImageDataItemPointer GetSliceData_unlocked(
int s, int t, int n, void *data, ImportMemoryManagementType importMemoryManagement) const;
ImageDataItemPointer GetVolumeData_unlocked(int t,
int n,
void *data,
ImportMemoryManagementType importMemoryManagement) const;
ImageDataItemPointer GetChannelData_unlocked(int n,
void *data,
ImportMemoryManagementType importMemoryManagement) const;
ImageDataItemPointer AllocateSliceData_unlocked(
int s, int t, int n, void *data, ImportMemoryManagementType importMemoryManagement) const;
ImageDataItemPointer AllocateVolumeData_unlocked(int t,
int n,
void *data,
ImportMemoryManagementType importMemoryManagement) const;
ImageDataItemPointer AllocateChannelData_unlocked(int n,
void *data,
ImportMemoryManagementType importMemoryManagement) const;
bool IsSliceSet_unlocked(int s, int t, int n) const;
bool IsVolumeSet_unlocked(int t, int n) const;
bool IsChannelSet_unlocked(int n) const;
/** Stores all existing ImageReadAccessors */
mutable std::vector<ImageAccessorBase *> m_Readers;
/** Stores all existing ImageWriteAccessors */
mutable std::vector<ImageAccessorBase *> m_Writers;
/** Stores all existing ImageVtkAccessors */
mutable std::vector<ImageAccessorBase *> m_VtkReaders;
/** A mutex, which needs to be locked to manage m_Readers and m_Writers */
itk::SimpleFastMutexLock m_ReadWriteLock;
/** A mutex, which needs to be locked to manage m_VtkReaders */
itk::SimpleFastMutexLock m_VtkReadersLock;
};
/**
* @brief Equal A function comparing two images for beeing equal in meta- and imagedata
* @warning This method is deprecated and will not be available in the future. Use the \a bool mitk::Equal(const
* mitk::Image& i1, const mitk::Image& i2) instead.
*
* @ingroup MITKTestingAPI
*
* Following aspects are tested for equality:
* - dimension of the images
* - size of the images
* - pixel type
* - pixel values : pixel values are expected to be identical at each position ( for other options see
* mitk::CompareImageFilter )
*
* @param rightHandSide An image to be compared
* @param leftHandSide An image to be compared
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return true, if all subsequent comparisons are true, false otherwise
*/
DEPRECATED(MITKCORE_EXPORT bool Equal(
const mitk::Image *leftHandSide, const mitk::Image *rightHandSide, ScalarType eps, bool verbose));
/**
* @brief Equal A function comparing two images for beeing equal in meta- and imagedata
*
* @ingroup MITKTestingAPI
*
* Following aspects are tested for equality:
* - dimension of the images
* - size of the images
* - pixel type
* - pixel values : pixel values are expected to be identical at each position ( for other options see
* mitk::CompareImageFilter )
*
* @param rightHandSide An image to be compared
* @param leftHandSide An image to be compared
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return true, if all subsequent comparisons are true, false otherwise
*/
MITKCORE_EXPORT bool Equal(const mitk::Image &leftHandSide,
const mitk::Image &rightHandSide,
ScalarType eps,
bool verbose);
} // namespace mitk
#endif /* MITKIMAGE_H_HEADER_INCLUDED_C1C2FCD2 */
diff --git a/Modules/Core/include/mitkImageChannelSelector.h b/Modules/Core/include/mitkImageChannelSelector.h
index 9d0845b1bb..ae721b6b62 100644
--- a/Modules/Core/include/mitkImageChannelSelector.h
+++ b/Modules/Core/include/mitkImageChannelSelector.h
@@ -1,53 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef IMAGECHANNELSELECTOR_H_HEADER_INCLUDED_C1E4F4E7
#define IMAGECHANNELSELECTOR_H_HEADER_INCLUDED_C1E4F4E7
#include "mitkSubImageSelector.h"
#include <MitkCoreExports.h>
namespace mitk
{
//##Documentation
//## @brief Provides access to a channel of the input image
//##
//## If the input is generated by a ProcessObject, only the required data is
//## requested.
//## @ingroup Process
class MITKCORE_EXPORT ImageChannelSelector : public SubImageSelector
{
public:
mitkClassMacro(ImageChannelSelector, SubImageSelector);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
- itkGetConstMacro(ChannelNr, int);
+ itkCloneMacro(Self);
+
+ itkGetConstMacro(ChannelNr, int);
itkSetMacro(ChannelNr, int);
protected:
ImageChannelSelector();
~ImageChannelSelector() override;
void GenerateOutputInformation() override;
void GenerateInputRequestedRegion() override;
void GenerateData() override;
int m_ChannelNr;
};
} // namespace mitk
#endif /* IMAGECHANNELSELECTOR_H_HEADER_INCLUDED_C1E4F4E7 */
diff --git a/Modules/Core/include/mitkImageDescriptor.h b/Modules/Core/include/mitkImageDescriptor.h
index d0399aca58..48986781eb 100644
--- a/Modules/Core/include/mitkImageDescriptor.h
+++ b/Modules/Core/include/mitkImageDescriptor.h
@@ -1,120 +1,122 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKIMAGEDESCRIPTOR_H
#define MITKIMAGEDESCRIPTOR_H
#include <itkObjectFactory.h>
#include <string>
#include <vector>
#include "mitkChannelDescriptor.h"
#include "mitkCommon.h"
/// Defines the maximum of 8 dimensions per image channel taken from ipPicDescriptor
#define MAX_IMAGE_DIMENSIONS 8
namespace mitk
{
/** \brief An object to hold all essential information about an Image object
The ImageDescriptor holds an std::vector of pointers to ChannelDescriptor together with the
information about the image's dimensions. The general assumption ist, that each channel of an image
has to have the same geometry.
\sa Image, ChannelDescriptor
*/
class MITKCORE_EXPORT ImageDescriptor : public itk::Object
{
public:
mitkClassMacroItkParent(ImageDescriptor, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/** Insert new channel
@param ptype Pixel Type
@param name channel's name
*/
void AddNewChannel(mitk::PixelType ptype, const char *name = nullptr);
/** \brief Initialize the image descriptor by the dimensions */
void Initialize(const unsigned int *dims, const unsigned int dim);
/** \brief Initialize the descriptor by an referenced Descriptor */
void Initialize(const ImageDescriptor::Pointer refDescriptor, unsigned int channel = 0);
/** \brief Get the C-array of unsigned int holding the size for each dimension of the image
The C-array has allways lenght of MAX_IMAGE_DIMENSIONS
*/
const unsigned int *GetDimensions() const { return m_Dimensions; }
/** \brief Get the number dimensions used (e.g. non-zero size)
The return value does not exceed MAX_IMAGE_DIMENSIONS
*/
unsigned int GetNumberOfDimensions() const { return m_NumberOfDimensions; }
/** \brief Get the name of selected channel
If the name of the channel wasn't initialized, the string returned is set to "Unnamed [ <PixelTypeName> ]"
\sa PixelType, ChannelDescriptor
*/
const std::string GetChannelName(unsigned int id) const;
/** \brief Get the pixel type of a channel specified by its name
Returns an uninitialized PixelType object if no channel with given name was found
*/
PixelType GetChannelTypeByName(const char *name) const;
/** \brief Get the pixel type of a channel specified by its id
Returns an uninitialized PixelType object if no channel with given id was found
*/
PixelType GetChannelTypeById(unsigned int id) const;
/** \brief Get the ChannelDescriptor for a channel specified by its id */
ChannelDescriptor GetChannelDescriptor(unsigned int id = 0) const;
/** \brief Get the count of channels used */
unsigned int GetNumberOfChannels() const { return m_NumberOfChannels; }
protected:
/** Protected constructor */
ImageDescriptor();
/** Protected desctructor */
~ImageDescriptor() override{};
private:
/** A std::vector holding a pointer to a ChannelDescriptor for each active channel of the image */
std::vector<ChannelDescriptor> m_ChannelDesc;
/** A vector holding the names of corresponding channels */
std::vector<std::string> m_ChannelNames;
/** Constant iterator for traversing the vector of channel's names */
typedef std::vector<std::string>::const_iterator ConstChannelNamesIter;
/** Constant iterator for traversing the vector of ChannelDescriptors */
typedef std::vector<ChannelDescriptor>::const_iterator ConstChannelsIter;
unsigned int m_NumberOfChannels;
unsigned int m_NumberOfDimensions;
unsigned int m_Dimensions[MAX_IMAGE_DIMENSIONS];
};
} // end namespace
#endif // MITKIMAGEDESCRIPTOR_H
diff --git a/Modules/Core/include/mitkImageSliceSelector.h b/Modules/Core/include/mitkImageSliceSelector.h
index fa2fd6a304..cb5f628ac5 100644
--- a/Modules/Core/include/mitkImageSliceSelector.h
+++ b/Modules/Core/include/mitkImageSliceSelector.h
@@ -1,63 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef IMAGESLICESELECTOR_H_HEADER_INCLUDED_C1E4BE7B
#define IMAGESLICESELECTOR_H_HEADER_INCLUDED_C1E4BE7B
#include "mitkSubImageSelector.h"
#include <MitkCoreExports.h>
namespace mitk
{
//##Documentation
//## @brief Provides access to a slice of the input image
//##
//## If the input is generated by a ProcessObject, only the required data is
//## requested.
//## @ingroup Process
class MITKCORE_EXPORT ImageSliceSelector : public SubImageSelector
{
public:
mitkClassMacro(ImageSliceSelector, SubImageSelector);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
- itkGetConstMacro(SliceNr, int);
+ itkCloneMacro(Self);
+
+ itkGetConstMacro(SliceNr, int);
itkSetMacro(SliceNr, int);
itkGetConstMacro(TimeNr, int);
itkSetMacro(TimeNr, int);
itkGetConstMacro(ChannelNr, int);
itkSetMacro(ChannelNr, int);
protected:
void GenerateOutputInformation() override;
void GenerateInputRequestedRegion() override;
void GenerateData() override;
ImageSliceSelector();
~ImageSliceSelector() override;
int m_SliceNr;
int m_TimeNr;
int m_ChannelNr;
};
} // namespace mitk
#endif /* IMAGESLICESELECTOR_H_HEADER_INCLUDED_C1E4BE7B */
diff --git a/Modules/Core/include/mitkImageSource.h b/Modules/Core/include/mitkImageSource.h
index 3565a9dcc5..d5a26274e8 100644
--- a/Modules/Core/include/mitkImageSource.h
+++ b/Modules/Core/include/mitkImageSource.h
@@ -1,250 +1,251 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef IMAGESOURCE_H_HEADER_INCLUDED_C1E7D6EC
#define IMAGESOURCE_H_HEADER_INCLUDED_C1E7D6EC
#include "mitkBaseDataSource.h"
#include "mitkImage.h"
#include <MitkCoreExports.h>
namespace mitk
{
/**
* @brief Superclass of all classes generating Images (instances of class
* Image) as output.
*
* In itk and vtk the generated result of a ProcessObject is only guaranteed
* to be up-to-date, when Update() of the ProcessObject or the generated
* DataObject is called immediately before access of the data stored in the
* DataObject. This is also true for subclasses of mitk::BaseProcess and thus
* for mitk::ImageSource. But there are also three access methods provided
* that guarantee an up-to-date result (by first calling Update and then
* returning the result of GetOutput()): GetData(), GetPic() and
* GetVtkImageData().
* @ingroup Process
*/
class MITKCORE_EXPORT ImageSource : public BaseDataSource
{
public:
- mitkClassMacro(ImageSource, BaseDataSource)
+ mitkClassMacro(ImageSource, BaseDataSource);
/** @brief Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** @brief Some convenient typedefs. */
typedef mitk::Image OutputImageType;
typedef OutputImageType OutputType;
typedef OutputImageType::Pointer OutputImagePointer;
typedef SlicedData::RegionType OutputImageRegionType;
/**
* @brief Get the output data of this image source object.
*
* The output of this
* function is not valid until an appropriate Update() method has
* been called, either explicitly or implicitly. Both the filter
* itself and the data object have Update() methods, and both
* methods update the data. Here are three ways to use
* GetOutput() and make sure the data is valid. In these
* examples, \a image is a pointer to some Image object, and the
* particular ProcessObjects involved are filters. The same
* examples apply to non-image (e.g. Mesh) data as well.
*
* \code
* anotherFilter->SetInput( someFilter->GetOutput() );
* anotherFilter->Update();
* \endcode
*
* In this situation, \a someFilter and \a anotherFilter are said
* to constitute a \b pipeline.
*
* \code
* image = someFilter->GetOutput();
* image->Update();
* \endcode
*
* \code
* someFilter->Update();
* image = someFilter->GetOutput();
* \endcode
* (In the above example, the two lines of code can be in
* either order.)
*
* Note that Update() is not called automatically except within a
* pipeline as in the first example. When \b streaming (using a
* StreamingImageFilter) is activated, it may be more efficient to
* use a pipeline than to call Update() once for each filter in
* turn.
*
* For an image, the data generated is for the requested
* Region, which can be set using ImageBase::SetRequestedRegion().
* By default, the largest possible region is requested.
*
* For Filters which have multiple outputs of different types, the
* GetOutput() method assumes the output is of OutputImageType. For
* the GetOutput(DataObjectPointerArraySizeType) method, a dynamic_cast is performed
* incase the filter has outputs of different types or image
* types. Derived classes should have named get methods for these
* outputs.
*/
mitkBaseDataSourceGetOutputDeclarations
/** @brief Make a DataObject of the correct type to used as the specified
* output.
*
* Every ProcessObject subclass must be able to create a
* DataObject that can be used as a specified output. This method
* is automatically called when DataObject::DisconnectPipeline() is
* called. DataObject::DisconnectPipeline, disconnects a data object
* from being an output of its current source. When the data object
* is disconnected, the ProcessObject needs to construct a replacement
* output data object so that the ProcessObject is in a valid state.
* So DataObject::DisconnectPipeline eventually calls
* ProcessObject::MakeOutput. Note that MakeOutput always returns a
* SmartPointer to a DataObject. If a subclass of ImageSource has
* multiple outputs of different types, then that class must provide
* an implementation of MakeOutput(). */
itk::DataObject::Pointer
MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
virtual vtkImageData *GetVtkImageData();
virtual const vtkImageData *GetVtkImageData() const;
protected:
ImageSource();
~ImageSource() override {}
/** @brief A version of GenerateData() specific for image processing
* filters.
*
* This implementation will split the processing across
* multiple threads. The buffer is allocated by this method. Then
* the BeforeThreadedGenerateData() method is called (if
* provided). Then, a series of threads are spawned each calling
* ThreadedGenerateData(). After all the threads have completed
* processing, the AfterThreadedGenerateData() method is called (if
* provided). If an image processing filter cannot be threaded, the
* filter should provide an implementation of GenerateData(). That
* implementation is responsible for allocating the output buffer.
* If a filter an be threaded, it should NOT provide a
* GenerateData() method but should provide a ThreadedGenerateData()
* instead.
*
* \sa ThreadedGenerateData() */
void GenerateData() override;
/** @brief If an imaging filter can be implemented as a multithreaded
* algorithm, the filter will provide an implementation of
* ThreadedGenerateData().
*
* This superclass will automatically split
* the output image into a number of pieces, spawn multiple threads,
* and call ThreadedGenerateData() in each thread. Prior to spawning
* threads, the BeforeThreadedGenerateData() method is called. After
* all the threads have completed, the AfterThreadedGenerateData()
* method is called. If an image processing filter cannot support
* threading, that filter should provide an implementation of the
* GenerateData() method instead of providing an implementation of
* ThreadedGenerateData(). If a filter provides a GenerateData()
* method as its implementation, then the filter is responsible for
* allocating the output data. If a filter provides a
* ThreadedGenerateData() method as its implementation, then the
* output memory will allocated automatically by this superclass.
* The ThreadedGenerateData() method should only produce the output
* specified by "outputThreadRegion"
* parameter. ThreadedGenerateData() cannot write to any other
* portion of the output image (as this is responsibility of a
* different thread).
*
* \sa GenerateData(), SplitRequestedRegion() */
virtual void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType threadId);
/** @brief This method is intentionally left blank.
*
* ImageSource's need not
* Initialize their containers. The Image::Allocate() method (called
* from GenerateData()) will resize the container if more memory is
* needed. Otherwise, the memory can be reused.
*/
void PrepareOutputs() override;
/** @brief The GenerateData method normally allocates the buffers for all of the
* outputs of a filter.
*
* Some filters may want to override this default
* behavior. For example, a filter may have multiple outputs with
* varying resolution. Or a filter may want to process data in place by
* grafting its input to its output.*/
virtual void AllocateOutputs();
/** @brief If an imaging filter needs to perform processing after the buffer
* has been allocated but before threads are spawned, the filter can
* can provide an implementation for BeforeThreadedGenerateData().
*
* The execution flow in the default GenerateData() method will be:
* 1) Allocate the output buffer
* 2) Call BeforeThreadedGenerateData()
* 3) Spawn threads, calling ThreadedGenerateData() in each thread.
* 4) Call AfterThreadedGenerateData()
* Note that this flow of control is only available if a filter provides
* a ThreadedGenerateData() method and NOT a GenerateData() method. */
virtual void BeforeThreadedGenerateData() {}
/** @brief If an imaging filter needs to perform processing after all
* processing threads have completed, the filter can can provide an
* implementation for AfterThreadedGenerateData().
*
* The execution
* flow in the default GenerateData() method will be:
* 1) Allocate the output buffer
* 2) Call BeforeThreadedGenerateData()
* 3) Spawn threads, calling ThreadedGenerateData() in each thread.
* 4) Call AfterThreadedGenerateData()
* Note that this flow of control is only available if a filter provides
* a ThreadedGenerateData() method and NOT a GenerateData() method. */
virtual void AfterThreadedGenerateData() {}
/** @brief Split the output's RequestedRegion into "num" pieces, returning
* region "i" as "splitRegion".
*
* This method is called "num" times. The
* regions must not overlap. The method returns the number of pieces that
* the routine is capable of splitting the output RequestedRegion,
* i.e. return value is less than or equal to "num". */
virtual unsigned int SplitRequestedRegion(unsigned int i, unsigned int num, OutputImageRegionType &splitRegion);
/** @brief Static function used as a "callback" by the MultiThreader.
*
* The threading library will call this routine for each thread, which will delegate the
* control to ThreadedGenerateData(). */
static ITK_THREAD_RETURN_TYPE ThreaderCallback(void *arg);
/** @brief Internal structure used for passing image data into the threading library */
struct ThreadStruct
{
Pointer Filter;
};
private:
ImageSource(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // namespace mitk
#endif /* IMAGESOURCE_H_HEADER_INCLUDED_C1E7D6EC */
diff --git a/Modules/Core/include/mitkImageTimeSelector.h b/Modules/Core/include/mitkImageTimeSelector.h
index 3d8841de9f..ea52c6dbdd 100644
--- a/Modules/Core/include/mitkImageTimeSelector.h
+++ b/Modules/Core/include/mitkImageTimeSelector.h
@@ -1,58 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef IMAGETIMESELECTOR_H_HEADER_INCLUDED_C1E4861D
#define IMAGETIMESELECTOR_H_HEADER_INCLUDED_C1E4861D
#include "mitkSubImageSelector.h"
#include <MitkCoreExports.h>
namespace mitk
{
//##Documentation
//## @brief Provides access to a volume at a specific time of the input image
//##
//## If the input is generated by a ProcessObject, only the required data is
//## requested.
//## @ingroup Process
class MITKCORE_EXPORT ImageTimeSelector : public SubImageSelector
{
public:
mitkClassMacro(ImageTimeSelector, SubImageSelector);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
- itkGetConstMacro(TimeNr, int);
+ itkCloneMacro(Self);
+
+ itkGetConstMacro(TimeNr, int);
itkSetMacro(TimeNr, int);
itkGetConstMacro(ChannelNr, int);
itkSetMacro(ChannelNr, int);
protected:
ImageTimeSelector();
~ImageTimeSelector() override;
void GenerateOutputInformation() override;
void GenerateInputRequestedRegion() override;
void GenerateData() override;
int m_TimeNr;
int m_ChannelNr;
};
} // namespace mitk
#endif /* IMAGETIMESELECTOR_H_HEADER_INCLUDED_C1E4861D */
diff --git a/Modules/Core/include/mitkImageToImageFilter.h b/Modules/Core/include/mitkImageToImageFilter.h
index 24298d7ac1..199d7c2bdf 100644
--- a/Modules/Core/include/mitkImageToImageFilter.h
+++ b/Modules/Core/include/mitkImageToImageFilter.h
@@ -1,79 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef IMAGETOIMAGEFILTER_H_HEADER_INCLUDED_C1E5E869
#define IMAGETOIMAGEFILTER_H_HEADER_INCLUDED_C1E5E869
#include "mitkImageSource.h"
#include <MitkCoreExports.h>
namespace mitk
{
//##Documentation
//## @brief Superclass of all classes having one or more Images as input and
//## generating Images as output
//## @ingroup Process
class MITKCORE_EXPORT ImageToImageFilter : public ImageSource
{
public:
mitkClassMacro(ImageToImageFilter, ImageSource);
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Superclass typedefs. */
typedef Superclass::OutputImageRegionType OutputImageRegionType;
/** Some convenient typedefs. */
typedef mitk::Image InputImageType;
typedef InputImageType::Pointer InputImagePointer;
typedef InputImageType::ConstPointer InputImageConstPointer;
typedef SlicedData::RegionType InputImageRegionType;
using itk::ProcessObject::SetInput;
/** Set/Get the image input of this process object. */
virtual void SetInput(const InputImageType *image);
virtual void SetInput(unsigned int, const InputImageType *image);
InputImageType *GetInput(void);
InputImageType *GetInput(unsigned int idx);
const InputImageType *GetInput(void) const;
const InputImageType *GetInput(unsigned int idx) const;
protected:
ImageToImageFilter();
~ImageToImageFilter() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
/** What is the input requested region that is required to produce the
* output requested region? The base assumption for image processing
* filters is that the input requested region can be set to match the
* output requested region. If a filter requires more input (for instance
* a filter that uses neighborhoods needs more input than output to avoid
* introducing artificial boundary conditions) or less input (for instance
* a magnify filter) will have to override this method. In doing so, it
* should call its superclass' implementation as its first step. Note that
* this imaging filters operate differently than the classes to this
* point in the class hierachy. Up till now, the base assumption has been
* that the largest possible region will be requested of the input.
*
* \sa ProcessObject::GenerateInputRequestedRegion(),
* ImageSource::GenerateInputRequestedRegion() */
void GenerateInputRequestedRegion() override;
private:
void operator=(const Self &); // purposely not implemented
};
} // namespace mitk
#endif /* IMAGETOIMAGEFILTER_H_HEADER_INCLUDED_C1E5E869 */
diff --git a/Modules/Core/include/mitkImageToItk.h b/Modules/Core/include/mitkImageToItk.h
index 7a03ab425d..93e1fa6005 100644
--- a/Modules/Core/include/mitkImageToItk.h
+++ b/Modules/Core/include/mitkImageToItk.h
@@ -1,182 +1,183 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef IMAGETOITK_H_HEADER_INCLUDED_C1C2FCD2
#define IMAGETOITK_H_HEADER_INCLUDED_C1C2FCD2
#include "mitkImage.h"
#include "mitkImageDataItem.h"
#include "mitkImageWriteAccessor.h"
#include <itkImage.h>
#include <itkImageSource.h>
namespace mitk
{
/**
* Create itk::ImageSource for mitk::Image
* \ingroup Adaptor
*
* \warning 2D MITK images will get a 2D identity matrix in ITK
* \todo Get clear about how to handle directed ITK 2D images in ITK
*/
template <class TOutputImage>
class ImageToItk : public itk::ImageSource<TOutputImage>
{
protected:
mitk::Image::Pointer m_MitkImage;
mitk::ImageDataItem::Pointer m_ImageDataItem;
public:
typedef ImageToItk Self;
typedef itk::ImageSource<TOutputImage> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Superclass typedefs. */
typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
/** Some convenient typedefs. */
typedef mitk::Image InputImageType;
typedef InputImageType::Pointer InputImagePointer;
typedef InputImageType::ConstPointer InputImageConstPointer;
typedef SlicedData::RegionType InputImageRegionType;
typedef typename TOutputImage::SizeType SizeType;
typedef typename TOutputImage::IndexType IndexType;
typedef typename TOutputImage::RegionType RegionType;
typedef typename TOutputImage::PixelType PixelType;
typedef typename TOutputImage::InternalPixelType InternalPixelType;
typedef typename TOutputImage::PixelContainer PixelContainer;
virtual void SetInput(mitk::Image *input);
virtual void SetInput(const mitk::Image *input);
// virtual void SetInput(unsigned int index, mitk::Image * image);
// virtual void SetInput(unsigned int index, const mitk::Image * image);
void UpdateOutputInformation() override;
itkGetMacro(Channel, int);
itkSetMacro(Channel, int);
itkSetMacro(CopyMemFlag, bool);
itkGetMacro(CopyMemFlag, bool);
itkBooleanMacro(CopyMemFlag);
itkSetMacro(Options, int);
itkGetMacro(Options, int);
protected:
using itk::ProcessObject::SetInput;
mitk::Image *GetInput(void);
const mitk::Image *GetInput() const;
ImageToItk() : m_CopyMemFlag(false), m_Channel(0), m_Options(mitk::ImageAccessorBase::DefaultBehavior) {}
~ImageToItk() override {}
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
void GenerateData() override;
void GenerateOutputInformation() override;
private:
bool m_CopyMemFlag;
int m_Channel;
int m_Options;
bool m_ConstInput;
// ImageToItk(const Self&); //purposely not implemented
void operator=(const Self &); // purposely not implemented
void CheckInput(const mitk::Image *image) const;
};
/**
* @brief Convert a MITK image to an ITK image.
*
* This method creates a itk::Image representation for the given MITK
* image, referencing the MITK image memory. If the provided template
* arguments do not match the type of the MITK image, an exception is thrown.
*
* The MITK image is locked for read/write access as long as the returned
* itk::Image object exists. See ImageToItkImage(const mitk::Image*) for
* read-only access.
*
* @tparam TPixel The pixel type of the ITK image
* @tparam VDimension The image dimension of the ITK image
* @param mitkImage The MITK image which is to be converted to an ITK image
* @return An ITK image representation for the given MITK image
* @throws mitk::Exception if the pixel type or dimension does not match
* the MITK image type or if the MITK image is already locked for
* read or write access.
*
* @sa ImageToItkImage(const mitk::Image*)
* @sa CastToItkImage
*
* @ingroup Adaptor
*/
template <typename TPixel, unsigned int VDimension>
typename ImageTypeTrait<TPixel, VDimension>::ImageType::Pointer ImageToItkImage(mitk::Image *mitkImage)
{
typedef typename ImageTypeTrait<TPixel, VDimension>::ImageType ImageType;
typedef mitk::ImageToItk<ImageType> ImageToItkType;
itk::SmartPointer<ImageToItkType> imagetoitk = ImageToItkType::New();
imagetoitk->SetInput(mitkImage);
imagetoitk->Update();
return imagetoitk->GetOutput();
}
/**
* @brief Convert a MITK image to an ITK image.
*
* This method creates a itk::Image representation for the given MITK
* image, referencing the MITK image memory. If the provided template
* arguments do not match the type of the MITK image, an exception is thrown.
*
* The MITK image is locked for read access as long as the returned
* itk::Image object exists. See ImageToItkImage(mitk::Image*) for
* read and write access.
*
* @tparam TPixel The pixel type of the ITK image
* @tparam VDimension The image dimension of the ITK image
* @param mitkImage The MITK image which is to be converted to an ITK image
* @return An ITK image representation for the given MITK image
* @throws mitk::Exception if the pixel type or dimension does not match
* the MITK image type or if the MITK image is already locked for
* write access.
*
* @sa ImageToItkImage(mitk::Image*)
* @sa CastToItkImage
*
* @ingroup Adaptor
*/
template <typename TPixel, unsigned int VDimension>
typename ImageTypeTrait<TPixel, VDimension>::ImageType::ConstPointer ImageToItkImage(const mitk::Image *mitkImage)
{
typedef typename ImageTypeTrait<TPixel, VDimension>::ImageType ImageType;
typedef mitk::ImageToItk<ImageType> ImageToItkType;
itk::SmartPointer<ImageToItkType> imagetoitk = ImageToItkType::New();
imagetoitk->SetInput(mitkImage);
imagetoitk->Update();
return imagetoitk->GetOutput();
}
} // end namespace mitk
#ifndef ITK_MANUAL_INSTANTIATION
#include "mitkImageToItk.txx"
#endif
#endif // IMAGETOITK_H_HEADER_INCLUDED_C1C2FCD2
diff --git a/Modules/Core/include/mitkImageToSurfaceFilter.h b/Modules/Core/include/mitkImageToSurfaceFilter.h
index 35abbcbc30..3a0b8eeab6 100644
--- a/Modules/Core/include/mitkImageToSurfaceFilter.h
+++ b/Modules/Core/include/mitkImageToSurfaceFilter.h
@@ -1,248 +1,249 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITKIMAGETOSURFACEFILTER_h__
#define _MITKIMAGETOSURFACEFILTER_h__
#include "MitkCoreExports.h"
#include <mitkCommon.h>
#include <mitkSurface.h>
#include <mitkSurfaceSource.h>
#include <vtkPolyData.h>
#include <mitkImage.h>
#include <vtkImageData.h>
#include <vtkMarchingCubes.h>
#include <vtkSmoothPolyDataFilter.h>
namespace mitk
{
/**
* @brief Converts pixel data to surface data by using a threshold
* The mitkImageToSurfaceFilter is used to create a new surface out of an mitk image. The filter
* uses a threshold to define the surface. It is based on the vtkMarchingCube algorithm. By default
* a vtkPolyData surface based on an input threshold for the input image will be created. Optional
* it is possible to reduce the number of triangles/polygones [SetDecimate(mitk::ImageToSurfaceFilter::DecimatePro) and
* SetTargetReduction (float _arg)]
* or smooth the surface-data [SetSmooth(true), SetSmoothIteration(int smoothIteration) and SetSmoothRelaxation(float
* smoothRelaxation)].
*
* The resulting vtk-surface has the same size as the input image. The surface
* can be generally smoothed by vtkDecimatePro reduce complexity of triangles
* and vtkSmoothPolyDataFilter to relax the mesh. Both are enabled by default
* and connected in the common way of pipelining in ITK. It's also possible
* to create time sliced surfaces.
*
* @ingroup ImageFilters
* @ingroup Process
*/
class MITKCORE_EXPORT ImageToSurfaceFilter : public SurfaceSource
{
public:
/*
* To decide whether a reduction of polygons in the created surface shall be
* done or not by using the vtkDecimatePro Filter. Till vtk 4.x an vtkDecimateFilter existed,
* but was patented. So since vtk 5.x it was replaced by the (worser?) vtkDecimateProFilter
* Maybe another Filter will come soon.
*/
enum DecimationType
{
NoDecimation,
DecimatePro,
QuadricDecimation
};
mitkClassMacro(ImageToSurfaceFilter, SurfaceSource);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* For each image time slice a surface will be created. This method is
* called by Update().
*/
void GenerateData() override;
/**
* Initializes the output information ( i.e. the geometry information ) of
* the output of the filter
*/
void GenerateOutputInformation() override;
/**
* Returns a const reference to the input image (e.g. the original input image that ist used to create the surface)
*/
const mitk::Image *GetInput(void);
/**
* Set the source image to create a surface for this filter class. As input every mitk
* 3D or 3D+t image can be used.
*/
using itk::ProcessObject::SetInput;
virtual void SetInput(const mitk::Image *image);
/**
* Set the number of iterations that is used to smooth the surface. Used is the vtkSmoothPolydataFilter that uses
* the
* laplacian filter. The higher the number of iterations that stronger the smooth-result
*
* @param smoothIteration As smoothIteration default in that case 50 was choosen. The VTK documentation recommends
* small relaxation factors and large numbers of iterations.
*/
void SetSmoothIteration(int smoothIteration);
/**
* Set number of relaxation. Specify the relaxation factor for Laplacian
* smoothing. The VTK documentation recommends small relaxation factors
* and large numbers of iterations.
*
* @param smoothRelaxation As smoothRelaxation default in that case 0.1 was choosen. The VTK documentation
* recommends
* small relaxation factors and large numbers of iterations.
*/
void SetSmoothRelaxation(float smoothRelaxation);
/**
* Threshold that is used to create the surface. All pixel in the input image that are higher than that
* value will be considered in the surface. The threshold referees to
* vtkMarchingCube. Default value is 1. See also SetThreshold (ScalarType _arg)
*/
itkSetMacro(Threshold, ScalarType);
/**
* Get Threshold from vtkMarchingCube. Threshold can be manipulated by
* inherited classes.
*/
itkGetConstMacro(Threshold, ScalarType);
/**
* Enables vtkSmoothPolyDataFilter. With Laplacian smoothing this filter
* will relax the surface. You can control the Filter by manipulating the
* number of iterations and the relaxing factor.
* */
itkSetMacro(Smooth, bool);
/*
* Enable/Disable surface smoothing.
*/
itkBooleanMacro(Smooth);
/*
* Returns if surface smoothing is enabled
*/
itkGetConstMacro(Smooth, bool);
/**
* Get the state of decimation mode to reduce triangle in the
* surface represantation. Modes can only be NoDecimation or DecimatePro
* (till vtk 4.x also Decimate)
* */
itkGetConstMacro(Decimate, DecimationType);
/**
* Enable the decimation filter to reduce the number of triangles in the
* mesh and produce a good approximation to the original image. The filter
* has support for vtk-5 and earlier versions. More detailed information
* check the vtkDecimatePro and vtkDecimate.
* */
itkSetMacro(Decimate, DecimationType);
/**
* Set desired TargetReduction of triangles in the range from 0.0 to 1.0.
* The destroyed triangles are in relation with the size of data. For example 0.9
* will reduce the data set to 10%.
*
* @param Set a TargetReduction float-value from 0.0 to 1.0
* */
itkSetMacro(TargetReduction, float);
/**
* Returns the reduction factor for the VtkDecimatePro Decimation Filter as a float value
*/
itkGetConstMacro(TargetReduction, float);
/**
* Transforms a point by a 4x4 matrix
*/
template <class T1, class T2, class T3>
inline void mitkVtkLinearTransformPoint(T1 matrix[4][4], T2 in[3], T3 out[3])
{
T3 x = matrix[0][0] * in[0] + matrix[0][1] * in[1] + matrix[0][2] * in[2] + matrix[0][3];
T3 y = matrix[1][0] * in[0] + matrix[1][1] * in[1] + matrix[1][2] * in[2] + matrix[1][3];
T3 z = matrix[2][0] * in[0] + matrix[2][1] * in[1] + matrix[2][2] * in[2] + matrix[2][3];
out[0] = x;
out[1] = y;
out[2] = z;
}
protected:
ImageToSurfaceFilter();
/**
* Destructor
* */
~ImageToSurfaceFilter() override;
/**
* With the given threshold vtkMarchingCube creates the surface. By default nothing a
* vtkPolyData surface based on a threshold of the input image will be created. Optional
* it is possible to reduce the number of triangles/polygones [SetDecimate(mitk::ImageToSurfaceFilter::DecimatePro)
* and
* SetTargetReduction (float _arg)]
* or smooth the data [SetSmooth(true), SetSmoothIteration(int smoothIteration) and SetSmoothRelaxation(float
* smoothRelaxation)].
*
* @param time selected slice or "0" for single
* @param *vtkimage input image
* @param *surface output
* @param threshold can be different from SetThreshold()
*/
void CreateSurface(int time, vtkImageData *vtkimage, mitk::Surface *surface, const ScalarType threshold);
/**
* Flag whether the created surface shall be smoothed or not (default is "false"). SetSmooth (bool _arg)
* */
bool m_Smooth;
/**
* Decimation mode, default mode is "NoDecimation". See also SetDecimate (DecimationType _arg)
* */
DecimationType m_Decimate;
/**
* Threshold that is used to create the surface. All pixel in the input image that are higher than that
* value will be considered in the surface. Default value is 1. See also SetThreshold (ScalarType _arg)
* */
ScalarType m_Threshold;
/**
* The Reduction factor of the Decimation Filter for the created surface. See also SetTargetReduction (float _arg)
* */
float m_TargetReduction;
/**
* The Iteration value for the Smooth Filter of the created surface. See also SetSmoothIteration (int
* smoothIteration)
* */
int m_SmoothIteration;
/**
* The Relaxation value for the Smooth Filter of the created surface. See also SetSmoothRelaxation (float
* smoothRelaxation)
* */
float m_SmoothRelaxation;
};
} // namespace mitk
#endif //_MITKIMAGETOSURFACEFILTER_h__
diff --git a/Modules/Core/include/mitkImageVtkMapper2D.h b/Modules/Core/include/mitkImageVtkMapper2D.h
index ddb32c1bbf..f629db70c0 100644
--- a/Modules/Core/include/mitkImageVtkMapper2D.h
+++ b/Modules/Core/include/mitkImageVtkMapper2D.h
@@ -1,306 +1,307 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKIMAGEVTKMAPPER2D_H_HEADER_INCLUDED_C10E906E
#define MITKIMAGEVTKMAPPER2D_H_HEADER_INCLUDED_C10E906E
// MITK
#include <mitkCommon.h>
// MITK Rendering
#include "mitkBaseRenderer.h"
#include "mitkExtractSliceFilter.h"
#include "mitkVtkMapper.h"
// VTK
#include <vtkPropAssembly.h>
#include <vtkSmartPointer.h>
class vtkActor;
class vtkPolyDataMapper;
class vtkPlaneSource;
class vtkImageData;
class vtkLookupTable;
class vtkImageExtractComponents;
class vtkImageReslice;
class vtkImageChangeInformation;
class vtkPoints;
class vtkMitkThickSlicesFilter;
class vtkPolyData;
class vtkMitkApplyLevelWindowToRGBFilter;
class vtkMitkLevelWindowFilter;
namespace mitk
{
/** \brief Mapper to resample and display 2D slices of a 3D image.
*
* The following image gives a brief overview of the mapping and the involved parts.
*
* \image html imageVtkMapper2Darchitecture.png
*
* First, the image is resliced by means of vtkImageReslice. The volume image
* serves as input to the mapper in addition to spatial placement of the slice and a few other
* properties such as thick slices. This code was already present in the old version
* (mitkImageMapperGL2D).
*
* Next, the obtained slice (m_ReslicedImage) is put into a vtkMitkLevelWindowFilter
* and the scalar levelwindow, opacity levelwindow and optional clipping to
* local image bounds are applied
*
* Next, the output of the vtkMitkLevelWindowFilter is used to create a texture
* (m_Texture) and a plane onto which the texture is rendered (m_Plane). For
* mapping purposes, a vtkPolyDataMapper (m_Mapper) is utilized. Orthographic
* projection is applied to create the effect of a 2D image. The mapper and the
* texture are assigned to the actor (m_Actor) which is passed to the VTK rendering
* pipeline via the method GetVtkProp().
*
* In order to transform the textured plane to the correct position in space, the
* same transformation as used for reslicing is applied to both the camera and the
* vtkActor. All important steps are explained in more detail below. The resulting
* 2D image (by reslicing the underlying 3D input image appropriately) can either
* be directly rendered in a 2D view or just be calculated to be used later by another
* rendering entity, e.g. in texture mapping in a 3D view.
*
* Properties that can be set for images and influence the imageMapper2D are:
*
* - \b "opacity": (FloatProperty) Opacity of the image
* - \b "color": (ColorProperty) Color of the image
* - \b "LookupTable": (mitkLookupTableProperty) If this property is set,
* the default lookuptable will be ignored and the "LookupTable" value
* will be used instead.
* - \b "Image Rendering.Mode": This property decides which mode is used to render images. (E.g. if a lookup table
or
a transferfunction is applied). Detailed documentation about the modes can be found here: \link
mitk::RenderingerModeProperty \endlink
* - \b "Image Rendering.Transfer Function": (mitkTransferFunctionProperty) If this
* property is set, a color transferfunction will be used to color the image.
* - \b "binary": (BoolProperty) is the image a binary image or not
* - \b "outline binary": (BoolProperty) show outline of the image or not
* - \b "texture interpolation": (BoolProperty) texture interpolation of the image
* - \b "reslice interpolation": (VtkResliceInterpolationProperty) reslice interpolation of the image
* - \b "in plane resample extent by geometry": (BoolProperty) Do it or not
* - \b "bounding box": (BoolProperty) Is the Bounding Box of the image shown or not
* - \b "layer": (IntProperty) Layer of the image
* - \b "volume annotation color": (ColorProperty) color of the volume annotation, TODO has to be reimplemented
* - \b "volume annotation unit": (StringProperty) annotation unit as string (does not implicit convert the unit!)
unit is ml or cm3, TODO has to be reimplemented
* The default properties are:
* - \b "opacity", mitk::FloatProperty::New(0.3f), renderer, overwrite )
* - \b "color", ColorProperty::New(1.0,0.0,0.0), renderer, overwrite )
* - \b "binary", mitk::BoolProperty::New( true ), renderer, overwrite )
* - \b "outline binary", mitk::BoolProperty::New( false ), renderer, overwrite )
* - \b "texture interpolation", mitk::BoolProperty::New( false ) )
* - \b "reslice interpolation", mitk::VtkResliceInterpolationProperty::New() )
* - \b "in plane resample extent by geometry", mitk::BoolProperty::New( false ) )
* - \b "bounding box", mitk::BoolProperty::New( false ) )
* - \b "layer", mitk::IntProperty::New(10), renderer, overwrite)
* - \b "Image Rendering.Transfer Function": Default color transfer function for CTs
* - \b "LookupTable": Rainbow color.
* If the modality-property is set for an image, the mapper uses modality-specific default properties,
* e.g. color maps, if they are defined.
* \ingroup Mapper
*/
class MITKCORE_EXPORT ImageVtkMapper2D : public VtkMapper
{
public:
/** Standard class typedefs. */
mitkClassMacro(ImageVtkMapper2D, VtkMapper);
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** \brief Get the Image to map */
const mitk::Image *GetInput(void);
/** \brief Checks whether this mapper needs to update itself and generate
* data. */
void Update(mitk::BaseRenderer *renderer) override;
//### methods of MITK-VTK rendering pipeline
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
//### end of methods of MITK-VTK rendering pipeline
/** \brief Internal class holding the mapper, actor, etc. for each of the 3 2D render windows */
/**
* To render transveral, coronal, and sagittal, the mapper is called three times.
* For performance reasons, the corresponding data for each view is saved in the
* internal helper class LocalStorage. This allows rendering n views with just
* 1 mitkMapper using n vtkMapper.
* */
class MITKCORE_EXPORT LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkActor> m_Actor;
vtkSmartPointer<vtkPropAssembly> m_Actors;
/** \brief Mapper of a 2D render window. */
vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
vtkSmartPointer<vtkImageExtractComponents> m_VectorComponentExtractor;
/** \brief Current slice of a 2D render window.*/
vtkSmartPointer<vtkImageData> m_ReslicedImage;
/** \brief Empty vtkPolyData that is set when rendering geometry does not
* intersect the image geometry.
* \warning This member variable is set to nullptr,
* if no image geometry is inside the plane geometry
* of the respective render window. Any user of this
* slice has to check whether it is set to nullptr!
*/
vtkSmartPointer<vtkPolyData> m_EmptyPolyData;
/** \brief Plane on which the slice is rendered as texture. */
vtkSmartPointer<vtkPlaneSource> m_Plane;
/** \brief The texture which is used to render the current slice. */
vtkSmartPointer<vtkTexture> m_Texture;
/** \brief The lookuptables for colors and level window */
vtkSmartPointer<vtkLookupTable> m_DefaultLookupTable;
vtkSmartPointer<vtkLookupTable> m_BinaryLookupTable;
vtkSmartPointer<vtkLookupTable> m_ColorLookupTable;
/** \brief The actual reslicer (one per renderer) */
mitk::ExtractSliceFilter::Pointer m_Reslicer;
/** \brief Filter for thick slices */
vtkSmartPointer<vtkMitkThickSlicesFilter> m_TSFilter;
/** \brief PolyData object containg all lines/points needed for outlining the contour.
This container is used to save a computed contour for the next rendering execution.
For instance, if you zoom or pann, there is no need to recompute the contour. */
vtkSmartPointer<vtkPolyData> m_OutlinePolyData;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief mmPerPixel relation between pixel and mm. (World spacing).*/
mitk::ScalarType *m_mmPerPixel;
/** \brief This filter is used to apply the level window to Grayvalue and RBG(A) images. */
vtkSmartPointer<vtkMitkLevelWindowFilter> m_LevelWindowFilter;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage() override;
};
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
/** \brief Get the LocalStorage corresponding to the current renderer. */
LocalStorage *GetLocalStorage(mitk::BaseRenderer *renderer);
/** \brief Set the default properties for general image rendering. */
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
/** \brief This method switches between different rendering modes (e.g. use a lookup table or a transfer function).
* Detailed documentation about the modes can be found here: \link mitk::RenderingerModeProperty \endlink
*/
void ApplyRenderingMode(mitk::BaseRenderer *renderer);
protected:
/** \brief Transforms the actor to the actual position in 3D.
* \param renderer The current renderer corresponding to the render window.
*/
void TransformActor(mitk::BaseRenderer *renderer);
/** \brief Generates a plane according to the size of the resliced image in milimeters.
*
* \image html texturedPlane.png
*
* In VTK a vtkPlaneSource is defined through three points. The origin and two
* points defining the axes of the plane (see VTK documentation). The origin is
* set to (xMin; yMin; Z), where xMin and yMin are the minimal bounds of the
* resliced image in space. Z is relevant for blending and the layer property.
* The center of the plane (C) is also the center of the view plane (cf. the image above).
*
* \note For the standard MITK view with three 2D render windows showing three
* different slices, three such planes are generated. All these planes are generated
* in the XY-plane (even if they depict a YZ-slice of the volume).
*
*/
void GeneratePlane(mitk::BaseRenderer *renderer, double planeBounds[6]);
/** \brief Generates a vtkPolyData object containing the outline of a given binary slice.
\param renderer: Pointer to the renderer containing the needed information
\note This code is based on code from the iil library.
*/
template <typename TPixel>
vtkSmartPointer<vtkPolyData> CreateOutlinePolyData(mitk::BaseRenderer *renderer);
/** Default constructor */
ImageVtkMapper2D();
/** Default deconstructor */
~ImageVtkMapper2D() override;
/** \brief Does the actual resampling, without rendering the image yet.
* All the data is generated inside this method. The vtkProp (or Actor)
* is filled with content (i.e. the resliced image).
*
* After generation, a 4x4 transformation matrix(t) of the current slice is obtained
* from the vtkResliceImage object via GetReslicesAxis(). This matrix is
* applied to each textured plane (actor->SetUserTransform(t)) to transform everything
* to the actual 3D position (cf. the following image).
*
* \image html cameraPositioning3D.png
*
*/
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
/** \brief This method uses the vtkCamera clipping range and the layer property
* to calcualte the depth of the object (e.g. image or contour). The depth is used
* to keep the correct order for the final VTK rendering.*/
float CalculateLayerDepth(mitk::BaseRenderer *renderer);
/** \brief This method applies (or modifies) the lookuptable for all types of images.
* \warning To use the lookup table, the property 'Lookup Table' must be set and a 'Image Rendering.Mode'
* which uses the lookup table must be set.
*/
void ApplyLookuptable(mitk::BaseRenderer *renderer);
/** \brief This method applies a color transfer function.
* Internally, a vtkColorTransferFunction is used. This is usefull for coloring continous
* images (e.g. float)
* \warning To use the color transfer function, the property 'Image Rendering.Transfer Function' must be set and a
* 'Image Rendering.Mode' which uses the color transfer function must be set.
*/
void ApplyColorTransferFunction(mitk::BaseRenderer *renderer);
/**
* @brief ApplyLevelWindow Apply the level window for the given renderer.
* \warning To use the level window, the property 'LevelWindow' must be set and a 'Image Rendering.Mode' which uses
* the level window must be set.
* @param renderer Level window for which renderer?
*/
void ApplyLevelWindow(mitk::BaseRenderer *renderer);
/** \brief Set the color of the image/polydata */
void ApplyColor(mitk::BaseRenderer *renderer);
/** \brief Set the opacity of the actor. */
void ApplyOpacity(mitk::BaseRenderer *renderer);
/**
* \brief Calculates whether the given rendering geometry intersects the
* given SlicedGeometry3D.
*
* This method checks if the given PlaneGeometry intersects the given
* SlicedGeometry3D. It calculates the distance of the PlaneGeometry to all
* 8 cornerpoints of the SlicedGeometry3D. If all distances have the same
* sign (all positive or all negative) there is no intersection.
* If the distances have different sign, there is an intersection.
**/
bool RenderingGeometryIntersectsImage(const PlaneGeometry *renderingGeometry, SlicedGeometry3D *imageGeometry);
};
} // namespace mitk
#endif /* MITKIMAGEVTKMAPPER2D_H_HEADER_INCLUDED_C10E906E */
diff --git a/Modules/Core/include/mitkIntPropertyExtension.h b/Modules/Core/include/mitkIntPropertyExtension.h
index c29265a2bd..acdbc55ad6 100644
--- a/Modules/Core/include/mitkIntPropertyExtension.h
+++ b/Modules/Core/include/mitkIntPropertyExtension.h
@@ -1,53 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkIntPropertyExtension_h
#define mitkIntPropertyExtension_h
#include <MitkCoreExports.h>
#include <mitkPropertyExtension.h>
namespace mitk
{
/** \brief Property extension for mitk::IntProperty.
*
* The property view uses this extension to configure the corresponding property editor.
*/
class MITKCORE_EXPORT IntPropertyExtension : public PropertyExtension
{
public:
mitkClassMacro(IntPropertyExtension, PropertyExtension);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) mitkNewMacro2Param(Self, int, int);
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
+ mitkNewMacro2Param(Self, int, int);
mitkNewMacro3Param(Self, int, int, int);
int GetMaximum() const;
void SetMaximum(int maximum);
int GetMinimum() const;
void SetMinimum(int minimum);
int GetSingleStep() const;
void SetSingleStep(int singleStep);
private:
IntPropertyExtension();
IntPropertyExtension(int minimum, int maximum, int singleStep = 1);
~IntPropertyExtension() override;
struct Impl;
Impl *m_Impl;
};
}
#endif
diff --git a/Modules/Core/include/mitkInteractionEvent.h b/Modules/Core/include/mitkInteractionEvent.h
index 0577a71947..17baee91a3 100644
--- a/Modules/Core/include/mitkInteractionEvent.h
+++ b/Modules/Core/include/mitkInteractionEvent.h
@@ -1,145 +1,146 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKINTERACTIONEVENT_H_
#define MITKINTERACTIONEVENT_H_
#include "itkLightObject.h"
#include "itkObjectFactory.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include <MitkCoreExports.h>
#include <string>
namespace mitk
{
class MITKCORE_EXPORT InteractionEvent : public itk::LightObject
{
public:
- mitkClassMacroItkParent(InteractionEvent, itk::LightObject) mitkNewMacro1Param(Self, BaseRenderer *)
+ mitkClassMacroItkParent(InteractionEvent, itk::LightObject);
+ mitkNewMacro1Param(Self, BaseRenderer*);
- void SetSender(BaseRenderer *sender);
+ void SetSender(BaseRenderer *sender);
BaseRenderer *GetSender() const;
/**
* This class implements an up cast to check if the provided baseClass object is derived from this class.
* This function is used to support polymorphism on state machine pattern (XML) level.
*/
virtual bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const;
/**
* Mouse/keyboard state values
*/
enum MouseButtons
{
NoButton = 0x0000,
LeftMouseButton = 0x0001,
RightMouseButton = 0x0002,
MiddleMouseButton = 0x0004
};
enum ModifierKeys
{
NoKey = 0x0000,
ShiftKey = 0x0100,
ControlKey = 0x0200,
AltKey = 0x0400
};
/**
* KeyConstants Constants for special keys
*/
// Special Keys
static const std::string KeyEsc; // = "Escape";
static const std::string KeyEnter; // = "Enter";
static const std::string KeyReturn; // = "Return";
static const std::string KeyDelete; // = "Delete";
static const std::string KeyArrowUp; // = "ArrowUp";
static const std::string KeyArrowDown; // = "ArrowDown";
static const std::string KeyArrowLeft; // = "ArrowLeft";
static const std::string KeyArrowRight; // = "ArrowRight";
static const std::string KeyF1; // = "F1";
static const std::string KeyF2; // = "F2";
static const std::string KeyF3; // = "F3";
static const std::string KeyF4; // = "F4";
static const std::string KeyF5; // = "F5";
static const std::string KeyF6; // = "F6";
static const std::string KeyF7; // = "F7";
static const std::string KeyF8; // = "F8";
static const std::string KeyF9; // = "F9";
static const std::string KeyF10; // = "F10";
static const std::string KeyF11; // = "F11";
static const std::string KeyF12; // = "F12";
static const std::string KeyPos1; // = "Pos1";
static const std::string KeyEnd; // = "End";
static const std::string KeyInsert; // = "Insert";
static const std::string KeyPageUp; // = "PageUp";
static const std::string KeyPageDown; // = "PageDown";
static const std::string KeySpace; // = "Space";
// End special keys
protected:
InteractionEvent(BaseRenderer *);
~InteractionEvent() override;
friend MITKCORE_EXPORT bool operator==(const InteractionEvent &, const InteractionEvent &);
virtual bool IsEqual(const InteractionEvent &other) const;
private:
BaseRenderer *m_Sender;
};
/**
* Implementation of equality for event classes.
* Equality does \b not mean an exact copy or pointer equality.
*
* A match is determined by agreement in all attributes that are necessary to describe
* the event for a state machine transition.
* E.g. for a mouse event press event, it is important which modifiers are used,
* which mouse button was used to triggered the event, but the mouse position is irrelevant.
*/
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b);
MITKCORE_EXPORT bool operator!=(const InteractionEvent &a, const InteractionEvent &b);
/*
* Allow bitwise OR operation on enums.
*/
inline InteractionEvent::MouseButtons operator|(InteractionEvent::MouseButtons a, InteractionEvent::MouseButtons b)
{
return static_cast<InteractionEvent::MouseButtons>(static_cast<int>(a) | static_cast<int>(b));
}
inline InteractionEvent::MouseButtons &operator|=(InteractionEvent::MouseButtons &a,
InteractionEvent::MouseButtons &b)
{
a = static_cast<InteractionEvent::MouseButtons>(static_cast<int>(a) | static_cast<int>(b));
return a;
}
inline InteractionEvent::ModifierKeys operator|(InteractionEvent::ModifierKeys a, InteractionEvent::ModifierKeys b)
{
return static_cast<InteractionEvent::ModifierKeys>(static_cast<int>(a) | static_cast<int>(b));
}
inline InteractionEvent::ModifierKeys &operator|=(InteractionEvent::ModifierKeys &a,
InteractionEvent::ModifierKeys &b)
{
a = static_cast<InteractionEvent::ModifierKeys>(static_cast<int>(a) | static_cast<int>(b));
return a;
}
} /* namespace mitk */
#endif /* MITKINTERACTIONEVENT_H_ */
diff --git a/Modules/Core/include/mitkInteractionEventHandler.h b/Modules/Core/include/mitkInteractionEventHandler.h
index cd6c268a24..53fb42c44c 100644
--- a/Modules/Core/include/mitkInteractionEventHandler.h
+++ b/Modules/Core/include/mitkInteractionEventHandler.h
@@ -1,129 +1,129 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKEVENTHANDLER_H_
#define MITKEVENTHANDLER_H_
#include "itkLightObject.h"
#include "itkObjectFactory.h"
#include "mitkCommon.h"
#include "mitkEventConfig.h"
#include "mitkPropertyList.h"
#include <MitkCoreExports.h>
#include <string>
namespace us
{
class Module;
}
namespace mitk
{
/**
* \class EventHandler
* Serves as a base class for all objects and classes that handle mitk::InteractionEvents.
*
* It provides an interface to load configuration objects map of events to variant names.
*/
class InteractionEvent;
class MITKCORE_EXPORT InteractionEventHandler : public itk::Object
{
public:
- mitkClassMacroItkParent(InteractionEventHandler, itk::Object)
+ mitkClassMacroItkParent(InteractionEventHandler, itk::Object);
/**
* @brief Loads a configuration from an XML resource.
*
* Loads an event configuration from an XML resource file contained in the given module.
* Default is the Mitk module (core).
* The files have to be placed in the Resources/Interactions folder of their respective module.
* This method will remove all existing configuration and replaces it with the new one.
*
* @see SetEventConfig(const EventConfig&)
*
* @param filename The resource name relative to the Interactions resource folder.
* @param module The module containing the resource. Defaults to the Mitk module.
* @return \c true if the resource was successfully loaded, \c false otherwise.
*/
bool SetEventConfig(const std::string &filename, const us::Module *module = nullptr);
/**
* @brief Loads a configuration from an EventConfig object.
*
* Loads an event configuration from the given EventConfig object. This method will remove
* all existing configuration and replaces it with the new one.
*
* @see SetEventConfig(const std::string&, const Module*)
*
* @param config The EventConfig object containing the new configuration.
* @return \c true if the configuration was successfully loaded, \c false otherwise.
*/
bool SetEventConfig(const EventConfig &config);
/**
* @brief Returns the current configuration.
* @return A EventConfig object representing the current event configuration.
*/
EventConfig GetEventConfig() const;
/**
* @brief This method \e extends the configuration.
*
* The configuration from the resource provided is loaded and only the ones conflicting are replaced by the new one.
* This way several configuration files can be combined.
*
* @see AddEventConfig(const EventConfig&)
*
* @param filename The resource name relative to the Interactions resource folder.
* @param module The module containing the resource. Defaults to the Mitk module.
* @return \c true if the configuration was successfully added, \c false otherwise.
*/
bool AddEventConfig(const std::string &filename, const us::Module *module = nullptr);
/**
* @brief This method \e extends the configuration.
* The configuration from the EventConfig object is loaded and only the ones conflicting are replaced by the new
* one.
* This way several configurations can be combined.
*
* @see AddEventConfig(const std::string&, const Module*)
*
* @param config The EventConfig object whose configuration should be added.
* @return \c true if the configuration was successfully added, \c false otherwise.
*/
bool AddEventConfig(const EventConfig &config);
protected:
InteractionEventHandler();
~InteractionEventHandler() override;
/**
* Returns a PropertyList in which the parameters defined in the config file are listed.
*/
PropertyList::Pointer GetAttributes() const;
std::string MapToEventVariant(InteractionEvent *interactionEvent);
/**
* Is called whenever a new config object ist set.
* Overwrite this method e.g. to initialize EventHandler with parameters in configuration file.
*/
virtual void ConfigurationChanged();
private:
EventConfig m_EventConfig;
};
} /* namespace mitk */
#endif /* MITKEVENTHANDLER_H_ */
diff --git a/Modules/Core/include/mitkInteractionKeyEvent.h b/Modules/Core/include/mitkInteractionKeyEvent.h
index c479206c67..9625743a51 100644
--- a/Modules/Core/include/mitkInteractionKeyEvent.h
+++ b/Modules/Core/include/mitkInteractionKeyEvent.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKINTERACTIONKEYEVENT_H_
#define MITKINTERACTIONKEYEVENT_H_
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkInteractionEvent.h"
#include "mitkInteractionEventConst.h"
#include "mitkInteractionPositionEvent.h"
#include <cstring>
#include <MitkCoreExports.h>
/*
* Note: A Click with the MiddleButton is to be handled with MousePressEvents
*/
namespace mitk
{
/**
* \class InteractionKeyEvent
* \brief Handles key events.
* Takes a std::string for pressed key or special key description, mitk::ModifierKeys for modifiers
* \ingroup Interaction.
*/
class MITKCORE_EXPORT InteractionKeyEvent : public InteractionEvent
{
public:
mitkClassMacro(InteractionKeyEvent, InteractionEvent)
- mitkNewMacro3Param(Self, BaseRenderer *, const std::string &, ModifierKeys)
+ mitkNewMacro3Param(Self, BaseRenderer*, const std::string&, ModifierKeys);
- bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const override;
+ bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const override;
ModifierKeys GetModifiers() const;
std::string GetKey() const;
protected:
InteractionKeyEvent(BaseRenderer *, const std::string &key, ModifierKeys modifiers);
~InteractionKeyEvent() override;
bool IsEqual(const InteractionEvent &) const override;
private:
std::string m_Key;
ModifierKeys m_Modifiers;
};
} /* namespace mitk */
#endif /* MITKINTERACTIONKEYEVENT_H_ */
diff --git a/Modules/Core/include/mitkInteractionSchemeSwitcher.h b/Modules/Core/include/mitkInteractionSchemeSwitcher.h
index 1a39618918..673472a03d 100644
--- a/Modules/Core/include/mitkInteractionSchemeSwitcher.h
+++ b/Modules/Core/include/mitkInteractionSchemeSwitcher.h
@@ -1,121 +1,122 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKINTERACTIONSCHEMESWITCHER_H
#define MITKINTERACTIONSCHEMESWITCHER_H
#include "MitkCoreExports.h"
#include "mitkInteractionEventHandler.h"
#include <itkObject.h>
namespace mitk
{
/***********************************************************************
*
* \brief Class that offers a convenient way to switch between different
* interaction schemes and their different modes.
*
* This class offers the possibility to switch between the two different
* interaction schemes that are available:
*
* - MITK : The original interaction scheme
* - left mouse button : setting the cross position in the MPR view
* - middle mouse button : panning
* - right mouse button : zooming
*
* There are 3 different MITK modes that are available in the MITK scheme.
*
* - PACS : An alternative interaction scheme that behaves more like a
* PACS workstation
* - left mouse button : behavior depends on current MouseMode
* - middle mouse button : fast scrolling
* - right mouse button : level-window
* - ctrl + right button : zooming
* - shift+ right button : panning
*
* There are 5 different PACS modes that are available in the PACS scheme.
* Each mode defines the interaction that is performed on a left
* mouse button click:
* - Pointer : sets the cross position for the MPR
* - Scroll
* - Level-Window
* - Zoom
* - Pan
*
* When the interaction scheme is changed, this class sets the corresponding
* interaction .xml-files for a given interaction event handler.
*
***********************************************************************/
class MITKCORE_EXPORT InteractionSchemeSwitcher : public itk::Object
{
public:
#pragma GCC visibility push(default)
/**
\brief Can be observed by GUI class to update button states when type is changed programmatically.
*/
itkEventMacro(InteractionSchemeChangedEvent, itk::AnyEvent);
#pragma GCC visibility pop
mitkClassMacroItkParent(InteractionSchemeSwitcher, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
// enum of the different interaction schemes that are available
enum InteractionScheme
{
MITKStandard = 0,
MITKRotationUncoupled,
MITKRotationCoupled,
MITKSwivel,
PACSStandard,
PACSLevelWindow,
PACSPan,
PACSScroll,
PACSZoom
};
/**
* @brief Set the current interaction scheme of the given interaction event handler
*
* The interaction event handler is able to accept xml-configuration files that will define the interaction scheme.
* Based on the given interaction scheme different configuration files are loaded into the interaction event handler.
* The interaction scheme can be a variant of the MITK-mouse mode or the PACS-mouse mode (see 'enum InteractionScheme').
* The default is 'MITKStandard'.
* If the interaction scheme has been changed, an 'InteractionSchemeChangedEvent' will be invoked.
*
* @pre The interaction event handler has to be valid (!nullptr).
* @throw mitk::Exception, if the interaction event handler is invalid (==nullptr).
*
* @param interactionEventHandler The interaction event handler that defines the interaction scheme via configuration files
* @param interactionScheme The interaction scheme that should be used for the currently active interaction event handler.
*/
void SetInteractionScheme(mitk::InteractionEventHandler* interactionEventHandler, InteractionScheme interactionScheme);
/**
* @brief Return the current interaction scheme
*
* @return The currently set InteractionScheme
*/
InteractionScheme GetInteractionScheme() const { return m_InteractionScheme; };
protected:
InteractionSchemeSwitcher();
~InteractionSchemeSwitcher() override;
private:
InteractionScheme m_InteractionScheme;
};
} // namespace mitk
#endif // MITKINTERACTIONSCHEMESWITCHER_H
diff --git a/Modules/Core/include/mitkItkLoggingAdapter.h b/Modules/Core/include/mitkItkLoggingAdapter.h
index 3a233ffc47..fc01c00e99 100644
--- a/Modules/Core/include/mitkItkLoggingAdapter.h
+++ b/Modules/Core/include/mitkItkLoggingAdapter.h
@@ -1,58 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef ItkLoggingAdapter_H_HEADER_INCLUDED
#define ItkLoggingAdapter_H_HEADER_INCLUDED
#include <MitkCoreExports.h>
#include <itkObjectFactory.h>
#include <itkOutputWindow.h>
namespace mitk
{
//##Documentation
//## @brief Adapter that overwrites the standard itk logging output window and sends the logging messages to the MITK
// logging instead.
//## @ingroup IO
// this class is used to send output to stdout and not the itk window
class MITKCORE_EXPORT ItkLoggingAdapter : public itk::OutputWindow
{
public:
typedef ItkLoggingAdapter Self;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Run-time type information (and related methods). */
itkTypeMacro(ItkLoggingAdapter, itk::OutputWindow);
/** New macro for creation of through a Smart Pointer */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** @brief Initializes the logging adapter. Itk logging
* messages are redirected to MITK logging afterwards.
*/
static void Initialize();
void DisplayText(const char *s) override;
protected:
ItkLoggingAdapter();
~ItkLoggingAdapter() override;
private:
ItkLoggingAdapter(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
}
#endif /* mitkItkLoggingAdapter_H_HEADER_INCLUDED */
diff --git a/Modules/Core/include/mitkLevelWindowManager.h b/Modules/Core/include/mitkLevelWindowManager.h
index 72579f0128..b639cbc2b8 100644
--- a/Modules/Core/include/mitkLevelWindowManager.h
+++ b/Modules/Core/include/mitkLevelWindowManager.h
@@ -1,215 +1,215 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKLEVELWINDOWMANAGER_H
#define MITKLEVELWINDOWMANAGER_H
// mitk core
#include "mitkBaseProperty.h"
#include "mitkDataStorage.h"
#include "mitkLevelWindowProperty.h"
// c++
#include <map>
#include <utility>
namespace mitk
{
/**
@brief Provides access to the LevelWindowProperty object and LevelWindow of the "current" image.
- provides a LevelWindowProperty for purposes like GUI editors
- this property comes from one of two possible sources
- either something (e.g. the application) sets the property because of some user selection
- OR the "Auto top-most" logic is used to search a DataStorage for the image with the highest "layer" property
value
Changes on Level/Window can be set with SetLevelWindow() and will affect either the topmost layer image,
if isAutoTopMost() returns true, or an image which is set by SetLevelWindowProperty(LevelWindowProperty::Pointer
levelWindowProperty).
Changes to Level/Window, when another image gets active or by SetLevelWindow(const LevelWindow& levelWindow),
will be sent to all listeners by Modified().
DataStorageChanged() listens to the DataStorage for new or removed images. Depending on how m_AutoTopMost is set,
the new image becomes active or not. If an image is removed from the DataStorage and m_AutoTopMost is false,
there is a check to proof, if the active image is still available. If not, then m_AutoTopMost becomes true.
Note that this class is not thread safe at the moment!
*/
class MITKCORE_EXPORT LevelWindowManager : public itk::Object
{
public:
- mitkClassMacroItkParent(LevelWindowManager, itk::Object)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacroItkParent(LevelWindowManager, itk::Object);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void SetDataStorage(DataStorage *ds);
DataStorage *GetDataStorage();
/**
* @brief (Re-)Initialize the LevelWindowManager by setting the topmost image.
* Use the removedNode parameter if a node was removed.
*
* @param autoTopMost Set the topmost layer image to be affected by changes, if true.
* @param removedNode A node was removed from the data storage if != nullptr.
*/
void SetAutoTopMostImage(bool autoTopMost, const DataNode *removedNode = nullptr);
/**
* @brief (Re-)Initialize the LevelWindowManager by setting the selected images.
* Use the removedNode parameter if a node was removed.
*
* @param selectedImagesMode Set the selected images to be affected by changes, if true.
* @param removedNode A node was removed from the data storage if != nullptr.
*/
void SetSelectedImages(bool selectedImagesMode, const DataNode *removedNode = nullptr);
void RecalculateLevelWindowForSelectedComponent(const itk::EventObject&);
/**
* @brief Update the level window.
* This function is called if a property of a data node is changed.
* Relevant properties are defined in the protected 'ObserverToPropertyValueMap'-members.
*/
void Update(const itk::EventObject&);
/**
* @brief Update the level window.
* This function is only called if the 'selected' property of a data node is changed.
* This is done in order to avoid finding the correct image each time a node is selected but
* the 'm_SelectedImages' bool value is set to false (as the normal 'Update'-function would do).
* Changes of the 'selected' property happen quite a lot so this should not slow down the application.
*/
void UpdateSelected(const itk::EventObject&);
/**
* @brief Set a specific LevelWindowProperty; all changes will affect the image belonging to this property.
* @throw mitk::Exception Throw an exception if the there is no image in the data storage which belongs to this
* property.
*/
void SetLevelWindowProperty(LevelWindowProperty::Pointer levelWindowProperty);
/**
* @brief Set new Level/Window values and inform all listeners about changes.
*/
void SetLevelWindow(const LevelWindow &levelWindow);
/**
* @brief Return the current LevelWindowProperty object from the image that is affected by changes.
*
* @return The current LevelWindowProperty
*/
LevelWindowProperty::Pointer GetLevelWindowProperty();
/**
* @brief Return Level/Window values for the current image
*
* @return The LevelWindow value for the current image.
*/
const LevelWindow &GetLevelWindow();
/**
* @brief Return true, if the changes on slider or line-edits will affect the topmost layer image.
*
* @return Return the member value that denotes the auto-topmost mode.
*/
bool IsAutoTopMost();
/**
* @brief Return true, if changes on slider or line-edits will affect the currently selected images.
*
* @return Return the member value that denotes the selected-images mode.
*/
bool IsSelectedImages();
/** @brief This method is called when a node is added to the data storage.
* A listener on the data storage is used to call this method automatically after a node was added.
* @throw mitk::Exception Throws an exception if something is wrong, e.g. if the number of observers differs from
* the number of nodes.
*/
void DataStorageAddedNode(const DataNode *n = nullptr);
/** @brief This method is called when a node is removed to the data storage.
* A listener on the data storage is used to call this method automatically directly before a node will be
* removed.
* @throw mitk::Exception Throws an exception if something is wrong, e.g. if the number of observers differs from
* the number of nodes.
*/
void DataStorageRemovedNode(const DataNode *removedNode = nullptr);
/**
* @brief Change notifications from mitkLevelWindowProperty.
*/
void OnPropertyModified(const itk::EventObject &e);
/**
* @brief Return the currently active image.
*
* @return The member variable holding the currently active image.
*/
Image *GetCurrentImage();
/**
* @return Returns the current number of observers which are registered in this object.
* @throw mitk::Exception Throws an exception if the number of observers differs from
* the number of relevant objects
* which means that something is wrong.
*
*/
int GetNumberOfObservers();
/**
* @brief Returns all nodes in the DataStorage that have the following properties:
* - "binary" == false
* - "levelwindow"
* - DataType == Image / DiffusionImage / TensorImage / OdfImage / ShImage
*/
DataStorage::SetOfObjects::ConstPointer GetRelevantNodes();
protected:
LevelWindowManager();
~LevelWindowManager() override;
DataStorage::Pointer m_DataStorage;
/// Pointer to the LevelWindowProperty of the current image.
LevelWindowProperty::Pointer m_LevelWindowProperty;
typedef std::pair<unsigned long, DataNode::Pointer> PropDataPair;
typedef std::map<PropDataPair, BaseProperty::Pointer> ObserverToPropertyValueMap;
/// Map to hold observer IDs to every "visible" property of DataNode's BaseProperty.
ObserverToPropertyValueMap m_ObserverToVisibleProperty;
/// Map to hold observer IDs to every "layer" property of DataNode's BaseProperty.
ObserverToPropertyValueMap m_ObserverToLayerProperty;
/// Map to hold observer IDs to every "Image Rendering.Mode" property of DataNode's BaseProperty.
ObserverToPropertyValueMap m_ObserverToRenderingModeProperty;
/// Map to hold observer IDs to every "Image.Displayed Component" property of DataNode's BaseProperty.
ObserverToPropertyValueMap m_ObserverToDisplayedComponentProperty;
/// Map to hold observer IDs to every "imageForLevelWindow" property of DataNode's BaseProperty.
ObserverToPropertyValueMap m_ObserverToLevelWindowImageProperty;
/// Map to hold observer IDs to every "selected" property of DataNode's BaseProperty.
ObserverToPropertyValueMap m_ObserverToSelectedProperty;
/// Updates the internal observer list.
/// Ignores nodes which are marked to be deleted in the variable m_NodeMarkedToDelete.
void UpdateObservers();
/// Internal help method to clear both lists/maps.
void ClearPropObserverLists();
/// Internal help method to create both lists/maps.
void CreatePropObserverLists();
bool IgnoreNode(const DataNode* dataNode);
/// This variable holds a data node which will be deleted from the datastorage immediately
/// Nullptr, if there is no data node to be deleted.
const DataNode *m_NodeMarkedToDelete;
bool m_AutoTopMost;
bool m_SelectedImagesMode;
unsigned long m_ObserverTag;
bool m_IsObserverTagSet;
unsigned long m_PropertyModifiedTag;
Image *m_CurrentImage;
std::vector<DataNode::Pointer> m_RelevantDataNodes;
bool m_IsPropertyModifiedTagSet;
bool m_LevelWindowMutex;
};
}
#endif // MITKLEVELWINDOWMANAGER_H
diff --git a/Modules/Core/include/mitkLevelWindowProperty.h b/Modules/Core/include/mitkLevelWindowProperty.h
index 332ce3d486..8fcf60c804 100755
--- a/Modules/Core/include/mitkLevelWindowProperty.h
+++ b/Modules/Core/include/mitkLevelWindowProperty.h
@@ -1,83 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKLEVELWINDOWPROPERTY_H_HEADER_INCLUDED_C10EEAA8
#define MITKLEVELWINDOWPROPERTY_H_HEADER_INCLUDED_C10EEAA8
#include "mitkBaseProperty.h"
#include "mitkLevelWindow.h"
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* @brief The LevelWindowProperty class Property for the mitk::LevelWindow
*
* @ingroup DataManagement
*
* @note If you want to apply the mitk::LevelWindowProperty to an mitk::Image,
* make sure to set the mitk::RenderingModeProperty to a mode which supports
* level window (e.g. LEVELWINDOW_COLOR). Make sure to check the documentation
* of the mitk::RenderingModeProperty. For a code example how to use the
* mitk::LevelWindowProperty check the mitkImageVtkMapper2DLevelWindowTest.cpp
* in Core\Code\Testing.
*/
class MITKCORE_EXPORT LevelWindowProperty : public BaseProperty
{
protected:
LevelWindow m_LevWin;
LevelWindowProperty();
LevelWindowProperty(const LevelWindowProperty &other);
LevelWindowProperty(const mitk::LevelWindow &levWin);
public:
mitkClassMacro(LevelWindowProperty, BaseProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) mitkNewMacro1Param(LevelWindowProperty, const mitk::LevelWindow &);
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self) mitkNewMacro1Param(LevelWindowProperty, const mitk::LevelWindow &);
typedef LevelWindow ValueType;
~LevelWindowProperty() override;
const mitk::LevelWindow &GetLevelWindow() const;
const mitk::LevelWindow &GetValue() const;
void SetLevelWindow(const LevelWindow &levWin);
void SetValue(const ValueType &levWin);
std::string GetValueAsString() const override;
using BaseProperty::operator=;
private:
// purposely not implemented
LevelWindowProperty &operator=(const LevelWindowProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
#endif /* MITKLEVELWINDOWPROPERTY_H_HEADER_INCLUDED_C10EEAA8 */
diff --git a/Modules/Core/include/mitkLimitedLinearUndo.h b/Modules/Core/include/mitkLimitedLinearUndo.h
index fb4d7c4ed6..fee98b5b91 100644
--- a/Modules/Core/include/mitkLimitedLinearUndo.h
+++ b/Modules/Core/include/mitkLimitedLinearUndo.h
@@ -1,158 +1,159 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef LIMITEDLINEARUNDO_H_HEADER_INCLUDED_C16E9C96
#define LIMITEDLINEARUNDO_H_HEADER_INCLUDED_C16E9C96
// MITK header
#include "mitkOperationEvent.h"
#include "mitkUndoModel.h"
#include <MitkCoreExports.h>
// STL header
#include <vector>
// ITK header
#pragma GCC visibility push(default)
#include <itkEventObject.h>
#pragma GCC visibility pop
#include <deque>
namespace mitk
{
//##Documentation
//## @brief A linear undo model with one undo and one redo stack.
//##
//## Derived from UndoModel AND itk::Object. Invokes ITK-events to signal listening
//## GUI elements, whether each of the stacks is empty or not (to enable/disable button, ...)
class MITKCORE_EXPORT LimitedLinearUndo : public UndoModel
{
public:
typedef std::deque<UndoStackItem *> UndoContainer;
typedef std::deque<UndoStackItem *>::reverse_iterator UndoContainerRevIter;
mitkClassMacro(LimitedLinearUndo, UndoModel);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
bool SetOperationEvent(UndoStackItem *stackItem) override;
//##Documentation
//## @brief Undoes the last changes
//##
//## Reads the top element of the Undo-Stack,
//## executes the operation,
//## swaps the OperationEvent-Undo with the Operation
//## and sets it to Redo-Stack
bool Undo() override;
bool Undo(bool) override;
//##Documentation
//## @brief Undoes all changes until ObjectEventID oeid
virtual bool Undo(int oeid);
//##Documentation
//## @brief Undoes the last changes
//##
//## Reads the top element of the Redo-Stack,
//## executes the operation,
//## swaps the OperationEvent-Operation with the Undo-Operation
//## and sets it to Undo-Stack
bool Redo() override;
bool Redo(bool) override;
//##Documentation
//## @brief Redoes all changes until ObjectEventID oeid
virtual bool Redo(int oeid);
//##Documentation
//## @brief Clears UndoList and RedoList
void Clear() override;
//##Documentation
//## @brief Clears the RedoList
void ClearRedoList() override;
//##Documentation
//## @brief True, if RedoList is empty
bool RedoListEmpty() override;
//##Documentation
//## @brief Gets the limit on the size of the undo history.
//## The undo limit determines how many items can be stored
//## in the undo stack. If the value is 0 that means that
//## there is no limit.
std::size_t GetUndoLimit() const override;
//##Documentation
//## @brief Sets a limit on the size of the undo history.
//## If the limit is reached, the oldest undo items will
//## be dropped from the bottom of the undo stack.
//## The 0 value means that there is no limit.
//## @param limit the maximum number of items on the stack
void SetUndoLimit(std::size_t limit) override;
//##Documentation
//## @brief Returns the ObjectEventId of the
//## top element in the OperationHistory
int GetLastObjectEventIdInList() override;
//##Documentation
//## @brief Returns the GroupEventId of the
//## top element in the OperationHistory
int GetLastGroupEventIdInList() override;
//##Documentation
//## @brief Returns the last specified OperationEvent in Undo-list
//## corresponding to the given values; if nothing found, then returns nullptr
OperationEvent *GetLastOfType(OperationActor *destination, OperationType opType) override;
protected:
//##Documentation
//## Constructor
LimitedLinearUndo();
//##Documentation
//## Destructor
~LimitedLinearUndo() override;
//## @brief Convenience method to free the memory of
//## elements in the list and to clear the list
void ClearList(UndoContainer *list);
UndoContainer m_UndoList;
UndoContainer m_RedoList;
private:
int FirstObjectEventIdOfCurrentGroup(UndoContainer &stack);
std::size_t m_UndoLimit;
};
#pragma GCC visibility push(default)
/// Some itk events to notify listening GUI elements, when the undo or redo stack is empty (diable undo button)
/// or when there are items in the stack (enable button)
itkEventMacro(UndoStackEvent, itk::ModifiedEvent);
itkEventMacro(UndoEmptyEvent, UndoStackEvent);
itkEventMacro(RedoEmptyEvent, UndoStackEvent);
itkEventMacro(UndoNotEmptyEvent, UndoStackEvent);
itkEventMacro(RedoNotEmptyEvent, UndoStackEvent);
/// Additional unused events, if anybody wants to put an artificial limit to the possible number of items in the stack
itkEventMacro(UndoFullEvent, UndoStackEvent);
itkEventMacro(RedoFullEvent, UndoStackEvent);
#pragma GCC visibility pop
} // namespace mitk
#endif /* LIMITEDLINEARUNDO_H_HEADER_INCLUDED_C16E9C96 */
diff --git a/Modules/Core/include/mitkLookupTable.h b/Modules/Core/include/mitkLookupTable.h
index 5209d8b4f5..ef88aba897 100644
--- a/Modules/Core/include/mitkLookupTable.h
+++ b/Modules/Core/include/mitkLookupTable.h
@@ -1,272 +1,274 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkLookupTable_h
#define mitkLookupTable_h
#include "mitkCommon.h"
#include <MitkCoreExports.h>
#include <itkDataObject.h>
#include <itkObjectFactory.h>
#include <vtkLookupTable.h>
#include <vtkSmartPointer.h>
class vtkColorTransferFunction;
class vtkPiecewiseFunction;
namespace mitk
{
/**
* @brief The LookupTable class mitk wrapper for a vtkLookupTable
* @ingroup DataManagement
*
* This class can be used to color images with a LookupTable, such as the
* vtkLookupTable.
* @note If you want to use this as a property for an mitk::Image, make sure
* to use the mitk::LookupTableProperty and set the mitk::RenderingModeProperty
* to a mode which supports lookup tables (e.g. LOOKUPTABLE_COLOR). Make
* sure to check the documentation of the mitk::RenderingModeProperty. For a
* code example how to use the mitk::LookupTable check the
* mitkImageVtkMapper2DLookupTableTest.cpp in Core\Code\Testing.
*/
class MITKCORE_EXPORT LookupTable : public itk::DataObject
{
public:
/**
* @brief RawLookupTableType raw lookuptable typedef for convenience.
*/
typedef unsigned char RawLookupTableType;
mitkClassMacroItkParent(LookupTable, itk::DataObject);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/**
* @brief GetVtkLookupTable Getter for the internally wrapped vtkLookupTable.
*/
virtual vtkSmartPointer<vtkLookupTable> GetVtkLookupTable() const;
/**
* @brief GetRawLookupTable Getter for the raw lookuptable array.
*/
virtual RawLookupTableType *GetRawLookupTable() const;
/**
* @brief SetVtkLookupTable Setter for the internal lookuptable.
* @param lut The lookuptable.
*/
virtual void SetVtkLookupTable(vtkSmartPointer<vtkLookupTable> lut);
/**
* @brief ChangeOpacityForAll Set the opacity for all table values.
* @param opacity Opacity between 0.0 and 1.0.
*/
virtual void ChangeOpacityForAll(float opacity);
/**
* @brief ChangeOpacity Set the opacity for a specific table index.
* @param index The lookuptable index.
* @param opacity Opacity between 0.0 and 1.0.
*/
virtual void ChangeOpacity(int index, float opacity);
/**
* @brief GetColor convenience method wrapping the vtkLookupTable::GetColor() method.
*
* Map one value through the lookup table and return the color as an RGB array of doubles between 0 and 1.
* @param value The value you want to map.
* @param rgb RGB values between 0 and 1.
*/
virtual void GetColor(double value, double rgb[3]);
/**
* @brief GetTableValue convenience method wrapping the vtkLookupTable::GetTableValue() method.
* @param index The index you want to get.
* @param rgba RGB values between 0 and 1.
*/
virtual void GetTableValue(int index, double rgba[4]);
/**
* @brief SetTableValue convenience method wrapping the vtkLookupTable::SetTableValue() method.
* @param index The index you want to set.
* @param rgba RGB values between 0 and 1.
*/
virtual void SetTableValue(int index, double rgba[4]);
itkSetMacro(Window, float);
itkSetMacro(Level, float);
itkSetMacro(Opacity, float);
/**
* @brief equality operator implementation
*/
virtual bool operator==(const mitk::LookupTable &LookupTable) const;
/**
* @brief non equality operator implementation
*/
virtual bool operator!=(const LookupTable &LookupTable) const;
/**
* @brief implementation necessary because operator made
* private in itk::Object
*/
virtual LookupTable &operator=(const LookupTable &LookupTable);
/**
* @brief Updates the output information of the current object by calling
* updateOutputInformation of the data objects source object.
*/
void UpdateOutputInformation() override;
/**
* @brief Sets the requested Region to the largest possible region.
* This method is not implemented, since this is the default
* behavior of the itk pipeline and we do not support the
* requested-region mechanism for lookup-tables
*/
void SetRequestedRegionToLargestPossibleRegion() override;
/**
* @brief Checks, if the requested region lies outside of the buffered region by
* calling verifyRequestedRegion().
*/
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
/**
* @brief Checks if the requested region is completely contained in
* the buffered region. Since we always want to process the lookup
* table as a whole, this method always returns true
*/
bool VerifyRequestedRegion() override;
/**
* @brief This method has no effect for lookup tables, since we do
* not support the region-mechanism
*/
void SetRequestedRegion(const itk::DataObject *data) override;
LookupTable();
~LookupTable() override;
/**
* \deprecatedSince{2014_03} Please use CreateColorTransferFunction() instead
*/
DEPRECATED(void CreateColorTransferFunction(vtkColorTransferFunction *&colorFunction));
/**
* \deprecatedSince{2014_03} Please use CreateOpacityTransferFunction() instead
*/
DEPRECATED(void CreateOpacityTransferFunction(vtkPiecewiseFunction *&opacityFunction));
/**
* \deprecatedSince{2014_03} Please use CreateGradientTransferFunction() instead
*/
DEPRECATED(void CreateGradientTransferFunction(vtkPiecewiseFunction *&gradientFunction));
vtkSmartPointer<vtkColorTransferFunction> CreateColorTransferFunction();
vtkSmartPointer<vtkPiecewiseFunction> CreateOpacityTransferFunction();
vtkSmartPointer<vtkPiecewiseFunction> CreateGradientTransferFunction();
/**
* @brief The LookupTableType enum for different predefined lookup tables.
*
* \li GRAYSCALE Our default level-window (sometimes referred to as window-level by other sources) setup for a test
* image looks like this:
* \image html ExampleLevelWindowColor.png
* \li INVERSE_GRAYSCALE Inverse LookupTable of GRAYSCALE.
* \li HOT_IRON A LookupTable for red colors.
* \li JET A LookupTable for JET color rendering.
* \li LEGACY_BINARY A LookupTable for binary images.
* \li LEGACY_RAINBOW_COLOR A rainbow-like LookupTable.
* \li MULTILABEL A LookupTable for multilabel images.
* \li PET_COLOR A LookupTable for PET color rendering.
* \li PET_20 A LookupTable for PET_20 color rendering.
*
* The different LookupTableTypes can be applied in the MitkWorkbench via right-clicking
* on an image and choosing a color map.
*/
enum LookupTableType
{
GRAYSCALE,
INVERSE_GRAYSCALE,
HOT_IRON,
JET,
JET_TRANSPARENT,
PLASMA,
INFERNO,
VIRIDIS,
MAGMA,
LEGACY_BINARY,
LEGACY_RAINBOW_COLOR,
MULTILABEL,
PET_COLOR,
PET_20
};
static std::vector<std::string> typenameList;
/**
* @brief Set the look-up table type by enum (or integer).
* @details Returns if the given type doesn't exist. Only changes the type if it is different
* from the current one.
*/
virtual void SetType(const LookupTableType type);
/**
* @brief Set the look-up table type by string.
* @details Returns if the given type doesn't exist. Only changes the type if it is different
* from the current one.
*/
virtual void SetType(const std::string &typeName);
/**
* @brief Return the current look-up table type.
*/
virtual LookupTableType GetActiveType() const;
/**
* @brief Return the current look-up table type as a string.
*/
virtual std::string GetActiveTypeAsString() const;
protected:
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
LookupTable(const LookupTable &other);
virtual void BuildGrayScaleLookupTable();
virtual void BuildLegacyBinaryLookupTable();
virtual void BuildLegacyRainbowColorLookupTable();
virtual void BuildInverseGrayScaleLookupTable();
virtual void BuildHotIronLookupTable();
virtual void BuildPlasmaLookupTable();
virtual void BuildInfernoLookupTable();
virtual void BuildViridisLookupTable();
virtual void BuildMagmaLookupTable();
virtual void BuildJetLookupTable(bool transparent = false);
virtual void BuildPETColorLookupTable();
virtual void BuildPET20LookupTable();
virtual void BuildMultiLabelLookupTable();
vtkSmartPointer<vtkLookupTable> m_LookupTable;
float m_Window;
float m_Level;
float m_Opacity;
LookupTableType m_Type;
private:
itk::LightObject::Pointer InternalClone() const override;
};
} // namespace mitk
#endif /* mitkLookupTable_h */
diff --git a/Modules/Core/include/mitkLookupTableProperty.h b/Modules/Core/include/mitkLookupTableProperty.h
index 42cd2aed44..7450b71adc 100644
--- a/Modules/Core/include/mitkLookupTableProperty.h
+++ b/Modules/Core/include/mitkLookupTableProperty.h
@@ -1,82 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKLookupTablePROPERTY_H_HEADER_INCLUDED_C10EEAA8
#define MITKLookupTablePROPERTY_H_HEADER_INCLUDED_C10EEAA8
#include "mitkBaseProperty.h"
#include "mitkLookupTable.h"
#include <MitkCoreExports.h>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* @brief The LookupTableProperty class Property to associate mitk::LookupTable
* to an mitk::DataNode.
* @ingroup DataManagement
*
* @note If you want to use this property to colorize an mitk::Image, make sure
* to set the mitk::RenderingModeProperty to a mode which supports lookup tables
* (e.g. LOOKUPTABLE_COLOR). Make sure to check the documentation of the
* mitk::RenderingModeProperty. For a code example how to use the mitk::LookupTable
* and this property check the mitkImageVtkMapper2DLookupTableTest.cpp in
* Core\Code\Testing.
*/
class MITKCORE_EXPORT LookupTableProperty : public BaseProperty
{
protected:
LookupTable::Pointer m_LookupTable;
LookupTableProperty();
LookupTableProperty(const LookupTableProperty &);
LookupTableProperty(const mitk::LookupTable::Pointer lut);
public:
typedef LookupTable::Pointer ValueType;
mitkClassMacro(LookupTableProperty, BaseProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self)
mitkNewMacro1Param(LookupTableProperty, const mitk::LookupTable::Pointer);
itkGetObjectMacro(LookupTable, LookupTable);
ValueType GetValue() const;
void SetLookupTable(const mitk::LookupTable::Pointer aLookupTable);
void SetValue(const ValueType &);
std::string GetValueAsString() const override;
using BaseProperty::operator=;
private:
// purposely not implemented
LookupTableProperty &operator=(const LookupTableProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
#endif /* MITKLookupTablePROPERTY_H_HEADER_INCLUDED_C10EEAA8 */
diff --git a/Modules/Core/include/mitkModalityProperty.h b/Modules/Core/include/mitkModalityProperty.h
index 494d47a217..e5c2b35a89 100644
--- a/Modules/Core/include/mitkModalityProperty.h
+++ b/Modules/Core/include/mitkModalityProperty.h
@@ -1,62 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkModalityProperty_h_Included
#define mitkModalityProperty_h_Included
#include "mitkEnumerationProperty.h"
#include <MitkCoreExports.h>
#include <itkObjectFactory.h>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
\brief Enumerates all known modalities
\ingroup DataManagement
*/
class MITKCORE_EXPORT ModalityProperty : public EnumerationProperty
{
public:
mitkClassMacro(ModalityProperty, EnumerationProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) mitkNewMacro1Param(ModalityProperty, const IdType &);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ mitkNewMacro1Param(ModalityProperty, const IdType&);
mitkNewMacro1Param(ModalityProperty, const std::string &);
using BaseProperty::operator=;
protected:
ModalityProperty();
ModalityProperty(const IdType &value);
ModalityProperty(const std::string &value);
~ModalityProperty() override;
virtual void AddEnumerationTypes();
private:
// purposely not implemented
const ModalityProperty &operator=(const ModalityProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace
#endif
diff --git a/Modules/Core/include/mitkMouseModeSwitcher.h b/Modules/Core/include/mitkMouseModeSwitcher.h
index edbf86b55f..17b9bd5f54 100644
--- a/Modules/Core/include/mitkMouseModeSwitcher.h
+++ b/Modules/Core/include/mitkMouseModeSwitcher.h
@@ -1,126 +1,127 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKMouseModeSwitcher_H_HEADER_INCLUDED_C10DC4EB
#define MITKMouseModeSwitcher_H_HEADER_INCLUDED_C10DC4EB
#include "MitkCoreExports.h"
#include "mitkDisplayInteractor.h"
#include <itkObject.h>
namespace mitk
{
/***********************************************************************
*
* \brief Class that offers a convenient way to switch between different
* interaction schemes
*
* This class offers the possibility to switch between the two different
* interaction schemes that are available:
* - MITK : The original interaction scheme
* - left mouse button : setting the cross position in the MPR view
* - middle mouse button : panning
* - right mouse button : zooming
*
*
* - PACS : an alternative interaction scheme that behaves more like a
* PACS workstation
* - left mouse button : behavior depends on current MouseMode
* - middle mouse button : fast scrolling
* - right mouse button : level-window
* - ctrl + right button : zooming
* - shift+ right button : panning
*
* There are 5 different MouseModes that are available in the PACS scheme.
* Each MouseMode defines the interaction that is performed on a left
* mouse button click:
* - Pointer : sets the cross position for the MPR
* - Scroll
* - Level-Window
* - Zoom
* - Pan
*
* When the interaction scheme or the MouseMode is changed, this class
* manages the adding and removing of the relevant listeners offering
* a convenient way to modify the interaction behavior.
*
***********************************************************************/
class MITKCORE_EXPORT MouseModeSwitcher : public itk::Object
{
public:
#pragma GCC visibility push(default)
/**
\brief Can be observed by GUI class to update button states when mode is changed programatically.
*/
itkEventMacro(MouseModeChangedEvent, itk::AnyEvent);
#pragma GCC visibility pop
mitkClassMacroItkParent(MouseModeSwitcher, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
// enum of the different interaction schemes that are available
enum InteractionScheme {
PACS = 0,
MITK = 1,
ROTATION = 2,
ROTATIONLINKED = 3,
SWIVEL = 4
};
// enum of available mouse modes for PACS interaction scheme
enum MouseMode
{
MousePointer = 0,
Scroll,
LevelWindow,
Zoom,
Pan
};
/**
* \brief Setter for interaction scheme
*/
void SetInteractionScheme(InteractionScheme);
/**
* \brief Setter for mouse mode
*/
void SelectMouseMode(MouseMode mode);
/**
* \brief Returns the current mouse mode
*/
MouseMode GetCurrentMouseMode() const;
protected:
MouseModeSwitcher();
~MouseModeSwitcher() override;
private:
/**
* \brief Initializes the listener with the MITK default behavior.
*/
void InitializeListeners();
InteractionScheme m_ActiveInteractionScheme;
MouseMode m_ActiveMouseMode;
DisplayInteractor::Pointer m_CurrentObserver;
/**
* Reference to the service registration of the observer,
* it is needed to unregister the observer on unload.
*/
us::ServiceRegistration<InteractionEventObserver> m_ServiceRegistration;
};
} // namespace mitk
#endif /* MITKMouseModeSwitcher_H_HEADER_INCLUDED_C10DC4EB */
diff --git a/Modules/Core/include/mitkNodePredicateFunction.h b/Modules/Core/include/mitkNodePredicateFunction.h
index 52a193003e..0046e5a098 100644
--- a/Modules/Core/include/mitkNodePredicateFunction.h
+++ b/Modules/Core/include/mitkNodePredicateFunction.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkNodePredicateFunction_h
#define mitkNodePredicateFunction_h
#include <mitkNodePredicateBase.h>
#include <MitkCoreExports.h>
#include <functional>
namespace mitk
{
/**
* \brief Predicate that transfers the check to a specific Callable.
*
* Callables include free functions, bound member functions, function
* objects, and lambda expressions. The signature of the Callable must
* match NodePredicateFunction::CheckNode.
*
* \ingroup DataStorage
*/
class MITKCORE_EXPORT NodePredicateFunction : public NodePredicateBase
{
public:
using FunctionType = std::function<bool (const mitk::DataNode *)>;
- mitkClassMacro(NodePredicateFunction, NodePredicateBase)
- mitkNewMacro1Param(NodePredicateFunction, const FunctionType &)
+ mitkClassMacro(NodePredicateFunction, NodePredicateBase);
+ mitkNewMacro1Param(NodePredicateFunction, const FunctionType&);
~NodePredicateFunction() override;
bool CheckNode(const mitk::DataNode *node) const override;
protected:
explicit NodePredicateFunction(const FunctionType &function);
FunctionType m_Function;
};
}
#endif
diff --git a/Modules/Core/include/mitkPlaneGeometry.h b/Modules/Core/include/mitkPlaneGeometry.h
index 1bc30cc96e..ad7644a739 100644
--- a/Modules/Core/include/mitkPlaneGeometry.h
+++ b/Modules/Core/include/mitkPlaneGeometry.h
@@ -1,607 +1,608 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
/**
* \brief Describes the geometry of a plane object
*
* Describes a two-dimensional manifold, i.e., to put it simply,
* an object that can be described using a 2D coordinate-system.
*
* PlaneGeometry can map points between 3D world coordinates
* (in mm) and the described 2D coordinate-system (in mm) by first projecting
* the 3D point onto the 2D manifold and then calculating the 2D-coordinates
* (in mm). These 2D-mm-coordinates can be further converted into
* 2D-unit-coordinates (e.g., pixels), giving a parameter representation of
* the object with parameter values inside a rectangle
* (e.g., [0,0]..[width, height]), which is the bounding box (bounding range
* in z-direction always [0]..[1]).
*
* A PlaneGeometry describes the 2D representation within a 3D object (derived from BaseGeometry). For example,
* a single CT-image (slice) is 2D in the sense that you can access the
* pixels using 2D-coordinates, but is also 3D, as the pixels are really
* voxels, thus have an extension (thickness) in the 3rd dimension.
*
*
* Optionally, a reference BaseGeometry can be specified, which usually would
* be the geometry associated with the underlying dataset. This is currently
* used for calculating the intersection of inclined / rotated planes
* (represented as PlaneGeometry) with the bounding box of the associated
* BaseGeometry.
*
* \warning The PlaneGeometry are not necessarily up-to-date and not even
* initialized. As described in the previous paragraph, one of the
* Generate-/Copy-/UpdateOutputInformation methods have to initialize it.
* mitk::BaseData::GetPlaneGeometry() makes sure, that the PlaneGeometry is
* up-to-date before returning it (by setting the update extent appropriately
* and calling UpdateOutputInformation).
*
* Rule: everything is in mm (or ms for temporal information) if not
* stated otherwise.
* \ingroup Geometry
*/
#ifndef PLANEGEOMETRY_H_HEADER_INCLUDED_C1C68A2C
#define PLANEGEOMETRY_H_HEADER_INCLUDED_C1C68A2C
#include "mitkBaseGeometry.h"
#include "mitkRestorePlanePositionOperation.h"
#include <MitkCoreExports.h>
#include <vnl/vnl_cross.h>
namespace mitk
{
template <class TCoordRep, unsigned int NPointDimension>
class Line;
typedef Line<ScalarType, 3> Line3D;
class PlaneGeometry;
/** \deprecatedSince{2014_10} This class is deprecated. Please use PlaneGeometry instead. */
DEPRECATED(typedef PlaneGeometry Geometry2D);
/**
* \brief Describes a two-dimensional, rectangular plane
*
* \ingroup Geometry
*/
class MITKCORE_EXPORT PlaneGeometry : public BaseGeometry
{
public:
mitkClassMacro(PlaneGeometry, BaseGeometry);
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
enum PlaneOrientation {
Axial,
Sagittal,
Frontal, // also known as "Coronal" in mitk.
None // This defines the PlaneGeometry for the 3D renderWindow which
// curiously also needs a PlaneGeometry. This should be reconsidered some time.
};
virtual void IndexToWorld(const Point2D &pt_units, Point2D &pt_mm) const;
virtual void WorldToIndex(const Point2D &pt_mm, Point2D &pt_units) const;
//##Documentation
//## @brief Convert (continuous or discrete) index coordinates of a \em vector
//## \a vec_units to world coordinates (in mm)
//## @deprecated First parameter (Point2D) is not used. If possible, please use void IndexToWorld(const
// mitk::Vector2D& vec_units, mitk::Vector2D& vec_mm) const.
//## For further information about coordinates types, please see the Geometry documentation
virtual void IndexToWorld(const mitk::Point2D &atPt2d_untis,
const mitk::Vector2D &vec_units,
mitk::Vector2D &vec_mm) const;
//##Documentation
//## @brief Convert (continuous or discrete) index coordinates of a \em vector
//## \a vec_units to world coordinates (in mm)
//## For further information about coordinates types, please see the Geometry documentation
virtual void IndexToWorld(const mitk::Vector2D &vec_units, mitk::Vector2D &vec_mm) const;
//##Documentation
//## @brief Convert world coordinates (in mm) of a \em vector
//## \a vec_mm to (continuous!) index coordinates.
//## @deprecated First parameter (Point2D) is not used. If possible, please use void WorldToIndex(const
// mitk::Vector2D& vec_mm, mitk::Vector2D& vec_units) const.
//## For further information about coordinates types, please see the Geometry documentation
virtual void WorldToIndex(const mitk::Point2D &atPt2d_mm,
const mitk::Vector2D &vec_mm,
mitk::Vector2D &vec_units) const;
//##Documentation
//## @brief Convert world coordinates (in mm) of a \em vector
//## \a vec_mm to (continuous!) index coordinates.
//## For further information about coordinates types, please see the Geometry documentation
virtual void WorldToIndex(const mitk::Vector2D &vec_mm, mitk::Vector2D &vec_units) const;
/**
* \brief Initialize a plane with orientation \a planeorientation
* (default: axial) with respect to \a BaseGeometry (default: identity).
* Spacing also taken from \a BaseGeometry.
*
* \warning A former version of this method created a geometry with unit
* spacing. For unit spacing use
*
* \code
* // for in-plane unit spacing:
* thisgeometry->SetSizeInUnits(thisgeometry->GetExtentInMM(0),
* thisgeometry->GetExtentInMM(1));
* // additionally, for unit spacing in normal direction (former version
* // did not do this):
* thisgeometry->SetExtentInMM(2, 1.0);
* \endcode
*/
virtual void InitializeStandardPlane(const BaseGeometry *geometry3D,
PlaneOrientation planeorientation = Axial,
ScalarType zPosition = 0,
bool frontside = true,
bool rotated = false,
bool top = true);
/**
* \brief Initialize a plane with orientation \a planeorientation
* (default: axial) with respect to \a BaseGeometry (default: identity).
* Spacing also taken from \a BaseGeometry.
*
* \param top if \a true, create plane at top, otherwise at bottom
* (for PlaneOrientation Axial, for other plane locations respectively)
*/
virtual void InitializeStandardPlane(const BaseGeometry *geometry3D,
bool top,
PlaneOrientation planeorientation = Axial,
bool frontside = true,
bool rotated = false);
/**
* \brief Initialize a plane with orientation \a planeorientation
* (default: axial) with respect to \a transform (default: identity)
* given width and height in units.
*
* \a Rotated means rotated by 180 degrees (1/2 rotation) within the plane.
* Rotation by 90 degrees (1/4 rotation) is not implemented as of now.
*
* \a Frontside/Backside:
* Viewed from below = frontside in the axial case;
* (radiologist's view versus neuro-surgeon's view, see:
* http://www.itk.org/Wiki/images/e/ed/DICOM-OrientationDiagram-Radiologist-vs-NeuroSurgeon.png )
* Viewed from front = frontside in the coronal case;
* Viewed from left = frontside in the sagittal case.
*
* \a Cave/Caution: Currently only RPI, LAI, LPS and RAS in the three standard planes are covered,
* i.e. 12 cases of 144: 3 standard planes * 48 coordinate orientations = 144 cases.
*/
virtual void InitializeStandardPlane(ScalarType width,
ScalarType height,
const AffineTransform3D *transform = nullptr,
PlaneOrientation planeorientation = Axial,
ScalarType zPosition = 0,
bool frontside = true,
bool rotated = false,
bool top = true);
/**
* \brief Initialize plane with orientation \a planeorientation
* (default: axial) given width, height and spacing.
*
*/
virtual void InitializeStandardPlane(ScalarType width,
ScalarType height,
const Vector3D &spacing,
PlaneOrientation planeorientation = Axial,
ScalarType zPosition = 0,
bool frontside = true,
bool rotated = false,
bool top = true);
/**
* \brief Initialize plane by width and height in pixels, right-/down-vector
* (itk) to describe orientation in world-space (vectors will be normalized)
* and spacing (default: 1.0 mm in all directions).
*
* The vectors are normalized and multiplied by the respective spacing before
* they are set in the matrix.
*
* This overloaded version of InitializeStandardPlane() creates only righthanded
* coordinate orientations, unless spacing contains 1 or 3 negative entries.
*
*/
virtual void InitializeStandardPlane(ScalarType width,
ScalarType height,
const Vector3D &rightVector,
const Vector3D &downVector,
const Vector3D *spacing = nullptr);
/**
* \brief Initialize plane by width and height in pixels,
* right-/down-vector (vnl) to describe orientation in world-space (vectors
* will be normalized) and spacing (default: 1.0 mm in all directions).
*
* The vectors are normalized and multiplied by the respective spacing
* before they are set in the matrix.
*
* This overloaded version of InitializeStandardPlane() creates only righthanded
* coordinate orientations, unless spacing contains 1 or 3 negative entries.
*
*/
virtual void InitializeStandardPlane(ScalarType width,
ScalarType height,
const VnlVector &rightVector,
const VnlVector &downVector,
const Vector3D *spacing = nullptr);
/**
* \brief Initialize plane by right-/down-vector (itk) and spacing
* (default: 1.0 mm in all directions).
*
* The length of the right-/-down-vector is used as width/height in units,
* respectively. Then, the vectors are normalized and multiplied by the
* respective spacing before they are set in the matrix.
*/
virtual void InitializeStandardPlane(const Vector3D &rightVector,
const Vector3D &downVector,
const Vector3D *spacing = nullptr);
/**
* \brief Initialize plane by right-/down-vector (vnl) and spacing
* (default: 1.0 mm in all directions).
*
* The length of the right-/-down-vector is used as width/height in units,
* respectively. Then, the vectors are normalized and multiplied by the
* respective spacing before they are set in the matrix.
*/
virtual void InitializeStandardPlane(const VnlVector &rightVector,
const VnlVector &downVector,
const Vector3D *spacing = nullptr);
/**
* \brief Initialize plane by origin and normal (size is 1.0 mm in
* all directions, direction of right-/down-vector valid but
* undefined).
* \warning This function can only produce righthanded coordinate orientation, not lefthanded.
*/
virtual void InitializePlane(const Point3D &origin, const Vector3D &normal);
/**
* \brief Initialize plane by right-/down-vector.
*
* \warning The vectors are set into the matrix as they are,
* \em without normalization!
* This function creates a righthanded IndexToWorldTransform,
* only a negative thickness could still make it lefthanded.
*/
void SetMatrixByVectors(const VnlVector &rightVector, const VnlVector &downVector, ScalarType thickness = 1.0);
/**
* \brief Check if matrix is a rotation matrix:
* - determinant is 1?
* - R*R^T is ID?
* Output warning otherwise.
*/
static bool CheckRotationMatrix(AffineTransform3D *transform, double epsilon=mitk::eps);
/**
* \brief Normal of the plane
*
*/
Vector3D GetNormal() const;
/**
* \brief Normal of the plane as VnlVector
*
*/
VnlVector GetNormalVnl() const;
virtual ScalarType SignedDistance(const Point3D &pt3d_mm) const;
/**
* \brief Calculates, whether a point is below or above the plane. There are two different
*calculation methods, with or without consideration of the bounding box.
*/
virtual bool IsAbove(const Point3D &pt3d_mm, bool considerBoundingBox = false) const;
/**
* \brief Distance of the point from the plane
* (bounding-box \em not considered)
*
*/
ScalarType DistanceFromPlane(const Point3D &pt3d_mm) const;
/**
* \brief Signed distance of the point from the plane
* (bounding-box \em not considered)
*
* > 0 : point is in the direction of the direction vector.
*/
inline ScalarType SignedDistanceFromPlane(const Point3D &pt3d_mm) const
{
ScalarType len = GetNormalVnl().two_norm();
if (len == 0)
return 0;
return (pt3d_mm - GetOrigin()) * GetNormal() / len;
}
/**
* \brief Distance of the plane from another plane
* (bounding-box \em not considered)
*
* Result is 0 if planes are not parallel.
*/
ScalarType DistanceFromPlane(const PlaneGeometry *plane) const { return fabs(SignedDistanceFromPlane(plane)); }
/**
* \brief Signed distance of the plane from another plane
* (bounding-box \em not considered)
*
* Result is 0 if planes are not parallel.
*/
inline ScalarType SignedDistanceFromPlane(const PlaneGeometry *plane) const
{
if (IsParallel(plane))
{
return SignedDistance(plane->GetOrigin());
}
return 0;
}
/**
* \brief Calculate the intersecting line of two planes
*
* \return \a true planes are intersecting
* \return \a false planes do not intersect
*/
bool IntersectionLine(const PlaneGeometry *plane, Line3D &crossline) const;
/**
* \brief Calculate two points where another plane intersects the border of this plane
*
* \return number of intersection points (0..2). First interection point (if existing)
* is returned in \a lineFrom, second in \a lineTo.
*/
unsigned int IntersectWithPlane2D(const PlaneGeometry *plane, Point2D &lineFrom, Point2D &lineTo) const;
/**
* \brief Calculate the angle between two planes
*
* \return angle in radiants
*/
double Angle(const PlaneGeometry *plane) const;
/**
* \brief Calculate the angle between the plane and a line
*
* \return angle in radiants
*/
double Angle(const Line3D &line) const;
/**
* \brief Calculate intersection point between the plane and a line
*
* \param intersectionPoint intersection point
* \return \a true if \em unique intersection exists, i.e., if line
* is \em not on or parallel to the plane
*/
bool IntersectionPoint(const Line3D &line, Point3D &intersectionPoint) const;
/**
* \brief Calculate line parameter of intersection point between the
* plane and a line
*
* \param t parameter of line: intersection point is
* line.GetPoint()+t*line.GetDirection()
* \return \a true if \em unique intersection exists, i.e., if line
* is \em not on or parallel to the plane
*/
bool IntersectionPointParam(const Line3D &line, double &t) const;
/**
* \brief Returns whether the plane is parallel to another plane
*
* @return true iff the normal vectors both point to the same or exactly oposit direction
*/
bool IsParallel(const PlaneGeometry *plane) const;
/**
* \brief Returns whether the point is on the plane
* (bounding-box \em not considered)
*/
bool IsOnPlane(const Point3D &point) const;
/**
* \brief Returns whether the line is on the plane
* (bounding-box \em not considered)
*/
bool IsOnPlane(const Line3D &line) const;
/**
* \brief Returns whether the plane is on the plane
* (bounding-box \em not considered)
*
* @return true iff the normal vector of the planes point to the same or the exactly oposit direction and
* the distance of the planes is < eps
*
*/
bool IsOnPlane(const PlaneGeometry *plane) const;
/**
* \brief Returns the lot from the point to the plane
*/
Point3D ProjectPointOntoPlane(const Point3D &pt) const;
itk::LightObject::Pointer InternalClone() const override;
/** Implements operation to re-orient the plane */
void ExecuteOperation(Operation *operation) override;
/**
* \brief Project a 3D point given in mm (\a pt3d_mm) onto the 2D
* geometry. The result is a 2D point in mm (\a pt2d_mm).
*
* The result is a 2D point in mm (\a pt2d_mm) relative to the upper-left
* corner of the geometry. To convert this point into units (e.g., pixels
* in case of an image), use WorldToIndex.
* \return true projection was possible
* \sa Project(const mitk::Point3D &pt3d_mm, mitk::Point3D
* &projectedPt3d_mm)
*/
virtual bool Map(const mitk::Point3D &pt3d_mm, mitk::Point2D &pt2d_mm) const;
/**
* \brief Converts a 2D point given in mm (\a pt2d_mm) relative to the
* upper-left corner of the geometry into the corresponding
* world-coordinate (a 3D point in mm, \a pt3d_mm).
*
* To convert a 2D point given in units (e.g., pixels in case of an
* image) into a 2D point given in mm (as required by this method), use
* IndexToWorld.
*/
virtual void Map(const mitk::Point2D &pt2d_mm, mitk::Point3D &pt3d_mm) const;
/**
* \brief Set the width and height of this 2D-geometry in units by calling
* SetBounds. This does \a not change the extent in mm!
*
* For an image, this is the number of pixels in x-/y-direction.
* \note In contrast to calling SetBounds directly, this does \a not change
* the extent in mm!
*/
virtual void SetSizeInUnits(mitk::ScalarType width, mitk::ScalarType height);
/**
* \brief Project a 3D point given in mm (\a pt3d_mm) onto the 2D
* geometry. The result is a 3D point in mm (\a projectedPt3d_mm).
*
* \return true projection was possible
*/
virtual bool Project(const mitk::Point3D &pt3d_mm, mitk::Point3D &projectedPt3d_mm) const;
/**
* \brief Project a 3D vector given in mm (\a vec3d_mm) onto the 2D
* geometry. The result is a 2D vector in mm (\a vec2d_mm).
*
* The result is a 2D vector in mm (\a vec2d_mm) relative to the
* upper-left
* corner of the geometry. To convert this point into units (e.g., pixels
* in case of an image), use WorldToIndex.
* \return true projection was possible
* \sa Project(const mitk::Vector3D &vec3d_mm, mitk::Vector3D
* &projectedVec3d_mm)
*/
virtual bool Map(const mitk::Point3D &atPt3d_mm, const mitk::Vector3D &vec3d_mm, mitk::Vector2D &vec2d_mm) const;
/**
* \brief Converts a 2D vector given in mm (\a vec2d_mm) relative to the
* upper-left corner of the geometry into the corresponding
* world-coordinate (a 3D vector in mm, \a vec3d_mm).
*
* To convert a 2D vector given in units (e.g., pixels in case of an
* image) into a 2D vector given in mm (as required by this method), use
* IndexToWorld.
*/
virtual void Map(const mitk::Point2D &atPt2d_mm, const mitk::Vector2D &vec2d_mm, mitk::Vector3D &vec3d_mm) const;
/**
* \brief Project a 3D vector given in mm (\a vec3d_mm) onto the 2D
* geometry. The result is a 3D vector in mm (\a projectedVec3d_mm).
*
* DEPRECATED. Use Project(vector,vector) instead
*
* \return true projection was possible
*/
virtual bool Project(const mitk::Point3D &atPt3d_mm,
const mitk::Vector3D &vec3d_mm,
mitk::Vector3D &projectedVec3d_mm) const;
/**
* \brief Project a 3D vector given in mm (\a vec3d_mm) onto the 2D
* geometry. The result is a 3D vector in mm (\a projectedVec3d_mm).
*
* \return true projection was possible
*/
virtual bool Project(const mitk::Vector3D &vec3d_mm, mitk::Vector3D &projectedVec3d_mm) const;
/**
* \brief Distance of the point from the geometry
* (bounding-box \em not considered)
*
*/
inline ScalarType Distance(const Point3D &pt3d_mm) const { return fabs(SignedDistance(pt3d_mm)); }
/**
* \brief Set the geometrical frame of reference in which this PlaneGeometry
* is placed.
*
* This would usually be the BaseGeometry of the underlying dataset, but
* setting it is optional.
*/
void SetReferenceGeometry(const mitk::BaseGeometry *geometry);
/**
* \brief Get the geometrical frame of reference for this PlaneGeometry.
*/
const BaseGeometry *GetReferenceGeometry() const;
bool HasReferenceGeometry() const;
static std::vector< int > CalculateDominantAxes(mitk::AffineTransform3D::MatrixType::InternalMatrixType& rotation_matrix);
protected:
PlaneGeometry();
PlaneGeometry(const PlaneGeometry &other);
~PlaneGeometry() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
const mitk::BaseGeometry *m_ReferenceGeometry;
//##Documentation
//## @brief PreSetSpacing
//##
//## These virtual function allows a different beahiour in subclasses.
//## Do implement them in every subclass of BaseGeometry. If not needed, use
//## {Superclass::PreSetSpacing();};
void PreSetSpacing(const mitk::Vector3D &aSpacing) override { Superclass::PreSetSpacing(aSpacing); };
//##Documentation
//## @brief CheckBounds
//##
//## This function is called in SetBounds. Assertions can be implemented in this function (see PlaneGeometry.cpp).
//## If you implement this function in a subclass, make sure, that all classes were your class inherits from
//## have an implementation of CheckBounds
//## (e.g. inheritance BaseGeometry <- A <- B. Implementation of CheckBounds in class B needs implementation in A as
// well!)
void CheckBounds(const BoundsArrayType &bounds) override;
//##Documentation
//## @brief CheckIndexToWorldTransform
//##
//## This function is called in SetIndexToWorldTransform. Assertions can be implemented in this function (see
// PlaneGeometry.cpp).
//## In Subclasses of BaseGeometry, implement own conditions or call Superclass::CheckBounds(bounds);.
void CheckIndexToWorldTransform(mitk::AffineTransform3D *transform) override;
private:
/**
* \brief Compares plane with another plane: \a true if IsOnPlane
* (bounding-box \em not considered)
*/
virtual bool operator==(const PlaneGeometry *) const { return false; };
/**
* \brief Compares plane with another plane: \a false if IsOnPlane
* (bounding-box \em not considered)
*/
virtual bool operator!=(const PlaneGeometry *) const { return false; };
};
} // namespace mitk
#endif /* PLANEGEOMETRY_H_HEADER_INCLUDED_C1C68A2C */
diff --git a/Modules/Core/include/mitkPlaneGeometryData.h b/Modules/Core/include/mitkPlaneGeometryData.h
index 4df13b1710..9b58fa1a52 100644
--- a/Modules/Core/include/mitkPlaneGeometryData.h
+++ b/Modules/Core/include/mitkPlaneGeometryData.h
@@ -1,78 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKGEOMETRY2DDATA_H_HEADER_INCLUDED_C19C01E2
#define MITKGEOMETRY2DDATA_H_HEADER_INCLUDED_C19C01E2
#include "mitkBaseData.h"
#include "mitkGeometryData.h"
#include "mitkPlaneGeometry.h"
#include <MitkCoreExports.h>
namespace mitk
{
class PlaneGeometryData;
/** \deprecatedSince{2014_10} This class is deprecated. Please use PlaneGeometryData instead. */
DEPRECATED(typedef PlaneGeometryData Geometry2DData);
//##Documentation
//## @brief Data class containing PlaneGeometry objects
//## @ingroup Geometry
//##
class MITKCORE_EXPORT PlaneGeometryData : public GeometryData
{
public:
mitkClassMacro(PlaneGeometryData, GeometryData);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
//##Documentation
//## @brief Set the reference to a PlaneGeometry that is stored
//## by the object
//##
//## @warning Accepts only instances of PlaneGeometry or sub-classes.
void SetGeometry(mitk::BaseGeometry *geometry) override;
//##Documentation
//## @brief Set the reference to the PlaneGeometry that is stored
//## by the object
virtual void SetPlaneGeometry(mitk::PlaneGeometry *geometry2d);
/**
* \deprecatedSince{2014_10} Please use SetPlaneGeometry
*/
DEPRECATED(void SetGeometry2D(PlaneGeometry *geo)) { SetPlaneGeometry(geo); };
//##Documentation
//## @brief Get the reference to the PlaneGeometry that is stored
//## by the object
virtual mitk::PlaneGeometry *GetPlaneGeometry() const { return static_cast<mitk::PlaneGeometry *>(GetGeometry()); };
/**
* \deprecatedSince{2014_10} Please use GetPlaneGeometry
*/
DEPRECATED(const PlaneGeometry *GetGeometry2D()) { return GetPlaneGeometry(); };
void UpdateOutputInformation() override;
void SetRequestedRegionToLargestPossibleRegion() override;
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
bool VerifyRequestedRegion() override;
void SetRequestedRegion(const itk::DataObject *data) override;
void CopyInformation(const itk::DataObject *data) override;
protected:
PlaneGeometryData();
~PlaneGeometryData() override;
};
} // namespace mitk
#endif /* MITKGEOMETRY2DDATA_H_HEADER_INCLUDED_C19C01E2 */
diff --git a/Modules/Core/include/mitkPlaneGeometryDataMapper2D.h b/Modules/Core/include/mitkPlaneGeometryDataMapper2D.h
index d5d832b31c..787d3b51cd 100644
--- a/Modules/Core/include/mitkPlaneGeometryDataMapper2D.h
+++ b/Modules/Core/include/mitkPlaneGeometryDataMapper2D.h
@@ -1,142 +1,144 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPlaneGeometryDataMapper2D_h
#define mitkPlaneGeometryDataMapper2D_h
#include "mitkBaseRenderer.h"
#include "mitkVtkMapper.h"
#include <MitkCoreExports.h>
#include <vtkSmartPointer.h>
class vtkActor2D;
class vtkPropAssembly;
class vtkFloatArray;
class vtkCellArray;
class vtkPolyDataMapper2D;
namespace mitk
{
/**
* @brief Vtk-based 2D mapper for rendering a crosshair with the plane geometry.
*
* This mapper uses the mitkPlaneGeometryData from the three helper objects in
* the StdMultiWidget to render a crosshair in all 2D render windows. The crosshair
* is assembled as lines and rendered with a vtkPolyDataMapper. The mapper
* requires multiple plane geometry to compute the correct crosshair position.
* The plane bounds are computed using either ReferenceGeometry if it is present or
* the plane geometry itself otherwise.
* The mapper offers the following properties:
* \b Crosshair.Line width: The thickness of the crosshair.
* \b Crosshair.Gap Size: The gap between the lines in pixels.
* \b Crosshair.Orientation Decoration: Adds a PlaneOrientationProperty, which
* indicates the direction of the plane normal. See mitkPlaneOrientationProperty.
*
* @ingroup Mapper
*/
class MITKCORE_EXPORT PlaneGeometryDataMapper2D : public VtkMapper
{
public:
mitkClassMacro(PlaneGeometryDataMapper2D, VtkMapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
virtual const mitk::PlaneGeometryData *GetInput() const;
/** \brief returns the a prop assembly */
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
/** Applies properties specific to this mapper */
virtual void ApplyAllProperties(BaseRenderer *renderer);
void UpdateVtkTransform(mitk::BaseRenderer *renderer) override;
/** \brief set the default properties for this mapper */
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
/** \brief Internal class holding the mapper, actor, etc. for each of the 3 2D render windows */
class LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/* constructor */
LocalStorage();
/* destructor */
~LocalStorage() override;
// actor
vtkSmartPointer<vtkActor2D> m_CrosshairActor;
vtkSmartPointer<vtkActor2D> m_CrosshairHelperLineActor;
vtkSmartPointer<vtkActor2D> m_ArrowActor;
vtkSmartPointer<vtkPolyDataMapper2D> m_HelperLinesmapper;
vtkSmartPointer<vtkPolyDataMapper2D> m_Arrowmapper;
vtkSmartPointer<vtkPolyDataMapper2D> m_Mapper;
vtkSmartPointer<vtkPropAssembly> m_CrosshairAssembly;
};
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
protected:
/* constructor */
PlaneGeometryDataMapper2D();
/* destructor */
~PlaneGeometryDataMapper2D() override;
/* \brief Applies the color and opacity properties and calls CreateVTKRenderObjects */
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
void CreateVtkCrosshair(BaseRenderer *renderer);
static bool TestPointInPlaneGeometry(const PlaneGeometry *planeGeometry, const Point3D &point);
static bool TestPointInReferenceGeometry(const BaseGeometry *referenceGeometry, const Point3D &point);
static bool CutCrossLineWithPlaneGeometry(const PlaneGeometry *planeGeometry, Line3D &crossLine);
static bool CutCrossLineWithReferenceGeometry(const BaseGeometry *referenceGeometry, Line3D &crossLine);
/**
* \brief Returns the thick slice mode for the given datanode.
*
* This method returns the value of the 'reslice.thickslices' property for
* the given datanode.
* '0': thick slice mode disabled
* '1': thick slice mode enabled
*
* The variable 'thickSlicesNum' contains the value of the 'reslice.thickslices.num'
* property that defines how many slices are shown at once.
*/
int DetermineThickSliceMode(DataNode *dn, int &thickSlicesNum);
void DrawLine(Point3D p0, Point3D p1, vtkCellArray *lines, vtkPoints *points);
// member variables holding the current value of the properties used in this mapper
typedef std::vector<DataNode *> NodesVectorType;
NodesVectorType m_OtherPlaneGeometries;
typedef std::set<Self *> AllInstancesContainer;
static AllInstancesContainer s_AllInstances;
bool m_RenderOrientationArrows;
bool m_ArrowOrientationPositive;
mitk::ScalarType m_DepthValue;
void ApplyColorAndOpacityProperties2D(BaseRenderer *renderer, vtkActor2D *actor);
void DrawOrientationArrow(vtkSmartPointer<vtkCellArray> triangles,
vtkSmartPointer<vtkPoints> triPoints,
double triangleSizeMM,
Vector3D &orthogonalVector,
Point3D &point1,
Point3D &point2);
};
} // namespace mitk
#endif /* mitkPlaneGeometryDataMapper2D_h */
diff --git a/Modules/Core/include/mitkPlaneGeometryDataToSurfaceFilter.h b/Modules/Core/include/mitkPlaneGeometryDataToSurfaceFilter.h
index b16ee49d11..1c66f1417a 100644
--- a/Modules/Core/include/mitkPlaneGeometryDataToSurfaceFilter.h
+++ b/Modules/Core/include/mitkPlaneGeometryDataToSurfaceFilter.h
@@ -1,222 +1,223 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKGEOMETRY2DDATATOSURFACEDATAFILTER_H_HEADER_INCLUDED_C10B22CD
#define MITKGEOMETRY2DDATATOSURFACEDATAFILTER_H_HEADER_INCLUDED_C10B22CD
#include "mitkGeometry3D.h"
#include "mitkSurfaceSource.h"
#include "vtkSystemIncludes.h"
class vtkPlaneSource;
class vtkTransformPolyDataFilter;
class vtkCubeSource;
class vtkTransform;
class vtkPlane;
class vtkCutter;
class vtkStripper;
class vtkPolyData;
class vtkPPolyDataNormals;
class vtkTriangleFilter;
class vtkTextureMapToPlane;
class vtkBox;
class vtkClipPolyData;
namespace mitk
{
class PlaneGeometryData;
class PlaneGeometryDataToSurfaceFilter;
/** \deprecatedSince{2014_10} This class is deprecated. Please use PlaneGeometryDataToSurfaceFilter instead. */
DEPRECATED(typedef PlaneGeometryDataToSurfaceFilter Geometry2DDataToSurfaceFilter);
/** \brief Superclass of all classes having a PlaneGeometryData as input and
* generating Images as output
*
* Currently implemented for PlaneGeometry and AbstractTransformGeometry.
* Currently, this class does not really have subclasses, but does the job
* for itself. It checks which kind of PlaneGeometry is stored in the
* PlaneGeometryData and - if it knows how - it generates the respective
* Surface. Of course, this has the disadvantage that for any new type of
* PlaneGeometry this class (PlaneGeometryDataToSurfaceFilter) has to be
* changed/extended. The idea is to move the type specific generation code in
* subclasses, and internally (within this class) use a factory to create an
* instance of the required subclass and delegate the surface generation to
* it.
*
* \sa mitk::DeformablePlane
* \todo make extension easier
* \ingroup Process
*/
class MITKCORE_EXPORT PlaneGeometryDataToSurfaceFilter : public SurfaceSource
{
public:
mitkClassMacro(PlaneGeometryDataToSurfaceFilter, SurfaceSource);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void GenerateOutputInformation() override;
void GenerateData() override;
const PlaneGeometryData *GetInput(void);
const PlaneGeometryData *GetInput(unsigned int idx);
virtual void SetInput(const PlaneGeometryData *image);
using itk::ProcessObject::SetInput;
virtual void SetInput(unsigned int index, const PlaneGeometryData *image);
/** \brief If \a true (default), use Geometry3D::GetParametricBounds() to define the resolution in parameter space,
* otherwise use m_XResolution and m_YResolution
*/
itkGetMacro(UseGeometryParametricBounds, bool);
/** \brief If \a true (default), use Geometry3D::GetParametricBounds() to define the resolution in parameter space,
* otherwise use m_XResolution and m_YResolution
*/
itkSetMacro(UseGeometryParametricBounds, bool);
/** \brief Get x-resolution in parameter space
*
* The m_PlaneSource will create this many sub-rectangles
* in x-direction (see vtkPlaneSource::SetXResolution)
* \note Only used, when GetUseGeometryParametricBounds() is \a false, otherwise the
* the x-bounds of Geometry3D::GetParametricBounds() are used.
* \sa m_XResolution
*/
itkGetMacro(XResolution, int);
/** \brief Set x-resolution in parameter space
*
* The m_PlaneSource will create this many sub-rectangles
* in x-direction (see vtkPlaneSource::SetXResolution)
* \note Only used, when GetUseGeometryParametricBounds() is \a false, otherwise the
* the x-bounds of Geometry3D::GetParametricBounds() are used.
* \sa m_XResolution
*/
itkSetMacro(XResolution, int);
/** \brief Get y-resolution in parameter space
*
* The m_PlaneSource will create this many sub-rectangles
* in y-direction (see vtkPlaneSource::SetYResolution)
* \note Only used, when GetUseGeometryParametricBounds() is \a false, otherwise the
* the y-bounds of Geometry3D::GetParametricBounds() are used.
* \sa m_YResolution
*/
itkGetMacro(YResolution, int);
/** \brief Set y-resolution in parameter space
*
* The m_PlaneSource will create this many sub-rectangles
* in y-direction (see vtkPlaneSource::SetYResolution)
* \note Only used, when GetUseGeometryParametricBounds() is \a false, otherwise the
* the y-bounds of Geometry3D::GetParametricBounds() are used.
* \sa m_YResolution
*/
itkSetMacro(YResolution, int);
/** \brief Get whether the Surface is at the origin and placed using the Geometry
*
* Default is \a false, i.e., the transform of the Geometry is the identity, thus
* the points within the Surface are at their final position. Otherwise
* (m_PlaceByGeometry==\a true), the first cornerpoint of the created Surface is
* at the origin and the actual position is determined by the transform of the
* Geometry.
* \sa m_PlaceByGeometry
*/
itkGetConstMacro(PlaceByGeometry, bool);
/** \brief Set whether the Surface is at the origin and placed using the Geometry
*
* Default is \a false, i.e., the transform of the Geometry is the identity, thus
* the points within the Surface are at their final position. Otherwise
* (m_PlaceByGeometry==\a true), the first cornerpoint of the created Surface is
* at the origin and the actual position is determined by the transform of the
* Geometry.
* \sa m_PlaceByGeometry
*/
itkSetMacro(PlaceByGeometry, bool);
itkBooleanMacro(PlaceByGeometry);
itkGetConstMacro(UseBoundingBox, bool);
itkSetMacro(UseBoundingBox, bool);
itkBooleanMacro(UseBoundingBox);
void SetBoundingBox(const BoundingBox *boundingBox);
const BoundingBox *GetBoundingBox() const;
protected:
PlaneGeometryDataToSurfaceFilter();
~PlaneGeometryDataToSurfaceFilter() override;
/** \brief Source to create the vtk-representation of the parameter space rectangle of the PlaneGeometry
*/
vtkPlaneSource *m_PlaneSource;
/** \brief Filter to create the vtk-representation of the PlaneGeometry, which is a
* transformation of the m_PlaneSource
*/
vtkTransformPolyDataFilter *m_VtkTransformPlaneFilter;
/** \brief If \a true, use Geometry3D::GetParametricBounds() to define the resolution in parameter space,
* otherwise use m_XResolution and m_YResolution
*/
bool m_UseGeometryParametricBounds;
/** \brief X-resolution in parameter space
*
* The m_PlaneSource will create this many sub-rectangles
* in x-direction (see vtkPlaneSource::SetXResolution)
* \note Only used, when GetUseGeometryParametricBounds() is \a false, otherwise the
* the x-bounds of Geometry3D::GetParametricBounds() are used.
* \sa m_XResolution
*/
int m_XResolution;
/** \brief Y-resolution in parameter space
*
* The m_PlaneSource will create this many sub-rectangles
* in y-direction (see vtkPlaneSource::SetYResolution)
* \note Only used, when GetUseGeometryParametricBounds() is \a false, otherwise the
* the y-bounds of Geometry3D::GetParametricBounds() are used.
*/
int m_YResolution;
/** \brief Define whether the Surface is at the origin and placed using the Geometry
*
* Default is \a false, i.e., the transform of the Geometry is the identity, thus
* the points within the Surface are at their final position. Otherwise
* (m_PlaceByGeometry==\a true), the first cornerpoint of the created Surface is
* at the origin and the actual position is determined by the transform of the
* Geometry.
*/
bool m_PlaceByGeometry;
bool m_UseBoundingBox;
BoundingBox::ConstPointer m_BoundingBox;
vtkCubeSource *m_CubeSource;
vtkTransform *m_Transform;
vtkTransformPolyDataFilter *m_PolyDataTransformer;
vtkPlane *m_Plane;
vtkCutter *m_PlaneCutter;
vtkStripper *m_PlaneStripper;
vtkPolyData *m_PlanePolyData;
vtkPPolyDataNormals *m_NormalsUpdater;
vtkTriangleFilter *m_PlaneTriangler;
vtkTextureMapToPlane *m_TextureMapToPlane;
vtkBox *m_Box;
vtkClipPolyData *m_PlaneClipper;
};
} // namespace mitk
#endif /* MITKGEOMETRY2DDATATOSURFACEDATAFILTER_H_HEADER_INCLUDED_C10B22CD */
diff --git a/Modules/Core/include/mitkPlaneGeometryDataVtkMapper3D.h b/Modules/Core/include/mitkPlaneGeometryDataVtkMapper3D.h
index ff78108186..1420e06c0a 100644
--- a/Modules/Core/include/mitkPlaneGeometryDataVtkMapper3D.h
+++ b/Modules/Core/include/mitkPlaneGeometryDataVtkMapper3D.h
@@ -1,219 +1,221 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKGEOMETRY2DDATAVTKMAPPER3D_H_HEADER_INCLUDED_C196C71F
#define MITKGEOMETRY2DDATAVTKMAPPER3D_H_HEADER_INCLUDED_C196C71F
#include "mitkDataStorage.h"
#include "mitkPlaneGeometryDataToSurfaceFilter.h"
#include "mitkVtkMapper.h"
#include "mitkWeakPointer.h"
#include <MitkCoreExports.h>
#include <vtkCleanPolyData.h>
#include <vtkSystemIncludes.h>
class vtkActor;
class vtkPolyDataMapper;
class vtkAssembly;
class vtkFeatureEdges;
class vtkTubeFilter;
class vtkTransformPolyDataFilter;
class vtkHedgeHog;
namespace mitk
{
class PlaneGeometryData;
class BaseRenderer;
class ImageVtkMapper2D;
class DataStorage;
class PlaneGeometryDataVtkMapper3D;
/** \deprecatedSince{2014_10} This class is deprecated. Please use PlaneGeometryDataVTKMapper3D instead. */
DEPRECATED(typedef PlaneGeometryDataVtkMapper3D Geometry2DDataVtkMapper3D);
/**
* \brief Vtk-based mapper to display a PlaneGeometry in a 3D window
* \ingroup Mapper
*
* Uses a PlaneGeometryDataToSurfaceFilter object to create a vtkPolyData representation of a given PlaneGeometry
* instance.
* PlaneGeometry may either contain a common flat plane or a curved plane (ThinPlateSplineCurvedGeometry).
*
* The vtkPolyData object is then decorated by a colored tube on the edges and by image textures if possible
* (currently this requires that there is a 2D render window rendering the same geometry as this mapper).
*
* Properties that influence rendering are:
*
* - \b "draw edges": (Bool) Toggle display of the tubed frame
* - \b "color": (ColorProperty) Color of the tubed frame.
* - \b "xresolution": (FloatProperty) Resolution (=number of tiles) in x direction. Only relevant for
* ThinPlateSplineCurvedGeometry
* - \b "yresolution": (FloatProperty) Resolution (=number of tiles) in y direction. Only relevant for
* ThinPlateSplineCurvedGeometry
* - \b "draw normals 3D": (BoolProperty) If true, a vtkHedgeHog is used to display normals for the generated surface
* object. Useful to distinguish front and back of a plane. Hedgehogs are colored according to "front color" and "back
* color"
* - \b "color two sides": (BoolProperty) If true, front and back side of the plane are colored differently ("front
* color" and "back color")
* - \b "invert normals": (BoolProperty) Inverts front/back for display.
* - \b "front color": (ColorProperty) Color for front side of the plane
* - \b "back color": (ColorProperty) Color for back side of the plane
* - \b "material.representation": (BoolProperty) Choose the representation to draw the mesh in (Surface, Wireframe,
* Point Cloud)
* - \b "surfacegeometry": TODO: Add documentation
* - \b "LookupTable": (LookupTableProperty) Set the lookuptable to render with.
*
* Note: The following properties are set for each image individually, and thus, also influence the rendering of this
* mapper:
*
* - \b "texture interpolation": (BoolProperty) Turn on/off the texture interpolation of each image
* - \b "use color": (BoolProperty) Decide whether we want to use the color property or a lookuptable.
* - \b "binary": (BoolProperty) Binary image handling: Color the value=1.0 with the color property and make the
* background (value=0.0) of the image translucent.
* - \b "layer": (IntProperty) Controls what image is considered "on top" of another. In the case that two should
* inhabit the same space, higher layer occludes lower layer.
* - \b "opacity": (FloatProperty) Set the opacity for each rendered image.
* - \b "color": (FloatProperty) Set the color for each rendered image.
*
* The internal filter pipeline which combines a (sometimes deformed) 2D surface
* with a nice frame and image textures is illustrated in the following sketch:
*
* \image html mitkPlaneGeometryDataVtkMapper3D.png "Internal filter pipeline"
*
*/
class MITKCORE_EXPORT PlaneGeometryDataVtkMapper3D : public VtkMapper
{
public:
mitkClassMacro(PlaneGeometryDataVtkMapper3D, VtkMapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/**
* Overloaded since the displayed color-frame of the image mustn't be
* transformed after generation of poly data, but before (vertex coordinates
* only)
*/
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
void UpdateVtkTransform(mitk::BaseRenderer *renderer) override;
/**
* \brief Get the PlaneGeometryData to map
*/
virtual const PlaneGeometryData *GetInput();
/**
* \brief All images found when traversing the (sub-) tree starting at
* \a iterator which are resliced by an ImageVtkMapper2D will be mapped.
* This method is used to set the data storage to traverse. This offers
* the possibility to use this mapper for other data storages (not only
* the default data storage).
*/
virtual void SetDataStorageForTexture(mitk::DataStorage *storage);
protected:
typedef std::multimap<int, vtkActor *> LayerSortedActorList;
PlaneGeometryDataVtkMapper3D();
~PlaneGeometryDataVtkMapper3D() override;
void GenerateDataForRenderer(BaseRenderer *renderer) override;
void ProcessNode(DataNode *node, BaseRenderer *renderer, Surface *surface, LayerSortedActorList &layerSortedActors);
void ImageMapperDeletedCallback(itk::Object *caller, const itk::EventObject &event);
/** \brief general PropAssembly to hold the entire scene */
vtkAssembly *m_Prop3DAssembly;
/** \brief PropAssembly to hold the planes */
vtkAssembly *m_ImageAssembly;
PlaneGeometryDataToSurfaceFilter::Pointer m_SurfaceCreator;
BoundingBox::Pointer m_SurfaceCreatorBoundingBox;
BoundingBox::PointsContainer::Pointer m_SurfaceCreatorPointsContainer;
/** \brief Edge extractor for tube-shaped frame */
vtkFeatureEdges *m_Edges;
/** \brief Filter to apply object transform to the extracted edges */
vtkTransformPolyDataFilter *m_EdgeTransformer;
/** \brief Source to create the tube-shaped frame */
vtkTubeFilter *m_EdgeTuber;
/** \brief Mapper for the tube-shaped frame */
vtkPolyDataMapper *m_EdgeMapper;
/** \brief Actor for the tube-shaped frame */
vtkActor *m_EdgeActor;
/** \brief Mapper for black plane background */
vtkPolyDataMapper *m_BackgroundMapper;
/** \brief Actor for black plane background */
vtkActor *m_BackgroundActor;
/** \brief Transforms the suface before applying the glyph filter */
vtkTransformPolyDataFilter *m_NormalsTransformer;
/** \brief Mapper for normals representation (thin lines) */
vtkPolyDataMapper *m_FrontNormalsMapper;
vtkPolyDataMapper *m_BackNormalsMapper;
/** \brief Generates lines for surface normals */
vtkHedgeHog *m_FrontHedgeHog;
vtkHedgeHog *m_BackHedgeHog;
/** \brief Actor to hold the normals arrows */
vtkActor *m_FrontNormalsActor;
vtkActor *m_BackNormalsActor;
/** Cleans the polyline in order to avoid phantom boundaries */
vtkCleanPolyData *m_Cleaner;
/** Internal flag, if actors for normals are already added to m_Prop3DAssembly*/
bool m_NormalsActorAdded;
/** \brief The DataStorage defines which part of the data tree is traversed for renderering. */
mitk::WeakPointer<mitk::DataStorage> m_DataStorage;
class MITKCORE_EXPORT ActorInfo
{
public:
vtkActor *m_Actor;
// we do not need a smart-pointer, because we delete our
// connection, when the referenced mapper is destroyed
itk::Object *m_Sender;
unsigned long m_ObserverID;
void Initialize(vtkActor *actor, itk::Object *sender, itk::Command *command);
ActorInfo();
~ActorInfo();
};
/** \brief List holding the vtkActor to map the image into 3D for each
* ImageMapper
*/
typedef std::map<ImageVtkMapper2D *, ActorInfo> ActorList;
ActorList m_ImageActors;
// responsiblity to remove the observer upon its destruction
typedef itk::MemberCommand<PlaneGeometryDataVtkMapper3D> MemberCommandType;
MemberCommandType::Pointer m_ImageMapperDeletedCommand;
};
} // namespace mitk
#endif /* MITKGEOMETRY2DDATAVTKMAPPER3D_H_HEADER_INCLUDED_C196C71F */
diff --git a/Modules/Core/include/mitkPlaneOrientationProperty.h b/Modules/Core/include/mitkPlaneOrientationProperty.h
index 6dd1576928..54798b7f00 100644
--- a/Modules/Core/include/mitkPlaneOrientationProperty.h
+++ b/Modules/Core/include/mitkPlaneOrientationProperty.h
@@ -1,120 +1,122 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_PLANE_DECORATION_PROPERTY__H
#define MITK_PLANE_DECORATION_PROPERTY__H
#include "mitkEnumerationProperty.h"
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* Property which controls whether 2D line representation of a PlaneGeometry
* should have small arrows at both ends to indicate the orientation of
* the plane, and whether the arrows should be oriented in the direction of
* the plane's normal or against it.
*
* Valid values of the enumeration property are
* - PLANE_DECORATION_NONE (no arrows)
* - PLANE_DECORATION_POSITIVE_ORIENTATION (arrows pointing upwards)
* - PLANE_DECORATION_NEGATIVE_ORIENTATION (arrows pointing downwards)
*
* See also mitk::PlaneGeometryDataMapper2D::DrawOrientationArrow()
*/
class MITKCORE_EXPORT PlaneOrientationProperty : public EnumerationProperty
{
public:
mitkClassMacro(PlaneOrientationProperty, EnumerationProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
mitkNewMacro1Param(PlaneOrientationProperty, const IdType &);
mitkNewMacro1Param(PlaneOrientationProperty, const std::string &);
enum
{
PLANE_DECORATION_NONE,
PLANE_DECORATION_POSITIVE_ORIENTATION,
PLANE_DECORATION_NEGATIVE_ORIENTATION
};
/**
* Returns the state of plane decoration.
*/
virtual int GetPlaneDecoration();
/**
* Sets the decoration type to no decoration.
*/
virtual void SetPlaneDecorationToNone();
/**
* Sets the decoration type to arrows in positive plane direction.
*/
virtual void SetPlaneDecorationToPositiveOrientation();
/**
* Sets the decoration type to arrows in negative plane direction.
*/
virtual void SetPlaneDecorationToNegativeOrientation();
using BaseProperty::operator=;
protected:
/**
* Constructor. Sets the decoration type to none.
*/
PlaneOrientationProperty();
/**
* Constructor. Sets the decoration type to the given value. If it is not
* valid, the interpolation is set to none
*/
PlaneOrientationProperty(const IdType &value);
/**
* Constructor. Sets the decoration type to the given value. If it is not
* valid, the representation is set to none
*/
PlaneOrientationProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the standard enumeration types with corresponding strings.
*/
virtual void AddDecorationTypes();
private:
// purposely not implemented
PlaneOrientationProperty &operator=(const PlaneOrientationProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // end of namespace mitk
#endif
diff --git a/Modules/Core/include/mitkPointSet.h b/Modules/Core/include/mitkPointSet.h
index 625478587f..2d35bc88dd 100755
--- a/Modules/Core/include/mitkPointSet.h
+++ b/Modules/Core/include/mitkPointSet.h
@@ -1,349 +1,351 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPointSet_H_HEADER_INCLUDED
#define MITKPointSet_H_HEADER_INCLUDED
#include "mitkBaseData.h"
#include <itkDefaultDynamicMeshTraits.h>
#include <itkMesh.h>
namespace mitk
{
/**
* \brief Data structure which stores a set of points. Superclass of
* mitk::Mesh.
*
* 3D points are grouped within a point set; for time resolved usage, one point
* set is created and maintained per time step. A point entry consists of the
* point coordinates and point data.
*
* The point data includes a point ID (unique identifier to address this point
* within the point set), the selection state of the point and the type of
* the point.
*
* For further information about different point types see
* mitk::PointSpecificationType in mitkVector.h.
*
* Inserting a point is accompanied by an event, containing an index. The new
* point is inserted into the list at the specified position. At the same time
* an internal ID is generated and stored for the point. Points at specific time
* steps are accessed by specifying the time step number (which defaults to 0).
*
* The points of itk::PointSet stores the points in a pointContainer
* (MapContainer). The points are best accessed by using a ConstIterator (as
* defined in MapContainer); avoid access via index.
*
* The class internally uses an itk::Mesh for each time step, because
* mitk::Mesh is derived from mitk::PointSet and needs the itk::Mesh structure
* which is also derived from itk::PointSet. Thus several typedefs which seem
* to be in wrong place, are declared here (for example SelectedLinesType).
*
* \section mitkPointSetDisplayOptions
*
* The default mappers for this data structure are mitk::PointSetGLMapper2D and
* mitk::PointSetVtkMapper3D. See these classes for display options which can
* can be set via properties.
*
* \section Events
*
* PointSet issues the following events, for which observers can register
* (the below events are grouped into a class hierarchy as indicated by
* identation level; e.g. PointSetSizeChangeEvent comprises PointSetAddEvent
* and PointSetRemoveEvent):
*
* <tt>
* PointSetEvent <i>subsumes all PointSet events</i>
* PointSetMoveEvent <i>issued when a point of the PointSet is moved</i>
* PointSetSizeChangeEvent <i>subsumes add and remove events</i>
* PointSetAddEvent <i>issued when a point is added to the PointSet</i>
* PointSetRemoveEvent <i>issued when a point is removed from the PointSet</i>
* </tt>
* \ingroup PSIO
* \ingroup Data
*/
class MITKCORE_EXPORT PointSet : public BaseData
{
public:
mitkClassMacro(PointSet, BaseData);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
typedef mitk::ScalarType CoordinateType;
typedef mitk::ScalarType InterpolationWeightType;
static const unsigned int PointDimension = 3;
static const unsigned int MaxTopologicalDimension = 3;
/**
* \brief struct for data of a point
*/
struct MITKCORE_EXPORT PointDataType
{
unsigned int id; // to give the point a special ID
bool selected; // information about if the point is selected
mitk::PointSpecificationType pointSpec; // specifies the type of the point
bool operator==(const PointDataType &other) const;
};
/**
* \brief cellDataType, that stores all indexes of the lines, that are
* selected e.g.: points A,B and C.Between A and B there is a line with
* index 0. If vector of cellData contains 1 and 2, then the lines between
* B and C and C and A is selected.
*/
typedef std::vector<unsigned int> SelectedLinesType;
typedef SelectedLinesType::iterator SelectedLinesIter;
struct CellDataType
{
// used to set the whole cell on selected
bool selected;
// indexes of selected lines. 0 is between pointId 0 and 1
SelectedLinesType selectedLines;
// is the polygon already finished and closed
bool closed;
};
typedef itk::DefaultDynamicMeshTraits<PointDataType,
PointDimension,
MaxTopologicalDimension,
CoordinateType,
InterpolationWeightType,
CellDataType>
MeshTraits;
typedef itk::Mesh<PointDataType, PointDimension, MeshTraits> MeshType;
typedef MeshType DataType;
typedef Point3D PointType;
typedef DataType::PointIdentifier PointIdentifier;
typedef DataType::PointsContainer PointsContainer;
typedef DataType::PointsContainerIterator PointsIterator;
typedef DataType::PointsContainer::ConstIterator PointsConstIterator;
typedef DataType::PointDataContainer PointDataContainer;
typedef DataType::PointDataContainerIterator PointDataIterator;
typedef DataType::PointDataContainerIterator PointDataConstIterator;
void Expand(unsigned int timeSteps) override;
/** \brief executes the given Operation */
void ExecuteOperation(Operation *operation) override;
/** \brief returns the current size of the point-list */
virtual int GetSize(unsigned int t = 0) const;
virtual unsigned int GetPointSetSeriesSize() const;
/** \brief returns the pointset */
virtual DataType::Pointer GetPointSet(int t = 0) const;
PointsIterator Begin(int t = 0);
PointsConstIterator Begin(int t = 0) const;
PointsIterator End(int t = 0);
PointsConstIterator End(int t = 0) const;
/**
* \brief Get an iterator to the max ID element if existent. Return End() otherwise.
*/
PointsIterator GetMaxId(int t = 0);
/**
* \brief Get the point with ID id in world coordinates
*
* check if the ID exists. If it doesn't exist, then return 0,0,0
*/
PointType GetPoint(PointIdentifier id, int t = 0) const;
/**
* \brief Get the point with ID id in world coordinates
*
* If a point exists for the ID id, the point is returned in the parameter point
* and the method returns true. If the ID does not exist, the method returns false
*/
bool GetPointIfExists(PointIdentifier id, PointType *point, int t = 0) const;
/**
* \brief Set the given point in world coordinate system into the itkPointSet.
*/
void SetPoint(PointIdentifier id, PointType point, int t = 0);
/**
* \brief Set the given point in world coordinate system with the given PointSpecificationType
*/
void SetPoint(PointIdentifier id, PointType point, PointSpecificationType spec, int t = 0);
/**
* \brief Set the given point in world coordinate system into the itkPointSet.
*/
void InsertPoint(PointIdentifier id, PointType point, int t = 0);
/**
* \brief Set the given point in world coordinate system with given PointSpecificationType
*/
void InsertPoint(PointIdentifier id, PointType point, PointSpecificationType spec, int t);
/**
* \brief Insert the given point in world coordinate system with incremented max id at time step t.
*/
PointIdentifier InsertPoint(PointType point, int t = 0);
/**
* \brief Remove point with given id at timestep t, if existent
*/
bool RemovePointIfExists(PointIdentifier id, int t = 0);
/**
* \brief Remove max id point at timestep t and return iterator to precedent point
*/
PointsIterator RemovePointAtEnd(int t = 0);
/**
* \brief Swap a point at the given position (id) with the upper point (moveUpwards=true) or with the lower point
* (moveUpwards=false).
* If upper or lower index does not exist false is returned, if swap was successful true.
*/
bool SwapPointPosition(PointIdentifier id, bool moveUpwards, int t = 0);
/**
* \brief searches a selected point and returns the id of that point.
* If no point is found, then -1 is returned
*/
virtual int SearchSelectedPoint(int t = 0) const;
/** \brief returns true if a point exists at this position */
virtual bool IndexExists(int position, int t = 0) const;
/** \brief to get the state selected/unselected of the point on the
* position
*/
virtual bool GetSelectInfo(int position, int t = 0) const;
virtual void SetSelectInfo(int position, bool selected, int t = 0);
/** \brief to get the type of the point at the position and the moment */
virtual PointSpecificationType GetSpecificationTypeInfo(int position, int t) const;
/** \brief returns the number of selected points */
virtual int GetNumberOfSelected(int t = 0) const;
/**
* \brief searches a point in the list == point +/- distance
*
* \param point is in world coordinates.
* \param distance is in mm.
* returns -1 if no point is found
* or the position in the list of the first match
*/
int SearchPoint(Point3D point, ScalarType distance, int t = 0) const;
bool IsEmptyTimeStep(unsigned int t) const override;
// virtual methods, that need to be implemented
void UpdateOutputInformation() override;
void SetRequestedRegionToLargestPossibleRegion() override;
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
bool VerifyRequestedRegion() override;
void SetRequestedRegion(const itk::DataObject *data) override;
// Method for subclasses
virtual void OnPointSetChange(){};
protected:
mitkCloneMacro(Self);
PointSet();
PointSet(const PointSet &other);
~PointSet() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override; ///< print content of the object to os
void ClearData() override;
void InitializeEmpty() override;
/** \brief swaps point coordinates and point data of the points with identifiers id1 and id2 */
bool SwapPointContents(PointIdentifier id1, PointIdentifier id2, int t = 0);
typedef std::vector<DataType::Pointer> PointSetSeries;
PointSetSeries m_PointSetSeries;
DataType::PointsContainer::Pointer m_EmptyPointsContainer;
/**
* @brief flag to indicate the right time to call SetBounds
**/
bool m_CalculateBoundingBox;
};
/**
* @brief Equal A function comparing two pointsets for beeing identical.
* @warning This method is deprecated and will not be available in the future. Use the \a bool mitk::Equal(const
* mitk::PointSet& p1, const mitk::PointSet& p2) instead.
*
* @ingroup MITKTestingAPI
*
* The function compares the Geometry, the size and all points element-wise.
* The parameter eps is a tolarence value for all methods which are internally used for comparion.
*
* @param rightHandSide Compare this against leftHandSide.
* @param leftHandSide Compare this against rightHandSide.
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @param checkGeometry if comparing point sets loaded from a file, the geometries might be different and must not be
* compared. In all other cases, you should compare the geometries.
* @return True, if all subsequent comparisons are true, false otherwise
*/
DEPRECATED(MITKCORE_EXPORT bool Equal(const mitk::PointSet *leftHandSide,
const mitk::PointSet *rightHandSide,
mitk::ScalarType eps,
bool verbose,
bool checkGeometry = true));
/**
* @brief Equal A function comparing two pointsets for beeing identical.
*
* @ingroup MITKTestingAPI
*
* The function compares the Geometry, the size and all points element-wise.
* The parameter eps is a tolarence value for all methods which are internally used for comparion.
*
* @param rightHandSide Compare this against leftHandSide.
* @param leftHandSide Compare this against rightHandSide.
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @param checkGeometry if comparing point sets loaded from a file, the geometries might be different and must not be
* compared. In all other cases, you should compare the geometries.
* @return True, if all subsequent comparisons are true, false otherwise
*/
MITKCORE_EXPORT bool Equal(const mitk::PointSet &leftHandSide,
const mitk::PointSet &rightHandSide,
mitk::ScalarType eps,
bool verbose,
bool checkGeometry = true);
itkEventMacro(PointSetEvent, itk::AnyEvent);
itkEventMacro(PointSetMoveEvent, PointSetEvent);
itkEventMacro(PointSetSizeChangeEvent, PointSetEvent);
itkEventMacro(PointSetAddEvent, PointSetSizeChangeEvent);
itkEventMacro(PointSetRemoveEvent, PointSetSizeChangeEvent);
itkEventMacro(PointSetExtendTimeRangeEvent, PointSetEvent);
} // namespace mitk
#endif /* MITKPointSet_H_HEADER_INCLUDED */
diff --git a/Modules/Core/include/mitkPointSetDataInteractor.h b/Modules/Core/include/mitkPointSetDataInteractor.h
index 744147f534..baaabb77c6 100644
--- a/Modules/Core/include/mitkPointSetDataInteractor.h
+++ b/Modules/Core/include/mitkPointSetDataInteractor.h
@@ -1,184 +1,186 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPointSetDataInteractor_h_
#define mitkPointSetDataInteractor_h_
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkSmartPointer.h"
#include "mitkCommon.h"
#include "mitkDataInteractor.h"
#include <MitkCoreExports.h>
#include <mitkPointSet.h>
namespace mitk
{
/**
* Class PointSetDataInteractor
* \brief Implementation of the PointSetInteractor
*
* Interactor operates on a point set and supports to:
* - add points
* - remove points
* - move single points
* - move complete pointset
* - select/unselect a point
*
* in 2d and 3d render windows.
*
* \warn If this Interactor is assigned (SetDataNode) an empty mitk::DataNode it creates a point set,
* changing the point set of the assigned mitk::DataNode after this assignment will cause the
mitk::PointSetDataInteractor
* to not work properly. So the usage has follow this general scheme:
*
* \code
// Set up interactor
m_CurrentInteractor = mitk::PointSetDataInteractor::New();
m_CurrentInteractor->LoadStateMachine("PointSet.xml");
m_CurrentInteractor->SetEventConfig("PointSetConfig.xml");
//Create new PointSet which will receive the interaction input
m_TestPointSet = mitk::PointSet::New();
// Add the point set to the mitk::DataNode *before* the DataNode is added to the mitk::PointSetDataInteractor
m_TestPointSetNode->SetData(m_TestPointSet);
// finally add the mitk::DataNode (which already is added to the mitk::DataStorage) to the
mitk::PointSetDataInteractor
m_CurrentInteractor->SetDataNode(m_TestPointSetNode);
\endcode
*
*
*/
// Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
class MITKCORE_EXPORT PointSetDataInteractor : public DataInteractor
{
public:
- mitkClassMacro(PointSetDataInteractor, DataInteractor) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(PointSetDataInteractor, DataInteractor);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* Sets the maximum distance that is accepted when looking for a point at a certain position using the
* GetPointIndexByPosition function.
*/
void SetAccuracy(float accuracy);
/**
* @brief SetMaxPoints Sets the maximal number of points for the pointset
* Default ist zero, which result in infinite number of allowed points
* @param maxNumber
*/
void SetMaxPoints(unsigned int maxNumber = 0);
protected:
PointSetDataInteractor();
~PointSetDataInteractor() override;
/**
* Here actions strings from the loaded state machine pattern are mapped to functions of
* the DataInteractor. These functions are called when an action from the state machine pattern is executed.
*/
void ConnectActionsAndFunctions() override;
/**
* This function is called when a DataNode has been set/changed.
* It is used to initialize the DataNode, e.g. if no PointSet exists yet it is created
* and added to the DataNode.
*/
void DataNodeChanged() override;
/**
* \brief Return index in PointSet of the point that is within given accuracy to the provided position.
*
* Assumes that the DataNode contains a PointSet, if so it iterates over all points
* in the DataNode to check if it contains a point near the pointer position.
* If a point is found its index-position is returned, else -1 is returned.
*/
virtual int GetPointIndexByPosition(Point3D position, unsigned int time = 0, float accuracy = -1);
virtual bool CheckSelection(const InteractionEvent *interactionEvent);
/** Adds a point at the given coordinates.
* Every time a point is added it is also checked if the maximal number of points is reached,
* and if so an InternalEvent with the signal name "MaxNumberOfPoints" is triggered.
*/
virtual void AddPoint(StateMachineAction *, InteractionEvent *event);
/** Removes point that is selected */
virtual void RemovePoint(StateMachineAction *, InteractionEvent *interactionEvent);
/**
* Checks if new point is close enough to an old one,
* if so, trigger the ClosedContour signal which can be caught by the state machine.
*/
virtual void IsClosedContour(StateMachineAction *, InteractionEvent *);
/**
* Moves the currently selected point to the new coodinates.
*/
virtual void MovePoint(StateMachineAction *, InteractionEvent *);
/**
* Initializes the movement, stores starting position.
*/
virtual void InitMove(StateMachineAction *, InteractionEvent *interactionEvent);
/**
* Is called when a movement is finished, changes back to regular color.
*/
virtual void FinishMove(StateMachineAction *, InteractionEvent *);
/**
* Selects a point from the PointSet as currently active.
*/
virtual void SelectPoint(StateMachineAction *, InteractionEvent *);
/**
* Unselects a point at the given coordinate.
*/
virtual void UnSelectPointAtPosition(StateMachineAction *, InteractionEvent *);
/**
* Unselects all points out of reach.
*/
virtual void UnSelectAll(StateMachineAction *, InteractionEvent *);
/**
* @brief UpdatePointSet Updates the member variable that holds the point set, evaluating the time step of the
* sender.
*/
virtual void UpdatePointSet(StateMachineAction *stateMachineAction, InteractionEvent *);
/**
* Calls for inactivation of the DataInteractor
*/
virtual void Abort(StateMachineAction *, InteractionEvent *);
/** \brief to calculate a direction vector from last point and actual
* point
*/
Point3D m_LastPoint;
/** \brief summ-vector for Movement */
Vector3D m_SumVec;
// DATA
PointSet::Pointer m_PointSet;
int m_MaxNumberOfPoints; // maximum of allowed number of points
float m_SelectionAccuracy; // accuracy that's needed to select a point
// FUNCTIONS
void UnselectAll(unsigned int timeStep, ScalarType timeInMs);
void SelectPoint(int position, unsigned int timeStep, ScalarType timeInMS);
};
}
#endif
diff --git a/Modules/Core/include/mitkPointSetShapeProperty.h b/Modules/Core/include/mitkPointSetShapeProperty.h
index a39d115e3d..cb8069e2d9 100644
--- a/Modules/Core/include/mitkPointSetShapeProperty.h
+++ b/Modules/Core/include/mitkPointSetShapeProperty.h
@@ -1,118 +1,120 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_POINTSET_SHAPE_PROPERTY__H_
#define _MITK_POINTSET_SHAPE_PROPERTY__H_
#include "mitkEnumerationProperty.h"
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* Encapsulates the enumeration for point set shapes. Valid values are:
* \li NONE
* \li VERTEX
* \li DASH
* \li CROSS (default)
* \li THICK_CROSS
* \li TRIANGLE
* \li SQUARE
* \li CIRCLE
* \li DIAMOND
* \li ARROW
* \li THICK_ARROW
* \li HOOKED_ARROW
*
* This class provides different shapes for the point set rendering (unselected points).
*
*/
class MITKCORE_EXPORT PointSetShapeProperty : public EnumerationProperty
{
public:
mitkClassMacro(PointSetShapeProperty, EnumerationProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
mitkNewMacro1Param(PointSetShapeProperty, const IdType &);
mitkNewMacro1Param(PointSetShapeProperty, const std::string &);
enum PointSetShape
{
NONE = 0,
VERTEX = 1,
DASH = 2,
CROSS = 3,
THICK_CROSS = 4,
TRIANGLE = 5,
SQUARE = 6,
CIRCLE = 7,
DIAMOND = 8,
ARROW = 9,
THICK_ARROW = 10,
HOOKED_ARROW = 11
// Default = CROSS;
};
/**
* Returns the current shape
*/
virtual int GetPointSetShape() const;
using BaseProperty::operator=;
protected:
/** Sets rendering type to default (VTK_RAY_CAST_COMPOSITE_FUNCTION).
*/
PointSetShapeProperty();
/**
* Constructor. Sets rendering type to the given value.
*/
PointSetShapeProperty(const IdType &value);
/**
* Constructor. Sets rendering type to the given value.
*/
PointSetShapeProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid rendering types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the default enumeration types.
*/
virtual void AddPointSetShapes();
private:
// purposely not implemented
PointSetShapeProperty &operator=(const PointSetShapeProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // end of namespace mitk
#endif
diff --git a/Modules/Core/include/mitkPointSetSource.h b/Modules/Core/include/mitkPointSetSource.h
index 2b6e53541d..a393f8e6db 100644
--- a/Modules/Core/include/mitkPointSetSource.h
+++ b/Modules/Core/include/mitkPointSetSource.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_POINT_SET_SOURCE_H
#define _MITK_POINT_SET_SOURCE_H
#include "mitkBaseDataSource.h"
#include "mitkPointSet.h"
namespace mitk
{
/**
* @brief Superclass of all classes generating point sets (instances of class
* mitk::PointSet) as output.
*
* In itk and vtk the generated result of a ProcessObject is only guaranteed
* to be up-to-date, when Update() of the ProcessObject or the generated
* DataObject is called immediately before access of the data stored in the
* DataObject.
* @ingroup Process
*/
class MITKCORE_EXPORT PointSetSource : public BaseDataSource
{
public:
- mitkClassMacro(PointSetSource, BaseDataSource)
-
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(PointSetSource, BaseDataSource);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef PointSet OutputType;
typedef OutputType::Pointer OutputTypePointer;
mitkBaseDataSourceGetOutputDeclarations
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer
MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
protected:
PointSetSource();
~PointSetSource() override;
};
}
#endif // #define _MITK_POINT_SET_SOURCE_H
diff --git a/Modules/Core/include/mitkPointSetToPointSetFilter.h b/Modules/Core/include/mitkPointSetToPointSetFilter.h
index 19be02b097..1c847c0962 100644
--- a/Modules/Core/include/mitkPointSetToPointSetFilter.h
+++ b/Modules/Core/include/mitkPointSetToPointSetFilter.h
@@ -1,82 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _mitkpointsettopointsetfilter_h
#define _mitkpointsettopointsetfilter_h
#include "mitkPointSetSource.h"
#include <MitkCoreExports.h>
namespace mitk
{
/**
* @brief Superclass of all classes/algorithms having one or more PointSets
* as input and output
* @ingroup Process
*/
class MITKCORE_EXPORT PointSetToPointSetFilter : public PointSetSource
{
public:
mitkClassMacro(PointSetToPointSetFilter, PointSetSource);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
typedef mitk::PointSet InputType;
typedef mitk::PointSet OutputType;
typedef InputType::Pointer InputTypePointer;
typedef InputType::ConstPointer InputTypeConstPointer;
using itk::ProcessObject::SetInput;
/**
* Sets the input of this process object
* @param input the input
*/
virtual void SetInput(const InputType *input);
/**
* Sets the input n'th of this process object
* @param idx the number associated with the given input
*/
virtual void SetInput(const unsigned int &idx, const InputType *input);
/**
* @returns the input tree of the process object
*/
const InputType *GetInput(void);
/**
* @param idx the index of the input to return
* @returns the input object with the given index
*/
const InputType *GetInput(const unsigned int &idx);
protected:
/**
* A default constructor
*/
PointSetToPointSetFilter();
/**
* The destructor
*/
~PointSetToPointSetFilter() override;
private:
void operator=(const Self &); // purposely not implemented
};
} // end of namespace mitk
#endif
diff --git a/Modules/Core/include/mitkPointSetVtkMapper2D.h b/Modules/Core/include/mitkPointSetVtkMapper2D.h
index 5363794e7c..08a0524cc5 100644
--- a/Modules/Core/include/mitkPointSetVtkMapper2D.h
+++ b/Modules/Core/include/mitkPointSetVtkMapper2D.h
@@ -1,236 +1,238 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPointSetVtkMapper2D_h
#define mitkPointSetVtkMapper2D_h
#include "mitkBaseRenderer.h"
#include "mitkLocalStorageHandler.h"
#include "mitkVtkMapper.h"
#include <MitkCoreExports.h>
#include <mitkPointSetShapeProperty.h>
// VTK
#include <vtkSmartPointer.h>
class vtkActor;
class vtkPropAssembly;
class vtkPolyData;
class vtkPolyDataMapper;
class vtkGlyphSource2D;
class vtkGlyph3D;
class vtkFloatArray;
class vtkCellArray;
namespace mitk
{
class PointSet;
/**
* @brief Vtk-based 2D mapper for PointSet
*
* Due to the need of different colors for selected
* and unselected points and the facts, that we also have a contour and
* labels for the points, the vtk structure is build up the following way:
*
* We have three PolyData, one selected, and one unselected and one
* for a contour between the points. Each one is connected to an own
* PolyDataMapper and an Actor. The different color for the unselected and
* selected state and for the contour is read from properties.
*
* This mapper has several additional functionalities, such as rendering
* a contour between points, calculating and displaying distances or angles
* between points.
*
* @section mitkPointSetVtkMapper2D_point_rep Point Representation
*
* The points are displayed as small glyphs of configurable shape
* (see property "PointSet.2D.shape"). The size of these glyphs
* is given in world units. That means, the size or shape of those
* glyphs is independent of the BaseGeometry object that you assign
* to the PointSet. As for all other objects, _positions_ of points
* will be transformed into the world via the Geometry's index-to-world
* transform.
*
* Then the three Actors are combined inside a vtkPropAssembly and this
* object is returned in GetProp() and so hooked up into the rendering
* pipeline.
*
* @section mitkPointSetVtkMapper2D_propertires Applicable Properties
*
* Properties that can be set for point sets and influence the PointSetVTKMapper2D are:
*
* - \b "line width": (IntProperty 2) // line width of the line from one point to another
* - \b "point line width": (IntProperty 1) // line width of the cross marking a point
* - \b "point 2D size": (FloatProperty 6) // size of the glyph marking a point (diameter, in world
* units!)
* - \b "show contour": (BoolProperty false) // enable contour rendering between points (lines)
* - \b "close contour": (BoolProperty false) // if enabled, the open strip is closed (first point
* connected with last point)
* - \b "show points": (BoolProperty true) // show or hide points
* - \b "show distances": (BoolProperty false) // show or hide distance measure
* - \b "distance decimal digits": (IntProperty 2) // set the number of decimal digits to be shown when
* rendering the distance information
* - \b "show angles": (BoolProperty false) // show or hide angle measurement
* - \b "show distant lines": (BoolProperty false) // show the line between to points from a distant view
* (equals "always on top" option)
* - \b "layer": (IntProperty 1) // default is drawing pointset above images (they have a
* default layer of 0)
* - \b "PointSet.2D.shape" (EnumerationProperty Cross) // provides different shapes marking a point
* 0 = "None", 1 = "Vertex", 2 = "Dash", 3 = "Cross", 4 = "ThickCross", 5 = "Triangle", 6 = "Square", 7 =
* "Circle",
* 8 = "Diamond", 9 = "Arrow", 10 = "ThickArrow", 11 = "HookedArrow", 12 = "Cross"
* - \b "PointSet.2D.fill shape": (BoolProperty false) // fill or do not fill the glyph shape
* - \b "Pointset.2D.distance to plane": (FloatProperty 4.0) //In the 2D render window, points are rendered which lie
* within a certain distance
* to the current plane. They are projected on the current
* plane and scaled according to their distance.
* Point markers appear smaller as the plane moves away
* from
* their true location.
* The distance threshold can be adjusted by this float
* property, which ables the user to delineate the points
* that lie exactly on the plane. (+/- rounding error)
*
* Other Properties used here but not defined in this class:
*
* - \b "selectedcolor": (ColorProperty (1.0f, 0.0f, 0.0f)) // default color of the selected pointset e.g. the
* current
* point is red
* - \b "contourcolor" : (ColorProperty (1.0f, 0.0f, 0.0f)) // default color for the contour is red
* - \b "color": (ColorProperty (1.0f, 1.0f, 0.0f)) // default color of the (unselected) pointset is yellow
* - \b "opacity": (FloatProperty 1.0) // opacity of point set, contours
* - \b "label": (StringProperty nullptr) // a label can be defined for each point, which is rendered in proximity
* to
* the point
*
* @ingroup Mapper
*/
class MITKCORE_EXPORT PointSetVtkMapper2D : public VtkMapper
{
public:
mitkClassMacro(PointSetVtkMapper2D, VtkMapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
virtual const mitk::PointSet *GetInput() const;
/** \brief returns the a prop assembly */
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
/** \brief set the default properties for this mapper */
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
/** \brief Internal class holding the mapper, actor, etc. for each of the 3 2D render windows */
class LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/* constructor */
LocalStorage();
/* destructor */
~LocalStorage() override;
// points
vtkSmartPointer<vtkPoints> m_UnselectedPoints;
vtkSmartPointer<vtkPoints> m_SelectedPoints;
vtkSmartPointer<vtkPoints> m_ContourPoints;
// scales
vtkSmartPointer<vtkFloatArray> m_UnselectedScales;
vtkSmartPointer<vtkFloatArray> m_SelectedScales;
// distances
vtkSmartPointer<vtkFloatArray> m_DistancesBetweenPoints;
// lines
vtkSmartPointer<vtkCellArray> m_ContourLines;
// glyph source (provides different shapes for the points)
vtkSmartPointer<vtkGlyphSource2D> m_UnselectedGlyphSource2D;
vtkSmartPointer<vtkGlyphSource2D> m_SelectedGlyphSource2D;
// glyph
vtkSmartPointer<vtkGlyph3D> m_UnselectedGlyph3D;
vtkSmartPointer<vtkGlyph3D> m_SelectedGlyph3D;
// polydata
vtkSmartPointer<vtkPolyData> m_VtkUnselectedPointListPolyData;
vtkSmartPointer<vtkPolyData> m_VtkSelectedPointListPolyData;
vtkSmartPointer<vtkPolyData> m_VtkContourPolyData;
// actor
vtkSmartPointer<vtkActor> m_UnselectedActor;
vtkSmartPointer<vtkActor> m_SelectedActor;
vtkSmartPointer<vtkActor> m_ContourActor;
vtkSmartPointer<vtkTextActor> m_VtkTextActor;
std::vector<vtkSmartPointer<vtkTextActor>> m_VtkTextLabelActors;
std::vector<vtkSmartPointer<vtkTextActor>> m_VtkTextDistanceActors;
std::vector<vtkSmartPointer<vtkTextActor>> m_VtkTextAngleActors;
// mappers
vtkSmartPointer<vtkPolyDataMapper> m_VtkUnselectedPolyDataMapper;
vtkSmartPointer<vtkPolyDataMapper> m_VtkSelectedPolyDataMapper;
vtkSmartPointer<vtkPolyDataMapper> m_VtkContourPolyDataMapper;
// propassembly
vtkSmartPointer<vtkPropAssembly> m_PropAssembly;
};
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
protected:
/* constructor */
PointSetVtkMapper2D();
/* destructor */
~PointSetVtkMapper2D() override;
/* \brief Applies the color and opacity properties and calls CreateVTKRenderObjects */
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
/* \brief Called in mitk::Mapper::Update
* If TimeSlicedGeometry or time step is not valid of point set: reset mapper so that nothing is
* displayed e.g. toggle visiblity of the propassembly */
void ResetMapper(BaseRenderer *renderer) override;
/* \brief Fills the vtk objects, thus it is only called when the point set has been changed.
* This function iterates over the input point set and determines the glyphs which lie in a specific
* range around the current slice. Those glyphs are rendered using a specific shape defined in vtk glyph source
* to mark each point. The shape can be changed in MITK using the property "PointSet.2D.shape".
*
* There were issues when rendering vtk glyphs in the 2D-render windows. By default, the glyphs are
* rendered within the x-y plane in each 2D-render window, so you would only see them from the
* side in the saggital and coronal 2D-render window. The solution to this is to rotate the glyphs in order
* to be ortogonal to the current view vector. To achieve this, the rotation (vtktransform) of the current
* PlaneGeometry is applied to the orienation of the glyphs. */
virtual void CreateVTKRenderObjects(mitk::BaseRenderer *renderer);
// member variables holding the current value of the properties used in this mapper
bool m_ShowContour; // "show contour" property
bool m_CloseContour; // "close contour" property
bool m_ShowPoints; // "show points" property
bool m_ShowDistances; // "show distances" property
int m_DistancesDecimalDigits; // "distance decimal digits" property
bool m_ShowAngles; // "show angles" property
bool m_ShowDistantLines; // "show distant lines" property
int m_LineWidth; // "line width" property
int m_PointLineWidth; // "point line width" property
float m_Point2DSize; // "point 2D size" property
int m_IDShapeProperty; // ID for mitkPointSetShape Enumeration Property "Pointset.2D.shape"
bool m_FillShape; // "Pointset.2D.fill shape" property
float m_DistanceToPlane; // "Pointset.2D.distance to plane" property
};
} // namespace mitk
#endif /* mitkPointSetVtkMapper2D_h */
diff --git a/Modules/Core/include/mitkPointSetVtkMapper3D.h b/Modules/Core/include/mitkPointSetVtkMapper3D.h
index f489b8fae2..a199ff20ae 100644
--- a/Modules/Core/include/mitkPointSetVtkMapper3D.h
+++ b/Modules/Core/include/mitkPointSetVtkMapper3D.h
@@ -1,162 +1,164 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPointSetVtkMAPPER3D_H_HEADER_INCLUDED_C1907273
#define MITKPointSetVtkMAPPER3D_H_HEADER_INCLUDED_C1907273
#include "mitkBaseRenderer.h"
#include "mitkVtkMapper.h"
#include <MitkCoreExports.h>
#include <vtkSmartPointer.h>
class vtkActor;
class vtkCellArray;
class vtkPropAssembly;
class vtkAppendPolyData;
class vtkPolyData;
class vtkTubeFilter;
class vtkPolyDataMapper;
class vtkTransformPolyDataFilter;
namespace mitk
{
class PointSet;
/**
* @brief Vtk-based mapper for PointSet
*
* Due to the need of different colors for selected
* and unselected points and the facts, that we also have a contour and
* labels for the points, the vtk structure is build up the following way:
*
* We have two AppendPolyData, one selected, and one unselected and one
* for a contour between the points. Each one is connected to an own
* PolyDaraMapper and an Actor. The different color for the unselected and
* selected state and for the contour is read from properties.
*
* "unselectedcolor", "selectedcolor" and "contourcolor" are the strings,
* that are looked for. Pointlabels are added besides the selected or the
* deselected points.
*
* Then the three Actors are combined inside a vtkPropAssembly and this
* object is returned in GetProp() and so hooked up into the rendering
* pipeline.
* Properties that can be set for point sets and influence the PointSetVTKMapper3D are:
*
* - \b "color": (ColorProperty*) Color of the point set
* - \b "Opacity": (FloatProperty) Opacity of the point set
* - \b "show contour": (BoolProperty) If the contour of the points are visible
* - \b "contourSizeProp":(FloatProperty) Contour size of the points
The default properties are:
* - \b "line width": (IntProperty::New(2), renderer, overwrite )
* - \b "pointsize": (FloatProperty::New(1.0), renderer, overwrite)
* - \b "selectedcolor": (ColorProperty::New(1.0f, 0.0f, 0.0f), renderer, overwrite) //red
* - \b "color": (ColorProperty::New(1.0f, 1.0f, 0.0f), renderer, overwrite) //yellow
* - \b "show contour": (BoolProperty::New(false), renderer, overwrite )
* - \b "contourcolor": (ColorProperty::New(1.0f, 0.0f, 0.0f), renderer, overwrite)
* - \b "contoursize": (FloatProperty::New(0.5), renderer, overwrite )
* - \b "close contour": (BoolProperty::New(false), renderer, overwrite )
* - \b "show points": (BoolProperty::New(true), renderer, overwrite )
* - \b "updateDataOnRender": (BoolProperty::New(true), renderer, overwrite )
*Other properties looked for are:
*
* - \b "show contour": if set to on, lines between the points are shown
* - \b "close contour": if set to on, the open strip is closed (first point
* connected with last point)
* - \b "pointsize": size of the points mapped (diameter of a sphere, in world woordinates!)
* - \b "label": text of the Points to show besides points
* - \b "contoursize": size of the contour drawn between the points
* (if not set, the pointsize is taken)
*
* @ingroup Mapper
*/
class MITKCORE_EXPORT PointSetVtkMapper3D : public VtkMapper
{
public:
mitkClassMacro(PointSetVtkMapper3D, VtkMapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
virtual const mitk::PointSet *GetInput();
// overwritten from VtkMapper3D to be able to return a
// m_PointsAssembly which is much faster than a vtkAssembly
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
void UpdateVtkTransform(mitk::BaseRenderer *renderer) override;
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
/*
* \deprecatedSince{2013_12} Use ReleaseGraphicsResources(mitk::BaseRenderer* renderer) instead
*/
DEPRECATED(void ReleaseGraphicsResources(vtkWindow *renWin));
void ReleaseGraphicsResources(mitk::BaseRenderer *renderer) override;
LocalStorageHandler<BaseLocalStorage> m_LSH;
protected:
PointSetVtkMapper3D();
~PointSetVtkMapper3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
void ResetMapper(BaseRenderer *renderer) override;
virtual void ApplyAllProperties(mitk::BaseRenderer *renderer, vtkActor *actor);
virtual void CreateContour(vtkPoints *points, vtkCellArray *connections);
virtual void CreateVTKRenderObjects();
/// All point positions, already in world coordinates
vtkSmartPointer<vtkPoints> m_WorldPositions;
/// All connections between two points (used for contour drawing)
vtkSmartPointer<vtkCellArray> m_PointConnections;
vtkSmartPointer<vtkAppendPolyData> m_vtkSelectedPointList;
vtkSmartPointer<vtkAppendPolyData> m_vtkUnselectedPointList;
vtkSmartPointer<vtkPoints> m_VtkPoints;
vtkSmartPointer<vtkCellArray> m_VtkPointConnections;
vtkSmartPointer<vtkTransformPolyDataFilter> m_VtkPointsTransformer;
vtkSmartPointer<vtkPolyDataMapper> m_VtkSelectedPolyDataMapper;
vtkSmartPointer<vtkPolyDataMapper> m_VtkUnselectedPolyDataMapper;
vtkSmartPointer<vtkActor> m_SelectedActor;
vtkSmartPointer<vtkActor> m_UnselectedActor;
vtkSmartPointer<vtkActor> m_ContourActor;
vtkSmartPointer<vtkPropAssembly> m_PointsAssembly;
// help for contour between points
vtkSmartPointer<vtkAppendPolyData> m_vtkTextList;
// variables to be able to log, how many inputs have been added to PolyDatas
unsigned int m_NumberOfSelectedAdded;
unsigned int m_NumberOfUnselectedAdded;
// variables to check if an update of the vtk objects is needed
ScalarType m_PointSize;
ScalarType m_ContourRadius;
};
} // namespace mitk
#endif /* MITKPointSetVtkMAPPER3D_H_HEADER_INCLUDED_C1907273 */
diff --git a/Modules/Core/include/mitkPropertyExtension.h b/Modules/Core/include/mitkPropertyExtension.h
index a5366a9656..a59053aff2 100644
--- a/Modules/Core/include/mitkPropertyExtension.h
+++ b/Modules/Core/include/mitkPropertyExtension.h
@@ -1,39 +1,40 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPropertyExtension_h
#define mitkPropertyExtension_h
#include <MitkCoreExports.h>
#include <itkObjectFactory.h>
#include <mitkCommon.h>
namespace mitk
{
/** \brief Base class for all property extensions.
*/
class MITKCORE_EXPORT PropertyExtension : public itk::LightObject
{
public:
mitkClassMacroItkParent(PropertyExtension, itk::LightObject);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
protected : PropertyExtension();
~PropertyExtension() override;
private:
PropertyExtension(const Self &other);
Self &operator=(const Self &other);
};
}
#endif
diff --git a/Modules/Core/include/mitkPropertyList.h b/Modules/Core/include/mitkPropertyList.h
index de59c3ca64..d818815efd 100644
--- a/Modules/Core/include/mitkPropertyList.h
+++ b/Modules/Core/include/mitkPropertyList.h
@@ -1,253 +1,254 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef PROPERTYLIST_H_HEADER_INCLUDED_C1C77D8D
#define PROPERTYLIST_H_HEADER_INCLUDED_C1C77D8D
#include "mitkBaseProperty.h"
#include "mitkGenericProperty.h"
#include "mitkUIDGenerator.h"
#include "mitkIPropertyOwner.h"
#include <MitkCoreExports.h>
#include <itkObjectFactory.h>
#include <map>
#include <string>
namespace mitk
{
class XMLWriter;
/**
* @brief Key-value list holding instances of BaseProperty
*
* This list is meant to hold an arbitrary list of "properties",
* which should describe the object associated with this list.
*
* Usually you will use PropertyList as part of a DataNode
* object - in this context the properties describe the data object
* held by the DataNode (e.g. whether the object is rendered at
* all, which color is used for rendering, what name should be
* displayed for the object, etc.)
*
* The values in the list are not fixed, you may introduce any kind
* of property that seems useful - all you have to do is inherit
* from BaseProperty.
*
* The list is organized as a key-value pairs, i.e.
*
* \li "name" : pointer to a StringProperty
* \li "visible" : pointer to a BoolProperty
* \li "color" : pointer to a ColorProperty
* \li "volume" : pointer to a FloatProperty
*
* Please see the documentation of SetProperty and ReplaceProperty for two
* quite different semantics. Normally SetProperty is what you want - this
* method will try to change the value of an existing property and will
* not allow you to replace e.g. a ColorProperty with an IntProperty.
*
* Please also regard, that the key of a property must be a none empty string.
* This is a precondition. Setting properties with empty keys will raise an exception.
*
* @ingroup DataManagement
*/
class MITKCORE_EXPORT PropertyList : public itk::Object, public IPropertyOwner
{
public:
- mitkClassMacroItkParent(PropertyList, itk::Object)
+ mitkClassMacroItkParent(PropertyList, itk::Object);
/**
* Method for creation through the object factory.
*/
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* Map structure to hold the properties: the map key is a string,
* the value consists of the actual property object (BaseProperty).
*/
typedef std::map<std::string, BaseProperty::Pointer> PropertyMap;
typedef std::pair<std::string, BaseProperty::Pointer> PropertyMapElementType;
// IPropertyProvider
BaseProperty::ConstPointer GetConstProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = true) const override;
std::vector<std::string> GetPropertyKeys(const std::string &contextName = "", bool includeDefaultContext = false) const override;
std::vector<std::string> GetPropertyContextNames() const override;
// IPropertyOwner
BaseProperty * GetNonConstProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = true) override;
void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName = "", bool fallBackOnDefaultContext = false) override;
void RemoveProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = false) override;
/**
* @brief Get a property by its name.
*/
mitk::BaseProperty *GetProperty(const std::string &propertyKey) const;
/**
* @brief Set a property object in the list/map by reference.
*
* The actual OBJECT holding the value of the property is replaced by this function.
* This is useful if you want to change the type of the property, like from BoolProperty to StringProperty.
* Another use is to share one and the same property object among several ProperyList/DataNode objects, which
* makes them appear synchronized.
*/
void ReplaceProperty(const std::string &propertyKey, BaseProperty *property);
/**
* @brief Set a property object in the list/map by reference.
*/
void ConcatenatePropertyList(PropertyList *pList, bool replace = false);
//##Documentation
//## @brief Convenience access method for GenericProperty<T> properties
//## (T being the type of the second parameter)
//## @return @a true property was found
template <typename T>
bool GetPropertyValue(const char *propertyKey, T &value) const
{
GenericProperty<T> *gp = dynamic_cast<GenericProperty<T> *>(GetProperty(propertyKey));
if (gp != nullptr)
{
value = gp->GetValue();
return true;
}
return false;
}
/**
* @brief Convenience method to access the value of a BoolProperty
*/
bool GetBoolProperty(const char *propertyKey, bool &boolValue) const;
/**
* @brief ShortCut for the above method
*/
bool Get(const char *propertyKey, bool &boolValue) const;
/**
* @brief Convenience method to set the value of a BoolProperty
*/
void SetBoolProperty(const char *propertyKey, bool boolValue);
/**
* @brief ShortCut for the above method
*/
void Set(const char *propertyKey, bool boolValue);
/**
* @brief Convenience method to access the value of an IntProperty
*/
bool GetIntProperty(const char *propertyKey, int &intValue) const;
/**
* @brief ShortCut for the above method
*/
bool Get(const char *propertyKey, int &intValue) const;
/**
* @brief Convenience method to set the value of an IntProperty
*/
void SetIntProperty(const char *propertyKey, int intValue);
/**
* @brief ShortCut for the above method
*/
void Set(const char *propertyKey, int intValue);
/**
* @brief Convenience method to access the value of a FloatProperty
*/
bool GetFloatProperty(const char *propertyKey, float &floatValue) const;
/**
* @brief ShortCut for the above method
*/
bool Get(const char *propertyKey, float &floatValue) const;
/**
* @brief Convenience method to set the value of a FloatProperty
*/
void SetFloatProperty(const char *propertyKey, float floatValue);
/**
* @brief ShortCut for the above method
*/
void Set(const char *propertyKey, float floatValue);
/**
* @brief Convenience method to access the value of a DoubleProperty
*/
bool GetDoubleProperty(const char *propertyKey, double &doubleValue) const;
/**
* @brief ShortCut for the above method
*/
bool Get(const char *propertyKey, double &doubleValue) const;
/**
* @brief Convenience method to set the value of a DoubleProperty
*/
void SetDoubleProperty(const char *propertyKey, double doubleValue);
/**
* @brief ShortCut for the above method
*/
void Set(const char *propertyKey, double doubleValue);
/**
* @brief Convenience method to access the value of a StringProperty
*/
bool GetStringProperty(const char *propertyKey, std::string &stringValue) const;
/**
* @brief ShortCut for the above method
*/
bool Get(const char *propertyKey, std::string &stringValue) const;
/**
* @brief Convenience method to set the value of a StringProperty
*/
void SetStringProperty(const char *propertyKey, const char *stringValue);
/**
* @brief ShortCut for the above method
*/
void Set(const char *propertyKey, const char *stringValue);
/**
* @brief ShortCut for the above method
*/
void Set(const char *propertyKey, const std::string &stringValue);
/**
* @brief Get the timestamp of the last change of the map or the last change of one of
* the properties store in the list (whichever is later).
*/
unsigned long GetMTime() const override;
/**
* @brief Remove a property from the list/map.
*/
bool DeleteProperty(const std::string &propertyKey);
const PropertyMap *GetMap() const { return &m_Properties; }
bool IsEmpty() const { return m_Properties.empty(); }
virtual void Clear();
protected:
PropertyList();
PropertyList(const PropertyList &other);
~PropertyList() override;
/**
* @brief Map of properties.
*/
PropertyMap m_Properties;
private:
itk::LightObject::Pointer InternalClone() const override;
};
} // namespace mitk
#endif /* PROPERTYLIST_H_HEADER_INCLUDED_C1C77D8D */
diff --git a/Modules/Core/include/mitkPropertyPersistenceInfo.h b/Modules/Core/include/mitkPropertyPersistenceInfo.h
index 5562cda353..b5bc5a6b78 100644
--- a/Modules/Core/include/mitkPropertyPersistenceInfo.h
+++ b/Modules/Core/include/mitkPropertyPersistenceInfo.h
@@ -1,121 +1,122 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPropertyPersistenceInfo_h
#define mitkPropertyPersistenceInfo_h
#include <functional>
#include <mitkBaseProperty.h>
#include <mitkCommon.h>
#include <MitkCoreExports.h>
#include <itkObjectFactory.h>
namespace mitk
{
/** \brief Property persistence info.
This class is used to specify the way the persistance of a property of BaseData derived instances is handled.
The info specifies the key for property, as well as the mime type the info is defined for and should be used.
Additionally the functions for deserialization and serialization of the property can be defined.
As default
*/
class MITKCORE_EXPORT PropertyPersistenceInfo : public itk::LightObject
{
public:
using DeserializationFunctionType = std::function<mitk::BaseProperty::Pointer(const std::string &)>;
using SerializationFunctionType = std::function<std::string(const mitk::BaseProperty *)>;
using MimeTypeNameType = std::string;
mitkClassMacroItkParent(PropertyPersistenceInfo, itk::LightObject);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) mitkNewMacro1Param(Self, const std::string &);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self) mitkNewMacro1Param(Self, const std::string &);
mitkNewMacro2Param(Self, const std::string &, const std::string &);
std::string GetName() const;
std::string GetKey() const;
void SetName(const std::string &name);
void SetNameAndKey(const std::string &name, const std::string &key);
bool IsRegEx() const;
/** Sets the name and the key identifier as a regular expression that describes valid names and keys.
* @pre nameRegEx must be a valid regular expression, otherweis a regex_error esception
* is thrown and the info object is not changed.
* @pre keyRegEx must be a valid regular expression, otherweis a regex_error esception
* is thrown and the info object is not changed.*/
void UseRegEx(const std::string &nameRegEx, const std::string &nameTemplate);
void UseRegEx(const std::string &nameRegEx,
const std::string &nameTemplate,
const std::string &keyRegEx,
const std::string keyTemplate);
const std::string &GetKeyTemplate() const;
const std::string &GetNameTemplate() const;
const MimeTypeNameType &GetMimeTypeName() const;
void SetMimeTypeName(const MimeTypeNameType &mimeTypeName);
const DeserializationFunctionType GetDeserializationFunction() const;
void SetDeserializationFunction(const DeserializationFunctionType &fnc);
const SerializationFunctionType GetSerializationFunction() const;
void SetSerializationFunction(const SerializationFunctionType &fnc);
PropertyPersistenceInfo::Pointer UnRegExByName(const std::string &propertyName) const;
PropertyPersistenceInfo::Pointer UnRegExByKey(const std::string &key) const;
/** This mime type name indicates that a info can be used for any mime type as long as
another info with a more specific mime type is not available.*/
static MimeTypeNameType ANY_MIMETYPE_NAME();
protected:
/** \brief Constructor.
*
* \param[in] name Name is the name of the property that described by the info. Key will be the same.
*/
PropertyPersistenceInfo(const std::string &name = "");
/** \brief Constructor.
*
* \param[in] name Name is the name of the property that described by the info. Key will be the same.
* \param[in] mimeTypeName mime type the info is defined for.
*/
PropertyPersistenceInfo(const std::string &name, const std::string &mimeTypeName);
~PropertyPersistenceInfo() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
private:
PropertyPersistenceInfo(const Self &other);
Self &operator=(const Self &other);
struct Impl;
Impl *m_Impl;
};
MITKCORE_EXPORT std::ostream &operator<<(std::ostream &os, const PropertyPersistenceInfo &info);
namespace PropertyPersistenceSerialization
{
/** Simple default serialization that uses prop->GetValueAsString for the serialization.*/
MITKCORE_EXPORT::std::string serializeByGetValueAsString(const mitk::BaseProperty *prop);
}
namespace PropertyPersistenceDeserialization
{
/** Simple default functions that puts the passed string into a string property.*/
MITKCORE_EXPORT mitk::BaseProperty::Pointer deserializeToStringProperty(const std::string &value);
}
}
#endif
diff --git a/Modules/Core/include/mitkProportionalTimeGeometry.h b/Modules/Core/include/mitkProportionalTimeGeometry.h
index ef2bd37ba6..699ed702a9 100644
--- a/Modules/Core/include/mitkProportionalTimeGeometry.h
+++ b/Modules/Core/include/mitkProportionalTimeGeometry.h
@@ -1,259 +1,260 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef ProportionalTimeGeometry_h
#define ProportionalTimeGeometry_h
// MITK
#include <MitkCoreExports.h>
#include <mitkCommon.h>
#include <mitkGeometry3D.h>
#include <mitkTimeGeometry.h>
namespace mitk
{
/**
* \brief Organizes geometries over proportional time steps
*
* For this TimeGeometry implementation it is assumed that
* the durations of the time steps are equidistant, e.g.
* the durations of the time steps in one ProportionalTimeGeometry
* are the same. The geometries of the time steps are independent,
* and not linked to each other. Since the timeBounds of the
* geometries are different for each time step it is not possible
* to set the same geometry to different time steps. Instead
* copies should be used.
*
* \addtogroup geometry
*/
class MITKCORE_EXPORT ProportionalTimeGeometry : public TimeGeometry
{
public:
mitkClassMacro(ProportionalTimeGeometry, TimeGeometry);
ProportionalTimeGeometry();
typedef ProportionalTimeGeometry self;
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* \brief Returns the number of time steps.
*
* Returns the number of time steps for which
* geometries are saved. The number of time steps
* is also the upper bound of the time steps. The
* minimum time steps is always 0.
*/
TimeStepType CountTimeSteps() const override;
/**
* \brief Returns the first time point for which the object is valid.
*
* Returns the first valid time point for this geometry. If only one
* time steps available it usually goes from -max to +max. The time point
* is given in ms.
*/
TimePointType GetMinimumTimePoint() const override;
/**
* \brief Returns the last time point for which the object is valid
*
* Gives the last time point for which a valid geometrie is saved in
* this time geometry. The time point is given in ms.
*/
TimePointType GetMaximumTimePoint() const override;
/**
* \brief Returns the first time point for which the object is valid.
*
* Returns the first valid time point for the given TimeStep. The time point
* is given in ms.
*/
TimePointType GetMinimumTimePoint(TimeStepType step) const override;
/**
* \brief Returns the last time point for which the object is valid
*
* Gives the last time point for the Geometry specified by the given TimeStep. The time point is given in ms.
*/
TimePointType GetMaximumTimePoint(TimeStepType step) const override;
/**
* \brief Get the time bounds (in ms)
*/
TimeBounds GetTimeBounds() const override;
/**
* \brief Get the time bounds for the given TimeStep (in ms)
*/
TimeBounds GetTimeBounds(TimeStepType step) const override;
/**
* \brief Tests if a given time point is covered by this object
*
* Returns true if a geometry can be returned for the given time
* point and falls if not. The time point must be given in ms.
*/
bool IsValidTimePoint(TimePointType timePoint) const override;
/**
* \brief Test for the given time step if a geometry is availible
*
* Returns true if a geometry is defined for the given time step.
* Otherwise false is returned.
* The time step is defined as positiv number.
*/
bool IsValidTimeStep(TimeStepType timeStep) const override;
/**
* \brief Converts a time step to a time point
*
* Converts a time step to a time point in a way that
* the new time point indicates the same geometry as the time step.
* If the original time steps does not point to a valid geometry,
* a time point is calculated that also does not point to a valid
* geometry, but no exception is raised.
*/
TimePointType TimeStepToTimePoint(TimeStepType timeStep) const override;
/**
* \brief Converts a time point to the corresponding time step
*
* Converts a time point to a time step in a way that
* the new time step indicates the same geometry as the time point.
* If a negativ invalid time point is given always time step 0 is
* returned. If an positiv invalid time step is given an invalid
* time step will be returned.
*/
TimeStepType TimePointToTimeStep(TimePointType timePoint) const override;
/**
* \brief Returns the geometry which corresponds to the given time step
*
* Returns a clone of the geometry which defines the given time step. If
* the given time step is invalid an null-pointer is returned.
*/
BaseGeometry::Pointer GetGeometryCloneForTimeStep(TimeStepType timeStep) const override;
/**
* \brief Returns the geometry which corresponds to the given time point
*
* Returns the geometry which defines the given time point. If
* the given time point is invalid an null-pointer is returned.
*
* If the returned geometry is changed this will affect the saved
* geometry.
*/
BaseGeometry::Pointer GetGeometryForTimePoint(TimePointType timePoint) const override;
/**
* \brief Returns the geometry which corresponds to the given time step
*
* Returns the geometry which defines the given time step. If
* the given time step is invalid an null-pointer is returned.
*
* If the returned geometry is changed this will affect the saved
* geometry.
*/
BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const override;
/**
* \brief Tests if all necessary informations are set and the object is valid
*/
bool IsValid() const override;
/**
* \brief Initilizes a new object with one time steps which contains an empty geometry.
*/
void Initialize() override;
/**
* \brief Expands the time geometry to the given number of time steps.
*
* Initializes the new time steps with empty geometries if no timesteps
* in the geometry so far. Otherwise fills the new times steps with
* clones of the first time step.
* Shrinking is not supported.
*/
void Expand(TimeStepType size) override;
/**
* \brief Sets the geometry for the given time step
*
* This method does not afflict other time steps, since the geometry for
* each time step is saved individually.
*/
void SetTimeStepGeometry(BaseGeometry *geometry, TimeStepType timeStep) override;
/**
* \brief Replaces the geometry instances with clones of the passed geometry.
*
* Replaces the geometries of all time steps with clones of the passed
* geometry. Replacement strategy depends on the implementation of TimeGeometry
* sub class.
* @remark The time points itself stays untouched. Use this method if you want
* to change the spatial properties of a TimeGeometry and preserve the time
* "grid".
*/
void ReplaceTimeStepGeometries(const BaseGeometry *geometry) override;
/**
* \brief Makes a deep copy of the current object
*/
itk::LightObject::Pointer InternalClone() const override;
itkGetConstMacro(FirstTimePoint, TimePointType);
itkSetMacro(FirstTimePoint, TimePointType);
itkGetConstMacro(StepDuration, TimePointType);
itkSetMacro(StepDuration, TimePointType);
// void SetGeometryForTimeStep(TimeStepType timeStep, BaseGeometry& geometry);
void ClearAllGeometries();
// void AddGeometry(BaseGeometry geometry);
void ReserveSpaceForGeometries(TimeStepType numberOfGeometries);
/**
* \brief Initializes the TimeGeometry with equally time Step geometries
*
* Saves a copy for each time step.
*/
void Initialize(const BaseGeometry *geometry, TimeStepType timeSteps);
/**
* \brief Initialize the TimeGeometry with empty BaseGeometry
*/
void Initialize(TimeStepType timeSteps);
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
protected:
~ProportionalTimeGeometry() override;
std::vector<BaseGeometry::Pointer> m_GeometryVector;
TimePointType m_FirstTimePoint;
TimePointType m_StepDuration;
}; // end class ProportialTimeGeometry
/**
* @brief Equal A function comparing two ProportionalTimeGeometries for being identical.
*
* @ingroup MITKTestingAPI
*
* The function compares two instances of ProportionalTimeGeometries in all their aspects.
*
* The parameter eps is a tolerance value for all methods which are internally used for comparison.
* If you want to use different tolerance values for different parts of the geometry, feel free to use
* the other comparison methods and write your own implementation of Equal.
*
* @param rightHandSide Compare this against leftHandSide.
* @param leftHandSide Compare this against rightHandSide.
* @param eps Tolerance for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
*
* @return True, if all comparison are true. False in any other case.
*/
MITKCORE_EXPORT bool Equal(const mitk::ProportionalTimeGeometry &leftHandSide,
const mitk::ProportionalTimeGeometry &rightHandSide,
ScalarType eps,
bool verbose);
} // end namespace MITK
#endif // ProportionalTimeGeometry_h
diff --git a/Modules/Core/include/mitkRGBToRGBACastImageFilter.h b/Modules/Core/include/mitkRGBToRGBACastImageFilter.h
index 3021f0b53a..d4e5cae3ba 100644
--- a/Modules/Core/include/mitkRGBToRGBACastImageFilter.h
+++ b/Modules/Core/include/mitkRGBToRGBACastImageFilter.h
@@ -1,79 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKRGBTORGBACASTIMAGEFILTER_H_HEADER_INCLUDED
#define MITKRGBTORGBACASTIMAGEFILTER_H_HEADER_INCLUDED
#include "mitkImageTimeSelector.h"
#include "mitkImageToImageFilter.h"
#include <MitkCoreExports.h>
#include <itkRGBPixel.h>
namespace itk
{
template <class TPixel, unsigned int VImageDimension>
class ITK_EXPORT Image;
}
namespace mitk
{
//##Documentation
//## @brief
//## @ingroup Process
class MITKCORE_EXPORT RGBToRGBACastImageFilter : public ImageToImageFilter
{
public:
mitkClassMacro(RGBToRGBACastImageFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/** Static convenience method to check if the passed mitk::Image is
* an RGB image in the sense of this converter filter.
*
* Returns falsefor RGBA and all other images.
*/
static bool IsRGBImage(const mitk::Image *image);
protected:
// Typedefs for supported RGB pixel types
typedef itk::RGBPixel<unsigned char> UCRGBPixelType;
typedef itk::RGBPixel<unsigned short> USRGBPixelType;
typedef itk::RGBPixel<float> FloatRGBPixelType;
typedef itk::RGBPixel<double> DoubleRGBPixelType;
RGBToRGBACastImageFilter();
~RGBToRGBACastImageFilter() override;
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
template <typename TPixel, unsigned int VImageDimension>
void InternalCast(itk::Image<TPixel, VImageDimension> *itkImage,
mitk::RGBToRGBACastImageFilter *addComponentFilter,
typename TPixel::ComponentType defaultAlpha);
mitk::ImageTimeSelector::Pointer m_InputTimeSelector;
mitk::ImageTimeSelector::Pointer m_OutputTimeSelector;
//##Description
//## @brief Time when Header was last initialized
itk::TimeStamp m_TimeOfHeaderInitialization;
};
} // namespace mitk
#endif /* MITKRGBTORGBACASTIMAGEFILTER_H_HEADER_INCLUDED */
diff --git a/Modules/Core/include/mitkRenderWindow.h b/Modules/Core/include/mitkRenderWindow.h
index a08fb137ea..64911a9143 100644
--- a/Modules/Core/include/mitkRenderWindow.h
+++ b/Modules/Core/include/mitkRenderWindow.h
@@ -1,91 +1,93 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKRENDERWINDOW_H_HEADER_INCLUDED_C1C40D66ASDF
#define MITKRENDERWINDOW_H_HEADER_INCLUDED_C1C40D66ASDF
#include <MitkCoreExports.h>
#include "mitkRenderWindowBase.h"
namespace mitk
{
class vtkEventProvider;
/**
* \brief mitkRenderWindow integrates the MITK rendering mechanism into VTK and
* is NOT QT dependent
*
*
* \ingroup Renderer
*/
class MITKCORE_EXPORT RenderWindow : public mitk::RenderWindowBase, public itk::Object
{
public:
mitkClassMacroItkParent(RenderWindow, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) mitkNewMacro1Param(Self, vtkRenderWindow *);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ mitkNewMacro1Param(Self, vtkRenderWindow*);
mitkNewMacro2Param(Self, vtkRenderWindow *, const char *);
~RenderWindow() override;
vtkRenderWindow *GetVtkRenderWindow() override;
vtkRenderWindowInteractor *GetVtkRenderWindowInteractor() override;
// Set Layout Index to define the Layout Type
void SetLayoutIndex(unsigned int layoutIndex);
// Get Layout Index to define the Layout Type
unsigned int GetLayoutIndex();
// MenuWidget need to update the Layout Design List when Layout had changed
void LayoutDesignListChanged(int layoutDesignIndex);
void FullScreenMode(bool state);
/**
* \brief Convenience method to set the size of an mitkRenderWindow.
*
* This method sets the size of the vtkRenderWindow and tells the
* rendering that the size has changed -> adapts displayGeometry, etc.
*/
void SetSize(int width, int height);
/**
* \brief Initializes the mitkVtkEventProvider to listen to the
* currently used vtkInteractorStyle.
*
* This method makes sure that the internal mitkVtkEventProvider
* listens to the correct vtkInteractorStyle.
* This makes sure that VTK-Events are correctly translated into
* MITK-Events.
*
* \warn This method needs to be called MANUALLY as soon as the MapperID
* for this RenderWindow is changed or the vtkInteractorStyle is modified
* somehow else!
*/
void ReinitEventProvider();
protected:
RenderWindow(vtkRenderWindow *existingRenderWindow = nullptr,
const char *name = "unnamed renderer");
void ResetView();
vtkRenderWindow *m_vtkRenderWindow;
vtkRenderWindowInteractor *m_vtkRenderWindowInteractor;
vtkEventProvider *m_vtkMitkEventProvider;
private:
};
} // namespace
#endif /* MITKRENDERWINDOW_H_HEADER_INCLUDED_C1C40D66ASDF */
diff --git a/Modules/Core/include/mitkRenderWindowFrame.h b/Modules/Core/include/mitkRenderWindowFrame.h
index 4eecfcb7ee..a5557ad481 100644
--- a/Modules/Core/include/mitkRenderWindowFrame.h
+++ b/Modules/Core/include/mitkRenderWindowFrame.h
@@ -1,93 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkRenderWindowFrame_h
#define mitkRenderWindowFrame_h
#include <MitkCoreExports.h>
#include <itkObject.h>
#include <mitkCommon.h>
#include <vtkSmartPointer.h>
class vtkRenderer;
class vtkRenderWindow;
namespace mitk
{
/**
* This is a simple class for rendering colored rectangles
* at the boarders of vtkRenderWindows.
* The rectangle rendering itself is performed by means of a
* vtkProp (vtkMitkRectangleProp).
* This class instantiates the vtkProp and a corresponding vtkRenderer instance.
*/
class MITKCORE_EXPORT RenderWindowFrame : public itk::Object
{
public:
mitkClassMacroItkParent(RenderWindowFrame, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* Sets the renderwindow, in which colored rectangle boarders will be shown.
* Make sure, you have called this function
* before calling Enable()
*/
virtual void SetRenderWindow(vtkSmartPointer<vtkRenderWindow> renderWindow);
/**
* Enables drawing of the colored rectangle.
* If you want to disable it, call the Disable() function.
*/
virtual void Enable(float col1, float col2, float col3);
/**
* Disables drawing of the colored rectangle.
* If you want to enable it, call the Enable() function.
*/
virtual void Disable();
/**
* Checks, if the text is currently
* enabled (visible)
*/
virtual bool IsEnabled();
/**
* Returns the vtkRenderWindow, which is used
* for displaying the text
*/
virtual vtkSmartPointer<vtkRenderWindow> GetRenderWindow();
/**
* Returns the renderer responsible for
* rendering the text into the
* vtkRenderWindow
*/
virtual vtkSmartPointer<vtkRenderer> GetVtkRenderer();
protected:
/**
* Constructor
*/
RenderWindowFrame();
/**
* Destructor
*/
~RenderWindowFrame() override;
vtkSmartPointer<vtkRenderWindow> m_RenderWindow;
vtkSmartPointer<vtkRenderer> m_RectangleRenderer;
bool m_IsEnabled;
};
} // end of namespace mitk
#endif // mitkRenderWindowFrame_h
diff --git a/Modules/Core/include/mitkRenderingManager.h b/Modules/Core/include/mitkRenderingManager.h
index daad34b1f3..6c69b69c2c 100644
--- a/Modules/Core/include/mitkRenderingManager.h
+++ b/Modules/Core/include/mitkRenderingManager.h
@@ -1,401 +1,402 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKRENDERINGMANAGER_H_HEADER_INCLUDED_C135A197
#define MITKRENDERINGMANAGER_H_HEADER_INCLUDED_C135A197
#include <MitkCoreExports.h>
#include <vtkCallbackCommand.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <string>
#include "mitkProperties.h"
#include "mitkPropertyList.h"
#include "mitkTimeGeometry.h"
#include <mitkAntiAliasing.h>
class vtkRenderWindow;
class vtkObject;
namespace mitk
{
class RenderingManager;
class RenderingManagerFactory;
class BaseGeometry;
class SliceNavigationController;
class BaseRenderer;
class DataStorage;
/**
* \brief Manager for coordinating the rendering process.
*
* RenderingManager is a central instance retrieving and executing
* RenderWindow update requests. Its main purpose is to coordinate
* distributed requests which cannot be aware of each other - lacking the
* knowledge of whether they are really necessary or not. For example, two
* objects might determine that a specific RenderWindow needs to be updated.
* This would result in one unnecessary update, if both executed the update
* on their own.
*
* The RenderingManager addresses this by letting each such object
* <em>request</em> an update, and waiting for other objects to possibly
* issue the same request. The actual update will then only be executed at a
* well-defined point in the main event loop (this may be each time after
* event processing is done).
*
* Convinience methods for updating all RenderWindows which have been
* registered with the RenderingManager exist. If theses methods are not
* used, it is not required to register (add) RenderWindows prior to using
* the RenderingManager.
*
* The methods #ForceImmediateUpdate() and #ForceImmediateUpdateAll() can
* be used to force the RenderWindow update execution without any delay,
* bypassing the request functionality.
*
* The interface of RenderingManager is platform independent. Platform
* specific subclasses have to be implemented, though, to supply an
* appropriate event issueing for controlling the update execution process.
* See method documentation for a description of how this can be done.
*
* \sa TestingRenderingManager An "empty" RenderingManager implementation which
* can be used in tests etc.
*
*/
class MITKCORE_EXPORT RenderingManager : public itk::Object
{
public:
mitkClassMacroItkParent(RenderingManager, itk::Object);
typedef std::vector<vtkRenderWindow *> RenderWindowVector;
typedef std::vector<float> FloatVector;
typedef std::vector<bool> BoolVector;
typedef itk::SmartPointer<DataStorage> DataStoragePointer;
enum RequestType
{
REQUEST_UPDATE_ALL = 0,
REQUEST_UPDATE_2DWINDOWS,
REQUEST_UPDATE_3DWINDOWS
};
static Pointer New();
/** Set the object factory which produces the desired platform specific
* RenderingManager singleton instance. */
static void SetFactory(RenderingManagerFactory *factory);
/** Get the object factory which produces the platform specific
* RenderingManager instances. */
static const RenderingManagerFactory *GetFactory();
/** Returns true if a factory has already been set. */
static bool HasFactory();
/** Get the RenderingManager singleton instance. */
static RenderingManager *GetInstance();
/** Returns true if the singleton instance does already exist. */
static bool IsInstantiated();
/** Adds a RenderWindow. This is required if the methods #RequestUpdateAll
* or #ForceImmediateUpdate are to be used. */
void AddRenderWindow(vtkRenderWindow *renderWindow);
/** Removes a RenderWindow. */
void RemoveRenderWindow(vtkRenderWindow *renderWindow);
/** Get a list of all registered RenderWindows */
const RenderWindowVector &GetAllRegisteredRenderWindows();
/** Requests an update for the specified RenderWindow, to be executed as
* soon as the main loop is ready for rendering. */
void RequestUpdate(vtkRenderWindow *renderWindow);
/** Immediately executes an update of the specified RenderWindow. */
void ForceImmediateUpdate(vtkRenderWindow *renderWindow);
/** Requests all currently registered RenderWindows to be updated.
* If only 2D or 3D windows should be updated, this can be specified
* via the parameter requestType. */
void RequestUpdateAll(RequestType type = REQUEST_UPDATE_ALL);
/** Immediately executes an update of all registered RenderWindows.
* If only 2D or 3D windows should be updated, this can be specified
* via the parameter requestType. */
void ForceImmediateUpdateAll(RequestType type = REQUEST_UPDATE_ALL);
/** Initializes the windows specified by requestType to the geometry of the
* given DataStorage. */
// virtual bool InitializeViews( const DataStorage *storage, const DataNode* node = nullptr,
// RequestType type = REQUEST_UPDATE_ALL, bool preserveRoughOrientationInWorldSpace = false );
/** Initializes the windows specified by requestType to the given
* geometry. PLATFORM SPECIFIC. TODO: HOW IS THIS PLATFORM SPECIFIC?
* Throws an exception if bounding box has 0 extent due to exceeding
* double precision range. */
virtual bool InitializeViews(const BaseGeometry *geometry,
RequestType type = REQUEST_UPDATE_ALL,
bool preserveRoughOrientationInWorldSpace = false);
virtual bool InitializeViews(const TimeGeometry *geometry,
RequestType type = REQUEST_UPDATE_ALL,
bool preserveRoughOrientationInWorldSpace = false);
/** Initializes the windows to the default viewing direction
* (geomtry information is NOT changed). PLATFORM SPECIFIC. */
virtual bool InitializeViews(RequestType type = REQUEST_UPDATE_ALL);
/** Initializes the specified window to the geometry of the given
* DataNode. Set "initializeGlobalTimeSNC" to true in order to use this
* geometry as global TimeGeometry. PLATFORM SPECIFIC. */
// virtual bool InitializeView( vtkRenderWindow *renderWindow, const DataStorage* ds, const DataNode* node = nullptr,
// bool initializeGlobalTimeSNC = false );
/** Initializes the specified window to the given geometry. Set
* "initializeGlobalTimeSNC" to true in order to use this geometry as
* global TimeGeometry. PLATFORM SPECIFIC. */
virtual bool InitializeView(vtkRenderWindow *renderWindow,
const BaseGeometry *geometry,
bool initializeGlobalTimeSNC = false);
virtual bool InitializeView(vtkRenderWindow *renderWindow,
const TimeGeometry *geometry,
bool initializeGlobalTimeSNC = false);
/** Initializes the specified window to the default viewing direction
* (geomtry information is NOT changed). PLATFORM SPECIFIC. */
virtual bool InitializeView(vtkRenderWindow *renderWindow);
/**
* @brief Initializes the renderwindows by the aggregated geometry of
* all objects that are held in the data storage.
* This is basically a global reinit
* @param The data storage from which the bounding object can be retrieved
*/
virtual void InitializeViewsByBoundingObjects(const DataStorage *);
/** Gets the (global) SliceNavigationController responsible for
* time-slicing. */
const SliceNavigationController *GetTimeNavigationController() const;
/** Gets the (global) SliceNavigationController responsible for
* time-slicing. */
SliceNavigationController *GetTimeNavigationController();
~RenderingManager() override;
/** Executes all pending requests. This method has to be called by the
* system whenever a RenderingManager induced request event occurs in
* the system pipeline (see concrete RenderingManager implementations). */
virtual void ExecutePendingRequests();
bool IsRendering() const;
void AbortRendering();
/** En-/Disable LOD increase globally. */
itkSetMacro(LODIncreaseBlocked, bool);
/** En-/Disable LOD increase globally. */
itkGetMacro(LODIncreaseBlocked, bool);
/** En-/Disable LOD increase globally. */
itkBooleanMacro(LODIncreaseBlocked);
/** En-/Disable LOD abort mechanism. */
itkSetMacro(LODAbortMechanismEnabled, bool);
/** En-/Disable LOD abort mechanism. */
itkGetMacro(LODAbortMechanismEnabled, bool);
/** En-/Disable LOD abort mechanism. */
itkBooleanMacro(LODAbortMechanismEnabled);
/** Force a sub-class to start a timer for a pending hires-rendering request */
virtual void StartOrResetTimer(){};
/** To be called by a sub-class from a timer callback */
void ExecutePendingHighResRenderingRequest();
virtual void DoStartRendering(){};
virtual void DoMonitorRendering(){};
virtual void DoFinishAbortRendering(){};
int GetNextLOD(BaseRenderer *renderer);
/** Set current LOD (nullptr means all renderers)*/
void SetMaximumLOD(unsigned int max);
void SetShading(bool state, unsigned int lod);
bool GetShading(unsigned int lod);
void SetClippingPlaneStatus(bool status);
bool GetClippingPlaneStatus();
void SetShadingValues(float ambient, float diffuse, float specular, float specpower);
FloatVector &GetShadingValues();
/** Returns a property list */
PropertyList::Pointer GetPropertyList() const;
/** Returns a property from m_PropertyList */
BaseProperty *GetProperty(const char *propertyKey) const;
/** Sets or adds (if not present) a property in m_PropertyList */
void SetProperty(const char *propertyKey, BaseProperty *propertyValue);
/**
* \brief Setter / Getter for internal DataStorage
*
* Sets / returns the mitk::DataStorage that is used internally. This instance holds all mitk::DataNodes that are
* rendered by the registered BaseRenderers.
*
* If this DataStorage is changed at runtime by calling SetDataStorage(),
* all currently registered BaseRenderers are automatically given the correct instance.
* When a new BaseRenderer is added, it is automatically initialized with the currently active DataStorage.
*/
void SetDataStorage(mitk::DataStorage *storage);
/**
* \brief Setter / Getter for internal DataStorage
*
* Sets / returns the mitk::DataStorage that is used internally. This instance holds all mitk::DataNodes that are
* rendered by the registered BaseRenderers.
*
* If this DataStorage is changed at runtime by calling SetDataStorage(),
* all currently registered BaseRenderers are automatically given the correct instance.
* When a new BaseRenderer is added, it is automatically initialized with the currently active DataStorage.
*/
mitk::DataStorage *GetDataStorage();
/**
* @brief Sets a flag to the given renderwindow to indicated that it has the focus e.g. has been clicked recently.
* @param focusWindow
*/
void SetRenderWindowFocus(vtkRenderWindow *focusWindow);
- itkGetMacro(FocusedRenderWindow, vtkRenderWindow *)
+ itkGetMacro(FocusedRenderWindow, vtkRenderWindow *);
itkSetMacro(ConstrainedPanningZooming, bool);
- itkGetMacro(AntiAliasing, AntiAliasing)
+ itkGetMacro(AntiAliasing, AntiAliasing);
void SetAntiAliasing(AntiAliasing antiAliasing);
protected:
enum
{
RENDERING_INACTIVE = 0,
RENDERING_REQUESTED,
RENDERING_INPROGRESS
};
RenderingManager();
/** Abstract method for generating a system specific event for rendering
* request. This method is called whenever an update is requested */
virtual void GenerateRenderingRequestEvent() = 0;
virtual void InitializePropertyList();
bool m_UpdatePending;
typedef std::map<BaseRenderer *, unsigned int> RendererIntMap;
typedef std::map<BaseRenderer *, bool> RendererBoolMap;
RendererBoolMap m_RenderingAbortedMap;
RendererIntMap m_NextLODMap;
unsigned int m_MaxLOD;
bool m_LODIncreaseBlocked;
bool m_LODAbortMechanismEnabled;
BoolVector m_ShadingEnabled;
bool m_ClippingPlaneEnabled;
FloatVector m_ShadingValues;
static void RenderingStartCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata);
static void RenderingProgressCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata);
static void RenderingEndCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata);
typedef std::map<vtkRenderWindow *, int> RenderWindowList;
RenderWindowList m_RenderWindowList;
RenderWindowVector m_AllRenderWindows;
struct RenderWindowCallbacks
{
vtkCallbackCommand *commands[3u];
};
typedef std::map<vtkRenderWindow *, RenderWindowCallbacks> RenderWindowCallbacksList;
RenderWindowCallbacksList m_RenderWindowCallbacksList;
itk::SmartPointer<SliceNavigationController> m_TimeNavigationController;
static RenderingManager::Pointer s_Instance;
static RenderingManagerFactory *s_RenderingManagerFactory;
PropertyList::Pointer m_PropertyList;
DataStoragePointer m_DataStorage;
bool m_ConstrainedPanningZooming;
private:
void InternalViewInitialization(mitk::BaseRenderer *baseRenderer,
const mitk::TimeGeometry *geometry,
bool boundingBoxInitialized,
int mapperID);
vtkRenderWindow *m_FocusedRenderWindow;
AntiAliasing m_AntiAliasing;
};
#pragma GCC visibility push(default)
itkEventMacro(RenderingManagerEvent, itk::AnyEvent);
itkEventMacro(RenderingManagerViewsInitializedEvent, RenderingManagerEvent);
#pragma GCC visibility pop
- itkEventMacroDeclaration(FocusChangedEvent, itk::AnyEvent)
+ itkEventMacroDeclaration(FocusChangedEvent, itk::AnyEvent);
- /**
- * Generic RenderingManager implementation for "non-rendering-plattform",
- * e.g. for tests. Its factory (TestingRenderingManagerFactory) is
- * automatically on start-up and is used by default if not other
- * RenderingManagerFactory is instantiated explicitly thereafter.
- * (see mitkRenderingManager.cpp)
- */
- class MITKCORE_EXPORT TestingRenderingManager : public RenderingManager
+ /**
+ * Generic RenderingManager implementation for "non-rendering-plattform",
+ * e.g. for tests. Its factory (TestingRenderingManagerFactory) is
+ * automatically on start-up and is used by default if not other
+ * RenderingManagerFactory is instantiated explicitly thereafter.
+ * (see mitkRenderingManager.cpp)
+ */
+ class MITKCORE_EXPORT TestingRenderingManager : public RenderingManager
{
public:
mitkClassMacro(TestingRenderingManager, RenderingManager);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
- protected : void GenerateRenderingRequestEvent() override{
- // ForceImmediateUpdateAll();
- };
+ protected:
+
+ void GenerateRenderingRequestEvent() override {};
};
} // namespace mitk
#endif /* MITKRenderingManager_H_HEADER_INCLUDED_C135A197 */
diff --git a/Modules/Core/include/mitkRenderingModeProperty.h b/Modules/Core/include/mitkRenderingModeProperty.h
index db90e5ccb0..e2adad411f 100644
--- a/Modules/Core/include/mitkRenderingModeProperty.h
+++ b/Modules/Core/include/mitkRenderingModeProperty.h
@@ -1,162 +1,164 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_RENDERING_MODE_PROPERTY__H_
#define _MITK_RENDERING_MODE_PROPERTY__H_
#include "mitkEnumerationProperty.h"
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* Encapsulates the enumeration for rendering modes. The property human-readable name (which is
* used in the mitkWorkbench inside the Property View) is "Image Rendering.Mode". This property
* affects rendering of images and is used inside the mitkImageVtkMapper2D to define which
* rendering mode is applied to images.
* Valid values are:
*
* \li LEVELWINDOW_COLOR is DEPRECATED and mapped to LOOKUPTABLE_LEVELWINDOW_COLOR.
* \li LOOKUPTABLE_LEVELWINDOW_COLOR: A lookup table, level window and color will be applied to the image.
* As lookup table, the table object supplied by the property "LookupTable" will be used. As default,
* we apply a GRAYSCALE mitk::LookupTable. Note, if you want to use a former rainbow-like lookup table,
* set the mitk::LookupTableProperty to use a LEGACY_RAINBOW_COLOR type mitk::LookupTable.
* Our default setup using the GRAYSCALE mitk::LookupTable for a test image looks like this:
* \image html ExampleLevelWindowColor.png
* This image can be reproduced with the mitkImageVtkMapper2DColorTest or mitkImageVtkMapper2DLevelWindowTest.
* If "Image Rendering.Mode" is set to LOOKUPTABLE_LEVELWINDOW_COLOR inside the mitkWorkbench, the level window
* slider will change the rendering of the image. That means it will change the values of an internally used
* default lookup table. Note, the level window slider changes the property "levelwindow" which modifies the range
* of the internally used lookup table.
* This mode will apply the "color" property. The default color is white. If you change the "color"
* property to yellow, the test image will be rendered like this:
* \image html ExampleColorYellow.png
* This image can be reproduced with the mitkImageVtkMapper2DColorTest.
* Our test image with a lookup table mapping everything from red to blue looks like this:
* \image html ExampleLookupTable.png
* This image can be reproduced with the mitkImageVtkMapper2DLookupTableTest. Check this test code for an example how
* to apply a lookup table to an image.
* \note Changing a lookup table via the "levelwindow" property can be unintuitive and unwanted since the
* level window slider will overwrite the range of the lookup table. Use LOOKUPTABLE_COLOR if you
* don't want your lookuptable to be influenced by the "levelwindow" property.
*
* \li COLORTRANSFERFUNCTION_LEVELWINDOW_COLOR: A color transfer function, level window and color will be applied to
* the
* image.
* Very similar mode to LOOKUPTABLE_LEVELWINDOW_COLOR. Instead of the lookup table a color transfer function will be
* used.
* Color transfer functions are useful to colorize floating point images and allow sometimes more flexibility than
* a lookup table. The "Image Rendering.Transfer Function" property defines the transfer function. Our test image
* with a transfer function mapping everything from to red, green and blue looks like this:
* \image html ExampleTransferFunction.png
* This image can be reproduced with the mitkImageVtkMapper2DTransferFunctionTest. Check the test code for
* an example how to define a transfer function for an image. This transfer function
* will be influenced by the property "levelwindow" and the actor will be colored by the
* "color" property.
* \note Changing a transfer function table via the "levelwindow" property can be unintuitive and unwanted since
* the level window slider will overwrite the.Use COLORTRANSFERFUNCTION_COLOR if you don't want your transfer
* function to be influenced by the level window.
*
* \li LOOKUPTABLE_COLOR: A lookup table and color will be applied to the image.
* Similar mode to LOOKUPTABLE_LEVELWINDOW_COLOR, except that the "levelwindow" property will not
* modify the range of the lookup table.
*
* \li COLORTRANSFERFUNCTION_COLOR: A color trans ferfunction and color will be applied to the image.
* Similar mode to COLORTRANSFERFUNCTION_LEVELWINDOW_COLOR, except that the "levelwindow" property will not
* modify the range of the transfer function.
*
* The order is given by the names (e.g. LOOKUPTABLE_COLOR applies first a lookup table and next a color).
* Currently, there is no GUI (in mitkWorkbench) support for controlling lookup tables or transfer functions.
* This has to be done by the programmer. Color and level window are controlled by color widget and level window
* slider.
* Currently, the color is always applied. We do not set the color to white, if the user changes the mode. We assume
* that users who change the mode know that a previously set color will still be applied (on top of the respective
* mode).
* See VTK documentation for examples how to use vtkTransferfunction and vtkLookupTable.
*/
class MITKCORE_EXPORT RenderingModeProperty : public EnumerationProperty
{
public:
mitkClassMacro(RenderingModeProperty, EnumerationProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
mitkNewMacro1Param(RenderingModeProperty, const IdType &);
mitkNewMacro1Param(RenderingModeProperty, const std::string &);
// Never (!) change this without adaptation of mitkLevelWindowManagerTest::VerifyRenderingModes and
// mitkLevelWindowManagerTest::TestLevelWindowSliderVisibility !
enum ImageRenderingMode
{
// 0 used to be LEVELWINDOW_COLOR which is deprecated now and will be mapped to LOOKUPTABLE_LEVELWINDOW_COLOR.
// Our default lookup table property is the GRAYSCALE type which represents the
// former LEVELWINDOW_COLOR mode.
LOOKUPTABLE_LEVELWINDOW_COLOR = 1,
COLORTRANSFERFUNCTION_LEVELWINDOW_COLOR = 2,
LOOKUPTABLE_COLOR = 3,
COLORTRANSFERFUNCTION_COLOR = 4
// Default = LOOKUPTABLE_LEVELWINDOW_COLOR;
};
/**
* Returns the current rendering mode
*/
virtual int GetRenderingMode();
using BaseProperty::operator=;
protected:
/** Sets rendering type to default (VTK_RAY_CAST_COMPOSITE_FUNCTION).
*/
RenderingModeProperty();
/**
* Constructor. Sets rendering type to the given value.
*/
RenderingModeProperty(const IdType &value);
/**
* Constructor. Sets rendering type to the given value.
*/
RenderingModeProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid rendering types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the default enumeration types.
*/
virtual void AddRenderingModes();
private:
// purposely not implemented
RenderingModeProperty &operator=(const RenderingModeProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // end of namespace mitk
#endif
diff --git a/Modules/Core/include/mitkResliceMethodProperty.h b/Modules/Core/include/mitkResliceMethodProperty.h
index cb6619dc40..ffa92c7fb2 100644
--- a/Modules/Core/include/mitkResliceMethodProperty.h
+++ b/Modules/Core/include/mitkResliceMethodProperty.h
@@ -1,57 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __MITKRESLICEMETHODENUMPROPERTY_H
#define __MITKRESLICEMETHODENUMPROPERTY_H
#include "mitkEnumerationProperty.h"
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* Encapsulates the thick slices method enumeration
*/
class MITKCORE_EXPORT ResliceMethodProperty : public EnumerationProperty
{
public:
mitkClassMacro(ResliceMethodProperty, EnumerationProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) mitkNewMacro1Param(ResliceMethodProperty, const IdType &);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ mitkNewMacro1Param(ResliceMethodProperty, const IdType&);
mitkNewMacro1Param(ResliceMethodProperty, const std::string &);
using BaseProperty::operator=;
protected:
ResliceMethodProperty();
ResliceMethodProperty(const IdType &value);
ResliceMethodProperty(const std::string &value);
void AddThickSlicesTypes();
private:
// purposely not implemented
ResliceMethodProperty &operator=(const ResliceMethodProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // end of namespace mitk
#endif //_MITK_VTK_SCALARMODE_PROPERTY__H_
diff --git a/Modules/Core/include/mitkSinglePointDataInteractor.h b/Modules/Core/include/mitkSinglePointDataInteractor.h
index 029030c9dc..95aea60401 100644
--- a/Modules/Core/include/mitkSinglePointDataInteractor.h
+++ b/Modules/Core/include/mitkSinglePointDataInteractor.h
@@ -1,59 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkSinglePointDataInteractor_h_
#define mitkSinglePointDataInteractor_h_
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkSmartPointer.h"
#include "mitkCommon.h"
#include "mitkPointSetDataInteractor.h"
#include <MitkCoreExports.h>
#include <mitkPointSet.h>
namespace mitk
{
/**
* Class SinglePointDataInteractor
* \brief Implementation of the single point interaction
*
* Interactor operates on a single point set, when a data node is set, its containing point set is clear for
* initialization.
*/
// Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
class MITKCORE_EXPORT SinglePointDataInteractor : public PointSetDataInteractor
{
public:
- mitkClassMacro(SinglePointDataInteractor, PointSetDataInteractor) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(SinglePointDataInteractor, PointSetDataInteractor);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
protected : SinglePointDataInteractor();
~SinglePointDataInteractor() override;
/** Adds a point at the given coordinates.
* This function overwrites the behavior of PointSetDataInteractor such that instead of adding new points
* the first points position is updated. All other interaction (move,delete) is still handled by
* PointSetDataInteractor.
*/
void AddPoint(StateMachineAction *, InteractionEvent *event) override;
/**
* @brief SetMaxPoints Sets the maximal number of points for the pointset
* Overwritten, per design this class will always have a maximal number of one.
* @param maxNumber
*/
virtual void SetMaxPoints(unsigned int /*maxNumber*/ = 0) {}
void DataNodeChanged() override;
};
}
#endif
diff --git a/Modules/Core/include/mitkSlicedGeometry3D.h b/Modules/Core/include/mitkSlicedGeometry3D.h
index f47fe9d08d..27f09a6086 100644
--- a/Modules/Core/include/mitkSlicedGeometry3D.h
+++ b/Modules/Core/include/mitkSlicedGeometry3D.h
@@ -1,326 +1,327 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKSLICEDGEOMETRY3D_H_HEADER_INCLUDED_C1EBD0AD
#define MITKSLICEDGEOMETRY3D_H_HEADER_INCLUDED_C1EBD0AD
#include "mitkBaseGeometry.h"
#include "mitkPlaneGeometry.h"
namespace mitk
{
class SliceNavigationController;
class NavigationController;
/** \brief Describes the geometry of a data object consisting of slices.
*
* A PlaneGeometry can be requested for each slice. In the case of
* \em evenly-spaced, \em plane geometries (m_EvenlySpaced==true),
* only the 2D-geometry of the first slice has to be set (to an instance of
* PlaneGeometry). The 2D geometries of the other slices are calculated
* by shifting the first slice in the direction m_DirectionVector by
* m_Spacing.z * sliceNumber. The m_Spacing member (which is only
* relevant in the case m_EvenlySpaced==true) descibes the size of a voxel
* (in mm), i.e., m_Spacing.x is the voxel width in the x-direction of the
* plane. It is derived from the reference geometry of this SlicedGeometry3D,
* which usually would be the global geometry describing how datasets are to
* be resliced.
*
* By default, slices are oriented in the direction of one of the main axes
* (x, y, z). However, by means of rotation, it is possible to realign the
* slices in any possible direction. In case of an inclined plane, the spacing
* is derived as a product of the (regular) geometry spacing and the direction
* vector of the plane.
*
* SlicedGeometry3D and the associated PlaneGeometries have to be initialized in
* the method GenerateOutputInformation() of BaseProcess (or CopyInformation /
* UpdateOutputInformation of BaseData, if possible, e.g., by analyzing pic
* tags in Image) subclasses. See also
*
* \sa itk::ProcessObject::GenerateOutputInformation(),
* \sa itk::DataObject::CopyInformation() and
* \a itk::DataObject::UpdateOutputInformation().
*
* Rule: everything is in mm (or ms for temporal information) if not
* stated otherwise.
*
* \warning The hull (i.e., transform, bounding-box and
* time-bounds) is only guaranteed to be up-to-date after calling
* UpdateInformation().
*
* \ingroup Geometry
*/
class MITKCORE_EXPORT SlicedGeometry3D : public mitk::BaseGeometry
{
public:
- mitkClassMacro(SlicedGeometry3D, BaseGeometry)
+ mitkClassMacro(SlicedGeometry3D, BaseGeometry);
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* \brief Returns the PlaneGeometry of the slice (\a s).
*
* If (a) m_EvenlySpaced==true, (b) we don't have a PlaneGeometry stored
* for the requested slice, and (c) the first slice (s=0)
* is a PlaneGeometry instance, then we calculate the geometry of the
* requested as the plane of the first slice shifted by m_Spacing[3]*s
* in the direction of m_DirectionVector.
*
* \warning The PlaneGeometries are not necessarily up-to-date and not even
* initialized.
*
* The PlaneGeometries have to be initialized in the method
* GenerateOutputInformation() of BaseProcess (or CopyInformation /
* UpdateOutputInformation of BaseData, if possible, e.g., by analyzing
* pic tags in Image) subclasses. See also
*
* \sa itk::ProcessObject::GenerateOutputInformation(),
* \sa itk::DataObject::CopyInformation() and
* \sa itk::DataObject::UpdateOutputInformation().
*/
virtual mitk::PlaneGeometry *GetPlaneGeometry(int s) const;
/**
* \deprecatedSince{2014_10} Please use GetPlaneGeometry
*/
DEPRECATED(const PlaneGeometry *GetGeometry2D(int s)) { return GetPlaneGeometry(s); }
/**
* \deprecatedSince{2014_10} Please use SetPlaneGeometry
*/
DEPRECATED(void SetGeometry2D(PlaneGeometry *geo, int s)) { SetPlaneGeometry(geo, s); }
//##Documentation
//## @brief When switching from an Image Geometry to a normal Geometry (and the other way around), you have to
//change
// the origin as well (See Geometry Documentation)! This function will change the "isImageGeometry" bool flag and
// changes the origin respectively.
void ChangeImageGeometryConsideringOriginOffset(const bool isAnImageGeometry) override;
// virtual void SetTimeBounds( const mitk::TimeBounds& timebounds );
const mitk::BoundingBox *GetBoundingBox() const override;
/**
* \brief Get the number of slices
*/
- itkGetConstMacro(Slices, unsigned int)
+ itkGetConstMacro(Slices, unsigned int);
/**
* \brief Set PlaneGeometry of slice \a s.
*/
virtual bool SetPlaneGeometry(mitk::PlaneGeometry *geometry2D, int s);
/**
* \brief Check whether a slice exists
*/
virtual bool IsValidSlice(int s = 0) const;
virtual const BaseGeometry* GetReferenceGeometry() const;
virtual void SetReferenceGeometry(const BaseGeometry *referenceGeometry);
bool HasReferenceGeometry() const;
/**
* \brief Set the SliceNavigationController corresponding to this sliced
* geometry.
*
* The SNC needs to be informed when the number of slices in the geometry
* changes, which can occur whenthe slices are re-oriented by rotation.
*/
virtual void SetSliceNavigationController(mitk::SliceNavigationController *snc);
mitk::SliceNavigationController *GetSliceNavigationController();
/**
* \brief Set/Get whether the SlicedGeometry3D is evenly-spaced
* (m_EvenlySpaced)
*
* If (a) m_EvenlySpaced==true, (b) we don't have a PlaneGeometry stored for
* the requested slice, and (c) the first slice (s=0) is a PlaneGeometry
* instance, then we calculate the geometry of the requested as the plane
* of the first slice shifted by m_Spacing.z * s in the direction of
* m_DirectionVector.
*
* \sa GetPlaneGeometry
*/
- itkGetConstMacro(EvenlySpaced, bool)
+ itkGetConstMacro(EvenlySpaced, bool);
virtual void SetEvenlySpaced(bool on = true);
/**
* \brief Set/Get the vector between slices for the evenly-spaced case
* (m_EvenlySpaced==true).
*
* If the direction-vector is (0,0,0) (the default) and the first
* 2D geometry is a PlaneGeometry, then the direction-vector will be
* calculated from the plane normal.
*
* \sa m_DirectionVector
*/
virtual void SetDirectionVector(const mitk::Vector3D &directionVector);
- itkGetConstMacro(DirectionVector, const mitk::Vector3D &)
+ itkGetConstMacro(DirectionVector, const mitk::Vector3D &);
itk::LightObject::Pointer InternalClone() const override;
#ifndef SWIG
static const std::string SLICES;
const static std::string DIRECTION_VECTOR;
const static std::string EVENLY_SPACED;
#endif // !SWIG
/**
* \brief Tell this instance how many PlaneGeometries it shall manage. Bounding
* box and the PlaneGeometries must be set additionally by calling the respective
* methods!
*
* \warning Bounding box and the 2D-geometries must be set additionally: use
* SetBounds(), SetGeometry().
*/
virtual void InitializeSlicedGeometry(unsigned int slices);
/**
* \brief Completely initialize this instance as evenly-spaced with slices
* parallel to the provided PlaneGeometry that is used as the first slice and
* for spacing calculation.
*
* Initializes the bounding box according to the width/height of the
* PlaneGeometry and \a slices. The spacing is calculated from the PlaneGeometry.
*/
virtual void InitializeEvenlySpaced(mitk::PlaneGeometry *geometry2D, unsigned int slices);
/**
* \brief Completely initialize this instance as evenly-spaced with slices
* parallel to the provided PlaneGeometry that is used as the first slice and
* for spacing calculation (except z-spacing).
*
* Initializes the bounding box according to the width/height of the
* PlaneGeometry and \a slices. The x-/y-spacing is calculated from the
* PlaneGeometry.
*/
virtual void InitializeEvenlySpaced(mitk::PlaneGeometry *geometry2D,
mitk::ScalarType zSpacing,
unsigned int slices);
/**
* \brief Completely initialize this instance as evenly-spaced plane slices
* parallel to a side of the provided BaseGeometry and using its spacing
* information.
*
* Initializes the bounding box according to the width/height of the
* BaseGeometry and the number of slices according to
* BaseGeometry::GetExtent(2).
*
* \param planeorientation side parallel to which the slices will be oriented
* \param top if \a true, create plane at top, otherwise at bottom
* (for PlaneOrientation Axial, for other plane locations respectively)
* \param frontside defines the side of the plane (the definition of
* front/back is somewhat arbitrary)
*
* \param rotate rotates the plane by 180 degree around its normal (the
* definition of rotated vs not rotated is somewhat arbitrary)
*/
virtual void InitializePlanes(const mitk::BaseGeometry *geometry3D,
mitk::PlaneGeometry::PlaneOrientation planeorientation,
bool top = true,
bool frontside = true,
bool rotated = false);
void SetImageGeometry(const bool isAnImageGeometry) override;
void ExecuteOperation(Operation *operation) override;
static double CalculateSpacing(const mitk::Vector3D &spacing, const mitk::Vector3D &d);
protected:
SlicedGeometry3D();
SlicedGeometry3D(const SlicedGeometry3D &other);
~SlicedGeometry3D() override;
/**
* Reinitialize plane stack after rotation. More precisely, the first plane
* of the stack needs to spatially aligned, in two respects:
*
* 1. Re-alignment with respect to the dataset center; this is necessary
* since the distance from the first plane to the center could otherwise
* continuously decrease or increase.
* 2. Re-alignment with respect to a given reference point; the reference
* point is a location which the user wants to be exactly touched by one
* plane of the plane stack. The first plane is minimally shifted to
* ensure this touching. Usually, the reference point would be the
* point around which the geometry is rotated.
*/
virtual void ReinitializePlanes(const Point3D &center, const Point3D &referencePoint);
ScalarType GetLargestExtent(const BaseGeometry *geometry);
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
/** Calculate "directed spacing", i.e. the spacing in directions
* non-orthogonal to the coordinate axes. This is done via the
* ellipsoid equation.
*/
double CalculateSpacing(const mitk::Vector3D &direction) const;
/** The extent of the slice stack, i.e. the number of slices, depends on the
* plane normal. For rotated geometries, the geometry's transform needs to
* be accounted in this calculation.
*/
mitk::Vector3D AdjustNormal(const mitk::Vector3D &normal) const;
/**
* Container for the 2D-geometries contained within this SliceGeometry3D.
*/
mutable std::vector<PlaneGeometry::Pointer> m_PlaneGeometries;
/**
* If (a) m_EvenlySpaced==true, (b) we don't have a PlaneGeometry stored
* for the requested slice, and (c) the first slice (s=0)
* is a PlaneGeometry instance, then we calculate the geometry of the
* requested as the plane of the first slice shifted by m_Spacing.z*s
* in the direction of m_DirectionVector.
*
* \sa GetPlaneGeometry
*/
bool m_EvenlySpaced;
/**
* Vector between slices for the evenly-spaced case (m_EvenlySpaced==true).
* If the direction-vector is (0,0,0) (the default) and the first
* 2D geometry is a PlaneGeometry, then the direction-vector will be
* calculated from the plane normal.
*/
mutable mitk::Vector3D m_DirectionVector;
/** Number of slices this SliceGeometry3D is descibing. */
unsigned int m_Slices;
/** Underlying BaseGeometry for this SlicedGeometry */
const mitk::BaseGeometry *m_ReferenceGeometry;
/** SNC correcsponding to this geometry; used to reflect changes in the
* number of slices due to rotation. */
// mitk::NavigationController *m_NavigationController;
mitk::SliceNavigationController *m_SliceNavigationController;
//##Documentation
//## @brief PreSetSpacing
//##
//## These virtual function allows a different beahiour in subclasses.
//## Do implement them in every subclass of BaseGeometry. If not needed, use
//## {Superclass::PreSetSpacing();};
void PreSetSpacing(const mitk::Vector3D &aSpacing) override;
};
} // namespace mitk
#endif /* MITKSLICEDGEOMETRY3D_H_HEADER_INCLUDED_C1EBD0AD */
diff --git a/Modules/Core/include/mitkSlicesCoordinator.h b/Modules/Core/include/mitkSlicesCoordinator.h
index bc8c511bbf..7397f1dda5 100644
--- a/Modules/Core/include/mitkSlicesCoordinator.h
+++ b/Modules/Core/include/mitkSlicesCoordinator.h
@@ -1,99 +1,99 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef SLICESCOORDINATOR_H_HEADER_INCLUDED_C1C55A2F
#define SLICESCOORDINATOR_H_HEADER_INCLUDED_C1C55A2F
#include <MitkCoreExports.h>
#include <itkObject.h>
#include <mitkCommon.h>
#include <vector>
namespace mitk
{
class SliceNavigationController;
class Action;
class StateEvent;
#pragma GCC visibility push(default)
itkEventMacro(SliceRotationEvent, itk::AnyEvent);
#pragma GCC visibility pop
/**
* \brief Coordinates a list of SliceNavigationControllers.
*
* Each SliceNavigationController can select one slice from a
* TimeGeometry. This class (SlicesCoordinator) coordinates several
* SliceNavigationControllers to facilitate e.g. rotation of slices. A new
* class is needed, because for rotation one has to know an axis of rotation.
* Such an axis is most easily determined from the "other slices", which are
* not known by a SliceNavigationController.
*/
class MITKCORE_EXPORT SlicesCoordinator : public itk::Object
{
public:
mitkClassMacroItkParent(SlicesCoordinator, itk::Object);
- itkFactorylessNewMacro(Self)
+ itkFactorylessNewMacro(Self);
typedef std::vector<SliceNavigationController *> SNCVector;
/** Add to list of managed slices. Check if CreatedWorldGeometry of SNC is
* managable (i.e. there is basically only one planegeometry) */
void AddSliceController(SliceNavigationController *snc);
/** Remove one controller from the internal list */
void RemoveSliceController(SliceNavigationController *snc);
/* Reset all Slices to central slice, no rotation */
// void ResetAllSlices();
/** Set/Get whether planes should stay linked to each other (by fixing
* their relative angle) */
itkSetMacro(LinkPlanes, bool);
itkGetMacro(LinkPlanes, bool);
itkBooleanMacro(LinkPlanes);
/** \brief Resets the mouse cursor (if modified by the SlicesCoordinator)
* to its original state.
*
* Should be used by subclasses and from external application instead
* of using QmitkApplicationCursor directly to avoid conflicts. */
void ResetMouseCursor();
protected:
/** \brief Default Constructor */
SlicesCoordinator();
/** clear list of controllers */
~SlicesCoordinator() override;
/** \brief Sets the specified mouse cursor.
*
* Use this in subclasses instead of using QmitkApplicationCursor directly.
*/
void SetMouseCursor(const char *xpm[], int hotspotX, int hotspotY);
/** for implementation in subclasses */
virtual void OnSliceControllerAdded(SliceNavigationController *snc);
/** for implementation in subclasses */
virtual void OnSliceControllerRemoved(SliceNavigationController *snc);
SNCVector m_SliceNavigationControllers;
bool m_LinkPlanes;
bool m_MouseCursorSet;
};
} // namespace
#endif
diff --git a/Modules/Core/include/mitkSmartPointerProperty.h b/Modules/Core/include/mitkSmartPointerProperty.h
index cc98e05f85..6cef5ba5a9 100644
--- a/Modules/Core/include/mitkSmartPointerProperty.h
+++ b/Modules/Core/include/mitkSmartPointerProperty.h
@@ -1,97 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKSMARTPOINTERPROPERTY_H_HEADER_INCLUDED_C126B791
#define MITKSMARTPOINTERPROPERTY_H_HEADER_INCLUDED_C126B791
#include "mitkBaseProperty.h"
#include "mitkUIDGenerator.h"
#include <MitkCoreExports.h>
#include <list>
#include <map>
#include <string>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
//##Documentation
//## @brief Property containing a smart-pointer
//## @ingroup DataManagement
class MITKCORE_EXPORT SmartPointerProperty : public BaseProperty
{
public:
mitkClassMacro(SmartPointerProperty, BaseProperty);
-
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) mitkNewMacro1Param(SmartPointerProperty, itk::Object *);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ mitkNewMacro1Param(SmartPointerProperty, itk::Object*);
typedef itk::Object::Pointer ValueType;
itk::Object::Pointer GetSmartPointer() const;
ValueType GetValue() const;
void SetSmartPointer(itk::Object *);
void SetValue(const ValueType &);
/// mainly for XML output
std::string GetValueAsString() const override;
static void PostProcessXMLReading();
/// Return the number of SmartPointerProperties that reference the object given as parameter
static unsigned int GetReferenceCountFor(itk::Object *);
static std::string GetReferenceUIDFor(itk::Object *);
static void RegisterPointerTarget(itk::Object *, const std::string uid);
using BaseProperty::operator=;
protected:
SmartPointerProperty(itk::Object * = nullptr);
SmartPointerProperty(const SmartPointerProperty &);
itk::Object::Pointer m_SmartPointer;
private:
// purposely not implemented
SmartPointerProperty &operator=(const SmartPointerProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &) const override;
bool Assign(const BaseProperty &) override;
typedef std::map<itk::Object *, unsigned int> ReferenceCountMapType;
typedef std::map<itk::Object *, std::string> ReferencesUIDMapType;
typedef std::map<SmartPointerProperty *, std::string> ReadInSmartPointersMapType;
typedef std::map<std::string, itk::Object *> ReadInTargetsMapType;
/// for each itk::Object* count how many SmartPointerProperties point to it
static ReferenceCountMapType m_ReferenceCount;
static ReferencesUIDMapType m_ReferencesUID;
static ReadInSmartPointersMapType m_ReadInInstances;
static ReadInTargetsMapType m_ReadInTargets;
/// to generate unique IDs for the objects pointed at (during XML writing)
static UIDGenerator m_UIDGenerator;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
#endif /* MITKSMARTPOINTERPROPERTY_H_HEADER_INCLUDED_C126B791 */
diff --git a/Modules/Core/include/mitkStandaloneDataStorage.h b/Modules/Core/include/mitkStandaloneDataStorage.h
index 4437955729..adf6b52e48 100644
--- a/Modules/Core/include/mitkStandaloneDataStorage.h
+++ b/Modules/Core/include/mitkStandaloneDataStorage.h
@@ -1,132 +1,133 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKSTANDALONEDATASTORAGE_H_HEADER_INCLUDED_
#define MITKSTANDALONEDATASTORAGE_H_HEADER_INCLUDED_
#include "itkVectorContainer.h"
#include "mitkDataStorage.h"
#include "mitkMessage.h"
#include <map>
namespace mitk
{
class NodePredicateBase;
class DataNode;
//##Documentation
//## @brief Data management class that handles 'was created by' relations
//##
//## The StandaloneDataStorage provides data storage and management functionality.
//## It handles a 'was created by' relation by associating each data object with a
//## set of source objects that were used to create the new object was created from.
//## Thus, nodes are stored in a noncyclical directed graph data structure.
//## It is derived from mitk::DataStorage and implements its interface,
//## including AddNodeEvent and RemoveNodeEvent.
//## @ingroup StandaloneDataStorage
class MITKCORE_EXPORT StandaloneDataStorage : public mitk::DataStorage
{
public:
mitkClassMacro(StandaloneDataStorage, mitk::DataStorage);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
//##Documentation
//## @brief Adds a DataNode containing a data object to its internal storage
//##
//## This Method adds a new data object to the StandaloneDataStorage. The new object is
//## passed in the first parameter. The second parameter is a set
//## of source objects, that were used to create this object. The new object will have
//## a 'was created from' relation to its source objects.
//## the addition of a new object will fire the notification mechanism.
//## If the node parameter is nullptr or if the DataNode has already been added,
//## an exception will be thrown.
void Add(mitk::DataNode *node, const mitk::DataStorage::SetOfObjects *parents = nullptr) override;
//##Documentation
//## @brief Removes node from the StandaloneDataStorage
//##
void Remove(const mitk::DataNode *node) override;
//##Documentation
//## @brief Checks if a node exists in the StandaloneDataStorage
//##
bool Exists(const mitk::DataNode *node) const override;
//##Documentation
//## @brief returns a set of source objects for a given node that meet the given condition(s).
//##
SetOfObjects::ConstPointer GetSources(const mitk::DataNode *node,
const NodePredicateBase *condition = nullptr,
bool onlyDirectSources = true) const override;
//##Documentation
//## @brief returns a set of derived objects for a given node.
//##
//## GetDerivations() returns a set of objects that are derived from the DataNode node.
//## This means, that node was used to create the returned objects. If the parameter
//## onlyDirectDerivations is set to true (default value), only objects that directly have
//## node as one of their source objects will be returned. Otherwise, objects that are
//## derived from derivations of node are returned too.
//## The derived objects can be filtered with a predicate object as described in the GetSubset()
//## method by providing a predicate as the condition parameter.
SetOfObjects::ConstPointer GetDerivations(const mitk::DataNode *node,
const NodePredicateBase *condition = nullptr,
bool onlyDirectDerivations = true) const override;
//##Documentation
//## @brief returns a set of all data objects that are stored in the data storage
//##
SetOfObjects::ConstPointer GetAll() const override;
/*ITK Mutex */
mutable itk::SimpleFastMutexLock m_Mutex;
protected:
//##Documentation
//## @brief noncyclical directed graph data structure to store the nodes with their relation
typedef std::map<mitk::DataNode::ConstPointer, SetOfObjects::ConstPointer> AdjacencyList;
//##Documentation
//## @brief Standard Constructor for ::New() instantiation
StandaloneDataStorage();
//##Documentation
//## @brief Standard Destructor
~StandaloneDataStorage() override;
//##Documentation
//## @brief convenience method to check if the object has been initialized (i.e. a data tree has been set)
bool IsInitialized() const;
//##Documentation
//## @brief Traverses the Relation graph and extracts a list of related elements (e.g. Sources or Derivations)
SetOfObjects::ConstPointer GetRelations(const mitk::DataNode *node,
const AdjacencyList &relation,
const NodePredicateBase *condition = nullptr,
bool onlyDirectlyRelated = true) const;
//##Documentation
//## @brief deletes all references to a node in a given relation (used in Remove() and TreeListener)
void RemoveFromRelation(const mitk::DataNode *node, AdjacencyList &relation);
//##Documentation
//## @brief Prints the contents of the StandaloneDataStorage to os. Do not call directly, call ->Print() instead
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
//##Documentation
//## @brief Nodes and their relation are stored in m_SourceNodes
AdjacencyList m_SourceNodes;
//##Documentation
//## @brief Nodes are stored in reverse relation for easier traversal in the opposite direction of the relation
AdjacencyList m_DerivedNodes;
};
} // namespace mitk
#endif /* MITKSTANDALONEDATASTORAGE_H_HEADER_INCLUDED_ */
diff --git a/Modules/Core/include/mitkStandardFileLocations.h b/Modules/Core/include/mitkStandardFileLocations.h
index 8f7865490e..d49dc2405e 100644
--- a/Modules/Core/include/mitkStandardFileLocations.h
+++ b/Modules/Core/include/mitkStandardFileLocations.h
@@ -1,111 +1,112 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_STANDARD_FILE_LOCATIONS_H_INCLUDED_SWDG
#define MITK_STANDARD_FILE_LOCATIONS_H_INCLUDED_SWDG
#include <string>
#include <MitkCoreExports.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
namespace mitk
{
/*! \brief Provides a method to look for configuration and option files etc.
Call mitk::StandardFileLocations::FindFile(filename) to look for configuration files.
Call mitk::StandardFileLocations::GetOptionDirectory() to look for/save option files.
*/
class MITKCORE_EXPORT StandardFileLocations : public itk::Object
{
public:
typedef StandardFileLocations Self;
typedef itk::Command Superclass;
typedef itk::SmartPointer<Self> Pointer;
/*!
\brief Adds a directory into the search queue:
\ Use this function in combination with FindFile(), after adding some
\ directories, they will also be searched for the requested file
\param dir directory you want to be searched in
\param insertInFrontOfSearchList wheather this search request shall be processed first
*/
void AddDirectoryForSearch(const char *dir, bool insertInFrontOfSearchList = true);
/*!
\brief Remove a directory from the search queue:
\ Use this function in combination with FindFile().
\param dir directory you want to be searched in
*/
void RemoveDirectoryForSearch(const char *dir);
/*!
\brief looks for a file in several standard locations
\param filename The file you want to fine, without any path
\param pathInSourceDir Where in the source tree hierarchy would that file be?
\return The absolute path to the file including the filename
This method appends several standard locations to the end of the searchqueue (if they not already exist)
and then searches for the file within all directories contained in the search queue:
<ol>
<li> Add the directory specified in the environment variable MITKCONF
<li> Add the .mitk directory in the home folder of the user
<li> Add the current working directory
<li> Add the (current working directory)/bin directory
<li> Add the directory specified in pathInSourceDir, that is relative to the source code directory root (which is
determined at compile time)
</ol>
Already added directories in the searchqueue by using AddDirectoryForSearch before calling FindFile are still searched
first,
because above mentioned standard locations are always appended at the end of the list.
*/
std::string FindFile(const char *filename, const char *pathInSourceDir = nullptr);
/*!
\brief Return directory of/for option files
\return The absolute path to the directory for option files.
This method looks for the directory of/for option files in two ways. The logic is as follows
1. If there is an environment variable MITKOPTIONS, then use that directory.
2. Use .mitk-subdirectory in home directory of the user
The directory will be created if it does not exist.
*/
std::string GetOptionDirectory();
static StandardFileLocations *GetInstance();
protected:
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef std::vector<std::string> FileSearchVectorType;
FileSearchVectorType m_SearchDirectories;
StandardFileLocations();
~StandardFileLocations() override;
std::string SearchDirectoriesForFile(const char *filename);
private:
// Private Copy Constructor
StandardFileLocations(const StandardFileLocations &);
};
} // namespace
#endif
diff --git a/Modules/Core/include/mitkStateMachineAction.h b/Modules/Core/include/mitkStateMachineAction.h
index 8fccc4fa16..5730a579df 100644
--- a/Modules/Core/include/mitkStateMachineAction.h
+++ b/Modules/Core/include/mitkStateMachineAction.h
@@ -1,52 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef SMACTION_H_HEADER_INCLUDED_C19AE06B
#define SMACTION_H_HEADER_INCLUDED_C19AE06B
#include "MitkCoreExports.h"
#include "mitkCommon.h"
#include <itkLightObject.h>
#include <itkObjectFactory.h>
#include <string>
namespace mitk
{
//##Documentation
//## @brief Represents an action, that is executed after a certain event (in statemachine-mechanism)
//## TODO: implement: Is used to connect the Action-Id in an XML Statemachine description with a functor in the
// StateMachine
//## implementation
//## @ingroup Interaction
class MITKCORE_EXPORT StateMachineAction : public itk::LightObject
{
public:
- mitkClassMacroItkParent(StateMachineAction, itk::Object) mitkNewMacro1Param(Self, const std::string &)
- /**
- * @brief Returns the String-Id of this action.
- **/
- std::string GetActionName() const;
+ mitkClassMacroItkParent(StateMachineAction, itk::Object);
+ mitkNewMacro1Param(Self, const std::string&);
+
+ /**
+ * @brief Returns the String-Id of this action.
+ **/
+ std::string GetActionName() const;
protected:
StateMachineAction(const std::string &);
~StateMachineAction() override;
private:
/**
* @brief The Id-Name of this action.
**/
std::string m_ActionName;
};
} // namespace mitk
#endif /* SMACTION_H_HEADER_INCLUDED_C19AE06B */
diff --git a/Modules/Core/include/mitkStepper.h b/Modules/Core/include/mitkStepper.h
index b41185b315..1a4e256ca8 100644
--- a/Modules/Core/include/mitkStepper.h
+++ b/Modules/Core/include/mitkStepper.h
@@ -1,144 +1,144 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef STEPPER_H_HEADER_INCLUDED_C1E77191
#define STEPPER_H_HEADER_INCLUDED_C1E77191
#include "mitkNumericTypes.h"
#include <MitkCoreExports.h>
#include <mitkCommon.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <string>
namespace mitk
{
/**
* \brief Helper class to step through a list
*
* A helper class to step through a list. Does not contain the list, just the
* position in the list (between 0 and GetSteps()). Provides methods like
* First (go to the first element), Next (go to the next one), etc.
*
* Besides the actual number of steps, the stepper can also hold a stepping
* range, indicating the scalar values corresponding to the covered steps.
* For example, steppers are generally used to slice a dataset with a plane;
* Hereby, Steps indicates the total number of steps (positions) available for
* the plane, Pos indicates the current step, and Range indicates the physical
* minimum and maximum values for the plane, in this case a value in mm.
*
* The range can also be supplied with a unit name (a string) which can be
* used by classes providing information about the stepping (e.g. graphical
* sliders).
*
* \ingroup NavigationControl
*/
class MITKCORE_EXPORT Stepper : public itk::Object
{
public:
mitkClassMacroItkParent(Stepper, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkGetConstMacro(Pos, unsigned int);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkGetConstMacro(Pos, unsigned int);
virtual void SetPos(unsigned int pos)
{
// copied from itkMacro.h, itkSetClampMacro(...)
unsigned int newPos;
if (m_Steps != 0)
{
newPos = (pos > m_Steps - 1 ? m_Steps - 1 : pos);
}
else
{
newPos = 0;
}
if (this->m_Pos != newPos)
{
this->m_Pos = newPos;
this->Modified();
}
}
itkGetConstMacro(Steps, unsigned int);
itkSetMacro(Steps, unsigned int);
itkGetConstMacro(AutoRepeat, bool);
itkSetMacro(AutoRepeat, bool);
itkBooleanMacro(AutoRepeat);
/** Causes the stepper to shift direction when the boundary is reached */
itkSetMacro(PingPong, bool);
itkGetConstMacro(PingPong, bool);
itkBooleanMacro(PingPong);
/** If set to true, the Next() decreases the stepper and Previous()
* decreases it */
itkSetMacro(InverseDirection, bool);
itkGetConstMacro(InverseDirection, bool);
itkBooleanMacro(InverseDirection);
void SetRange(ScalarType min, ScalarType max);
void InvalidateRange();
ScalarType GetRangeMin() const;
ScalarType GetRangeMax() const;
bool HasValidRange() const;
void RemoveRange();
bool HasRange() const;
void SetUnitName(const char *unitName);
const char *GetUnitName() const;
void RemoveUnitName();
bool HasUnitName() const;
virtual void Next();
virtual void Previous();
virtual void MoveSlice(int sliceDelta);
virtual void First();
virtual void Last();
protected:
Stepper();
~Stepper() override;
void Increase();
void Decrease();
unsigned int m_Pos;
unsigned int m_Steps;
bool m_AutoRepeat;
bool m_PingPong;
bool m_InverseDirection;
ScalarType m_RangeMin;
ScalarType m_RangeMax;
bool m_RangeValid;
bool m_HasRange;
std::string m_UnitName;
bool m_HasUnitName;
};
} // namespace mitk
#endif /* STEPPER_H_HEADER_INCLUDED_C1E77191 */
diff --git a/Modules/Core/include/mitkStringProperty.h b/Modules/Core/include/mitkStringProperty.h
index 0d5ebbb46f..1a4d62f442 100644
--- a/Modules/Core/include/mitkStringProperty.h
+++ b/Modules/Core/include/mitkStringProperty.h
@@ -1,76 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKSTRINGPROPERTY_H_HEADER_INCLUDED_C1C02491
#define MITKSTRINGPROPERTY_H_HEADER_INCLUDED_C1C02491
#include <itkConfigure.h>
#include "mitkBaseProperty.h"
#include <MitkCoreExports.h>
#include <string>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* @brief Property for strings
* @ingroup DataManagement
*/
class MITKCORE_EXPORT StringProperty : public BaseProperty
{
protected:
std::string m_Value;
StringProperty(const char *string = nullptr);
StringProperty(const std::string &s);
StringProperty(const StringProperty &);
public:
mitkClassMacro(StringProperty, BaseProperty);
typedef std::string ValueType;
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) mitkNewMacro1Param(StringProperty, const char *);
- mitkNewMacro1Param(StringProperty, const std::string &)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ mitkNewMacro1Param(StringProperty, const char*);
+ mitkNewMacro1Param(StringProperty, const std::string&);
- itkGetStringMacro(Value);
+ itkGetStringMacro(Value);
itkSetStringMacro(Value);
std::string GetValueAsString() const override;
static const char *PATH;
using BaseProperty::operator=;
private:
// purposely not implemented
StringProperty &operator=(const StringProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
#endif
diff --git a/Modules/Core/include/mitkSubImageSelector.h b/Modules/Core/include/mitkSubImageSelector.h
index ebaa87096b..ddd5cbd79d 100644
--- a/Modules/Core/include/mitkSubImageSelector.h
+++ b/Modules/Core/include/mitkSubImageSelector.h
@@ -1,57 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef SUBIMAGESELECTOR_H_HEADER_INCLUDED_C1E4F463
#define SUBIMAGESELECTOR_H_HEADER_INCLUDED_C1E4F463
#include "mitkBaseData.h"
#include "mitkImageDataItem.h"
#include "mitkImageToImageFilter.h"
#include <MitkCoreExports.h>
namespace mitk
{
//##Documentation
//## @brief Base class of all classes providing access to parts of an image
//##
//## Base class of all classes providing access to parts of an image, e.g., to
//## a slice (mitk::ImageSilceSelector) or a volume at a specific time
//## (mitk::ImageTimeSelector). If the input is generated by a ProcessObject,
//## only the required data is requested.
//## @ingroup Process
class MITKCORE_EXPORT SubImageSelector : public ImageToImageFilter
{
public:
/** Run-time type information (and related methods). */
mitkClassMacro(SubImageSelector, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
virtual void SetPosNr(int p);
SubImageSelector();
~SubImageSelector() override;
protected:
mitk::Image::ImageDataItemPointer GetSliceData(int s = 0, int t = 0, int n = 0);
mitk::Image::ImageDataItemPointer GetVolumeData(int t = 0, int n = 0);
mitk::Image::ImageDataItemPointer GetChannelData(int n = 0);
void SetSliceItem(mitk::Image::ImageDataItemPointer dataItem, int s = 0, int t = 0, int n = 0);
void SetVolumeItem(mitk::Image::ImageDataItemPointer dataItem, int t = 0, int n = 0);
void SetChannelItem(mitk::Image::ImageDataItemPointer dataItem, int n = 0);
};
} // namespace mitk
#endif /* SUBIMAGESELECTOR_H_HEADER_INCLUDED_C1E4F463 */
diff --git a/Modules/Core/include/mitkSurface.h b/Modules/Core/include/mitkSurface.h
index baadda7ae5..9708cc7e0e 100644
--- a/Modules/Core/include/mitkSurface.h
+++ b/Modules/Core/include/mitkSurface.h
@@ -1,138 +1,139 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkSurface_h
#define mitkSurface_h
#include "itkImageRegion.h"
#include "mitkBaseData.h"
#include <vtkSmartPointer.h>
class vtkPolyData;
namespace mitk
{
/**
* \brief Class for storing surfaces (vtkPolyData).
* \ingroup Data
*/
class MITKCORE_EXPORT Surface : public BaseData
{
public:
typedef itk::ImageRegion<5> RegionType;
mitkClassMacro(Surface, BaseData);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void CalculateBoundingBox();
void CopyInformation(const itk::DataObject *data) override;
void ExecuteOperation(Operation *operation) override;
void Expand(unsigned int timeSteps = 1) override;
const RegionType &GetLargestPossibleRegion() const;
virtual const RegionType &GetRequestedRegion() const;
unsigned int GetSizeOfPolyDataSeries() const;
virtual vtkPolyData *GetVtkPolyData(unsigned int t = 0) const;
void Graft(const DataObject *data) override;
bool IsEmptyTimeStep(unsigned int t) const override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
void SetRequestedRegion(const itk::DataObject *data) override;
virtual void SetRequestedRegion(Surface::RegionType *region);
void SetRequestedRegionToLargestPossibleRegion() override;
virtual void SetVtkPolyData(vtkPolyData *polydata, unsigned int t = 0);
virtual void Swap(Surface &other);
void Update() override;
void UpdateOutputInformation() override;
bool VerifyRequestedRegion() override;
protected:
mitkCloneMacro(Self);
Surface();
~Surface() override;
Surface(const Surface &other);
Surface &operator=(Surface other);
void ClearData() override;
void InitializeEmpty() override;
private:
std::vector<vtkSmartPointer<vtkPolyData>> m_PolyDatas;
mutable RegionType m_LargestPossibleRegion;
mutable RegionType m_RequestedRegion;
bool m_CalculateBoundingBox;
};
/**
* @brief Equal Compare two surfaces for equality, returns true if found equal.
* @warning This method is deprecated and will not be available in the future. Use the \a bool mitk::Equal(const
* mitk::Surface& s1, const mitk::Surface& s2) instead
* @ingroup MITKTestingAPI
* @param rightHandSide Surface to compare.
* @param leftHandSide Surface to compare.
* @param eps Epsilon to use for floating point comparison. Most of the time mitk::eps will be sufficient.
* @param verbose Flag indicating if the method should give a detailed console output.
* @return True if every comparison is true, false in any other case.
*/
DEPRECATED(MITKCORE_EXPORT bool Equal(
mitk::Surface *leftHandSide, mitk::Surface *rightHandSide, mitk::ScalarType eps, bool verbose));
/**
* @brief Equal Compare two surfaces for equality, returns true if found equal.
* @ingroup MITKTestingAPI
* @param rightHandSide Surface to compare.
* @param leftHandSide Surface to compare.
* @param eps Epsilon to use for floating point comparison. Most of the time mitk::eps will be sufficient.
* @param verbose Flag indicating if the method should give a detailed console output.
* @return True if every comparison is true, false in any other case.
*/
MITKCORE_EXPORT bool Equal(mitk::Surface &leftHandSide,
mitk::Surface &rightHandSide,
mitk::ScalarType eps,
bool verbose);
/**
* @brief Equal Compare two vtk PolyDatas for equality, returns true if found equal.
* @warning This method is deprecated and will not be available in the future. Use the \a bool mitk::Equal(const
* vtkPolyData& p1, const vtkPolyData& p2) instead
* @ingroup MITKTestingAPI
* @param rightHandSide Surface to compare.
* @param leftHandSide Surface to compare.
* @param eps Epsilon to use for floating point comparison. Most of the time mitk::eps will be sufficient.
* @param verbose Flag indicating if the method should give a detailed console output.
* @return True if every comparison is true, false in any other case.
*
* This will only check if the number of cells, vertices, polygons, stripes and lines is the same and whether
* all the two poly datas have the same number of points with the same coordinates. It is not checked whether
* all points are correctly connected.
*/
DEPRECATED(MITKCORE_EXPORT bool Equal(
vtkPolyData *leftHandSide, vtkPolyData *rightHandSide, mitk::ScalarType eps, bool verbose));
/**
* @brief Equal Compare two vtk PolyDatas for equality, returns true if found equal.
* @ingroup MITKTestingAPI
* @param rightHandSide Surface to compare.
* @param leftHandSide Surface to compare.
* @param eps Epsilon to use for floating point comparison. Most of the time mitk::eps will be sufficient.
* @param verbose Flag indicating if the method should give a detailed console output.
* @return True if every comparison is true, false in any other case.
*
* This will only check if the number of cells, vertices, polygons, stripes and lines is the same and whether
* all the two poly datas have the same number of points with the same coordinates. It is not checked whether
* all points are correctly connected.
*/
MITKCORE_EXPORT bool Equal(vtkPolyData &leftHandSide, vtkPolyData &rightHandSide, mitk::ScalarType eps, bool verbose);
}
#endif
diff --git a/Modules/Core/include/mitkSurfaceSource.h b/Modules/Core/include/mitkSurfaceSource.h
index e77777dc09..6c43c1ba09 100644
--- a/Modules/Core/include/mitkSurfaceSource.h
+++ b/Modules/Core/include/mitkSurfaceSource.h
@@ -1,67 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKSURFACEDATASOURCE_H_HEADER_INCLUDED_C10B4740
#define MITKSURFACEDATASOURCE_H_HEADER_INCLUDED_C10B4740
#include "mitkBaseDataSource.h"
namespace mitk
{
class Surface;
/**
* @brief Superclass of all classes generating surfaces (instances of class
* Surface) as output.
*
* In itk and vtk the generated result of a ProcessObject is only guaranteed
* to be up-to-date, when Update() of the ProcessObject or the generated
* DataObject is called immediately before access of the data stored in the
* DataObject. This is also true for subclasses of mitk::BaseProcess and thus
* for mitk::SurfaceSource.
* @ingroup Process
*/
class MITKCORE_EXPORT SurfaceSource : public BaseDataSource
{
public:
- mitkClassMacro(SurfaceSource, BaseDataSource) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(SurfaceSource, BaseDataSource);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef Surface OutputType;
mitkBaseDataSourceGetOutputDeclarations
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer
MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
protected:
SurfaceSource();
~SurfaceSource() override;
};
} // namespace mitk
#endif /* MITKSURFACEDATASOURCE_H_HEADER_INCLUDED_C10B4740 */
diff --git a/Modules/Core/include/mitkSurfaceToImageFilter.h b/Modules/Core/include/mitkSurfaceToImageFilter.h
index 3db843e339..f99bcd5963 100644
--- a/Modules/Core/include/mitkSurfaceToImageFilter.h
+++ b/Modules/Core/include/mitkSurfaceToImageFilter.h
@@ -1,97 +1,97 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _mitkSurfaceToImageFilter_h__
#define _mitkSurfaceToImageFilter_h__
#include "MitkCoreExports.h"
#include "mitkCommon.h"
#include "mitkImageSource.h"
#include "mitkSurface.h"
class vtkPolyData;
namespace mitk
{
/**
*
* @brief Converts surface data to pixel data. Requires a surface and an
* image, which header information defines the output image.
*
* The resulting image has the same dimension, size, and Geometry3D
* as the input image. The image is cut using a vtkStencil.
* The user can decide if he wants to keep the original values or create a
* binary image by setting MakeBinaryOutputOn (default is \a false). If
* set to \a true all voxels inside the surface are set to one and all
* outside voxel are set to zero.
*
* NOTE: Since the reference input image is passed to the vtkStencil in
* any case, the image needs to be initialized with pixel values greater than
* the numerical minimum of the used pixel type (e.g. at least -127 for
* unsigned char images, etc.) to produce a correct binary image
* representation of the surface in MakeOutputBinary mode.
*
* @ingroup SurfaceFilters
* @ingroup Process
*/
class MITKCORE_EXPORT SurfaceToImageFilter : public ImageSource
{
public:
mitkClassMacro(SurfaceToImageFilter, ImageSource);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkSetMacro(MakeOutputBinary, bool);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkSetMacro(MakeOutputBinary, bool);
itkGetMacro(MakeOutputBinary, bool);
itkBooleanMacro(MakeOutputBinary);
itkSetMacro(UShortBinaryPixelType, bool);
itkGetMacro(UShortBinaryPixelType, bool);
itkBooleanMacro(UShortBinaryPixelType);
itkGetConstMacro(BackgroundValue, float);
itkSetMacro(BackgroundValue, float);
itkGetConstMacro(Tolerance, double);
itkSetMacro(Tolerance, double);
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
const mitk::Surface *GetInput(void);
using itk::ProcessObject::SetInput;
virtual void SetInput(const mitk::Surface *surface);
void SetImage(const mitk::Image *source);
const mitk::Image *GetImage(void);
protected:
SurfaceToImageFilter();
~SurfaceToImageFilter() override;
void Stencil3DImage(int time = 0);
bool m_MakeOutputBinary;
bool m_UShortBinaryPixelType;
float m_BackgroundValue;
double m_Tolerance;
};
} // namespace mitk
#endif /* MITKCOONSPATCHFILTER_H_HEADER_INCLUDED_C10B22CD */
diff --git a/Modules/Core/include/mitkSurfaceToSurfaceFilter.h b/Modules/Core/include/mitkSurfaceToSurfaceFilter.h
index 7f0f241ebd..f91142d7de 100644
--- a/Modules/Core/include/mitkSurfaceToSurfaceFilter.h
+++ b/Modules/Core/include/mitkSurfaceToSurfaceFilter.h
@@ -1,78 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKSURFACETOSURFACEFILTER_H_HEADER_INCLUDED_C10B4740
#define MITKSURFACETOSURFACEFILTER_H_HEADER_INCLUDED_C10B4740
#include "mitkSurfaceSource.h"
namespace mitk
{
class Surface;
//##Documentation
//## @brief Superclass of all classes getting surfaces (instances of class
//## Surface) as input and generating surfaces as output.
//##
//## In itk and vtk the generated result of a ProcessObject is only guaranteed
//## to be up-to-date, when Update() of the ProcessObject or the generated
//## DataObject is called immediately before access of the data stored in the
//## DataObject. This is also true for subclasses of mitk::BaseProcess and thus
//## for mitk::mitkSurfaceToSurfaceFilter.
//## @ingroup Process
class MITKCORE_EXPORT SurfaceToSurfaceFilter : public mitk::SurfaceSource
{
public:
mitkClassMacro(SurfaceToSurfaceFilter, mitk::SurfaceSource);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
typedef itk::DataObject::Pointer DataObjectPointer;
using itk::ProcessObject::SetInput;
virtual void SetInput(const mitk::Surface *surface);
/**
* @brief Add a new input at the given index (idx)
* Calls mitk::Surface::CreateOutputForInput(idx)
* @note The inputs must be added sequentially
* @param idx the index of the input, which must be incremental
* @param surface the input which should be added
*/
virtual void SetInput(unsigned int idx, const mitk::Surface *surface);
virtual const mitk::Surface *GetInput();
virtual const mitk::Surface *GetInput(unsigned int idx);
/**
* @brief Create a new output for the input at idx
* @param idx the index of the input for which the output should be created
*/
virtual void CreateOutputForInput(unsigned int idx);
/**
* @brief Creates outputs for all existing inputs
* @note For each existing input a new output will be allocated
*/
virtual void CreateOutputsForAllInputs();
virtual void RemoveInputs(mitk::Surface *surface);
protected:
SurfaceToSurfaceFilter();
~SurfaceToSurfaceFilter() override;
};
} // namespace mitk
#endif /* MITKSURFACETOSURFACEFILTER_H_HEADER_INCLUDED_C10B4740 */
diff --git a/Modules/Core/include/mitkSurfaceVtkMapper2D.h b/Modules/Core/include/mitkSurfaceVtkMapper2D.h
index 3e9f6294d3..1a0e357f42 100644
--- a/Modules/Core/include/mitkSurfaceVtkMapper2D.h
+++ b/Modules/Core/include/mitkSurfaceVtkMapper2D.h
@@ -1,213 +1,215 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkSurfaceVtkMapper2D_h
#define mitkSurfaceVtkMapper2D_h
#include "mitkBaseRenderer.h"
#include "mitkLocalStorageHandler.h"
#include "mitkVtkMapper.h"
#include <MitkCoreExports.h>
// VTK
#include <vtkSmartPointer.h>
class vtkAssembly;
class vtkCutter;
class vtkPlane;
class vtkLookupTable;
class vtkGlyph3D;
class vtkArrowSource;
class vtkReverseSense;
namespace mitk
{
class Surface;
/**
* @brief Vtk-based mapper for cutting 2D slices out of Surfaces.
*
* The mapper uses a vtkCutter filter to cut out slices (contours) of the 3D
* volume and render these slices as vtkPolyData. The data is transformed
* according to its geometry before cutting, to support the geometry concept
* of MITK.
*
* Properties:
* \b Surface.2D.Line Width: Thickness of the rendered lines in 2D.
* \b Surface.2D.Normals.Draw Normals: enables drawing of normals as 3D arrows
* in the 2D render window. The normals are created with a vtkGlyph3D from
* the vtkPolyData.
* \b Surface.2D.Normals.Draw Inverse Normals: same as normals, but in the
* other direction. The inverse normals are computed with a vtkReverseSense
* filter.
* \b Surface.2D.Normals.(Inverse) Normals Color: Color of the (inverse) normals.
* \b Surface.2D.Normals.(Inverse) Normals Scale Factor: Regulates the size of the normals.
*
* @ingroup Mapper
*/
class MITKCORE_EXPORT SurfaceVtkMapper2D : public VtkMapper
{
public:
mitkClassMacro(SurfaceVtkMapper2D, VtkMapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
virtual const mitk::Surface *GetInput() const;
/** \brief returns the prop assembly */
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
/** \brief set the default properties for this mapper */
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
/** \brief Internal class holding the mapper, actor, etc. for each of the 3 2D render windows */
class LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/**
* @brief m_PropAssembly Contains all vtkProps for the final rendering.
*
* Consists of 3 actors:
* The surface cut (the slice from the 3D surface).
* The normals and the inverse normals.
*/
vtkSmartPointer<vtkAssembly> m_PropAssembly;
/**
* @brief m_Actor actor for the surface cut.
*/
vtkSmartPointer<vtkActor> m_Actor;
/**
* @brief m_NormalActor actor for the normals.
*/
vtkSmartPointer<vtkActor> m_NormalActor;
/**
* @brief m_InverseNormalActor actor for the inverse normals.
*/
vtkSmartPointer<vtkActor> m_InverseNormalActor;
/**
* @brief m_Mapper VTK mapper for all types of 2D polydata e.g. werewolves.
*/
vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
/**
* @brief m_Cutter Filter to cut out the 2D slice.
*/
vtkSmartPointer<vtkCutter> m_Cutter;
/**
* @brief m_CuttingPlane The plane where to cut off the 2D slice.
*/
vtkSmartPointer<vtkPlane> m_CuttingPlane;
/**
* @brief m_NormalMapper Mapper for the normals.
*/
vtkSmartPointer<vtkPolyDataMapper> m_NormalMapper;
/**
* @brief m_InverseNormalMapper Mapper for the inverse normals.
*/
vtkSmartPointer<vtkPolyDataMapper> m_InverseNormalMapper;
/**
* @brief m_NormalGlyph Glyph for creating normals.
*/
vtkSmartPointer<vtkGlyph3D> m_NormalGlyph;
/**
* @brief m_InverseNormalGlyph Glyph for creating inverse normals.
*/
vtkSmartPointer<vtkGlyph3D> m_InverseNormalGlyph;
/**
* @brief m_ArrowSource Arrow representation of the normals.
*/
vtkSmartPointer<vtkArrowSource> m_ArrowSource;
/**
* @brief m_ReverseSense Filter to invert the normals.
*/
vtkSmartPointer<vtkReverseSense> m_ReverseSense;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage() override;
};
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
/**
* @brief UpdateVtkTransform Overwrite the method of the base class.
*
* The base class transforms the actor according to the respective
* geometry which is correct for most cases. This mapper, however,
* uses a vtkCutter to cut out a contour. To cut out the correct
* contour, the data has to be transformed beforehand. Else the
* current plane geometry will point the cutter to en empty location
* (if the surface does have a geometry, which is a rather rare case).
*/
void UpdateVtkTransform(mitk::BaseRenderer * /*renderer*/) override {}
protected:
/**
* @brief SurfaceVtkMapper2D default constructor.
*/
SurfaceVtkMapper2D();
/**
* @brief ~SurfaceVtkMapper2D default destructor.
*/
~SurfaceVtkMapper2D() override;
/**
* @brief GenerateDataForRenderer produces all the data.
* @param renderer The respective renderer of the mitkRenderWindow.
*/
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
/**
* @brief ResetMapper Called in mitk::Mapper::Update to hide objects.
* If TimeSlicedGeometry or time step is not valid, reset the mapper.
* so that nothing is displayed e.g. toggle visiblity of the propassembly.
*
* @param renderer The respective renderer of the mitkRenderWindow.
*/
void ResetMapper(BaseRenderer *renderer) override;
/**
* @brief Updates legacy properties to current behavior/interpretation.
* @param properties The property list which should be adapted to new behaviour.
*
* Whenever a mapper decides to change its property types or its
* interpretation of certain values, it should add something to this
* method and call it before methods like ApplyProperties();
*
* This is particularly helpful when dealing with data from
* archive/scene files that were created before changes.
*/
virtual void FixupLegacyProperties(PropertyList *properties);
/**
* @brief ApplyAllProperties Pass all the properties to VTK.
* @param renderer The respective renderer of the mitkRenderWindow.
*/
void ApplyAllProperties(BaseRenderer *renderer);
/**
* @brief Update Check if data should be generated.
* @param renderer The respective renderer of the mitkRenderWindow.
*/
void Update(BaseRenderer *renderer) override;
};
} // namespace mitk
#endif /* mitkSurfaceVtkMapper2D_h */
diff --git a/Modules/Core/include/mitkSurfaceVtkMapper3D.h b/Modules/Core/include/mitkSurfaceVtkMapper3D.h
index a518386772..7308ac72df 100644
--- a/Modules/Core/include/mitkSurfaceVtkMapper3D.h
+++ b/Modules/Core/include/mitkSurfaceVtkMapper3D.h
@@ -1,143 +1,145 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkSurfaceVtkMapper3D_h
#define mitkSurfaceVtkMapper3D_h
#include "mitkBaseRenderer.h"
#include "mitkLocalStorageHandler.h"
#include "mitkVtkMapper.h"
#include <MitkCoreExports.h>
#include <mitkSurface.h>
#include <vtkActor.h>
#include <vtkDepthSortPolyData.h>
#include <vtkPlaneCollection.h>
#include <vtkPolyDataMapper.h>
#include <vtkPolyDataNormals.h>
#include <vtkSmartPointer.h>
namespace mitk
{
/**
* @brief Vtk-based mapper for Surfaces.
*
* The mapper renders a surface in 3D. The actor is adapted according to the geometry in
* the base class in mitk::VtkMapper::UpdateVtkTransform().
*
* Properties that can be set for surfaces and influence the surfaceVTKMapper3D are:
*
* - \b "Backface Culling": True enables backface culling, which means only front-facing polygons will be visualized.
False/disabled by default.
* - \b "color": (ColorProperty) Diffuse color of the surface object (this property will be read when
material.diffuseColor is not defined)
* - \b "Opacity": (FloatProperty) Opacity of the surface object
* - \b "material.ambientColor": (ColorProperty) Ambient color of the surface object
* - \b "material.ambientCoefficient": ( FloatProperty) Ambient coefficient of the surface object
* - \b "material.diffuseColor": ( ColorProperty) Diffuse color of the surface object
* - \b "material.diffuseCoefficient": (FloatProperty) Diffuse coefficient of the surface object
* - \b "material.specularColor": (ColorProperty) Specular Color of the surface object
* - \b "material.specularCoefficient": (FloatProperty) Specular coefficient of the surface object
* - \b "material.specularPower": (FloatProperty) Specular power of the surface object
* - \b "material.interpolation": (VtkInterpolationProperty) Interpolation
* - \b "material.representation": (VtkRepresentationProperty*) Representation
* - \b "material.wireframeLineWidth": (FloatProperty) Width in pixels of the lines drawn.
* - \b "material.pointSize": (FloatProperty) Size in pixels of the points drawn.
* - \b "scalar visibility": (BoolProperty) If the scarlars of the surface are visible
* - \b "Surface.TransferFunction (TransferFunctionProperty) Set a transferfunction for coloring the surface
* - \b "LookupTable (LookupTableProperty) LookupTable
* Properties to look for are:
*
* - \b "scalar visibility": if set to on, scalars assigned to the data are shown
* Turn this on if using a lookup table.
* - \b "ScalarsRangeMinimum": Optional. Can be used to store the scalar min, e.g.
* for the level window settings.
* - \b "ScalarsRangeMaximum": Optional. See above.
*
* There might be still some other, deprecated properties. These will not be documented anymore.
* Please check the source if you really need them.
*
* @ingroup Mapper
*/
class MITKCORE_EXPORT SurfaceVtkMapper3D : public VtkMapper
{
public:
mitkClassMacro(SurfaceVtkMapper3D, VtkMapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
- itkSetMacro(GenerateNormals, bool);
+ itkCloneMacro(Self);
+
+ itkSetMacro(GenerateNormals, bool);
itkGetMacro(GenerateNormals, bool);
virtual const mitk::Surface *GetInput();
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
virtual void ApplyAllProperties(mitk::BaseRenderer *renderer, vtkActor *actor);
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
protected:
SurfaceVtkMapper3D();
~SurfaceVtkMapper3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
void ResetMapper(mitk::BaseRenderer *renderer) override;
/** Checks whether the specified property is a ClippingProperty and if yes,
* adds it to m_ClippingPlaneCollection (internal method). */
virtual void CheckForClippingProperty(mitk::BaseRenderer *renderer, mitk::BaseProperty *property);
bool m_GenerateNormals;
public:
class LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
vtkSmartPointer<vtkActor> m_Actor;
vtkSmartPointer<vtkPolyDataMapper> m_VtkPolyDataMapper;
vtkSmartPointer<vtkPolyDataNormals> m_VtkPolyDataNormals;
vtkSmartPointer<vtkPlaneCollection> m_ClippingPlaneCollection;
vtkSmartPointer<vtkDepthSortPolyData> m_DepthSort;
itk::TimeStamp m_ShaderTimestampUpdate;
LocalStorage()
{
m_VtkPolyDataMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
m_VtkPolyDataNormals = vtkSmartPointer<vtkPolyDataNormals>::New();
m_Actor = vtkSmartPointer<vtkActor>::New();
m_ClippingPlaneCollection = vtkSmartPointer<vtkPlaneCollection>::New();
m_Actor->SetMapper(m_VtkPolyDataMapper);
m_DepthSort = vtkSmartPointer<vtkDepthSortPolyData>::New();
}
~LocalStorage() override {}
};
mitk::LocalStorageHandler<LocalStorage> m_LSH;
static void ApplyMitkPropertiesToVtkProperty(mitk::DataNode *node,
vtkProperty *property,
mitk::BaseRenderer *renderer);
static void SetDefaultPropertiesForVtkProperty(mitk::DataNode *node, mitk::BaseRenderer *renderer, bool overwrite);
};
} // namespace mitk
#endif /* mitkSurfaceVtkMapper3D_h */
diff --git a/Modules/Core/include/mitkTemporoSpatialStringProperty.h b/Modules/Core/include/mitkTemporoSpatialStringProperty.h
index 933907df7d..a138685bdf 100644
--- a/Modules/Core/include/mitkTemporoSpatialStringProperty.h
+++ b/Modules/Core/include/mitkTemporoSpatialStringProperty.h
@@ -1,122 +1,125 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKTEMPOROSPATIALSTRINGPROPERTY_H_HEADER
#define MITKTEMPOROSPATIALSTRINGPROPERTY_H_HEADER
#include <itkConfigure.h>
#include "mitkBaseProperty.h"
#include <MitkCoreExports.h>
#include "mitkTimeGeometry.h"
#include <string>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* @brief Property for time and space resolved string values
* @ingroup DataManagement
*/
class MITKCORE_EXPORT TemporoSpatialStringProperty : public BaseProperty
{
public:
typedef ::itk::IndexValueType IndexValueType;
typedef std::string ValueType;
mitkClassMacro(TemporoSpatialStringProperty, BaseProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) mitkNewMacro1Param(TemporoSpatialStringProperty, const char *);
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
+ mitkNewMacro1Param(TemporoSpatialStringProperty, const char*);
mitkNewMacro1Param(TemporoSpatialStringProperty, const std::string &);
/**Returns the value of the first time point in the first slice.
* If now value is set it returns an empty string.*/
ValueType GetValue() const;
/**Returns the value of the passed time step and slice. If it does not exist and allowedClosed is true
* it will look for the closest value. If nothing could be found an empty string will be returned.*/
ValueType GetValue(const TimeStepType &timeStep,
const IndexValueType &zSlice,
bool allowCloseTime = false,
bool allowCloseSlice = false) const;
ValueType GetValueBySlice(const IndexValueType &zSlice, bool allowClose = false) const;
ValueType GetValueByTimeStep(const TimeStepType &timeStep, bool allowClose = false) const;
bool HasValue() const;
bool HasValue(const TimeStepType &timeStep,
const IndexValueType &zSlice,
bool allowCloseTime = false,
bool allowCloseSlice = false) const;
bool HasValueBySlice(const IndexValueType &zSlice, bool allowClose = false) const;
bool HasValueByTimeStep(const TimeStepType &timeStep, bool allowClose = false) const;
std::vector<IndexValueType> GetAvailableSlices(const TimeStepType &timeStep) const;
std::vector<TimeStepType> GetAvailableTimeSteps() const;
void SetValue(const TimeStepType &timeStep, const IndexValueType &zSlice, const ValueType &value);
void SetValue(const ValueType &value);
std::string GetValueAsString() const override;
using BaseProperty::operator=;
protected:
typedef std::map<IndexValueType, std::string> SliceMapType;
typedef std::map<TimeStepType, SliceMapType> TimeMapType;
TimeMapType m_Values;
TemporoSpatialStringProperty(const char *string = nullptr);
TemporoSpatialStringProperty(const std::string &s);
TemporoSpatialStringProperty(const TemporoSpatialStringProperty &);
std::pair<bool, ValueType> CheckValue(const TimeStepType &timeStep,
const IndexValueType &zSlice,
bool allowCloseTime = false,
bool allowCloseSlice = false) const;
private:
// purposely not implemented
TemporoSpatialStringProperty &operator=(const TemporoSpatialStringProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
};
namespace PropertyPersistenceSerialization
{
/** Serialization of a TemporoSpatialStringProperty into a JSON string.*/
MITKCORE_EXPORT::std::string serializeTemporoSpatialStringPropertyToJSON(const mitk::BaseProperty *prop);
}
namespace PropertyPersistenceDeserialization
{
/**Deserialize a passed JSON string into a TemporoSpatialStringProperty.*/
MITKCORE_EXPORT mitk::BaseProperty::Pointer deserializeJSONToTemporoSpatialStringProperty(const std::string &value);
}
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
#endif
diff --git a/Modules/Core/include/mitkThinPlateSplineCurvedGeometry.h b/Modules/Core/include/mitkThinPlateSplineCurvedGeometry.h
index 961e39259f..ef84e1f1a1 100644
--- a/Modules/Core/include/mitkThinPlateSplineCurvedGeometry.h
+++ b/Modules/Core/include/mitkThinPlateSplineCurvedGeometry.h
@@ -1,65 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKTHINPLATESPLINECURVEDGEOMETRY_H_HEADER_INCLUDED_C1C68A2C
#define MITKTHINPLATESPLINECURVEDGEOMETRY_H_HEADER_INCLUDED_C1C68A2C
#include "mitkLandmarkProjectorBasedCurvedGeometry.h"
class vtkPoints;
class vtkThinPlateSplineTransform;
namespace mitk
{
//##Documentation
//## @brief Thin-plate-spline-based landmark-based curved geometry
//##
//## @ingroup Geometry
class MITKCORE_EXPORT ThinPlateSplineCurvedGeometry : public LandmarkProjectorBasedCurvedGeometry
{
public:
mitkClassMacro(ThinPlateSplineCurvedGeometry, LandmarkProjectorBasedCurvedGeometry);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
void ComputeGeometry() override;
itk::LightObject::Pointer InternalClone() const override;
vtkThinPlateSplineTransform *GetThinPlateSplineTransform() const { return m_ThinPlateSplineTransform; }
virtual void SetSigma(double sigma);
virtual double GetSigma() const;
bool IsValid() const override;
protected:
ThinPlateSplineCurvedGeometry();
ThinPlateSplineCurvedGeometry(const ThinPlateSplineCurvedGeometry &other);
~ThinPlateSplineCurvedGeometry() override;
vtkThinPlateSplineTransform *m_ThinPlateSplineTransform;
vtkPoints *m_VtkTargetLandmarks;
vtkPoints *m_VtkProjectedLandmarks;
//##Documentation
//## @brief PreSetSpacing
//##
//## These virtual function allows a different beahiour in subclasses.
//## Do implement them in every subclass of BaseGeometry. If not needed, use
//## {Superclass::PreSetSpacing();};
void PreSetSpacing(const mitk::Vector3D &aSpacing) override { Superclass::PreSetSpacing(aSpacing); };
};
} // namespace mitk
#endif /* MITKTHINPLATESPLINECURVEDGEOMETRY_H_HEADER_INCLUDED_C1C68A2C */
diff --git a/Modules/Core/include/mitkTimeGeometry.h b/Modules/Core/include/mitkTimeGeometry.h
index 847fecd294..d844411d3f 100644
--- a/Modules/Core/include/mitkTimeGeometry.h
+++ b/Modules/Core/include/mitkTimeGeometry.h
@@ -1,321 +1,323 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef TimeGeometry_h
#define TimeGeometry_h
// ITK
#include <itkObject.h>
// MITK
#include "mitkOperationActor.h"
#include <MitkCoreExports.h>
#include <mitkBaseGeometry.h>
#include <mitkCommon.h>
namespace mitk
{
typedef mitk::ScalarType TimePointType;
typedef std::size_t TimeStepType;
/**
* \brief Manages the geometries of a data object for each time step
*
* This class is an abstract class. The concrete implementation
* depends on the way the different time steps are managed.
*
* The time is defined either by a time step or a time point. Time steps
* are non-negativ integers starting from 0. A time point is is a ScalarType value
* which gives the passed time since start in ms. Be aware that the starting
* point is not fixed so it is possible that the same time point defines two
* different time depending on the start time of the used time geometry.
*
* \addtogroup geometry
*/
class MITKCORE_EXPORT TimeGeometry : public itk::Object, public OperationActor
{
protected:
TimeGeometry();
~TimeGeometry() override;
/**
* \brief Contains a bounding box which includes all time steps
*/
BoundingBox::Pointer m_BoundingBox;
/**
* \brief Makes a deep copy of the current object
*/
LightObject::Pointer InternalClone() const override;
public:
- mitkClassMacroItkParent(TimeGeometry, itk::Object) itkCloneMacro(Self) itkCreateAnotherMacro(Self)
+ mitkClassMacroItkParent(TimeGeometry, itk::Object);
+ itkCloneMacro(Self);
+ itkCreateAnotherMacro(Self);
/**
* \brief Returns the number of time steps.
*
* Returns the number of time steps for which
* geometries are saved. The number of time steps
* is also the upper bound of the time steps. The
* minimum time steps is always 0.
*/
virtual TimeStepType CountTimeSteps() const = 0;
/**
* \brief Returns the first time point for which the object is valid.
*
* Returns the first valid time point for this geometry. If only one
* time steps available it usually goes from -max to +max. The time point
* is given in ms.
*/
virtual TimePointType GetMinimumTimePoint() const = 0;
/**
* \brief Returns the last time point for which the object is valid
*
* Gives the last time point for which a valid geometrie is saved in
* this time geometry. The time point is given in ms.
*/
virtual TimePointType GetMaximumTimePoint() const = 0;
/**
* \brief Returns the first time point for which the object is valid.
*
* Returns the first valid time point for the given TimeStep. The time point
* is given in ms.
*/
virtual TimePointType GetMinimumTimePoint(TimeStepType step) const = 0;
/**
* \brief Returns the last time point for which the object is valid
*
* Gives the last time point for the Geometry specified by the given TimeStep. The time point is given in ms.
*/
virtual TimePointType GetMaximumTimePoint(TimeStepType step) const = 0;
/**
* \brief Get the time bounds (in ms)
*/
virtual TimeBounds GetTimeBounds() const = 0;
/**
* \brief Get the time bounds for the given TimeStep (in ms)
*/
virtual TimeBounds GetTimeBounds(TimeStepType step) const = 0;
/**
* \brief Tests if a given time point is covered by this object
*
* Returns true if a geometry can be returned for the given time
* point and falls if not. The time point must be given in ms.
*/
virtual bool IsValidTimePoint(TimePointType timePoint) const = 0;
/**
* \brief Test for the given time step if a geometry is availible
*
* Returns true if a geometry is defined for the given time step.
* Otherwise false is returned.
* The time step is defined as positiv number.
*/
virtual bool IsValidTimeStep(TimeStepType timeStep) const = 0;
/**
* \brief Converts a time step to a time point
*
* Converts a time step to a time point in a way that
* the new time point indicates the same geometry as the time step.
* If the original time steps does not point to a valid geometry,
* a time point is calculated that also does not point to a valid
* geometry, but no exception is raised.
*/
virtual TimePointType TimeStepToTimePoint(TimeStepType timeStep) const = 0;
/**
* \brief Converts a time point to the corresponding time step
*
* Converts a time point to a time step in a way that
* the new time step indicates the same geometry as the time point.
* If a negativ invalid time point is given always time step 0 is
* returned. If an positiv invalid time step is given an invalid
* time step will be returned.
*/
virtual TimeStepType TimePointToTimeStep(TimePointType timePoint) const = 0;
/**
* \brief Returns the geometry of a specific time point
*
* Returns the geometry which defines the given time point. If
* the given time point is invalid an null-pointer is returned.
*
* The pointer to the returned geometry may point to the saved
* geometry but this is not necessarily the case. So a change to
* the returned geometry may or may not afflict the geometry for the
* time point or all time points depending on the used implementation
* of TimeGeometry.
*/
virtual BaseGeometry::Pointer GetGeometryForTimePoint(TimePointType timePoint) const = 0;
/**
* \brief Returns the geometry which corresponds to the given time step
*
* Returns the geometry which defines the given time step. If
* the given time step is invalid an null-pointer is returned.
*
* The pointer to the returned geometry may point to the saved
* geometry but this is not necessarily the case. So a change to
* the returned geometry may or may not afflict the geometry for the
* time step or all time steps depending on the used implementation
* of TimeGeometry.
*/
virtual BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const = 0;
/**
* \brief Returns a clone of the geometry of a specific time point
*
* If an invalid time step is given (e.g. no geometry is defined for this time step)
* a null-pointer will be returned.
*/
virtual BaseGeometry::Pointer GetGeometryCloneForTimeStep(TimeStepType timeStep) const = 0;
/**
* \brief Sets the geometry for a given time step
*
* Sets the geometry for the given time steps. This may also afflects other
* time steps, depending on the implementation of TimeGeometry.
*/
virtual void SetTimeStepGeometry(BaseGeometry *geometry, TimeStepType timeStep) = 0;
/**
* \brief Expands to the given number of time steps
*
* Expands to the given number of time steps. Each new created time
* step is filled with an empty geometry.
* Shrinking is not supported!
*/
virtual void Expand(TimeStepType size) = 0;
/**
* \brief Replaces the geometry instances with clones ot the passed geometry.
*
* Replaces the geometries of all time steps with clones of the passed
* geometry. Replacment strategy depends on the implementation of TimeGeometry
* sub class.
* @remark The time points itself stays untouched. Use this method if you want
* to change the spatial properties of a TimeGeometry and preserve the time
* "grid".
*/
virtual void ReplaceTimeStepGeometries(const BaseGeometry *geometry) = 0;
/**
* \brief Tests if all necessary informations are set and the object is valid
*/
virtual bool IsValid() const = 0;
/**
* \brief Get the position of the corner number \a id (in world coordinates)
*
* See SetImageGeometry for how a corner is defined on images.
*/
Point3D GetCornerPointInWorld(int id) const;
/**
* \brief Get the position of a corner (in world coordinates)
*
* See SetImageGeometry for how a corner is defined on images.
*/
Point3D GetCornerPointInWorld(bool xFront = true, bool yFront = true, bool zFront = true) const;
/**
* \brief Get the center of the bounding-box in mm
*/
Point3D GetCenterInWorld() const;
/**
* \brief Get the squared length of the diagonal of the bounding-box in mm
*/
double GetDiagonalLength2InWorld() const;
/**
* \brief Get the length of the diagonal of the bounding-box in mm
*/
double GetDiagonalLengthInWorld() const;
/**
* \brief Test whether the point \a p (world coordinates in mm) is inside the bounding box
*/
bool IsWorldPointInside(const mitk::Point3D &p) const;
/**
* \brief Updates the bounding box to cover the area used in all time steps
*
* The bounding box is updated by this method. The new bounding box
* covers an area which includes all bounding boxes during
* all times steps.
*/
void UpdateBoundingBox();
/**
* \brief Returns a bounding box that covers all time steps
*/
BoundingBox *GetBoundingBoxInWorld() const { return m_BoundingBox; }
/**
* \brief Returns the world bounds of the object that cover all time steps
*/
BoundingBox::BoundsArrayType GetBoundsInWorld() const { return m_BoundingBox->GetBounds(); }
/**
* \brief Returns the Extend of the bounding in the given direction
*/
ScalarType GetExtentInWorld(unsigned int direction) const;
/**
* \brief Initializes the TimeGeometry
*/
virtual void Initialize();
/**
* \brief Updates the geometry
*/
void Update();
/**
* \brief Updates everything except the Bounding box
*
* This class should be overwritten by child classes.
* The method is called when Update() is required.
*/
virtual void UpdateWithoutBoundingBox(){};
/**
* \brief Executes the given operation on all time steps
*/
void ExecuteOperation(Operation *op) override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
}; // end class TimeGeometry
/**
* @brief Equal A function comparing two instances of TimeGeometry for being identical.
*
* @ingroup MITKTestingAPI
*
* The function compares two instances of TimeGeometries in all their aspects.
*
* The parameter eps is a tolerance value for all methods which are internally used for comparison.
* If you want to use different tolerance values for different parts of the geometry, feel free to use
* the other comparison methods and write your own implementation of Equal.
*
* @param rightHandSide Compare this against leftHandSide.
* @param leftHandSide Compare this against rightHandSide.
* @param eps Tolerance for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
*
* @return True, if all comparison are true. False in any other case.
*/
MITKCORE_EXPORT bool Equal(const mitk::TimeGeometry &leftHandSide,
const mitk::TimeGeometry &rightHandSide,
ScalarType eps,
bool verbose);
} // end namespace MITK
#endif // TimeGeometry_h
diff --git a/Modules/Core/include/mitkTransferFunction.h b/Modules/Core/include/mitkTransferFunction.h
index 097582ec79..4416927203 100644
--- a/Modules/Core/include/mitkTransferFunction.h
+++ b/Modules/Core/include/mitkTransferFunction.h
@@ -1,193 +1,195 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_TRANSFER_FUNCTION_H_HEADER_INCLUDED
#define MITK_TRANSFER_FUNCTION_H_HEADER_INCLUDED
#include "mitkHistogramGenerator.h"
#include "mitkImage.h"
#include <MitkCoreExports.h>
#include <itkHistogram.h>
#include <itkObject.h>
#include <itkRGBPixel.h>
#include <vtkColorTransferFunction.h>
#include <vtkPiecewiseFunction.h>
#include <vtkSmartPointer.h>
#include <algorithm>
#include <set>
#include <vector>
namespace mitk
{
/**
* @brief The TransferFunction class A wrapper class for VTK scalar opacity,
* gradient opacity, and color transfer functions.
* @ingroup DataManagement
*
* Holds a copy of each of the three standard VTK transfer functions (scalar
* opacity, gradient opacity, color) and provides an interface for manipulating
* their control points. Each original function can be retrieved by a Get()
* method.
*
* @note Currently, transfer function initialization based on histograms or
* computed-tomography-presets is also provided by this class, but will likely
* be separated into a specific initializer class.
*
* @note If you want to use this as a property for an mitk::Image, make sure
* to use the mitk::TransferFunctionProperty and set the mitk::RenderingModeProperty
* to a mode which supports transfer functions (e.g. COLORTRANSFERFUNCTION_COLOR).
* Make sure to check the documentation of the mitk::RenderingModeProperty. For a
* code example how to use the mitk::TransferFunction check the
* mitkImageVtkMapper2DTransferFunctionTest.cpp in Core\Code\Testing.
*/
class MITKCORE_EXPORT TransferFunction : public itk::Object
{
public:
typedef std::vector<std::pair<double, double>> ControlPoints;
typedef std::vector<std::pair<double, itk::RGBPixel<double>>> RGBControlPoints;
mitkClassMacroItkParent(TransferFunction, itk::DataObject);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/** \brief Get/Set min/max of transfer function range for initialization. */
itkSetMacro(Min, int);
/** \brief Get/Set min/max of transfer function range for initialization. */
itkSetMacro(Max, int);
/** \brief Get/Set min/max of transfer function range for initialization. */
itkGetMacro(Min, int);
/** \brief Get/Set min/max of transfer function range for initialization. */
itkGetMacro(Max, int);
/** \brief Get/Set wrapped vtk transfer function. */
itkGetMacro(ScalarOpacityFunction, vtkPiecewiseFunction *);
/** \brief Get/Set wrapped vtk transfer function. */
itkGetMacro(GradientOpacityFunction, vtkPiecewiseFunction *);
/** \brief Get/Set wrapped vtk transfer function. */
itkGetMacro(ColorTransferFunction, vtkColorTransferFunction *);
itkSetMacro(ColorTransferFunction, vtkSmartPointer<vtkColorTransferFunction>);
/** \brief Get histogram used for transfer function initialization. */
itkGetConstObjectMacro(Histogram, HistogramGenerator::HistogramType);
/** \brief Initialize transfer function based on the histogram of an mitk::Image. */
void InitializeByMitkImage(const mitk::Image *image);
/** \brief Initialize transfer function based on the specified histogram. */
void InitializeByItkHistogram(const itk::Statistics::Histogram<double> *histogram);
/** \brief Initialize the internal histogram and min/max range based on the
* specified mitk::Image. */
void InitializeHistogram(const mitk::Image *image);
/** \brief Insert control points and values into the scalar opacity transfer
* function. */
void SetScalarOpacityPoints(TransferFunction::ControlPoints points);
/** \brief Insert control points and values into the gradient opacity transfer
* function. */
void SetGradientOpacityPoints(TransferFunction::ControlPoints points);
/** \brief Insert control points and RGB values into the color transfer
* function. */
void SetRGBPoints(TransferFunction::RGBControlPoints rgbpoints);
/** \brief Add a single control point to the scalar opacity transfer function. */
void AddScalarOpacityPoint(double x, double value);
/** \brief Add a single control point to the gradient opacity transfer function. */
void AddGradientOpacityPoint(double x, double value);
/** \brief Add a single control point to the color opacity transfer function. */
void AddRGBPoint(double x, double r, double g, double b);
/** \brief Get a copy of the scalar opacity transfer function control-points. */
TransferFunction::ControlPoints &GetScalarOpacityPoints();
/** \brief Get a copy of the gradient opacity transfer function control-points. */
TransferFunction::ControlPoints &GetGradientOpacityPoints();
/** \brief Get a copy of the color transfer function control-points. */
TransferFunction::RGBControlPoints &GetRGBPoints();
/** \brief Remove the specified control point from the scalar opacity transfer
* function. */
int RemoveScalarOpacityPoint(double x);
/** \brief Remove the specified control point from the gradient opacity transfer
* function. */
int RemoveGradientOpacityPoint(double x);
/** \brief Remove the specified control point from the color transfer function. */
int RemoveRGBPoint(double x);
/** \brief Removes all control points from the scalar opacity transfer function. */
void ClearScalarOpacityPoints();
/** \brief Removes all control points from the gradient opacity transfer
* function. */
void ClearGradientOpacityPoints();
/** \brief Removes all control points from the color transfer function. */
void ClearRGBPoints();
bool operator==(Self &other);
protected:
TransferFunction();
~TransferFunction() override;
TransferFunction(const TransferFunction &other);
itk::LightObject::Pointer InternalClone() const override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
/** Wrapped VTK scalar opacity transfer function */
vtkSmartPointer<vtkPiecewiseFunction> m_ScalarOpacityFunction;
/** Wrapped VTK gradient opacity transfer function */
vtkSmartPointer<vtkPiecewiseFunction> m_GradientOpacityFunction;
/** Wrapped VTK color transfer function */
vtkSmartPointer<vtkColorTransferFunction> m_ColorTransferFunction;
/** Current range of transfer function (used for initialization) */
int m_Min;
/** Current range of transfer function (used for initialization) */
int m_Max;
/** Specified or calculated histogram (used for initialization) */
mitk::HistogramGenerator::HistogramType::ConstPointer m_Histogram;
private:
/** Temporary STL style copy of VTK internal control points */
TransferFunction::ControlPoints m_ScalarOpacityPoints;
/** Temporary STL style copy of VTK internal control points */
TransferFunction::ControlPoints m_GradientOpacityPoints;
/** Temporary STL style copy of VTK internal control points */
TransferFunction::RGBControlPoints m_RGBPoints;
};
}
#endif /* MITK_TRANSFER_FUNCTION_H_HEADER_INCLUDED */
diff --git a/Modules/Core/include/mitkTransferFunctionInitializer.h b/Modules/Core/include/mitkTransferFunctionInitializer.h
index fa49f73e7b..609f33760f 100644
--- a/Modules/Core/include/mitkTransferFunctionInitializer.h
+++ b/Modules/Core/include/mitkTransferFunctionInitializer.h
@@ -1,93 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_TRANSFER_FUNCTION_MODE_CREATOR_H_HEADER_INCLUDED
#define MITK_TRANSFER_FUNCTION_MODE_CREATOR_H_HEADER_INCLUDED
#include <vtkColorTransferFunction.h>
#include <vtkPiecewiseFunction.h>
#include <vtkSmartPointer.h>
#include "mitkTransferFunction.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <MitkCoreExports.h>
namespace mitk
{
/**
* \brief Wrapper class for VTK scalar opacity, gradient opacity, and color
* transfer functions.
*
* Holds a copy of each of the three standard VTK transfer functions (scalar
* opacity, gradient opacity, color) and provides an interface for manipulating
* their control points. Each original function can be retrieved by a Get()
* method.
*
* NOTE: Currently, transfer function initialization based on histograms or
* computed-tomography-presets is also provided by this class, but will likely
* be separated into a specific initializer class.
*/
class MITKCORE_EXPORT TransferFunctionInitializer : public itk::Object
{
public:
mitkClassMacroItkParent(TransferFunctionInitializer, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self)
mitkNewMacro1Param(TransferFunctionInitializer, TransferFunction::Pointer);
static void GetPresetNames(std::vector<std::string> &presetNames);
void SetTransferFunction(TransferFunction::Pointer transferFunction);
mitk::TransferFunction::Pointer GetTransferFunction();
void SetTransferFunctionMode(int mode);
void InitTransferFunctionMode();
protected:
TransferFunctionInitializer(TransferFunction::Pointer transferFunction = nullptr);
~TransferFunctionInitializer() override;
private:
int m_Mode;
mitk::TransferFunction::Pointer m_transferFunction;
// Define Transfer Function
enum TransferFunctionMode
{
TF_CT_DEFAULT,
TF_CT_BLACK_WHITE,
TF_CT_THORAX_LARGE,
TF_CT_THORAX_SMALL,
TF_CT_BONE,
TF_CT_BONE_GRADIENT,
TF_CT_CARDIAC,
TF_MR_GENERIC
};
// remove all old points
void RemoveAllPoints();
void SetModified();
void SetCtDefaultMode();
void SetCtBlackWhiteMode();
void SetCtThoraxLargeMode();
void SetCtThoraxSmallMode();
void SetCtBoneMode();
void SetCtBoneGradientMode();
void SetCtCardiacMode();
void SetMrGenericMode();
};
}
#endif /* MITK_TRANSFER_FUNCTION_MODE_CREATOR_H_HEADER_INCLUDED */
diff --git a/Modules/Core/include/mitkTransferFunctionProperty.h b/Modules/Core/include/mitkTransferFunctionProperty.h
index dc7a2d7820..2cb10185eb 100644
--- a/Modules/Core/include/mitkTransferFunctionProperty.h
+++ b/Modules/Core/include/mitkTransferFunctionProperty.h
@@ -1,77 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKTRANFERFUNCTIONPROPERTY_H_HEADER_INCLUDED
#define MITKTRANFERFUNCTIONPROPERTY_H_HEADER_INCLUDED
#include "mitkBaseProperty.h"
#include "mitkTransferFunction.h"
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* @brief The TransferFunctionProperty class Property class for the mitk::TransferFunction.
* @ingroup DataManagement
*
* @note If you want to use this property for an mitk::Image, make sure
* to set the mitk::RenderingModeProperty to a mode which supports transfer
* functions (e.g. COLORTRANSFERFUNCTION_COLOR). Make sure to check the
* documentation of the mitk::RenderingModeProperty. For a code example how
* to use the mitk::TransferFunction check the
* mitkImageVtkMapper2DTransferFunctionTest.cpp in Core\Code\Testing.
*/
class MITKCORE_EXPORT TransferFunctionProperty : public BaseProperty
{
public:
typedef mitk::TransferFunction::Pointer ValueType;
mitkClassMacro(TransferFunctionProperty, BaseProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self)
mitkNewMacro1Param(TransferFunctionProperty, mitk::TransferFunction::Pointer);
itkSetMacro(Value, mitk::TransferFunction::Pointer);
itkGetConstMacro(Value, mitk::TransferFunction::Pointer);
std::string GetValueAsString() const override;
using BaseProperty::operator=;
protected:
mitk::TransferFunction::Pointer m_Value;
TransferFunctionProperty();
TransferFunctionProperty(const TransferFunctionProperty &other);
TransferFunctionProperty(mitk::TransferFunction::Pointer value);
private:
// purposely not implemented
TransferFunctionProperty &operator=(const TransferFunctionProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
#endif /* MITKTRANFERFUNCTIONPROPERTY_H_HEADER_INCLUDED */
diff --git a/Modules/Core/include/mitkVectorProperty.h b/Modules/Core/include/mitkVectorProperty.h
index fc00b80c78..be0b00f767 100644
--- a/Modules/Core/include/mitkVectorProperty.h
+++ b/Modules/Core/include/mitkVectorProperty.h
@@ -1,133 +1,133 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkVectorProperty_h
#define mitkVectorProperty_h
// MITK
#include <MitkCoreExports.h>
#include <mitkBaseProperty.h>
// STL
#include <vector>
namespace mitk
{
/**
\brief Helper for VectorProperty to determine a good ITK ClassName.
This template is specialized for special instantiations that need
a serializer of this VectorProperty.
*/
template <typename D>
struct VectorPropertyDataType
{
static const char *prefix() { return "Invalid"; }
};
/**
\brief Providing a std::vector as property.
Templated over the data type of the std::vector that is held
by this class. Nothing special about data handling, setting and
getting of std::vectors is implemented by-value.
When checking the declaration of this class, you'll notice
that it does not use the mitkClassMacro but instead writes all
of its definition manually.
This is in order to specifically override the GetNameOfClass()
method without having to inherit again from the template (see
comments in code).
*/
template <typename DATATYPE>
class MITKCORE_EXPORT VectorProperty : public BaseProperty
{
public:
typedef std::vector<DATATYPE> VectorType;
// Manually expand most of mitkClassMacro:
// mitkClassMacro(VectorProperty<DATATYPE>, mitk::BaseProperty);
// This manual expansion is done to override explicitly
// the GetNameOfClass() and GetStaticNameOfClass() methods
typedef VectorProperty<DATATYPE> Self;
typedef BaseProperty SuperClass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
std::vector<std::string> GetClassHierarchy() const override { return mitk::GetClassHierarchy<Self>(); }
/// This function must return different
/// strings in function of the template parameter!
/// Serialization depends on this feature.
static const char *GetStaticNameOfClass()
{
// concatenate a prefix dependent on the template type and our own classname
static std::string nameOfClass = std::string(VectorPropertyDataType<DATATYPE>::prefix()) + "VectorProperty";
return nameOfClass.c_str();
}
const char *GetNameOfClass() const override { return this->GetStaticNameOfClass(); }
itkFactorylessNewMacro(Self);
- itkCloneMacro(Self)
+ itkCloneMacro(Self);
/// Returns the property value as a std::string.
///
/// Since VectorProperty potentially holds many
/// elements, it implements this function in a way
/// that only the first and the last couple of
/// elements really appear in the string.
/// Missing central elements are indicated by
/// an ellipsis ("...")
std::string GetValueAsString() const override;
/// returns a const reference to the contained vector
virtual const VectorType &GetValue() const;
/// sets the content vector
virtual void SetValue(const VectorType &parameter_vector);
private:
/// purposely not implemented
VectorProperty &operator=(const Self &);
/// creates a copy of it self
itk::LightObject::Pointer InternalClone() const override;
/// compares two properties.
bool IsEqual(const BaseProperty &an_other_property) const override;
/// assigns the content of an_other_property to this
bool Assign(const BaseProperty &an_other_property) override;
/// property content
VectorType m_PropertyContent;
};
/// This should be used in .h files.
#define MITK_DECLARE_VECTOR_PROPERTY(TYPE, PREFIX) \
\
typedef VectorProperty<TYPE> PREFIX##VectorProperty; \
\
template <> \
\
struct VectorPropertyDataType<TYPE> \
{ \
static const char *prefix() { return #PREFIX; } \
};
/// This should be used in a .cpp file
#define MITK_DEFINE_VECTOR_PROPERTY(TYPE) template class VectorProperty<TYPE>;
MITK_DECLARE_VECTOR_PROPERTY(double, Double)
MITK_DECLARE_VECTOR_PROPERTY(int, Int)
} // namespace
#endif
diff --git a/Modules/Core/include/mitkVerboseLimitedLinearUndo.h b/Modules/Core/include/mitkVerboseLimitedLinearUndo.h
index f1c91fcfb5..ce4366e5b9 100644
--- a/Modules/Core/include/mitkVerboseLimitedLinearUndo.h
+++ b/Modules/Core/include/mitkVerboseLimitedLinearUndo.h
@@ -1,57 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef VERBOSELIMITEDLINEARUNDO_H_HEADER_INCLUDED_C16E96
#define VERBOSELIMITEDLINEARUNDO_H_HEADER_INCLUDED_C16E96
// MITK header
#include "mitkLimitedLinearUndo.h"
#include <MitkCoreExports.h>
// STL header
#include <list>
#include <string>
#include <utility>
#include <vector>
namespace mitk
{
class UndoStackItem;
/**
* @brief A limited linear undo model providing GUI elements with stack status information.
*
* Basically does the same, as LimitedLinearUndo class, but it allows you to retrieve a string list, which describes
* the undo stack or the redo stack. This can be used for display by GUI elements.
*/
class MITKCORE_EXPORT VerboseLimitedLinearUndo : public LimitedLinearUndo
{
public:
mitkClassMacro(VerboseLimitedLinearUndo, LimitedLinearUndo);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef std::pair<int, std::string> StackDescriptionItem;
typedef std::vector<StackDescriptionItem>
StackDescription; /// a list of pairs (int,string), representing a stack with ObjectEventIDs and descriptions
bool SetOperationEvent(UndoStackItem *undoStackItem) override;
virtual StackDescription GetUndoDescriptions();
virtual StackDescription GetRedoDescriptions();
protected:
VerboseLimitedLinearUndo();
~VerboseLimitedLinearUndo() override;
};
} // namespace mitk
#endif /* VERBOSELIMITEDLINEARUNDO_H_HEADER_INCLUDED_C16E96 */
diff --git a/Modules/Core/include/mitkVolumeCalculator.h b/Modules/Core/include/mitkVolumeCalculator.h
index 262236f7e3..53e4f85b8d 100644
--- a/Modules/Core/include/mitkVolumeCalculator.h
+++ b/Modules/Core/include/mitkVolumeCalculator.h
@@ -1,81 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef VOLUME_CALCULATOR_H_HEADER_INCLUDED
#define VOLUME_CALCULATOR_H_HEADER_INCLUDED
#include "itkImage.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "mitkImage.h"
#include "mitkImageTimeSelector.h"
#include <MitkCoreExports.h>
namespace mitk
{
/**
* @brief Calculates the volume of a mitk::Image.
* The given volume is in milliliters or as a voxel count.
* Voxels are counted if their gray value is above a threshold (see SetThreshold), the default threshold is 0.
*
* The filter works for 2D, 3D and 3D+t. In the 3D+t case a vector of volumes is provided (see GetVolumes()).
*/
class MITKCORE_EXPORT VolumeCalculator : public itk::Object
{
public:
mitkClassMacroItkParent(VolumeCalculator, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) itkSetObjectMacro(Image, Image);
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
+
+ itkSetObjectMacro(Image, Image);
/**
* Sets threshold, all voxels that are equal or greater are accepted.
*/
itkSetMacro(Threshold, int);
/**
* In case of a 2D image this returns the calculated volume in square cm, in case of 3D images the result is given
* in cubic cm. For 4D data refer to the GetVolumes() function.
* @see GetVolumes()
*/
itkGetMacro(Volume, float);
/**
* Returns the number of accepted voxels.
*/
itkGetMacro(VoxelCount, unsigned long int);
/**
* Returns the volume for 4D images, as a vector where each volume is represented by an item in the vector (in cubic
cm).
\note Also for 2D+t images the result will be returned in cubic cm.
*/
std::vector<float> GetVolumes();
void ComputeVolume();
void ComputeVolumeFromImageStatistics();
static float ComputeVolume(Vector3D spacing, unsigned int voxelCount);
protected:
VolumeCalculator();
~VolumeCalculator() override;
template <typename TPixel, unsigned int VImageDimension>
void InternalCompute(const itk::Image<TPixel, VImageDimension> *itkImage);
Image::ConstPointer m_Image;
int m_Threshold;
float m_Volume;
unsigned long int m_VoxelCount;
std::vector<float> m_Volumes;
ImageTimeSelector::Pointer m_TimeSelector;
};
} // namespace mitk
#endif /* VOLUME_CALCULATOR_H_HEADER_INCLUDED */
diff --git a/Modules/Core/include/mitkVtkInterpolationProperty.h b/Modules/Core/include/mitkVtkInterpolationProperty.h
index 0af3b292f7..476f49f0a5 100644
--- a/Modules/Core/include/mitkVtkInterpolationProperty.h
+++ b/Modules/Core/include/mitkVtkInterpolationProperty.h
@@ -1,110 +1,112 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_VTK_INTERPOLATION_PROPERTY__H_
#define _MITK_VTK_INTERPOLATION_PROPERTY__H_
#include "mitkEnumerationProperty.h"
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* Encapsulates the enumeration vtkInterpolation. Valid values are
* (VTK constant/Id/string representation):
* VTK_FLAT/0/Flat, VTK_GOURAUD/1/Gouraud, VTK_PHONG/2/Phong
* Default is the Gouraud interpolation
*/
class MITKCORE_EXPORT VtkInterpolationProperty : public EnumerationProperty
{
public:
mitkClassMacro(VtkInterpolationProperty, EnumerationProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
- mitkNewMacro1Param(VtkInterpolationProperty, const IdType &);
+ itkCloneMacro(Self);
+
+ mitkNewMacro1Param(VtkInterpolationProperty, const IdType &);
mitkNewMacro1Param(VtkInterpolationProperty, const std::string &);
/**
* Returns the current interpolation value as defined by VTK constants.
* @returns the current interpolation as VTK constant.
*/
virtual int GetVtkInterpolation();
/**
* Sets the interpolation type to VTK_FLAT.
*/
virtual void SetInterpolationToFlat();
/**
* Sets the interpolation type to VTK_WIREFRAME.
*/
virtual void SetInterpolationToGouraud();
/**
* Sets the interpolation type to VTK_SURFACE.
*/
virtual void SetInterpolationToPhong();
using BaseProperty::operator=;
protected:
/**
* Constructor. Sets the representation to a default value of surface(2)
*/
VtkInterpolationProperty();
/**
* Constructor. Sets the interpolation to the given value. If it is not
* valid, the interpolation is set to gouraud(1)
* @param value the integer representation of the interpolation
*/
VtkInterpolationProperty(const IdType &value);
/**
* Constructor. Sets the interpolation to the given value. If it is not
* valid, the representation is set to gouraud(1)
* @param value the string representation of the interpolation
*/
VtkInterpolationProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid interpolation types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the enumeration types as defined by vtk to the list of known
* enumeration values.
*/
virtual void AddInterpolationTypes();
private:
// purposely not implemented
VtkInterpolationProperty &operator=(const VtkInterpolationProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // end of namespace mitk
#endif
diff --git a/Modules/Core/include/mitkVtkRepresentationProperty.h b/Modules/Core/include/mitkVtkRepresentationProperty.h
index db18f76b29..f954a3bd77 100644
--- a/Modules/Core/include/mitkVtkRepresentationProperty.h
+++ b/Modules/Core/include/mitkVtkRepresentationProperty.h
@@ -1,109 +1,111 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_VTK_REPRESENTATION_PROPERTY__H_
#define _MITK_VTK_REPRESENTATION_PROPERTY__H_
#include "mitkEnumerationProperty.h"
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* Encapsulates the enumeration vtkRepresentation. Valid values are
* (VTK constant/Id/string representation):
* VTK_POINTS/0/Points, VTK_WIREFRAME/1/Wireframe, VTK_SURFACE/2/Surface
* Default is the Surface representation
*/
class MITKCORE_EXPORT VtkRepresentationProperty : public EnumerationProperty
{
public:
mitkClassMacro(VtkRepresentationProperty, EnumerationProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
mitkNewMacro1Param(VtkRepresentationProperty, const IdType &);
mitkNewMacro1Param(VtkRepresentationProperty, const std::string &);
/**
* Returns the current representation value as defined by VTK constants.
* @returns the current representation as VTK constant.
*/
virtual int GetVtkRepresentation();
/**
* Sets the representation type to VTK_POINTS.
*/
virtual void SetRepresentationToPoints();
/**
* Sets the representation type to VTK_WIREFRAME.
*/
virtual void SetRepresentationToWireframe();
/**
* Sets the representation type to VTK_SURFACE.
*/
virtual void SetRepresentationToSurface();
using BaseProperty::operator=;
protected:
/**
* Constructor. Sets the representation to a default value of Surface(2)
*/
VtkRepresentationProperty();
/**
* Constructor. Sets the representation to the given value. If it is not
* valid, the representation is set to Surface(2)
* @param value the integer representation of the representation
*/
VtkRepresentationProperty(const IdType &value);
/**
* Constructor. Sets the representation to the given value. If it is not
* valid, the representation is set to Surface(2)
* @param value the string representation of the representation
*/
VtkRepresentationProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid representation types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the enumeration types as defined by vtk to the list of known
* enumeration values.
*/
virtual void AddRepresentationTypes();
private:
// purposely not implemented
VtkRepresentationProperty &operator=(const VtkRepresentationProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // end of namespace mitk
#endif
diff --git a/Modules/Core/include/mitkVtkResliceInterpolationProperty.h b/Modules/Core/include/mitkVtkResliceInterpolationProperty.h
index fac8392604..b7044f2bed 100644
--- a/Modules/Core/include/mitkVtkResliceInterpolationProperty.h
+++ b/Modules/Core/include/mitkVtkResliceInterpolationProperty.h
@@ -1,106 +1,108 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_VTK_RESLICE_INTERPOLATION_PROPERTY__H_
#define _MITK_VTK_RESLICE_INTERPOLATION_PROPERTY__H_
#include "mitkEnumerationProperty.h"
#include <vtkImageReslice.h>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* Encapsulates the enumeration for reslice interpolation. Valid values are
* (VTK constant/Id/string representation):
* VTK_RESLICE_NEAREST, VTK_RESLICE_LINEAR, VTK_RESLICE_CUBIC
* Default is VTK_RESLICE_NEAREST
*/
class MITKCORE_EXPORT VtkResliceInterpolationProperty : public EnumerationProperty
{
public:
mitkClassMacro(VtkResliceInterpolationProperty, EnumerationProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
mitkNewMacro1Param(VtkResliceInterpolationProperty, const IdType &);
mitkNewMacro1Param(VtkResliceInterpolationProperty, const std::string &);
/**
* Returns the current interpolation value as defined by VTK constants.
*/
virtual int GetInterpolation();
/**
* Sets the interpolation type to VTK_RESLICE_NEAREST.
*/
virtual void SetInterpolationToNearest();
/**
* Sets the interpolation type to VTK_RESLICE_LINEAR.
*/
virtual void SetInterpolationToLinear();
/**
* Sets the interpolation type to VTK_RESLICE_CUBIC.
*/
virtual void SetInterpolationToCubic();
using BaseProperty::operator=;
protected:
/** Sets reslice interpolation mode to default (VTK_RESLICE_NEAREST).
*/
VtkResliceInterpolationProperty();
/**
* Constructor. Sets reslice interpolation to the given value.
*/
VtkResliceInterpolationProperty(const IdType &value);
/**
* Constructor. Sets reslice interpolation to the given value.
*/
VtkResliceInterpolationProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid interpolation types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the enumeration types as defined by vtk to the list of known
* enumeration values.
*/
virtual void AddInterpolationTypes();
private:
// purposely not implemented
VtkResliceInterpolationProperty &operator=(const VtkResliceInterpolationProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // end of namespace mitk
#endif
diff --git a/Modules/Core/include/mitkVtkScalarModeProperty.h b/Modules/Core/include/mitkVtkScalarModeProperty.h
index d096ec50a0..c315d9c99b 100644
--- a/Modules/Core/include/mitkVtkScalarModeProperty.h
+++ b/Modules/Core/include/mitkVtkScalarModeProperty.h
@@ -1,108 +1,110 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_VTK_SCALARMODE_PROPERTY__H_
#define _MITK_VTK_SCALARMODE_PROPERTY__H_
#include "mitkEnumerationProperty.h"
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* Encapsulates the enumeration vtkInterpolation. Valid values are
* (VTK constant/Id/string representation):
* \li VTK_SCALAR_MODE_DEFAULT/0/Default,
* \li VTK_SCALAR_MODE_USE_POINT_DATA/1/PointData,
* \li VTK_SCALAR_MODE_USE_CELL_DATA/2/CellData
* \li VTK_SCALAR_MODE_USE_POINT_FIELD_DATA/3/PointFieldData
* \li VTK_SCALAR_MODE_USE_CELL_FIELD_DATA/4/CellFieldData
*/
class MITKCORE_EXPORT VtkScalarModeProperty : public EnumerationProperty
{
public:
mitkClassMacro(VtkScalarModeProperty, EnumerationProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
mitkNewMacro1Param(VtkScalarModeProperty, const IdType &);
mitkNewMacro1Param(VtkScalarModeProperty, const std::string &);
/**
* Returns the current scalar mode value as defined by VTK constants.
* @returns the current scalar mode as VTK constant.
*/
virtual int GetVtkScalarMode();
virtual void SetScalarModeToDefault();
virtual void SetScalarModeToPointData();
virtual void SetScalarModeToCellData();
virtual void SetScalarModeToPointFieldData();
virtual void SetScalarModeToCellFieldData();
using BaseProperty::operator=;
protected:
/**
* Constructor. Sets the representation to a default value of surface(2)
*/
VtkScalarModeProperty();
/**
* \brief Sets the scalar mode to the given value. If it is not
* valid, the scalar mode is set to default (0).
* @param value the integer representation of the scalar mode
*/
VtkScalarModeProperty(const IdType &value);
/**
* \brief Sets the scalar mode to the given value. If it is not
* valid, the representation is set to default (0).
* @param value the string representation of the scalar mode
*/
VtkScalarModeProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid scalar mode types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the enumeration types as defined by vtk to the list of known
* enumeration values.
*/
virtual void AddInterpolationTypes();
private:
// purposely not implemented
VtkScalarModeProperty &operator=(const VtkScalarModeProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // end of namespace mitk
#endif //_MITK_VTK_SCALARMODE_PROPERTY__H_
diff --git a/Modules/Core/include/mitkVtkVolumeRenderingProperty.h b/Modules/Core/include/mitkVtkVolumeRenderingProperty.h
index 568f5a57e1..7d9c8df434 100644
--- a/Modules/Core/include/mitkVtkVolumeRenderingProperty.h
+++ b/Modules/Core/include/mitkVtkVolumeRenderingProperty.h
@@ -1,102 +1,104 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_VTK_VOLUME_RENDERING_PROPERTY__H_
#define _MITK_VTK_VOLUME_RENDERING_PROPERTY__H_
#include "mitkEnumerationProperty.h"
#define VTK_RAY_CAST_COMPOSITE_FUNCTION 1
#define VTK_VOLUME_RAY_CAST_MIP_FUNCTION 2
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* Encapsulates the enumeration for volume rendering. Valid values are
* (VTK constant/Id/string representation):
* VTK_VOLUME_RAY_CAST_MIP_FUNCTION
* VTK_RAY_CAST_COMPOSITE_FUNCTION
* Default is nullptr
*/
class MITKCORE_EXPORT VtkVolumeRenderingProperty : public EnumerationProperty
{
public:
mitkClassMacro(VtkVolumeRenderingProperty, EnumerationProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
mitkNewMacro1Param(VtkVolumeRenderingProperty, const IdType &);
mitkNewMacro1Param(VtkVolumeRenderingProperty, const std::string &);
/**
* Returns the current volume rendering type
*/
virtual int GetRenderingType();
/**
* Sets the rendering type to VTK_VOLUME_RAY_CAST_MIP_FUNCTION
*/
virtual void SetRenderingTypeToMIP();
/**
* Sets the rendering type to VTK_RAY_CAST_COMPOSITE_FUNCTION
*/
virtual void SetRenderingTypeToComposite();
using BaseProperty::operator=;
protected:
/** Sets rendering type to default (VTK_RAY_CAST_COMPOSITE_FUNCTION).
*/
VtkVolumeRenderingProperty();
/**
* Constructor. Sets rendering type to the given value.
*/
VtkVolumeRenderingProperty(const IdType &value);
/**
* Constructor. Sets rendering type to the given value.
*/
VtkVolumeRenderingProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid rendering types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the enumeration types as defined by vtk to the list of known
* enumeration values.
*/
virtual void AddRenderingTypes();
private:
// purposely not implemented
VtkVolumeRenderingProperty &operator=(const VtkVolumeRenderingProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // end of namespace mitk
#endif
diff --git a/Modules/Core/include/mitkVtkWidgetRendering.h b/Modules/Core/include/mitkVtkWidgetRendering.h
index 91f5ef1cdf..a22abc9848 100644
--- a/Modules/Core/include/mitkVtkWidgetRendering.h
+++ b/Modules/Core/include/mitkVtkWidgetRendering.h
@@ -1,133 +1,135 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _vtk_Widget_Rendering_h_
#define _vtk_Widget_Rendering_h_
#include <mitkBaseData.h>
class vtkRenderer;
class vtkRenderWindow;
class vtkInteractorObserver;
namespace mitk
{
class RenderWindow;
/**
* \brief Mechanism for rendering a vtkWidget in the foreground of a RenderWindow.
*
* To use this class, specify the vtkRenderWindow of the window into which the
* vtkWidget shall be placed, and set the vtkWidget using SetVtkWidget().
* After enabling the vtkWidget and calling Enable() of this class, the widget
* should be rendered.
*
* Note: this class only provides a basic mechanism for adding widget; all widget
* configuration such as placement, size, and en-/disabling of interaction
* mechanisms need to be done in the vtkWidget object.
*/
class MITKCORE_EXPORT VtkWidgetRendering : public BaseData
{
public:
mitkClassMacro(VtkWidgetRendering, BaseData);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/**
* Sets the renderwindow, in which the widget
* will be shown. Make sure, you have called this function
* before calling Enable()
*/
virtual void SetRenderWindow(vtkRenderWindow *renderWindow);
/**
* Enables drawing of the widget.
* If you want to disable it, call the Disable() function.
*/
virtual void Enable();
/**
* Disables drawing of the widget.
* If you want to enable it, call the Enable() function.
*/
virtual void Disable();
/**
* Checks, if the widget is currently
* enabled (visible)
*/
virtual bool IsEnabled();
/**
* Empty implementation, since the VtkWidgetRendering doesn't
* support the requested region concept
*/
void SetRequestedRegionToLargestPossibleRegion() override;
/**
* Empty implementation, since the VtkWidgetRendering doesn't
* support the requested region concept
*/
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
/**
* Empty implementation, since the VtkWidgetRendering doesn't
* support the requested region concept
*/
bool VerifyRequestedRegion() override;
/**
* Empty implementation, since the VtkWidgetRendering doesn't
* support the requested region concept
*/
void SetRequestedRegion(const itk::DataObject *) override;
/**
* Returns the vtkRenderWindow, which is used
* for displaying the widget
*/
virtual vtkRenderWindow *GetRenderWindow();
/**
* Returns the renderer responsible for
* rendering the widget into the
* vtkRenderWindow
*/
virtual vtkRenderer *GetVtkRenderer();
/** Set the vtkWidget to be rendered */
void SetVtkWidget(vtkInteractorObserver *widget);
/** Get the vtkWidget to be rendered */
vtkInteractorObserver *GetVtkWidget() const;
protected:
/**
* Constructor
*/
VtkWidgetRendering();
/**
* Destructor
*/
~VtkWidgetRendering() override;
vtkRenderWindow *m_RenderWindow;
vtkRenderer *m_Renderer;
vtkInteractorObserver *m_VtkWidget;
bool m_IsEnabled;
};
} // end of namespace mitk
#endif
diff --git a/Modules/Core/include/mitkWeakPointerProperty.h b/Modules/Core/include/mitkWeakPointerProperty.h
index 377bfe22fa..122d61ea56 100644
--- a/Modules/Core/include/mitkWeakPointerProperty.h
+++ b/Modules/Core/include/mitkWeakPointerProperty.h
@@ -1,75 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKWEAKPOINTERPROPERTY_H_HEADER_INCLUDED_C126B791
#define MITKWEAKPOINTERPROPERTY_H_HEADER_INCLUDED_C126B791
#include "itkWeakPointer.h"
#include "mitkBaseProperty.h"
#include <MitkCoreExports.h>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
//##Documentation
//## @brief Property containing a smart-pointer
//##
//## @ingroup DataManagement
class MITKCORE_EXPORT WeakPointerProperty : public BaseProperty
{
public:
mitkClassMacro(WeakPointerProperty, BaseProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) mitkNewMacro1Param(WeakPointerProperty, itk::Object *);
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
+ mitkNewMacro1Param(WeakPointerProperty, itk::Object*);
~WeakPointerProperty() override;
typedef itk::WeakPointer<itk::Object> ValueType;
ValueType GetWeakPointer() const;
ValueType GetValue() const;
void SetWeakPointer(itk::Object *pointer);
void SetValue(const ValueType &value);
std::string GetValueAsString() const override;
using BaseProperty::operator=;
protected:
itk::WeakPointer<itk::Object> m_WeakPointer;
WeakPointerProperty(const WeakPointerProperty &);
WeakPointerProperty(itk::Object *pointer = nullptr);
private:
// purposely not implemented
WeakPointerProperty &operator=(const WeakPointerProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
#endif /* MITKWEAKPOINTERPROPERTY_H_HEADER_INCLUDED_C126B791 */
diff --git a/Modules/Core/src/Controllers/mitkRenderingManager.cpp b/Modules/Core/src/Controllers/mitkRenderingManager.cpp
index 200e842496..cc36bc0e19 100644
--- a/Modules/Core/src/Controllers/mitkRenderingManager.cpp
+++ b/Modules/Core/src/Controllers/mitkRenderingManager.cpp
@@ -1,767 +1,767 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "mitkRenderingManager.h"
#include "mitkBaseRenderer.h"
#include "mitkCameraController.h"
#include "mitkNodePredicateNot.h"
#include "mitkNodePredicateProperty.h"
#include "mitkProportionalTimeGeometry.h"
#include "mitkRenderingManagerFactory.h"
#include <vtkRenderWindow.h>
#include <vtkRendererCollection.h>
#include "mitkNumericTypes.h"
#include <itkAffineGeometryFrame.h>
#include <itkCommand.h>
#include <itkScalableAffineTransform.h>
#include <mitkVtkPropRenderer.h>
#include <algorithm>
namespace mitk
{
- itkEventMacroDefinition(FocusChangedEvent, itk::AnyEvent)
+ itkEventMacroDefinition(FocusChangedEvent, itk::AnyEvent);
- RenderingManager::Pointer RenderingManager::s_Instance = nullptr;
+ RenderingManager::Pointer RenderingManager::s_Instance = nullptr;
RenderingManagerFactory *RenderingManager::s_RenderingManagerFactory = nullptr;
RenderingManager::RenderingManager()
: m_UpdatePending(false),
m_MaxLOD(1),
m_LODIncreaseBlocked(false),
m_LODAbortMechanismEnabled(false),
m_ClippingPlaneEnabled(false),
m_TimeNavigationController(SliceNavigationController::New()),
m_DataStorage(nullptr),
m_ConstrainedPanningZooming(true),
m_FocusedRenderWindow(nullptr),
m_AntiAliasing(AntiAliasing::FastApproximate)
{
m_ShadingEnabled.assign(3, false);
m_ShadingValues.assign(4, 0.0);
InitializePropertyList();
}
RenderingManager::~RenderingManager()
{
// Decrease reference counts of all registered vtkRenderWindows for
// proper destruction
RenderWindowVector::iterator it;
for (it = m_AllRenderWindows.begin(); it != m_AllRenderWindows.end(); ++it)
{
(*it)->UnRegister(nullptr);
auto callbacks_it = this->m_RenderWindowCallbacksList.find(*it);
if (callbacks_it != this->m_RenderWindowCallbacksList.end())
{
(*it)->RemoveObserver(callbacks_it->second.commands[0u]);
(*it)->RemoveObserver(callbacks_it->second.commands[1u]);
(*it)->RemoveObserver(callbacks_it->second.commands[2u]);
}
}
}
void RenderingManager::SetFactory(RenderingManagerFactory *factory) { s_RenderingManagerFactory = factory; }
const RenderingManagerFactory *RenderingManager::GetFactory() { return s_RenderingManagerFactory; }
bool RenderingManager::HasFactory()
{
if (RenderingManager::s_RenderingManagerFactory)
{
return true;
}
else
{
return false;
}
}
RenderingManager::Pointer RenderingManager::New()
{
const RenderingManagerFactory *factory = GetFactory();
if (factory == nullptr)
return nullptr;
return factory->CreateRenderingManager();
}
RenderingManager *RenderingManager::GetInstance()
{
if (!RenderingManager::s_Instance)
{
if (s_RenderingManagerFactory)
{
s_Instance = s_RenderingManagerFactory->CreateRenderingManager();
}
}
return s_Instance;
}
bool RenderingManager::IsInstantiated()
{
if (RenderingManager::s_Instance)
return true;
else
return false;
}
void RenderingManager::AddRenderWindow(vtkRenderWindow *renderWindow)
{
if (renderWindow && (m_RenderWindowList.find(renderWindow) == m_RenderWindowList.end()))
{
m_RenderWindowList[renderWindow] = RENDERING_INACTIVE;
m_AllRenderWindows.push_back(renderWindow);
if (m_DataStorage.IsNotNull())
mitk::BaseRenderer::GetInstance(renderWindow)->SetDataStorage(m_DataStorage.GetPointer());
// Register vtkRenderWindow instance
renderWindow->Register(nullptr);
// Add callbacks for rendering abort mechanism
// BaseRenderer *renderer = BaseRenderer::GetInstance( renderWindow );
vtkCallbackCommand *startCallbackCommand = vtkCallbackCommand::New();
startCallbackCommand->SetCallback(RenderingManager::RenderingStartCallback);
renderWindow->AddObserver(vtkCommand::StartEvent, startCallbackCommand);
vtkCallbackCommand *progressCallbackCommand = vtkCallbackCommand::New();
progressCallbackCommand->SetCallback(RenderingManager::RenderingProgressCallback);
renderWindow->AddObserver(vtkCommand::AbortCheckEvent, progressCallbackCommand);
vtkCallbackCommand *endCallbackCommand = vtkCallbackCommand::New();
endCallbackCommand->SetCallback(RenderingManager::RenderingEndCallback);
renderWindow->AddObserver(vtkCommand::EndEvent, endCallbackCommand);
RenderWindowCallbacks callbacks;
callbacks.commands[0u] = startCallbackCommand;
callbacks.commands[1u] = progressCallbackCommand;
callbacks.commands[2u] = endCallbackCommand;
this->m_RenderWindowCallbacksList[renderWindow] = callbacks;
// Delete vtk variables correctly
startCallbackCommand->Delete();
progressCallbackCommand->Delete();
endCallbackCommand->Delete();
}
}
void RenderingManager::RemoveRenderWindow(vtkRenderWindow *renderWindow)
{
if (m_RenderWindowList.erase(renderWindow))
{
auto callbacks_it = this->m_RenderWindowCallbacksList.find(renderWindow);
if (callbacks_it != this->m_RenderWindowCallbacksList.end())
{
renderWindow->RemoveObserver(callbacks_it->second.commands[0u]);
renderWindow->RemoveObserver(callbacks_it->second.commands[1u]);
renderWindow->RemoveObserver(callbacks_it->second.commands[2u]);
this->m_RenderWindowCallbacksList.erase(callbacks_it);
}
auto rw_it =
std::find(m_AllRenderWindows.begin(), m_AllRenderWindows.end(), renderWindow);
if (rw_it != m_AllRenderWindows.cend())
{
// Decrease reference count for proper destruction
(*rw_it)->UnRegister(nullptr);
m_AllRenderWindows.erase(rw_it);
}
}
}
const RenderingManager::RenderWindowVector &RenderingManager::GetAllRegisteredRenderWindows()
{
return m_AllRenderWindows;
}
void RenderingManager::RequestUpdate(vtkRenderWindow *renderWindow)
{
// If the renderWindow is not valid, we do not want to inadvertantly create
// an entry in the m_RenderWindowList map. It is possible if the user is
// regularly calling AddRenderer and RemoveRenderer for a rendering update
// to come into this method with a renderWindow pointer that is valid in the
// sense that the window does exist within the application, but that
// renderWindow has been temporarily removed from this RenderingManager for
// performance reasons.
if (m_RenderWindowList.find(renderWindow) == m_RenderWindowList.cend())
{
return;
}
m_RenderWindowList[renderWindow] = RENDERING_REQUESTED;
if (!m_UpdatePending)
{
m_UpdatePending = true;
this->GenerateRenderingRequestEvent();
}
}
void RenderingManager::ForceImmediateUpdate(vtkRenderWindow *renderWindow)
{
// If the renderWindow is not valid, we do not want to inadvertantly create
// an entry in the m_RenderWindowList map. It is possible if the user is
// regularly calling AddRenderer and RemoveRenderer for a rendering update
// to come into this method with a renderWindow pointer that is valid in the
// sense that the window does exist within the application, but that
// renderWindow has been temporarily removed from this RenderingManager for
// performance reasons.
if (m_RenderWindowList.find(renderWindow) == m_RenderWindowList.cend())
{
return;
}
// Erase potentially pending requests for this window
m_RenderWindowList[renderWindow] = RENDERING_INACTIVE;
m_UpdatePending = false;
// Immediately repaint this window (implementation platform specific)
// If the size is 0 it crashes
int *size = renderWindow->GetSize();
if (0 != size[0] && 0 != size[1])
{
// prepare the camera etc. before rendering
// Note: this is a very important step which should be called before the VTK render!
// If you modify the camera anywhere else or after the render call, the scene cannot be seen.
auto *vPR = dynamic_cast<mitk::VtkPropRenderer *>(mitk::BaseRenderer::GetInstance(renderWindow));
if (vPR)
vPR->PrepareRender();
// Execute rendering
renderWindow->Render();
}
}
void RenderingManager::RequestUpdateAll(RequestType type)
{
RenderWindowList::const_iterator it;
for (it = m_RenderWindowList.cbegin(); it != m_RenderWindowList.cend(); ++it)
{
int id = BaseRenderer::GetInstance(it->first)->GetMapperID();
if ((type == REQUEST_UPDATE_ALL) || ((type == REQUEST_UPDATE_2DWINDOWS) && (id == 1)) ||
((type == REQUEST_UPDATE_3DWINDOWS) && (id == 2)))
{
this->RequestUpdate(it->first);
}
}
}
void RenderingManager::ForceImmediateUpdateAll(RequestType type)
{
RenderWindowList::const_iterator it;
for (it = m_RenderWindowList.cbegin(); it != m_RenderWindowList.cend(); ++it)
{
int id = BaseRenderer::GetInstance(it->first)->GetMapperID();
if ((type == REQUEST_UPDATE_ALL) || ((type == REQUEST_UPDATE_2DWINDOWS) && (id == 1)) ||
((type == REQUEST_UPDATE_3DWINDOWS) && (id == 2)))
{
// Immediately repaint this window (implementation platform specific)
// If the size is 0, it crashes
this->ForceImmediateUpdate(it->first);
}
}
}
void RenderingManager::InitializeViewsByBoundingObjects(const DataStorage *ds)
{
if (!ds)
return;
// get all nodes that have not set "includeInBoundingBox" to false
mitk::NodePredicateNot::Pointer pred = mitk::NodePredicateNot::New(
mitk::NodePredicateProperty::New("includeInBoundingBox", mitk::BoolProperty::New(false)));
mitk::DataStorage::SetOfObjects::ConstPointer rs = ds->GetSubset(pred);
// calculate bounding geometry of these nodes
auto bounds = ds->ComputeBoundingGeometry3D(rs, "visible");
// initialize the views to the bounding geometry
this->InitializeViews(bounds);
}
// TODO_GOETZ
// Remove old function, so only this one is working.
bool RenderingManager::InitializeViews(const BaseGeometry *dataGeometry,
RequestType type,
bool preserveRoughOrientationInWorldSpace)
{
ProportionalTimeGeometry::Pointer propTimeGeometry = ProportionalTimeGeometry::New();
propTimeGeometry->Initialize(dynamic_cast<BaseGeometry *>(dataGeometry->Clone().GetPointer()), 1);
return InitializeViews(propTimeGeometry, type, preserveRoughOrientationInWorldSpace);
}
bool RenderingManager::InitializeViews(const TimeGeometry *dataGeometry,
RequestType type,
bool /*preserveRoughOrientationInWorldSpace*/)
{
MITK_DEBUG << "initializing views";
bool boundingBoxInitialized = false;
TimeGeometry::ConstPointer timeGeometry = dataGeometry;
TimeGeometry::Pointer modifiedGeometry = nullptr;
if (dataGeometry != nullptr)
{
modifiedGeometry = dataGeometry->Clone();
}
int warningLevel = vtkObject::GetGlobalWarningDisplay();
vtkObject::GlobalWarningDisplayOff();
if ((timeGeometry.IsNotNull()) &&
(timeGeometry->GetBoundingBoxInWorld()->GetDiagonalLength2() > mitk::eps))
{
boundingBoxInitialized = true;
}
if (timeGeometry.IsNotNull())
{ // make sure bounding box has an extent bigger than zero in any direction
// clone the input geometry
// Old Geometry3D::Pointer modifiedGeometry = dynamic_cast<Geometry3D*>( dataGeometry->Clone().GetPointer() );
assert(modifiedGeometry.IsNotNull());
for (TimeStepType step = 0; step < modifiedGeometry->CountTimeSteps(); ++step)
{
BaseGeometry::BoundsArrayType newBounds = modifiedGeometry->GetGeometryForTimeStep(step)->GetBounds();
for (unsigned int dimension = 0; (2 * dimension) < newBounds.Size(); dimension++)
{
// check for equality but for an epsilon
if (Equal(newBounds[2 * dimension], newBounds[2 * dimension + 1]))
{
newBounds[2 * dimension + 1] += 1;
if (Equal(
newBounds[2 * dimension],
newBounds[2 * dimension + 1])) // newBounds will still be equal if values are beyond double precision
{
mitkThrow() << "One dimension of object data has zero length, please make sure you're not using numbers "
"beyond double precision as coordinates.";
}
}
}
modifiedGeometry->GetGeometryForTimeStep(step)->SetBounds(newBounds);
}
}
timeGeometry = modifiedGeometry;
RenderWindowList::const_iterator it;
for (it = m_RenderWindowList.cbegin(); it != m_RenderWindowList.cend(); ++it)
{
mitk::BaseRenderer *baseRenderer = mitk::BaseRenderer::GetInstance(it->first);
baseRenderer->SetConstrainZoomingAndPanning(m_ConstrainedPanningZooming);
int id = baseRenderer->GetMapperID();
if (((type == REQUEST_UPDATE_ALL) || ((type == REQUEST_UPDATE_2DWINDOWS) && (id == 1)) ||
((type == REQUEST_UPDATE_3DWINDOWS) && (id == 2))))
{
this->InternalViewInitialization(baseRenderer, timeGeometry, boundingBoxInitialized, id);
}
}
if (boundingBoxInitialized)
{
m_TimeNavigationController->SetInputWorldTimeGeometry(timeGeometry);
}
m_TimeNavigationController->Update();
this->RequestUpdateAll(type);
vtkObject::SetGlobalWarningDisplay(warningLevel);
// Inform listeners that views have been initialized
this->InvokeEvent(mitk::RenderingManagerViewsInitializedEvent());
return boundingBoxInitialized;
}
bool RenderingManager::InitializeViews(RequestType type)
{
RenderWindowList::const_iterator it;
for (it = m_RenderWindowList.cbegin(); it != m_RenderWindowList.cend(); ++it)
{
mitk::BaseRenderer *baseRenderer = mitk::BaseRenderer::GetInstance(it->first);
int id = baseRenderer->GetMapperID();
if ((type == REQUEST_UPDATE_ALL) || ((type == REQUEST_UPDATE_2DWINDOWS) && (id == 1)) ||
((type == REQUEST_UPDATE_3DWINDOWS) && (id == 2)))
{
mitk::SliceNavigationController *nc =
baseRenderer->GetSliceNavigationController();
// Re-initialize view direction
nc->SetViewDirectionToDefault();
// Update the SNC
nc->Update();
}
}
this->RequestUpdateAll(type);
return true;
}
bool RenderingManager::InitializeView(vtkRenderWindow *renderWindow,
const BaseGeometry *geometry,
bool initializeGlobalTimeSNC)
{
ProportionalTimeGeometry::Pointer propTimeGeometry = ProportionalTimeGeometry::New();
propTimeGeometry->Initialize(dynamic_cast<BaseGeometry *>(geometry->Clone().GetPointer()), 1);
return InitializeView(renderWindow, propTimeGeometry, initializeGlobalTimeSNC);
}
bool RenderingManager::InitializeView(vtkRenderWindow *renderWindow,
const TimeGeometry *geometry,
bool initializeGlobalTimeSNC)
{
bool boundingBoxInitialized = false;
int warningLevel = vtkObject::GetGlobalWarningDisplay();
vtkObject::GlobalWarningDisplayOff();
if ((geometry != nullptr) &&
(geometry->GetBoundingBoxInWorld()->GetDiagonalLength2() > mitk::eps))
{
boundingBoxInitialized = true;
}
mitk::BaseRenderer *baseRenderer = mitk::BaseRenderer::GetInstance(renderWindow);
int id = baseRenderer->GetMapperID();
this->InternalViewInitialization(baseRenderer, geometry, boundingBoxInitialized, id);
if (boundingBoxInitialized && initializeGlobalTimeSNC)
{
m_TimeNavigationController->SetInputWorldTimeGeometry(geometry);
}
m_TimeNavigationController->Update();
this->RequestUpdate(renderWindow);
vtkObject::SetGlobalWarningDisplay(warningLevel);
return boundingBoxInitialized;
}
bool RenderingManager::InitializeView(vtkRenderWindow *renderWindow)
{
mitk::BaseRenderer *baseRenderer = mitk::BaseRenderer::GetInstance(renderWindow);
mitk::SliceNavigationController *nc = baseRenderer->GetSliceNavigationController();
// Re-initialize view direction
nc->SetViewDirectionToDefault();
// Update the SNC
nc->Update();
this->RequestUpdate(renderWindow);
return true;
}
void RenderingManager::InternalViewInitialization(mitk::BaseRenderer *baseRenderer,
const mitk::TimeGeometry *geometry,
bool boundingBoxInitialized,
int mapperID)
{
mitk::SliceNavigationController *nc = baseRenderer->GetSliceNavigationController();
// Re-initialize view direction
nc->SetViewDirectionToDefault();
if (boundingBoxInitialized)
{
// Set geometry for NC
nc->SetInputWorldTimeGeometry(geometry);
nc->Update();
if (mapperID == BaseRenderer::Standard2D)
{
// For 2D SNCs, steppers are set so that the cross is centered
// in the image
nc->GetSlice()->SetPos(nc->GetSlice()->GetSteps() / 2);
}
baseRenderer->GetCameraController()->SetViewToAnterior();
baseRenderer->GetCameraController()->Fit();
}
else
{
nc->Update();
}
}
const SliceNavigationController *RenderingManager::GetTimeNavigationController() const
{
return m_TimeNavigationController.GetPointer();
}
SliceNavigationController *RenderingManager::GetTimeNavigationController()
{
return m_TimeNavigationController.GetPointer();
}
void RenderingManager::ExecutePendingRequests()
{
m_UpdatePending = false;
// Satisfy all pending update requests
RenderWindowList::const_iterator it;
int i = 0;
for (it = m_RenderWindowList.cbegin(); it != m_RenderWindowList.cend(); ++it, ++i)
{
if (it->second == RENDERING_REQUESTED)
{
this->ForceImmediateUpdate(it->first);
}
}
}
void RenderingManager::RenderingStartCallback(vtkObject *caller, unsigned long, void *, void *)
{
auto renderingManager = RenderingManager::GetInstance();
auto renderWindow = dynamic_cast<vtkRenderWindow*>(caller);
if (nullptr != renderWindow)
renderingManager->m_RenderWindowList[renderWindow] = RENDERING_INPROGRESS;
renderingManager->m_UpdatePending = false;
}
void RenderingManager::RenderingProgressCallback(vtkObject *caller, unsigned long, void *, void *)
{
auto renderingManager = RenderingManager::GetInstance();
if (renderingManager->m_LODAbortMechanismEnabled)
{
auto renderWindow = dynamic_cast<vtkRenderWindow *>(caller);
if (nullptr != renderWindow)
{
auto renderer = BaseRenderer::GetInstance(renderWindow);
if (nullptr != renderer && 0 < renderer->GetNumberOfVisibleLODEnabledMappers())
renderingManager->DoMonitorRendering();
}
}
}
void RenderingManager::RenderingEndCallback(vtkObject *caller, unsigned long, void *, void *)
{
auto renderWindow = dynamic_cast<vtkRenderWindow*>(caller);
if (nullptr != renderWindow)
{
auto renderer = BaseRenderer::GetInstance(renderWindow);
if (nullptr != renderer)
{
auto renderingManager = RenderingManager::GetInstance();
renderingManager->m_RenderWindowList[renderer->GetRenderWindow()] = RENDERING_INACTIVE;
if (0 < renderer->GetNumberOfVisibleLODEnabledMappers())
{
if (0 == renderingManager->m_NextLODMap[renderer])
{
renderingManager->StartOrResetTimer();
}
else
{
renderingManager->m_NextLODMap[renderer] = 0;
}
}
}
}
}
bool RenderingManager::IsRendering() const
{
RenderWindowList::const_iterator it;
for (it = m_RenderWindowList.cbegin(); it != m_RenderWindowList.cend(); ++it)
{
if (it->second == RENDERING_INPROGRESS)
{
return true;
}
}
return false;
}
void RenderingManager::AbortRendering()
{
RenderWindowList::const_iterator it;
for (it = m_RenderWindowList.cbegin(); it != m_RenderWindowList.cend(); ++it)
{
if (it->second == RENDERING_INPROGRESS)
{
it->first->SetAbortRender(true);
m_RenderingAbortedMap[BaseRenderer::GetInstance(it->first)] = true;
}
}
}
int RenderingManager::GetNextLOD(BaseRenderer *renderer)
{
if (renderer != nullptr)
{
return m_NextLODMap[renderer];
}
else
{
return 0;
}
}
void RenderingManager::ExecutePendingHighResRenderingRequest()
{
RenderWindowList::const_iterator it;
for (it = m_RenderWindowList.cbegin(); it != m_RenderWindowList.cend(); ++it)
{
BaseRenderer *renderer = BaseRenderer::GetInstance(it->first);
if (renderer->GetNumberOfVisibleLODEnabledMappers() > 0)
{
if (m_NextLODMap[renderer] == 0)
{
m_NextLODMap[renderer] = 1;
RequestUpdate(it->first);
}
}
}
}
void RenderingManager::SetMaximumLOD(unsigned int max) { m_MaxLOD = max; }
// enable/disable shading
void RenderingManager::SetShading(bool state, unsigned int lod)
{
if (lod > m_MaxLOD)
{
itkWarningMacro(<< "LOD out of range requested: " << lod << " maxLOD: " << m_MaxLOD);
return;
}
m_ShadingEnabled[lod] = state;
}
bool RenderingManager::GetShading(unsigned int lod)
{
if (lod > m_MaxLOD)
{
itkWarningMacro(<< "LOD out of range requested: " << lod << " maxLOD: " << m_MaxLOD);
return false;
}
return m_ShadingEnabled[lod];
}
// enable/disable the clipping plane
void RenderingManager::SetClippingPlaneStatus(bool status) { m_ClippingPlaneEnabled = status; }
bool RenderingManager::GetClippingPlaneStatus() { return m_ClippingPlaneEnabled; }
void RenderingManager::SetShadingValues(float ambient, float diffuse, float specular, float specpower)
{
m_ShadingValues[0] = ambient;
m_ShadingValues[1] = diffuse;
m_ShadingValues[2] = specular;
m_ShadingValues[3] = specpower;
}
RenderingManager::FloatVector &RenderingManager::GetShadingValues() { return m_ShadingValues; }
void RenderingManager::InitializePropertyList()
{
if (m_PropertyList.IsNull())
{
m_PropertyList = PropertyList::New();
}
this->SetProperty("coupled-zoom", BoolProperty::New(false));
this->SetProperty("coupled-plane-rotation", BoolProperty::New(false));
this->SetProperty("MIP-slice-rendering", BoolProperty::New(false));
}
PropertyList::Pointer RenderingManager::GetPropertyList() const { return m_PropertyList; }
BaseProperty *RenderingManager::GetProperty(const char *propertyKey) const
{
return m_PropertyList->GetProperty(propertyKey);
}
void RenderingManager::SetProperty(const char *propertyKey, BaseProperty *propertyValue)
{
m_PropertyList->SetProperty(propertyKey, propertyValue);
}
void RenderingManager::SetDataStorage(DataStorage *storage)
{
if (storage != nullptr)
{
m_DataStorage = storage;
RenderingManager::RenderWindowVector::const_iterator iter;
for (iter = m_AllRenderWindows.cbegin(); iter < m_AllRenderWindows.cend(); ++iter)
{
mitk::BaseRenderer::GetInstance((*iter))->SetDataStorage(m_DataStorage.GetPointer());
}
}
}
mitk::DataStorage *RenderingManager::GetDataStorage() { return m_DataStorage; }
void RenderingManager::SetRenderWindowFocus(vtkRenderWindow *focusWindow)
{
if (focusWindow != m_FocusedRenderWindow)
{
if (!focusWindow || (m_RenderWindowList.find(focusWindow) != m_RenderWindowList.cend()))
{
m_FocusedRenderWindow = focusWindow;
this->InvokeEvent(FocusChangedEvent());
return;
}
MITK_ERROR << "Tried to set a RenderWindow that does not exist.";
}
}
void RenderingManager::SetAntiAliasing(AntiAliasing antiAliasing)
{
if (m_AntiAliasing != antiAliasing)
{
auto renderingManager = mitk::RenderingManager::GetInstance();
auto renderWindows = renderingManager->GetAllRegisteredRenderWindows();
for (auto renderWindow : renderWindows)
{
auto renderers = renderWindow->GetRenderers();
if (nullptr != renderers)
{
renderers->InitTraversal();
auto renderer = renderers->GetNextItem();
while (nullptr != renderer)
{
renderer->SetUseFXAA(AntiAliasing::FastApproximate == antiAliasing);
renderer = renderers->GetNextItem();
}
renderingManager->RequestUpdate(renderWindow);
}
}
m_AntiAliasing = antiAliasing;
}
}
// Create and register generic RenderingManagerFactory.
TestingRenderingManagerFactory renderingManagerFactory;
} // namespace
diff --git a/Modules/Core/test/CMakeLists.txt b/Modules/Core/test/CMakeLists.txt
index 0e4dbdc277..7b3e5e46e9 100644
--- a/Modules/Core/test/CMakeLists.txt
+++ b/Modules/Core/test/CMakeLists.txt
@@ -1,200 +1,192 @@
# The core tests need relaxed compiler flags...
# TODO fix core tests to compile without these additional no-error flags
if(MSVC_VERSION)
# disable deprecated warnings (they would lead to errors)
mitkFunctionCheckCAndCXXCompilerFlags("/wd4996" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
else()
mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=deprecated" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=deprecated-declarations" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
endif()
MITK_CREATE_MODULE_TESTS()
if(TARGET ${TESTDRIVER})
mitk_use_modules(TARGET ${TESTDRIVER} PACKAGES ITK|ITKThresholding+ITKTestKernel VTK|vtkTestingRendering tinyxml)
mitkAddCustomModuleTest(mitkVolumeCalculatorTest_Png2D-bw mitkVolumeCalculatorTest
${MITK_DATA_DIR}/Png2D-bw.png
${MITK_DATA_DIR}/Pic2DplusT.nrrd
)
mitkAddCustomModuleTest(mitkEventConfigTest_CreateObjectInDifferentWays mitkEventConfigTest
${MITK_SOURCE_DIR}/Modules/Core/test/resource/Interactions/StatemachineConfigTest.xml
)
mitkAddCustomModuleTest(mitkDataStorageTest_US4DCyl mitkDataStorageTest
${MITK_DATA_DIR}/US4DCyl.nrrd
)
mitkAddCustomModuleTest(mitkPointSetReaderTest mitkPointSetReaderTest
${MITK_DATA_DIR}/PointSetReaderTestData.mps
)
mitkAddCustomModuleTest(mitkImageTest_4DImageData mitkImageTest
${MITK_DATA_DIR}/US4DCyl.nrrd
)
mitkAddCustomModuleTest(mitkImageTest_2D+tImageData mitkImageTest
${MITK_DATA_DIR}/Pic2DplusT.nrrd
)
mitkAddCustomModuleTest(mitkImageTest_3DImageData mitkImageTest
${MITK_DATA_DIR}/Pic3D.nrrd
)
mitkAddCustomModuleTest(mitkImageEqualTest mitkImageEqualTest)
mitkAddCustomModuleTest(mitkImageTest_brainImage mitkImageTest
${MITK_DATA_DIR}/brain.mhd
)
- mitkAddCustomModuleTest(mitkImageTest_3DImageData mitkImageGeneratorTest
- ${MITK_DATA_DIR}/Pic3D.nrrd
- )
-
mitkAddCustomModuleTest(mitkLevelWindowManagerTest mitkLevelWindowManagerTest
${MITK_DATA_DIR}/Pic3D.nrrd
)
mitkAddCustomModuleTest(mitkMultiComponentImageDataComparisonFilterTest mitkMultiComponentImageDataComparisonFilterTest
${MITK_DATA_DIR}/NrrdWritingTestImage.jpg
)
mitkAddCustomModuleTest(mitkImageToItkTest mitkImageToItkTest
${MITK_DATA_DIR}/Pic3D.nrrd
)
mitkAddCustomModuleTest(mitkImageSliceSelectorTest mitkImageSliceSelectorTest
${MITK_DATA_DIR}/Pic2DplusT.nrrd
)
mitkAddCustomModuleTest(mitkRotatedSlice4DTest mitkRotatedSlice4DTest
${MITK_DATA_DIR}/UltrasoundImages/4D_TEE_Data_MV.dcm
)
- if(MITK_ENABLE_RENDERING_TESTING) ### since the rendering test's do not run in ubuntu, yet, we build them only for other systems or if the user explicitly sets the variable MITK_ENABLE_RENDERING_TESTING
- mitkAddCustomModuleTest(mitkImageVtkMapper2D_rgbaImage640x480 mitkImageVtkMapper2DTest
- ${MITK_DATA_DIR}/RenderingTestData/rgbaImage.png #input image to load in data storage
- -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/rgbaImage640x480REF.png #corresponding reference screenshot
- )
- mitkAddCustomModuleTest(mitkImageVtkMapper2D_pic3d640x480 mitkImageVtkMapper2DTest #test for standard Pic3D axial slice
- ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage
- -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3d640x480REF.png #corresponding reference screenshot
- )
- mitkAddCustomModuleTest(mitkImageVtkMapper2D_pic3dColorBlue640x480 mitkImageVtkMapper2DColorTest #test for color property (=blue) Pic3D sagittal slice
- ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage
- -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dColorBlue640x480REF.png #corresponding reference screenshot
- )
- mitkAddCustomModuleTest(mitkImageVtkMapper2D_pic3dLevelWindow640x480 mitkImageVtkMapper2DLevelWindowTest #test for levelwindow property (=blood) #Pic3D sagittal slice
- ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage
- -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dLevelWindowBlood640x480REF.png #corresponding reference #screenshot
- )
- #mitkAddCustomModuleTest(mitkImageVtkMapper2D_pic3dOpacity640x480 mitkImageVtkMapper2DOpacityTest #test for opacity (=0.5) Pic3D coronal slice
- # ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage
- # -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dOpacity640x480REF.png corresponding reference screenshot
- #)
- mitkAddCustomModuleTest(mitkImageVtkMapper2D_pic3dSwivel640x480 mitkImageVtkMapper2DSwivelTest #test for a randomly chosen Pic3D swivelled slice
- ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage
- -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dSwivel640x480REF.png #corresponding reference screenshot
- )
- mitkAddCustomModuleTest(mitkPointSetVtkMapper2D_openMeAlone640x480 mitkPointSetVtkMapper2DTest
- ${MITK_DATA_DIR}/RenderingTestData/openMeAlone.mps #input point set to load in data storage
- -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/openMeAlone640x480REF.png #corresponding reference screenshot
- )
- mitkAddCustomModuleTest(mitkPointSetVtkMapper2D_Pic3DPointSetForPic3D640x480 mitkPointSetVtkMapper2DImageTest
- ${MITK_DATA_DIR}/Pic3D.nrrd ${MITK_DATA_DIR}/RenderingTestData/PointSetForPic3D.mps #input point set and image to load in data storage
- -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Pic3DPointSetForPic3D640x480REF.png #corresponding reference screenshot
- )
- mitkAddCustomModuleTest(mitkPointSetVtkMapper2D_openMeAloneGlyphType640x480 mitkPointSetVtkMapper2DGlyphTypeTest
- ${MITK_DATA_DIR}/RenderingTestData/openMeAlone.mps #input point set to load in data storage
- -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/openMeAloneGlyphType640x480REF.png #corresponding reference screenshot
- )
- mitkAddCustomModuleTest(mitkPointSetVtkMapper2D_openMeAloneTransformed640x480 mitkPointSetVtkMapper2DTransformedPointsTest
- ${MITK_DATA_DIR}/RenderingTestData/openMeAlone.mps #input point set to load in data storage
- -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/openMeAloneTransformedPoints640x480REF.png #corresponding reference screenshot
- )
- # Currently not working on windows because of a rendering timing issue
- # see bug 18083 for details
- if(NOT WIN32)
+ mitkAddCustomModuleTest(mitkImageVtkMapper2D_rgbaImage640x480 mitkImageVtkMapper2DTest
+ ${MITK_DATA_DIR}/RenderingTestData/rgbaImage.png #input image to load in data storage
+ -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/rgbaImage640x480REF.png #corresponding reference screenshot
+ )
+ mitkAddCustomModuleTest(mitkImageVtkMapper2D_pic3d640x480 mitkImageVtkMapper2DTest #test for standard Pic3D axial slice
+ ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage
+ -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3d640x480REF.png #corresponding reference screenshot
+ )
+ mitkAddCustomModuleTest(mitkImageVtkMapper2D_pic3dColorBlue640x480 mitkImageVtkMapper2DColorTest #test for color property (=blue) Pic3D sagittal slice
+ ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage
+ -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dColorBlue640x480REF.png #corresponding reference screenshot
+ )
+ mitkAddCustomModuleTest(mitkImageVtkMapper2D_pic3dLevelWindow640x480 mitkImageVtkMapper2DLevelWindowTest #test for levelwindow property (=blood) #Pic3D sagittal slice
+ ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage
+ -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dLevelWindowBlood640x480REF.png #corresponding reference #screenshot
+ )
+ #mitkAddCustomModuleTest(mitkImageVtkMapper2D_pic3dOpacity640x480 mitkImageVtkMapper2DOpacityTest #test for opacity (=0.5) Pic3D coronal slice
+ # ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage
+ # -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dOpacity640x480REF.png corresponding reference screenshot
+ #)
+ mitkAddCustomModuleTest(mitkImageVtkMapper2D_pic3dSwivel640x480 mitkImageVtkMapper2DSwivelTest #test for a randomly chosen Pic3D swivelled slice
+ ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage
+ -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dSwivel640x480REF.png #corresponding reference screenshot
+ )
+ mitkAddCustomModuleTest(mitkPointSetVtkMapper2D_openMeAlone640x480 mitkPointSetVtkMapper2DTest
+ ${MITK_DATA_DIR}/RenderingTestData/openMeAlone.mps #input point set to load in data storage
+ -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/openMeAlone640x480REF.png #corresponding reference screenshot
+ )
+ mitkAddCustomModuleTest(mitkPointSetVtkMapper2D_Pic3DPointSetForPic3D640x480 mitkPointSetVtkMapper2DImageTest
+ ${MITK_DATA_DIR}/Pic3D.nrrd ${MITK_DATA_DIR}/RenderingTestData/PointSetForPic3D.mps #input point set and image to load in data storage
+ -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Pic3DPointSetForPic3D640x480REF.png #corresponding reference screenshot
+ )
+ mitkAddCustomModuleTest(mitkPointSetVtkMapper2D_openMeAloneGlyphType640x480 mitkPointSetVtkMapper2DGlyphTypeTest
+ ${MITK_DATA_DIR}/RenderingTestData/openMeAlone.mps #input point set to load in data storage
+ -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/openMeAloneGlyphType640x480REF.png #corresponding reference screenshot
+ )
+ mitkAddCustomModuleTest(mitkPointSetVtkMapper2D_openMeAloneTransformed640x480 mitkPointSetVtkMapper2DTransformedPointsTest
+ ${MITK_DATA_DIR}/RenderingTestData/openMeAlone.mps #input point set to load in data storage
+ -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/openMeAloneTransformedPoints640x480REF.png #corresponding reference screenshot
+ )
+ # Currently not working on windows because of a rendering timing issue
+ # see bug 18083 for details
+ if(NOT WIN32)
mitkAddCustomModuleTest(mitkSurfaceDepthSortingTransparency_StanfordBunnySTL640x480 mitkSurfaceDepthSortingTest
${MITK_DATA_DIR}/RenderingTestData/Stanford_bunny.stl
- -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Stanford_bunnySTLDepthSorting640x480REF.png
- )
- endif()
-
-# BUG 18695 - tests deactivated, because win 32 bit continuous renders images slightly different. TODO!
- #Test reslice interpolation
- #note: nearest mode is already tested by swivel test
- #mitkAddCustomModuleTest(ResliceInterpolationIsLinear mitkImageVtkMapper2DResliceInterpolationPropertyTest
- # 1 #linear
- # ${MITK_DATA_DIR}/Pic3D.nrrd
- # -V
- # ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dRefLinear.png #corresponding reference screenshot LINEAR
- #)
-
- #mitkAddCustomModuleTest(ResliceInterpolationIsCubic mitkImageVtkMapper2DResliceInterpolationPropertyTest
- # 3 #cubic
- # ${MITK_DATA_DIR}/Pic3D.nrrd
- # -V
- # ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dRefCubic.png #corresponding reference screenshot CUBIC
- #)
- #End test reslice interpolation
-
- # Testing of the rendering of binary images
- #mitkAddCustomModuleTest(mitkImageVtkMapper2D_binaryTestImage640x480 mitkImageVtkMapper2DTest #test for standard Pic3D axial slice
- # ${MITK_DATA_DIR}/RenderingTestData/binaryImage.nrrd #input image to load in data storage
- # -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/binaryImage640x480REF.png #corresponding reference screenshot
- #)
- #mitkAddCustomModuleTest(mitkImageVtkMapper2D_binaryTestImageWithRef640x480 mitkImageVtkMapper2DTest #test for standard Pic3D axial slice
- # ${MITK_DATA_DIR}/Pic3D.nrrd ${MITK_DATA_DIR}/RenderingTestData/binaryImage.nrrd #input image to load in data storage
- # -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/binaryImageWithRef640x480REF.png #corresponding reference screenshot
- #)
- # End of binary image tests
-
- mitkAddCustomModuleTest(mitkSurfaceVtkMapper3DTest_TextureProperty mitkSurfaceVtkMapper3DTest
- ${MITK_DATA_DIR}/RenderingTestData/earth.jpg
- -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/texturedSphere640x480REF.png #corresponding reference screenshot
- )
-
- mitkAddCustomModuleTest(mitkImageVtkMapper2DTransferFunctionTest_Png2D-bw mitkImageVtkMapper2DTransferFunctionTest
- ${MITK_DATA_DIR}/Png2D-bw.png
- -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Png2D-bw-TransferFunctionRGBImage640x480REF.png #corresponding reference screenshot
- )
-
- mitkAddCustomModuleTest(mitkImageVtkMapper2DOpacityTransferFunctionTest_Png2D-bw mitkImageVtkMapper2DOpacityTransferFunctionTest
- ${MITK_DATA_DIR}/Png2D-bw.png
- -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Png2D-bw-OpacityTransferFunctionRGBImage640x480REF.png #corresponding reference screenshot
- )
-
- ############################## DISABLED TESTS
-
- mitkAddCustomModuleTest(mitkImageVtkMapper2DLookupTableTest_Png2D-bw mitkImageVtkMapper2DLookupTableTest
- ${MITK_DATA_DIR}/Png2D-bw.png
- -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Png2D-bw-LookupTableRGBImage640x480REF.png #corresponding reference screenshot
- )
-
- #mitkAddCustomModuleTest(mitkImageTest_color2DImage mitkImageTest
- # ${MITK_DATA_DIR}/NrrdWritingTestImage.jpg
- #)
-
- #mitkAddCustomModuleTest(mitkNodeDependentPointSetInteractorTest mitkNodeDependentPointSetInteractorTest
- # ${MITK_DATA_DIR}/Pic3D.pic.gz ${MITK_DATA_DIR}/BallBinary30x30x30.pic.gz
- #)
-
- mitkAddCustomModuleTest(mitkPlaneGeometryDataMapper2DTest mitkPlaneGeometryDataMapper2DTest
- ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage
- -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/PlaneGeometryMapper640x480REF.png #corresponding reference screenshot
- )
-
-
- SET_PROPERTY(TEST mitkRotatedSlice4DTest mitkImageVtkMapper2D_rgbaImage640x480 mitkImageVtkMapper2D_pic3d640x480 mitkImageVtkMapper2D_pic3dColorBlue640x480 mitkImageVtkMapper2D_pic3dLevelWindow640x480 mitkImageVtkMapper2D_pic3dSwivel640x480 mitkImageVtkMapper2DTransferFunctionTest_Png2D-bw
- # mitkImageVtkMapper2D_pic3dOpacity640x480
- mitkSurfaceVtkMapper2DTest mitkSurfaceVtkMapper3DTest_TextureProperty mitkPointSetVtkMapper2D_Pic3DPointSetForPic3D640x480 mitkPointSetVtkMapper2D_openMeAlone640x480 mitkPointSetVtkMapper2D_openMeAloneGlyphType640x480 mitkPointSetVtkMapper2D_openMeAloneTransformed640x480
- mitkPlaneGeometryDataMapper2DTest
- PROPERTY RUN_SERIAL TRUE)
-
+ -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Stanford_bunnySTLDepthSorting640x480REF.png)
endif()
+ # BUG 18695 - tests deactivated, because win 32 bit continuous renders images slightly different. TODO!
+ #Test reslice interpolation
+ #note: nearest mode is already tested by swivel test
+ #mitkAddCustomModuleTest(ResliceInterpolationIsLinear mitkImageVtkMapper2DResliceInterpolationPropertyTest
+ # 1 #linear
+ # ${MITK_DATA_DIR}/Pic3D.nrrd
+ # -V
+ # ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dRefLinear.png #corresponding reference screenshot LINEAR
+ #)
+
+ #mitkAddCustomModuleTest(ResliceInterpolationIsCubic mitkImageVtkMapper2DResliceInterpolationPropertyTest
+ # 3 #cubic
+ # ${MITK_DATA_DIR}/Pic3D.nrrd
+ # -V
+ # ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dRefCubic.png #corresponding reference screenshot CUBIC
+ #)
+ #End test reslice interpolation
+
+ # Testing of the rendering of binary images
+ #mitkAddCustomModuleTest(mitkImageVtkMapper2D_binaryTestImage640x480 mitkImageVtkMapper2DTest #test for standard Pic3D axial slice
+ # ${MITK_DATA_DIR}/RenderingTestData/binaryImage.nrrd #input image to load in data storage
+ # -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/binaryImage640x480REF.png #corresponding reference screenshot
+ #)
+ #mitkAddCustomModuleTest(mitkImageVtkMapper2D_binaryTestImageWithRef640x480 mitkImageVtkMapper2DTest #test for standard Pic3D axial slice
+ # ${MITK_DATA_DIR}/Pic3D.nrrd ${MITK_DATA_DIR}/RenderingTestData/binaryImage.nrrd #input image to load in data storage
+ # -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/binaryImageWithRef640x480REF.png #corresponding reference screenshot
+ #)
+ # End of binary image tests
+
+ mitkAddCustomModuleTest(mitkSurfaceVtkMapper3DTest_TextureProperty mitkSurfaceVtkMapper3DTest
+ ${MITK_DATA_DIR}/RenderingTestData/earth.jpg
+ -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/texturedSphere640x480REF.png #corresponding reference screenshot
+ )
+
+ mitkAddCustomModuleTest(mitkImageVtkMapper2DTransferFunctionTest_Png2D-bw mitkImageVtkMapper2DTransferFunctionTest
+ ${MITK_DATA_DIR}/Png2D-bw.png
+ -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Png2D-bw-TransferFunctionRGBImage640x480REF.png #corresponding reference screenshot
+ )
+
+ mitkAddCustomModuleTest(mitkImageVtkMapper2DOpacityTransferFunctionTest_Png2D-bw mitkImageVtkMapper2DOpacityTransferFunctionTest
+ ${MITK_DATA_DIR}/Png2D-bw.png
+ -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Png2D-bw-OpacityTransferFunctionRGBImage640x480REF.png #corresponding reference screenshot
+ )
+
+ ############################## DISABLED TESTS
+
+ mitkAddCustomModuleTest(mitkImageVtkMapper2DLookupTableTest_Png2D-bw mitkImageVtkMapper2DLookupTableTest
+ ${MITK_DATA_DIR}/Png2D-bw.png
+ -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Png2D-bw-LookupTableRGBImage640x480REF.png #corresponding reference screenshot
+ )
+
+ #mitkAddCustomModuleTest(mitkImageTest_color2DImage mitkImageTest
+ # ${MITK_DATA_DIR}/NrrdWritingTestImage.jpg
+ #)
+
+ #mitkAddCustomModuleTest(mitkNodeDependentPointSetInteractorTest mitkNodeDependentPointSetInteractorTest
+ # ${MITK_DATA_DIR}/Pic3D.pic.gz ${MITK_DATA_DIR}/BallBinary30x30x30.pic.gz
+ #)
+
+ mitkAddCustomModuleTest(mitkPlaneGeometryDataMapper2DTest mitkPlaneGeometryDataMapper2DTest
+ ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage
+ -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/PlaneGeometryMapper640x480REF.png #corresponding reference screenshot
+ )
+
+
+ SET_PROPERTY(TEST mitkRotatedSlice4DTest mitkImageVtkMapper2D_rgbaImage640x480 mitkImageVtkMapper2D_pic3d640x480 mitkImageVtkMapper2D_pic3dColorBlue640x480 mitkImageVtkMapper2D_pic3dLevelWindow640x480 mitkImageVtkMapper2D_pic3dSwivel640x480 mitkImageVtkMapper2DTransferFunctionTest_Png2D-bw
+ # mitkImageVtkMapper2D_pic3dOpacity640x480
+ mitkSurfaceVtkMapper2DTest mitkSurfaceVtkMapper3DTest_TextureProperty mitkPointSetVtkMapper2D_Pic3DPointSetForPic3D640x480 mitkPointSetVtkMapper2D_openMeAlone640x480 mitkPointSetVtkMapper2D_openMeAloneGlyphType640x480 mitkPointSetVtkMapper2D_openMeAloneTransformed640x480
+ mitkPlaneGeometryDataMapper2DTest
+ PROPERTY RUN_SERIAL TRUE)
+
endif() # TARGET ${TESTDRIVER}
diff --git a/Modules/Core/test/files.cmake b/Modules/Core/test/files.cmake
index bddcd8ca8e..f98fb8a5df 100644
--- a/Modules/Core/test/files.cmake
+++ b/Modules/Core/test/files.cmake
@@ -1,201 +1,193 @@
# tests with no extra command line parameter
set(MODULE_TESTS
# IMPORTANT: If you plan to deactivate / comment out a test please write a bug number to the commented out line of code.
#
# Example: #mitkMyTest #this test is commented out because of bug 12345
#
# It is important that the bug is open and that the test will be activated again before the bug is closed. This assures that
# no test is forgotten after it was commented out. If there is no bug for your current problem, please add a new one and
# mark it as critical.
################## DISABLED TESTS #################################################
#mitkAbstractTransformGeometryTest.cpp #seems as tested class mitkExternAbstractTransformGeometry doesnt exist any more
#mitkStateMachineContainerTest.cpp #rewrite test, indirect since no longer exported Bug 14529
#mitkRegistrationBaseTest.cpp #tested class mitkRegistrationBase doesn't exist any more
#mitkSegmentationInterpolationTest.cpp #file doesn't exist!
#mitkPipelineSmartPointerCorrectnessTest.cpp #file doesn't exist!
#mitkITKThreadingTest.cpp #test outdated because itk::Semaphore was removed from ITK
#mitkAbstractTransformPlaneGeometryTest.cpp #mitkVtkAbstractTransformPlaneGeometry doesn't exist any more
#mitkTestUtilSharedLibrary.cpp #Linker problem with this test...
#mitkTextOverlay2DSymbolsRenderingTest.cpp #Implementation of the tested feature is not finished yet. Ask Christoph or see bug 15104 for details.
################# RUNNING TESTS ###################################################
mitkAccessByItkTest.cpp
mitkCoreObjectFactoryTest.cpp
mitkDataNodeTest.cpp
mitkMaterialTest.cpp
mitkActionTest.cpp
mitkDispatcherTest.cpp
mitkEnumerationPropertyTest.cpp
mitkFileReaderRegistryTest.cpp
#mitkFileWriterRegistryTest.cpp
mitkFloatToStringTest.cpp
mitkGenericPropertyTest.cpp
mitkGeometry3DTest.cpp
mitkGeometry3DEqualTest.cpp
mitkGeometryDataIOTest.cpp
mitkGeometryDataToSurfaceFilterTest.cpp
mitkImageCastTest.cpp
- mitkImageEqualTest.cpp
mitkImageDataItemTest.cpp
mitkImageGeneratorTest.cpp
mitkIOUtilTest.cpp
mitkBaseDataTest.cpp
mitkImportItkImageTest.cpp
mitkGrabItkImageMemoryTest.cpp
mitkInstantiateAccessFunctionTest.cpp
mitkLevelWindowTest.cpp
mitkMessageTest.cpp
mitkPixelTypeTest.cpp
mitkPlaneGeometryTest.cpp
mitkPointSetTest.cpp
mitkPointSetEqualTest.cpp
mitkPointSetFileIOTest.cpp
mitkPointSetOnEmptyTest.cpp
mitkPointSetLocaleTest.cpp
mitkPointSetWriterTest.cpp
- mitkPointSetReaderTest.cpp
mitkPointSetPointOperationsTest.cpp
mitkProgressBarTest.cpp
mitkPropertyTest.cpp
mitkPropertyListTest.cpp
mitkPropertyPersistenceTest.cpp
mitkPropertyPersistenceInfoTest.cpp
mitkPropertyRelationRuleBaseTest.cpp
mitkPropertyRelationsTest.cpp
mitkSlicedGeometry3DTest.cpp
mitkSliceNavigationControllerTest.cpp
mitkSurfaceTest.cpp
mitkSurfaceEqualTest.cpp
mitkSurfaceToSurfaceFilterTest.cpp
mitkTimeGeometryTest.cpp
mitkProportionalTimeGeometryTest.cpp
mitkUndoControllerTest.cpp
mitkVtkWidgetRenderingTest.cpp
mitkVerboseLimitedLinearUndoTest.cpp
mitkWeakPointerTest.cpp
mitkTransferFunctionTest.cpp
mitkStepperTest.cpp
mitkRenderingManagerTest.cpp
mitkCompositePixelValueToStringTest.cpp
vtkMitkThickSlicesFilterTest.cpp
mitkNodePredicateSourceTest.cpp
mitkNodePredicateDataPropertyTest.cpp
mitkNodePredicateFunctionTest.cpp
mitkVectorTest.cpp
mitkClippedSurfaceBoundsCalculatorTest.cpp
mitkExceptionTest.cpp
mitkExtractSliceFilterTest.cpp
mitkLogTest.cpp
mitkImageDimensionConverterTest.cpp
mitkLoggingAdapterTest.cpp
mitkUIDGeneratorTest.cpp
mitkPlanePositionManagerTest.cpp
mitkAffineTransformBaseTest.cpp
mitkPropertyAliasesTest.cpp
mitkPropertyDescriptionsTest.cpp
mitkPropertyExtensionsTest.cpp
mitkPropertyFiltersTest.cpp
mitkPropertyKeyPathTest.cpp
mitkTinyXMLTest.cpp
mitkRawImageFileReaderTest.cpp
mitkInteractionEventTest.cpp
mitkLookupTableTest.cpp
mitkSTLFileReaderTest.cpp
mitkPointTypeConversionTest.cpp
mitkVectorTypeConversionTest.cpp
mitkMatrixTypeConversionTest.cpp
mitkArrayTypeConversionTest.cpp
mitkSurfaceToImageFilterTest.cpp
mitkBaseGeometryTest.cpp
mitkImageToSurfaceFilterTest.cpp
mitkEqualTest.cpp
mitkLineTest.cpp
mitkArbitraryTimeGeometryTest.cpp
mitkItkImageIOTest.cpp
- mitkRotatedSlice4DTest.cpp
mitkLevelWindowManagerCppUnitTest.cpp
mitkVectorPropertyTest.cpp
mitkTemporoSpatialStringPropertyTest.cpp
mitkPropertyNameHelperTest.cpp
mitkNodePredicateGeometryTest.cpp
mitkPreferenceListReaderOptionsFunctorTest.cpp
mitkGenericIDRelationRuleTest.cpp
mitkSourceImageRelationRuleTest.cpp
-)
-
-if(MITK_ENABLE_RENDERING_TESTING)
-set(MODULE_TESTS
- ${MODULE_TESTS}
- mitkPlaneGeometryDataMapper2DTest.cpp
mitkPointSetDataInteractorTest.cpp #since mitkInteractionTestHelper is currently creating a vtkRenderWindow
mitkSurfaceVtkMapper2DTest.cpp #new rendering test in CppUnit style
mitkSurfaceVtkMapper2D3DTest.cpp # comparisons/consistency 2D/3D
)
-endif()
-
-
# test with image filename as an extra command line parameter
set(MODULE_IMAGE_TESTS
mitkImageTimeSelectorTest.cpp #only runs on images
mitkImageAccessorTest.cpp #only runs on images
)
set(MODULE_SURFACE_TESTS
mitkSurfaceVtkWriterTest.cpp #only runs on surfaces
)
# list of images for which the tests are run
set(MODULE_TESTIMAGE
US4DCyl.nrrd
Pic3D.nrrd
Pic2DplusT.nrrd
BallBinary30x30x30.nrrd
Png2D-bw.png
)
set(MODULE_TESTSURFACE
binary.stl
ball.stl
)
set(MODULE_CUSTOM_TESTS
mitkDataStorageTest.cpp
mitkDataNodeTest.cpp
mitkEventConfigTest.cpp
mitkPointSetLocaleTest.cpp
mitkImageTest.cpp
mitkImageVtkMapper2DTest.cpp
mitkImageVtkMapper2DLevelWindowTest.cpp
mitkImageVtkMapper2DOpacityTest.cpp
mitkImageVtkMapper2DResliceInterpolationPropertyTest.cpp
mitkImageVtkMapper2DColorTest.cpp
mitkImageVtkMapper2DSwivelTest.cpp
mitkImageVtkMapper2DTransferFunctionTest.cpp
mitkImageVtkMapper2DOpacityTransferFunctionTest.cpp
mitkImageVtkMapper2DLookupTableTest.cpp
mitkSurfaceVtkMapper3DTest.cpp
mitkVolumeCalculatorTest.cpp
mitkLevelWindowManagerTest.cpp
mitkPointSetVtkMapper2DTest.cpp
mitkPointSetVtkMapper2DImageTest.cpp
mitkPointSetVtkMapper2DGlyphTypeTest.cpp
mitkPointSetVtkMapper2DTransformedPointsTest.cpp
mitkVTKRenderWindowSizeTest.cpp
mitkMultiComponentImageDataComparisonFilterTest.cpp
mitkImageToItkTest.cpp
mitkImageSliceSelectorTest.cpp
+ mitkPointSetReaderTest.cpp
+ mitkImageEqualTest.cpp
+ mitkRotatedSlice4DTest.cpp
+ mitkPlaneGeometryDataMapper2DTest.cpp
)
# Currently not working on windows because of a rendering timing issue
# see bug 18083 for details
if(NOT WIN32)
set(MODULE_CUSTOM_TESTS ${MODULE_CUSTOM_TESTS} mitkSurfaceDepthSortingTest.cpp)
endif()
set(RESOURCE_FILES
Interactions/AddAndRemovePoints.xml
Interactions/globalConfig.xml
Interactions/StatemachineTest.xml
Interactions/StatemachineConfigTest.xml
)
diff --git a/Modules/Core/test/mitkBaseDataTest.cpp b/Modules/Core/test/mitkBaseDataTest.cpp
index 0e7be67417..16a242f275 100644
--- a/Modules/Core/test/mitkBaseDataTest.cpp
+++ b/Modules/Core/test/mitkBaseDataTest.cpp
@@ -1,279 +1,278 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
// Testing
#include "mitkTestFixture.h"
#include "mitkTestingMacros.h"
// std includes
#include <string>
// MITK includes
#include "mitkBaseDataTestImplementation.h"
#include "mitkStringProperty.h"
#include <mitkProportionalTimeGeometry.h>
#include <mitkTimeGeometry.h>
-// itksys
#include "itkImage.h"
// VTK includes
#include <vtkDebugLeaks.h>
class mitkBaseDataTestSuite : public mitk::TestFixture
{
CPPUNIT_TEST_SUITE(mitkBaseDataTestSuite);
MITK_TEST(CreateBaseData_Success);
MITK_TEST(InitializationOfBaseData_Success);
MITK_TEST(CreateCloneBaseData_Success);
MITK_TEST(InitializationOfCloneBaseData_Success);
MITK_TEST(GetAndSetTimeGeometry_Success);
MITK_TEST(ResetTimeGeometry_Success);
MITK_TEST(ReinitOfTimeGeometry_Success);
MITK_TEST(GetGeometryForSingleTimeGeometries_Failure);
MITK_TEST(TestingExpand_Success);
MITK_TEST(TestingGetUpdateGeometry_Success);
MITK_TEST(GetOriginOfBaseData_Success);
MITK_TEST(GetOriginOfCloneBaseData);
MITK_TEST(ClearATimeStep);
MITK_TEST(BaseDataSetAndGetProperty_Success);
MITK_TEST(CloneBaseDataSetAndGetProperty_Success);
MITK_TEST(BasePropertyListIsSet_Success);
MITK_TEST(BasePorpertyIsSetInPropertyList_Success);
MITK_TEST(UpdateOutputInformationOfBaseData_Failure);
MITK_TEST(CopyingInformationOfBaseData_Failure);
CPPUNIT_TEST_SUITE_END();
private:
mitk::BaseDataTestImplementation::Pointer m_BaseDataImpl;
mitk::BaseDataTestImplementation::Pointer m_CloneBaseData;
mitk::TimeGeometry *m_Geo;
mitk::ProportionalTimeGeometry::Pointer m_Geo2;
mitk::Geometry3D::Pointer m_Geometry3D;
mitk::BaseGeometry::Pointer m_Geo3;
mitk::ScalarType m_X[3];
mitk::PropertyList::Pointer m_PropertyList;
public:
void setUp() override
{
m_BaseDataImpl = mitk::BaseDataTestImplementation::New();
m_CloneBaseData = m_BaseDataImpl->Clone();
m_Geo = nullptr;
m_Geo2 = mitk::ProportionalTimeGeometry::New();
m_Geometry3D = mitk::Geometry3D::New();
m_Geo3 = dynamic_cast<mitk::BaseGeometry *>(m_Geometry3D.GetPointer());
m_X[0] = 2;
m_X[1] = 4;
m_X[2] = 6;
m_PropertyList = mitk::PropertyList::New();
}
void tearDown() override
{
m_BaseDataImpl = nullptr;
m_CloneBaseData = nullptr;
m_Geo = nullptr;
m_Geo2 = nullptr;
m_Geometry3D = nullptr;
m_Geo3 = nullptr;
m_X[0] = 0;
m_X[1] = 0;
m_X[2] = 0;
m_PropertyList = nullptr;
}
void CreateBaseData_Success()
{
// Create a BaseData implementation
MITK_INFO << "Creating a base data instance...";
CPPUNIT_ASSERT_MESSAGE("Testing instantiation", m_BaseDataImpl.IsNotNull());
}
void InitializationOfBaseData_Success()
{
CPPUNIT_ASSERT_MESSAGE("BaseDataTestImplementation is initialized", m_BaseDataImpl->IsInitialized());
CPPUNIT_ASSERT_MESSAGE("BaseDataTestImplementation is initialized and empty", m_BaseDataImpl->IsEmpty());
}
void CreateCloneBaseData_Success()
{
// Create CloneBaseData implementation
MITK_INFO << "Creating a clone base data instance...";
CPPUNIT_ASSERT_MESSAGE("Testing instantiation of base data clone", m_CloneBaseData.IsNotNull());
}
void InitializationOfCloneBaseData_Success()
{
CPPUNIT_ASSERT_MESSAGE("Clone of BaseDataTestImplementation is initialized", m_CloneBaseData->IsInitialized());
CPPUNIT_ASSERT_MESSAGE("Clone of BaseDataTestImplementation is initialized and empty", m_CloneBaseData->IsEmpty());
}
void GetAndSetTimeGeometry_Success()
{
// test method GetTimeGeometry()
MITK_INFO << "Testing setter and getter for geometries...";
CPPUNIT_ASSERT_MESSAGE("Testing creation of TimeGeometry", m_BaseDataImpl->GetTimeGeometry());
}
void ResetTimeGeometry_Success()
{
m_BaseDataImpl->SetTimeGeometry(m_Geo);
CPPUNIT_ASSERT_MESSAGE("Reset Geometry", m_BaseDataImpl->GetTimeGeometry() == nullptr);
}
void ReinitOfTimeGeometry_Success()
{
m_BaseDataImpl->SetTimeGeometry(m_Geo2);
m_Geo2->Initialize(2);
CPPUNIT_ASSERT_MESSAGE("Correct Reinit of TimeGeometry", m_BaseDataImpl->GetTimeGeometry() == m_Geo2.GetPointer());
}
void GetGeometryForSingleTimeGeometries_Failure()
{
// test method GetGeometry(int timeStep)
CPPUNIT_ASSERT_MESSAGE("Testing Creation of single TimeGeometries", m_BaseDataImpl->GetGeometry(1) == nullptr);
}
void TestingExpand_Success()
{
// test method Expand(unsigned int timeSteps)
m_BaseDataImpl->Expand(5);
CPPUNIT_ASSERT_MESSAGE("Expand the geometry to further time slices!", m_BaseDataImpl->GetTimeSteps() == 5);
}
void TestingGetUpdateGeometry_Success()
{
// test method GetUpdatedGeometry(int timeStep);
m_BaseDataImpl->Expand(5);
mitk::ProportionalTimeGeometry::Pointer timeGeometry =
dynamic_cast<mitk::ProportionalTimeGeometry *>(m_BaseDataImpl->GetTimeGeometry());
if (timeGeometry.IsNotNull())
{
timeGeometry->SetTimeStepGeometry(m_Geo3, 1);
}
CPPUNIT_ASSERT_MESSAGE("Set Geometry for time step 1", m_BaseDataImpl->GetUpdatedGeometry(1) == m_Geo3);
CPPUNIT_ASSERT_MESSAGE("Check if modified time is set", m_BaseDataImpl->GetMTime() != 0);
}
void GetOriginOfBaseData_Success()
{
m_BaseDataImpl->Expand(5);
m_BaseDataImpl->SetClonedGeometry(m_Geo3, 1);
mitk::Point3D p3d(m_X);
m_BaseDataImpl->SetOrigin(p3d);
m_Geo3->SetOrigin(p3d);
CPPUNIT_ASSERT_MESSAGE("Testing Origin set", m_BaseDataImpl->GetGeometry(1)->GetOrigin() == m_Geo3->GetOrigin());
}
void GetOriginOfCloneBaseData()
{
m_BaseDataImpl->Expand(5);
m_BaseDataImpl->SetClonedGeometry(m_Geo3, 1);
mitk::Point3D p3d(m_X);
m_BaseDataImpl->SetOrigin(p3d);
m_Geo3->SetOrigin(p3d);
m_CloneBaseData = m_BaseDataImpl->Clone();
CPPUNIT_ASSERT_MESSAGE("Testing origin set in clone!",
m_CloneBaseData->GetGeometry(1)->GetOrigin() == m_Geo3->GetOrigin());
}
void ClearATimeStep()
{
CPPUNIT_ASSERT_MESSAGE("Is not empty before clear()!", !m_BaseDataImpl->IsEmptyTimeStep(1));
m_BaseDataImpl->Clear();
CPPUNIT_ASSERT_MESSAGE("...but afterwards!", m_BaseDataImpl->IsEmptyTimeStep(1));
}
void BaseDataSetAndGetProperty_Success()
{
// test method Set-/GetProperty()
m_BaseDataImpl->SetProperty("property38", mitk::StringProperty::New("testproperty"));
CPPUNIT_ASSERT_MESSAGE("Check if base property is set correctly!",
m_BaseDataImpl->GetProperty("property38")->GetValueAsString() == "testproperty");
}
void CloneBaseDataSetAndGetProperty_Success()
{
m_BaseDataImpl->SetProperty("property38", mitk::StringProperty::New("testproperty"));
m_CloneBaseData = m_BaseDataImpl->Clone();
CPPUNIT_ASSERT_MESSAGE("Testing origin set in clone!",
m_CloneBaseData->GetProperty("property38")->GetValueAsString() == "testproperty");
}
void BasePropertyListIsSet_Success()
{
// test method Set-/GetPropertyList
m_PropertyList->SetFloatProperty("floatProperty1", 123.45);
m_PropertyList->SetBoolProperty("visibility", true);
m_PropertyList->SetStringProperty("nameXY", "propertyName");
m_BaseDataImpl->SetPropertyList(m_PropertyList);
CPPUNIT_ASSERT_MESSAGE("Check if base property list is set correctly!",
m_BaseDataImpl->GetPropertyList() == m_PropertyList);
}
void BasePorpertyIsSetInPropertyList_Success()
{
m_PropertyList->SetFloatProperty("floatProperty1", 123.45);
m_PropertyList->SetBoolProperty("visibility", true);
m_PropertyList->SetStringProperty("nameXY", "propertyName");
m_BaseDataImpl->SetPropertyList(m_PropertyList);
bool value = false;
CPPUNIT_ASSERT_MESSAGE("Check if base property is set correctly in the property list!",
m_BaseDataImpl->GetPropertyList()->GetBoolProperty("visibility", value) == true);
}
void UpdateOutputInformationOfBaseData_Failure()
{
// test method UpdateOutputInformation()
m_BaseDataImpl->UpdateOutputInformation();
m_Geo2->Initialize(2);
m_Geo2.GetPointer();
CPPUNIT_ASSERT_MESSAGE("TimeGeometry update!", m_BaseDataImpl->GetUpdatedTimeGeometry() != m_Geo2);
}
void CopyingInformationOfBaseData_Failure()
{
// Test method CopyInformation()
mitk::BaseDataTestImplementation::Pointer newBaseData = mitk::BaseDataTestImplementation::New();
newBaseData->CopyInformation(m_BaseDataImpl);
CPPUNIT_ASSERT_MESSAGE("Check copying of Basedata Data Object!",
newBaseData->GetTimeGeometry()->CountTimeSteps() != 5);
}
};
MITK_TEST_SUITE_REGISTRATION(mitkBaseData)
diff --git a/Modules/Core/test/mitkDispatcherTest.cpp b/Modules/Core/test/mitkDispatcherTest.cpp
index 87169dd319..3b622050d5 100644
--- a/Modules/Core/test/mitkDispatcherTest.cpp
+++ b/Modules/Core/test/mitkDispatcherTest.cpp
@@ -1,119 +1,203 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#include "itkLightObject.h"
+// Testing
+#include "mitkTestFixture.h"
+#include "mitkTestingMacros.h"
+// MITK includes
+#include <mitkCoreServices.h>
#include "mitkBaseRenderer.h"
#include "mitkDataInteractor.h"
#include "mitkDataNode.h"
#include "mitkDispatcher.h"
#include "mitkStandaloneDataStorage.h"
-#include "mitkTestingMacros.h"
#include "mitkVtkPropRenderer.h"
+// ITK includes
+#include "itkLightObject.h"
-int mitkDispatcherTest(int /*argc*/, char * /*argv*/ [])
+class mitkDispatcherTestSuite : public mitk::TestFixture
{
- MITK_TEST_BEGIN("Dispatcher")
+ CPPUNIT_TEST_SUITE(mitkDispatcherTestSuite);
+ MITK_TEST(DispatcherExists_Success);
+ MITK_TEST(AddInteractorConnectedToDataStorage_IncreaseNumberOfInteractors);
+ MITK_TEST(AddDataNodeToInteractor_NoIncreasedNumberOfInteractors);
+ MITK_TEST(AddInteractorNotConnectedToDataStorage_NoRegisteredInteractor);
+ MITK_TEST(ConnectInteractorToDataStorage_ReplaceInteractorEntry);
+ MITK_TEST(NewDataNodeAndInteractor_IncreasedNumberOfInteractors);
+ MITK_TEST(InteractorsPointToSameDataNode_DecreasedNumberOfInteractors);
+ MITK_TEST(SetDataNodeToNullptr_RemoveInteractor);
+ MITK_TEST(RemoveDataNode_RemoveInteractor);
+ MITK_TEST(GetReferenceCountDataNode_Success);
+ MITK_TEST(GetReferenceCountInteractors_Success);
+ CPPUNIT_TEST_SUITE_END();
+
+private:
+
+ vtkRenderWindow *m_RenWin;
+ mitk::VtkPropRenderer::Pointer m_Renderer;
+
+ mitk::StandaloneDataStorage::Pointer m_Ds;
+ mitk::DataNode::Pointer m_Dn;
+
+ mitk::DataNode::Pointer m_Dn2;
+ mitk::DataInteractor::Pointer m_Ei;
+ mitk::DataInteractor::Pointer m_Ei2;
+public:
/*
- * Tests the process of creating Interactors and assigning DataNodes to them.
- * Test checks if these Interactors are added to the Dispatcher under different conditions,
- * and in different call order.
- */
-
- // Here BindDispatcherInteractor and Dispatcher should be created automatically
- vtkRenderWindow *renWin = vtkRenderWindow::New();
- mitk::VtkPropRenderer::Pointer renderer =
- mitk::VtkPropRenderer::New("ContourRenderer", renWin);
-
- mitk::StandaloneDataStorage::Pointer ds = mitk::StandaloneDataStorage::New();
- mitk::DataNode::Pointer dn;
-
- dn = mitk::DataNode::New();
- mitk::DataNode::Pointer dn2 = mitk::DataNode::New();
- mitk::DataInteractor::Pointer ei = mitk::DataInteractor::New();
- mitk::DataInteractor::Pointer ei2 = mitk::DataInteractor::New();
-
- MITK_TEST_CONDITION_REQUIRED(renderer->GetDispatcher()->GetNumberOfInteractors() == 0,
- "01 Check Existence of Dispatcher.");
-
- ei->SetDataNode(dn);
- renderer->SetDataStorage(ds);
- ds->Add(dn);
-
- int num = renderer->GetDispatcher()->GetNumberOfInteractors();
- MITK_TEST_CONDITION_REQUIRED(num == 1, "02 Number of registered Interactors " << num << " , expected 1");
-
- // This _must not_ result in additionally registered interactors.
- ei->SetDataNode(dn);
- ei->SetDataNode(dn);
-
- num = renderer->GetDispatcher()->GetNumberOfInteractors();
- MITK_TEST_CONDITION_REQUIRED(num == 1, "03 Number of registered Interactors " << num << " , expected 1");
-
- // Switching the DataNode of an Interactor also must not result in extra registered Interactors in Dispatcher
- // since dn2 is not connected to DataStorage
- // ei will be dropped from dispatcher
- ei->SetDataNode(dn2);
-
- num = renderer->GetDispatcher()->GetNumberOfInteractors();
- MITK_TEST_CONDITION_REQUIRED(num == 0, "04 Number of registered Interactors " << num << " , expected 0");
-
- // DataNode Added to DataStorage, now Interactor entry in Dispatcher should be replaced,
- // hence we restore Interactor in the Dispatcher
- ds->Add(dn2);
-
- num = renderer->GetDispatcher()->GetNumberOfInteractors();
- MITK_TEST_CONDITION_REQUIRED(num == 1, "05 Number of registered Interactors " << num << " , expected 1");
-
- // New DataNode and new interactor, this should result in additional Interactor in the Dispatcher.
-
- ei2->SetDataNode(dn);
-
- num = renderer->GetDispatcher()->GetNumberOfInteractors();
- MITK_TEST_CONDITION_REQUIRED(num == 2, "06 Number of registered Interactors " << num << " , expected 2");
-
- // Here ei and ei2 point to the same dn2; dn2 now only points to ei2, so ei is abandoned,
- // therefore ei1 is expected to be removed
-
- ei2->SetDataNode(dn2);
- num = renderer->GetDispatcher()->GetNumberOfInteractors();
- MITK_TEST_CONDITION_REQUIRED(num == 1, "07 Number of registered Interactors " << num << " , expected 1");
-
- // Setting DataNode in Interactor to nullptr, should remove Interactor from Dispatcher
- ei2->SetDataNode(nullptr);
- num = renderer->GetDispatcher()->GetNumberOfInteractors();
- MITK_TEST_CONDITION_REQUIRED(num == 0, "08 Number of registered Interactors " << num << " , expected 0");
-
- // Add DN again check if it is registered
-
- ei2->SetDataNode(dn);
-
- num = renderer->GetDispatcher()->GetNumberOfInteractors();
- MITK_TEST_CONDITION_REQUIRED(num == 1, "09 Number of registered Interactors " << num << " , expected 1");
-
- // If DN is removed Interactors should be too
- ds->Remove(dn);
- num = renderer->GetDispatcher()->GetNumberOfInteractors();
- MITK_TEST_CONDITION_REQUIRED(num == 0, "10 Number of registered Interactors " << num << " , expected 0");
-
- // after DN is removed from DS its reference count must be back to one
-
- MITK_TEST_CONDITION_REQUIRED(dn->GetReferenceCount() == 1,
- "10 Number of references of DataNode " << num << " , expected 1");
-
- MITK_TEST_CONDITION_REQUIRED(ei->GetReferenceCount() == 1,
- "11 Number of references of Interactors " << num << " , expected 1");
-
- renWin->Delete();
- // always end with this!
- MITK_TEST_END()
-}
+ * Tests the process of creating Interactors and assigning DataNodes to them.
+ * Test checks if these Interactors are added to the Dispatcher under different conditions,
+ * and in different call order.
+ */
+
+ void setUp()
+ {
+ // Here BindDispatcherInteractor and Dispatcher should be created automatically
+ m_RenWin = vtkRenderWindow::New();
+ m_Renderer = mitk::VtkPropRenderer::New("ContourRenderer", m_RenWin);
+ m_Ds = mitk::StandaloneDataStorage::New();
+ m_Dn = mitk::DataNode::New();
+ m_Dn2 = mitk::DataNode::New();
+ m_Ei = mitk::DataInteractor::New();
+ m_Ei2 = mitk::DataInteractor::New();
+ m_Renderer->SetDataStorage(m_Ds);
+ }
+
+ void tearDown()
+ {
+ m_RenWin->Delete();
+ m_Renderer = nullptr;
+ m_Ds = nullptr;
+ m_Dn = nullptr;
+ m_Dn2 = nullptr;
+ m_Ei = nullptr;
+ m_Ei2 = nullptr;
+ }
+
+ void DispatcherExists_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("01 Check Existence of Dispatcher.",
+ m_Renderer->GetDispatcher()->GetNumberOfInteractors() == 0);
+ }
+
+ void AddInteractorConnectedToDataStorage_IncreaseNumberOfInteractors()
+ {
+ m_Ei->SetDataNode(m_Dn);
+ m_Ds->Add(m_Dn);
+
+ CPPUNIT_ASSERT_MESSAGE("02 Expected number of registered Interactors is 1",
+ m_Renderer->GetDispatcher()->GetNumberOfInteractors() == 1);
+ }
+
+ void AddDataNodeToInteractor_NoIncreasedNumberOfInteractors()
+ {
+ m_Ei->SetDataNode(m_Dn);
+ m_Renderer->SetDataStorage(m_Ds);
+ m_Ds->Add(m_Dn);
+ // This _must not_ result in additionally registered interactors.
+ m_Ei->SetDataNode(m_Dn);
+ CPPUNIT_ASSERT_MESSAGE("03 Expected number of registered Interactors is 1",
+ m_Renderer->GetDispatcher()->GetNumberOfInteractors() == 1);
+ }
+
+ void AddInteractorNotConnectedToDataStorage_NoRegisteredInteractor()
+ {
+ // Switching the DataNode of an Interactor also must not result in extra registered Interactors in Dispatcher
+ // since dn2 is not connected to DataStorage
+ m_Ei->SetDataNode(m_Dn2);
+
+ CPPUNIT_ASSERT_MESSAGE("04 Expected number of registered Interactors is 0",
+ m_Renderer->GetDispatcher()->GetNumberOfInteractors() == 0);
+ }
+
+ void ConnectInteractorToDataStorage_ReplaceInteractorEntry()
+ {
+ m_Ei->SetDataNode(m_Dn2);
+ // DataNode Added to DataStorage, now Interactor entry in Dispatcher should be replaced,
+ // hence we restore Interactor in the Dispatcher
+ m_Ds->Add(m_Dn2);
+
+ CPPUNIT_ASSERT_MESSAGE("05 Expected number of registered Interactors is 1",
+ m_Renderer->GetDispatcher()->GetNumberOfInteractors() == 1);
+ }
+
+ void NewDataNodeAndInteractor_IncreasedNumberOfInteractors()
+ {
+ m_Ei->SetDataNode(m_Dn2);
+ m_Ds->Add(m_Dn2);
+ m_Ds->Add(m_Dn);
+ // New DataNode and new interactor, this should result in additional Interactor in the Dispatcher.
+ m_Ei2->SetDataNode(m_Dn);
+
+ CPPUNIT_ASSERT_MESSAGE("06 Exprected number of registered Interactors is 2",
+ m_Renderer->GetDispatcher()->GetNumberOfInteractors() == 2);
+ }
+
+ void InteractorsPointToSameDataNode_DecreasedNumberOfInteractors()
+ {
+ m_Ds->Add(m_Dn2);
+ m_Ds->Add(m_Dn);
+ m_Ei->SetDataNode(m_Dn2);
+ m_Ei2->SetDataNode(m_Dn);
+ // Here ei and ei2 point to the same dn2; dn2 now only points to ei2, so ei is abandoned,
+ // therefore ei1 is expected to be removed
+
+ m_Ei2->SetDataNode(m_Dn2);
+ CPPUNIT_ASSERT_MESSAGE("07 Expected number of registered Interactors is 1",
+ m_Renderer->GetDispatcher()->GetNumberOfInteractors() == 1);
+ }
+
+ void SetDataNodeToNullptr_RemoveInteractor()
+ {
+ m_Ds->Add(m_Dn2);
+ m_Ei2->SetDataNode(m_Dn2);
+ // Setting DataNode in Interactor to nullptr, should remove Interactor from Dispatcher
+ m_Ei2->SetDataNode(nullptr);
+ CPPUNIT_ASSERT_MESSAGE("08 Expected number of registered Interactors is 0",
+ m_Renderer->GetDispatcher()->GetNumberOfInteractors() == 0);
+ }
+
+ void RemoveDataNode_RemoveInteractor()
+ {
+ // Add DN again check if it is registered
+ m_Ds->Add(m_Dn);
+ m_Ei2->SetDataNode(m_Dn);
+
+ CPPUNIT_ASSERT_MESSAGE("09 Expected number of registered Interactors is 1",
+ m_Renderer->GetDispatcher()->GetNumberOfInteractors() == 1);
+
+ // If DN is removed Interactors should be too
+ m_Ds->Remove(m_Dn);
+ CPPUNIT_ASSERT_MESSAGE("10 ExpectedNumber of registered Interactors is 0",
+ m_Renderer->GetDispatcher()->GetNumberOfInteractors() == 0);
+ }
+
+ void GetReferenceCountDataNode_Success()
+ {
+ m_Ds->Add(m_Dn);
+ m_Ei2->SetDataNode(m_Dn);
+ m_Ds->Remove(m_Dn);
+ // after DN is removed from DS its reference count must be back to one
+ CPPUNIT_ASSERT_MESSAGE("11 Expected number of references of DataNode is 1",
+ m_Dn->GetReferenceCount() == 1);
+ }
+
+ void GetReferenceCountInteractors_Success()
+ {
+ m_Ei->SetDataNode(m_Dn2);
+ m_Ds->Add(m_Dn2);
+ m_Ei2->SetDataNode(m_Dn2);
+ CPPUNIT_ASSERT_MESSAGE("12 Expected number of references of Interactors is 1",
+ m_Ei->GetReferenceCount() == 1);
+ }
+};
+MITK_TEST_SUITE_REGISTRATION(mitkDispatcher)
diff --git a/Modules/Core/test/mitkImageGeneratorTest.cpp b/Modules/Core/test/mitkImageGeneratorTest.cpp
index aeaed85d9a..8dfd22dea4 100644
--- a/Modules/Core/test/mitkImageGeneratorTest.cpp
+++ b/Modules/Core/test/mitkImageGeneratorTest.cpp
@@ -1,126 +1,327 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+// Testing
+#include "mitkTestFixture.h"
+#include <mitkTestingMacros.h>
+// MITK includes
+#include <mitkCoreServices.h>
#include "mitkImage.h"
#include "mitkImageGenerator.h"
#include "mitkImageReadAccessor.h"
#include "mitkImageStatisticsHolder.h"
-#include <mitkTestingMacros.h>
-int mitkImageGeneratorTest(int /*argc*/, char * /*argv*/ [])
+class mitkImageGeneratorTestSuite : public mitk::TestFixture
{
- MITK_TEST_BEGIN("ImageGeneratorTest");
+ CPPUNIT_TEST_SUITE(mitkImageGeneratorTestSuite);
+ MITK_TEST(SetSpacingX2D_Success);
+ MITK_TEST(SetDefaultSpacingX2D_Success);
+ MITK_TEST(SetSpacingX3D_Success);
+ MITK_TEST(SetSpacingY2D_Success);
+ MITK_TEST(SetDefaultSpacingY2D_Success);
+ MITK_TEST(SetSpacingY3D_Success);
+ MITK_TEST(SetSpacingZ2D_Success);
+ MITK_TEST(SetDefaultSpacingZ2D_Success);
+ MITK_TEST(SetSpacingZ3D_Success);
+ MITK_TEST(SetDimension2D_Success);
+ MITK_TEST(SetDimension3D_Success);
+ MITK_TEST(SetDimension4D_Success);
+ MITK_TEST(SetDimensionX2D_Success);
+ MITK_TEST(SetDimensionY2D_Success);
+ MITK_TEST(SetDimensionZ3D_Success);
+ MITK_TEST(SetDimensionT4D_Success);
+ MITK_TEST(SetDimensions3Dc_Success);
+ MITK_TEST(SetDataTypeFloat2D_Success);
+ MITK_TEST(SetDataTypeUChar2D_Success);
+ MITK_TEST(SetDataTypeInt3D_Success);
+ MITK_TEST(SetDataTypeDouble3D_Success);
+ MITK_TEST(SetDataTypeFloat4D_Success);
+ MITK_TEST(SetDataTypeUChar4D_Success);
+ MITK_TEST(SetDataTypeUInt3D_Success);
+ MITK_TEST(SetPixelTypeFloat2D_Success);
+ MITK_TEST(SetPixelTypeUChar2D_Success);
+ MITK_TEST(SetPixelTypeInt3D_Success);
+ MITK_TEST(SetPixelTypeDouble3D_Success);
+ MITK_TEST(SetPixelTypeFloat4D_Success);
+ MITK_TEST(SetPixelTypeUChar4D_Success);
+ MITK_TEST(SetPixelTypeUInt3D_Success);
+ MITK_TEST(MaxValueHolds_Success);
+ MITK_TEST(MinValueHolds_Success);
+ MITK_TEST(DefaultMaxValueHolds_Success);
+ MITK_TEST(DefaultMinValueHolds_Success);
+ MITK_TEST(SetGradientImageValues_Success);
+ CPPUNIT_TEST_SUITE_END();
+private:
// create some images with arbitrary parameters (corner cases)
- mitk::Image::Pointer image2Da =
- mitk::ImageGenerator::GenerateRandomImage<float>(120, 205, 0, 0, 0.1, 0.2, 0.3, 577, 23);
- mitk::Image::Pointer image2Db = mitk::ImageGenerator::GenerateRandomImage<unsigned char>(1, 1, 0, 0);
- mitk::Image::Pointer image3Da = mitk::ImageGenerator::GenerateRandomImage<int>(512, 205, 1, 0);
- mitk::Image::Pointer image3Db = mitk::ImageGenerator::GenerateRandomImage<double>(512, 532, 112, 0);
- mitk::Image::Pointer image4Da = mitk::ImageGenerator::GenerateRandomImage<float>(120, 205, 78, 1);
- mitk::Image::Pointer image4Db = mitk::ImageGenerator::GenerateRandomImage<unsigned char>(550, 33, 78, 150);
-
- mitk::Image::Pointer image3Dc = mitk::ImageGenerator::GenerateGradientImage<unsigned int>(1, 2, 3, 4, 5, 6);
-
- MITK_TEST_CONDITION_REQUIRED(fabs(image2Da->GetGeometry()->GetSpacing()[0] - 0.1) < 0.0001,
- "Testing if spacing x is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(fabs(image2Da->GetGeometry()->GetSpacing()[1] - 0.2) < 0.0001,
- "Testing if spacing y is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(fabs(image2Da->GetGeometry()->GetSpacing()[2] - 0.3) < 0.0001,
- "Testing if spacing z is set correctly.");
-
- MITK_TEST_CONDITION_REQUIRED(fabs(image2Db->GetGeometry()->GetSpacing()[0] - 1.0) < 0.0001,
- "Testing if default spacing x is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(fabs(image2Db->GetGeometry()->GetSpacing()[1] - 1.0) < 0.0001,
- "Testing if default spacing y is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(fabs(image2Db->GetGeometry()->GetSpacing()[2] - 1.0) < 0.0001,
- "Testing if default spacing z is set correctly.");
-
- MITK_TEST_CONDITION_REQUIRED(fabs(image3Dc->GetGeometry()->GetSpacing()[0] - 4) < 0.0001,
- "Testing if spacing x is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(fabs(image3Dc->GetGeometry()->GetSpacing()[1] - 5) < 0.0001,
- "Testing if spacing y is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(fabs(image3Dc->GetGeometry()->GetSpacing()[2] - 6) < 0.0001,
- "Testing if spacing z is set correctly.");
-
- MITK_TEST_CONDITION_REQUIRED(image2Da->GetDimension() == 2, "Testing if the dimension is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image2Db->GetDimension() == 2, "Testing if the dimension is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image3Da->GetDimension() == 2, "Testing if the dimension is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image3Db->GetDimension() == 3, "Testing if the dimension is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image4Da->GetDimension() == 3, "Testing if the dimension is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image4Db->GetDimension() == 4, "Testing if the dimension is set correctly.");
-
- MITK_TEST_CONDITION_REQUIRED(image2Da->GetDimension(0) == 120, "Testing if the dimensions are set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image2Db->GetDimension(1) == 1, "Testing if the dimensions are set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image3Da->GetDimension(2) == 1, "Testing if the dimensions are set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image3Db->GetDimension(2) == 112, "Testing if the dimensions are set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image4Da->GetDimension(3) == 1, "Testing if the dimensions are set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image4Db->GetDimension(3) == 150, "Testing if the dimensions are set correctly.");
-
- MITK_TEST_CONDITION_REQUIRED(image3Dc->GetDimension(0) == 1, "Testing if image3Dc dimension x is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image3Dc->GetDimension(1) == 2, "Testing if image3Dc dimension y is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image3Dc->GetDimension(2) == 3, "Testing if image3Dc dimension z is set correctly.");
-
- itk::ImageIOBase::IOPixelType scalarType = itk::ImageIOBase::SCALAR;
-
- MITK_TEST_CONDITION_REQUIRED(image2Da->GetPixelType().GetComponentType() == itk::ImageIOBase::FLOAT,
- "Testing if the data type is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image2Da->GetPixelType().GetPixelType() == scalarType,
- "Testing if the pixel type is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image2Db->GetPixelType().GetComponentType() == itk::ImageIOBase::UCHAR,
- "Testing if the data type is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image2Db->GetPixelType().GetPixelType() == scalarType,
- "Testing if the data type is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image3Da->GetPixelType().GetComponentType() == itk::ImageIOBase::INT,
- "Testing if the data type is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image3Da->GetPixelType().GetPixelType() == scalarType,
- "Testing if the pixel type is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image3Db->GetPixelType().GetComponentType() == itk::ImageIOBase::DOUBLE,
- "Testing if the data type is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image3Db->GetPixelType().GetPixelType() == scalarType,
- "Testing if the pixel type is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image4Da->GetPixelType().GetComponentType() == itk::ImageIOBase::FLOAT,
- "Testing if the data type is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image4Da->GetPixelType().GetPixelType() == scalarType,
- "Testing if the pixel type is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image4Db->GetPixelType().GetComponentType() == itk::ImageIOBase::UCHAR,
- "Testing if the data type is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image4Db->GetPixelType().GetPixelType() == scalarType,
- "Testing if the pixel type is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image3Dc->GetPixelType().GetComponentType() == itk::ImageIOBase::UINT,
- "Testing if the data type is set correctly.");
- MITK_TEST_CONDITION_REQUIRED(image3Dc->GetPixelType().GetPixelType() == scalarType,
- "Testing if the pixel type is set correctly.");
-
- MITK_TEST_CONDITION_REQUIRED(image2Da->GetStatistics()->GetScalarValueMax() <= 577, "Testing if max value holds");
- MITK_TEST_CONDITION_REQUIRED(image2Da->GetStatistics()->GetScalarValueMin() >= 23, "Testing if min value holds");
-
- MITK_TEST_CONDITION_REQUIRED(image3Da->GetStatistics()->GetScalarValueMax() <= 1000, "Testing if max value holds");
- MITK_TEST_CONDITION_REQUIRED(image3Da->GetStatistics()->GetScalarValueMin() >= 0, "Testing if min value holds");
-
- const unsigned int *image3DcBuffer = nullptr;
- try
- {
- mitk::ImageReadAccessor readAccess(image3Dc);
- image3DcBuffer = static_cast<const unsigned int *>(readAccess.GetData());
- }
- catch (...)
- {
- MITK_ERROR << "Read access not granted on mitk::Image.";
- }
- for (unsigned int i = 0; i < 2 * 3; i++)
- {
- MITK_TEST_CONDITION_REQUIRED(image3DcBuffer[i] == i, "Testing if gradient image values are set correctly");
- }
-
- MITK_TEST_END();
-}
+ mitk::Image::Pointer m_Image2Da;
+ mitk::Image::Pointer m_Image2Db;
+ mitk::Image::Pointer m_Image3Da;
+ mitk::Image::Pointer m_Image3Db;
+ mitk::Image::Pointer m_Image4Da;
+ mitk::Image::Pointer m_Image4Db;
+ mitk::Image::Pointer m_Image3Dc;
+
+public:
+ void setUp()
+ {
+ m_Image2Da = mitk::ImageGenerator::GenerateRandomImage<float>(120, 205, 0, 0, 0.1, 0.2, 0.3, 577, 23);
+ m_Image2Db = mitk::ImageGenerator::GenerateRandomImage<unsigned char>(1, 1, 0, 0);
+ m_Image3Da = mitk::ImageGenerator::GenerateRandomImage<int>(512, 205, 1, 0);
+ m_Image3Db = mitk::ImageGenerator::GenerateRandomImage<double>(512, 532, 112, 0);
+ m_Image4Da = mitk::ImageGenerator::GenerateRandomImage<float>(120, 205, 78, 1);
+ m_Image4Db = mitk::ImageGenerator::GenerateRandomImage<unsigned char>(550, 33, 78, 150);
+ m_Image3Dc = mitk::ImageGenerator::GenerateGradientImage<unsigned int>(1, 2, 3, 4, 5, 6);
+ }
+ void tearDown()
+ {
+ m_Image2Da = nullptr;
+ m_Image2Db = nullptr;
+ m_Image3Da = nullptr;
+ m_Image3Db = nullptr;
+ m_Image4Da = nullptr;
+ m_Image4Db = nullptr;
+ m_Image3Dc = nullptr;
+ }
+
+ void SetSpacingX2D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if spacing 2D x is set correctly.",
+ fabs(m_Image2Da->GetGeometry()->GetSpacing()[0] - 0.1) < 0.0001);
+ }
+
+ void SetDefaultSpacingX2D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if default spacing 2D x is set correctly.",
+ fabs(m_Image2Db->GetGeometry()->GetSpacing()[0] - 1.0) < 0.0001);
+ }
+
+ void SetSpacingX3D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if spacing 3D x is set correctly.",
+ fabs(m_Image3Dc->GetGeometry()->GetSpacing()[0] - 4) < 0.0001);
+ }
+
+ void SetSpacingY2D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if spacing 2D y is set correctly.",
+ fabs(m_Image2Da->GetGeometry()->GetSpacing()[1] - 0.2) < 0.0001);
+ }
+
+ void SetDefaultSpacingY2D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if default spacing 2D y is set correctly.",
+ fabs(m_Image2Db->GetGeometry()->GetSpacing()[1] - 1.0) < 0.0001);
+ }
+
+ void SetSpacingY3D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if spacing 3D y is set correctly.",
+ fabs(m_Image3Dc->GetGeometry()->GetSpacing()[1] - 5) < 0.0001);
+ }
+
+ void SetSpacingZ2D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if spacing 2D z is set correctly.",
+ fabs(m_Image2Da->GetGeometry()->GetSpacing()[2] - 0.3) < 0.0001);
+ }
+
+ void SetDefaultSpacingZ2D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if default spacing 2D z is set correctly.",
+ fabs(m_Image2Db->GetGeometry()->GetSpacing()[2] - 1.0) < 0.0001);
+ }
+
+ void SetSpacingZ3D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if spacing z is set correctly.",
+ fabs(m_Image3Dc->GetGeometry()->GetSpacing()[2] - 6) < 0.0001);
+ }
+
+ void SetDimension2D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if the dimension 2D is set correctly.", m_Image2Da->GetDimension() == 2);
+ CPPUNIT_ASSERT_MESSAGE("Testing if the dimension 2D is set correctly.", m_Image2Db->GetDimension() == 2);
+ }
+
+ void SetDimension3D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if the dimension 3D is set correctly.",m_Image3Da->GetDimension() == 2);
+ CPPUNIT_ASSERT_MESSAGE("Testing if the dimension 3D is set correctly.", m_Image3Db->GetDimension() == 3);
+ }
+
+ void SetDimension4D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if the dimension 4D is set correctly.", m_Image4Da->GetDimension() == 3);
+ CPPUNIT_ASSERT_MESSAGE("Testing if the dimension 4D is set correctly.", m_Image4Db->GetDimension() == 4);
+ }
+
+ void SetDimensionX2D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if the X dimension of the 2D image is set correctly.", m_Image2Da->GetDimension(0) == 120);
+ }
+
+ void SetDimensionY2D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if the Y dimension of the 2D image is set correctly.", m_Image2Db->GetDimension(1) == 1);
+ }
+
+ void SetDimensionZ3D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if the Z dimension of the 3D image is set correctly.", m_Image3Da->GetDimension(2) == 1);
+ CPPUNIT_ASSERT_MESSAGE("Testing if the Z dimension of the 3D image is set correctly.", m_Image3Db->GetDimension(2) == 112);
+ }
+
+ void SetDimensionT4D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if the T dimension of the 4D image is set correctly.", m_Image4Da->GetDimension(3) == 1);
+ CPPUNIT_ASSERT_MESSAGE("Testing if the T dimension of the 4D image is set correctly.", m_Image4Db->GetDimension(3) == 150);
+ }
+
+ void SetDimensions3Dc_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if image3Dc dimension x is set correctly.", m_Image3Dc->GetDimension(0) == 1);
+ CPPUNIT_ASSERT_MESSAGE("Testing if image3Dc dimension y is set correctly.", m_Image3Dc->GetDimension(1) == 2);
+ CPPUNIT_ASSERT_MESSAGE("Testing if image3Dc dimension z is set correctly.", m_Image3Dc->GetDimension(2) == 3);
+ }
+
+ void SetDataTypeFloat2D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if the data type for a float 3D image is set correctly.",
+ m_Image2Da->GetPixelType().GetComponentType() == itk::ImageIOBase::FLOAT);
+ }
+
+ void SetDataTypeUChar2D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if the data type for a UChar 2D image is set correctly.",
+ m_Image2Db->GetPixelType().GetComponentType() == itk::ImageIOBase::UCHAR);
+ }
+
+ void SetDataTypeInt3D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if the data type for a Int 3D image is set correctly.",
+ m_Image3Da->GetPixelType().GetComponentType() == itk::ImageIOBase::INT);
+ }
+
+ void SetDataTypeDouble3D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if the data type for a Double 3D image is set correctly.",
+ m_Image3Db->GetPixelType().GetComponentType() == itk::ImageIOBase::DOUBLE);
+ }
+
+ void SetDataTypeFloat4D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if the data type for a Float 4D image is set correctly.",
+ m_Image4Da->GetPixelType().GetComponentType() == itk::ImageIOBase::FLOAT);
+ }
+
+ void SetDataTypeUChar4D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if the data type for a UChar 4D image is set correctly.",
+ m_Image4Db->GetPixelType().GetComponentType() == itk::ImageIOBase::UCHAR);
+ }
+
+ void SetDataTypeUInt3D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if the data type for a UInt 3D image is set correctly.",
+ m_Image3Dc->GetPixelType().GetComponentType() == itk::ImageIOBase::UINT);
+ }
+
+ void SetPixelTypeFloat2D_Success()
+ {
+ itk::ImageIOBase::IOPixelType scalarType = itk::ImageIOBase::SCALAR;
+ CPPUNIT_ASSERT_MESSAGE("Testing if the pixel type for a Float 2D image is set correctly.",
+ m_Image2Da->GetPixelType().GetPixelType() == scalarType);
+ }
+
+ void SetPixelTypeUChar2D_Success()
+ {
+ itk::ImageIOBase::IOPixelType scalarType = itk::ImageIOBase::SCALAR;
+ CPPUNIT_ASSERT_MESSAGE("Testing if the pixel type for a UChar 2D image is set correctly.",
+ m_Image2Db->GetPixelType().GetPixelType() == scalarType);
+ }
+
+ void SetPixelTypeInt3D_Success()
+ {
+ itk::ImageIOBase::IOPixelType scalarType = itk::ImageIOBase::SCALAR;
+ CPPUNIT_ASSERT_MESSAGE("Testing if the pixel type for a Int 3D image is set correctly.",
+ m_Image3Da->GetPixelType().GetPixelType() == scalarType);
+ }
+
+ void SetPixelTypeDouble3D_Success()
+ {
+ itk::ImageIOBase::IOPixelType scalarType = itk::ImageIOBase::SCALAR;
+ CPPUNIT_ASSERT_MESSAGE("Testing if the pixel type for a Double 3D image is set correctly.",
+ m_Image3Db->GetPixelType().GetPixelType() == scalarType);
+ }
+
+ void SetPixelTypeFloat4D_Success()
+ {
+ itk::ImageIOBase::IOPixelType scalarType = itk::ImageIOBase::SCALAR;
+ CPPUNIT_ASSERT_MESSAGE("Testing if the pixel type for a Float 4D image is set correctly.",
+ m_Image4Da->GetPixelType().GetPixelType() == scalarType);
+ }
+
+ void SetPixelTypeUChar4D_Success()
+ {
+ itk::ImageIOBase::IOPixelType scalarType = itk::ImageIOBase::SCALAR;
+ CPPUNIT_ASSERT_MESSAGE("Testing if the pixel type for a UChar 4D image is set correctly.",
+ m_Image4Db->GetPixelType().GetPixelType() == scalarType);
+ }
+
+ void SetPixelTypeUInt3D_Success()
+ {
+ itk::ImageIOBase::IOPixelType scalarType = itk::ImageIOBase::SCALAR;
+ CPPUNIT_ASSERT_MESSAGE("Testing if the pixel type for a UInt 3D image is set correctly.",
+ m_Image3Dc->GetPixelType().GetPixelType() == scalarType);
+ }
+
+ void MaxValueHolds_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if max value holds", m_Image2Da->GetStatistics()->GetScalarValueMax() <= 577);
+ }
+
+ void MinValueHolds_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if min value holds", m_Image2Da->GetStatistics()->GetScalarValueMin() >= 23);
+ }
+
+ void DefaultMaxValueHolds_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if default max value holds", m_Image3Da->GetStatistics()->GetScalarValueMax() <= 1000);
+ }
+
+ void DefaultMinValueHolds_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if default min value holds", m_Image3Da->GetStatistics()->GetScalarValueMin() >= 0);
+ }
+
+ void SetGradientImageValues_Success()
+ {
+ const unsigned int *image3DcBuffer = nullptr;
+ try
+ {
+ mitk::ImageReadAccessor readAccess(m_Image3Dc);
+ image3DcBuffer = static_cast<const unsigned int *>(readAccess.GetData());
+ }
+ catch (...)
+ {
+ MITK_ERROR << "Read access not granted on mitk::Image.";
+ }
+ for (unsigned int i = 0; i < 2 * 3; i++)
+ {
+ CPPUNIT_ASSERT_MESSAGE("Testing if gradient image values are set correctly", image3DcBuffer[i] == i);
+ }
+ }
+};
+MITK_TEST_SUITE_REGISTRATION(mitkImageGenerator)
+
diff --git a/Modules/Core/test/mitkInteractionEventTest.cpp b/Modules/Core/test/mitkInteractionEventTest.cpp
index a042082ce0..ce740a3a7e 100644
--- a/Modules/Core/test/mitkInteractionEventTest.cpp
+++ b/Modules/Core/test/mitkInteractionEventTest.cpp
@@ -1,89 +1,116 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+// Testing
+#include "mitkTestFixture.h"
+#include "mitkTestingMacros.h"
+// MITK includes
+#include <mitkCoreServices.h>
#include "mitkInteractionEventConst.h"
#include "mitkMouseMoveEvent.h"
#include "mitkMousePressEvent.h"
#include "mitkMouseReleaseEvent.h"
-#include "mitkTestingMacros.h"
+// VTK includes
#include "mitkVtkPropRenderer.h"
-int mitkInteractionEventTest(int /*argc*/, char * /*argv*/ [])
+class mitkInteractionEventTestSuite : public mitk::TestFixture
{
- /*
- * Create different Events, fill them with data.
- * And check if isEqual method is implemented properly.
- */
- MITK_TEST_BEGIN("InteractionEvent")
-
- mitk::VtkPropRenderer::Pointer renderer = nullptr;
-
- mitk::InteractionEvent::MouseButtons buttonStates =
- mitk::InteractionEvent::LeftMouseButton | mitk::InteractionEvent::RightMouseButton;
- mitk::InteractionEvent::MouseButtons eventButton = mitk::InteractionEvent::LeftMouseButton;
- mitk::InteractionEvent::ModifierKeys modifiers = mitk::InteractionEvent::ControlKey | mitk::InteractionEvent::AltKey;
-
- mitk::Point2D point;
- point[0] = 17;
- point[1] = 170;
-
- mitk::Point3D worldPos;
- worldPos[0] = 0.5;
- worldPos[1] = 10.609;
- worldPos[2] = 5.0;
-
- // MousePress Events
- mitk::MousePressEvent::Pointer me1 =
- mitk::MousePressEvent::New(renderer, point, buttonStates, modifiers, eventButton);
- mitk::MousePressEvent::Pointer me2 =
- mitk::MousePressEvent::New(renderer, point, buttonStates, modifiers, eventButton);
- point[0] = 178;
- point[1] = 170;
- mitk::MousePressEvent::Pointer me3 =
- mitk::MousePressEvent::New(renderer, point, buttonStates, modifiers, eventButton);
- modifiers = mitk::InteractionEvent::ControlKey;
- mitk::MousePressEvent::Pointer me4 =
- mitk::MousePressEvent::New(renderer, point, buttonStates, modifiers, eventButton);
-
- MITK_TEST_CONDITION_REQUIRED(*me1 == *me2 && *me1 == *me3 && *me2 == *me3 && *me3 != *me4,
- "Checking isEqual and Constructors of mitk::InteractionEvent, mitk::MousePressEvent");
-
- // MouseReleaseEvents
- mitk::MouseReleaseEvent::Pointer mr1 =
- mitk::MouseReleaseEvent::New(renderer, point, buttonStates, modifiers, eventButton);
- mitk::MouseReleaseEvent::Pointer mr2 =
- mitk::MouseReleaseEvent::New(renderer, point, buttonStates, modifiers, eventButton);
- point[0] = 178;
- point[1] = 170;
- mitk::MouseReleaseEvent::Pointer mr3 =
- mitk::MouseReleaseEvent::New(renderer, point, buttonStates, modifiers, eventButton);
- eventButton = mitk::InteractionEvent::RightMouseButton;
- mitk::MouseReleaseEvent::Pointer mr4 =
- mitk::MouseReleaseEvent::New(renderer, point, buttonStates, modifiers, eventButton);
-
- MITK_TEST_CONDITION_REQUIRED(*mr1 == *mr2 && *mr1 == *mr3 && *mr2 == *mr3 && *mr3 != *mr4,
- "Checking isEqual and Constructors of mitk::InteractionEvent, mitk::MouseReleaseEvent");
-
- // MouseMoveEvents
- mitk::MouseMoveEvent::Pointer mm1 = mitk::MouseMoveEvent::New(renderer, point, buttonStates, modifiers);
- point[0] = 178;
- point[1] = 170;
- mitk::MouseMoveEvent::Pointer mm3 = mitk::MouseMoveEvent::New(renderer, point, buttonStates, modifiers);
- modifiers = mitk::InteractionEvent::AltKey;
- mitk::MouseMoveEvent::Pointer mm4 = mitk::MouseMoveEvent::New(renderer, point, buttonStates, modifiers);
-
- MITK_TEST_CONDITION_REQUIRED(*mm1 == *mm3 && *mm3 != *mm4,
- "Checking isEqual and Constructors of mitk::InteractionEvent, mitk::MouseMoveEvent");
-
- // always end with this!
- MITK_TEST_END()
-}
+ CPPUNIT_TEST_SUITE(mitkInteractionEventTestSuite);
+ MITK_TEST(MousePressEvent_Success);
+ MITK_TEST(MouseReleaseEvent_Success);
+ MITK_TEST(MouseMoveEvent_Success);
+ CPPUNIT_TEST_SUITE_END();
+
+private:
+ mitk::VtkPropRenderer::Pointer m_Renderer;
+
+ mitk::InteractionEvent::MouseButtons m_ButtonStates;
+ mitk::InteractionEvent::MouseButtons m_EventButton;
+ mitk::InteractionEvent::ModifierKeys m_Modifiers;
+
+ mitk::Point2D m_Point;
+
+ mitk::Point3D m_WorldPos;
+
+public:
+ void setUp()
+ {
+ m_Renderer = nullptr;
+ m_ButtonStates = mitk::InteractionEvent::LeftMouseButton | mitk::InteractionEvent::RightMouseButton;
+ m_EventButton = mitk::InteractionEvent::LeftMouseButton;
+ m_Modifiers = mitk::InteractionEvent::ControlKey | mitk::InteractionEvent::AltKey;
+
+ m_Point[0] = 17;
+ m_Point[1] = 170;
+
+ m_WorldPos[0] = 0.5;
+ m_WorldPos[1] = 10.609;
+ m_WorldPos[2] = 5.0;
+ }
+ void tearDown()
+ {
+ }
+
+ void MousePressEvent_Success()
+ {
+ // MousePress Events
+ mitk::MousePressEvent::Pointer me1 =
+ mitk::MousePressEvent::New(m_Renderer, m_Point, m_ButtonStates, m_Modifiers, m_EventButton);
+ mitk::MousePressEvent::Pointer me2 =
+ mitk::MousePressEvent::New(m_Renderer, m_Point, m_ButtonStates, m_Modifiers, m_EventButton);
+ m_Point[0] = 178;
+ m_Point[1] = 170;
+ mitk::MousePressEvent::Pointer me3 =
+ mitk::MousePressEvent::New(m_Renderer, m_Point, m_ButtonStates, m_Modifiers, m_EventButton);
+ m_Modifiers = mitk::InteractionEvent::ControlKey;
+ mitk::MousePressEvent::Pointer me4 =
+ mitk::MousePressEvent::New(m_Renderer, m_Point, m_ButtonStates, m_Modifiers, m_EventButton);
+
+ CPPUNIT_ASSERT_MESSAGE("Checking isEqual and Constructors of mitk::InteractionEvent, mitk::MousePressEvent",
+ *me1 == *me2 && *me1 == *me3 && *me2 == *me3 && *me3 != *me4);
+ }
+
+ void MouseReleaseEvent_Success()
+ {
+ // MouseReleaseEvents
+ mitk::MouseReleaseEvent::Pointer mr1 =
+ mitk::MouseReleaseEvent::New(m_Renderer, m_Point, m_ButtonStates, m_Modifiers, m_EventButton);
+ mitk::MouseReleaseEvent::Pointer mr2 =
+ mitk::MouseReleaseEvent::New(m_Renderer, m_Point, m_ButtonStates, m_Modifiers, m_EventButton);
+ m_Point[0] = 178;
+ m_Point[1] = 170;
+ mitk::MouseReleaseEvent::Pointer mr3 =
+ mitk::MouseReleaseEvent::New(m_Renderer, m_Point, m_ButtonStates, m_Modifiers, m_EventButton);
+ m_EventButton = mitk::InteractionEvent::RightMouseButton;
+ mitk::MouseReleaseEvent::Pointer mr4 =
+ mitk::MouseReleaseEvent::New(m_Renderer, m_Point, m_ButtonStates, m_Modifiers, m_EventButton);
+
+ CPPUNIT_ASSERT_MESSAGE("Checking isEqual and Constructors of mitk::InteractionEvent, mitk::MouseReleaseEvent",
+ *mr1 == *mr2 && *mr1 == *mr3 && *mr2 == *mr3 && *mr3 != *mr4);
+ }
+
+ void MouseMoveEvent_Success()
+ {
+ // MouseMoveEvents
+ mitk::MouseMoveEvent::Pointer mm1 = mitk::MouseMoveEvent::New(m_Renderer, m_Point, m_ButtonStates, m_Modifiers);
+ m_Point[0] = 178;
+ m_Point[1] = 170;
+ mitk::MouseMoveEvent::Pointer mm3 = mitk::MouseMoveEvent::New(m_Renderer, m_Point, m_ButtonStates, m_Modifiers);
+ m_Modifiers = mitk::InteractionEvent::AltKey;
+ mitk::MouseMoveEvent::Pointer mm4 = mitk::MouseMoveEvent::New(m_Renderer, m_Point, m_ButtonStates, m_Modifiers);
+
+ CPPUNIT_ASSERT_MESSAGE("Checking isEqual and Constructors of mitk::InteractionEvent, mitk::MouseMoveEvent",
+ *mm1 == *mm3 && *mm3 != *mm4);
+ }
+
+};
+MITK_TEST_SUITE_REGISTRATION(mitkInteractionEvent)
diff --git a/Modules/Core/test/mitkPixelTypeTest.cpp b/Modules/Core/test/mitkPixelTypeTest.cpp
index a5596f9451..0df8ef5104 100644
--- a/Modules/Core/test/mitkPixelTypeTest.cpp
+++ b/Modules/Core/test/mitkPixelTypeTest.cpp
@@ -1,150 +1,241 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#include "mitkPixelType.h"
+// Testing
+#include "mitkTestFixture.h"
#include "mitkTestingMacros.h"
-#include <itkImage.h>
+// std includes
+#include <string>
+// MITK includes
+#include "mitkPixelType.h"
#include <mitkLogMacros.h>
-
+// ITK includes
+#include "itkImage.h"
#include <itkVectorImage.h>
+// VTK includes
+#include <vtkDebugLeaks.h>
struct MyObscurePixelType
{
typedef float ValueType;
static const size_t Length = 2;
};
//## Documentation
//## main testing method
-int mitkPixelTypeTest(int /*argc*/, char * /*argv*/ [])
+class mitkPixelTypeTestSuite : public mitk::TestFixture
{
- MITK_TEST_BEGIN("PixelTypeTest");
-
- MITK_INFO << "ptype = mitk::MakePixelType<int, int, 5>();";
- MITK_INFO
- << "itkPtype = mitk::MakePixelType<ItkImageType>();\n with itk::Image<itk::FixedArray< int, 5>, 3> ItkImageType";
-
- mitk::PixelType ptype = mitk::MakePixelType<int, int, 5>();
+ CPPUNIT_TEST_SUITE(mitkPixelTypeTestSuite);
+
+ MITK_TEST(GetComponentType_Success);
+ MITK_TEST(GetPixelTypeAsString_Success);
+ MITK_TEST(GetBpePtype_Success);
+ MITK_TEST(GetNumberOfComponentsPtype_Success);
+ MITK_TEST(GetBitsPerComponentPtype_Success);
+ MITK_TEST(GetBpeItkPtype_Success);
+ MITK_TEST(GetNumberOfComponentsItkPtype_Success);
+ MITK_TEST(GetBitsPerComponentItkPtype_Success);
+ MITK_TEST(ConstructorWithBrackets_Success);
+ MITK_TEST(InitializeWithEqualSign_Success);
+ MITK_TEST(EqualityOperator_Success);
+ MITK_TEST(NotEqualityOperator_Success);
+ MITK_TEST(GetPixelTypeUnknown_Success);
+ MITK_TEST(SetLengthCorrectly_Success);
+ MITK_TEST(ValueTypeCorresponds_Success);
+ MITK_TEST(ImageTypeTraitInt3D_Success);
+ MITK_TEST(ImageTypeTraitShort2D_Success);
+ MITK_TEST(ImageTypeTraitVectorShort3D_Success);
+ MITK_TEST(ImageTypeTraitItkInt3D_Success);
+ MITK_TEST(ImageTypeTraitItkShort2D_Success);
+ MITK_TEST(ImageTypeTraitItkVectorShort3D_Success);
+
+ CPPUNIT_TEST_SUITE_END();
+
+private:
typedef itk::Image<itk::FixedArray<int, 5>, 3> ItkImageType;
- mitk::PixelType itkPtype = mitk::MakePixelType<ItkImageType>();
-
- MITK_TEST_CONDITION_REQUIRED(ptype.GetComponentType() == itk::ImageIOBase::INT, "GetComponentType()");
- // MITK_TEST_CONDITION( ptype.GetPixelTypeId() == typeid(ItkImageType), "GetPixelTypeId()");
-
- MITK_INFO << ptype.GetPixelTypeAsString();
- MITK_INFO << typeid(ItkImageType).name();
-
- MITK_TEST_CONDITION_REQUIRED(ptype.GetBpe() == 8 * sizeof(int) * 5, "[ptype] GetBpe()");
- MITK_TEST_CONDITION_REQUIRED(ptype.GetNumberOfComponents() == 5, "[ptype]GetNumberOfComponents()");
- MITK_TEST_CONDITION_REQUIRED(ptype.GetBitsPerComponent() == 8 * sizeof(int), "[ptype]GetBitsPerComponent()");
-
- MITK_TEST_CONDITION_REQUIRED(itkPtype.GetBpe() == 8 * sizeof(int) * 5, "[itkPType] GetBpe()");
- MITK_TEST_CONDITION_REQUIRED(itkPtype.GetNumberOfComponents() == 5, "[itkPType] GetNumberOfComponents()");
- MITK_TEST_CONDITION_REQUIRED(itkPtype.GetBitsPerComponent() == 8 * sizeof(int), "[itkPType] GetBitsPerComponent()");
-
- // MITK_TEST_CONDITION_REQUIRED( itkPtype == ptype, "[itkPtype = ptype]");
-
- // MITK_TEST_CONDITION( ptype.GetPixelTypeAsString().compare("unknown") == 0, "GetPixelTypeAsString()");
- {
- {
- mitk::PixelType ptype2(ptype);
- MITK_TEST_CONDITION_REQUIRED(ptype2.GetComponentType() == itk::ImageIOBase::INT,
- "ptype2( ptype)- GetComponentType()");
- MITK_TEST_CONDITION(ptype2.GetPixelType() == ptype.GetPixelType(), "ptype2( ptype)-GetPixelType(");
- MITK_TEST_CONDITION(ptype2.GetComponentType() == ptype.GetComponentType(), "ptype2( ptype)-GetComponentType(");
- MITK_TEST_CONDITION_REQUIRED(ptype2.GetBpe() == 8 * sizeof(int) * 5, "ptype2( ptype)-GetBpe()");
- MITK_TEST_CONDITION_REQUIRED(ptype2.GetNumberOfComponents() == 5, "ptype2( ptype)-GetNumberOfComponents()");
- MITK_TEST_CONDITION_REQUIRED(ptype2.GetBitsPerComponent() == 8 * sizeof(int),
- "ptype2( ptype)-GetBitsPerComponent()");
- // MITK_TEST_CONDITION_REQUIRED( ptype.GetPixelTypeAsString().compare("unknown") == 0, "ptype2(
- // ptype)-GetPixelTypeAsString()");
- }
-
- {
- mitk::PixelType ptype2 = ptype;
- MITK_TEST_CONDITION_REQUIRED(ptype2.GetComponentType() == itk::ImageIOBase::INT,
- "ptype2 = ptype- GetComponentType()");
- MITK_TEST_CONDITION(ptype2.GetPixelType() == ptype.GetPixelType(), "ptype2 = ptype- GetPixelType(");
- MITK_TEST_CONDITION(ptype2.GetComponentType() == ptype.GetComponentType(), "ptype2( ptype)-GetComponentType(");
- MITK_TEST_CONDITION_REQUIRED(ptype2.GetBpe() == 8 * sizeof(int) * 5, "ptype2 = ptype- GetBpe()");
- MITK_TEST_CONDITION_REQUIRED(ptype2.GetNumberOfComponents() == 5, "ptype2 = ptype- GetNumberOfComponents()");
- MITK_TEST_CONDITION_REQUIRED(ptype2.GetBitsPerComponent() == 8 * sizeof(int),
- "ptype2 = ptype- GetBitsPerComponent()");
- // MITK_TEST_CONDITION_REQUIRED( ptype.GetPixelTypeAsString().compare("unknown") == 0, "ptype2 = ptype-
- // GetPixelTypeAsString()");
- }
-
- {
- mitk::PixelType ptype2 = ptype;
- MITK_TEST_CONDITION_REQUIRED(ptype == ptype2, "operator ==");
- // MITK_TEST_CONDITION_REQUIRED( ptype == typeid(int), "operator ==");
- // mitk::PixelType ptype3 = mitk::MakePixelType<char, char ,5>;
- // MITK_TEST_CONDITION_REQUIRED( ptype != ptype3, "operator !=");
- // MITK_TEST_CONDITION_REQUIRED( *ptype3 != typeid(int), "operator !=");
- }
- }
-
- // test instantiation
typedef itk::Image<MyObscurePixelType> MyObscureImageType;
- mitk::PixelType obscurePixelType = mitk::MakePixelType<MyObscureImageType>();
+ typedef itk::VectorImage<short, 3> VectorImageType;
+ typedef itk::Image<itk::Vector<short, 7>> FixedVectorImageType;
- MITK_TEST_CONDITION(obscurePixelType.GetPixelType() == itk::ImageIOBase::UNKNOWNPIXELTYPE,
- "PixelTypeId is 'UNKNOWN' ");
- MITK_TEST_CONDITION(obscurePixelType.GetNumberOfComponents() == MyObscurePixelType::Length,
- "Lenght was set correctly");
- MITK_TEST_CONDITION(
- obscurePixelType.GetComponentType() == mitk::MapPixelComponentType<MyObscurePixelType::ValueType>::value,
- "ValueType corresponds.");
- typedef itk::VectorImage<short, 3> VectorImageType;
- mitk::PixelType vectorPixelType = mitk::MakePixelType<VectorImageType>(78);
- // vectorPixelType.SetVectorLength( 78 );
+public:
+ void setUp() override
+ {
+ }
- typedef itk::Image<itk::Vector<short, 7>> FixedVectorImageType;
- mitk::PixelType fixedVectorPixelType = mitk::MakePixelType<FixedVectorImageType>();
+ void tearDown() override
+ {
+ }
+
+ void GetComponentType_Success()
+ {
+ mitk::PixelType ptype = mitk::MakePixelType<int, int, 5>();
+ MITK_INFO << "m_Ptype = mitk::MakePixelType<int, int, 5>();";
+ MITK_INFO
+ << "m_ItkPtype = mitk::MakePixelType<ItkImageType>();\n with itk::Image<itk::FixedArray< int, 5>, 3> ItkImageType";
+ CPPUNIT_ASSERT_MESSAGE("GetComponentType()", ptype.GetComponentType() == itk::ImageIOBase::INT);
+ }
+
+ void GetPixelTypeAsString_Success()
+ {
+ mitk::PixelType ptype = mitk::MakePixelType<int, int, 5>();
+ MITK_INFO << ptype.GetPixelTypeAsString();
+ MITK_INFO << typeid(ItkImageType).name();
+ }
+
+ void GetBpePtype_Success()
+ {
+ mitk::PixelType ptype = mitk::MakePixelType<int, int, 5>();
+ CPPUNIT_ASSERT_MESSAGE("[m_Ptype] GetBpe()", ptype.GetBpe() == 8 * sizeof(int) * 5);
+ }
+
+ void GetNumberOfComponentsPtype_Success()
+ {
+ mitk::PixelType ptype = mitk::MakePixelType<int, int, 5>();
+ CPPUNIT_ASSERT_MESSAGE("[ptype]GetNumberOfComponents()", ptype.GetNumberOfComponents() == 5);
+ }
+
+ void GetBitsPerComponentPtype_Success()
+ {
+ mitk::PixelType ptype = mitk::MakePixelType<int, int, 5>();
+ CPPUNIT_ASSERT_MESSAGE("[ptype]GetBitsPerComponent()", ptype.GetBitsPerComponent() == 8 * sizeof(int));
+ }
+
+ void GetBpeItkPtype_Success()
+ {
+ mitk::PixelType itkPtype = mitk::MakePixelType<ItkImageType>();
+ CPPUNIT_ASSERT_MESSAGE("[itkPType] GetBpe()", itkPtype.GetBpe() == 8 * sizeof(int) * 5);
+ }
+
+ void GetNumberOfComponentsItkPtype_Success()
+ {
+ mitk::PixelType itkPtype = mitk::MakePixelType<ItkImageType>();
+ CPPUNIT_ASSERT_MESSAGE("[itkPType] GetNumberOfComponents()", itkPtype.GetNumberOfComponents() == 5);
+ }
+
+ void GetBitsPerComponentItkPtype_Success()
+ {
+ mitk::PixelType itkPtype = mitk::MakePixelType<ItkImageType>();
+ CPPUNIT_ASSERT_MESSAGE("[itkPType] GetBitsPerComponent()", itkPtype.GetBitsPerComponent() == 8 * sizeof(int));
+ }
+
+ void ConstructorWithBrackets_Success()
+ {
+ mitk::PixelType ptype = mitk::MakePixelType<int, int, 5>();
+ mitk::PixelType ptype2(ptype);
+ CPPUNIT_ASSERT_MESSAGE("ptype2( ptype)- GetComponentType()", ptype2.GetComponentType() == itk::ImageIOBase::INT);
+ CPPUNIT_ASSERT_MESSAGE("ptype2( ptype)-GetPixelType(", ptype2.GetPixelType() == ptype.GetPixelType());
+ CPPUNIT_ASSERT_MESSAGE("ptype2( ptype)-GetComponentType(", ptype2.GetComponentType() == ptype.GetComponentType());
+ CPPUNIT_ASSERT_MESSAGE("ptype2( ptype)-GetBpe()", ptype2.GetBpe() == 8 * sizeof(int) * 5);
+ CPPUNIT_ASSERT_MESSAGE("ptype2( ptype)-GetNumberOfComponents()", ptype2.GetNumberOfComponents() == 5);
+ CPPUNIT_ASSERT_MESSAGE("ptype2( ptype)-GetBitsPerComponent()", ptype2.GetBitsPerComponent() == 8 * sizeof(int));
+ }
+
+ void InitializeWithEqualSign_Success()
+ {
+ mitk::PixelType ptype = mitk::MakePixelType<int, int, 5>();
+ mitk::PixelType ptype2 = ptype;
+ CPPUNIT_ASSERT_MESSAGE("ptype2 = ptype- GetComponentType()", ptype2.GetComponentType() == itk::ImageIOBase::INT);
+ CPPUNIT_ASSERT_MESSAGE("ptype2 = ptype- GetPixelType(", ptype2.GetPixelType() == ptype.GetPixelType());
+ CPPUNIT_ASSERT_MESSAGE("ptype2( ptype)-GetComponentType(", ptype2.GetComponentType() == ptype.GetComponentType());
+ CPPUNIT_ASSERT_MESSAGE("ptype2 = ptype- GetBpe()", ptype2.GetBpe() == 8 * sizeof(int) * 5);
+ CPPUNIT_ASSERT_MESSAGE("ptype2 = ptype- GetNumberOfComponents()", ptype2.GetNumberOfComponents() == 5);
+ CPPUNIT_ASSERT_MESSAGE("ptype2 = ptype- GetBitsPerComponent()", ptype2.GetBitsPerComponent() == 8 * sizeof(int));
+ }
+
+ void EqualityOperator_Success()
+ {
+ mitk::PixelType ptype = mitk::MakePixelType<int, int, 5>();
+ mitk::PixelType ptype2 = ptype;
+ CPPUNIT_ASSERT_MESSAGE("operator ==", ptype == ptype2);
+ }
+
+ void NotEqualityOperator_Success()
+ {
+ mitk::PixelType ptype = mitk::MakePixelType<int, int, 5>();
+ mitk::PixelType ptype3 = mitk::MakePixelType<char, char ,5>();
+ CPPUNIT_ASSERT_MESSAGE("operator !=", ptype != ptype3);
+ }
+
+ void GetPixelTypeUnknown_Success()
+ {
+ // test instantiation
+ mitk::PixelType obscurePixelType = mitk::MakePixelType<MyObscureImageType>();
+ CPPUNIT_ASSERT_MESSAGE("PixelTypeId is 'UNKNOWN' ", obscurePixelType.GetPixelType() == itk::ImageIOBase::UNKNOWNPIXELTYPE);
+ }
+
+ void SetLengthCorrectly_Success()
+ {
+ mitk::PixelType obscurePixelType = mitk::MakePixelType<MyObscureImageType>();
+ CPPUNIT_ASSERT_MESSAGE("Lenght was set correctly", obscurePixelType.GetNumberOfComponents() == MyObscurePixelType::Length);
+ }
- mitk::PixelType scalarPixelType = mitk::MakeScalarPixelType<float>();
+ void ValueTypeCorresponds_Success()
+ {
+ mitk::PixelType obscurePixelType = mitk::MakePixelType<MyObscureImageType>();
+ CPPUNIT_ASSERT_MESSAGE("ValueType corresponds.",
- // test ImageTypeTrait traits class
- MITK_TEST_CONDITION(typeid(mitk::ImageTypeTrait<int, 3>::ImageType) == typeid(itk::Image<int, 3>), "ImageTypeTrait");
- MITK_TEST_CONDITION((mitk::ImageTypeTrait<int, 3>::IsVectorImage == false), "ImageTypeTrait");
+ obscurePixelType.GetComponentType() == mitk::MapPixelComponentType<MyObscurePixelType::ValueType>::value);
+ }
+
+ void ImageTypeTraitInt3D_Success()
+ {
+ // test ImageTypeTrait traits class
+ CPPUNIT_ASSERT_MESSAGE("ImageTypeTrait typeid int 3D equals ITK typeid",
+
+ typeid(mitk::ImageTypeTrait<int, 3>::ImageType) == typeid(itk::Image<int, 3>));
+ CPPUNIT_ASSERT_MESSAGE("ImageTypeTrait is no vector image", (mitk::ImageTypeTrait<int, 3>::IsVectorImage == false));
+ }
+
+ void ImageTypeTraitShort2D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("ImageTypeTrait typeid short 2D equals ITK typeid",
+ typeid(mitk::ImageTypeTrait<itk::FixedArray<short, 2>, 3>::ImageType) ==
+ typeid(itk::Image<itk::FixedArray<short, 2>, 3>));
+ CPPUNIT_ASSERT_MESSAGE("ImageTypeTrait is no vector image", (mitk::ImageTypeTrait<itk::FixedArray<short, 2>, 3>::IsVectorImage == false));
+ }
- MITK_TEST_CONDITION(typeid(mitk::ImageTypeTrait<itk::FixedArray<short, 2>, 3>::ImageType) ==
- typeid(itk::Image<itk::FixedArray<short, 2>, 3>),
- "ImageTypeTrait");
- MITK_TEST_CONDITION((mitk::ImageTypeTrait<itk::FixedArray<short, 2>, 3>::IsVectorImage == false), "ImageTypeTrait");
+ void ImageTypeTraitVectorShort3D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("ImageTypeTrait typeid short 3D equals ITK typeid",
+ typeid(mitk::ImageTypeTrait<itk::VariableLengthVector<short>, 3>::ImageType) == typeid(itk::VectorImage<short, 3>));
+ CPPUNIT_ASSERT_MESSAGE("ImageTypeTrait is a vector image", (mitk::ImageTypeTrait<itk::VariableLengthVector<short>, 3>::IsVectorImage == true));
+ }
- MITK_TEST_CONDITION(
- typeid(mitk::ImageTypeTrait<itk::VariableLengthVector<short>, 3>::ImageType) == typeid(itk::VectorImage<short, 3>),
- "ImageTypeTrait");
- MITK_TEST_CONDITION((mitk::ImageTypeTrait<itk::VariableLengthVector<short>, 3>::IsVectorImage == true),
- "ImageTypeTrait");
+ void ImageTypeTraitItkInt3D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("ImageTypeTrait typeid ITK int 3D equals ITK typeid",
+ typeid(mitk::ImageTypeTrait<itk::Image<int, 3>>::ImageType) == typeid(itk::Image<int, 3>));
+ CPPUNIT_ASSERT_MESSAGE("ImageTypeTrait is no vector image", (mitk::ImageTypeTrait<itk::Image<int, 3>>::IsVectorImage == false));
+ }
- MITK_TEST_CONDITION(typeid(mitk::ImageTypeTrait<itk::Image<int, 3>>::ImageType) == typeid(itk::Image<int, 3>),
- "ImageTypeTrait");
- MITK_TEST_CONDITION((mitk::ImageTypeTrait<itk::Image<int, 3>>::IsVectorImage == false), "ImageTypeTrait");
+ void ImageTypeTraitItkShort2D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("ImageTypeTrait typeid ITK short 2D equals ITK typeid",
+ typeid(mitk::ImageTypeTrait<itk::Image<itk::FixedArray<short, 2>, 3>>::ImageType) ==
+ typeid(itk::Image<itk::FixedArray<short, 2>, 3>));
+ CPPUNIT_ASSERT_MESSAGE("ImageTypeTrait is no vector image",
- MITK_TEST_CONDITION(typeid(mitk::ImageTypeTrait<itk::Image<itk::FixedArray<short, 2>, 3>>::ImageType) ==
- typeid(itk::Image<itk::FixedArray<short, 2>, 3>),
- "ImageTypeTrait");
- MITK_TEST_CONDITION((mitk::ImageTypeTrait<itk::Image<itk::FixedArray<short, 2>, 3>>::IsVectorImage == false),
- "ImageTypeTrait");
+ (mitk::ImageTypeTrait<itk::Image<itk::FixedArray<short, 2>, 3>>::IsVectorImage == false));
+ }
- MITK_TEST_CONDITION(
- typeid(mitk::ImageTypeTrait<itk::VectorImage<short, 3>>::ImageType) == typeid(itk::VectorImage<short, 3>),
- "ImageTypeTrait");
- MITK_TEST_CONDITION((mitk::ImageTypeTrait<itk::VectorImage<short, 3>>::IsVectorImage == true), "ImageTypeTrait");
+ void ImageTypeTraitItkVectorShort3D_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("ImageTypeTrait typeid ITK short 3D equals ITK typeid",
+ typeid(mitk::ImageTypeTrait<itk::VectorImage<short, 3>>::ImageType) == typeid(itk::VectorImage<short, 3>));
+ CPPUNIT_ASSERT_MESSAGE("ImageTypeTrait is a vector image",
+ (mitk::ImageTypeTrait<itk::VectorImage<short, 3>>::IsVectorImage == true));
+ }
+};
+MITK_TEST_SUITE_REGISTRATION(mitkPixelType)
- // test CastableTo
- MITK_TEST_END();
-}
diff --git a/Modules/Core/test/mitkPropertyAliasesTest.cpp b/Modules/Core/test/mitkPropertyAliasesTest.cpp
index 22dd5d8ec0..3188a48066 100644
--- a/Modules/Core/test/mitkPropertyAliasesTest.cpp
+++ b/Modules/Core/test/mitkPropertyAliasesTest.cpp
@@ -1,63 +1,106 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+// Testing
+#include "mitkTestFixture.h"
+#include "mitkTestingMacros.h"
+// std includes
+#include <string>
#include <algorithm>
+// MITK includes
#include <mitkCoreServices.h>
#include <mitkIPropertyAliases.h>
-#include <mitkTestingMacros.h>
+// VTK includes
+#include <vtkDebugLeaks.h>
-int mitkPropertyAliasesTest(int, char *[])
+class mitkPropertyAliasesTestSuite : public mitk::TestFixture
{
- MITK_TEST_BEGIN("mitkPropertyAliasesTest");
-
- mitk::IPropertyAliases *propertyAliases = mitk::CoreServices::GetPropertyAliases();
- MITK_TEST_CONDITION_REQUIRED(propertyAliases != nullptr, "Get property aliases service");
-
- propertyAliases->AddAlias("propertyName1", "alias1a");
- propertyAliases->AddAlias("propertyName1", "alias1b");
- propertyAliases->AddAlias("propertyName2", "alias2a");
- propertyAliases->AddAlias("propertyName2", "alias2b", "className");
-
+ CPPUNIT_TEST_SUITE(mitkPropertyAliasesTestSuite);
+ MITK_TEST(GetPropertyAliasesService_Success);
+ MITK_TEST(GetAliases_Success);
+ MITK_TEST(GetAliasesRestricted_Success);
+ MITK_TEST(GetPropertyName_Success);
+ MITK_TEST(GetPropertyNameNonexisting_Empty);
+ MITK_TEST(GetPropertyNameRestricted_Success);
+ CPPUNIT_TEST_SUITE_END();
+
+private:
+ mitk::IPropertyAliases *m_PropertyAliases;
typedef std::vector<std::string> Aliases;
-
- Aliases aliases = propertyAliases->GetAliases("propertyName1");
- auto it1 = std::find(aliases.begin(), aliases.end(), "alias1a");
- auto it2 = std::find(aliases.begin(), aliases.end(), "alias1b");
-
- MITK_TEST_CONDITION(aliases.size() == 2 && it1 != aliases.end() && it2 != aliases.end(),
- "Get aliases of \"propertyName1\"");
-
- aliases = propertyAliases->GetAliases("propertyName2");
- it1 = std::find(aliases.begin(), aliases.end(), "alias2a");
-
- MITK_TEST_CONDITION(aliases.size() == 1 && it1 != aliases.end(), "Get aliases of \"propertyName2\"");
-
- aliases = propertyAliases->GetAliases("propertyName2", "className");
- it1 = std::find(aliases.begin(), aliases.end(), "alias2b");
-
- MITK_TEST_CONDITION(aliases.size() == 1 && it1 != aliases.end(),
- "Get aliases of \"propertyName2\" restricted to \"className\"");
-
- std::string propertyName = propertyAliases->GetPropertyName("alias1b");
-
- MITK_TEST_CONDITION(propertyName == "propertyName1", "Get property name of \"alias1b\"");
-
- propertyName = propertyAliases->GetPropertyName("alias2b");
-
- MITK_TEST_CONDITION(propertyName.empty(), "Get property name of non-existing unrestricted \"alias2b\"");
-
- propertyName = propertyAliases->GetPropertyName("alias2b", "className");
-
- MITK_TEST_CONDITION(propertyName == "propertyName2", "Get property name of restricted \"alias2b\"");
-
- MITK_TEST_END();
-}
+ Aliases m_Aliases;
+ std::string m_PropertyName;
+
+public:
+ void setUp()
+ {
+ m_PropertyAliases = mitk::CoreServices::GetPropertyAliases();
+ m_PropertyAliases->AddAlias("propertyName1", "alias1a");
+ m_PropertyAliases->AddAlias("propertyName1", "alias1b");
+ m_PropertyAliases->AddAlias("propertyName2", "alias2a");
+ m_PropertyAliases->AddAlias("propertyName2", "alias2b", "className");
+ }
+ void tearDown()
+ {
+ m_PropertyAliases = nullptr;
+ }
+
+
+ void GetPropertyAliasesService_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Get property aliases service", m_PropertyAliases != nullptr);
+ }
+
+ void GetAliases_Success()
+ {
+ m_Aliases = m_PropertyAliases->GetAliases("propertyName1");
+ auto it1 = std::find(m_Aliases.begin(), m_Aliases.end(), "alias1a");
+ auto it2 = std::find(m_Aliases.begin(), m_Aliases.end(), "alias1b");
+
+ CPPUNIT_ASSERT_MESSAGE("Get aliases of \"propertyName1\"", m_Aliases.size() == 2 && it1 != m_Aliases.end() && it2 != m_Aliases.end());
+
+ m_Aliases = m_PropertyAliases->GetAliases("propertyName2");
+ it1 = std::find(m_Aliases.begin(), m_Aliases.end(), "alias2a");
+
+ CPPUNIT_ASSERT_MESSAGE("Get aliases of \"propertyName2\"", m_Aliases.size() == 1 && it1 != m_Aliases.end());
+ }
+
+ void GetAliasesRestricted_Success()
+ {
+ m_Aliases = m_PropertyAliases->GetAliases("propertyName2", "className");
+ auto it1 = std::find(m_Aliases.begin(), m_Aliases.end(), "alias2b");
+
+ CPPUNIT_ASSERT_MESSAGE("Get aliases of \"propertyName2\" restricted to \"className\"", m_Aliases.size() == 1 && it1 != m_Aliases.end());
+ }
+
+ void GetPropertyName_Success()
+ {
+ m_PropertyName = m_PropertyAliases->GetPropertyName("alias1b");
+
+ CPPUNIT_ASSERT_MESSAGE("Get property name of \"alias1b\"", m_PropertyName == "propertyName1");
+ }
+
+ void GetPropertyNameNonexisting_Empty()
+ {
+ m_PropertyName = m_PropertyAliases->GetPropertyName("alias2b");
+
+ CPPUNIT_ASSERT_MESSAGE("Get property name of non-existing unrestricted \"alias2b\"", m_PropertyName.empty());
+ }
+
+ void GetPropertyNameRestricted_Success()
+ {
+ m_PropertyName = m_PropertyAliases->GetPropertyName("alias2b", "className");
+
+ CPPUNIT_ASSERT_MESSAGE("Get property name of restricted \"alias2b\"", m_PropertyName == "propertyName2");
+ }
+};
+
+MITK_TEST_SUITE_REGISTRATION(mitkPropertyAliases)
diff --git a/Modules/Core/test/mitkPropertyDescriptionsTest.cpp b/Modules/Core/test/mitkPropertyDescriptionsTest.cpp
index 6b7e98b5f0..4b58119a59 100644
--- a/Modules/Core/test/mitkPropertyDescriptionsTest.cpp
+++ b/Modules/Core/test/mitkPropertyDescriptionsTest.cpp
@@ -1,43 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+// Testing
+#include "mitkTestFixture.h"
+#include "mitkTestingMacros.h"
+// std includes
+#include <string>
+#include <algorithm>
+// MITK includes
#include <mitkCoreServices.h>
#include <mitkIPropertyDescriptions.h>
-#include <mitkTestingMacros.h>
+// VTK includes
+#include <vtkDebugLeaks.h>
-int mitkPropertyDescriptionsTest(int, char *[])
+class mitkPropertyDescriptionsTestSuite : public mitk::TestFixture
{
- MITK_TEST_BEGIN("mitkPropertyDescriptionsTest");
+ CPPUNIT_TEST_SUITE(mitkPropertyDescriptionsTestSuite);
+ MITK_TEST(GetPropertyDescriptionService_Success);
+ MITK_TEST(GetPropertyDescription_Success);
+ MITK_TEST(GetOverwrittenDescription_Success);
+ MITK_TEST(GetPropertyDescriptionRestricted_Success);
+ CPPUNIT_TEST_SUITE_END();
- mitk::IPropertyDescriptions *propertyDescriptions = mitk::CoreServices::GetPropertyDescriptions();
- MITK_TEST_CONDITION_REQUIRED(propertyDescriptions != nullptr, "Get property descriptions service");
+ private:
+ mitk::IPropertyDescriptions *m_PropertyDescriptions;
+ std::string m_Description1;
- propertyDescriptions->AddDescription("propertyName1", "description1a");
- propertyDescriptions->AddDescription("propertyName1", "description1b");
- std::string description1 = propertyDescriptions->GetDescription("propertyName1");
+ public:
+ void setUp()
+ {
+ m_PropertyDescriptions = mitk::CoreServices::GetPropertyDescriptions();
+ m_PropertyDescriptions->AddDescription("propertyName1", "description1a");
+ m_PropertyDescriptions->AddDescription("propertyName1", "description1b");
+ }
- MITK_TEST_CONDITION(description1 == "description1a", "Get description of \"propertyName1\"");
+ void tearDown()
+ {
+ m_PropertyDescriptions = nullptr;
+ }
- propertyDescriptions->AddDescription("propertyName1", "description1b", "", true);
- description1 = propertyDescriptions->GetDescription("propertyName1");
+ void GetPropertyDescriptionService_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Get property descriptions service", m_PropertyDescriptions != nullptr);
+ }
- MITK_TEST_CONDITION(description1 == "description1b", "Get overwritten description of \"propertyName1\"");
+ void GetPropertyDescription_Success()
+ {
+ m_Description1 = m_PropertyDescriptions->GetDescription("propertyName1");
+ CPPUNIT_ASSERT_MESSAGE("Get description of \"propertyName1\"", m_Description1 == "description1a");
+ }
- propertyDescriptions->AddDescription("propertyName1", "description1c", "className");
- std::string description2 = propertyDescriptions->GetDescription("propertyName1", "className");
- description1 = propertyDescriptions->GetDescription("propertyName1");
+ void GetOverwrittenDescription_Success()
+ {
+ m_PropertyDescriptions->AddDescription("propertyName1", "description1b", "", true);
+ m_Description1 = m_PropertyDescriptions->GetDescription("propertyName1");
+ CPPUNIT_ASSERT_MESSAGE("Get overwritten description of \"propertyName1\"", m_Description1 == "description1b");
+ }
- MITK_TEST_CONDITION(description1 == "description1b" && description2 == "description1c",
- "Get description of \"propertyName1\" restricted to \"className\"");
+ void GetPropertyDescriptionRestricted_Success()
+ {
+ m_PropertyDescriptions->AddDescription("propertyName1", "description1c", "className");
+ std::string description2 = m_PropertyDescriptions->GetDescription("propertyName1", "className");
+ m_Description1 = m_PropertyDescriptions->GetDescription("propertyName1");
+
+ CPPUNIT_ASSERT_MESSAGE("Get description of \"propertyName1\" restricted to \"className\"",
+ m_Description1 == "description1b" && description2 == "description1c");
+ }
+};
- MITK_TEST_END();
-}
+MITK_TEST_SUITE_REGISTRATION(mitkPropertyDescriptions)
diff --git a/Modules/Core/test/mitkPropertyExtensionsTest.cpp b/Modules/Core/test/mitkPropertyExtensionsTest.cpp
index 8404dcc0cb..af38679513 100644
--- a/Modules/Core/test/mitkPropertyExtensionsTest.cpp
+++ b/Modules/Core/test/mitkPropertyExtensionsTest.cpp
@@ -1,63 +1,100 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+// Testing
+#include "mitkTestFixture.h"
+#include "mitkTestingMacros.h"
+// std includes
+#include <string>
+#include <algorithm>
+// MITK includes
#include <mitkCoreServices.h>
#include <mitkIPropertyExtensions.h>
#include <mitkPropertyExtension.h>
-#include <mitkTestingMacros.h>
+// VTK includes
+#include <vtkDebugLeaks.h>
class TestPropertyExtension : public mitk::PropertyExtension
{
public:
mitkClassMacro(TestPropertyExtension, mitk::PropertyExtension);
mitkNewMacro1Param(Self, const std::string &);
std::string GetName() const { return m_Name; }
private:
explicit TestPropertyExtension(const std::string &name) : m_Name(name) {}
~TestPropertyExtension() override {}
std::string m_Name;
};
-int mitkPropertyExtensionsTest(int, char *[])
+class mitkPropertyExtensionsTestSuite : public mitk::TestFixture
{
- MITK_TEST_BEGIN("mitkPropertyExtensionsTest");
+ CPPUNIT_TEST_SUITE(mitkPropertyExtensionsTestSuite);
+ MITK_TEST(GetPropertyExtensionService_Success);
+ MITK_TEST(GetPropertyExtension_Success);
+ MITK_TEST(GetOverwrittenExtension_Success);
+ MITK_TEST(GetPropertyExtensionRestricted_Success);
+ CPPUNIT_TEST_SUITE_END();
- mitk::IPropertyExtensions *propertyExtensions = mitk::CoreServices::GetPropertyExtensions();
- MITK_TEST_CONDITION_REQUIRED(propertyExtensions != nullptr, "Get property extensions service");
-
- propertyExtensions->AddExtension("propertyName1", TestPropertyExtension::New("extension1a").GetPointer());
- propertyExtensions->AddExtension("propertyName1", TestPropertyExtension::New("extension1b").GetPointer());
- TestPropertyExtension::Pointer extension1 =
- dynamic_cast<TestPropertyExtension *>(propertyExtensions->GetExtension("propertyName1").GetPointer());
-
- MITK_TEST_CONDITION(extension1.IsNotNull() && extension1->GetName() == "extension1a",
- "Get extension of \"propertyName1\"");
-
- propertyExtensions->AddExtension("propertyName1", TestPropertyExtension::New("extension1b").GetPointer(), "", true);
- extension1 = dynamic_cast<TestPropertyExtension *>(propertyExtensions->GetExtension("propertyName1").GetPointer());
-
- MITK_TEST_CONDITION(extension1.IsNotNull() && extension1->GetName() == "extension1b",
- "Get overwritten extension of \"propertyName1\"");
-
- propertyExtensions->AddExtension(
- "propertyName1", TestPropertyExtension::New("extension1c").GetPointer(), "className");
- TestPropertyExtension::Pointer extension2 =
- dynamic_cast<TestPropertyExtension *>(propertyExtensions->GetExtension("propertyName1", "className").GetPointer());
- extension1 = dynamic_cast<TestPropertyExtension *>(propertyExtensions->GetExtension("propertyName1").GetPointer());
+private:
+ mitk::IPropertyExtensions *m_PropertyExtensions;
+ TestPropertyExtension::Pointer m_Extension1;
- MITK_TEST_CONDITION(extension1.IsNotNull() && extension1->GetName() == "extension1b" && extension2.IsNotNull() &&
- extension2->GetName() == "extension1c",
- "Get extension of \"propertyName1\" restricted to \"className\"");
+public:
+ void setUp()
+ {
+ m_PropertyExtensions = mitk::CoreServices::GetPropertyExtensions();
+ m_PropertyExtensions->AddExtension("propertyName1", TestPropertyExtension::New("extension1a").GetPointer());
+ m_PropertyExtensions->AddExtension("propertyName1", TestPropertyExtension::New("extension1b").GetPointer());
+ }
+
+ void tearDown()
+ {
+ m_PropertyExtensions = nullptr;
+ }
+
+ void GetPropertyExtensionService_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Get property extensions service", m_PropertyExtensions != nullptr);
+ }
+
+ void GetPropertyExtension_Success()
+ {
+ TestPropertyExtension::Pointer extension1 =
+ dynamic_cast<TestPropertyExtension *>(m_PropertyExtensions->GetExtension("propertyName1").GetPointer());
+
+ CPPUNIT_ASSERT_MESSAGE("Get extension of \"propertyName1\"",
+ extension1.IsNotNull() && extension1->GetName() == "extension1a");
+ }
+
+ void GetOverwrittenExtension_Success()
+ {
+ m_PropertyExtensions->AddExtension("propertyName1", TestPropertyExtension::New("extension1b").GetPointer(), "", true);
+ m_Extension1 = dynamic_cast<TestPropertyExtension *>(m_PropertyExtensions->GetExtension("propertyName1").GetPointer());
+ CPPUNIT_ASSERT_MESSAGE("Get overwritten extension of \"propertyName1\"",
+ m_Extension1.IsNotNull() && m_Extension1->GetName() == "extension1b");
+ }
+
+ void GetPropertyExtensionRestricted_Success()
+ {
+ m_PropertyExtensions->AddExtension("propertyName1", TestPropertyExtension::New("extension1c").GetPointer(), "className");
+ TestPropertyExtension::Pointer extension2 =
+ dynamic_cast<TestPropertyExtension *>(m_PropertyExtensions->GetExtension("propertyName1", "className").GetPointer());
+ m_Extension1 = dynamic_cast<TestPropertyExtension *>(m_PropertyExtensions->GetExtension("propertyName1").GetPointer());
+
+ CPPUNIT_ASSERT_MESSAGE("Get extension of \"propertyName1\" restricted to \"className\"",
+ m_Extension1.IsNotNull() && m_Extension1->GetName() == "extension1b" && extension2.IsNotNull() &&
+ extension2->GetName() == "extension1c");
+ }
+ };
+ MITK_TEST_SUITE_REGISTRATION(mitkPropertyExtensions)
- MITK_TEST_END();
-}
diff --git a/Modules/Core/test/mitkPropertyFiltersTest.cpp b/Modules/Core/test/mitkPropertyFiltersTest.cpp
index 2eba270d66..f48ff6725f 100644
--- a/Modules/Core/test/mitkPropertyFiltersTest.cpp
+++ b/Modules/Core/test/mitkPropertyFiltersTest.cpp
@@ -1,65 +1,96 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#include <algorithm>
+// Testing
+#include "mitkTestFixture.h"
+#include "mitkTestingMacros.h"
+// std includes
+#include <string>
+#include <utility>
+// MITK includes
#include <mitkCoreServices.h>
#include <mitkIPropertyFilters.h>
#include <mitkProperties.h>
#include <mitkPropertyFilter.h>
-#include <mitkTestingMacros.h>
-#include <utility>
+// VTK includes
+#include <vtkDebugLeaks.h>
-int mitkPropertyFiltersTest(int, char *[])
+class mitkPropertyFiltersTestSuite : public mitk::TestFixture
{
- MITK_TEST_BEGIN("mitkPropertyFiltersTest");
-
- mitk::IPropertyFilters *propertyFilters = mitk::CoreServices::GetPropertyFilters();
- MITK_TEST_CONDITION_REQUIRED(propertyFilters != nullptr, "Get property filters service");
-
+ CPPUNIT_TEST_SUITE(mitkPropertyFiltersTestSuite);
+ MITK_TEST(GetPropertyFiltersService_Success);
+ MITK_TEST(ApplyGlobalPropertyFilter_Success);
+ MITK_TEST(ApplyRestrictedPropertyFilter_Success);
+ CPPUNIT_TEST_SUITE_END();
+
+private:
+ mitk::IPropertyFilters *m_PropertyFilters;
typedef std::map<std::string, mitk::BaseProperty::Pointer> PropertyMap;
typedef PropertyMap::const_iterator PropertyMapConstIterator;
-
- PropertyMap propertyMap;
- propertyMap.insert(std::make_pair("propertyName1", mitk::BoolProperty::New().GetPointer()));
- propertyMap.insert(std::make_pair("propertyName2", mitk::BoolProperty::New().GetPointer()));
- propertyMap.insert(std::make_pair("propertyName3", mitk::BoolProperty::New().GetPointer()));
-
- mitk::PropertyFilter filter;
- filter.AddEntry("propertyName1", mitk::PropertyFilter::Whitelist);
- filter.AddEntry("propertyName2", mitk::PropertyFilter::Whitelist);
-
- mitk::PropertyFilter restrictedFilter;
- restrictedFilter.AddEntry("propertyName2", mitk::PropertyFilter::Blacklist);
-
- propertyFilters->AddFilter(filter);
- propertyFilters->AddFilter(restrictedFilter, "className");
-
- PropertyMap filteredPropertyMap = propertyFilters->ApplyFilter(propertyMap);
- PropertyMapConstIterator it1 = filteredPropertyMap.find("propertyName1");
- PropertyMapConstIterator it2 = filteredPropertyMap.find("propertyName2");
- PropertyMapConstIterator it3 = filteredPropertyMap.find("propertyName3");
-
- MITK_TEST_CONDITION(
- it1 != filteredPropertyMap.end() && it2 != filteredPropertyMap.end() && it3 == filteredPropertyMap.end(),
- "Apply global property filter");
-
- filteredPropertyMap = propertyFilters->ApplyFilter(propertyMap, "className");
- it1 = filteredPropertyMap.find("propertyName1");
- it2 = filteredPropertyMap.find("propertyName2");
- it3 = filteredPropertyMap.find("propertyName3");
-
- MITK_TEST_CONDITION(
- it1 != filteredPropertyMap.end() && it2 == filteredPropertyMap.end() && it3 == filteredPropertyMap.end(),
- "Apply restricted property filter (also respects global filter)");
-
- MITK_TEST_END();
-}
+ PropertyMap m_PropertyMap;
+ mitk::PropertyFilter m_Filter;
+ mitk::PropertyFilter m_RestrictedFilter;
+ PropertyMap m_FilteredPropertyMap;
+ PropertyMapConstIterator m_It1;
+ PropertyMapConstIterator m_It2;
+ PropertyMapConstIterator m_It3;
+
+public:
+ void setUp()
+ {
+ m_PropertyFilters = mitk::CoreServices::GetPropertyFilters();
+
+ m_PropertyMap.insert(std::make_pair("propertyName1", mitk::BoolProperty::New().GetPointer()));
+ m_PropertyMap.insert(std::make_pair("propertyName2", mitk::BoolProperty::New().GetPointer()));
+ m_PropertyMap.insert(std::make_pair("propertyName3", mitk::BoolProperty::New().GetPointer()));
+
+ m_Filter.AddEntry("propertyName1", mitk::PropertyFilter::Whitelist);
+ m_Filter.AddEntry("propertyName2", mitk::PropertyFilter::Whitelist);
+
+ m_RestrictedFilter.AddEntry("propertyName2", mitk::PropertyFilter::Blacklist);
+
+ m_PropertyFilters->AddFilter(m_Filter);
+ m_PropertyFilters->AddFilter(m_RestrictedFilter, "className");
+ }
+ void tearDown()
+ {
+ m_PropertyFilters = nullptr;
+ }
+
+ void GetPropertyFiltersService_Success()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Get property filters service", m_PropertyFilters != nullptr);
+ }
+
+ void ApplyGlobalPropertyFilter_Success()
+ {
+ m_FilteredPropertyMap = m_PropertyFilters->ApplyFilter(m_PropertyMap);
+ m_It1 = m_FilteredPropertyMap.find("propertyName1");
+ m_It2 = m_FilteredPropertyMap.find("propertyName2");
+ m_It3 = m_FilteredPropertyMap.find("propertyName3");
+
+ CPPUNIT_ASSERT_MESSAGE("Apply global property filter",
+ m_It1 != m_FilteredPropertyMap.end() && m_It2 != m_FilteredPropertyMap.end() && m_It3 == m_FilteredPropertyMap.end());
+ }
+
+ void ApplyRestrictedPropertyFilter_Success()
+ {
+ m_FilteredPropertyMap = m_PropertyFilters->ApplyFilter(m_PropertyMap, "className");
+ m_It1 = m_FilteredPropertyMap.find("propertyName1");
+ m_It2 = m_FilteredPropertyMap.find("propertyName2");
+ m_It3 = m_FilteredPropertyMap.find("propertyName3");
+
+ CPPUNIT_ASSERT_MESSAGE("Apply restricted property filter (also respects global filter)",
+ m_It1 != m_FilteredPropertyMap.end() && m_It2 == m_FilteredPropertyMap.end() && m_It3 == m_FilteredPropertyMap.end());
+ }
+};
+MITK_TEST_SUITE_REGISTRATION(mitkPropertyFilters)
diff --git a/Modules/Core/test/mitkPropertyTest.cpp b/Modules/Core/test/mitkPropertyTest.cpp
index 01a23ef6ec..3d2fa11b29 100644
--- a/Modules/Core/test/mitkPropertyTest.cpp
+++ b/Modules/Core/test/mitkPropertyTest.cpp
@@ -1,434 +1,489 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+// Testing
+#include "mitkTestFixture.h"
#include "mitkTestingMacros.h"
-
+// std includes
+#include <string>
+// MITK includes
#include <mitkAnnotationProperty.h>
#include <mitkClippingProperty.h>
#include <mitkColorProperty.h>
#include <mitkLevelWindowProperty.h>
#include <mitkLookupTableProperty.h>
#include <mitkLookupTables.h>
#include <mitkProperties.h>
#include <mitkSmartPointerProperty.h>
#include <mitkStringProperty.h>
#include <mitkTransferFunctionProperty.h>
#include <mitkWeakPointerProperty.h>
-
+#include <mitkLogMacros.h>
+// ITK includes
#include <itkCommand.h>
+// VTK includes
+#include <vtkDebugLeaks.h>
struct PropertyModifiedListener
{
typedef itk::SimpleMemberCommand<PropertyModifiedListener> CmdType;
PropertyModifiedListener() : m_Modified(false), m_Cmd(CmdType::New())
{
m_Cmd->SetCallbackFunction(this, &PropertyModifiedListener::Modified);
}
void Modified() { m_Modified = true; }
bool Pop()
{
bool b = m_Modified;
m_Modified = false;
return b;
}
bool m_Modified;
CmdType::Pointer m_Cmd;
};
-template <class T>
-void TestPropInequality(T prop, T prop2)
-{
- mitk::BaseProperty::Pointer baseProp2(prop2.GetPointer());
- MITK_TEST_CONDITION_REQUIRED(!(*prop == *prop2), "Test inequality 1");
- MITK_TEST_CONDITION_REQUIRED(!(*prop == *baseProp2), "Test polymorphic inequality 1");
- MITK_TEST_CONDITION_REQUIRED(!(*baseProp2 == *prop), "Test polymorphic inequality 2");
-}
-
-template <class T>
-void TestPropAssignment(T prop, T prop2, const std::string &strProp)
-{
- PropertyModifiedListener l;
- unsigned long tag = prop->AddObserver(itk::ModifiedEvent(), l.m_Cmd.GetPointer());
-
- mitk::BaseProperty::Pointer baseProp2(prop2.GetPointer());
- *prop = *baseProp2;
- MITK_TEST_CONDITION_REQUIRED(l.Pop(), "Test modified event");
- std::string msg = std::string("Test assignment [") + prop->GetValueAsString() + " == " + strProp + "]";
- MITK_TEST_CONDITION_REQUIRED(prop->GetValueAsString() == strProp, msg);
- MITK_TEST_CONDITION_REQUIRED(*prop == *prop2, "Test equality");
- MITK_TEST_CONDITION_REQUIRED(*prop == *baseProp2, "Test equality");
- MITK_TEST_CONDITION_REQUIRED(*baseProp2 == *prop, "Test polymorphic equality");
-
- prop->RemoveObserver(tag);
-}
-
-template <class T>
-void TestPropPolymorphicAssignment(T prop, T prop2, const std::string &strProp)
+class mitkPropertyTestSuite : public mitk::TestFixture
{
- mitk::BaseProperty::Pointer baseProp(prop.GetPointer());
-
- PropertyModifiedListener l;
- unsigned long tag = baseProp->AddObserver(itk::ModifiedEvent(), l.m_Cmd.GetPointer());
-
- *baseProp = *prop2;
- MITK_TEST_CONDITION_REQUIRED(l.Pop(), "Test modified event");
- std::string msg =
- std::string("Test polymorphic assignment [") + baseProp->GetValueAsString() + " == " + strProp + "]";
- MITK_TEST_CONDITION_REQUIRED(baseProp->GetValueAsString() == strProp, msg);
- MITK_TEST_CONDITION_REQUIRED(*prop == *prop2, "Test equality");
- MITK_TEST_CONDITION_REQUIRED(*prop2 == *baseProp, "Test equality");
- MITK_TEST_CONDITION_REQUIRED(*baseProp == *prop2, "Test polymorphic equality");
-
- baseProp->RemoveObserver(tag);
-}
-
-template <class T>
-void TestPropCloning(T prop)
-{
- T prop2 = prop->Clone();
- MITK_TEST_CONDITION_REQUIRED(prop.GetPointer() != prop2.GetPointer(), "Test clone pointer")
- MITK_TEST_CONDITION_REQUIRED(*prop == *prop2, "Test equality of the clone")
-}
-
-template <class T>
-void TestProperty(const typename T::ValueType &v1,
- const typename T::ValueType &v2,
- const std::string &strV1,
- const std::string &strV2)
-{
- PropertyModifiedListener l;
-
- typename T::Pointer prop = T::New(v1);
- MITK_TEST_OUTPUT(<< "**** Test [" << prop->GetNameOfClass() << "] ****");
+ CPPUNIT_TEST_SUITE(mitkPropertyTestSuite);
+ MITK_TEST(TestBoolProperty_Success);
+ MITK_TEST(TestIntProperty_Success);
+ MITK_TEST(TestFloatProperty_Success);
+ MITK_TEST(TestDoubleProperty_Success);
+ MITK_TEST(TestVector3DProperty_Success);
+ MITK_TEST(TestPoint3D_Success);
+ MITK_TEST(TestPoint4D_Success);
+ MITK_TEST(TestPoint3I_Success);
+ MITK_TEST(TestFloatLookupTable_Success);
+ MITK_TEST(TestBoolLookupTable_Success);
+ MITK_TEST(TestIntLookupTable_Success);
+ MITK_TEST(TestStringLookupTable_Success);
+ MITK_TEST(TestAnnotationProperty_Success);
+ MITK_TEST(TestClippingProperty_Success);
+ MITK_TEST(TestColorProperty_Success);
+ MITK_TEST(TestLevelWindowProperty_Success);
+ MITK_TEST(TestSmartPointerProperty_Success);
+ MITK_TEST(TestStringProperty_Success);
+ MITK_TEST(TestTransferFunctionProperty_Success);
+ MITK_TEST(TestWeakPointerProperty_Success);
+ MITK_TEST(TestLookupTablePropertyProperty_Success);
+ CPPUNIT_TEST_SUITE_END();
+
+private:
+ PropertyModifiedListener m_L;
+public:
+ void setUp()
+ {
+ }
+ void tearDown()
+ {
+ }
- MITK_TEST_CONDITION_REQUIRED(prop->GetValue() == v1, "Test constructor");
- std::string msg = std::string("Test GetValueAsString() [") + prop->GetValueAsString() + " == " + strV1 + "]";
- MITK_TEST_CONDITION_REQUIRED(prop->GetValueAsString() == strV1, msg);
+ template <class T>
+ void TestPropInequality(T prop, T prop2)
+ {
+ mitk::BaseProperty::Pointer baseProp2(prop2.GetPointer());
+ CPPUNIT_ASSERT_MESSAGE("Test inequality 1", !(*prop == *prop2));
+ CPPUNIT_ASSERT_MESSAGE("Test polymorphic inequality 1", !(*prop == *baseProp2));
+ CPPUNIT_ASSERT_MESSAGE("Test polymorphic inequality 2", !(*baseProp2 == *prop));
+ }
- TestPropCloning(prop);
+ template <class T>
+ void TestPropAssignment(T prop, T prop2, const std::string &strProp)
+ {
+ unsigned long tag = prop->AddObserver(itk::ModifiedEvent(), m_L.m_Cmd.GetPointer());
+
+ mitk::BaseProperty::Pointer baseProp2(prop2.GetPointer());
+ *prop = *baseProp2;
+ CPPUNIT_ASSERT_MESSAGE("Test modified event", m_L.Pop());
+ std::string msg = std::string("Test assignment [") + prop->GetValueAsString() + " == " + strProp + "]";
+ CPPUNIT_ASSERT_MESSAGE(msg, prop->GetValueAsString() == strProp);
+ CPPUNIT_ASSERT_MESSAGE("Test equality", *prop == *prop2);
+ CPPUNIT_ASSERT_MESSAGE("Test equality", *prop == *baseProp2);
+ CPPUNIT_ASSERT_MESSAGE("Test polymorphic equality", *baseProp2 == *prop);
+
+ prop->RemoveObserver(tag);
+ }
- typename T::Pointer prop2 = T::New();
- prop2->AddObserver(itk::ModifiedEvent(), l.m_Cmd.GetPointer());
- MITK_TEST_CONDITION_REQUIRED(!l.m_Modified, "Test modified");
- prop2->SetValue(v2);
- MITK_TEST_CONDITION_REQUIRED(l.Pop(), "Test modified");
- MITK_TEST_CONDITION_REQUIRED(prop2->GetValue() == v2, "Test SetValue()");
+ template <class T>
+ void TestPropPolymorphicAssignment(T prop, T prop2, const std::string &strProp)
+ {
+ mitk::BaseProperty::Pointer baseProp(prop.GetPointer());
+
+ unsigned long tag = baseProp->AddObserver(itk::ModifiedEvent(), m_L.m_Cmd.GetPointer());
+
+ *baseProp = *prop2;
+ CPPUNIT_ASSERT_MESSAGE("Test modified event", m_L.Pop());
+ std::string msg =
+ std::string("Test polymorphic assignment [") + baseProp->GetValueAsString() + " == " + strProp + "]";
+ CPPUNIT_ASSERT_MESSAGE(msg, baseProp->GetValueAsString() == strProp);
+ CPPUNIT_ASSERT_MESSAGE("Test equality", *prop == *prop2);
+ CPPUNIT_ASSERT_MESSAGE("Test equality", *prop2 == *baseProp);
+ CPPUNIT_ASSERT_MESSAGE("Test polymorphic equality", *baseProp == *prop2);
+ baseProp->RemoveObserver(tag);
+ }
+
+ template <class T>
+ void TestPropCloning(T prop)
+ {
+ T prop2 = prop->Clone();
+ CPPUNIT_ASSERT_MESSAGE("Test clone pointer", prop.GetPointer() != prop2.GetPointer());
+ CPPUNIT_ASSERT_MESSAGE("Test equality of the clone", *prop == *prop2);
+ }
+
+ template <class T>
+ void TestProperty(const typename T::ValueType &v1,
+ const typename T::ValueType &v2,
+ const std::string &strV1,
+ const std::string &strV2)
+ {
+ typename T::Pointer prop = T::New(v1);
+ MITK_TEST_OUTPUT(<< "**** Test [" << prop->GetNameOfClass() << "] ****");
+
+ CPPUNIT_ASSERT_MESSAGE("Test constructor", prop->GetValue() == v1);
+ std::string msg = std::string("Test GetValueAsString() [") + prop->GetValueAsString() + " == " + strV1 + "]";
+ CPPUNIT_ASSERT_MESSAGE(msg, prop->GetValueAsString() == strV1);
+
+ TestPropCloning(prop);
+
+ typename T::Pointer prop2 = T::New();
+ prop2->AddObserver(itk::ModifiedEvent(), m_L.m_Cmd.GetPointer());
+ CPPUNIT_ASSERT_MESSAGE("Test modified", !m_L.m_Modified);
+ prop2->SetValue(v2);
+ CPPUNIT_ASSERT_MESSAGE("Test modified", m_L.Pop());
+ CPPUNIT_ASSERT_MESSAGE("Test SetValue()", prop2->GetValue() == v2);
+ prop2->SetValue(v2);
+ CPPUNIT_ASSERT_MESSAGE("Test for no modification", !m_L.Pop());
+
+ TestPropInequality(prop, prop2);
+ TestPropAssignment(prop, prop2, strV2);
+
+ prop->SetValue(v1);
+ TestPropPolymorphicAssignment(prop2, prop, strV1);
+ }
- prop2->SetValue(v2);
- MITK_TEST_CONDITION_REQUIRED(!l.Pop(), "Test for no modification");
+ void TestBoolProperty_Success()
+ {
+ TestProperty<mitk::BoolProperty>(false, true, "0", "1");
+ }
- TestPropInequality(prop, prop2);
- TestPropAssignment(prop, prop2, strV2);
+ void TestIntProperty_Success()
+ {
+ TestProperty<mitk::IntProperty>(3, 5, "3", "5");
+ }
- prop->SetValue(v1);
- TestPropPolymorphicAssignment(prop2, prop, strV1);
-}
+ void TestFloatProperty_Success()
+ {
+ TestProperty<mitk::FloatProperty>(0.3f, -23.5f, "0.3", "-23.5");
+ }
-void TestGenericProperties()
-{
- TestProperty<mitk::BoolProperty>(false, true, "0", "1");
- TestProperty<mitk::IntProperty>(3, 5, "3", "5");
- TestProperty<mitk::FloatProperty>(0.3f, -23.5f, "0.3", "-23.5");
- TestProperty<mitk::DoubleProperty>(64.1f, 2.34f, "64.1", "2.34");
+ void TestDoubleProperty_Success()
+ {
+ TestProperty<mitk::DoubleProperty>(64.1f, 2.34f, "64.1", "2.34");
+ }
+ void TestVector3DProperty_Success()
{
mitk::Vector3D p1;
p1[0] = 2.0;
p1[1] = 3.0;
p1[2] = 4.0;
mitk::Vector3D p2;
p2[0] = -1.0;
p2[1] = 2.0;
p2[2] = 3.0;
TestProperty<mitk::Vector3DProperty>(p1, p2, "[2, 3, 4]", "[-1, 2, 3]");
}
+ void TestPoint3D_Success()
{
mitk::Point3D p1;
p1[0] = 2.0;
p1[1] = 3.0;
p1[2] = 4.0;
mitk::Point3D p2;
p2[0] = -1.0;
p2[1] = 2.0;
p2[2] = 3.0;
TestProperty<mitk::Point3dProperty>(p1, p2, "[2, 3, 4]", "[-1, 2, 3]");
}
+ void TestPoint4D_Success()
{
mitk::Point4D p1;
p1[0] = 2.0;
p1[1] = 3.0;
p1[2] = 4.0;
p1[3] = -2.0;
mitk::Point4D p2;
p2[0] = -1.0;
p2[1] = 2.0;
p2[2] = 3.0;
p2[3] = 5.0;
TestProperty<mitk::Point4dProperty>(p1, p2, "[2, 3, 4, -2]", "[-1, 2, 3, 5]");
}
+ void TestPoint3I_Success()
{
mitk::Point3I p1;
p1[0] = 2;
p1[1] = 3;
p1[2] = 4;
mitk::Point3I p2;
p2[0] = 8;
p2[1] = 7;
p2[2] = 6;
TestProperty<mitk::Point3iProperty>(p1, p2, "[2, 3, 4]", "[8, 7, 6]");
}
+ void TestFloatLookupTable_Success()
{
mitk::FloatLookupTable lut1;
lut1.SetTableValue(1, 0.3f);
lut1.SetTableValue(4, 323.7f);
mitk::FloatLookupTable lut2;
lut2.SetTableValue(6, -0.3f);
lut2.SetTableValue(2, 25.7f);
TestProperty<mitk::FloatLookupTableProperty>(lut1, lut2, "[1 -> 0.3, 4 -> 323.7]", "[2 -> 25.7, 6 -> -0.3]");
}
+ void TestBoolLookupTable_Success()
{
mitk::BoolLookupTable lut1;
lut1.SetTableValue(3, false);
lut1.SetTableValue(5, true);
mitk::BoolLookupTable lut2;
lut2.SetTableValue(1, false);
lut2.SetTableValue(2, false);
TestProperty<mitk::BoolLookupTableProperty>(lut1, lut2, "[3 -> 0, 5 -> 1]", "[1 -> 0, 2 -> 0]");
}
+ void TestIntLookupTable_Success()
{
mitk::IntLookupTable lut1;
lut1.SetTableValue(5, -12);
lut1.SetTableValue(7, 3);
mitk::IntLookupTable lut2;
lut2.SetTableValue(4, -6);
lut2.SetTableValue(8, -45);
TestProperty<mitk::IntLookupTableProperty>(lut1, lut2, "[5 -> -12, 7 -> 3]", "[4 -> -6, 8 -> -45]");
}
+ void TestStringLookupTable_Success()
{
mitk::StringLookupTable lut1;
lut1.SetTableValue(0, "a");
lut1.SetTableValue(2, "b");
mitk::StringLookupTable lut2;
lut2.SetTableValue(0, "a");
lut2.SetTableValue(2, "c");
TestProperty<mitk::StringLookupTableProperty>(lut1, lut2, "[0 -> a, 2 -> b]", "[0 -> a, 2 -> c]");
}
-}
-
-void TestAnnotationProperty()
-{
- PropertyModifiedListener l;
-
- std::string label1("Label1");
- mitk::Point3D point1;
- point1[0] = 3;
- point1[1] = 5;
- point1[2] = -4;
- std::string str1 = "Label1[3, 5, -4]";
-
- std::string label2("Label2");
- mitk::Point3D point2;
- point2[0] = -2;
- point2[1] = 8;
- point2[2] = -4;
- std::string str2 = "Label2[-2, 8, -4]";
-
- mitk::AnnotationProperty::Pointer prop = mitk::AnnotationProperty::New(label1, point1);
- MITK_TEST_OUTPUT(<< "**** Test [" << prop->GetNameOfClass() << "] ****");
-
- MITK_TEST_CONDITION_REQUIRED(prop->GetLabel() == label1 && prop->GetPosition() == point1, "Test constructor");
- std::string msg = std::string("Test GetValueAsString() [") + prop->GetValueAsString() + " == " + str1 + "]";
- MITK_TEST_CONDITION_REQUIRED(prop->GetValueAsString() == str1, msg);
-
- mitk::AnnotationProperty::Pointer prop2 = mitk::AnnotationProperty::New();
- prop2->AddObserver(itk::ModifiedEvent(), l.m_Cmd.GetPointer());
- MITK_TEST_CONDITION_REQUIRED(!l.m_Modified, "Test not modified");
- prop2->SetLabel(label2);
- MITK_TEST_CONDITION_REQUIRED(l.Pop(), "Test modified");
- prop2->SetPosition(point2);
- MITK_TEST_CONDITION_REQUIRED(l.Pop(), "Test modified");
- MITK_TEST_CONDITION_REQUIRED(prop2->GetLabel() == label2 && prop2->GetPosition() == point2, "Test Setter");
-
- prop2->SetLabel(label2);
- MITK_TEST_CONDITION_REQUIRED(!l.Pop(), "Test for no modification");
- prop2->SetPosition(point2);
- MITK_TEST_CONDITION_REQUIRED(!l.Pop(), "Test for no modification");
-
- TestPropInequality(prop, prop2);
- TestPropAssignment(prop, prop2, str2);
-
- prop->SetLabel(label1);
- prop->SetPosition(point1);
- TestPropPolymorphicAssignment(prop2, prop, str1);
-}
-
-void TestClippingProperty()
-{
- PropertyModifiedListener l;
-
- bool enabled1 = true;
- mitk::Point3D point1;
- point1[0] = 3;
- point1[1] = 5;
- point1[2] = -4;
- mitk::Vector3D vec1;
- vec1[0] = 0;
- vec1[1] = 2;
- vec1[2] = -1;
- std::string str1 = "1[3, 5, -4][0, 2, -1]";
-
- bool enabled2 = false;
- mitk::Point3D point2;
- point2[0] = -2;
- point2[1] = 8;
- point2[2] = -4;
- mitk::Vector3D vec2;
- vec2[0] = 0;
- vec2[1] = 2;
- vec2[2] = 4;
- std::string str2 = "0[-2, 8, -4][0, 2, 4]";
-
- mitk::ClippingProperty::Pointer prop = mitk::ClippingProperty::New(point1, vec1);
- MITK_TEST_OUTPUT(<< "**** Test [" << prop->GetNameOfClass() << "] ****");
-
- MITK_TEST_CONDITION_REQUIRED(
- prop->GetClippingEnabled() == enabled1 && prop->GetOrigin() == point1 && prop->GetNormal() == vec1,
- "Test constructor");
- std::string msg = std::string("Test GetValueAsString() [") + prop->GetValueAsString() + " == " + str1 + "]";
- MITK_TEST_CONDITION_REQUIRED(prop->GetValueAsString() == str1, msg);
-
- mitk::ClippingProperty::Pointer prop2 = mitk::ClippingProperty::New();
- prop2->AddObserver(itk::ModifiedEvent(), l.m_Cmd.GetPointer());
- MITK_TEST_CONDITION_REQUIRED(!l.m_Modified, "Test not modified");
- prop2->SetClippingEnabled(enabled2);
- MITK_TEST_CONDITION_REQUIRED(!l.Pop(), "Test not modified");
- prop2->SetOrigin(point2);
- MITK_TEST_CONDITION_REQUIRED(l.Pop(), "Test modified");
- prop2->SetNormal(vec2);
- MITK_TEST_CONDITION_REQUIRED(l.Pop(), "Test modified");
-
- MITK_TEST_CONDITION_REQUIRED(
- prop2->GetClippingEnabled() == enabled2 && prop2->GetOrigin() == point2 && prop2->GetNormal() == vec2,
- "Test Setter");
-
- prop2->SetClippingEnabled(enabled2);
- MITK_TEST_CONDITION_REQUIRED(!l.Pop(), "Test for no modification");
- prop2->SetOrigin(point2);
- MITK_TEST_CONDITION_REQUIRED(!l.Pop(), "Test for no modification");
- prop2->SetNormal(vec2);
- MITK_TEST_CONDITION_REQUIRED(!l.Pop(), "Test for no modification");
-
- TestPropInequality(prop, prop2);
- TestPropAssignment(prop, prop2, str2);
-
- prop->SetClippingEnabled(enabled1);
- prop->SetOrigin(point1);
- prop->SetNormal(vec1);
- TestPropPolymorphicAssignment(prop2, prop, str1);
-}
-
-int mitkPropertyTest(int /* argc */, char * /*argv*/ [])
-{
- MITK_TEST_BEGIN("Testing MITK Properties")
- TestGenericProperties();
+ void TestAnnotationProperty_Success()
+ {
+ std::string label1("Label1");
+ mitk::Point3D point1;
+ point1[0] = 3;
+ point1[1] = 5;
+ point1[2] = -4;
+ std::string str1 = "Label1[3, 5, -4]";
+
+ std::string label2("Label2");
+ mitk::Point3D point2;
+ point2[0] = -2;
+ point2[1] = 8;
+ point2[2] = -4;
+ std::string str2 = "Label2[-2, 8, -4]";
+
+ mitk::AnnotationProperty::Pointer prop = mitk::AnnotationProperty::New(label1, point1);
+ MITK_TEST_OUTPUT(<< "**** Test [" << prop->GetNameOfClass() << "] ****");
+
+ CPPUNIT_ASSERT_MESSAGE("Test constructor", prop->GetLabel() == label1 && prop->GetPosition() == point1);
+ std::string msg = std::string("Test GetValueAsString() [") + prop->GetValueAsString() + " == " + str1 + "]";
+ CPPUNIT_ASSERT_MESSAGE(msg, prop->GetValueAsString() == str1);
+
+ mitk::AnnotationProperty::Pointer prop2 = mitk::AnnotationProperty::New();
+ prop2->AddObserver(itk::ModifiedEvent(), m_L.m_Cmd.GetPointer());
+ CPPUNIT_ASSERT_MESSAGE("Test not modified", !m_L.m_Modified);
+ prop2->SetLabel(label2);
+ CPPUNIT_ASSERT_MESSAGE("Test modified", m_L.Pop());
+ prop2->SetPosition(point2);
+ CPPUNIT_ASSERT_MESSAGE("Test modified", m_L.Pop());
+ CPPUNIT_ASSERT_MESSAGE("Test Setter", prop2->GetLabel() == label2 && prop2->GetPosition() == point2);
+
+ prop2->SetLabel(label2);
+ CPPUNIT_ASSERT_MESSAGE("Test for no modification", !m_L.Pop());
+ prop2->SetPosition(point2);
+ CPPUNIT_ASSERT_MESSAGE("Test for no modification", !m_L.Pop());
+
+ TestPropInequality(prop, prop2);
+ TestPropAssignment(prop, prop2, str2);
+
+ prop->SetLabel(label1);
+ prop->SetPosition(point1);
+ TestPropPolymorphicAssignment(prop2, prop, str1);
+ }
- TestAnnotationProperty();
- TestClippingProperty();
+ void TestClippingProperty_Success()
+ {
+ bool enabled1 = true;
+ mitk::Point3D point1;
+ point1[0] = 3;
+ point1[1] = 5;
+ point1[2] = -4;
+ mitk::Vector3D vec1;
+ vec1[0] = 0;
+ vec1[1] = 2;
+ vec1[2] = -1;
+ std::string str1 = "1[3, 5, -4][0, 2, -1]";
+
+ bool enabled2 = false;
+ mitk::Point3D point2;
+ point2[0] = -2;
+ point2[1] = 8;
+ point2[2] = -4;
+ mitk::Vector3D vec2;
+ vec2[0] = 0;
+ vec2[1] = 2;
+ vec2[2] = 4;
+ std::string str2 = "0[-2, 8, -4][0, 2, 4]";
+
+ mitk::ClippingProperty::Pointer prop = mitk::ClippingProperty::New(point1, vec1);
+ MITK_TEST_OUTPUT(<< "**** Test [" << prop->GetNameOfClass() << "] ****");
+
+ CPPUNIT_ASSERT_MESSAGE("Test constructor",
+ prop->GetClippingEnabled() == enabled1 && prop->GetOrigin() == point1 && prop->GetNormal() == vec1);
+ std::string msg = std::string("Test GetValueAsString() [") + prop->GetValueAsString() + " == " + str1 + "]";
+ CPPUNIT_ASSERT_MESSAGE(msg, prop->GetValueAsString() == str1);
+
+ mitk::ClippingProperty::Pointer prop2 = mitk::ClippingProperty::New();
+ prop2->AddObserver(itk::ModifiedEvent(), m_L.m_Cmd.GetPointer());
+ CPPUNIT_ASSERT_MESSAGE("Test not modified", !m_L.m_Modified);
+ prop2->SetClippingEnabled(enabled2);
+ CPPUNIT_ASSERT_MESSAGE("Test not modified", !m_L.Pop());
+ prop2->SetOrigin(point2);
+ CPPUNIT_ASSERT_MESSAGE("Test modified", m_L.Pop());
+ prop2->SetNormal(vec2);
+ CPPUNIT_ASSERT_MESSAGE("Test modified", m_L.Pop());
+
+ CPPUNIT_ASSERT_MESSAGE("Test Setter",
+ prop2->GetClippingEnabled() == enabled2 && prop2->GetOrigin() == point2 && prop2->GetNormal() == vec2);
+
+ prop2->SetClippingEnabled(enabled2);
+ CPPUNIT_ASSERT_MESSAGE("Test for no modification", !m_L.Pop());
+ prop2->SetOrigin(point2);
+ CPPUNIT_ASSERT_MESSAGE("Test for no modification", !m_L.Pop());
+ prop2->SetNormal(vec2);
+ CPPUNIT_ASSERT_MESSAGE("Test for no modification", !m_L.Pop());
+
+ TestPropInequality(prop, prop2);
+ TestPropAssignment(prop, prop2, str2);
+
+ prop->SetClippingEnabled(enabled1);
+ prop->SetOrigin(point1);
+ prop->SetNormal(vec1);
+ TestPropPolymorphicAssignment(prop2, prop, str1);
+ }
- mitk::Color c1;
- c1[0] = 0.2;
- c1[1] = 0.6;
- c1[2] = 0.8;
- mitk::Color c2;
- c2[0] = 0.2;
- c2[1] = 0.4;
- c2[2] = 0.1;
- TestProperty<mitk::ColorProperty>(c1, c2, "0.2 0.6 0.8", "0.2 0.4 0.1");
+ void TestColorProperty_Success()
+ {
+ mitk::Color c1;
+ c1[0] = 0.2;
+ c1[1] = 0.6;
+ c1[2] = 0.8;
+ mitk::Color c2;
+ c2[0] = 0.2;
+ c2[1] = 0.4;
+ c2[2] = 0.1;
+ TestProperty<mitk::ColorProperty>(c1, c2, "0.2 0.6 0.8", "0.2 0.4 0.1");
+ }
- mitk::LevelWindow lw1(50, 100);
- mitk::LevelWindow lw2(120, 30);
- TestProperty<mitk::LevelWindowProperty>(lw1, lw2, "L:50 W:100", "L:120 W:30");
+ void TestLevelWindowProperty_Success()
+ {
+ mitk::LevelWindow lw1(50, 100);
+ mitk::LevelWindow lw2(120, 30);
+ TestProperty<mitk::LevelWindowProperty>(lw1, lw2, "L:50 W:100", "L:120 W:30");
+ }
+ void TestSmartPointerProperty_Success()
{
itk::Object::Pointer sp1 = itk::Object::New();
itk::Object::Pointer sp2 = itk::Object::New();
// to generate the UIDs, we set the smartpointers
mitk::SmartPointerProperty::Pointer spp1 = mitk::SmartPointerProperty::New(sp1.GetPointer());
mitk::SmartPointerProperty::Pointer spp2 = mitk::SmartPointerProperty::New(sp2.GetPointer());
TestProperty<mitk::SmartPointerProperty>(sp1, sp2, spp1->GetReferenceUIDFor(sp1), spp2->GetReferenceUIDFor(sp2));
}
- TestProperty<mitk::StringProperty>("1", "2", "1", "2");
+ void TestStringProperty_Success()
+ {
+ TestProperty<mitk::StringProperty>("1", "2", "1", "2");
+ }
+ void TestTransferFunctionProperty_Success()
{
mitk::TransferFunction::Pointer tf1 = mitk::TransferFunction::New();
mitk::TransferFunction::Pointer tf2 = mitk::TransferFunction::New();
tf2->AddScalarOpacityPoint(0.4, 0.8);
std::stringstream ss;
ss << tf1;
std::string strTF1 = ss.str();
ss.str("");
ss << tf2;
std::string strTF2 = ss.str();
TestProperty<mitk::TransferFunctionProperty>(tf1, tf2, strTF1, strTF2);
}
+ void TestWeakPointerProperty_Success()
{
itk::Object::Pointer sp1 = itk::Object::New();
itk::Object::Pointer sp2 = itk::Object::New();
mitk::WeakPointerProperty::ValueType wp1 = sp1.GetPointer();
mitk::WeakPointerProperty::ValueType wp2 = sp2.GetPointer();
std::stringstream ss;
ss << sp1.GetPointer();
std::string str1 = ss.str();
ss.str("");
ss << sp2.GetPointer();
std::string str2 = ss.str();
TestProperty<mitk::WeakPointerProperty>(wp1, wp2, str1, str2);
}
+ void TestLookupTablePropertyProperty_Success()
{
mitk::LookupTable::Pointer lut1 = mitk::LookupTable::New();
lut1->GetVtkLookupTable()->SetTableValue(0, 0.2, 0.3, 0.4);
mitk::LookupTable::Pointer lut2 = mitk::LookupTable::New();
lut2->GetVtkLookupTable()->SetTableValue(0, 0.2, 0.4, 0.4);
std::stringstream ss;
ss << lut1;
std::string strLUT1 = ss.str();
ss.str("");
ss << lut2;
std::string strLUT2 = ss.str();
TestProperty<mitk::LookupTableProperty>(lut1, lut2, strLUT1, strLUT2);
}
+};
+MITK_TEST_SUITE_REGISTRATION(mitkProperty)
- MITK_TEST_END()
-}
diff --git a/Modules/Core/test/mitkTinyXMLTest.cpp b/Modules/Core/test/mitkTinyXMLTest.cpp
index db5273b47d..ddd251e473 100644
--- a/Modules/Core/test/mitkTinyXMLTest.cpp
+++ b/Modules/Core/test/mitkTinyXMLTest.cpp
@@ -1,160 +1,159 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
// Testing
#include "mitkTestFixture.h"
#include <mitkTestingMacros.h>
// std includes
#include <cmath>
#include <iomanip>
-#include <string>
#include <tinyxml.h>
// MITK includes
#include "mitkStringProperty.h"
#include <mitkNumericTypes.h>
// itksys
#include <itksys/SystemTools.hxx>
// VTK includes
#include <vtkDebugLeaks.h>
// vnl includes
#include <vnl/vnl_vector_fixed.hxx>
class mitkTinyXMLTestSuite : public mitk::TestFixture
{
CPPUNIT_TEST_SUITE(mitkTinyXMLTestSuite);
MITK_TEST(TestingFunctionSetupWorks_Success);
MITK_TEST(TestingReadValueFromSetupDocument_Success);
MITK_TEST(TestingReadOutValueWorks_Success);
MITK_TEST(TestDoubleValueWriteOut_Success);
MITK_TEST(TestDoubleValueWriteOutManyDecimalPlaces_Success);
CPPUNIT_TEST_SUITE_END();
private:
const std::string m_Filename = itksys::SystemTools::GetCurrentWorkingDirectory() + "/TinyXMLTest.txt";
const std::string m_ElementToStoreAttributeName = "DoubleTest";
const std::string m_AttributeToStoreName = "CommaValue";
TiXmlDocument m_Document;
TiXmlElement *m_DoubleTest;
double calcPrecision(const unsigned int requiredDecimalPlaces)
{
return pow(10.0, -1.0 * ((double)requiredDecimalPlaces));
}
bool Setup(double valueToWrite)
{
// 1. create simple document
auto decl = new TiXmlDeclaration("1.0", "", ""); // TODO what to write here? encoding? etc....
m_Document.LinkEndChild(decl);
auto version = new TiXmlElement("Version");
version->SetAttribute("Writer", __FILE__);
version->SetAttribute("CVSRevision", "$Revision: 17055 $");
version->SetAttribute("FileVersion", 1);
m_Document.LinkEndChild(version);
// 2. store one element containing a double value with potentially many after comma digits.
auto vElement = new TiXmlElement(m_ElementToStoreAttributeName);
vElement->SetDoubleAttribute(m_AttributeToStoreName, valueToWrite);
m_Document.LinkEndChild(vElement);
// 3. store in file.
return m_Document.SaveFile(m_Filename);
}
public:
void setUp() override {}
void tearDown() override {}
void TestingFunctionSetupWorks_Success()
{
CPPUNIT_ASSERT_MESSAGE("Test if Setup correctly writes data to file", Setup(1.0));
}
int readValueFromSetupDocument(double &readOutValue)
{
if (!m_Document.LoadFile(m_Filename))
{
CPPUNIT_ASSERT_MESSAGE("Test Setup failed, could not open file", false);
return TIXML_NO_ATTRIBUTE;
}
else
{
m_DoubleTest = m_Document.FirstChildElement(m_ElementToStoreAttributeName);
return m_DoubleTest->QueryDoubleAttribute(m_AttributeToStoreName, &readOutValue);
}
}
void TestingReadValueFromSetupDocument_Success()
{
if (!m_Document.LoadFile(m_Filename))
{
CPPUNIT_ASSERT_MESSAGE("Test Setup failed, could not open file", !m_Document.LoadFile(m_Filename));
}
else
{
m_DoubleTest = m_Document.FirstChildElement(m_ElementToStoreAttributeName);
CPPUNIT_ASSERT_MESSAGE("Test Setup could open file", m_DoubleTest != nullptr);
}
}
/**
* this first test ensures we can correctly readout values from the
* TinyXMLDocument.
*/
void TestingReadOutValueWorks_Success()
{
double readValue;
CPPUNIT_ASSERT_MESSAGE("checking if readout mechanism works.",
TIXML_SUCCESS == readValueFromSetupDocument(readValue));
}
void TestDoubleValueWriteOut_Success()
{
const double valueToWrite = -1.123456;
const int validDigitsAfterComma = 6; // indicates the number of valid digits after comma of valueToWrite
const double neededPrecision = calcPrecision(validDigitsAfterComma + 1);
double readValue;
Setup(valueToWrite);
readValueFromSetupDocument(readValue);
CPPUNIT_ASSERT_MESSAGE("Testing if value valueToWrite equals readValue which was retrieved from TinyXML document",
mitk::Equal(valueToWrite, readValue, neededPrecision));
}
void TestDoubleValueWriteOutManyDecimalPlaces_Success()
{
const double valueToWrite = -1.12345678910111;
const int validDigitsAfterComma = 14; // indicates the number of valid digits after comma of valueToWrite
const double neededPrecision = calcPrecision(validDigitsAfterComma + 1);
double readValue;
Setup(valueToWrite);
readValueFromSetupDocument(readValue);
CPPUNIT_ASSERT_MESSAGE("Testing if value valueToWrite equals readValue which was retrieved from TinyXML document",
mitk::Equal(valueToWrite, readValue, neededPrecision));
}
};
MITK_TEST_SUITE_REGISTRATION(mitkTinyXML)
diff --git a/Modules/Core/test/mitkUIDGeneratorTest.cpp b/Modules/Core/test/mitkUIDGeneratorTest.cpp
index 84b7f86640..12dd6aa337 100644
--- a/Modules/Core/test/mitkUIDGeneratorTest.cpp
+++ b/Modules/Core/test/mitkUIDGeneratorTest.cpp
@@ -1,59 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+// Testing
+#include "mitkTestFixture.h"
+#include "mitkTestingMacros.h"
+// std includes
+#include <string>
+// MITK includes
#include "mitkUIDGenerator.h"
#include <mitkLogMacros.h>
#include <mitkTestFixture.h>
#include <mitkTestingMacros.h>
class mitkUIDGeneratorTestSuite : public mitk::TestFixture
{
CPPUNIT_TEST_SUITE(mitkUIDGeneratorTestSuite);
MITK_TEST(UIDGeneratorInstanceRenewalSucceed);
MITK_TEST(UIDGeneratorMultipleInstancesSucceed);
CPPUNIT_TEST_SUITE_END();
unsigned short m_UidLengthStart = 5;
unsigned short m_UidLengthEnd = 20;
void UIDGeneratorInstanceRenewalSucceed()
{
for (auto k = m_UidLengthStart; k < m_UidLengthEnd; ++k)
{
mitk::UIDGenerator uidGen1("UID_", k);
auto uid1_1 = uidGen1.GetUID();
uidGen1 = mitk::UIDGenerator("UID_", k);
auto uid2_1 = uidGen1.GetUID();
CPPUNIT_ASSERT_MESSAGE("Different UIDs are not allowed to be equal", uid1_1 != uid2_1);
}
}
void UIDGeneratorMultipleInstancesSucceed()
{
for (auto k = m_UidLengthStart; k < m_UidLengthEnd; ++k)
{
mitk::UIDGenerator uidGen1("UID_", k);
mitk::UIDGenerator uidGen2("UID_", k);
auto uid1_1 = uidGen1.GetUID();
auto uid2_1 = uidGen2.GetUID();
CPPUNIT_ASSERT_MESSAGE("Different UIDs are not allowed to be equal", uid1_1 != uid2_1);
}
}
};
MITK_TEST_SUITE_REGISTRATION(mitkUIDGenerator)
diff --git a/Modules/CppMicroServices/doc/doxygen.conf.in b/Modules/CppMicroServices/doc/doxygen.conf.in
index 32b597b2d5..6e7ffad4eb 100644
--- a/Modules/CppMicroServices/doc/doxygen.conf.in
+++ b/Modules/CppMicroServices/doc/doxygen.conf.in
@@ -1,2308 +1,2293 @@
# Doxyfile 1.8.5
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a double hash (##) is considered a comment and is placed in
# front of the TAG it is preceding.
#
# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
# TAG = value [value, ...]
# For lists, items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (\" \").
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the config file
# that follow. The default is UTF-8 which is also the encoding used for all text
# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
# for the list of possible encodings.
# The default value is: UTF-8.
DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
# double-quotes, unless you are using Doxywizard) that should identify the
# project for which the documentation is generated. This name is used in the
# title of most generated pages and in a few other places.
# The default value is: My Project.
PROJECT_NAME = "C++ Micro Services"
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = @CppMicroServices_VERSION@
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF = "A dynamic OSGi-like C++ service registry"
# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
# the documentation. The maximum height of the logo should not exceed 55 pixels
# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
# to the output directory.
PROJECT_LOGO =
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY = "@US_DOXYGEN_OUTPUT_DIR@"
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
# will distribute the generated files over these directories. Enabling this
# option can be useful when feeding doxygen a huge amount of source files, where
# putting all generated files in the same directory would otherwise causes
# performance problems for the file system.
# The default value is: NO.
CREATE_SUBDIRS = NO
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# Possible values are: Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-
# Traditional, Croatian, Czech, Danish, Dutch, English, Esperanto, Farsi,
# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en,
# Korean, Korean-en, Latvian, Norwegian, Macedonian, Persian, Polish,
# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish,
# Turkish, Ukrainian and Vietnamese.
# The default value is: English.
OUTPUT_LANGUAGE = English
# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
# descriptions after the members that are listed in the file and class
# documentation (similar to Javadoc). Set to NO to disable this.
# The default value is: YES.
BRIEF_MEMBER_DESC = YES
# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
# description of a member or function before the detailed description
#
# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
# The default value is: YES.
REPEAT_BRIEF = YES
# This tag implements a quasi-intelligent brief description abbreviator that is
# used to form the text in various listings. Each string in this list, if found
# as the leading text of the brief description, will be stripped from the text
# and the result, after processing the whole list, is used as the annotated
# text. Otherwise, the brief description is used as-is. If left blank, the
# following values are used ($name is automatically replaced with the name of
# the entity):The $name class, The $name widget, The $name file, is, provides,
# specifies, contains, represents, a, an and the.
ABBREVIATE_BRIEF =
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# doxygen will generate a detailed section even if there is only a brief
# description.
# The default value is: NO.
ALWAYS_DETAILED_SEC = NO
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
# The default value is: NO.
INLINE_INHERITED_MEMB = NO
# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
# before files name in the file list and in the header files. If set to NO the
# shortest path that makes the file name unique will be used
# The default value is: YES.
FULL_PATH_NAMES = NO
# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
# Stripping is only done if one of the specified strings matches the left-hand
# part of the path. The tag can be used to show relative paths in the file list.
# If left blank the directory from which doxygen is run is used as the path to
# strip.
#
# Note that you can specify absolute paths here, but also relative paths, which
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
STRIP_FROM_PATH =
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
# header file to include in order to use a class. If left blank only the name of
# the header file containing the class definition is used. Otherwise one should
# specify the list of include paths that are normally passed to the compiler
# using the -I flag.
STRIP_FROM_INC_PATH =
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
# less readable) file names. This can be useful is your file systems doesn't
# support long names like on DOS, Mac, or CD-ROM.
# The default value is: NO.
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
# first line (until the first dot) of a Javadoc-style comment as the brief
# description. If set to NO, the Javadoc-style will behave just like regular Qt-
# style comments (thus requiring an explicit @brief command for a brief
# description.)
# The default value is: NO.
JAVADOC_AUTOBRIEF = YES
# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
# line (until the first dot) of a Qt-style comment as the brief description. If
# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
# requiring an explicit \brief command for a brief description.)
# The default value is: NO.
QT_AUTOBRIEF = NO
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
# a brief description. This used to be the default behavior. The new default is
# to treat a multi-line C++ comment block as a detailed description. Set this
# tag to YES if you prefer the old behavior instead.
#
# Note that setting this tag to YES also means that rational rose comments are
# not recognized any more.
# The default value is: NO.
MULTILINE_CPP_IS_BRIEF = NO
# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
# documentation from any documented member that it re-implements.
# The default value is: YES.
INHERIT_DOCS = YES
# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
# new page for each member. If set to NO, the documentation of a member will be
# part of the file/class/namespace that contains it.
# The default value is: NO.
SEPARATE_MEMBER_PAGES = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
# uses this value to replace tabs by spaces in code fragments.
# Minimum value: 1, maximum value: 16, default value: 4.
TAB_SIZE = 2
# This tag can be used to specify a number of aliases that act as commands in
# the documentation. An alias has the form:
# name=value
# For example adding
# "sideeffect=@par Side Effects:\n"
# will allow you to put the command \sideeffect (or @sideeffect) in the
# documentation, which will result in a user-defined paragraph with heading
# "Side Effects:". You can put \n's in the value part of an alias to insert
# newlines.
ALIASES = "FIXME=\par Fix Me's:\n" \
"embmainpage{1}=@US_DOXYGEN_MAIN_PAGE_CMD@"
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
# will allow you to use the command class in the itcl::class meaning.
TCL_SUBST =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For
# instance, some of the names that are used will be different. The list of all
# members will be omitted, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_FOR_C = NO
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
# Python sources only. Doxygen will then generate output that is more tailored
# for that language. For instance, namespaces will be presented as packages,
# qualified scopes will look different, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_JAVA = NO
# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
# sources. Doxygen will then generate output that is tailored for Fortran.
# The default value is: NO.
OPTIMIZE_FOR_FORTRAN = NO
# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
# sources. Doxygen will then generate output that is tailored for VHDL.
# The default value is: NO.
OPTIMIZE_OUTPUT_VHDL = NO
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
# using this tag. The format is ext=language, where ext is a file extension, and
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make
# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
# (default is Fortran), use: inc=Fortran f=C.
#
# Note For files without extension you can use no_extension as a placeholder.
#
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
# the files are not read by doxygen.
EXTENSION_MAPPING =
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
# according to the Markdown format, which allows for more readable
# documentation. See http://daringfireball.net/projects/markdown/ for details.
# The output of markdown processing is further processed by doxygen, so you can
# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
# case of backward compatibilities issues.
# The default value is: YES.
MARKDOWN_SUPPORT = YES
# When enabled doxygen tries to link words that correspond to documented
# classes, or namespaces to their corresponding documentation. Such a link can
# be prevented in individual cases by by putting a % sign in front of the word
# or globally by setting AUTOLINK_SUPPORT to NO.
# The default value is: YES.
AUTOLINK_SUPPORT = YES
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
# to include (a tag file for) the STL sources as input, then you should set this
# tag to YES in order to let doxygen match functions declarations and
# definitions whose arguments contain STL classes (e.g. func(std::string);
# versus func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
# The default value is: NO.
BUILTIN_STL_SUPPORT = YES
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
# The default value is: NO.
CPP_CLI_SUPPORT = NO
# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
# will parse them like normal C++ but will assume all classes use public instead
# of private inheritance when no explicit protection keyword is present.
# The default value is: NO.
SIP_SUPPORT = NO
# For Microsoft's IDL there are propget and propput attributes to indicate
# getter and setter methods for a property. Setting this option to YES will make
# doxygen to replace the get and set methods by a property in the documentation.
# This will only work if the methods are indeed getting or setting a simple
# type. If this is not the case, or you want to show the methods anyway, you
# should set this option to NO.
# The default value is: YES.
IDL_PROPERTY_SUPPORT = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
# The default value is: NO.
DISTRIBUTE_GROUP_DOC = YES
# Set the SUBGROUPING tag to YES to allow class member groups of the same type
# (for instance a group of public functions) to be put as a subgroup of that
# type (e.g. under the Public Functions section). Set it to NO to prevent
# subgrouping. Alternatively, this can be done per class using the
# \nosubgrouping command.
# The default value is: YES.
SUBGROUPING = YES
# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
# are shown inside the group in which they are included (e.g. using \ingroup)
# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
# and RTF).
#
# Note that this feature does not work in combination with
# SEPARATE_MEMBER_PAGES.
# The default value is: NO.
INLINE_GROUPED_CLASSES = NO
# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
# with only public data fields or simple typedef fields will be shown inline in
# the documentation of the scope in which they are defined (i.e. file,
# namespace, or group documentation), provided this scope is documented. If set
# to NO, structs, classes, and unions are shown on a separate page (for HTML and
# Man pages) or section (for LaTeX and RTF).
# The default value is: NO.
INLINE_SIMPLE_STRUCTS = NO
# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
# enum is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
# namespace, or class. And the struct will be named TypeS. This can typically be
# useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name.
# The default value is: NO.
TYPEDEF_HIDES_STRUCT = NO
# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
# cache is used to resolve symbols given their name and scope. Since this can be
# an expensive process and often the same symbol appears multiple times in the
# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
# doxygen will become slower. If the cache is too large, memory is wasted. The
# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
# symbols. At the end of a run doxygen will report the cache usage and suggest
# the optimal cache size from a speed point of view.
# Minimum value: 0, maximum value: 9, default value: 0.
LOOKUP_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
# documentation are documented, even if no documentation was available. Private
# class members and static file members will be hidden unless the
# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
# Note: This will also disable the warnings about undocumented members that are
# normally produced when WARNINGS is set to YES.
# The default value is: NO.
EXTRACT_ALL = YES
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
# be included in the documentation.
# The default value is: NO.
EXTRACT_PRIVATE = NO
# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
# scope will be included in the documentation.
# The default value is: NO.
EXTRACT_PACKAGE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
# included in the documentation.
# The default value is: NO.
EXTRACT_STATIC = YES
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
# locally in source files will be included in the documentation. If set to NO
# only classes defined in header files are included. Does not have any effect
# for Java sources.
# The default value is: YES.
EXTRACT_LOCAL_CLASSES = NO
# This flag is only useful for Objective-C code. When set to YES local methods,
# which are defined in the implementation section but not in the interface are
# included in the documentation. If set to NO only methods in the interface are
# included.
# The default value is: NO.
EXTRACT_LOCAL_METHODS = NO
# If this flag is set to YES, the members of anonymous namespaces will be
# extracted and appear in the documentation as a namespace called
# 'anonymous_namespace{file}', where file will be replaced with the base name of
# the file that contains the anonymous namespace. By default anonymous namespace
# are hidden.
# The default value is: NO.
EXTRACT_ANON_NSPACES = NO
# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
# undocumented members inside documented classes or files. If set to NO these
# members will be included in the various overviews, but no documentation
# section is generated. This option has no effect if EXTRACT_ALL is enabled.
# The default value is: NO.
HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy. If set
# to NO these classes will be included in the various overviews. This option has
# no effect if EXTRACT_ALL is enabled.
# The default value is: NO.
HIDE_UNDOC_CLASSES = NO
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
# (class|struct|union) declarations. If set to NO these declarations will be
# included in the documentation.
# The default value is: NO.
HIDE_FRIEND_COMPOUNDS = YES
# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
# documentation blocks found inside the body of a function. If set to NO these
# blocks will be appended to the function's detailed documentation block.
# The default value is: NO.
HIDE_IN_BODY_DOCS = NO
# The INTERNAL_DOCS tag determines if documentation that is typed after a
# \internal command is included. If the tag is set to NO then the documentation
# will be excluded. Set it to YES to include the internal documentation.
# The default value is: NO.
INTERNAL_DOCS = NO
# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
# names in lower-case letters. If set to YES upper-case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# and Mac users are advised to set this option to NO.
# The default value is: system dependent.
CASE_SENSE_NAMES = YES
# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
# their full class and namespace scopes in the documentation. If set to YES the
# scope will be hidden.
# The default value is: NO.
HIDE_SCOPE_NAMES = NO
# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
# the files that are included by a file in the documentation of that file.
# The default value is: YES.
SHOW_INCLUDE_FILES = NO
# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
# files with double quotes in the documentation rather than with sharp brackets.
# The default value is: NO.
FORCE_LOCAL_INCLUDES = NO
# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
# documentation for inline members.
# The default value is: YES.
INLINE_INFO = YES
# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
# (detailed) documentation of file and class members alphabetically by member
# name. If set to NO the members will appear in declaration order.
# The default value is: YES.
SORT_MEMBER_DOCS = YES
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
# descriptions of file, namespace and class members alphabetically by member
# name. If set to NO the members will appear in declaration order.
# The default value is: NO.
SORT_BRIEF_DOCS = NO
# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
# (brief and detailed) documentation of class members so that constructors and
# destructors are listed first. If set to NO the constructors will appear in the
# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
# member documentation.
# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
# detailed member documentation.
# The default value is: NO.
SORT_MEMBERS_CTORS_1ST = NO
# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
# of group names into alphabetical order. If set to NO the group names will
# appear in their defined order.
# The default value is: NO.
SORT_GROUP_NAMES = NO
# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
# fully-qualified names, including namespaces. If set to NO, the class list will
# be sorted only by class name, not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
# Note: This option applies only to the class list, not to the alphabetical
# list.
# The default value is: NO.
SORT_BY_SCOPE_NAME = YES
# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
# type resolution of all parameters of a function it will reject a match between
# the prototype and the implementation of a member function even if there is
# only one candidate or it is obvious which candidate to choose by doing a
# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
# accept a match between prototype and implementation in such cases.
# The default value is: NO.
STRICT_PROTO_MATCHING = NO
# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
# todo list. This list is created by putting \todo commands in the
# documentation.
# The default value is: YES.
GENERATE_TODOLIST = YES
# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
# test list. This list is created by putting \test commands in the
# documentation.
# The default value is: YES.
GENERATE_TESTLIST = YES
# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
# list. This list is created by putting \bug commands in the documentation.
# The default value is: YES.
GENERATE_BUGLIST = YES
# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
# the deprecated list. This list is created by putting \deprecated commands in
# the documentation.
# The default value is: YES.
GENERATE_DEPRECATEDLIST= YES
# The ENABLED_SECTIONS tag can be used to enable conditional documentation
# sections, marked by \if <section_label> ... \endif and \cond <section_label>
# ... \endcond blocks.
ENABLED_SECTIONS = @US_DOXYGEN_ENABLED_SECTIONS@
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
# initial value of a variable or macro / define can have for it to appear in the
# documentation. If the initializer consists of more lines than specified here
# it will be hidden. Use a value of 0 to hide initializers completely. The
# appearance of the value of individual variables and macros / defines can be
# controlled using \showinitializer or \hideinitializer command in the
# documentation regardless of this setting.
# Minimum value: 0, maximum value: 10000, default value: 30.
MAX_INITIALIZER_LINES = 0
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
# the bottom of the documentation of classes and structs. If set to YES the list
# will mention the files that were used to generate the documentation.
# The default value is: YES.
SHOW_USED_FILES = NO
# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
# will remove the Files entry from the Quick Index and from the Folder Tree View
# (if specified).
# The default value is: YES.
SHOW_FILES = NO
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
# page. This will remove the Namespaces entry from the Quick Index and from the
# Folder Tree View (if specified).
# The default value is: YES.
SHOW_NAMESPACES = YES
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
# doxygen should invoke to get the current version for each file (typically from
# the version control system). Doxygen will invoke the program by executing (via
# popen()) the command command input-file, where command is the value of the
# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
# by doxygen. Whatever the program writes to standard output is used as the file
# version. For an example see the documentation.
FILE_VERSION_FILTER =
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
# output files in an output format independent way. To create the layout file
# that represents doxygen's defaults, run doxygen with the -l option. You can
# optionally specify a file name after the option, if omitted DoxygenLayout.xml
# will be used as the name of the layout file.
#
# Note that if you run doxygen from a directory containing a file called
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.
LAYOUT_FILE =
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
# extension is automatically appended if omitted. This requires the bibtex tool
# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
# For LaTeX the style of the bibliography can be controlled using
# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
# search path. Do not use file names with spaces, bibtex cannot handle them. See
# also \cite for info how to create references.
CITE_BIB_FILES =
#---------------------------------------------------------------------------
# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
# The QUIET tag can be used to turn on/off the messages that are generated to
# standard output by doxygen. If QUIET is set to YES this implies that the
# messages are off.
# The default value is: NO.
QUIET = NO
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
# this implies that the warnings are on.
#
# Tip: Turn warnings on while writing the documentation.
# The default value is: YES.
WARNINGS = YES
# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
# will automatically be disabled.
# The default value is: YES.
WARN_IF_UNDOCUMENTED = YES
# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some parameters
# in a documented function, or documenting parameters that don't exist or using
# markup commands wrongly.
# The default value is: YES.
WARN_IF_DOC_ERROR = YES
# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
# are documented, but have no documentation for their parameters or return
# value. If set to NO doxygen will only warn about wrong or incomplete parameter
# documentation, but not about the absence of documentation.
# The default value is: NO.
WARN_NO_PARAMDOC = YES
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
# can produce. The string should contain the $file, $line, and $text tags, which
# will be replaced by the file and line number from which the warning originated
# and the warning text. Optionally the format may contain $version, which will
# be replaced by the version of the file (if it could be obtained via
# FILE_VERSION_FILTER)
# The default value is: $file:$line: $text.
WARN_FORMAT = "$file:$line: $text"
# The WARN_LOGFILE tag can be used to specify a file to which warning and error
# messages should be written. If left blank the output is written to standard
# error (stderr).
WARN_LOGFILE =
#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag is used to specify the files and/or directories that contain
# documented source files. You may enter file names like myfile.cpp or
# directories like /usr/src/myproject. Separate the files or directories with
# spaces.
# Note: If this tag is empty the current directory is searched.
INPUT = "@PROJECT_SOURCE_DIR@" \
"@PROJECT_SOURCE_DIR@/cmake/usFunctionAddResources.cmake" \
"@PROJECT_SOURCE_DIR@/cmake/usFunctionEmbedResources.cmake" \
"@PROJECT_SOURCE_DIR@/cmake/usFunctionGenerateModuleInit.cmake" \
"@PROJECT_SOURCE_DIR@/cmake/usFunctionGetResourceSource.cmake" \
"@PROJECT_BINARY_DIR@/include/usGlobalConfig.h" \
"@PROJECT_BINARY_DIR@/core/include"
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
# documentation (see: http://www.gnu.org/software/libiconv) for the list of
# possible encodings.
# The default value is: UTF-8.
INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
# *.h) to filter out the source-files in the directories. If left blank the
# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
# *.qsf, *.as and *.js.
FILE_PATTERNS = *.h \
*.dox \
*.md
# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
# The default value is: NO.
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
#
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE = "@PROJECT_SOURCE_DIR@/README.md" \
"@PROJECT_SOURCE_DIR@/gh-pages/" \
"@PROJECT_SOURCE_DIR@/third_party/" \
"@PROJECT_SOURCE_DIR@/.git/"
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
# The default value is: NO.
EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories.
#
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS = */test/* \
*/snippets/* \
*/core/examples/* \
*/.git/* \
*_p.h \
*Private.*
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
#
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*
EXCLUDE_SYMBOLS = us \
US_NAMESPACE \
*Private* \
ModuleInfo \
ServiceObjectsBase* \
TrackedService*
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
# that contain example code fragments that are included (see the \include
# command).
EXAMPLE_PATH = "@PROJECT_SOURCE_DIR@/core/doc/snippets/" \
"@PROJECT_SOURCE_DIR@/core/examples/"
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
# *.h) to filter out the source-files in the directories. If left blank all
# files are included.
EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude commands
# irrespective of the value of the RECURSIVE tag.
# The default value is: NO.
EXAMPLE_RECURSIVE = YES
# The IMAGE_PATH tag can be used to specify one or more files or directories
# that contain images that are to be included in the documentation (see the
# \image command).
IMAGE_PATH =
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
# by executing (via popen()) the command:
#
# <filter> <input-file>
#
# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
# name of an input file. Doxygen will then use the output that the filter
# program writes to standard output. If FILTER_PATTERNS is specified, this tag
# will be ignored.
#
# Note that the filter must not add or remove lines; it is applied before the
# code is scanned, but not when the output code is generated. If lines are added
# or removed, the anchors will not be placed correctly.
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis. Doxygen will compare the file name with each pattern and apply the
# filter if there is a match. The filters are a list of the form: pattern=filter
# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
# patterns match the file name, INPUT_FILTER is applied.
FILTER_PATTERNS = *.cmake=@CMakeDoxygenFilter_EXECUTABLE@
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER ) will also be used to filter the input files that are used for
# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
# The default value is: NO.
FILTER_SOURCE_FILES = NO
# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
# it is also possible to disable source filtering for a specific pattern using
# *.ext= (so without naming a filter).
# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
FILTER_SOURCE_PATTERNS =
# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
# is part of the input, its contents will be placed on the main page
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.
USE_MDFILE_AS_MAINPAGE =
#---------------------------------------------------------------------------
# Configuration options related to source browsing
#---------------------------------------------------------------------------
# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
# generated. Documented entities will be cross-referenced with these sources.
#
# Note: To get rid of all source code in the generated output, make sure that
# also VERBATIM_HEADERS is set to NO.
# The default value is: NO.
SOURCE_BROWSER = NO
# Setting the INLINE_SOURCES tag to YES will include the body of functions,
# classes and enums directly into the documentation.
# The default value is: NO.
INLINE_SOURCES = NO
# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
# special comment blocks from generated source code fragments. Normal C, C++ and
# Fortran comments will always remain visible.
# The default value is: YES.
STRIP_CODE_COMMENTS = NO
# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
# function all documented functions referencing it will be listed.
# The default value is: NO.
REFERENCED_BY_RELATION = YES
# If the REFERENCES_RELATION tag is set to YES then for each documented function
# all documented entities called/used by that function will be listed.
# The default value is: NO.
REFERENCES_RELATION = YES
# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
# link to the documentation.
# The default value is: YES.
REFERENCES_LINK_SOURCE = YES
# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
# source code will show a tooltip with additional information such as prototype,
# brief description and links to the definition and documentation. Since this
# will make the HTML file larger and loading of large files a bit slower, you
# can opt to disable this feature.
# The default value is: YES.
# This tag requires that the tag SOURCE_BROWSER is set to YES.
SOURCE_TOOLTIPS = YES
# If the USE_HTAGS tag is set to YES then the references to source code will
# point to the HTML generated by the htags(1) tool instead of doxygen built-in
# source browser. The htags tool is part of GNU's global source tagging system
# (see http://www.gnu.org/software/global/global.html). You will need version
# 4.8.6 or higher.
#
# To use it do the following:
# - Install the latest version of global
# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
# - Make sure the INPUT points to the root of the source tree
# - Run doxygen as normal
#
# Doxygen will invoke htags (and that will in turn invoke gtags), so these
# tools must be available from the command line (i.e. in the search path).
#
# The result: instead of the source browser generated by doxygen, the links to
# source code will now point to the output of htags.
# The default value is: NO.
# This tag requires that the tag SOURCE_BROWSER is set to YES.
USE_HTAGS = NO
# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
# verbatim copy of the header file for each class for which an include is
# specified. Set to NO to disable this.
# See also: Section \class.
# The default value is: YES.
VERBATIM_HEADERS = NO
#---------------------------------------------------------------------------
# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
# compounds will be generated. Enable this if the project contains a lot of
# classes, structs, unions or interfaces.
# The default value is: YES.
ALPHABETICAL_INDEX = YES
# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
# which the alphabetical index list will be split.
# Minimum value: 1, maximum value: 20, default value: 5.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
COLS_IN_ALPHA_INDEX = 3
# In case all classes in a project start with a common prefix, all classes will
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
# can be used to specify a prefix (or a list of prefixes) that should be ignored
# while generating the index headers.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the HTML output
#---------------------------------------------------------------------------
# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
# The default value is: YES.
GENERATE_HTML = YES
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: html.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_OUTPUT = "@US_DOXYGEN_HTML_OUTPUT@"
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
# generated HTML page (for example: .htm, .php, .asp).
# The default value is: .html.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FILE_EXTENSION = .html
# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
# each generated HTML page. If the tag is left blank doxygen will generate a
# standard header.
#
# To get valid HTML the header file that includes any scripts and style sheets
# that doxygen needs, which is dependent on the configuration options used (e.g.
# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
# default header using
# doxygen -w html new_header.html new_footer.html new_stylesheet.css
# YourConfigFile
# and then modify the file new_header.html. See also section "Doxygen usage"
# for information on how to generate the default header that doxygen normally
# uses.
# Note: The header is subject to change so you typically have to regenerate the
# default header when upgrading to a newer version of doxygen. For a description
# of the possible markers and block names see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_HEADER = "@US_DOXYGEN_HEADER@"
# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
# generated HTML page. If the tag is left blank doxygen will generate a standard
# footer. See HTML_HEADER for more information on how to generate a default
# footer and what special commands can be used inside the footer. See also
# section "Doxygen usage" for information on how to generate the default footer
# that doxygen normally uses.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FOOTER = "@US_DOXYGEN_FOOTER@"
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
# sheet that is used by each HTML page. It can be used to fine-tune the look of
# the HTML output. If left blank doxygen will generate a default style sheet.
# See also section "Doxygen usage" for information on how to generate the style
# sheet that doxygen normally uses.
# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
# it is more robust and this tag (HTML_STYLESHEET) will in the future become
# obsolete.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_STYLESHEET =
# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-
# defined cascading style sheet that is included after the standard style sheets
# created by doxygen. Using this option one can overrule certain style aspects.
# This is preferred over using HTML_STYLESHEET since it does not replace the
# standard style sheet and is therefor more robust against future updates.
# Doxygen will copy the style sheet file to the output directory. For an example
# see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_STYLESHEET = "@US_DOXYGEN_EXTRA_CSS@"
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
# that these files will be copied to the base HTML output directory. Use the
# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
# files will be copied as-is; there are no commands or markers available.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_FILES =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
# will adjust the colors in the stylesheet and background images according to
# this color. Hue is specified as an angle on a colorwheel, see
# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
# purple, and 360 is red again.
# Minimum value: 0, maximum value: 359, default value: 220.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_HUE = 220
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
# in the HTML output. For a value of 0 the output will use grayscales only. A
# value of 255 will produce the most vivid colors.
# Minimum value: 0, maximum value: 255, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_SAT = 100
# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
# luminance component of the colors in the HTML output. Values below 100
# gradually make the output lighter, whereas values above 100 make the output
# darker. The value divided by 100 is the actual gamma applied, so 80 represents
# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
# change the gamma.
# Minimum value: 40, maximum value: 240, default value: 80.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_GAMMA = 80
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting this
# to NO can help when comparing the output of multiple runs.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_TIMESTAMP = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_DYNAMIC_SECTIONS = NO
# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
# shown in the various tree structured indices initially; the user can expand
# and collapse entries dynamically later on. Doxygen will expand the tree to
# such a level that at most the specified number of entries are visible (unless
# a fully collapsed tree already exceeds this amount). So setting the number of
# entries 1 will produce a full collapsed tree by default. 0 is a special value
# representing an infinite number of entries and will result in a full expanded
# tree by default.
# Minimum value: 0, maximum value: 9999, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_INDEX_NUM_ENTRIES = 100
# If the GENERATE_DOCSET tag is set to YES, additional index files will be
# generated that can be used as input for Apple's Xcode 3 integrated development
# environment (see: http://developer.apple.com/tools/xcode/), introduced with
# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
# Makefile in the HTML output directory. Running make will produce the docset in
# that directory and running make install will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
# for more information.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_DOCSET = NO
# This tag determines the name of the docset feed. A documentation feed provides
# an umbrella under which multiple documentation sets from a single provider
# (such as a company or product suite) can be grouped.
# The default value is: Doxygen generated docs.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_FEEDNAME = "Doxygen generated docs"
# This tag specifies a string that should uniquely identify the documentation
# set bundle. This should be a reverse domain-name style string, e.g.
# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_BUNDLE_ID = org.doxygen.Project
# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
# the documentation publisher. This should be a reverse domain-name style
# string, e.g. com.mycompany.MyDocSet.documentation.
# The default value is: org.doxygen.Publisher.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
# The default value is: Publisher.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_NAME = Publisher
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
# Windows.
#
# The HTML Help Workshop contains a compiler that can convert all HTML output
# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
# files are now used as the Windows 98 help format, and will replace the old
# Windows help format (.hlp) on all Windows platforms in the future. Compressed
# HTML files also contain an index, a table of contents, and you can search for
# words in the documentation. The HTML workshop also contains a viewer for
# compressed HTML files.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_HTMLHELP = NO
# The CHM_FILE tag can be used to specify the file name of the resulting .chm
# file. You can add a path in front of the file if the result should not be
# written to the html output directory.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_FILE =
# The HHC_LOCATION tag can be used to specify the location (absolute path
# including file name) of the HTML help compiler ( hhc.exe). If non-empty
# doxygen will try to run the HTML help compiler on the generated index.hhp.
# The file has to be specified with full path.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
HHC_LOCATION =
# The GENERATE_CHI flag controls if a separate .chi index file is generated (
# YES) or that it should be included in the master .chm file ( NO).
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
GENERATE_CHI = NO
# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
# and project file content.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_INDEX_ENCODING =
# The BINARY_TOC flag controls whether a binary table of contents is generated (
# YES) or a normal table of contents ( NO) in the .chm file.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
BINARY_TOC = NO
# The TOC_EXPAND flag can be set to YES to add extra items for group members to
# the table of contents of the HTML help documentation and to the tree view.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
TOC_EXPAND = NO
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
# (.qch) of the generated HTML documentation.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_QHP = NO
# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
# the file name of the resulting .qch file. The path specified is relative to
# the HTML output folder.
# This tag requires that the tag GENERATE_QHP is set to YES.
QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace
# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_NAMESPACE =
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
# Help Project output. For more information please see Qt Help Project / Virtual
# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
# folders).
# The default value is: doc.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_VIRTUAL_FOLDER =
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
# filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
# The QHG_LOCATION tag can be used to specify the location of Qt's
# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
# generated .qhp file.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHG_LOCATION =
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
# generated, together with the HTML files, they form an Eclipse help plugin. To
# install this plugin and make it available under the help contents menu in
# Eclipse, the contents of the directory containing the HTML and XML files needs
# to be copied into the plugins directory of eclipse. The name of the directory
# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
# After copying Eclipse needs to be restarted before the help appears.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_ECLIPSEHELP = NO
# A unique identifier for the Eclipse help plugin. When installing the plugin
# the directory name containing the HTML and XML files should also have this
# name. Each documentation set should have its own identifier.
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
ECLIPSE_DOC_ID = org.doxygen.Project
# If you want full control over the layout of the generated HTML pages it might
# be necessary to disable the index and replace it with your own. The
# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
# of each HTML page. A value of NO enables the index and the value YES disables
# it. Since the tabs in the index contain the same information as the navigation
# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
DISABLE_INDEX = NO
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
# structure should be generated to display hierarchical information. If the tag
# value is set to YES, a side panel will be generated containing a tree-like
# index structure (just like the one that is generated for HTML Help). For this
# to work a browser that supports JavaScript, DHTML, CSS and frames is required
# (i.e. any modern browser). Windows users are probably better off using the
# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
# further fine-tune the look of the index. As an example, the default style
# sheet generated by doxygen has an example that shows how to put an image at
# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
# the same information as the tab index, you could consider setting
# DISABLE_INDEX to YES when enabling this option.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_TREEVIEW = NO
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
# doxygen will group on one line in the generated HTML documentation.
#
# Note that a value of 0 will completely suppress the enum values from appearing
# in the overview section.
# Minimum value: 0, maximum value: 20, default value: 4.
# This tag requires that the tag GENERATE_HTML is set to YES.
ENUM_VALUES_PER_LINE = 4
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
# to set the initial width (in pixels) of the frame in which the tree is shown.
# Minimum value: 0, maximum value: 1500, default value: 250.
# This tag requires that the tag GENERATE_HTML is set to YES.
TREEVIEW_WIDTH = 300
# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
# external symbols imported via tag files in a separate window.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
EXT_LINKS_IN_WINDOW = NO
# Use this tag to change the font size of LaTeX formulas included as images in
# the HTML documentation. When you change the font size after a successful
# doxygen run you need to manually remove any form_*.png images from the HTML
# output directory to force them to be regenerated.
# Minimum value: 8, maximum value: 50, default value: 10.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_FONTSIZE = 10
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not
# supported properly for IE 6.0, but are supported on all modern browsers.
#
# Note that when changing this option you need to delete any form_*.png files in
# the HTML output directory before the changes have effect.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_TRANSPARENT = YES
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
# http://www.mathjax.org) which uses client side Javascript for the rendering
# instead of using prerendered bitmaps. Use this if you do not have LaTeX
# installed or if you want to formulas look prettier in the HTML output. When
# enabled you may also need to install MathJax separately and configure the path
# to it using the MATHJAX_RELPATH option.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
USE_MATHJAX = NO
# When MathJax is enabled you can set the default output format to be used for
# the MathJax output. See the MathJax site (see:
# http://docs.mathjax.org/en/latest/output.html) for more details.
# Possible values are: HTML-CSS (which is slower, but has the best
# compatibility), NativeMML (i.e. MathML) and SVG.
# The default value is: HTML-CSS.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_FORMAT = HTML-CSS
# When MathJax is enabled you need to specify the location relative to the HTML
# output directory using the MATHJAX_RELPATH option. The destination directory
# should contain the MathJax.js script. For instance, if the mathjax directory
# is located at the same level as the HTML output directory, then
# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
# Content Delivery Network so you can quickly see the result without installing
# MathJax. However, it is strongly recommended to install a local copy of
# MathJax from http://www.mathjax.org before deployment.
# The default value is: http://cdn.mathjax.org/mathjax/latest.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
# extension names that should be enabled during MathJax rendering. For example
# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_EXTENSIONS =
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
# of code that will be used on startup of the MathJax code. See the MathJax site
# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
# example see the documentation.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_CODEFILE =
# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
# the HTML output. The underlying search engine uses javascript and DHTML and
# should work on any modern browser. Note that when using HTML help
# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
# there is already a search function so this one should typically be disabled.
# For large projects the javascript based search engine can be slow, then
# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
# search using the keyboard; to jump to the search box use <access key> + S
# (what the <access key> is depends on the OS and browser, but it is typically
# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
# key> to jump into the search results window, the results can be navigated
# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
# the search. The filter options can be selected when the cursor is inside the
# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
# to select a filter and <Enter> or <escape> to activate or cancel the filter
# option.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
SEARCHENGINE = YES
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
# implemented using a web server instead of a web client using Javascript. There
# are two flavours of web server based searching depending on the
# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for
# searching and an index file used by the script. When EXTERNAL_SEARCH is
# enabled the indexing and searching needs to be provided by external tools. See
# the section "External Indexing and Searching" for details.
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
SERVER_BASED_SEARCH = NO
# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
# script for searching. Instead the search results are written to an XML file
# which needs to be processed by an external indexer. Doxygen will invoke an
# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
# search results.
#
# Doxygen ships with an example indexer ( doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: http://xapian.org/).
#
# See the section "External Indexing and Searching" for details.
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH = NO
# The SEARCHENGINE_URL should point to a search engine hosted by a web server
# which will return the search results when EXTERNAL_SEARCH is enabled.
#
# Doxygen ships with an example indexer ( doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: http://xapian.org/). See the section "External Indexing and
# Searching" for details.
# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHENGINE_URL =
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
# search data is written to a file for indexing by an external tool. With the
# SEARCHDATA_FILE tag the name of this file can be specified.
# The default file is: searchdata.xml.
# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHDATA_FILE = searchdata.xml
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
# projects and redirect the results back to the right project.
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH_ID =
# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
# projects other than the one defined by this configuration file, but that are
# all added to the same external search index. Each project needs to have a
# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
# to a relative location where the documentation can be found. The format is:
# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
# The default value is: YES.
GENERATE_LATEX = NO
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked.
#
# Note that when enabling USE_PDFLATEX this option is only used for generating
# bitmaps for formulas in the HTML output, but not in the Makefile that is
# written to the output directory.
# The default file is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_CMD_NAME = latex
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
# index for LaTeX.
# The default file is: makeindex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
MAKEINDEX_CMD_NAME = makeindex
# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
# documents. This may be useful for small projects and may help to save some
# trees in general.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used by the
# printer.
# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
# 14 inches) and executive (7.25 x 10.5 inches).
# The default value is: a4.
# This tag requires that the tag GENERATE_LATEX is set to YES.
PAPER_TYPE = a4wide
# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
# that should be included in the LaTeX output. To get the times font for
# instance you can specify
# EXTRA_PACKAGES=times
# If left blank no extra packages will be included.
# This tag requires that the tag GENERATE_LATEX is set to YES.
EXTRA_PACKAGES = amssymb
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
# generated LaTeX document. The header should contain everything until the first
# chapter. If it is left blank doxygen will generate a standard header. See
# section "Doxygen usage" for information on how to let doxygen write the
# default header to a separate file.
#
# Note: Only use a user-defined header if you know what you are doing! The
# following commands have a special meaning inside the header: $title,
# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will
# replace them by respectively the title of the page, the current date and time,
# only the current date, the version number of doxygen, the project name (see
# PROJECT_NAME), or the project number (see PROJECT_NUMBER).
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HEADER =
# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
# generated LaTeX document. The footer should contain everything after the last
# chapter. If it is left blank doxygen will generate a standard footer.
#
# Note: Only use a user-defined footer if you know what you are doing!
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_FOOTER =
# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the LATEX_OUTPUT output
# directory. Note that the files will be copied as-is; there are no commands or
# markers available.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_EXTRA_FILES =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
# contain links (just like the HTML output) instead of page references. This
# makes the output suitable for online browsing using a PDF viewer.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.
PDF_HYPERLINKS = NO
# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
# the PDF file directly from the LaTeX files. Set this option to YES to get a
# higher quality PDF documentation.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.
USE_PDFLATEX = NO
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
# command to the generated LaTeX files. This will instruct LaTeX to keep running
# if errors occur, instead of asking the user for help. This option is also used
# when generating formulas in HTML.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BATCHMODE = NO
# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
# index chapters (such as File Index, Compound Index, etc.) in the output.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HIDE_INDICES = NO
# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
# code with syntax highlighting in the LaTeX output.
#
# Note that which sources are shown also depends on other settings such as
# SOURCE_BROWSER.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_SOURCE_CODE = NO
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
# bibliography, e.g. plainnat, or ieeetr. See
# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
# The default value is: plain.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BIB_STYLE = plain
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
# RTF output is optimized for Word 97 and may not look too pretty with other RTF
# readers/editors.
# The default value is: NO.
GENERATE_RTF = NO
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: rtf.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_OUTPUT = rtf
# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
# documents. This may be useful for small projects and may help to save some
# trees in general.
# The default value is: NO.
# This tag requires that the tag GENERATE_RTF is set to YES.
COMPACT_RTF = NO
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
# contain hyperlink fields. The RTF file will contain links (just like the HTML
# output) instead of page references. This makes the output suitable for online
# browsing using Word or some other Word compatible readers that support those
# fields.
#
# Note: WordPad (write) and others do not support links.
# The default value is: NO.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's config
# file, i.e. a series of assignments. You only have to provide replacements,
# missing definitions are set to their default value.
#
# See also section "Doxygen usage" for information on how to generate the
# default style sheet that doxygen normally uses.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an RTF document. Syntax is
# similar to doxygen's config file. A template extensions file can be generated
# using doxygen -e rtf extensionFile.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# Configuration options related to the man page output
#---------------------------------------------------------------------------
# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
# classes and files.
# The default value is: NO.
GENERATE_MAN = NO
# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it. A directory man3 will be created inside the directory specified by
# MAN_OUTPUT.
# The default directory is: man.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_OUTPUT = man
# The MAN_EXTENSION tag determines the extension that is added to the generated
# man pages. In case the manual section does not start with a number, the number
# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
# optional.
# The default value is: .3.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_EXTENSION = .3
# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
# will generate one additional man file for each entity documented in the real
# man page(s). These additional files only source the real man page, but without
# them the man command would be unable to find the correct page.
# The default value is: NO.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_LINKS = NO
#---------------------------------------------------------------------------
# Configuration options related to the XML output
#---------------------------------------------------------------------------
# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
# captures the structure of the code including all documentation.
# The default value is: NO.
GENERATE_XML = NO
# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: xml.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_OUTPUT = xml
# The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a
# validating XML parser to check the syntax of the XML files.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_SCHEMA =
# The XML_DTD tag can be used to specify a XML DTD, which can be used by a
# validating XML parser to check the syntax of the XML files.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_DTD =
# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
# listings (including syntax highlighting and cross-referencing information) to
# the XML output. Note that enabling this will significantly increase the size
# of the XML output.
# The default value is: YES.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
# that can be used to generate PDF.
# The default value is: NO.
GENERATE_DOCBOOK = NO
# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
# front of it.
# The default directory is: docbook.
# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
DOCBOOK_OUTPUT = docbook
#---------------------------------------------------------------------------
# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
# Definitions (see http://autogen.sf.net) file that captures the structure of
# the code including all documentation. Note that this feature is still
# experimental and incomplete at the moment.
# The default value is: NO.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# Configuration options related to the Perl module output
#---------------------------------------------------------------------------
# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
# file that captures the structure of the code including all documentation.
#
# Note that this feature is still experimental and incomplete at the moment.
# The default value is: NO.
GENERATE_PERLMOD = NO
# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
# output from the Perl module output.
# The default value is: NO.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_LATEX = NO
# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
# formatted so it can be parsed by a human reader. This is useful if you want to
# understand what is going on. On the other hand, if this tag is set to NO the
# size of the Perl module output will be much smaller and Perl will parse it
# just the same.
# The default value is: YES.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_PRETTY = YES
# The names of the make variables in the generated doxyrules.make file are
# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
# so different doxyrules.make files included by the same Makefile don't
# overwrite each other's variables.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
# C-preprocessor directives found in the sources and include files.
# The default value is: YES.
ENABLE_PREPROCESSING = YES
# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
# in the source code. If set to NO only conditional compilation will be
# performed. Macro expansion can be done in a controlled way by setting
# EXPAND_ONLY_PREDEF to YES.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
MACRO_EXPANSION = YES
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
# the macro expansion is limited to the macros specified with the PREDEFINED and
# EXPAND_AS_DEFINED tags.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_ONLY_PREDEF = YES
# If the SEARCH_INCLUDES tag is set to YES the includes files in the
# INCLUDE_PATH will be searched if a #include is found.
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by the
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH = "@PROJECT_BINARY_DIR@/include/"
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
# directories. If left blank, the patterns specified with FILE_PATTERNS will be
# used.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
INCLUDE_FILE_PATTERNS = *.h
# The PREDEFINED tag can be used to specify one or more macro names that are
# defined before the preprocessor is started (similar to the -D option of e.g.
# gcc). The argument of the tag is a list of macros of the form: name or
# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
# is assumed. To prevent a macro definition from being undefined via #undef or
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED = US_PREPEND_NAMESPACE(x)=x \
US_BEGIN_NAMESPACE= \
US_END_NAMESPACE= \
US_Core_EXPORT= \
US_ABI_LOCAL= \
US_MSVC_POP_WARNING=
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
# macro definition that is found in the sources will be used. Use the PREDEFINED
# tag if you want to use a different macro definition that overrules the
# definition found in the source code.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
# remove all refrences to function-like macros that are alone on a line, have an
# all uppercase name, and do not end with a semicolon. Such function macros are
# typically used for boiler-plate code, and will confuse the parser if not
# removed.
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration options related to external references
#---------------------------------------------------------------------------
# The TAGFILES tag can be used to specify one or more tag files. For each tag
# file the location of the external documentation should be added. The format of
# a tag file without this location is as follows:
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
# TAGFILES = file1=loc1 "file2 = loc2" ...
# where loc1 and loc2 can be relative or absolute paths or URLs. See the
# section "Linking to external documentation" for more information about the use
# of tag files.
# Note: Each tag file must have an unique name (where the name does NOT include
# the path). If a tag file is not located in the directory in which doxygen is
# run, you must also specify the path to the tagfile here.
TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
# tag file that is based on the input files it reads. See section "Linking to
# external documentation" for more information about the usage of tag files.
GENERATE_TAGFILE =
# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
# class index. If set to NO only the inherited external classes will be listed.
# The default value is: NO.
ALLEXTERNALS = NO
# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
# the modules index. If set to NO, only the current project's groups will be
# listed.
# The default value is: YES.
EXTERNAL_GROUPS = NO
# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
# the related pages index. If set to NO, only the current project's pages will
# be listed.
# The default value is: YES.
EXTERNAL_PAGES = YES
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of 'which perl').
-# The default file (with absolute path) is: /usr/bin/perl.
-
-PERL_PATH = /usr/bin/perl
-
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
# NO turns the diagrams off. Note that this option also works with HAVE_DOT
# disabled, but it is recommended to install and use dot, since it yields more
# powerful graphs.
# The default value is: YES.
CLASS_DIAGRAMS = YES
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see:
-# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
# If set to YES, the inheritance and collaboration graphs will hide inheritance
# and usage relations if the target is undocumented or is not a class.
# The default value is: YES.
HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz (see:
# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
# Bell Labs. The other options in this section have no effect if this option is
# set to NO
# The default value is: NO.
HAVE_DOT = @US_HAVE_DOT@
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
# to run in parallel. When set to 0 doxygen will base this on the number of
# processors available in the system. You can set it explicitly to a value
# larger than 0 to get control over the balance between CPU load and processing
# speed.
# Minimum value: 0, maximum value: 32, default value: 0.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_NUM_THREADS = @US_DOXYGEN_DOT_NUM_THREADS@
# When you want a differently looking font n the dot files that doxygen
# generates you can specify the font name using DOT_FONTNAME. You need to make
# sure dot is able to find the font, which can be done by putting it in a
# standard location or by setting the DOTFONTPATH environment variable or by
# setting DOT_FONTPATH to the directory containing the font.
# The default value is: Helvetica.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTNAME = Helvetica
# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
# dot graphs.
# Minimum value: 4, maximum value: 24, default value: 10.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTSIZE = 10
# By default doxygen will tell dot to use the default font as specified with
# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
# the path where dot can find it using this tag.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTPATH =
# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
# each documented class showing the direct and indirect inheritance relations.
# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
CLASS_GRAPH = YES
# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
# graph for each documented class showing the direct and indirect implementation
# dependencies (inheritance, containment, and class references variables) of the
# class with other documented classes.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
COLLABORATION_GRAPH = YES
# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
# groups, showing the direct groups dependencies.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GROUP_GRAPHS = YES
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
UML_LOOK = NO
# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
# class node. If there are many fields or methods and many nodes the graph may
# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
# number of items for each type to make the size more manageable. Set this to 0
# for no limit. Note that the threshold may be exceeded by 50% before the limit
# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
# but if the number exceeds 15, the total amount of fields shown is limited to
# 10.
# Minimum value: 0, maximum value: 100, default value: 10.
# This tag requires that the tag HAVE_DOT is set to YES.
UML_LIMIT_NUM_FIELDS = 10
# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
# collaboration graphs will show the relations between templates and their
# instances.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
TEMPLATE_RELATIONS = YES
# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
# YES then doxygen will generate a graph for each documented file showing the
# direct and indirect include dependencies of the file with other documented
# files.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDE_GRAPH = NO
# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
# set to YES then doxygen will generate a graph for each documented file showing
# the direct and indirect include dependencies of the file with other documented
# files.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDED_BY_GRAPH = NO
# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
# dependency graph for every global function or class method.
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable call graphs for selected
# functions only using the \callgraph command.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
CALL_GRAPH = NO
# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
# dependency graph for every global function or class method.
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable caller graphs for selected
# functions only using the \callergraph command.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
CALLER_GRAPH = NO
# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
# hierarchy of all classes instead of a textual one.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GRAPHICAL_HIERARCHY = NO
# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
# dependencies a directory has on other directories in a graphical way. The
# dependency relations are determined by the #include relations between the
# files in the directories.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
DIRECTORY_GRAPH = NO
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot.
# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
# to make the SVG files visible in IE 9+ (other browsers do not have this
# requirement).
# Possible values are: png, jpg, gif and svg.
# The default value is: png.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_IMAGE_FORMAT = png
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
# enable generation of interactive SVG images that allow zooming and panning.
#
# Note that this requires a modern browser other than Internet Explorer. Tested
# and working are Firefox, Chrome, Safari, and Opera.
# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
# the SVG files visible. Older versions of IE do not have SVG support.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
INTERACTIVE_SVG = NO
# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_PATH = "@US_DOXYGEN_DOT_PATH@"
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the \dotfile
# command).
# This tag requires that the tag HAVE_DOT is set to YES.
DOTFILE_DIRS =
# The MSCFILE_DIRS tag can be used to specify one or more directories that
# contain msc files that are included in the documentation (see the \mscfile
# command).
MSCFILE_DIRS =
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
# that will be shown in the graph. If the number of nodes in a graph becomes
# larger than this value, doxygen will truncate the graph, which is visualized
# by representing a node as a red box. Note that doxygen if the number of direct
# children of the root node in a graph is already larger than
# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
# Minimum value: 0, maximum value: 10000, default value: 50.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_GRAPH_MAX_NODES = 50
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
# generated by dot. A depth value of 3 means that only nodes reachable from the
# root by following a path via at most 3 edges will be shown. Nodes that lay
# further from the root node will be omitted. Note that setting this option to 1
# or 2 may greatly reduce the computation time needed for large code bases. Also
# note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
# Minimum value: 0, maximum value: 1000, default value: 0.
# This tag requires that the tag HAVE_DOT is set to YES.
MAX_DOT_GRAPH_DEPTH = 0
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
# background. This is disabled by default, because dot on Windows does not seem
# to support this out of the box.
#
# Warning: Depending on the platform used, enabling this option may lead to
# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
# read).
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_TRANSPARENT = NO
# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
# makes dot run faster, but since only newer versions of dot (>1.8.10) support
# this, this feature is disabled by default.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_MULTI_TARGETS = NO
# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
# explaining the meaning of the various boxes and arrows in the dot generated
# graphs.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GENERATE_LEGEND = YES
# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
# files that are used to generate the various graphs.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_CLEANUP = YES
diff --git a/Modules/DICOMReader/include/mitkDICOMDatasetSorter.h b/Modules/DICOMReader/include/mitkDICOMDatasetSorter.h
index b01de13fb6..88487ca536 100644
--- a/Modules/DICOMReader/include/mitkDICOMDatasetSorter.h
+++ b/Modules/DICOMReader/include/mitkDICOMDatasetSorter.h
@@ -1,91 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkDICOMDatasetSorter_h
#define mitkDICOMDatasetSorter_h
#include "itkObjectFactory.h"
#include "mitkCommon.h"
#include "mitkDICOMDatasetAccess.h"
namespace mitk
{
/**
\ingroup DICOMReaderModule
\brief The sorting/splitting building-block of DICOMITKSeriesGDCMReader.
This class describes the interface of the sorting/splitting process
described as part of DICOMITKSeriesGDCMReader::AnalyzeInputFiles()
(see \ref DICOMITKSeriesGDCMReader_LoadingStrategy).
The prodecure is simple:
- take a list of input datasets (DICOMDatasetAccess)
- sort them (to be defined by sub-classes, based on specific tags)
- return the sorting result as outputs (the single input might be distributed into multiple outputs)
The simplest and most generic form of sorting is implemented in
sub-class DICOMTagBasedSorter.
*/
class MITKDICOMREADER_EXPORT DICOMDatasetSorter : public itk::LightObject
{
public:
- mitkClassMacroItkParent( DICOMDatasetSorter, itk::LightObject )
+ mitkClassMacroItkParent( DICOMDatasetSorter, itk::LightObject );
/**
\brief Return the tags of interest (to facilitate scanning)
*/
virtual DICOMTagList GetTagsOfInterest() = 0;
/// \brief Input for sorting
void SetInput(DICOMDatasetList filenames);
/// \brief Input for sorting
const DICOMDatasetList& GetInput() const;
/// \brief Sort input datasets into one or multiple outputs.
virtual void Sort() = 0;
/// \brief Output of the sorting process.
unsigned int GetNumberOfOutputs() const;
/// \brief Output of the sorting process.
const DICOMDatasetList& GetOutput(unsigned int index) const;
/// \brief Output of the sorting process.
DICOMDatasetList& GetOutput(unsigned int index);
/// \brief Print configuration details into stream.
virtual void PrintConfiguration(std::ostream& os, const std::string& indent = "") const = 0;
virtual bool operator==(const DICOMDatasetSorter& other) const = 0;
protected:
DICOMDatasetSorter();
~DICOMDatasetSorter() override;
DICOMDatasetSorter(const DICOMDatasetSorter& other);
DICOMDatasetSorter& operator=(const DICOMDatasetSorter& other);
void ClearOutputs();
void SetNumberOfOutputs(unsigned int numberOfOutputs);
void SetOutput(unsigned int index, const DICOMDatasetList& output);
private:
DICOMDatasetList m_Input;
std::vector< DICOMDatasetList > m_Outputs;
};
}
#endif
diff --git a/Modules/DICOMReader/include/mitkDICOMFileReaderSelector.h b/Modules/DICOMReader/include/mitkDICOMFileReaderSelector.h
index 1d23bf1135..832f7fd456 100644
--- a/Modules/DICOMReader/include/mitkDICOMFileReaderSelector.h
+++ b/Modules/DICOMReader/include/mitkDICOMFileReaderSelector.h
@@ -1,100 +1,100 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkDICOMFileReaderSelector_h
#define mitkDICOMFileReaderSelector_h
#include "mitkDICOMFileReader.h"
#include <usModuleResource.h>
namespace mitk
{
/**
\ingroup DICOMReaderModule
\brief Simple best-reader selection.
This class implements a process of comparing different DICOMFileReader%s and selecting
the reader with the minimal number of mitk::Image%s in its output.
The code found in this class can
- just be used to select a reader using this simple strategy
- be taken as an example of how to use DICOMFileReader%s
To create a selection of potential readers, the class makes use
of mitk::DICOMReaderConfigurator, i.e. DICOMFileReaderSelector
also expects the configuration files/strings to be in the format
expected by mitk::DICOMReaderConfigurator.
Two convenience methods load "default" configurations from
compiled-in resources: LoadBuiltIn3DConfigs() and LoadBuiltIn3DnTConfigs().
*/
class MITKDICOMREADER_EXPORT DICOMFileReaderSelector : public itk::LightObject
{
public:
typedef std::list<DICOMFileReader::Pointer> ReaderList;
- mitkClassMacroItkParent( DICOMFileReaderSelector, itk::LightObject )
- itkNewMacro( DICOMFileReaderSelector )
+ mitkClassMacroItkParent( DICOMFileReaderSelector, itk::LightObject );
+ itkNewMacro( DICOMFileReaderSelector );
/// \brief Add a configuration as expected by DICOMReaderConfigurator.
/// Configs can only be reset by instantiating a new DICOMFileReaderSelector.
void AddConfig(const std::string& xmlDescription);
/// \brief Add a configuration as expected by DICOMReaderConfigurator.
/// Configs can only be reset by instantiating a new DICOMFileReaderSelector.
void AddConfigFile(const std::string& filename);
/// \brief Add a whole pre-configured reader to the selection process.
void AddFileReaderCanditate(DICOMFileReader::Pointer reader);
/// \brief Load 3D image creating configurations from the MITK module system (see \ref mitk::Module::FindResources).
/// For a default set of configurations, look into the directory Resources of the DICOMReader module.
void LoadBuiltIn3DConfigs();
/// \brief Load 3D+t image creating configurations from the MITK module system (see \ref mitk::Module::FindResources).
/// For a default set of configurations, look into the directory Resources of the DICOMReader module.
void LoadBuiltIn3DnTConfigs();
/// \brief Return all the DICOMFileReader%s that are currently used for selection by this class.
/// The readers returned by this method depend on what config files have been added earlier
/// (or which of the built-in readers have been loaded)
ReaderList GetAllConfiguredReaders() const;
/// Input files
void SetInputFiles(StringList filenames);
/// Input files
const StringList& GetInputFiles() const;
/// Execute the analysis and selection process. The first reader with a minimal number of outputs will be returned.
DICOMFileReader::Pointer GetFirstReaderWithMinimumNumberOfOutputImages();
protected:
DICOMFileReaderSelector();
~DICOMFileReaderSelector() override;
void AddConfigsFromResources(const std::string& path);
void AddConfigFromResource(const std::string& resourcename);
void AddConfigFromResource(us::ModuleResource& resource);
private:
StringList m_PossibleConfigurations;
StringList m_InputFilenames;
ReaderList m_Readers;
};
} // namespace
#endif // mitkDICOMFileReaderSelector_h
diff --git a/Modules/DICOMReader/include/mitkDICOMImageFrameInfo.h b/Modules/DICOMReader/include/mitkDICOMImageFrameInfo.h
index 6b4ab69049..2dfd4f16cf 100644
--- a/Modules/DICOMReader/include/mitkDICOMImageFrameInfo.h
+++ b/Modules/DICOMReader/include/mitkDICOMImageFrameInfo.h
@@ -1,56 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkDICOMImageFrameInfo_h
#define mitkDICOMImageFrameInfo_h
#include "itkObjectFactory.h"
#include "mitkCommon.h"
#include "MitkDICOMReaderExports.h"
namespace mitk
{
/**
\ingroup DICOMReaderModule
\brief Describes a frame within a DICOM file.
This is a minimal data structure to describe a single frame
(think of DICOM multi-frame classes) within a DICOM file.
To be used by DICOMFileReader%s and as part of DICOMImageBlockDescriptor.
*/
class MITKDICOMREADER_EXPORT DICOMImageFrameInfo : public itk::LightObject
{
public:
/// absolute filename
const std::string Filename;
/// frame number, starting with 0
const unsigned int FrameNo;
- mitkClassMacroItkParent( DICOMImageFrameInfo, itk::LightObject )
+ mitkClassMacroItkParent( DICOMImageFrameInfo, itk::LightObject );
itkFactorylessNewMacro( DICOMImageFrameInfo );
mitkNewMacro1Param( DICOMImageFrameInfo, const std::string&);
mitkNewMacro2Param( DICOMImageFrameInfo, const std::string&, unsigned int );
bool operator==(const DICOMImageFrameInfo& other) const;
protected:
DICOMImageFrameInfo(const std::string& filename = "", unsigned int frameNo = 0);
};
typedef std::vector<DICOMImageFrameInfo::Pointer> DICOMImageFrameList;
}
#endif
diff --git a/Modules/DICOMReader/include/mitkDICOMReaderConfigurator.h b/Modules/DICOMReader/include/mitkDICOMReaderConfigurator.h
index 791c2ef579..9fa675aa69 100644
--- a/Modules/DICOMReader/include/mitkDICOMReaderConfigurator.h
+++ b/Modules/DICOMReader/include/mitkDICOMReaderConfigurator.h
@@ -1,142 +1,142 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkDICOMReaderConfigurator_h
#define mitkDICOMReaderConfigurator_h
#include "mitkClassicDICOMSeriesReader.h"
#include "mitkDICOMTagBasedSorter.h"
// to put into private implementation
#include "tinyxml.h"
namespace mitk
{
/**
\ingroup DICOMReaderModule
\brief Too-simple factory to create DICOMFileReader%s.
This class is able to instantiate and configure (where possible) DICOMFileReader%s from XML descriptions.
\note This is a bad factory example, because the factory is not extensible and needs to know all the specific readers. A flexible implementation should be provided in a future version.
In its current version, the XML input is meant to be structured like
\verbatim
<?xml version="1.0" standalone=no>
<DICOMFileReader
label="Example Reader"
description="Sort images by example tags"
class="DICOMITKSeriesGDCMReader"
fixTiltByShearing="true">
<Distinguishing>
<Tag name="SeriesInstanceUID" group="0020" element="000e"/>
<Tag name="SeriesNumber" group="0020" element="0011"/>
</Distinguishing>
<Sorting>
<ImagePositionPatient/>
<Tag name="SOPInstanceUID" group="0x0008" element="0x0018"/>
</Sorting>
</DICOMFileReader>
\endverbatim
The root-tag \i <DICOMFileReader> names the class to be instantiated, currently this can be one of
- DICOMITKSeriesGDCMReader
- ThreeDnTDICOMSeriesReader
Both classes bring simple configuration flags with them and a description of how images are sorted prior to loading.
Flag for DICOMITKSeriesGDCMReader:
<pre>fixTiltByShearing="true|false"</pre>
Determines whether a potential gantry tilt should be "fixed" by shearing the output image.
Flag for ThreeDnTDICOMSeriesReader:
<pre>group3DnT="true|false"</pre>
Determines whether images at the same spatial position should be interpreted as 3D+t images.
The tags <Distinguishing> and <Sorting> describe the basic loading strategy of both
reader mentioned above: first images are divided into incompatible groups (<Distinguishing>),
and afterwards the images within each group are sorted by means of DICOMSortCriterion, which
most commonly mentions a tag.
Tag element and group are interpreted as the exadecimal numbers
found all around the DICOM standard. The numbers can be prepended by a "0x" if this is preferred
by the programmer (but they are taken as hexadecimal in all cases).
\section DICOMReaderConfigurator_AboutTheFuture About the future evolution of this class
This first version is hard coded for the current state of the implementation.
If things should evolve in a way that needs us to splitt off readers for "old" versions,
time should be taken to refactor this class.
Basically, a serializer class should accompany each of the configurable classes. Such
serializer classes should be registered and discovered via micro-services (to support extensions).
A serializer should offer both methods to serialize a class and to desirialize it again.
A "version" attribute at the top-level tag should be used to distinguish versions.
Usually it should be enough to keep DE-serializers for all versions. Writers for the most
recent version should be enough.
*/
class MITKDICOMREADER_EXPORT DICOMReaderConfigurator : public itk::LightObject
{
public:
- mitkClassMacroItkParent( DICOMReaderConfigurator, itk::LightObject )
- itkNewMacro( DICOMReaderConfigurator )
+ mitkClassMacroItkParent( DICOMReaderConfigurator, itk::LightObject );
+ itkNewMacro( DICOMReaderConfigurator );
DICOMFileReader::Pointer CreateFromConfigFile(const std::string& filename) const;
DICOMFileReader::Pointer CreateFromUTF8ConfigString(const std::string& xmlContents) const;
std::string CreateConfigStringFromReader(DICOMFileReader::ConstPointer reader) const;
protected:
DICOMReaderConfigurator();
~DICOMReaderConfigurator() override;
private:
DICOMFileReader::Pointer CreateFromTiXmlDocument(TiXmlDocument& doc) const;
DICOMTag tagFromXMLElement(TiXmlElement*) const;
std::string requiredStringAttribute(TiXmlElement* xmlElement, const std::string& key) const;
unsigned int hexStringToUInt(const std::string& s) const;
ThreeDnTDICOMSeriesReader::Pointer ConfigureThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, TiXmlElement*) const;
DICOMITKSeriesGDCMReader::Pointer ConfigureDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, TiXmlElement*) const;
void ConfigureCommonPropertiesOfDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, TiXmlElement* element) const;
void ConfigureCommonPropertiesOfThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, TiXmlElement* element) const;
DICOMSortCriterion::Pointer CreateDICOMSortByTag(TiXmlElement* xmlElement, DICOMSortCriterion::Pointer secondaryCriterion) const;
DICOMSortCriterion::Pointer CreateSortByImagePositionPatient(TiXmlElement* xmlElement, DICOMSortCriterion::Pointer secondaryCriterion) const;
mitk::DICOMTagBasedSorter::Pointer CreateDICOMTagBasedSorter(TiXmlElement* element) const;
TiXmlElement* CreateConfigStringFromReader(const DICOMITKSeriesGDCMReader* reader) const;
TiXmlElement* CreateConfigStringFromReader(const ThreeDnTDICOMSeriesReader* reader) const;
TiXmlElement* CreateConfigStringFromReader(const ClassicDICOMSeriesReader* reader) const;
TiXmlElement* CreateConfigStringFromDICOMDatasetSorter(const DICOMTagBasedSorter* sorter) const;
TiXmlElement* CreateConfigStringFromDICOMTag(const DICOMTag& tag) const;
TiXmlElement* CreateDICOMFileReaderTag(const DICOMFileReader* reader) const;
const char* toString(bool) const;
std::string toHexString(unsigned int i) const;
/** Helper that queries an boolean xml attribute. If the attribute does not exist, the passed default value is used.*/
bool QueryBooleanAttribute(const TiXmlElement* element, const char* attributeName, bool defaultValue) const;
};
} // namespace
#endif // mitkDICOMReaderConfigurator_h
diff --git a/Modules/DICOMReader/include/mitkDICOMTagBasedSorter.h b/Modules/DICOMReader/include/mitkDICOMTagBasedSorter.h
index fb42f29aee..efc2b46121 100644
--- a/Modules/DICOMReader/include/mitkDICOMTagBasedSorter.h
+++ b/Modules/DICOMReader/include/mitkDICOMTagBasedSorter.h
@@ -1,201 +1,202 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkDICOMTagBasedSorter_h
#define mitkDICOMTagBasedSorter_h
#include "mitkDICOMDatasetSorter.h"
#include "mitkDICOMSortCriterion.h"
namespace mitk
{
/**
\ingroup DICOMReaderModule
\brief Sort DICOM datasets based on configurable tags.
This class implements sorting of input DICOM datasets into multiple outputs
as described in \ref DICOMITKSeriesGDCMReader_LoadingStrategy.
The logic of sorting and splitting is most simple and most generic:
1. Datasets will be put into different groups, if they differ in their value of specific tags (defined by AddDistinguishingTag())
- there might be multiple distinguishing tags defined
- tag values might be processed before comparison by means of TagValueProcessor (e.g. round to a number of decimal places)
2. Each of the groups will be sorted by comparing their tag values using multiple DICOMSortCriterion
- DICOMSortCriterion might evaluate a single tag (e.g. Instance Number) or multiple values (as in SortByImagePositionPatient)
- only a single DICOMSortCriterion is defined for DICOMTagBasedSorter, because each DICOMSortCriterion holds a "secondary sort criterion", i.e. an application can define multiple tags for sorting by chaining \link DICOMSortCriterion DICOMSortCriteria \endlink
- applications should make sure that sorting is always defined (to avoid problems with standard containers), e.g. by adding a comparison of filenames or instance UIDs as a last sorting fallback.
*/
class MITKDICOMREADER_EXPORT DICOMTagBasedSorter : public DICOMDatasetSorter
{
public:
/**
\brief Processes tag values before they are compared.
These classes could do some kind of normalization such as rounding, lower case formatting, etc.
*/
class MITKDICOMREADER_EXPORT TagValueProcessor
{
public:
/// \brief Implements the "processing".
virtual std::string operator()(const std::string&) const = 0;
virtual TagValueProcessor* Clone() const = 0;
virtual ~TagValueProcessor() {}
};
/**
\brief Cuts a number after configured number of decimal places.
An instance of this class can be used to avoid errors when comparing minimally different image orientations.
*/
class MITKDICOMREADER_EXPORT CutDecimalPlaces : public TagValueProcessor
{
public:
CutDecimalPlaces(unsigned int precision);
CutDecimalPlaces(const CutDecimalPlaces& other);
unsigned int GetPrecision() const;
std::string operator()(const std::string&) const override;
TagValueProcessor* Clone() const override;
private:
unsigned int m_Precision;
};
- mitkClassMacro( DICOMTagBasedSorter, DICOMDatasetSorter )
- itkNewMacro( DICOMTagBasedSorter )
+ mitkClassMacro( DICOMTagBasedSorter, DICOMDatasetSorter );
+
+ itkNewMacro( DICOMTagBasedSorter );
/**
\brief Datasets that differ in given tag's value will be sorted into separate outputs.
*/
void AddDistinguishingTag( const DICOMTag&, TagValueProcessor* tagValueProcessor = nullptr );
DICOMTagList GetDistinguishingTags() const;
const TagValueProcessor* GetTagValueProcessorForDistinguishingTag(const DICOMTag&) const;
/**
\brief Define the sorting criterion (which holds seconardy criteria)
*/
void SetSortCriterion( DICOMSortCriterion::ConstPointer criterion );
DICOMSortCriterion::ConstPointer GetSortCriterion() const;
/**
\brief A list of all the tags needed for processing (facilitates scanning).
*/
DICOMTagList GetTagsOfInterest() override;
/**
\brief Whether or not groups should be checked for consecutive tag values.
When this flag is set (default in constructor=off), the sorter will
not only sort in a way that the values of a configured tag are ascending
BUT in addition the sorter will enforce a constant numerical distance
between values.
Having this flag is useful for handling of series with missing slices,
e.g. Instance Numbers 1 2 3 5 6 7 8. With the flag set to true, the sorter
would split this group into two, because the initial distance of 1 is
not kept between Instance Numbers 3 and 5.
A special case of this behavior can be configured by SetExpectDistanceOne().
When this additional flag is set to true, the sorter will expect distance
1 exactly. This can help if the second slice is missing already. Without
this additional flag, we would "learn" about a wrong distance of 2 (or similar)
and then sort completely wrong.
*/
void SetStrictSorting(bool strict);
bool GetStrictSorting() const;
/**
\brief Flag for a special case in "strict sorting".
Please see documentation of SetStrictSorting().
\sa SetStrictSorting
*/
void SetExpectDistanceOne(bool strict);
bool GetExpectDistanceOne() const;
/**
\brief Actually sort as described in the Detailed Description.
*/
void Sort() override;
/**
\brief Print configuration details into given stream.
*/
void PrintConfiguration(std::ostream& os, const std::string& indent = "") const override;
bool operator==(const DICOMDatasetSorter& other) const override;
static bool GetDefaultStrictSorting()
{
return m_DefaultStrictSorting;
}
static bool GetDefaultExpectDistanceOne()
{
return m_DefaultExpectDistanceOne;
}
protected:
/**
\brief Helper struct to feed into std::sort, configured via DICOMSortCriterion.
*/
struct ParameterizedDatasetSort
{
ParameterizedDatasetSort(DICOMSortCriterion::ConstPointer);
bool operator() (const mitk::DICOMDatasetAccess* left, const mitk::DICOMDatasetAccess* right);
DICOMSortCriterion::ConstPointer m_SortCriterion;
};
DICOMTagBasedSorter();
~DICOMTagBasedSorter() override;
DICOMTagBasedSorter(const DICOMTagBasedSorter& other);
DICOMTagBasedSorter& operator=(const DICOMTagBasedSorter& other);
/**
\brief Helper for SplitInputGroups().
*/
std::string BuildGroupID( DICOMDatasetAccess* dataset );
typedef std::map<std::string, DICOMDatasetList> GroupIDToListType;
/**
\brief Implements the "distiguishing tags".
To sort datasets into different groups, a long string will be built for each dataset. The string concatenates all tags and their respective values.
Datasets that match in all values will end up with the same string.
*/
GroupIDToListType SplitInputGroups();
/**
\brief Implements the sorting step.
Relatively simple implementation thanks to std::sort and a parameterization via DICOMSortCriterion.
*/
GroupIDToListType& SortGroups(GroupIDToListType& groups);
DICOMTagList m_DistinguishingTags;
typedef std::map<const DICOMTag, TagValueProcessor*> TagValueProcessorMap;
TagValueProcessorMap m_TagValueProcessor;
DICOMSortCriterion::ConstPointer m_SortCriterion;
bool m_StrictSorting;
bool m_ExpectDistanceOne;
const static bool m_DefaultStrictSorting = false;
const static bool m_DefaultExpectDistanceOne = false;
};
}
#endif
diff --git a/Modules/DICOMReader/include/mitkEquiDistantBlocksSorter.h b/Modules/DICOMReader/include/mitkEquiDistantBlocksSorter.h
index e35ef5c381..d80ecc1a78 100644
--- a/Modules/DICOMReader/include/mitkEquiDistantBlocksSorter.h
+++ b/Modules/DICOMReader/include/mitkEquiDistantBlocksSorter.h
@@ -1,210 +1,211 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkEquiDistantBlocksSorter_h
#define mitkEquiDistantBlocksSorter_h
#include "mitkDICOMDatasetSorter.h"
#include "mitkDICOMSortCriterion.h"
#include "mitkGantryTiltInformation.h"
#include "mitkVector.h"
namespace mitk
{
/**
\ingroup DICOMReaderModule
\brief Split inputs into blocks of equidistant slices (for use in DICOMITKSeriesGDCMReader).
Since inter-slice distance is not recorded in DICOM tags, we must ensure that blocks are made up of
slices that have equal distances between neighboring slices. This is especially necessary because itk::ImageSeriesReader
is later used for the actual loading, and this class expects (and does nocht verify) equal inter-slice distance (see \ref DICOMITKSeriesGDCMReader_ForcedConfiguration).
To achieve such grouping, the inter-slice distance is calculated from the first two different slice positions of a block.
Following slices are added to a block as long as they can be added by adding the calculated inter-slice distance to the
last slice of the block. Slices that do not fit into the expected distance pattern, are set aside for further analysis.
This grouping is done until each file has been assigned to a group.
Slices that share a position in space are also sorted into separate blocks during this step.
So the result of this step is a set of blocks that contain only slices with equal z spacing
and uniqe slices at each position.
During sorting, the origins (documented in tag image position patient) are compared
against expected origins (from former origin plus moving direction). As there will
be minor differences in numbers (from both calculations and unprecise tag values),
we must be a bit tolerant here. The default behavior is to expect that an origin is
not further away from the expected position than 30% of the inter-slice distance.
To support a legacy behavior of a former loader (DicomSeriesReader), this default can
be restricted to a constant number of millimeters by calling SetToleratedOriginOffset(mm).
Detailed implementation in AnalyzeFileForITKImageSeriesReaderSpacingAssumption().
*/
class MITKDICOMREADER_EXPORT EquiDistantBlocksSorter : public DICOMDatasetSorter
{
public:
- mitkClassMacro( EquiDistantBlocksSorter, DICOMDatasetSorter )
- itkNewMacro( EquiDistantBlocksSorter )
+ mitkClassMacro( EquiDistantBlocksSorter, DICOMDatasetSorter );
+
+ itkNewMacro( EquiDistantBlocksSorter );
DICOMTagList GetTagsOfInterest() override;
/**
\brief Delegates work to AnalyzeFileForITKImageSeriesReaderSpacingAssumption().
AnalyzeFileForITKImageSeriesReaderSpacingAssumption() is called until it does not
create multiple blocks anymore.
*/
void Sort() override;
/**
\brief Whether or not to accept images from a tilted acquisition in a single output group.
*/
void SetAcceptTilt(bool accept);
bool GetAcceptTilt() const;
/**
\brief See class description and SetToleratedOriginOffset().
*/
void SetToleratedOriginOffsetToAdaptive(double fractionOfInterSliceDistanct = 0.3);
/**
\brief See class description and SetToleratedOriginOffsetToAdaptive().
Default value of 0.005 is calculated so that we get a maximum of 1/10mm
error when having a measurement crosses 20 slices in z direction (too strict? we don't know better..).
*/
void SetToleratedOriginOffset(double millimeters = 0.005);
double GetToleratedOriginOffset() const;
bool IsToleratedOriginOffsetAbsolute() const;
void SetAcceptTwoSlicesGroups(bool accept);
bool GetAcceptTwoSlicesGroups() const;
void PrintConfiguration(std::ostream& os, const std::string& indent = "") const override;
bool operator==(const DICOMDatasetSorter& other) const override;
protected:
/**
\brief Return type of AnalyzeFileForITKImageSeriesReaderSpacingAssumption().
Class contains the grouping result of method AnalyzeFileForITKImageSeriesReaderSpacingAssumption(),
which takes as input a number of images, which are all equally oriented and spatially sorted along their normal direction.
The result contains of two blocks: a first one is the grouping result, all of those images can be loaded
into one image block because they have an equal origin-to-origin distance without any gaps in-between.
*/
class SliceGroupingAnalysisResult
{
public:
SliceGroupingAnalysisResult();
/**
\brief Grouping result, all same origin-to-origin distance w/o gaps.
*/
DICOMDatasetList GetBlockDatasets();
void SetFirstFilenameOfBlock(const std::string& filename);
std::string GetFirstFilenameOfBlock() const;
void SetLastFilenameOfBlock(const std::string& filename);
std::string GetLastFilenameOfBlock() const;
/**
\brief Remaining files, which could not be grouped.
*/
DICOMDatasetList GetUnsortedDatasets();
/**
\brief Wheter or not the grouped result contain a gantry tilt.
*/
bool ContainsGantryTilt();
/**
\brief Detailed description of gantry tilt.
*/
const GantryTiltInformation& GetTiltInfo() const;
/**
\brief Meant for internal use by AnalyzeFileForITKImageSeriesReaderSpacingAssumption only.
*/
void AddFileToSortedBlock(DICOMDatasetAccess* dataset);
/**
\brief Meant for internal use by AnalyzeFileForITKImageSeriesReaderSpacingAssumption only.
*/
void AddFileToUnsortedBlock(DICOMDatasetAccess* dataset);
void AddFilesToUnsortedBlock(const DICOMDatasetList& datasets);
/**
\brief Meant for internal use by AnalyzeFileForITKImageSeriesReaderSpacingAssumption only.
\todo Could make sense to enhance this with an instance of GantryTiltInformation to store the whole result!
*/
void FlagGantryTilt(const GantryTiltInformation& tiltInfo);
/**
\brief Only meaningful for use by AnalyzeFileForITKImageSeriesReaderSpacingAssumption.
*/
void UndoPrematureGrouping();
protected:
DICOMDatasetList m_GroupedFiles;
DICOMDatasetList m_UnsortedFiles;
GantryTiltInformation m_TiltInfo;
std::string m_FirstFilenameOfBlock;
std::string m_LastFilenameOfBlock;
};
/**
\brief Ensure an equal z-spacing for a group of files.
Takes as input a number of images, which are all equally oriented and spatially sorted along their normal direction.
Internally used by GetSeries. Returns two lists: the first one contins slices of equal inter-slice spacing.
The second list contains remaining files, which need to be run through AnalyzeFileForITKImageSeriesReaderSpacingAssumption again.
Relevant code that is matched here is in
itkImageSeriesReader.txx (ImageSeriesReader<TOutputImage>::GenerateOutputInformation(void)), lines 176 to 245 (as of ITK 3.20)
*/
SliceGroupingAnalysisResult
AnalyzeFileForITKImageSeriesReaderSpacingAssumption(const DICOMDatasetList& files, bool groupsOfSimilarImages);
/**
\brief Safely convert const char* to std::string.
*/
std::string
ConstCharStarToString(const char* s);
EquiDistantBlocksSorter();
~EquiDistantBlocksSorter() override;
EquiDistantBlocksSorter(const EquiDistantBlocksSorter& other);
EquiDistantBlocksSorter& operator=(const EquiDistantBlocksSorter& other);
bool m_AcceptTilt;
typedef std::vector<SliceGroupingAnalysisResult> ResultsList;
ResultsList m_SliceGroupingResults;
double m_ToleratedOriginOffset;
bool m_ToleratedOriginOffsetIsAbsolute;
bool m_AcceptTwoSlicesGroups;
};
}
#endif
diff --git a/Modules/DICOMReader/include/mitkNormalDirectionConsistencySorter.h b/Modules/DICOMReader/include/mitkNormalDirectionConsistencySorter.h
index 7138f00203..6f62620098 100644
--- a/Modules/DICOMReader/include/mitkNormalDirectionConsistencySorter.h
+++ b/Modules/DICOMReader/include/mitkNormalDirectionConsistencySorter.h
@@ -1,70 +1,71 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkNormalDirectionConsistencySorter_h
#define mitkNormalDirectionConsistencySorter_h
#include "mitkDICOMDatasetSorter.h"
#include "mitkGantryTiltInformation.h"
namespace mitk
{
/**
\ingroup DICOMReaderModule
\brief Makes sure that the order of files is along the image plane normals.
When loading with ImageSeriesReader and initializing an mitk::Image with the result
we need to make sure that the order of inputs for the ImageSeriesReader is along the
normal of the images. I.e. The direction of the normal needs to be the same direction
as the vector from the first to the last image origin.
Since this class is used as a last sorting step before loading, it will also
calculate (and return) an updated GantryTiltInformation object.
\note This class might be a workaround for another bug in MITK, but until this issue
is completely understood, the workaround fixes the problem of images that
appear upside-down.
*/
class MITKDICOMREADER_EXPORT NormalDirectionConsistencySorter : public DICOMDatasetSorter
{
public:
- mitkClassMacro( NormalDirectionConsistencySorter, DICOMDatasetSorter )
- itkNewMacro( NormalDirectionConsistencySorter )
+ mitkClassMacro( NormalDirectionConsistencySorter, DICOMDatasetSorter );
+
+ itkNewMacro( NormalDirectionConsistencySorter );
DICOMTagList GetTagsOfInterest() override;
/// See class description.
void Sort() override;
/// See class description and DICOMITKSeriesGDCMReader.
GantryTiltInformation GetTiltInformation() const;
void PrintConfiguration(std::ostream& os, const std::string& indent = "") const override;
bool operator==(const DICOMDatasetSorter& other) const override;
protected:
NormalDirectionConsistencySorter();
~NormalDirectionConsistencySorter() override;
NormalDirectionConsistencySorter(const NormalDirectionConsistencySorter& other);
NormalDirectionConsistencySorter& operator=(const NormalDirectionConsistencySorter& other);
GantryTiltInformation m_TiltInfo;
};
}
#endif
diff --git a/Modules/DICOMReader/test/mitkDICOMFilenameSorter.h b/Modules/DICOMReader/test/mitkDICOMFilenameSorter.h
index 4b0f34462d..d788595937 100644
--- a/Modules/DICOMReader/test/mitkDICOMFilenameSorter.h
+++ b/Modules/DICOMReader/test/mitkDICOMFilenameSorter.h
@@ -1,56 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkDICOMFilenameSorter_h
#define mitkDICOMFilenameSorter_h
#include "mitkDICOMDatasetSorter.h"
namespace mitk
{
/**
\ingroup DICOMReaderModule
\brief sort files based on filename (last resort).
*/
class DICOMFilenameSorter : public DICOMDatasetSorter
{
public:
- mitkClassMacro( DICOMFilenameSorter, DICOMDatasetSorter )
- itkNewMacro( DICOMFilenameSorter )
+ mitkClassMacro( DICOMFilenameSorter, DICOMDatasetSorter );
+
+ itkNewMacro( DICOMFilenameSorter );
DICOMTagList GetTagsOfInterest() override;
void Sort() override;
void PrintConfiguration(std::ostream& os, const std::string& indent = "") const override;
bool operator==(const DICOMDatasetSorter& other) const override;
protected:
struct FilenameSort
{
bool operator() (const mitk::DICOMDatasetAccess* left, const mitk::DICOMDatasetAccess* right);
};
DICOMFilenameSorter();
~DICOMFilenameSorter() override;
DICOMFilenameSorter(const DICOMFilenameSorter& other);
DICOMFilenameSorter& operator=(const DICOMFilenameSorter& other);
};
}
#endif
diff --git a/Modules/DataTypesExt/include/mitkAffineBaseDataInteractor3D.h b/Modules/DataTypesExt/include/mitkAffineBaseDataInteractor3D.h
index fde1135fe0..5774512c17 100644
--- a/Modules/DataTypesExt/include/mitkAffineBaseDataInteractor3D.h
+++ b/Modules/DataTypesExt/include/mitkAffineBaseDataInteractor3D.h
@@ -1,102 +1,105 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkAffineBaseDataInteractor3D_h
#define mitkAffineBaseDataInteractor3D_h
#include "MitkDataTypesExtExports.h"
#include <mitkDataInteractor.h>
#include <mitkGeometry3D.h>
namespace mitk
{
////create events for interactions
#pragma GCC visibility push(default)
- itkEventMacro(AffineInteractionEvent, itk::AnyEvent) itkEventMacro(ScaleEvent, AffineInteractionEvent)
- itkEventMacro(RotateEvent, AffineInteractionEvent) itkEventMacro(TranslateEvent, AffineInteractionEvent)
+ itkEventMacro(AffineInteractionEvent, itk::AnyEvent);
+ itkEventMacro(ScaleEvent, AffineInteractionEvent);
+ itkEventMacro(RotateEvent, AffineInteractionEvent);
+ itkEventMacro(TranslateEvent, AffineInteractionEvent);
#pragma GCC visibility pop
- /**
- * \brief Affine interaction with mitk::BaseGeometry.
- *
- * \ingroup Interaction
- */
- // Inherit from DataInteractor, this provides functionality of a state machine and configurable inputs.
- class MITKDATATYPESEXT_EXPORT AffineBaseDataInteractor3D : public DataInteractor
+ /**
+ * \brief Affine interaction with mitk::BaseGeometry.
+ *
+ * \ingroup Interaction
+ */
+ // Inherit from DataInteractor, this provides functionality of a state machine and configurable inputs.
+ class MITKDATATYPESEXT_EXPORT AffineBaseDataInteractor3D : public DataInteractor
{
public:
mitkClassMacro(AffineBaseDataInteractor3D, DataInteractor);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
- void SetDataNode(DataNode *node) override;
+ void SetDataNode(DataNode *node) override;
void TranslateGeometry(mitk::Vector3D translate, mitk::BaseGeometry *geometry);
void RotateGeometry(mitk::ScalarType angle, int rotationaxis, mitk::BaseGeometry *geometry);
void ScaleGeometry(mitk::Point3D newScale, mitk::BaseGeometry *geometry);
mitk::BaseGeometry *GetUpdatedTimeGeometry(mitk::InteractionEvent *interactionEvent);
protected:
AffineBaseDataInteractor3D();
~AffineBaseDataInteractor3D() override;
/**
* Here actions strings from the loaded state machine pattern are mapped to functions of
* the DataInteractor. These functions are called when an action from the state machine pattern is executed.
*/
void ConnectActionsAndFunctions() override;
/**
* This function is called when a DataNode has been set/changed.
*/
void DataNodeChanged() override;
/**
* Initializes the movement, stores starting position.
*/
virtual bool CheckOverObject(const InteractionEvent *);
virtual void SelectObject(StateMachineAction *, InteractionEvent *);
virtual void DeselectObject(StateMachineAction *, InteractionEvent *);
virtual void InitTranslate(StateMachineAction *, InteractionEvent *);
virtual void InitRotate(StateMachineAction *, InteractionEvent *);
virtual void TranslateObject(StateMachineAction *, InteractionEvent *);
virtual void RotateObject(StateMachineAction *, InteractionEvent *);
virtual void ScaleObject(StateMachineAction *, InteractionEvent *);
virtual void TranslateUpKey(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void TranslateDownKey(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void TranslateLeftKey(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void TranslateRightKey(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void TranslateUpModifierKey(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void TranslateDownModifierKey(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void RotateUpKey(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void RotateDownKey(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void RotateLeftKey(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void RotateRightKey(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void RotateUpModifierKey(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void RotateDownModifierKey(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void ScaleDownKey(mitk::StateMachineAction *, mitk::InteractionEvent *interactionEvent);
virtual void ScaleUpKey(mitk::StateMachineAction *, mitk::InteractionEvent *interactionEvent);
virtual void RestoreNodeProperties();
/**
* @brief InitMembers convinience method to avoid code duplication between InitRotate() and InitTranslate().
* @param interactionEvent
*/
bool InitMembers(InteractionEvent *interactionEvent);
private:
Point3D m_InitialPickedWorldPoint;
Point2D m_InitialPickedDisplayPoint;
Geometry3D::Pointer m_OriginalGeometry;
};
}
#endif
diff --git a/Modules/DataTypesExt/include/mitkAffineImageCropperInteractor.h b/Modules/DataTypesExt/include/mitkAffineImageCropperInteractor.h
index ad61cac292..7c7d20c8bb 100644
--- a/Modules/DataTypesExt/include/mitkAffineImageCropperInteractor.h
+++ b/Modules/DataTypesExt/include/mitkAffineImageCropperInteractor.h
@@ -1,72 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkAffineImageCropperInteractor_h_
#define mitkAffineImageCropperInteractor_h_
#include "MitkDataTypesExtExports.h"
#include "mitkBaseRenderer.h"
#include "mitkDataInteractor.h"
#include "mitkGeometry3D.h"
namespace mitk
{
/**
* \brief Affine interaction with objects in 3D windows.
*
* \ingroup Interaction
*/
// Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
class MITKDATATYPESEXT_EXPORT AffineImageCropperInteractor : public DataInteractor
{
public:
mitkClassMacro(AffineImageCropperInteractor, DataInteractor);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
protected : AffineImageCropperInteractor();
~AffineImageCropperInteractor() override;
/**
* Here actions strings from the loaded state machine pattern are mapped to functions of
* the DataInteractor. These functions are called when an action from the state machine pattern is executed.
*/
void ConnectActionsAndFunctions() override;
/**
* This function is called when a DataNode has been set/changed.
*/
void DataNodeChanged() override;
/**
* Initializes the movement, stores starting position.
*/
virtual bool CheckOverObject(const InteractionEvent *interactionEvent);
virtual void SelectObject(StateMachineAction *, InteractionEvent *);
virtual void DeselectObject(StateMachineAction *, InteractionEvent *);
virtual void InitTranslate(StateMachineAction *, InteractionEvent *);
virtual void InitRotate(StateMachineAction *, InteractionEvent *);
virtual void InitDeformation(StateMachineAction *, InteractionEvent *);
virtual void TranslateObject(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void RotateObject(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void DeformObject(StateMachineAction *, InteractionEvent *);
virtual void ScaleRadius(StateMachineAction *, InteractionEvent *interactionEvent);
private:
Geometry3D::Pointer m_OriginalGeometry;
mitk::DataNode::Pointer m_SelectedNode;
Point3D m_InitialPickedPoint;
Point3D m_InitialOrigin;
Point2D m_InitialPickedDisplayPoint;
void Deselect();
};
}
#endif
diff --git a/Modules/DataTypesExt/include/mitkBoundingObjectGroup.h b/Modules/DataTypesExt/include/mitkBoundingObjectGroup.h
index 2bb276675a..ff72d0bbe7 100644
--- a/Modules/DataTypesExt/include/mitkBoundingObjectGroup.h
+++ b/Modules/DataTypesExt/include/mitkBoundingObjectGroup.h
@@ -1,65 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BOUNDINGOBJECTGROUP_H_HEADER_INCLUDED
#define BOUNDINGOBJECTGROUP_H_HEADER_INCLUDED
#include "MitkDataTypesExtExports.h"
#include <deque>
#include <mitkBoundingObject.h>
namespace mitk
{
//##Documentation
//## @brief group object, that contains several mitk::BoundingObjects
//##
//## Calculates a bounding box that contains all sub-bounding boxes.
//## @ingroup Data
class MITKDATATYPESEXT_EXPORT BoundingObjectGroup : public mitk::BoundingObject
{
public:
enum CSGMode
{
Union,
Intersection,
Difference
};
mitkClassMacro(BoundingObjectGroup,
mitk::BoundingObject); // itk::VectorContainer<unsigned int ,mitk::BoundingObject::Pointer>);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void UpdateOutputInformation() override;
bool IsInside(const mitk::Point3D &p) const override;
void SetBoundingObjects(const std::deque<mitk::BoundingObject::Pointer> boundingObjects);
std::deque<mitk::BoundingObject::Pointer> GetBoundingObjects();
itkSetMacro(CSGMode, mitk::BoundingObjectGroup::CSGMode);
itkGetMacro(CSGMode, mitk::BoundingObjectGroup::CSGMode);
void AddBoundingObject(mitk::BoundingObject::Pointer boundingObject);
void RemoveBoundingObject(mitk::BoundingObject::Pointer boundingObject);
unsigned int GetCount() const;
mitk::BaseGeometry *GetGeometry(int t = 0) const;
bool VerifyRequestedRegion() override;
protected:
BoundingObjectGroup();
~BoundingObjectGroup() override;
std::deque<mitk::BoundingObject::Pointer> m_BoundingObjects;
unsigned int m_Counter;
CSGMode m_CSGMode;
};
}
#endif /* BOUNDINGOBJECTGROUP_H_HEADER_INCLUDED */
diff --git a/Modules/DataTypesExt/include/mitkClippingPlaneInteractor3D.h b/Modules/DataTypesExt/include/mitkClippingPlaneInteractor3D.h
index 702d8f9314..aeca9ad97a 100644
--- a/Modules/DataTypesExt/include/mitkClippingPlaneInteractor3D.h
+++ b/Modules/DataTypesExt/include/mitkClippingPlaneInteractor3D.h
@@ -1,69 +1,70 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkClippingPlaneInteractor3D_h
#define mitkClippingPlaneInteractor3D_h
#include "MitkDataTypesExtExports.h"
#include <mitkBaseRenderer.h>
#include <mitkDataInteractor.h>
#include <mitkGeometry3D.h>
namespace mitk
{
/**
* \brief Specialized interactor for clipping planes.
*
* \ingroup Interaction
*/
// Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
class MITKDATATYPESEXT_EXPORT ClippingPlaneInteractor3D : public DataInteractor
{
public:
mitkClassMacro(ClippingPlaneInteractor3D, DataInteractor);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
protected : ClippingPlaneInteractor3D();
~ClippingPlaneInteractor3D() override;
/**
* Here actions strings from the loaded state machine pattern are mapped to functions of
* the DataInteractor. These functions are called when an action from the state machine pattern is executed.
*/
void ConnectActionsAndFunctions() override;
/**
* This function is called when a DataNode has been set/changed.
*/
void DataNodeChanged() override;
/**
* Initializes the movement, stores starting position.
*/
virtual bool CheckOverObject(const InteractionEvent *);
virtual void SelectObject(StateMachineAction *, InteractionEvent *);
virtual void DeselectObject(StateMachineAction *, InteractionEvent *);
virtual void InitTranslate(StateMachineAction *, InteractionEvent *);
virtual void InitRotate(StateMachineAction *, InteractionEvent *);
virtual void TranslateObject(StateMachineAction *, InteractionEvent *);
virtual void RotateObject(StateMachineAction *, InteractionEvent *);
private:
void ColorizeSurface(BaseRenderer::Pointer renderer, double scalar = 0.0);
double m_InitialPickedWorldPoint[4];
Point2D m_InitialPickedDisplayPoint;
Geometry3D::Pointer m_OriginalGeometry;
Vector3D m_ObjectNormal;
};
}
#endif // mitkClippingPlaneInteractor3D_h
diff --git a/Modules/DataTypesExt/include/mitkCompressedImageContainer.h b/Modules/DataTypesExt/include/mitkCompressedImageContainer.h
index f607adada8..71d5d9878e 100644
--- a/Modules/DataTypesExt/include/mitkCompressedImageContainer.h
+++ b/Modules/DataTypesExt/include/mitkCompressedImageContainer.h
@@ -1,79 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkCompressedImageContainer_h_Included
#define mitkCompressedImageContainer_h_Included
#include "MitkDataTypesExtExports.h"
#include "mitkCommon.h"
#include "mitkGeometry3D.h"
#include "mitkImage.h"
#include "mitkImageDataItem.h"
#include <itkObject.h>
#include <vector>
namespace mitk
{
/**
\brief Holds one (compressed) mitk::Image
Uses zlib to compress the data of an mitk::Image.
$Author$
*/
class MITKDATATYPESEXT_EXPORT CompressedImageContainer : public itk::Object
{
public:
mitkClassMacroItkParent(CompressedImageContainer, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* \brief Creates a compressed version of the image.
*
* Will not hold any further SmartPointers to the image.
*
*/
void SetImage(Image *);
/**
* \brief Creates a full mitk::Image from its compressed version.
*
* This Method hold no buffer, so the uncompression algorithm will be
* executed every time you call this method. Don't overdo it.
*
*/
Image::Pointer GetImage();
protected:
CompressedImageContainer(); // purposely hidden
~CompressedImageContainer() override;
PixelType *m_PixelType;
unsigned int m_ImageDimension;
std::vector<unsigned int> m_ImageDimensions;
unsigned long m_OneTimeStepImageSizeInBytes;
unsigned int m_NumberOfTimeSteps;
/// one for each timestep. first = pointer to compressed data; second = size of buffer in bytes
std::vector<std::pair<unsigned char *, unsigned long>> m_ByteBuffers;
BaseGeometry::Pointer m_ImageGeometry;
};
} // namespace
#endif
diff --git a/Modules/DataTypesExt/include/mitkCone.h b/Modules/DataTypesExt/include/mitkCone.h
index 280998f5fc..7921e6dab8 100644
--- a/Modules/DataTypesExt/include/mitkCone.h
+++ b/Modules/DataTypesExt/include/mitkCone.h
@@ -1,38 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKCONE_H_HEADER_INCLUDED
#define MITKCONE_H_HEADER_INCLUDED
#include "MitkDataTypesExtExports.h"
#include "mitkBoundingObject.h"
namespace mitk
{
//##Documentation
//## @brief Data class containing an cylinder
//## @ingroup Data
class MITKDATATYPESEXT_EXPORT Cone : public BoundingObject
{
public:
mitkClassMacro(Cone, BoundingObject);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
mitk::ScalarType GetVolume() override;
bool IsInside(const Point3D &p) const override;
// virtual void UpdateOutputInformation();
protected:
Cone();
~Cone() override;
};
}
#endif /* MITKCONE_H_HEADER_INCLUDED */
diff --git a/Modules/DataTypesExt/include/mitkCuboid.h b/Modules/DataTypesExt/include/mitkCuboid.h
index d0ced627f1..a05d3828f0 100644
--- a/Modules/DataTypesExt/include/mitkCuboid.h
+++ b/Modules/DataTypesExt/include/mitkCuboid.h
@@ -1,38 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITCUBOID_H_HEADER_INCLUDED
#define MITCUBOID_H_HEADER_INCLUDED
#include "MitkDataTypesExtExports.h"
#include "mitkBoundingObject.h"
namespace mitk
{
//##Documentation
//## @brief Data class containing an cuboid
//## @ingroup Data
class MITKDATATYPESEXT_EXPORT Cuboid : public BoundingObject
{
public:
mitkClassMacro(Cuboid, BoundingObject);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
mitk::ScalarType GetVolume() override;
bool IsInside(const Point3D &p) const override;
protected:
Cuboid();
~Cuboid() override;
};
}
#endif /* MITCUBOID_H_HEADER_INCLUDED */
diff --git a/Modules/DataTypesExt/include/mitkCylinder.h b/Modules/DataTypesExt/include/mitkCylinder.h
index 99065e6e1c..9b8ec84b90 100644
--- a/Modules/DataTypesExt/include/mitkCylinder.h
+++ b/Modules/DataTypesExt/include/mitkCylinder.h
@@ -1,38 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKCYLINDER_H_HEADER_INCLUDED
#define MITKCYLINDER_H_HEADER_INCLUDED
#include "MitkDataTypesExtExports.h"
#include "mitkBoundingObject.h"
namespace mitk
{
//##Documentation
//## @brief Data class containing an cylinder
//## @ingroup Data
class MITKDATATYPESEXT_EXPORT Cylinder : public BoundingObject
{
public:
mitkClassMacro(Cylinder, BoundingObject);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
mitk::ScalarType GetVolume() override;
bool IsInside(const Point3D &p) const override;
protected:
Cylinder();
~Cylinder() override;
};
}
#endif /* MITKCYLINDER_H_HEADER_INCLUDED */
diff --git a/Modules/DataTypesExt/include/mitkEllipsoid.h b/Modules/DataTypesExt/include/mitkEllipsoid.h
index 56677b11a1..7256d54ee3 100644
--- a/Modules/DataTypesExt/include/mitkEllipsoid.h
+++ b/Modules/DataTypesExt/include/mitkEllipsoid.h
@@ -1,38 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKELLIPSEDATA_H_HEADER_INCLUDED
#define MITKELLIPSEDATA_H_HEADER_INCLUDED
#include "MitkDataTypesExtExports.h"
#include "mitkBoundingObject.h"
namespace mitk
{
//##Documentation
//## @brief Data class containing an ellipsoid
//## @ingroup Data
class MITKDATATYPESEXT_EXPORT Ellipsoid : public BoundingObject
{
public:
mitkClassMacro(Ellipsoid, BoundingObject);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
mitk::ScalarType GetVolume() override;
bool IsInside(const Point3D &p) const override;
protected:
Ellipsoid();
~Ellipsoid() override;
};
}
#endif /* MITKELLIPSEDATA_H_HEADER_INCLUDED */
diff --git a/Modules/DataTypesExt/include/mitkGridRepresentationProperty.h b/Modules/DataTypesExt/include/mitkGridRepresentationProperty.h
index 47b31d22bf..8bb20169c3 100644
--- a/Modules/DataTypesExt/include/mitkGridRepresentationProperty.h
+++ b/Modules/DataTypesExt/include/mitkGridRepresentationProperty.h
@@ -1,108 +1,110 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_GRID_REPRESENTATION_PROPERTY__H_
#define _MITK_GRID_REPRESENTATION_PROPERTY__H_
#include "MitkDataTypesExtExports.h"
#include "mitkEnumerationProperty.h"
namespace mitk
{
/**
* Extends the enumeration prop mitkEnumerationPropery. Adds the value
* (constant / Id / string representation):
* <ul>
* <li>POINTS / 0 / Points</li>
* <li>WIREFRAME / 1 / Wireframe</li>
* <li>SURFACE / 2 / Surface</li>
* <li>WIREFRAME_SURFACE / 3 / WireframeSurface</li>
* </ul>
* Default is the Wireframe representation
*/
class MITKDATATYPESEXT_EXPORT GridRepresentationProperty : public EnumerationProperty
{
public:
enum RepresentationType
{
POINTS = 0,
WIREFRAME = 1,
SURFACE = 2
}; //, WIREFRAME_SURFACE = 3};
mitkClassMacro(GridRepresentationProperty, EnumerationProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
mitkNewMacro1Param(GridRepresentationProperty, const IdType &);
mitkNewMacro1Param(GridRepresentationProperty, const std::string &);
/**
* Sets the representation type to POINTS.
*/
virtual void SetRepresentationToPoints();
/**
* Sets the representation type to WIREFRAME.
*/
virtual void SetRepresentationToWireframe();
/**
* Sets the representation type to SURFACE.
*/
virtual void SetRepresentationToSurface();
/**
* Sets the representation type to WIREFRAME_SURFACE.
*/
virtual void SetRepresentationToWireframeSurface();
protected:
/**
* Constructor. Sets the representation to a default value of Wireframe(1)
*/
GridRepresentationProperty();
GridRepresentationProperty(const GridRepresentationProperty &other);
/**
* Constructor. Sets the representation to the given value. If it is not
* valid, the representation is set to Wireframe(1)
* @param value the integer representation of the representation
*/
GridRepresentationProperty(const IdType &value);
/**
* Constructor. Sets the representation to the given value. If it is not
* valid, the representation is set to Wireframe(1)
* @param value the string representation of the representation
*/
GridRepresentationProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid representation types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the enumeration types as defined by vtk to the list of known
* enumeration values.
*/
virtual void AddRepresentationTypes();
private:
itk::LightObject::Pointer InternalClone() const override;
};
} // end of namespace mitk
#endif // _MITK_GRID_REPRESENTATION_PROPERTY__H_
diff --git a/Modules/DataTypesExt/include/mitkGridVolumeMapperProperty.h b/Modules/DataTypesExt/include/mitkGridVolumeMapperProperty.h
index 2b0ac225ad..38396b574b 100644
--- a/Modules/DataTypesExt/include/mitkGridVolumeMapperProperty.h
+++ b/Modules/DataTypesExt/include/mitkGridVolumeMapperProperty.h
@@ -1,96 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_GRID_VOLUME_MAPPER_PROPERTY__H_
#define _MITK_GRID_VOLUME_MAPPER_PROPERTY__H_
#include "MitkDataTypesExtExports.h"
#include "mitkEnumerationProperty.h"
namespace mitk
{
/**
* Extends the enumeration prop mitkEnumerationPropery. Adds the value
* (constant/Id/string representation):
* PT/0/Projected Tetrahedra, ZSWEEP/1/ZSweep, RAYCAST/2/Ray Cast
* Default is the Wireframe representation
*/
class MITKDATATYPESEXT_EXPORT GridVolumeMapperProperty : public EnumerationProperty
{
public:
enum MapperType
{
RAYCAST = 0,
PT = 1,
ZSWEEP = 2
};
mitkClassMacro(GridVolumeMapperProperty, EnumerationProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
mitkNewMacro1Param(GridVolumeMapperProperty, const IdType &);
mitkNewMacro1Param(GridVolumeMapperProperty, const std::string &);
/**
* Sets the mapper to projected tetrahedra.
*/
virtual void SetVolumeMapperToPT();
/**
* Sets the mapper to zsweep.
*/
virtual void SetVolumeMapperToZSweep();
/**
* Sets the mapper to ray casting.
*/
virtual void SetVolumeMapperToRayCast();
protected:
/**
* Constructor. Sets the representation to a default value of Wireframe(1)
*/
GridVolumeMapperProperty();
/**
* Constructor. Sets the representation to the given value. If it is not
* valid, the representation is set to Wireframe(1)
* @param value the integer representation of the representation
*/
GridVolumeMapperProperty(const IdType &value);
/**
* Constructor. Sets the representation to the given value. If it is not
* valid, the representation is set to Wireframe(1)
* @param value the string representation of the representation
*/
GridVolumeMapperProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid representation types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the enumeration types as defined by vtk to the list of known
* enumeration values.
*/
virtual void AddRepresentationTypes();
private:
itk::LightObject::Pointer InternalClone() const override;
};
} // end of namespace mitk
#endif // _MITK_GRID_VOLUME_MAPPER_PROPERTY__H_
diff --git a/Modules/DataTypesExt/include/mitkLabeledImageLookupTable.h b/Modules/DataTypesExt/include/mitkLabeledImageLookupTable.h
index a598ad2555..f30b6f1d5a 100644
--- a/Modules/DataTypesExt/include/mitkLabeledImageLookupTable.h
+++ b/Modules/DataTypesExt/include/mitkLabeledImageLookupTable.h
@@ -1,111 +1,112 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKMITKLABELEDIMAGELOOKUPTABLE_H
#define MITKMITKLABELEDIMAGELOOKUPTABLE_H
#include "MitkDataTypesExtExports.h"
#include "mitkLevelWindow.h"
#include "mitkLookupTable.h"
#include <iostream>
#include <string>
namespace mitk
{
/**
* A lookup table for 2D mapping of labeled images. The lookup table supports
* images with up to 256 unsigned labels. Negative labels are not supported.
* Please use the level/window settings as given by the GetLevelWindow() method
* to make sure, that the colors are rendered correctly.
* The colors are initialized with random colors as default. As background
* the label 0 is assumed. The color for the background is set to fully transparent
* as default.
*/
class MITKDATATYPESEXT_EXPORT LabeledImageLookupTable : public LookupTable
{
public:
/**
* Standard mitk typedefs are generated by the mitkClassMacro
*/
mitkClassMacro(LabeledImageLookupTable, LookupTable);
/**
* Make this object constructable by the ::New() Method.
*/
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* The data type for a label. Currently only images with labels
* in the range [0,255] are supported.
*/
typedef unsigned char LabelType;
LabeledImageLookupTable &operator=(const LookupTable &other) override;
/**
* Sets the color for a given label
* @param label The pixel value used as a label in the image
* @param r The red component of the rgba color value. Values sould be given in the range [0,1]
* @param g The green component of the rgba color value. Values sould be given in the range [0,1]
* @param b The blue component of the rgba color value. Values sould be given in the range [0,1]
* @param a The alpha component of the rgba color value. Values sould be given in the range [0,1]. Default is 1.
*/
virtual void SetColorForLabel(
const LabelType &label, const double &r, const double &g, const double &b, const double a = 1.0);
/**
* Determines the color which will be used for coloring a given label.
* @param label the label for which the color should be returned
* @returns an rgba array containing the color information for the given label.
* Color components are expressed as [0,1] double values.
*/
virtual double *GetColorForLabel(const LabelType &label);
/**
* Provides access to level window settings, which should be used
* in combination with the LUTs generated by this filter (at lease for
* 2D visualization. If you use other level/window settings, it is not
* guaranteed, that scalar values are mapped to the correct colors.
*/
mitk::LevelWindow GetLevelWindow() { return m_LevelWindow; }
protected:
/**
* Default constructor. Protected to prevent "normal" creation
*/
LabeledImageLookupTable();
LabeledImageLookupTable(const LabeledImageLookupTable &other);
/**
* Virtual destructor
*/
~LabeledImageLookupTable() override;
/**
* Generates a random rgb color value. Values for rgb are in the range
* [0,1]
*/
virtual void GenerateRandomColor(double &r, double &g, double &b);
/**
* Generates a radnom number drawn from a uniform
* distribution in the range [0,1].
*/
virtual double GenerateRandomNumber();
mitk::LevelWindow m_LevelWindow;
private:
itk::LightObject::Pointer InternalClone() const override;
};
}
#endif
diff --git a/Modules/DataTypesExt/include/mitkLabeledImageVolumeCalculator.h b/Modules/DataTypesExt/include/mitkLabeledImageVolumeCalculator.h
index 54786dd2f6..c9c2586dd7 100644
--- a/Modules/DataTypesExt/include/mitkLabeledImageVolumeCalculator.h
+++ b/Modules/DataTypesExt/include/mitkLabeledImageVolumeCalculator.h
@@ -1,76 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_LABELEDIMAGEVOLUMECALCULATOR_H
#define _MITK_LABELEDIMAGEVOLUMECALCULATOR_H
#include "MitkDataTypesExtExports.h"
#include <itkObject.h>
#include "mitkImage.h"
#include "mitkImageTimeSelector.h"
#include <itkImage.h>
namespace mitk
{
/**
* \brief Class for calculating the volume (or area) for each label in a
* labeled image.
*
* Labels are expected to be of an unsigned integer type.
*
* TODO: Extend class for time resolved images
*/
class MITKDATATYPESEXT_EXPORT LabeledImageVolumeCalculator : public itk::Object
{
public:
typedef std::vector<double> VolumeVector;
typedef std::vector<Point3D> PointVector;
mitkClassMacroItkParent(LabeledImageVolumeCalculator, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkSetConstObjectMacro(Image, mitk::Image);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkSetConstObjectMacro(Image, mitk::Image);
virtual void Calculate();
double GetVolume(unsigned int label) const;
const Point3D &GetCentroid(unsigned int label) const;
const VolumeVector &GetVolumes() const;
const PointVector &GetCentroids() const;
protected:
LabeledImageVolumeCalculator();
~LabeledImageVolumeCalculator() override;
template <typename TPixel, unsigned int VImageDimension>
void _InternalCalculateVolumes(itk::Image<TPixel, VImageDimension> *image,
LabeledImageVolumeCalculator *volumeCalculator,
BaseGeometry *geometry);
ImageTimeSelector::Pointer m_InputTimeSelector;
Image::ConstPointer m_Image;
VolumeVector m_VolumeVector;
PointVector m_CentroidVector;
Point3D m_DummyPoint;
};
}
#endif // #define _MITK_LABELEDIMAGEVOLUMECALCULATOR_H
diff --git a/Modules/DataTypesExt/include/mitkLookupTableSource.h b/Modules/DataTypesExt/include/mitkLookupTableSource.h
index 41a366bbf3..bbe82e194c 100644
--- a/Modules/DataTypesExt/include/mitkLookupTableSource.h
+++ b/Modules/DataTypesExt/include/mitkLookupTableSource.h
@@ -1,87 +1,89 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKLOOKUPTABLESOURCE_H_HEADER_INCLUDED
#define MITKLOOKUPTABLESOURCE_H_HEADER_INCLUDED
#include "MitkDataTypesExtExports.h"
#include "mitkCommon.h"
#include "mitkLookupTable.h"
#include "itkProcessObject.h"
namespace mitk
{
/**
* @brief Base class for all objects which have an object of type
* mitkLookupTable as output
*
* Base class for all objects which have an object of type mitkLookupTable
* as output. It is assumed, that mitkLookupTableSources do not provide support
* for streaming, that is, that the requested region is always the largest
* possible region.
* @ingroup Process
*/
class MITKDATATYPESEXT_EXPORT LookupTableSource : public itk::ProcessObject
{
public:
- mitkClassMacroItkParent(LookupTableSource, itk::ProcessObject) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacroItkParent(LookupTableSource, itk::ProcessObject);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
- typedef mitk::LookupTable OutputType;
+ typedef mitk::LookupTable OutputType;
typedef OutputType::Pointer OutputTypePointer;
typedef itk::DataObject::Pointer DataObjectPointer;
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
/**
* Generates the input requested region simply by calling the equivalent
* method of the superclass.
*/
void GenerateInputRequestedRegion() override;
/**
* Replacement of the SetOutput method. I think it is not yet correcly
* implemented, so you should better not use it.
* @todo provide a more usefule implementation
* @param output the intended output of the lookup table source.
*/
virtual void GraftOutput(OutputType *output);
virtual OutputType *GetOutput();
virtual const OutputType *GetOutput() const;
virtual OutputType *GetOutput(DataObjectPointerArraySizeType idx);
virtual const OutputType *GetOutput(DataObjectPointerArraySizeType idx) const;
protected:
LookupTableSource();
~LookupTableSource() override;
};
} // namespace mitk
#endif
diff --git a/Modules/DataTypesExt/include/mitkMesh.h b/Modules/DataTypesExt/include/mitkMesh.h
index 74408065d2..215e71e648 100644
--- a/Modules/DataTypesExt/include/mitkMesh.h
+++ b/Modules/DataTypesExt/include/mitkMesh.h
@@ -1,124 +1,126 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKMESH_H_HEADER_INCLUDED
#define MITKMESH_H_HEADER_INCLUDED
#include "MitkDataTypesExtExports.h"
#include "mitkPointSet.h"
#include <itkPolygonCell.h>
#include <vtkCellArray.h>
#include <vtkFloatArray.h>
#include <vtkPointData.h>
#include <vtkPolyData.h>
#include <vtkPoints.h>
#include <vtkSystemIncludes.h>
namespace mitk
{
/**
* \brief DataStructure which stores a set of points (incl. pointdata) where
* each point can be associated to an element of a cell.
*
* A mesh contains several cells that can be of different celltypes
* (Line, Triangle, Polygone...). A cell is always closed. If a linestrip is
* to be created, then declare several cells, each containing one line.
*
* The operations take care of the coherence. If a line is added to an
* existing LineCell, then a TriangleCell is built with the old and the new
* parameter (and so on). Deletion is done the opposite way.
*
* Example for inserting a line into a TriangleCell:
* existing PIds ind the cell: 1, 2, 4;
* inserting (2, 3) so that new PIds in Cell: 1, 2, 3, 4
*
* The cell is now of type QuadrilateralCell
*
* \ingroup Data
*/
class MITKDATATYPESEXT_EXPORT Mesh : public PointSet
{
public:
mitkClassMacro(Mesh, PointSet);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
typedef Superclass::DataType::CellType CellType;
typedef CellType::CellAutoPointer CellAutoPointer;
typedef Superclass::MeshTraits::CellTraits CellTraits;
typedef CellTraits::PointIdConstIterator PointIdConstIterator;
typedef CellTraits::PointIdIterator PointIdIterator;
typedef DataType::CellDataContainer CellDataContainer;
typedef DataType::CellDataContainerIterator CellDataIterator;
typedef Superclass::DataType::CellsContainer::Iterator CellIterator;
typedef Superclass::DataType::CellsContainer::ConstIterator ConstCellIterator;
typedef itk::PolygonCell<CellType> PolygonType;
typedef MeshType::CellType::MultiVisitor MeshMultiVisitor;
/** \brief returns the current number of cells in the mesh */
virtual unsigned long GetNumberOfCells(int t = 0);
/** \brief returns the mesh */
virtual const DataType *GetMesh(int t = 0) const;
/** \brief returns the mesh */
virtual DataType *GetMesh(int t = 0);
void SetMesh(DataType *mesh, int t = 0);
/** \brief checks if the given point is in a cell and returns that cellId.
* Basicaly it searches lines and points that are hit.
*/
virtual bool EvaluatePosition(Point3D point, unsigned long &cellId, float precision, int t = 0);
/** \brief searches for the next new cellId and returns that id */
unsigned long GetNewCellId(int t = 0);
/** \brief returns the first cell that includes the given pointId */
virtual int SearchFirstCell(unsigned long pointId, int t = 0);
/** \brief searches for a line, that is hit by the given point.
* Then returns the lineId and the cellId
*/
virtual bool SearchLine(Point3D point, float distance, unsigned long &lineId, unsigned long &cellId, int t = 0);
/** \brief searches a line according to the cellId and lineId and returns
* the PointIds, that assign the line; if successful, then return
* param = true;
*/
virtual bool GetPointIds(unsigned long cellId, unsigned long lineId, int &idA, int &idB, int t = 0);
/** \brief searches a selected cell and returns the id of that cell. If no
* cell is found, then -1 is returned
*/
virtual int SearchSelectedCell(int t = 0);
/** \brief creates a BoundingBox and computes it with the given points of
* the cell.
*
* Returns the BoundingBox != IsNull() if successful.
*/
virtual DataType::BoundingBoxPointer GetBoundingBoxFromCell(unsigned long cellId, int t = 0);
/** \brief executes the given Operation */
void ExecuteOperation(Operation *operation) override;
protected:
Mesh();
~Mesh() override;
};
} // namespace mitk
#endif /* MITKMESH_H_HEADER_INCLUDED */
diff --git a/Modules/DataTypesExt/include/mitkMultiStepper.h b/Modules/DataTypesExt/include/mitkMultiStepper.h
index db3648827a..c77859a4e0 100644
--- a/Modules/DataTypesExt/include/mitkMultiStepper.h
+++ b/Modules/DataTypesExt/include/mitkMultiStepper.h
@@ -1,60 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MULTISTEPPER_H_HEADER_INCLUDED
#define MULTISTEPPER_H_HEADER_INCLUDED
#include "MitkDataTypesExtExports.h"
#include "mitkCommon.h"
#include "mitkStepper.h"
#include "mitkVector.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <set>
namespace mitk
{
//##Documentation
//## @brief Helper class to step through a list
//##
//## A helper class to step through a list. Does not contain the list, just the
//## position in the list (between 0 and GetSteps()). Provides methods like
//## First (go to the first element), Next (go to the next one), etc.
//## @ingroup NavigationControl
class MITKDATATYPESEXT_EXPORT MultiStepper : public Stepper
{
public:
mitkClassMacro(MultiStepper, Stepper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) void AddStepper(Stepper::Pointer stepper, unsigned int repeat = 1);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self) void AddStepper(Stepper::Pointer stepper, unsigned int repeat = 1);
void RemoveStepper(Stepper::Pointer stepper, unsigned int repeat = 1);
/*void Next();
void Previous();
void First();
void Last(); */
// unsigned int GetPos();
void SetPos(unsigned int pos) override;
void SetSteps(const unsigned int steps) override;
protected:
MultiStepper();
~MultiStepper() override;
typedef std::set<Stepper::Pointer> StepperSet;
typedef std::map<Stepper::Pointer, unsigned int> ScaleFactorMap;
StepperSet m_SubSteppers;
ScaleFactorMap m_ScaleFactors;
Stepper::Pointer m_LargestRangeStepper;
void UpdateStepCount();
};
} // namespace mitk
#endif /* MULTISTEPPER_H_HEADER_INCLUDED */
diff --git a/Modules/DataTypesExt/include/mitkPlane.h b/Modules/DataTypesExt/include/mitkPlane.h
index 47d5219ea0..f31f31b593 100644
--- a/Modules/DataTypesExt/include/mitkPlane.h
+++ b/Modules/DataTypesExt/include/mitkPlane.h
@@ -1,57 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPLANE_H_HEADER_INCLUDED
#define MITKPLANE_H_HEADER_INCLUDED
#include "MitkDataTypesExtExports.h"
#include "mitkBoundingObject.h"
class vtkPlaneSource;
class vtkDoubleArray;
namespace mitk
{
/**
* \brief Plane surface representation
*
* Encapsulates vtkPlaneSource.
*
* \ingroup Data
*/
class MITKDATATYPESEXT_EXPORT Plane : public BoundingObject
{
public:
mitkClassMacro(Plane, BoundingObject);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void SetExtent(const double x, const double y);
void GetExtent(double &x, double &y) const;
void SetResolution(const int xR, const int yR);
void GetResolution(int &xR, int &yR) const;
mitk::ScalarType GetVolume() override;
bool IsInside(const Point3D &p) const override;
protected:
Plane();
~Plane() override;
vtkPlaneSource *m_PlaneSource;
vtkPolyData *m_Plane;
vtkDoubleArray *m_PlaneNormal;
};
}
#endif /* MITKPLANE_H_HEADER_INCLUDED */
diff --git a/Modules/DataTypesExt/include/mitkSurfaceDeformationDataInteractor3D.h b/Modules/DataTypesExt/include/mitkSurfaceDeformationDataInteractor3D.h
index 0b8257e304..622401862b 100644
--- a/Modules/DataTypesExt/include/mitkSurfaceDeformationDataInteractor3D.h
+++ b/Modules/DataTypesExt/include/mitkSurfaceDeformationDataInteractor3D.h
@@ -1,78 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkSurfaceDeformationDataInteractor3D_h_
#define mitkSurfaceDeformationDataInteractor3D_h_
#include "MitkDataTypesExtExports.h"
#include "mitkDataInteractor.h"
#include "mitkSurface.h"
namespace mitk
{
/**
* \brief SurfaceDeformation interaction with objects in 3D windows.
*
* \ingroup Interaction
*/
// Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
class MITKDATATYPESEXT_EXPORT SurfaceDeformationDataInteractor3D : public DataInteractor
{
public:
mitkClassMacro(SurfaceDeformationDataInteractor3D, DataInteractor);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
protected : SurfaceDeformationDataInteractor3D();
~SurfaceDeformationDataInteractor3D() override;
/**
* Here actions strings from the loaded state machine pattern are mapped to functions of
* the DataInteractor. These functions are called when an action from the state machine pattern is executed.
*/
void ConnectActionsAndFunctions() override;
/**
* This function is called when a DataNode has been set/changed.
*/
void DataNodeChanged() override;
/**
* Initializes the movement, stores starting position.
*/
virtual bool CheckOverObject(const InteractionEvent *);
virtual void SelectObject(StateMachineAction *, InteractionEvent *);
virtual void DeselectObject(StateMachineAction *, InteractionEvent *);
virtual void InitDeformation(StateMachineAction *, InteractionEvent *);
virtual void DeformObject(StateMachineAction *, InteractionEvent *);
virtual void ScaleRadius(StateMachineAction *, InteractionEvent *);
enum
{
COLORIZATION_GAUSS,
COLORIZATION_CONSTANT
};
private:
void ColorizeSurface(
vtkPolyData *polyData, int timeStep, const Point3D &pickedPoint, int mode, double scalar = 0.0);
double m_InitialPickedWorldPoint[4];
Point3D m_InitialPickedPoint;
Point3D m_SurfaceColorizationCenter;
Surface *m_Surface;
vtkPolyData *m_OriginalPolyData;
double m_GaussSigma;
Vector3D m_ObjectNormal;
};
}
#endif
diff --git a/Modules/DataTypesExt/include/mitkUnstructuredGrid.h b/Modules/DataTypesExt/include/mitkUnstructuredGrid.h
index 80ed138154..f02c0e0a31 100644
--- a/Modules/DataTypesExt/include/mitkUnstructuredGrid.h
+++ b/Modules/DataTypesExt/include/mitkUnstructuredGrid.h
@@ -1,103 +1,105 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_UNSTRUCTURED_GRID_H_
#define _MITK_UNSTRUCTURED_GRID_H_
#include "MitkDataTypesExtExports.h"
#include "itkImageRegion.h"
#include "mitkBaseData.h"
class vtkUnstructuredGrid;
namespace mitk
{
//##Documentation
//## @brief Class for storing unstructured grids (vtkUnstructuredGrid)
//## @ingroup Data
class MITKDATATYPESEXT_EXPORT UnstructuredGrid : public BaseData
{
public:
// not yet the best choice of a region-type for surfaces, but it works for the time being
typedef itk::ImageRegion<5> RegionType;
mitkClassMacro(UnstructuredGrid, BaseData);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
virtual void SetVtkUnstructuredGrid(vtkUnstructuredGrid *grid, unsigned int t = 0);
virtual vtkUnstructuredGrid *GetVtkUnstructuredGrid(unsigned int t = 0);
void UpdateOutputInformation() override;
void SetRequestedRegionToLargestPossibleRegion() override;
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
bool VerifyRequestedRegion() override;
void SetRequestedRegion(const itk::DataObject *data) override;
virtual void SetRequestedRegion(UnstructuredGrid::RegionType *region);
void Graft(const DataObject *data) override;
void CopyInformation(const itk::DataObject *data) override;
void Update() override;
// Initialize should not be called manually;
// The polydata vector is initialized automatically when enlarged;
void Expand(unsigned int timeSteps = 1) override;
const RegionType &GetLargestPossibleRegion() const
{
m_LargestPossibleRegion.SetIndex(3, 0);
m_LargestPossibleRegion.SetSize(3, GetTimeGeometry()->CountTimeSteps());
return m_LargestPossibleRegion;
}
//##Documentation
//## Get the region object that defines the size and starting index
//## for the region of the image requested (i.e., the region of the
//## image to be operated on by a filter).
virtual const RegionType &GetRequestedRegion() const { return m_RequestedRegion; }
void CalculateBoundingBox();
protected:
mitkCloneMacro(Self);
typedef std::vector<vtkUnstructuredGrid *> VTKUnstructuredGridSeries;
UnstructuredGrid();
UnstructuredGrid(const mitk::UnstructuredGrid &other);
~UnstructuredGrid() override;
void ClearData() override;
void InitializeEmpty() override;
VTKUnstructuredGridSeries m_GridSeries;
mutable RegionType m_LargestPossibleRegion;
RegionType m_RequestedRegion;
bool m_CalculateBoundingBox;
};
} // namespace mitk
#endif /* _MITK_UNSTRUCTURED_GRID_H_ */
diff --git a/Modules/DataTypesExt/include/mitkUnstructuredGridSource.h b/Modules/DataTypesExt/include/mitkUnstructuredGridSource.h
index 2dbe6e8868..e6d8e7cd8b 100644
--- a/Modules/DataTypesExt/include/mitkUnstructuredGridSource.h
+++ b/Modules/DataTypesExt/include/mitkUnstructuredGridSource.h
@@ -1,66 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_UNSTRUCTURED_GRID_DATA_SOURCE_H_HEADER_
#define _MITK_UNSTRUCTURED_GRID_DATA_SOURCE_H_HEADER_
#include "MitkDataTypesExtExports.h"
#include "mitkBaseDataSource.h"
namespace mitk
{
class UnstructuredGrid;
//##Documentation
//## @brief Superclass of all classes generating unstructured grids (instances of class
//## UnstructuredGrid) as output.
//##
//## In itk and vtk the generated result of a ProcessObject is only guaranteed
//## to be up-to-date, when Update() of the ProcessObject or the generated
//## DataObject is called immediately before access of the data stored in the
//## DataObject. This is also true for subclasses of mitk::BaseProcess and thus
//## for mitk::UnstructuredGridSource.
//## @ingroup Process
class MITKDATATYPESEXT_EXPORT UnstructuredGridSource : public BaseDataSource
{
public:
- mitkClassMacro(UnstructuredGridSource, BaseDataSource) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(UnstructuredGridSource, BaseDataSource);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef mitk::UnstructuredGrid OutputType;
mitkBaseDataSourceGetOutputDeclarations
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer
MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
protected:
UnstructuredGridSource();
~UnstructuredGridSource() override;
};
} // namespace mitk
#endif /* _MITK_UNSTRUCTURED_GRID_DATA_SOURCE_H_HEADER_ */
diff --git a/Modules/DicomRT/include/mitkDoseImageVtkMapper2D.h b/Modules/DicomRT/include/mitkDoseImageVtkMapper2D.h
index e1bb7b3edc..9c98014252 100644
--- a/Modules/DicomRT/include/mitkDoseImageVtkMapper2D.h
+++ b/Modules/DicomRT/include/mitkDoseImageVtkMapper2D.h
@@ -1,309 +1,309 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKDoseImageVtkMapper2D2D_H_HEADER_INCLUDED
#define MITKDoseImageVtkMapper2D2D_H_HEADER_INCLUDED
//MITK
#include <mitkCommon.h>
#include <MitkDicomRTExports.h>
//MITK Rendering
#include "mitkBaseRenderer.h"
#include "mitkVtkMapper.h"
#include "mitkExtractSliceFilter.h"
//VTK
#include <vtkSmartPointer.h>
#include <vtkPropAssembly.h>
#include <vtkCellArray.h>
class vtkActor;
class vtkPolyDataMapper;
class vtkPlaneSource;
class vtkImageData;
class vtkLookupTable;
class vtkImageExtractComponents;
class vtkImageReslice;
class vtkImageChangeInformation;
class vtkPoints;
class vtkMitkThickSlicesFilter;
class vtkPolyData;
class vtkMitkApplyLevelWindowToRGBFilter;
class vtkMitkLevelWindowFilter;
namespace mitk {
/** \brief Mapper to resample and display 2D slices of a 3D image.
*
* The following image gives a brief overview of the mapping and the involved parts.
*
* \image html DoseImageVtkMapper2Darchitecture.png
*
* First, the image is resliced by means of vtkImageReslice. The volume image
* serves as input to the mapper in addition to spatial placement of the slice and a few other
* properties such as thick slices. This code was already present in the old version
* (mitkImageMapperGL2D).
*
* Next, the obtained slice (m_ReslicedImage) is put into a vtkMitkLevelWindowFilter
* and the scalar levelwindow, opacity levelwindow and optional clipping to
* local image bounds are applied
*
* Next, the output of the vtkMitkLevelWindowFilter is used to create a texture
* (m_Texture) and a plane onto which the texture is rendered (m_Plane). For
* mapping purposes, a vtkPolyDataMapper (m_Mapper) is utilized. Orthographic
* projection is applied to create the effect of a 2D image. The mapper and the
* texture are assigned to the actor (m_Actor) which is passed to the VTK rendering
* pipeline via the method GetVtkProp().
*
* In order to transform the textured plane to the correct position in space, the
* same transformation as used for reslicing is applied to both the camera and the
* vtkActor. All important steps are explained in more detail below. The resulting
* 2D image (by reslicing the underlying 3D input image appropriately) can either
* be directly rendered in a 2D view or just be calculated to be used later by another
* rendering entity, e.g. in texture mapping in a 3D view.
*
* Properties that can be set for images and influence the imageMapper2D are:
*
* - \b "opacity": (FloatProperty) Opacity of the image
* - \b "color": (ColorProperty) Color of the image
* - \b "LookupTable": (mitkLookupTableProperty) If this property is set,
* the default lookuptable will be ignored and the "LookupTable" value
* will be used instead.
* - \b "Image Rendering.Mode": This property decides which mode is used to render images. (E.g. if a lookup table or a transferfunction is applied). Detailed documentation about the modes can be found here: \link mitk::RenderingerModeProperty \endlink
* - \b "Image Rendering.Transfer Function": (mitkTransferFunctionProperty) If this
* property is set, a color transferfunction will be used to color the image.
* - \b "binary": (BoolProperty) is the image a binary image or not
* - \b "outline binary": (BoolProperty) show outline of the image or not
* - \b "texture interpolation": (BoolProperty) texture interpolation of the image
* - \b "reslice interpolation": (VtkResliceInterpolationProperty) reslice interpolation of the image
* - \b "in plane resample extent by geometry": (BoolProperty) Do it or not
* - \b "bounding box": (BoolProperty) Is the Bounding Box of the image shown or not
* - \b "layer": (IntProperty) Layer of the image
* - \b "volume annotation color": (ColorProperty) color of the volume annotation, TODO has to be reimplemented
* - \b "volume annotation unit": (StringProperty) annotation unit as string (does not implicit convert the unit!)
unit is ml or cm3, TODO has to be reimplemented
* The default properties are:
* - \b "opacity", mitk::FloatProperty::New(0.3f), renderer, overwrite )
* - \b "color", ColorProperty::New(1.0,0.0,0.0), renderer, overwrite )
* - \b "binary", mitk::BoolProperty::New( true ), renderer, overwrite )
* - \b "outline binary", mitk::BoolProperty::New( false ), renderer, overwrite )
* - \b "texture interpolation", mitk::BoolProperty::New( false ) )
* - \b "reslice interpolation", mitk::VtkResliceInterpolationProperty::New() )
* - \b "in plane resample extent by geometry", mitk::BoolProperty::New( false ) )
* - \b "bounding box", mitk::BoolProperty::New( false ) )
* - \b "layer", mitk::IntProperty::New(10), renderer, overwrite)
* - \b "Image Rendering.Transfer Function": Default color transfer function for CTs
* - \b "LookupTable": Rainbow color.
* If the modality-property is set for an image, the mapper uses modality-specific default properties,
* e.g. color maps, if they are defined.
* \ingroup Mapper
*/
class MITKDICOMRT_EXPORT DoseImageVtkMapper2D : public VtkMapper
{
public:
/** Standard class typedefs. */
mitkClassMacro( DoseImageVtkMapper2D,VtkMapper );
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** \brief Get the Image to map */
const mitk::Image *GetInput(void);
/** \brief Checks whether this mapper needs to update itself and generate
* data. */
void Update(mitk::BaseRenderer * renderer) override;
//### methods of MITK-VTK rendering pipeline
vtkProp* GetVtkProp(mitk::BaseRenderer* renderer) override;
//### end of methods of MITK-VTK rendering pipeline
/** \brief Internal class holding the mapper, actor, etc. for each of the 3 2D render windows */
/**
* To render transveral, coronal, and sagittal, the mapper is called three times.
* For performance reasons, the corresponding data for each view is saved in the
* internal helper class LocalStorage. This allows rendering n views with just
* 1 mitkMapper using n vtkMapper.
* */
class MITKDICOMRT_EXPORT LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkActor> m_Actor;
vtkSmartPointer<vtkPropAssembly> m_Actors;
/** \brief Mapper of a 2D render window. */
vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
vtkSmartPointer<vtkImageExtractComponents> m_VectorComponentExtractor;
/** \brief Current slice of a 2D render window.*/
vtkSmartPointer<vtkImageData> m_ReslicedImage;
/** \brief Empty vtkPolyData that is set when rendering geometry does not
* intersect the image geometry.
* \warning This member variable is set to nullptr,
* if no image geometry is inside the plane geometry
* of the respective render window. Any user of this
* slice has to check whether it is set to nullptr!
*/
vtkSmartPointer<vtkPolyData> m_EmptyPolyData;
/** \brief Plane on which the slice is rendered as texture. */
vtkSmartPointer<vtkPlaneSource> m_Plane;
/** \brief The texture which is used to render the current slice. */
vtkSmartPointer<vtkTexture> m_Texture;
/** \brief The lookuptables for colors and level window */
vtkSmartPointer<vtkLookupTable> m_DefaultLookupTable;
vtkSmartPointer<vtkLookupTable> m_BinaryLookupTable;
vtkSmartPointer<vtkLookupTable> m_ColorLookupTable;
/** \brief The actual reslicer (one per renderer) */
mitk::ExtractSliceFilter::Pointer m_Reslicer;
/** \brief Filter for thick slices */
vtkSmartPointer<vtkMitkThickSlicesFilter> m_TSFilter;
/** \brief PolyData object containg all lines/points needed for outlining the contour.
This container is used to save a computed contour for the next rendering execution.
For instance, if you zoom or pann, there is no need to recompute the contour. */
vtkSmartPointer<vtkPolyData> m_OutlinePolyData;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief mmPerPixel relation between pixel and mm. (World spacing).*/
mitk::ScalarType* m_mmPerPixel;
/** \brief This filter is used to apply the level window to Grayvalue and RBG(A) images. */
vtkSmartPointer<vtkMitkLevelWindowFilter> m_LevelWindowFilter;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage() override;
};
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
/** \brief Get the LocalStorage corresponding to the current renderer. */
LocalStorage* GetLocalStorage(mitk::BaseRenderer* renderer);
/** \brief Set the default properties for general image rendering. */
static void SetDefaultProperties(mitk::DataNode* node, mitk::BaseRenderer* renderer = nullptr, bool overwrite = false);
/** \brief This method switches between different rendering modes (e.g. use a lookup table or a transfer function).
* Detailed documentation about the modes can be found here: \link mitk::RenderingerModeProperty \endlink
*/
void ApplyRenderingMode(mitk::BaseRenderer *renderer);
protected:
/** \brief Transforms the actor to the actual position in 3D.
* \param renderer The current renderer corresponding to the render window.
*/
void TransformActor(mitk::BaseRenderer* renderer);
/** \brief Generates a plane according to the size of the resliced image in milimeters.
*
* \image html texturedPlane.png
*
* In VTK a vtkPlaneSource is defined through three points. The origin and two
* points defining the axes of the plane (see VTK documentation). The origin is
* set to (xMin; yMin; Z), where xMin and yMin are the minimal bounds of the
* resliced image in space. Z is relevant for blending and the layer property.
* The center of the plane (C) is also the center of the view plane (cf. the image above).
*
* \note For the standard MITK view with three 2D render windows showing three
* different slices, three such planes are generated. All these planes are generated
* in the XY-plane (even if they depict a YZ-slice of the volume).
*
*/
void GeneratePlane(mitk::BaseRenderer* renderer, double planeBounds[6]);
/** \brief Generates a vtkPolyData object containing the outline of a given binary slice.
\param renderer: Pointer to the renderer containing the needed information
\note This code is based on code from the iil library.
*/
vtkSmartPointer<vtkPolyData> CreateOutlinePolyData(mitk::BaseRenderer* renderer);
/** Default constructor */
DoseImageVtkMapper2D();
/** Default deconstructor */
~DoseImageVtkMapper2D() override;
/** \brief Does the actual resampling, without rendering the image yet.
* All the data is generated inside this method. The vtkProp (or Actor)
* is filled with content (i.e. the resliced image).
*
* After generation, a 4x4 transformation matrix(t) of the current slice is obtained
* from the vtkResliceImage object via GetReslicesAxis(). This matrix is
* applied to each textured plane (actor->SetUserTransform(t)) to transform everything
* to the actual 3D position (cf. the following image).
*
* \image html cameraPositioning3D.png
*
*/
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
/** \brief This method uses the vtkCamera clipping range and the layer property
* to calcualte the depth of the object (e.g. image or contour). The depth is used
* to keep the correct order for the final VTK rendering.*/
float CalculateLayerDepth(mitk::BaseRenderer* renderer);
/** \brief This method applies (or modifies) the lookuptable for all types of images.
* \warning To use the lookup table, the property 'Lookup Table' must be set and a 'Image Rendering.Mode'
* which uses the lookup table must be set.
*/
void ApplyLookuptable(mitk::BaseRenderer* renderer);
/** \brief This method applies a color transfer function.
* Internally, a vtkColorTransferFunction is used. This is usefull for coloring continous
* images (e.g. float)
* \warning To use the color transfer function, the property 'Image Rendering.Transfer Function' must be set and a 'Image Rendering.Mode' which uses the color transfer function must be set.
*/
void ApplyColorTransferFunction(mitk::BaseRenderer* renderer);
/**
* @brief ApplyLevelWindow Apply the level window for the given renderer.
* \warning To use the level window, the property 'LevelWindow' must be set and a 'Image Rendering.Mode' which uses the level window must be set.
* @param renderer Level window for which renderer?
*/
void ApplyLevelWindow(mitk::BaseRenderer* renderer);
/** \brief Set the color of the image/polydata */
void ApplyColor( mitk::BaseRenderer* renderer );
/** \brief Set the opacity of the actor. */
void ApplyOpacity( mitk::BaseRenderer* renderer );
/**
* \brief Calculates whether the given rendering geometry intersects the
* given SlicedGeometry3D.
*
* This method checks if the given PlaneGeometry intersects the given
* SlicedGeometry3D. It calculates the distance of the PlaneGeometry to all
* 8 cornerpoints of the SlicedGeometry3D. If all distances have the same
* sign (all positive or all negative) there is no intersection.
* If the distances have different sign, there is an intersection.
**/
bool RenderingGeometryIntersectsImage( const PlaneGeometry* renderingGeometry, SlicedGeometry3D* imageGeometry );
private:
void CreateLevelOutline(mitk::BaseRenderer* renderer, const mitk::IsoDoseLevel* level, float pref, vtkSmartPointer<vtkPoints> points, vtkSmartPointer<vtkCellArray> lines, vtkSmartPointer<vtkUnsignedCharArray> colors);
};
} // namespace mitk
#endif /* MITKDoseImageVtkMapper2D_H_HEADER_INCLUDED_C10E906E */
diff --git a/Modules/Gizmo/include/mitkGizmoInteractor.h b/Modules/Gizmo/include/mitkGizmoInteractor.h
index b1e58196b5..6a1f8a715f 100644
--- a/Modules/Gizmo/include/mitkGizmoInteractor.h
+++ b/Modules/Gizmo/include/mitkGizmoInteractor.h
@@ -1,157 +1,158 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGizmoInteractor_h
#define mitkGizmoInteractor_h
#include "mitkGizmo.h"
// MITK includes
#include <mitkDataInteractor.h>
#include <mitkDataNode.h>
#include <mitkGeometry3D.h>
// VTK includes
#include <vtkCellPicker.h>
#include <vtkSmartPointer.h>
// System includes
#include <memory>
#include "MitkGizmoExports.h"
namespace mitk
{
class InteractionPositionEvent;
//! Data interactor to manipulate the geometry of an object via interaction
//! with a mitk::Gizmo visualization.
//!
//! Unlike other interactors, this class needs two DataNodes to work on:
//! - the "manipulated object" is the one whose geometry is modified by user input
//! - the "gizmo node" represents the manipulated object's primary axes _and_ is
//! used to take user input (most importantly: to have a picking target)
//!
//! To determine what parts of the object are clicked during interaction,
//! the mappers (2D: custom mapper, 3D: regular surface mapper) are asked
//! for their VTK objects, picking is performed, and the picked point is
//! forwarded to the gizmo object for interpretation.
//!
//! The interactor fills the undo/redo stack with operations on the modified geometry.
//!
//! \sa Gizmo
class MITKGIZMO_EXPORT GizmoInteractor : public DataInteractor
{
public:
mitkClassMacro(GizmoInteractor, DataInteractor);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
//! The node holding the gizmo for visual feedback.
//! This is the node that the interactor is primarily working on
//! (calls DataInteractor::SetDataNode).
void SetGizmoNode(DataNode *node);
//! The node that shall be manipulated in function of the user
//! interaction on the gizmo.
void SetManipulatedObjectNode(DataNode *node);
private:
GizmoInteractor();
~GizmoInteractor() override;
//! Setup the relation between the XML state machine and this object's methods.
void ConnectActionsAndFunctions() override;
//! State machine condition: successful gizmo picking
//! \return true when any part of the gizmo has been picked.
bool HasPickedHandle(const InteractionEvent *);
//! State machine action: Advances state machine by generating a new event
//! in function of the picked part of the gizmo.
void DecideInteraction(StateMachineAction *, InteractionEvent *interactionEvent);
//! State machine action: Translates the manipulated object along the picked axis
//! in function of mouse movement.
void MoveAlongAxis(StateMachineAction *, InteractionEvent *interactionEvent);
//! State machine action: Scale the manipulated object equally along all axes
//! in function of mouse movement.
void ScaleEqually(StateMachineAction *, InteractionEvent *interactionEvent);
//! State machine action: Rotates the manipulated object around the picked axis
//! in function of mouse movement.
void RotateAroundAxis(StateMachineAction *, InteractionEvent *interactionEvent);
//! State machine action: Moves the manipulated object parallel to the camera view plane
//! in function of mouse movement.
void MoveFreely(StateMachineAction *, InteractionEvent *interactionEvent);
//! Add the final transformation operations to the undo stack
void FeedUndoStack(StateMachineAction *, InteractionEvent *interactionEvent);
//! Applies a calculated translation vector to the manipulated object.
void ApplyTranslationToManipulatedObject(const Vector3D &projectedMovement);
//! Applies a calculated scaling factor the manipulated object.
void ApplyEqualScalingToManipulatedObject(double scalingFactor);
//! Applies a calculated rotation angle to the manipulated object.
void ApplyRotationToManipulatedObject(double angle_deg);
//! Pick a gizmo handle from a 2D event (passing by the 2D mapper)
Gizmo::HandleType PickFrom2D(const InteractionPositionEvent *positionEvent);
//! Pick a gizmo handle from a 3D event
//! (passing by the general surface mapper and the gizmo object)
Gizmo::HandleType PickFrom3D(const InteractionPositionEvent *positionEvent);
void UpdateHandleHighlight();
//! the Gizmo used for visual feedback and picking
Gizmo::Pointer m_Gizmo;
//! The manipulated object's geometry
BaseGeometry::Pointer m_ManipulatedObjectGeometry;
//! For picking on the vtkPolyData representing the gizmo
std::map<BaseRenderer *, vtkSmartPointer<vtkCellPicker>> m_Picker;
//! Part of the gizmo that was picked on last check
Gizmo::HandleType m_PickedHandle = Gizmo::NoHandle;
//! Part of the gizmo that is currently highlighted
Gizmo::HandleType m_HighlightedHandle = Gizmo::NoHandle;
//! Color (RGBA) used for highlighting
double m_ColorForHighlight[4];
//! Color (RGBA) that has been replaced by m_ColorForHighlight
double m_ColorReplacedByHighlight[4];
Point2D m_InitialClickPosition2D; //< Initial screen click position
double m_InitialClickPosition2DZ; //< Z value of the initial screen click position
Point3D m_InitialClickPosition3D; //< Initial 3D click position
Point2D m_InitialGizmoCenter2D; //< Initial position of the gizmo's center in screen coordinates
Point3D m_InitialGizmoCenter3D; //< Initial 3D position of the gizmo's center
Vector3D m_AxisOfMovement; //< Axis along which we move when translating
Vector3D m_AxisOfRotation; //< Axis around which we turn when rotating
std::unique_ptr<Operation> m_FinalDoOperation; //< Operation for the undo-stack
std::unique_ptr<Operation> m_FinalUndoOperation; //< Operation for the undo-stack
//! A copy of the origin geometry, to avoid accumulation of tiny errors
BaseGeometry::Pointer m_InitialManipulatedObjectGeometry;
};
}
#endif
diff --git a/Modules/GraphAlgorithms/itkShortestPathCostFunctionLiveWire.h b/Modules/GraphAlgorithms/itkShortestPathCostFunctionLiveWire.h
index 44817dc20e..56f4b2ea74 100644
--- a/Modules/GraphAlgorithms/itkShortestPathCostFunctionLiveWire.h
+++ b/Modules/GraphAlgorithms/itkShortestPathCostFunctionLiveWire.h
@@ -1,164 +1,165 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __itkShortestPathCostFunctionLiveWire_h
#define __itkShortestPathCostFunctionLiveWire_h
#include "itkShortestPathCostFunction.h"
#include "itkImageRegionConstIterator.h"
namespace itk
{
/** \brief Cost function for LiveWire purposes.
Specific features are considered to calculate cummulative
costs of a link between two pixels. These are:
- Gradient Magnitude
- Gradient Direction
- Laplacian Zero Crossing
By default the Gradient Magnitude is mapped linearly to cost values
between 0 (good) and 1 (bad). Via SetDynamicCostMap( std::map< int, int > &costMap)
a cost map can be set to dynamically map Gradient Magnitude (non
linear). Thus, lower values can be considered with lower costs
than higher values of gradient magnitudes.
To compute the costs of the gradient magnitude dynamically
an iverted map of the histogram of gradient magnitude image is used.
*/
template <class TInputImageType>
class ITK_EXPORT ShortestPathCostFunctionLiveWire : public ShortestPathCostFunction<TInputImageType>
{
public:
/** Standard class typedefs. */
typedef ShortestPathCostFunctionLiveWire Self;
typedef ShortestPathCostFunction<TInputImageType> Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
typedef itk::ImageRegionConstIterator<TInputImageType> ConstIteratorType;
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(ShortestPathCostFunctionLiveWire, ShortestPathCostFunction);
typedef itk::Image<unsigned char, 2> UnsignedCharImageType;
typedef itk::Image<float, 2> FloatImageType;
typedef float ComponentType;
typedef itk::CovariantVector<ComponentType, 2> OutputPixelType;
typedef itk::Image<OutputPixelType, 2> VectorOutputImageType;
typedef typename TInputImageType::IndexType IndexType;
typedef TInputImageType ImageType;
typedef itk::ImageRegion<2> RegionType;
/** \brief calculates the costs for going from p1 to p2*/
double GetCost(IndexType p1, IndexType p2) override;
/** \brief returns the minimal costs possible (needed for A*)*/
double GetMinCost() override;
/** \brief Initialize the metric*/
void Initialize() override;
/** \brief Add void pixel in cost map*/
virtual void AddRepulsivePoint(const IndexType &index);
/** \brief Remove void pixel in cost map*/
virtual void RemoveRepulsivePoint(const IndexType &index);
/** \brief Clear repulsive points in cost function*/
virtual void ClearRepulsivePoints();
itkSetMacro(RequestedRegion, RegionType);
itkGetMacro(RequestedRegion, RegionType);
void SetImage(const TInputImageType *_arg) override;
void SetDynamicCostMap(std::map<int, int> &costMap)
{
this->m_CostMap = costMap;
this->m_UseCostMap = true;
this->m_MaxMapCosts = -1;
this->Modified();
}
void SetUseCostMap(bool useCostMap) { this->m_UseCostMap = useCostMap; }
/**
\brief Set the maximum of the dynamic cost map to save computation time.
*/
void SetCostMapMaximum(double max) { this->m_MaxMapCosts = max; }
enum Constants
{
MAPSCALEFACTOR = 10
};
/** \brief Returns the y value of gaussian with given offset and amplitude
gaussian approximation
f(x) = v(bin) * e^ ( -1/2 * (|x-k(bin)| / sigma)^2 )
\param x
\param xOfGaussian - offset
\param yOfGaussian - amplitude
*/
static double Gaussian(double x, double xOfGaussian, double yOfGaussian);
const UnsignedCharImageType *GetMaskImage() { return this->m_MaskImage.GetPointer(); };
const FloatImageType *GetGradientMagnitudeImage() { return this->m_GradientMagnitudeImage.GetPointer(); };
const FloatImageType *GetEdgeImage() { return this->m_EdgeImage.GetPointer(); };
const VectorOutputImageType *GetGradientImage() { return this->m_GradientImage.GetPointer(); };
protected:
ShortestPathCostFunctionLiveWire();
~ShortestPathCostFunctionLiveWire() override{};
FloatImageType::Pointer m_GradientMagnitudeImage;
FloatImageType::Pointer m_EdgeImage;
UnsignedCharImageType::Pointer m_MaskImage;
VectorOutputImageType::Pointer m_GradientImage;
double m_MinCosts;
bool m_UseRepulsivePoints;
typename Superclass::PixelType val;
typename Superclass::PixelType startValue;
typename Superclass::PixelType endValue;
double m_GradientMax;
RegionType m_RequestedRegion;
bool m_Initialized;
std::map<int, int> m_CostMap;
bool m_UseCostMap;
double m_MaxMapCosts;
private:
double SigmoidFunction(double I, double max, double min, double alpha, double beta);
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkShortestPathCostFunctionLiveWire.txx"
#endif
#endif /* __itkShortestPathCostFunctionLiveWire_h */
diff --git a/Modules/GraphAlgorithms/itkShortestPathCostFunctionTbss.h b/Modules/GraphAlgorithms/itkShortestPathCostFunctionTbss.h
index 29693020c0..728dc183c3 100644
--- a/Modules/GraphAlgorithms/itkShortestPathCostFunctionTbss.h
+++ b/Modules/GraphAlgorithms/itkShortestPathCostFunctionTbss.h
@@ -1,68 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __itkShortestPathCostFunctionTbss_h
#define __itkShortestPathCostFunctionTbss_h
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkShapedNeighborhoodIterator.h"
#include "itkShortestPathCostFunction.h" // Superclass of Metrics
#include <itkImageRegionConstIterator.h>
#include <itkMacro.h>
namespace itk
{
template <class TInputImageType>
class ShortestPathCostFunctionTbss : public ShortestPathCostFunction<TInputImageType>
{
public:
/** Standard class typedefs. */
typedef ShortestPathCostFunctionTbss Self;
typedef ShortestPathCostFunction<TInputImageType> Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
typedef itk::ImageRegionConstIterator<TInputImageType> ConstIteratorType;
typedef typename TInputImageType::IndexType IndexType;
typedef itk::Image<float, 3> FloatImageType;
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(Self, Superclass);
// \brief calculates the costs for going from p1 to p2
double GetCost(IndexType p1, IndexType p2) override;
// \brief Initialize the metric
void Initialize() override;
// \brief returns the minimal costs possible (needed for A*)
double GetMinCost() override;
void SetThreshold(double t) { m_Threshold = t; }
protected:
ShortestPathCostFunctionTbss();
~ShortestPathCostFunctionTbss() override{};
double m_Threshold;
private:
};
} // end namespace itk
#include "itkShortestPathCostFunctionTbss.txx"
#endif /* __itkShortestPathCostFunctionTbss_h */
diff --git a/Modules/GraphAlgorithms/itkShortestPathImageFilter.h b/Modules/GraphAlgorithms/itkShortestPathImageFilter.h
index f06db95922..f392465b02 100644
--- a/Modules/GraphAlgorithms/itkShortestPathImageFilter.h
+++ b/Modules/GraphAlgorithms/itkShortestPathImageFilter.h
@@ -1,230 +1,231 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __itkShortestPathImageFilter_h
#define __itkShortestPathImageFilter_h
#include "itkImageToImageFilter.h"
#include "itkShortestPathCostFunction.h"
#include "itkShortestPathNode.h"
#include <itkImageRegionIteratorWithIndex.h>
#include <itkMacro.h>
// ------- INFORMATION ----------
/// SET FUNCTIONS
// void SetInput( ItkImage ) // Compulsory
// void SetStartIndex (const IndexType & StartIndex); // Compulsory
// void SetEndIndex(const IndexType & EndIndex); // Compulsory
// void SetFullNeighborsMode(bool) // Optional (default=false), if false N4, if true N26
// void SetActivateTimeOut(bool) // Optional (default=false), for debug issues: after 30s algorithms terminates. You can
// have a look at the VectorOrderImage to see how far it came
// void SetMakeOutputImage(bool) // Optional (default=true), Generate an outputimage of the path. You can also get the
// path directoy with GetVectorPath()
// void SetCalcAllDistances(bool) // Optional (default=false), Calculate Distances over the whole image. CAREFUL,
// algorithm time extends a lot. Necessary for GetDistanceImage
// void SetStoreVectorOrder(bool) // Optional (default=false), Stores in which order the pixels were checked. Necessary
// for GetVectorOrderImage
// void AddEndIndex(const IndexType & EndIndex) //Optional. By calling this function you can add several endpoints! The
// algorithm will look for several shortest Pathes. From Start to all Endpoints.
//
/// GET FUNCTIONS
// std::vector< itk::Index<3> > GetVectorPath(); // returns the shortest path as vector
// std::vector< std::vector< itk::Index<3> > GetMultipleVectorPathe(); // returns a vector of shortest Pathes (which are
// vectors of points)
// GetDistanceImage // Returns the distance image
// GetVectorOrderIMage // Returns the Vector Order image
//
// EXAMPLE USE
// pleae see qmitkmitralvalvesegmentation4dtee bundle
namespace itk
{
template <class TInputImageType, class TOutputImageType>
class ShortestPathImageFilter : public ImageToImageFilter<TInputImageType, TOutputImageType>
{
public:
// Standard Typedefs
typedef ShortestPathImageFilter Self;
typedef ImageToImageFilter<TInputImageType, TOutputImageType> Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
// Typdefs for metric
typedef ShortestPathCostFunction<TInputImageType> CostFunctionType;
typedef typename CostFunctionType::Pointer CostFunctionTypePointer;
// More typdefs for convenience
typedef TInputImageType InputImageType;
typedef typename TInputImageType::Pointer InputImagePointer;
typedef typename TInputImageType::PixelType InputImagePixelType;
typedef typename TInputImageType::SizeType InputImageSizeType;
typedef typename TInputImageType::IndexType IndexType;
typedef typename itk::ImageRegionIteratorWithIndex<InputImageType> InputImageIteratorType;
typedef TOutputImageType OutputImageType;
typedef typename TOutputImageType::Pointer OutputImagePointer;
typedef typename TOutputImageType::PixelType OutputImagePixelType;
typedef typename TOutputImageType::IndexType OutputImageIndexType;
typedef ImageRegionIteratorWithIndex<OutputImageType> OutputImageIteratorType;
typedef itk::ShapedNeighborhoodIterator<TInputImageType> itkShapedNeighborhoodIteratorType;
// New Macro for smartpointer instantiation
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
// Run-time type information
- itkTypeMacro(ShortestPathImageFilter, ImageToImageFilter)
+ itkTypeMacro(ShortestPathImageFilter, ImageToImageFilter);
// Display
void PrintSelf(std::ostream &os, Indent indent) const override;
// Compare function for A_STAR
struct CompareNodeStar
{
bool operator()(ShortestPathNode *a, ShortestPathNode *b) { return (a->distAndEst > b->distAndEst); }
};
// \brief Set Starpoint for ShortestPath Calculation
void SetStartIndex(const IndexType &StartIndex);
// \brief Adds Endpoint for multiple ShortestPath Calculation
void AddEndIndex(const IndexType &index);
// \brief Set Endpoint for ShortestPath Calculation
void SetEndIndex(const IndexType &EndIndex);
// \brief Set FullNeighborsMode. false = no diagonal neighbors, in 2D this means N4 Neigborhood. true = would be N8
// in 2D
itkSetMacro(FullNeighborsMode, bool);
itkGetMacro(FullNeighborsMode, bool);
// \brief Set Graph_fullNeighbors. false = no diagonal neighbors, in 2D this means N4 Neigborhood. true = would be
// N8 in 2D
- itkSetMacro(Graph_fullNeighbors, bool)
+ itkSetMacro(Graph_fullNeighbors, bool);
// \brief (default=true), Produce output image, which shows the shortest path. But you can also get the shortest
// Path directly as vector with the function GetVectorPath
itkSetMacro(MakeOutputImage, bool);
itkGetMacro(MakeOutputImage, bool);
// \brief (default=false), Store an Vector of Order, so you can call getVectorOrderImage after update
itkSetMacro(StoreVectorOrder, bool);
itkGetMacro(StoreVectorOrder, bool);
// \brief (default=false), // Calculate all Distances to all pixels, so you can call getDistanceImage after update
// (warning algo will take a long time)
itkSetMacro(CalcAllDistances, bool);
itkGetMacro(CalcAllDistances, bool);
// \brief (default=false), for debug issues: after 30s algorithms terminates. You can have a look at the
// VectorOrderImage to see how far it came
itkSetMacro(ActivateTimeOut, bool);
itkGetMacro(ActivateTimeOut, bool);
// \brief returns shortest Path as vector
std::vector<IndexType> GetVectorPath();
// \brief returns Multiple shortest Paths. You can call this function, when u performed a multiple shortest path
// search (one start, several ends)
std::vector<std::vector<IndexType>> GetMultipleVectorPaths();
// \brief returns the vector order image. It shows in which order the pixels were checked. good for debugging. Be
// sure to have m_StoreVectorOrder=true
OutputImagePointer GetVectorOrderImage();
// \brief returns the distance image. It shows the distances from the startpoint to all other pixels. Be sure to
// have m_CalcAllDistances=true
OutputImagePointer GetDistanceImage();
// \brief Fill m_VectorPath
void MakeShortestPathVector();
// \brief cleans up the filter
void CleanUp();
itkSetObjectMacro(CostFunction,
CostFunctionType); // itkSetObjectMacro = set function that uses pointer as parameter
itkGetObjectMacro(CostFunction, CostFunctionType);
protected:
std::vector<IndexType>
m_endPoints; // if you fill this vector, the algo will not rest until all endPoints have been reached
std::vector<IndexType> m_endPointsClosed;
ShortestPathNode *m_Nodes; // main list that contains all nodes
NodeNumType m_Graph_NumberOfNodes;
NodeNumType m_Graph_StartNode;
NodeNumType m_Graph_EndNode;
bool m_Graph_fullNeighbors;
std::vector<ShortestPathNode *> m_Graph_DiscoveredNodeList;
ShortestPathImageFilter(Self &); // intentionally not implemented
void operator=(const Self &); // intentionally not implemented
const static int BACKGROUND = 0;
const static int FOREGROUND = 255;
bool m_FullNeighborsMode;
bool m_MakeOutputImage;
bool m_StoreVectorOrder; // Store an Vector of Order, so you can call getVectorOrderImage after update
bool m_CalcAllDistances; // Calculate all Distances, so you can call getDistanceImage after update (warning algo
// will take a long time)
bool multipleEndPoints;
bool m_ActivateTimeOut; // if true, then i search max. 30 secs. then abort
bool m_Initialized;
CostFunctionTypePointer m_CostFunction;
IndexType m_StartIndex, m_EndIndex;
std::vector<IndexType> m_VectorPath;
std::vector<std::vector<IndexType>> m_MultipleVectorPaths;
std::vector<NodeNumType> m_VectorOrder;
ShortestPathImageFilter();
~ShortestPathImageFilter() override;
// \brief Create all the outputs
void MakeOutputs();
// \brief Generate Data
void GenerateData() override;
// \brief gets the estimate costs from pixel a to target.
double getEstimatedCostsToTarget(const IndexType &a);
typename InputImageType::Pointer m_magnitudeImage;
// \brief Convert a indexnumber of a node in m_Nodes to image coordinates
typename TInputImageType::IndexType NodeToCoord(NodeNumType);
// \brief Convert image coordinate to a indexnumber of a node in m_Nodes
unsigned int CoordToNode(IndexType);
// \brief Returns the neighbors of a node
std::vector<ShortestPathNode *> GetNeighbors(NodeNumType nodeNum, bool FullNeighbors);
// \brief Check if coords are in bounds of image
bool CoordIsInBounds(IndexType);
// \brief Initializes the graph
void InitGraph();
// \brief Start ShortestPathSearch
void StartShortestPathSearch();
};
} // end of namespace itk
#include "itkShortestPathImageFilter.txx"
#endif
diff --git a/Modules/IGT/Algorithms/mitkIGTLMessageToNavigationDataFilter.h b/Modules/IGT/Algorithms/mitkIGTLMessageToNavigationDataFilter.h
index 1e0199662c..64b4de8f14 100644
--- a/Modules/IGT/Algorithms/mitkIGTLMessageToNavigationDataFilter.h
+++ b/Modules/IGT/Algorithms/mitkIGTLMessageToNavigationDataFilter.h
@@ -1,137 +1,137 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKOPENIGTLINKMESSAGETONAVIGATIONDATAFILTER_H_HEADER_INCLUDED_
#define MITKOPENIGTLINKMESSAGETONAVIGATIONDATAFILTER_H_HEADER_INCLUDED_
#include <mitkNavigationDataSource.h>
#include "mitkIGTLMessage.h"
#include "mitkIGTLMessageSource.h"
#include "MitkIGTExports.h"
namespace mitk
{
/**Documentation
* \brief IGTLinkMessageToNavigationDataFilter is a filter that receives
* OpenIGTLink messages as input and produce NavigationDatas as output
*
* IGTLinkMessageToNavigationDataFilter is a filter that receives
* OpenIGTLink messages as input and produce NavigationDatas as output.
* If the OpenIGTLink message is not of the proper type the filter will not
* do anything.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT
IGTLMessageToNavigationDataFilter : public NavigationDataSource
{
public:
mitkClassMacro(IGTLMessageToNavigationDataFilter, NavigationDataSource);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
using Superclass::SetInput;
/**
* \brief Set the input of this filter
*
* \warning: this will set the number of outputs to the number of inputs,
* deleting any extra outputs that might have been initialized.
* Subclasses that have a different number of outputs than inputs
* must overwrite the SetInput methods.
*/
virtual void SetInput( const IGTLMessage* msg);
/**
* \brief Set input with id idx of this filter
*
* \warning: this will set the number of outputs to the number of inputs,
* deleting any extra outputs that might have been initialized.
* Subclasses that have a different number of outputs than inputs
* must overwrite the SetInput methods.
* If the last input is set to nullptr, the number of inputs will be decreased by
* one (-> removing the last input). If other inputs are set to nullptr, the
* number of inputs will not change.
*/
virtual void SetInput( unsigned int idx, const IGTLMessage* msg);
/** Set an input */
// virtual void SetInput(const DataObjectIdentifierType & key, DataObject *input);
/**
* \brief Get the input of this filter
*/
const IGTLMessage* GetInput(void) const;
/**
* \brief Get the input with id idx of this filter
*/
const IGTLMessage* GetInput(unsigned int idx) const;
/**
* \brief Get the input with name messageName of this filter
*/
const IGTLMessage* GetInput(std::string messageName) const;
/**
*\brief return the index of the input with name messageName,
* throw std::invalid_argument exception if that name was not found
*
*/
DataObjectPointerArraySizeType GetInputIndex(std::string messageName);
/**
*\brief Connects the input of this filter to the outputs of the given
* IGTLMessageSource
*
* This method does not support smartpointer. use FilterX.GetPointer() to
* retrieve a dumbpointer.
*/
virtual void ConnectTo(mitk::IGTLMessageSource * UpstreamFilter);
/**
*\brief Sets the number of expected outputs.
*
* Normally, this is done automatically by the filter concept. However, in our
* case we can not know, for example, how many tracking elements are stored
* in the incoming igtl message. Therefore, we have to set the number here to
* the expected value.
*/
void SetNumberOfExpectedOutputs(unsigned int numOutputs);
protected:
IGTLMessageToNavigationDataFilter();
~IGTLMessageToNavigationDataFilter() override;
void GenerateData() override;
void GenerateTransformData();
void GenerateTrackingDataData();
void GenerateQuaternionTrackingDataData();
/**
* \brief Create an output for each input
*
* This Method sets the number of outputs to the number of inputs
* and creates missing outputs objects.
* \warning any additional outputs that exist before the method is called are
* deleted
*/
void CreateOutputsForAllInputs();
/**
* \brief Defines how the input will be copied into the output
*/
void GenerateOutputInformation() override;
};
} // namespace mitk
#endif /* MITKOPENIGTLMESSAGETONAVIGATIONDATAFILTER_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataDisplacementFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataDisplacementFilter.h
index 08396da19f..efdfb9b5b8 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataDisplacementFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataDisplacementFilter.h
@@ -1,81 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKNavigationDataDisplacementFilter_H_HEADER_INCLUDED_
#define MITKNavigationDataDisplacementFilter_H_HEADER_INCLUDED_
#include <mitkNavigationDataToNavigationDataFilter.h>
namespace mitk
{
/**Documentation
* \brief NavigationDataDisplacementFilter adds an offset to navigation data objects
*
* Example class that shows how to write a navigation filter. This filter
* adds a offset that can be specified as a parameter to each input navigation data.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataDisplacementFilter : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro(NavigationDataDisplacementFilter, NavigationDataToNavigationDataFilter);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
-
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
mitkSetVectorMacro(Offset, mitk::Vector3D); ///< Get Offset parameter
mitkGetVectorMacro(Offset, mitk::Vector3D); ///< Set Offset parameter
itkSetMacro(Transform6DOF, bool);
itkGetMacro(Transform6DOF, bool);
void SetTransformation( mitk::AffineTransform3D::Pointer transform );
/**
*\brief Set all filter parameters (Offset) as the PropertyList p
*
* This method reads the following properties from the PropertyList (name : data type):
* - "NavigationDataDisplacementFilter_Offset" : mitk::Vector3DProperty
*/
void SetParameters(const mitk::PropertyList* p) override;
/**
*\brief Get all filter parameters (offset) as a PropertyList
*
* This method returns a PropertyList containing the following
* properties (name : data type):
* - "NavigationDataDisplacementFilter_Offset" : mitk::Vector3DProperty
* The returned PropertyList must be assigned to a
* SmartPointer immediately, or else it will get destroyed.
*/
mitk::PropertyList::ConstPointer GetParameters() const override;
protected:
NavigationDataDisplacementFilter();
~NavigationDataDisplacementFilter() override;
/**Documentation
* \brief filter execute method
*
* adds the offset m_Offset to all inputs
*/
void GenerateData() override;
mitk::Vector3D m_Offset; ///< offset that is added to all inputs
bool m_Transform6DOF;
mitk::NavigationData::Pointer m_Transformation;
};
} // namespace mitk
#endif /* MITKNAVIGATIONDATATONAVIGATIONDATAFILTER_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataEvaluationFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataEvaluationFilter.h
index bfd82adfe8..1594ef1864 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataEvaluationFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataEvaluationFilter.h
@@ -1,121 +1,121 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKNavigationDataEvaluationFilter_H_HEADER_INCLUDED_
#define MITKNavigationDataEvaluationFilter_H_HEADER_INCLUDED_
#include <mitkNavigationDataToNavigationDataFilter.h>
#include <mitkPointSet.h>
#include <itkQuaternionRigidTransform.h>
#include <itkTransform.h>
namespace mitk {
/**Documentation
* \brief NavigationDataEvaluationFilter calculates statistical data (mean value, mean error, etc.) on the input navigation data.
* Input navigation data are set 1:1 on output navigation data.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataEvaluationFilter : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro(NavigationDataEvaluationFilter, NavigationDataToNavigationDataFilter);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** @brief Resets all statistics and starts again. */
void ResetStatistic();
/** @return Returns the number of analysed navigation datas for the specified input (without invalid samples). */
int GetNumberOfAnalysedNavigationData(int input);
/** @return Returns the number of invalid samples for the specified input. Invalid samples are ignored for the statistical calculation.*/
int GetNumberOfInvalidSamples(int input);
/** @return Returns the percentage of invalid samples in relation to all samples for the specified input.*/
double GetPercentageOfInvalidSamples(int input);
/** @return Returns the mean position of the specified input since the start of the statistic (last call of ResetStatistic()) */
mitk::Point3D GetPositionMean(int input);
/** @return Returns the standard derivation of each component (x, y and z) of the specified input since the start of the statistic (last call of ResetStatistic()) */
mitk::Vector3D GetPositionStandardDeviation(int input);
/** @return Returns the sample standard derivation of each component (x, y and z) of the specified input since the start of the statistic (last call of ResetStatistic()) */
mitk::Vector3D GetPositionSampleStandardDeviation(int input);
/** @return Returns the mean quaternion of the specified input since the start of the statistic (last call of ResetStatistic()) */
mitk::Quaternion GetQuaternionMean(int input);
/** @return Returns the standard derivation of each component of the specified input since the start of the statistic (last call of ResetStatistic()) */
mitk::Quaternion GetQuaternionStandardDeviation(int input);
/** @return Returns the mean euler angles (theta_x, theta_y, theta_z) of the specified input since the start of the statistic (last call of ResetStatistic()) */
mitk::Vector3D GetEulerAnglesMean(int input);
/** @return Returns the RMS of the error of the euler angles (theta_x, theta_y, theta_z) in radians of the specified input since the start of the statistic (last call of ResetStatistic()) */
double GetEulerAnglesRMS(int input);
/** @return Returns the RMS of the error of the euler angles (theta_x, theta_y, theta_z) in degree of the specified input since the start of the statistic (last call of ResetStatistic()) */
double GetEulerAnglesRMSDegree(int input);
/** @return Returns the mean distance to the mean postion (=mean error) to the specified input. */
double GetPositionErrorMean(int input);
/** @return Returns the standard derivation of the errors of all positions to the specified input. */
double GetPositionErrorStandardDeviation(int input);
/** @return Returns the sample standard derivation of the errors of all positions to the specified input. */
double GetPositionErrorSampleStandardDeviation(int input);
/** @return Returns the RMS of the errors of all positions to the specified input. */
double GetPositionErrorRMS(int input);
/** @return Returns the median of the errors of all positions to the specified input. */
double GetPositionErrorMedian(int input);
/** @return Returns the maximum of the errors of all positions to the specified input. */
double GetPositionErrorMax(int input);
/** @return Returns the minimum of the errors of all positions to the specified input. */
double GetPositionErrorMin(int input);
/** @return Returns a logged point on position i of the specified input. If there is no point on position i the method returns [0,0,0] */
mitk::Point3D GetLoggedPosition(unsigned int i, int input);
/** @return Returns a logged orientation on position i of the specified input. If there is no orientation on position i the method returns [0,0,0,0] */
mitk::Quaternion GetLoggedOrientation(unsigned int i, int input);
protected:
NavigationDataEvaluationFilter();
~NavigationDataEvaluationFilter() override;
/**Documentation
* \brief filter execute method
*
* transforms navigation data
*/
void GenerateData() override;
/** @brief Creates the member variables which store all the statistical data for every input. */
void CreateMembersForAllInputs();
std::map<std::size_t,std::vector<mitk::Point3D> > m_LoggedPositions; //a map here, to have one list for every navigation data
std::map<std::size_t,std::vector<mitk::Quaternion> > m_LoggedQuaternions;
std::map<std::size_t,int> m_InvalidSamples;
mitk::Quaternion GetMean(std::vector<mitk::Quaternion> list);
mitk::PointSet::Pointer VectorToPointSet(std::vector<mitk::Point3D> pSet);
mitk::PointSet::Pointer VectorToPointSet(std::vector<mitk::Vector3D> pSet);
/** @brief Converts a list of quaterions to a list of euler angles (theta_x, theta_y, theta_z) */
std::vector<mitk::Vector3D> QuaternionsToEulerAngles(std::vector<mitk::Quaternion> quaterions); //in radians
std::vector<mitk::Vector3D> QuaternionsToEulerAnglesGrad(std::vector<mitk::Quaternion> quaterions); //in degree
};
} // namespace mitk
#endif /* MITKNavigationDataEvaluationFilter_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataLandmarkTransformFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataLandmarkTransformFilter.h
index 00d16e2fa8..ef20fd7f6b 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataLandmarkTransformFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataLandmarkTransformFilter.h
@@ -1,184 +1,184 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKNavigationDataLandmarkTransformFilter_H_HEADER_INCLUDED_
#define MITKNavigationDataLandmarkTransformFilter_H_HEADER_INCLUDED_
#include <mitkNavigationDataToNavigationDataFilter.h>
#include <mitkPointSet.h>
#include <itkLandmarkBasedTransformInitializer.h>
#include <itkQuaternionRigidTransform.h>
#include <itkImage.h>
namespace mitk {
/**Documentation
* \brief NavigationDataLandmarkTransformFilter applies a itk-landmark-transformation
* defined by source and target pointsets.
*
* Before executing the filter SetSourceLandmarks and SetTargetLandmarks must be called. Before both source
* and target landmarks are set, the filter performs an identity transform.
* If source or target points are changed after calling SetXXXPoints, the corresponding SetXXXPoints
* method has to be called again to apply the changes.
* If UseICPInitialization is false (standard value, or set with SetUseICPInitialization(false) or UseICPInitializationOff())
* then source landmarks and target landmarks with the same ID must correspond to each other.
* (--> source landmark with ID x will be mapped to target landmark with ID x).
* If you do not know the correspondences, call SetUseICPInitialization(true) or UseICPInitializationOn()
* to let the filter guess the correspondences during initialization with an iterative closest point search.
* This is only possible, if at least 6 source and target landmarks are available.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataLandmarkTransformFilter : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro(NavigationDataLandmarkTransformFilter, NavigationDataToNavigationDataFilter);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef std::vector<mitk::ScalarType> ErrorVector;
typedef itk::VersorRigid3DTransform< double > LandmarkTransformType;
/**
*\brief Set points used as source points for landmark transform.
*
*/
virtual void SetSourceLandmarks(mitk::PointSet::Pointer sourcePointSet);
/**
*\brief Set points used as target points for landmark transform
*
*/
virtual void SetTargetLandmarks(mitk::PointSet::Pointer targetPointSet);
virtual bool IsInitialized() const;
/**
*\brief Returns the Fiducial Registration Error
*
*/
mitk::ScalarType GetFRE() const;
/**
*\brief Returns the standard deviation of the Fiducial Registration Error
*
*/
mitk::ScalarType GetFREStdDev() const;
/**
*\brief Returns the Root Mean Square of the registration error
*
*/
mitk::ScalarType GetRMSError() const;
/**
*\brief Returns the minimum registration error / best fitting landmark distance
*
*/
mitk::ScalarType GetMinError() const;
/**
*\brief Returns the maximum registration error / worst fitting landmark distance
*
*/
mitk::ScalarType GetMaxError() const;
/**
*\brief Returns the absolute maximum registration error
*
*/
mitk::ScalarType GetAbsMaxError() const;
/**
*\brief Returns a vector with the euclidean distance of each transformed source point to its respective target point
*
*/
const ErrorVector& GetErrorVector() const;
itkSetMacro(UseICPInitialization, bool); ///< If set to true, source and target point correspondences are established with iterative closest point optimization
itkGetMacro(UseICPInitialization, bool); ///< If set to true, source and target point correspondences are established with iterative closest point optimization
itkBooleanMacro(UseICPInitialization); ///< If set to true, source and target point correspondences are established with iterative closest point optimization
itkGetConstObjectMacro(LandmarkTransform, LandmarkTransformType); ///< returns the current landmark transform
protected:
typedef itk::Image< signed short, 3> ImageType; // only because itk::LandmarkBasedTransformInitializer must be templated over two imagetypes
typedef itk::LandmarkBasedTransformInitializer< LandmarkTransformType, ImageType, ImageType > TransformInitializerType;
typedef TransformInitializerType::LandmarkPointContainer LandmarkPointContainer;
typedef itk::QuaternionRigidTransform<double> QuaternionTransformType;
/**
* \brief Constructor
**/
NavigationDataLandmarkTransformFilter();
~NavigationDataLandmarkTransformFilter() override;
/**
* \brief transforms input NDs according to the calculated LandmarkTransform
*
*/
void GenerateData() override;
/**Documentation
* \brief perform an iterative closest point matching to find corresponding landmarks that will be used for landmark transform calculation
*
* Perform ICP optimization to match source landmarks to target landmarks. Landmark containers must contain
* at least 6 landmarks for the optimization.
* after ICP, landmark correspondences are established and the source landmarks are sorted, so that
* corresponding landmarks have the same indices.
*
* \param[in] sources Source landmarks that will be mapped to the target landmarks
* \param[in] targets Target landmarks onto which the source landmarks will be mapped
* \param[out] sources The sources container will be sorted,
so that landmarks have the same index as their corresponding target landmarks
* \return true if ICP was successful and sources are sorted , false otherwise
*/
bool FindCorrespondentLandmarks(LandmarkPointContainer& sources, const LandmarkPointContainer& targets) const;
/**
* \brief initializes the transform using source and target PointSets
*
* if UseICPInitialization is true, FindCorrespondentLandmarks() will be used to sort the source landmarks in order to
* establish corresponding landmark pairs before the landmark transform is build
*/
void InitializeLandmarkTransform(LandmarkPointContainer& sources, const LandmarkPointContainer& targets);
/**
* \brief calculates the transform using source and target PointSets
*/
void UpdateLandmarkTransform(const LandmarkPointContainer &sources, const LandmarkPointContainer &targets); ///<
void AccumulateStatistics(ErrorVector& vector); ///< calculate error metrics for the transforms.
void PrintSelf( std::ostream& os, itk::Indent indent ) const override; ///< print object info to ostream
mitk::ScalarType m_ErrorMean; ///< Fiducial Registration Error
mitk::ScalarType m_ErrorStdDev; ///< standard deviation of the Fiducial Registration Error
mitk::ScalarType m_ErrorRMS; ///< Root Mean Square of the registration error
mitk::ScalarType m_ErrorMin; ///< minimum registration error / best fitting landmark distance
mitk::ScalarType m_ErrorMax; ///< maximum registration error / worst fitting landmark distance
mitk::ScalarType m_ErrorAbsMax; ///< the absolute maximum registration error
LandmarkPointContainer m_SourcePoints; ///< positions of the source points
LandmarkPointContainer m_TargetPoints; ///< positions of the target points
TransformInitializerType::Pointer m_LandmarkTransformInitializer; ///< landmark based transform initializer
LandmarkTransformType::Pointer m_LandmarkTransform; ///< transform calculated from source and target points
QuaternionTransformType::Pointer m_QuatLandmarkTransform; ///< transform needed to rotate orientation
QuaternionTransformType::Pointer m_QuatTransform; ///< further transform needed to rotate orientation
ErrorVector m_Errors; ///< stores the euclidean distance of each transformed source landmark and its respective target landmark
bool m_UseICPInitialization; ///< find source <--> target point correspondences with iterative closest point optimization
};
} // namespace mitk
#endif /* MITKNavigationDataLandmarkTransformFilter_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataPassThroughFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataPassThroughFilter.h
index f75bc62a27..fde3a05656 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataPassThroughFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataPassThroughFilter.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef NAVIGATIONDATAPASSTHROUGHFILTER_H
#define NAVIGATIONDATAPASSTHROUGHFILTER_H
#include "mitkNavigationDataToNavigationDataFilter.h"
#include "MitkIGTExports.h"
namespace mitk {
/**
* \brief Basis for filters that want to leave the navigation data untouched.
*
* Subclasses can call the mitk::NavigationDataToNavigationDataFilter::GenerateData()
* method in their own GenerateData() implementation to pass through navigation data
* from all inputs to the outputs.
*/
class MITKIGT_EXPORT NavigationDataPassThroughFilter : public NavigationDataToNavigationDataFilter
{
public:
- mitkClassMacro(NavigationDataPassThroughFilter, NavigationDataToNavigationDataFilter)
- itkNewMacro(Self)
+ mitkClassMacro(NavigationDataPassThroughFilter, NavigationDataToNavigationDataFilter);
+ itkNewMacro(Self);
protected:
NavigationDataPassThroughFilter();
~NavigationDataPassThroughFilter() override;
/**
* \brief Passes navigation data from all inputs to all outputs.
* If a subclass wants to implement its own version of the GenerateData()
* method it should call this method inside its implementation.
*/
void GenerateData() override;
};
} // namespace mitk
#endif // NAVIGATIONDATAPASSTHROUGHFILTER_H
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataReferenceTransformFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataReferenceTransformFilter.h
index 2afe703aa7..a9db8f1f06 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataReferenceTransformFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataReferenceTransformFilter.h
@@ -1,107 +1,107 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKNavigationDataReferenceTransformFilter_H_HEADER_INCLUDED_
#define MITKNavigationDataReferenceTransformFilter_H_HEADER_INCLUDED_
#include <mitkNavigationDataLandmarkTransformFilter.h>
#include <itkQuaternionRigidTransform.h>
#include <mitkPointSet.h>
namespace mitk {
/**Documentation
* \brief NavigationDataReferenceTransformFilter applies a itk-landmark-transformation
* defined by source and target NavigationDatas.
*
* Before executing the filter SetSourceNavigationDatas and SetTargetNavigationDatas must be called.
* The amount of given NavigationDatas must be the same for source and target.
* If source or target points are changed after calling SetXXXNavigationDatas, the corresponding SetXXXNavigationDatas
* method has to be called again to apply the changes.
* If UseICPInitialization is false (standard value, or set with SetUseICPInitialization(false) or UseICPInitializationOff())
* then source landmarks and target landmarks with the same ID must correspondent to each other.
* (--> source landmark with ID x will be mapped to target landmark with ID x).
* If you do not know the correspondences, call SetUseICPInitialization(true) or UseICPInitializationOn()
* to let the filter guess the correspondences during initialization with an iterative closest point search.
* This is only possible, if at least 6 source and target landmarks are available.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataReferenceTransformFilter : public NavigationDataLandmarkTransformFilter
{
public:
mitkClassMacro(NavigationDataReferenceTransformFilter, NavigationDataToNavigationDataFilter);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef itk::QuaternionRigidTransform<double> QuaternionTransformType; ///< Quaternion transform for calculating
/**
*\brief Set NavigationDatas whose positions are used as source points for the transform.
*
*/
void SetSourceNavigationDatas(const std::vector<mitk::NavigationData::Pointer>& sourceNavigationDatas);
/**
*\brief Set NavigationDatas whose positions are used as target points for the transform.
*
*/
void SetTargetNavigationDatas(const std::vector<mitk::NavigationData::Pointer>& sourceNavigationDatas);
/**
*\brief Sets the filter back to initial settings.
*
*/
void ReinitFilter();
/**
*\brief Returns the source landmarks PointSet filled with points from given ND position(s) and orientation
*/
const mitk::PointSet::Pointer GetSourceLandmarks();
/**
*\brief Returns the target landmarks PointSet filled with points from given ND position(s) and orientation
*/
const mitk::PointSet::Pointer GetTargetLandmarks();
/**
* \brief Initializes the transform. Transform will be perfomed only if source and target points have the same size.
*
* Returns "true" if transform has been initialized, else "false" is returned.
**/
bool InitializeTransform();
protected:
/**
* \brief Constructor
**/
NavigationDataReferenceTransformFilter();
/**
* \brief Destructor
**/
~NavigationDataReferenceTransformFilter() override;
QuaternionTransformType::Pointer m_QuaternionTransform; ///< itk Quaternion transform
mitk::PointSet::Pointer CreateLandmarkPointsForSingleNavigationData(mitk::PointSet::Pointer landmarkContainer, const std::vector<mitk::NavigationData::Pointer>& navigationDatas);
mitk::PointSet::Pointer m_SourceLandmarksFromNavigationDatas; ///< source points from NavigationDatas
mitk::PointSet::Pointer m_TargetLandmarksFromNavigationDatas; ///< target points from NavigationDatas
};
} // namespace mitk
#endif /* MITKNavigationDataReferenceTransformFilter_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataToIGTLMessageFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataToIGTLMessageFilter.h
index c7d5b1c48a..2378204f95 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataToIGTLMessageFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataToIGTLMessageFilter.h
@@ -1,169 +1,169 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITKNAVIGATIONDATATOIGTLMessageFILTER_H__
#define _MITKNAVIGATIONDATATOIGTLMessageFILTER_H__
#include "mitkCommon.h"
#include "mitkPointSet.h"
#include "mitkIGTLMessageSource.h"
#include "mitkNavigationData.h"
#include "mitkNavigationDataSource.h"
namespace mitk {
/**Documentation
*
* \brief This filter creates IGTL messages from mitk::NavigaitionData objects
*
*
* \ingroup IGT
*
*/
class MITKIGT_EXPORT NavigationDataToIGTLMessageFilter : public IGTLMessageSource
{
public:
mitkClassMacro(NavigationDataToIGTLMessageFilter, IGTLMessageSource);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**Documentation
* \brief There are four different operation modes.
*
* - ModeSendQTransMsg: every input NavigationData is processed into one
* output message that contains a position and a orientation (quaternion).
* - ModeSendTransMsg: every input NavigationData is processed into one
* output message that contains a 4x4 transformation.
* - ModeSendQTDataMsg:all input NavigationData is processed into one single
* output message that contains a position and orientation (quaternion) for
* each navigation data.
* - ModeSendTDataMsg:all input NavigationData is processed into one single
* output message that contains a 4x4 transformation for
* each navigation data.
*/
enum OperationMode
{
ModeSendQTransMsg,
ModeSendTransMsg,
ModeSendQTDataMsg,
ModeSendTDataMsg
};
/**
* \brief filter execute method
*/
void GenerateData() override;
using Superclass::SetInput;
/**
* \brief Sets one input NavigationData
*/
virtual void SetInput(const mitk::NavigationData *NavigationData);
/**
* \brief Sets the input NavigationData at a specific index
*/
virtual void SetInput(unsigned int idx, const NavigationData* nd);
/**
* \brief Returns the input of this filter
*/
const mitk::NavigationData* GetInput();
/**
* \brief Returns the input number idx of this filter
*/
const mitk::NavigationData* GetInput(unsigned int idx);
/**
* \brief Sets the mode of this filter.
*
* See OperationMode for the behavior in the different modes
* \warn A call to this method will change the number of outputs of the filter.
* After calling this method, all previously acquired pointers to outputs are invalid
* Always set the operation mode first, then get the outputs with GetOutput()
*/
virtual void SetOperationMode(OperationMode mode);
/**
* \brief returns the mode of this filter.
*
* See OperationMode for the behavior in the different modes
*/
itkGetConstMacro(OperationMode, OperationMode);
/**
* empty implementation to prevent calling of the superclass method that
* would try to copy information from the input NavigationData to the output
* PointSet, which makes no sense!
*/
void GenerateOutputInformation() override {};
/**
*\brief Connects the input of this filter to the outputs of the given
* NavigationDataSource
*
* This method does not support smartpointer. use FilterX.GetPointer() to
* retrieve a dumbpointer.
*/
virtual void ConnectTo(mitk::NavigationDataSource * UpstreamFilter);
protected:
NavigationDataToIGTLMessageFilter();
~NavigationDataToIGTLMessageFilter() override;
/**
* \brief Generates the output
*
*/
// virtual void GenerateData();
/**
* \brief Generates the output for ModeSendQTDataMsg
*
*/
virtual void GenerateDataModeSendQTDataMsg();
/**
* \brief Generates the output for ModeSendTDataMsg
*/
virtual void GenerateDataModeSendTDataMsg();
/**
* \brief Generates the output for ModeSendQTransMsg
*
*/
virtual void GenerateDataModeSendQTransMsg();
/**
* \brief Generates the output for ModeSendTransMsg
*/
virtual void GenerateDataModeSendTransMsg();
/**
* \brief create output objects according to OperationMode for all inputs
*/
virtual void CreateOutputsForAllInputs();
OperationMode m_OperationMode; ///< Stores the mode. See enum OperationMode
// unsigned int m_RingBufferSize; ///< Stores the ringbuffer size
unsigned int m_CurrentTimeStep; ///< Indicates the current timestamp
// unsigned int m_NumberForMean; ///< Number of Navigation Data, which should be averaged
/** Converts a mitk::IGTTimestamp (double, milliseconds) to an OpenIGTLink timestamp */
igtl::TimeStamp::Pointer ConvertToIGTLTimeStamp(double IGTTimeStamp);
/** Measurement class to calculate latency and frame count */
};
} // namespace mitk
#endif // _MITKNAVIGATIONDATATOIGTLMessageFILTER_H__
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataToMessageFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataToMessageFilter.h
index de80d3fa04..193b72da10 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataToMessageFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataToMessageFilter.h
@@ -1,90 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKNAVIGATIONDATATOMESSAGEFILTER_H_HEADER_INCLUDED_
#define MITKNAVIGATIONDATATOMESSAGEFILTER_H_HEADER_INCLUDED_
#include <mitkNavigationDataToNavigationDataFilter.h>
#include "mitkMessage.h"
namespace mitk
{
/**Documentation
* \brief NavigationDataToMessageFilter emits multiple mitk::Message messages when the input NavigationData values change
*
* This filter can have multiple inputs. It emits
* the following Messages if an input navigation data values changed since the last Update()
* - PositionChangedMessage
* - OrientationChangedMessage
* - ErrorChangedMessage
* - TimeStampChangedMessage
* - DataValidChangedMessage
*
* The first parameter of these messages is the new value, the second is the index of the input that has changed
* The filter has as many outputs as it has inputs. It copies the inputs to the outputs after sending the messages.
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataToMessageFilter : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro(NavigationDataToMessageFilter, NavigationDataToNavigationDataFilter);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
mitkNewMessage2Macro(PositionChanged, mitk::NavigationData::PositionType, unsigned int); ///< Sends the message PositionChangedMessage whenever the position of the input changes. First parameter is the new position, second parameter is the index of the input that changed
mitkNewMessage2Macro(OrientationChanged, mitk::NavigationData::OrientationType, unsigned int); ///< Sends the message OrientationChangedMessage whenever the orientation of the input changes. First parameter is the new orientation, second parameter is the index of the input that changed
mitkNewMessage2Macro(ErrorChanged, mitk::NavigationData::CovarianceMatrixType, unsigned int); ///< Sends the message ErrorChangedMessage whenever the error covariance matrix of the input changes. First parameter is the new error covariance matrix, second parameter is the index of the input that changed
mitkNewMessage2Macro(TimeStampChanged, mitk::NavigationData::TimeStampType, unsigned int); ///< Sends the message TimeStampChangedMessage whenever the timestamp of the input changes. First parameter is the new timestamp, second parameter is the index of the input that changed
mitkNewMessage2Macro(DataValidChanged, bool, unsigned int); ///< Sends the message DataValidChangedMessage whenever the DataValid flag of the input changes. First parameter is the new DataValid value, second parameter is the index of the input that changed
/**Documentation
* \brief sets the nth input of the filter. Warning: this filter only has input #0!
*
* WARNING: NavigationDataToMessageFilter manages only one input. Calling this method
* with an idx parameter other than 0 will raise an std::invalid_argument exception!
*/
//virtual void SetInput(unsigned int idx, const NavigationData* nd);
/**Documentation
* \brief Sets the input of this filter
*
* Sets the input navigation data object for this filter.
*/
//virtual void SetInput(const NavigationData* nd);
itkSetMacro(PositionEpsilon, double);
itkSetMacro(OrientationEpsilon, double);
itkSetMacro(CovErrorEpsilon, double);
itkSetMacro(TimeStampEpsilon, double);
itkGetMacro(PositionEpsilon, double);
itkGetMacro(OrientationEpsilon, double);
itkGetMacro(CovErrorEpsilon, double);
itkGetMacro(TimeStampEpsilon, double);
protected:
double m_PositionEpsilon;
double m_OrientationEpsilon;
double m_CovErrorEpsilon;
double m_TimeStampEpsilon;
NavigationDataToMessageFilter();
~NavigationDataToMessageFilter() override;
/**Documentation
* \brief filter execute method
*
* emits the Messages
*/
void GenerateData() override;
};
} // namespace mitk
#endif /* MITKNAVIGATIONDATATOMESSAGEFILTER_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataToPointSetFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataToPointSetFilter.h
index 290c989a16..3850298b2a 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataToPointSetFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataToPointSetFilter.h
@@ -1,156 +1,155 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITKNAVIGATIONDATATOPOINTSETFILTER_H__
#define _MITKNAVIGATIONDATATOPOINTSETFILTER_H__
#include "mitkCommon.h"
#include "mitkPointSet.h"
#include "mitkPointSetSource.h"
#include "mitkNavigationData.h"
#include "MitkIGTExports.h"
namespace mitk {
/**Documentation
*
* \brief This filter creates mitk::PointSet objects from mitk::NavigaitionData objects
*
* This filter has two modes that can be set with SetOperationMode().
* - Mode3D: every input NavigationData is processed into one output pointset. For each call to Update() a point with the ND position will be added to the PointSet
* - Mode4D: one output pointset is generated that contains one point for each input NavigationData. Each call to Update() adds a new timestep to the PointSet that contains new positions for the points.
*
* \ingroup IGT
*
*/
class MITKIGT_EXPORT NavigationDataToPointSetFilter : public PointSetSource
{
public:
mitkClassMacro(NavigationDataToPointSetFilter, PointSetSource);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**Documentation
* \brief There are two different operation modes.
*
* - Mode3D: every input NavigationData is processed into one output pointset that contains a point with the ND position for each Update()
* - Mode3DMean: a defined number of input NavigationData is used to generate a mean position and processed into one output pointset that contains a point with the ND position for each Update()
* - Mode4D: one output pointset is generated that contains one point for each input NavigationData. Each call to Update() adds a new timestep to the PointSet that contains new positions for the points.
* The RingBufferSize limits the number of timesteps in the 4D mode. It currently does _not_ limit the number of points in the 3D mode.
*/
enum OperationMode
{
Mode3D,
Mode3DMean,
Mode4D
};
/**Documentation
* \brief Sets the size for the ring buffer.
*
* The size determines the maximum number of timesteps in 4D mode and the number of points in 3D mode of the output PointSet
*/
- itkSetMacro(RingBufferSize, unsigned int)
-
+ itkSetMacro(RingBufferSize, unsigned int);
/**
* \brief Sets the number of Navigation Data, which should be averaged.
*/
- itkSetMacro(NumberForMean, unsigned int)
+ itkSetMacro(NumberForMean, unsigned int);
/**
* \brief Gets the number of Navigation Data, which should be averaged.
*/
itkGetMacro(NumberForMean, unsigned int);
/**
* \brief filter execute method
*/
void GenerateData() override;
using Superclass::SetInput;
/**
* \brief Sets one input NavigationData
*/
virtual void SetInput(const mitk::NavigationData *NavigationData);
/**
* \brief Sets the input NavigationData at a specific index
*/
virtual void SetInput(unsigned int idx, const NavigationData* nd);
/**
* \brief Returns the input of this filter
*/
const mitk::NavigationData* GetInput();
/**
* \brief Returns the input number idx of this filter
*/
const mitk::NavigationData* GetInput(unsigned int idx);
/**
* \brief Sets the mode of this filter.
*
* See OperationMode for the behavior in the different modes
* \warn A call to this method will change the number of outputs of the filter.
* After calling this method, all previously acquired pointers to outputs are invalid
* Always set the operation mode first, then get the outputs with GetOutput()
*/
virtual void SetOperationMode(OperationMode mode);
/**
* \brief returns the mode of this filter.
*
* See OperationMode for the behavior in the different modes
*/
itkGetConstMacro(OperationMode, OperationMode);
void GenerateOutputInformation() override {}; ///< empty implementation to prevent calling of the superclass method that would try to copy information from the input NavigationData to the output PointSet, which makes no sense!
protected:
NavigationDataToPointSetFilter();
~NavigationDataToPointSetFilter() override;
/**
* \brief Generates the output for Mode3D
*
*/
virtual void GenerateDataMode3D();
/**
* \brief Generates the output for Mode3DMean
*
*/
virtual void GenerateDataMode3DMean();
/**
* \brief Generates the output for Mode4D
*/
virtual void GenerateDataMode4D();
/**
* \brief create output objects according to OperationMode for all inputs
*/
virtual void CreateOutputsForAllInputs();
OperationMode m_OperationMode; ///< Stores the mode. See enum OperationMode
unsigned int m_RingBufferSize; ///< Stores the ringbuffer size
unsigned int m_CurrentTimeStep; ///< Indicates the current timestamp
unsigned int m_NumberForMean; ///< Number of Navigation Data, which should be averaged
};
} // namespace mitk
#endif // _MITKNAVIGATIONDATATOPOINTSETFILTER_H__
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataTransformFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataTransformFilter.h
index 0e36347c35..e8169dc154 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataTransformFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataTransformFilter.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKNavigationDataTransformFilter_H_HEADER_INCLUDED_
#define MITKNavigationDataTransformFilter_H_HEADER_INCLUDED_
#include <mitkNavigationDataToNavigationDataFilter.h>
#include <itkVersorRigid3DTransform.h>
namespace mitk {
/**Documentation
* \brief NavigationDataTransformFilter applies an user-defined rigid transformation on navigation data objects.
* Input navigation data are mapped 1:1 on output navigation data. To run the filter SetRigid3DTransform(TransformType::Pointer transform) has to be called first.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataTransformFilter : public NavigationDataToNavigationDataFilter
{
public:
// The epsilon ITK uses to check the orthogonality of rotation matrices
// is too small for float precision so we must use double precision to
// compose the transforms and convert back to float (mitk::ScalarType) at
// the end
typedef itk::VersorRigid3DTransform< double > TransformType;
mitkClassMacro(NavigationDataTransformFilter, NavigationDataToNavigationDataFilter);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**Documentation
* \brief Set the rigid transform used to transform the input navigation data.
*/
itkSetObjectMacro(Rigid3DTransform, TransformType);
itkGetConstObjectMacro(Rigid3DTransform, TransformType);
/**Documentation
* \brief Set transform composition order
*
* If precompose is true, then transform is precomposed with the input
* NavigationData transform; that is, the resulting transformation consists
* of first applying transform, then applying the input NavigationData
* transformation.
*
* If precompose is false or omitted, then transform is post-composed with
* the input NavigationData transform; that is the resulting transformation
* consists of first applying the NavigationData transformation, followed by
* transform.
*/
itkSetMacro(Precompose, bool);
itkGetMacro(Precompose, bool);
itkBooleanMacro(Precompose);
protected:
NavigationDataTransformFilter();
~NavigationDataTransformFilter() override;
/**Documentation
* \brief filter execute method
*
* transforms navigation data
*/
void GenerateData() override;
TransformType::Pointer m_Rigid3DTransform; ///< transform which will be applied on navigation data(s)
bool m_Precompose;
};
} // namespace mitk
#endif /* MITKNavigationDataTransformFilter_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGT/Common/mitkSerialCommunication.h b/Modules/IGT/Common/mitkSerialCommunication.h
index c906d58fa1..ec25205f1d 100644
--- a/Modules/IGT/Common/mitkSerialCommunication.h
+++ b/Modules/IGT/Common/mitkSerialCommunication.h
@@ -1,347 +1,347 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKSERIALCOMMUNICATION_H_HEADER_INCLUDED_
#define MITKSERIALCOMMUNICATION_H_HEADER_INCLUDED_
#include <MitkIGTExports.h>
#include "mitkCommon.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
#ifdef WIN32
#include <windows.h>
#else // Posix
#include <termios.h>
#endif
namespace mitk
{
/**Documentation
* \brief serial communication interface
*
* This class allows to send and receive data over a serial communication interface (COM Port).
* Define the serial interface that should be used either with SetPortNumber() or SetDeviceName()
* Next, define communication parameters: baud rate, number of data bits, number of stop bits,
* parity mode, usage of hardware handshake and timeout values (in ms).
* Use OpenConnection() to establish a connection on the serial interface with the selected
* parameters. While the connection is established, changes to the parameters will not take
* effect. You have to close the connection using CloseConnection() and then reopen it with
* the new parameters with OpenConnection().
*
* \ingroup IGT
*/
class MITKIGT_EXPORT SerialCommunication : public itk::Object
{
public:
mitkClassMacroItkParent(SerialCommunication, itk::Object);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
enum PortNumber
{
COM1 = 1,
COM2 = 2,
COM3 = 3,
COM4 = 4,
COM5 = 5,
COM6 = 6,
COM7 = 7,
COM8 = 8,
COM9 = 9,
COM10 = 10,
COM11 = 11,
COM12 = 12,
COM13 = 13
};
enum BaudRate
{
BaudRate9600 = 9600,
BaudRate14400 = 14400,
BaudRate19200 = 19200,
BaudRate38400 = 38400,
BaudRate57600 = 57600,
BaudRate115200 = 115200, // Highest supported rate for NDI Aurora
BaudRate230400 = 230400,
BaudRate460800 = 460800,
BaudRate500000 = 500000,
BaudRate576000 = 576000,
BaudRate921600 = 921600,
BaudRate1000000 = 1000000,
BaudRate1152000 = 1152000,
// BaudRate1228739 = 1228739, // Highest supported rate for NDI Polaris According to handbook, unknown value to most compilers though
BaudRate1500000 = 1500000,
BaudRate2000000 = 2000000,
BaudRate2500000 = 2500000,
BaudRate3000000 = 3000000,
BaudRate3500000 = 3500000,
BaudRate4000000 = 4000000
};
enum DataBits
{
DataBits8 = 8,
DataBits7 = 7
};
enum Parity
{
None = 'N',
Odd = 'O',
Even = 'E'
};
enum StopBits
{
StopBits1 = 1,
StopBits2 = 2
};
enum HardwareHandshake
{
HardwareHandshakeOn = 1,
HardwareHandshakeOff = 0
};
/**
* \brief Returns m_Connected
*
*/
bool IsConnected();
/**
* \brief Opens connection to the COM port with port number m_PortNumber
* or the device name m_DeviceName and all port settings.
*
*/
int OpenConnection();
/**
* \brief Closes the connection
*
*/
void CloseConnection();
/**
* \brief Read numberOfBytes characters from the serial interface
*
* This method tries to read numberOfBytes characters from the serial
* interface or until an eol byte is received, whichever comes first. If
* The ReceiveTimeout is set to 0, the Receive() method will wait
* indefinetly until all characters are received or an eol character is
* received. If the ReceiveTimeout is set to another value, it will return
* after m_ReceiveTimeout milliseconds (or after all characters are read or
* an eol character is received).
*
* \param[out] answer String that stores the received characters. Note
* that this will overwrite the content of answer!
* \param[in] numberOfBytes The number of bytes to read. When an eol
* character is used this is interpretted as the
* maximum number of bytes to read.
* \param[in] eol Pointer to an End-of-Line character. If this is nullptr
* (the default) then no End-of-Line character is used.
*/
int Receive(std::string& answer, unsigned int numberOfBytes, const char *eol=nullptr);
/**
* \brief Send the string input
*
* \param[in] input The string to send to the serial interface. The string
* termination character \\0 is not sent.
* \param[in] block If false, the this method will return immediately. If
* true, this method will block until all bytes have been
* physically transmitted over the serial interface.
*/
int Send(const std::string& input, bool block = false);
/**
* \brief Send the break signal for ms milliseconds
*/
void SendBreak(unsigned int ms = 400);
/**
* \brief erase the receive buffer of the serial interface
*/
void ClearReceiveBuffer();
/**
* \brief erase the send buffer of the serial interface
*/
void ClearSendBuffer();
/**
* \brief Get the port number of the serial interface
*
* Returns the port number that will be used in the connection.
* The port number is only used if the m_DeviceName is empty ("").
*/
itkGetConstMacro(PortNumber, PortNumber);
/**
* \brief Set the port number of the serial interface
*
* SerialCommunication can either use PortNumber to create serial interface device names
* COM1 to COM9 for windows and /dev/ttyS0 to /dev/ttyS8 on linux
* (SetPortNumber(COM1) is mapped to /dev/ttyS0 and so on). Alternatively, use SetDeviceName()
* to set the device name directly (e.g. "CNCA0" for a com0com virtual com port or
* "/dev/ttyUSB0" for a USB to serial adapter on linux. If a device name is set (m_DeviceName != "")
* then OpenConnection() will try to open that device. Otherwise, it will build the device
* name using the port number
*/
itkSetMacro(PortNumber, PortNumber);
/**
* \brief Get the device name
*
* SerialCommunication can either use m_PortNumber to create serial interface device names
* or use m_DeviceName directly. This method allows to set an arbitrary device name
* that will be used to connect to the device. Common names are COM1, CNCA0, CNCB9
* on windows and /dev/ttyS0 or /dev/ttyUSB0 on linux.
*/
itkGetStringMacro(DeviceName);
/**
* \brief Set the device name
*
* if the device name is set (!=""), OpenConnection() will try to open the
* serial device on that device name. Normally, the serial interfaces are named COM1-COM9
* on windows and /dev/ttyS0 to /dev/ttyS9 on linux, but other names are possible too
* (e.g. /dev/ttyUSB0).
*/
itkSetStringMacro(DeviceName);
/**
* \brief Get the baud rate of the serial interface
*/
itkGetConstMacro(BaudRate, BaudRate);
/**
* \brief Set the baud rate of the serial interface
*/
itkSetMacro(BaudRate, BaudRate);
/**
* \brief Get the number of data bits of the serial interface
*/
itkGetConstMacro(DataBits, DataBits);
/**
* \brief Set the number of data bits of the serial interface
*/
itkSetMacro(DataBits, DataBits);
/**
* \brief Get the parity mode of the serial interface
*/
itkGetConstMacro(Parity, Parity);
/**
* \brief Set the parity mode of the serial interface
*/
itkSetMacro(Parity, Parity);
/**
* \brief Get number of stop bits of the serial interface
*/
itkGetConstMacro(StopBits, StopBits);
/**
* \brief Set number of stop bits of the serial interface
*/
itkSetMacro(StopBits, StopBits);
/**
* \brief returns true if hardware handshake should is used
*/
itkGetConstMacro(HardwareHandshake, HardwareHandshake);
/**
* \brief Set if hardware handshake should be used
*/
itkSetMacro(HardwareHandshake, HardwareHandshake);
/**
* \brief returns the send timeout in milliseconds
*/
itkGetConstMacro(SendTimeout, unsigned int);
/**
* \brief set the send timeout in milliseconds
*
* Only applies to WIN32, not POSIX
*/
itkSetMacro(SendTimeout, unsigned int);
/**
* \brief returns the receive timeout in milliseconds
*/
itkGetConstMacro(ReceiveTimeout, unsigned int);
/**
* \brief set the send timeout in milliseconds
*
* Specify the receive timeout in milliseconds.
* Setting this value to 0 will cause the Receive()
* method to wait until all expected characters are received.
*/
itkSetMacro(ReceiveTimeout, unsigned int);
protected:
SerialCommunication();
~SerialCommunication() override;
/**
* \brief configures the serial interface with all parameters
*
* This automatically reroutes the call to the hardware specific function
*/
int ApplyConfiguration();
#ifdef WIN32
/**
* \brief Applies the configuration for Windows
*/
int ApplyConfigurationWin();
#else
/**
* \brief Applies the configuration for Linux
*/
int ApplyConfigurationUnix();
#endif
std::string m_DeviceName; ///< device name that is used to connect to the serial interface (will be used if != "")
PortNumber m_PortNumber; ///< port number of the device
BaudRate m_BaudRate; ///< baud rate of the serial interface connection
DataBits m_DataBits; ///< number of data bits per symbol
Parity m_Parity; ///< parity mode
StopBits m_StopBits; ///< number of stop bits per symbol
HardwareHandshake m_HardwareHandshake; ///< whether to use hardware handshake for the connection
unsigned int m_ReceiveTimeout; ///< timeout for receiving data from the serial interface in milliseconds
unsigned int m_SendTimeout; ///< timeout for sending data to the serial interface in milliseconds
bool m_Connected; ///< is set to true if a connection currently established
#ifdef WIN32
HANDLE m_ComPortHandle;
DWORD m_PreviousMask;
COMMTIMEOUTS m_PreviousTimeout;
DCB m_PreviousDeviceControlBlock;
#else
int m_FileDescriptor;
#endif
};
} // namespace mitk
#endif /* MITKSERIALCOMMUNICATION_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGT/DataManagement/mitkNavigationTool.h b/Modules/IGT/DataManagement/mitkNavigationTool.h
index d81a602ed1..6ee2d3c96a 100644
--- a/Modules/IGT/DataManagement/mitkNavigationTool.h
+++ b/Modules/IGT/DataManagement/mitkNavigationTool.h
@@ -1,205 +1,205 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef NAVIGATIONTOOL_H_INCLUDED
#define NAVIGATIONTOOL_H_INCLUDED
//itk headers
#include <itkObjectFactory.h>
#include <itkSpatialObject.h>
#include <itkDataObject.h>
//mitk headers
#include <mitkCommon.h>
#include <mitkDataNode.h>
#include <mitkPointSet.h>
#include <mitkTrackingTypes.h>
#include <mitkSurface.h>
#include <MitkIGTExports.h>
namespace mitk {
/**Documentation
* \brief An object of this class represents a navigation tool in the view of the software.
* A few informations like an identifier, a toolname, a surface and a itk spatial
* object are stored in such an object. The classes NavigationToolReader and
* are availiable to write/read tools to/from the harddisc. If you need a collection
* of navigation tools the class NavigationToolStorage could be used.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationTool : public itk::DataObject
{
public:
mitkClassMacroItkParent(NavigationTool,itk::DataObject);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
enum NavigationToolType {Instrument, Fiducial, Skinmarker, Unknown};
//## getter and setter ##
//NavigationToolType:
itkGetConstMacro(Type,NavigationToolType);
itkSetMacro(Type,NavigationToolType);
//Identifier:
itkGetConstMacro(Identifier,std::string);
itkSetMacro(Identifier,std::string);
//Datatreenode:
itkGetConstMacro(DataNode,mitk::DataNode::Pointer);
itkSetMacro(DataNode,mitk::DataNode::Pointer);
//SpatialObject:
itkGetConstMacro(SpatialObject,itk::SpatialObject<3>::Pointer);
itkSetMacro(SpatialObject,itk::SpatialObject<3>::Pointer);
//CalibrationFile:
itkGetConstMacro(CalibrationFile,std::string);
void SetCalibrationFile(const std::string filename);
//Tool tip definition:
itkGetConstMacro(ToolTipPosition,mitk::Point3D);
itkSetMacro(ToolTipPosition,mitk::Point3D);
itkGetConstMacro(ToolAxisOrientation,mitk::Quaternion);
itkSetMacro(ToolAxisOrientation,mitk::Quaternion);
//Tool Axis definition:
/** @return Returns the main tool axis which is defined as the z-coordinate of the tool coordinate system. */
mitk::Point3D GetToolAxis();
/** Convenience function to define the tool orientation given the main tool axis. As the main tool axis
is defined as the negative z-axis of the tool coordinate system, the tool orientation is calculated as
a rotation of the actual tool axis in tool coordinates as obtained by a calibration to the main axis.*/
void SetToolAxis(mitk::Point3D toolAxis);
/** @return Returns the tooltip as transform object. */
mitk::AffineTransform3D::Pointer GetToolTipTransform();
/** @return Returns true if a tooltip is set, false if not. */
bool IsToolTipSet();
//Tool Landmarks:
/** For overview, here are descriptons of the two types of tool landmarks:
*
* control points: These landmarks may be used clearly define the tools pose only by
* using landmarks in the tool coordinate system. E.g., two landmarks for a 5DoF tool and three
* landmarks for a 6DoF tool. These landmarks may be used, e.g., for a point based registration
* of a tool from image space to tracking space.
*
* tool landmarks: These landmarks are designed for representing defined landmarks
* on a tools surface. The number of these landmarks might exeed the number of tool control points
* for reasons of redundancy and averaging. They are used for, e.g., manually registering
* the pose of a tool by visual markers in a CT scan. If you would use these landmarks to do a
* point based registration from image space to tracking space later, you might overweight the
* tool because of two many landmarks compared to other markers.
*
* @return Returns the tool registration landmarks which represent markers / special points on a
* tool that can be used for registration. The landmarks should be given in tool coordinates.
* If there are no landmarks defined for this tool the method returns an empty point set.
*/
itkGetConstMacro(ToolLandmarks,mitk::PointSet::Pointer);
/** @brief Sets the tool landmarks which represent markers / special points on a
* tool that can be used for registration. The landmarks should be given in tool coordinates.
*/
itkSetMacro(ToolLandmarks,mitk::PointSet::Pointer);
/** @return Returns the tool control point in the tool coordinate system, e.g. 2 landmarks for a 5DoF
* tool and 3 landmarks for a 6DoF tool.
*/
itkGetConstMacro(ToolControlPoints,mitk::PointSet::Pointer);
/** @brief Sets the tool calibration landmarks for calibration of defined points in the
* tool coordinate system, e.g. 2 landmarks for a 5DoF tool and 3 landmarks for a 6DoF tool.
*/
itkSetMacro(ToolControlPoints,mitk::PointSet::Pointer);
//SerialNumber:
itkGetConstMacro(SerialNumber,std::string);
itkSetMacro(SerialNumber,std::string);
//TrackingDeviceType:
itkGetConstMacro(TrackingDeviceType,mitk::TrackingDeviceType);
itkSetMacro(TrackingDeviceType,mitk::TrackingDeviceType);
//ToolName (only getter):
/** @return Returns the name of this navigation tool. Returns an empty string if there is
* no name (for example because the data node has not been set yet).
*
* Note: There is no setter for the name,
* because the name of the corresponding data node is used as tool name. So if you
* want to modify the name of this navigation tool only get the data node and modify
* its name.
*/
std::string GetToolName();
//ToolSurface (only getter):
/** @return Returns the surface of this navigation tool. Returns nullptr if there is
* no surface (for example because the data node has not been set yet).
*
* Note: There is no setter for the surface,
* because the surface is the data of the corresponding data node. So if you
* want to set a new surface only get the data node and modify its data.
*/
mitk::Surface::Pointer GetToolSurface();
/**
* \brief Graft the data and information from one NavigationTool to another.
*
* Copies the content of data into this object.
* This is a convenience method to setup a second NavigationTool object with all the meta
* information of another NavigationTool object.
* Note that this method is different than just using two
* SmartPointers to the same NavigationTool object since separate DataObjects are
* still maintained.
*/
void Graft(const DataObject *data) override;
/**
* Return all relevant information as string, e.g. to display all tool information
*/
std::string GetStringWithAllToolInformation() const;
void SetDefaultSurface();
//#######################
protected:
NavigationTool();
NavigationTool(const NavigationTool &other);
~NavigationTool() override;
itk::LightObject::Pointer InternalClone() const override;
//## data structure of a navigation tool object ##
std::string m_Identifier;
NavigationToolType m_Type;
/** @brief This DataNode holds a toolname and a tool surface */
mitk::DataNode::Pointer m_DataNode;
/** @brief This member variable holds a mathamatical description of the tool */
itk::SpatialObject<3>::Pointer m_SpatialObject;
/** @brief The path to the calibration file of the tool. */
std::string m_CalibrationFile;
/** @brief A unique serial number of the tool which is needed to identify the tool correctly. This is very important
* in case of the NDI Aurora System. */
std::string m_SerialNumber;
/** @brief This member holds the tracking device type of the tool. */
mitk::TrackingDeviceType m_TrackingDeviceType;
/** @brief Holds landmarks for tool registration. */
mitk::PointSet::Pointer m_ToolLandmarks;
/** @brief Holds control points in the tool coordinate system,
* e.g. 2 landmarks for a 5DoF tool and 3 landmarks for a 6DoF tool.
*/
mitk::PointSet::Pointer m_ToolControlPoints;
/** @brief Holds the position of the tool tip. */
mitk::Point3D m_ToolTipPosition;
/** @brief Holds the transformation of the main tool axis to the negative z-axis (0,0,-1) */
mitk::Quaternion m_ToolAxisOrientation;
};
} // namespace mitk
#endif //NAVIGATIONTOOL
diff --git a/Modules/IGT/DataManagement/mitkNavigationToolStorage.h b/Modules/IGT/DataManagement/mitkNavigationToolStorage.h
index e737db363d..9bacedc301 100644
--- a/Modules/IGT/DataManagement/mitkNavigationToolStorage.h
+++ b/Modules/IGT/DataManagement/mitkNavigationToolStorage.h
@@ -1,197 +1,197 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef NAVIGATIONTOOLSTORAGE_H_INCLUDED
#define NAVIGATIONTOOLSTORAGE_H_INCLUDED
//itk headers
#include <itkObjectFactory.h>
//mitk headers
#include <mitkCommon.h>
#include <MitkIGTExports.h>
#include "mitkNavigationTool.h"
#include <mitkDataStorage.h>
// Microservices
#include <mitkServiceInterface.h>
#include <usServiceRegistration.h>
#include <usServiceProperties.h>
namespace mitk {
/**Documentation
* \brief An object of this class represents a collection of navigation tools.
* You may add/delete navigation tools or store/load the whole collection
* to/from the harddisc by using the class NavigationToolStorageSerializer
* and NavigationToolStorageDeserializer.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationToolStorage : public itk::Object
{
public:
mitkClassMacroItkParent(NavigationToolStorage,itk::Object);
/** @brief Constructs a NavigationToolStorage without reference to a DataStorage. The Data Nodes of tools have to be added and removed to a data storage outside this class.
* Normaly the other constructor should be used.
*/
- itkFactorylessNewMacro(Self)
+ itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
/** @brief Constructs a NavigationToolStorage with reference to a DataStorage. The Data Nodes of tools are added and removed automatically to this data storage. */
mitkNewMacro1Param(Self,mitk::DataStorage::Pointer);
/**
*\brief Registers this object as a Microservice, making it available to every module and/or plugin.
* To unregister, call UnregisterMicroservice(). Make sure to pass the id of the Device that this tool is connected to.
*/
virtual void RegisterAsMicroservice();
/**
*\brief Registers this object as a Microservice, making it available to every module and/or plugin.
*/
virtual void UnRegisterMicroservice();
/**
*\brief Returns the id that this device is registered with. The id will only be valid, if the
* NavigationDataSource has been registered using RegisterAsMicroservice().
*/
std::string GetMicroserviceID();
/**
*\brief These constants are used in conjunction with Microservices
*/
// Name of the interface
static const std::string US_INTERFACE_NAME;
// ID of the NavigationDataSource this ToolStorage is associated with. Can be empty ("") and changed with SetSourceID().
static const std::string US_PROPKEY_SOURCE_ID;
// name of the storage
static const std::string US_PROPKEY_STORAGE_NAME;
/**
* @brief Adds a tool to the storage. Be sure that the tool has a unique
* identifier which is not already part of this storage.
* @return Returns true if the tool was added to the storage, false if not
* (false can be returned if the identifier already exists in this storage
* for example).
*/
bool AddTool(mitk::NavigationTool::Pointer tool);
/**
* @return Returns the tracking tool at the position "number"
* in the storage. Returns nullptr if there is no
* tracking tool at this position.
*/
mitk::NavigationTool::Pointer GetTool(int number);
/**
* @return Returns the tracking tool with the given identifier.
* Returns nullptr if there is no
* tracking tool with this identifier in the storage.
*/
mitk::NavigationTool::Pointer GetTool(std::string identifier);
/**
* @return Returns the tracking tool with the given name.
* Returns nullptr if there is no
* tracking tool with this name in the storage.
*/
mitk::NavigationTool::Pointer GetToolByName(std::string name);
/** Assigns the given number to the tool with the given identifier. This means the tool is swapped with another tool in the internal tool vector.
* @return Returns true if the assignment was successfull. Returns false if assignment is not possible, e.g. because the identifier does not exist or if the given number is not available.
**/
bool AssignToolNumber(std::string identifier1, int number2);
/**
* @brief Deletes a tool from the collection.
* Warning, this method operates on the data storage and is not thread save. Calling it from outside the main thread may cause crashes.
*/
bool DeleteTool(int number);
/**
* @brief Deletes all tools from the collection.
* Warning, this method operates on the data storage and is not thread save. Calling it from outside the main thread may cause crashes.
*/
bool DeleteAllTools();
/**
* @return Returns the number of tools stored in the storage.
*/
unsigned int GetToolCount();
/**
* @return Returns true if the storage is empty, false if not.
*/
bool isEmpty();
/**
* @return Returns the corresponding data storage if one is set to this NavigationToolStorage.
* Returns nullptr if none is set.
*/
itkGetMacro(DataStorage,mitk::DataStorage::Pointer);
/** Sets the name of this storage. The name should be understandable for the user.
* Something like "NDI Aurora Tool Storage". If a storage is loaded from the harddisk
* the name might be the filename.
*/
void SetName(std::string);
/** @return Returns the name of this storage. */
std::string GetName() const;
/** Sets the name of this storage. The name should be understandable for the user.
* Something like "NDI Aurora Tool Storage". If a storage is loaded from the harddisk
* the name might be the filename.
* @warning: if your microservice is already registered, you need to call UpdateMicroservice after changing the ID.
* This can't be done inside this functions, as we might use different threads.
*/
void SetSourceID(std::string);
/** @return Returns the name of this storage. */
std::string GetSourceID() const;
/** Locks the storage. A logged storage may not be modified.
* If a method tries to modify the storage anyway a waring message is given.
* The storage is unlocked by default. A Storage might be locked when a
* tracking device is active and needs the storage to stay consistent.
*/
void LockStorage();
/** Unlocks the storage again. */
void UnLockStorage();
/** @return Returns true if the storage is locked at the moment, false if not. */
bool isLocked();
/** Sets the properties which causes the microservice to emit an update signal. */
void UpdateMicroservice();
protected:
NavigationToolStorage();
NavigationToolStorage(mitk::DataStorage::Pointer);
~NavigationToolStorage() override;
std::vector<mitk::NavigationTool::Pointer> m_ToolCollection;
mitk::DataStorage::Pointer m_DataStorage;
std::string m_Name;
std::string m_SourceID;
bool m_storageLocked;
private:
us::ServiceRegistration<Self> m_ServiceRegistration;
us::ServiceProperties m_props;
};
} // namespace mitk
MITK_DECLARE_SERVICE_INTERFACE(mitk::NavigationToolStorage, "org.mitk.services.NavigationToolStorage")
#endif //NAVIGATIONTOOLSTORAGE
diff --git a/Modules/IGT/DataManagement/mitkTrackingDeviceSource.h b/Modules/IGT/DataManagement/mitkTrackingDeviceSource.h
index 5fe71f207f..c1d9107fd8 100644
--- a/Modules/IGT/DataManagement/mitkTrackingDeviceSource.h
+++ b/Modules/IGT/DataManagement/mitkTrackingDeviceSource.h
@@ -1,131 +1,131 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKTRACKINGDEVICESOURCE_H_HEADER_INCLUDED_
#define MITKTRACKINGDEVICESOURCE_H_HEADER_INCLUDED_
#include <mitkNavigationDataSource.h>
#include "mitkTrackingDevice.h"
namespace mitk {
/**Documentation
* \brief Connects a mitk::TrackingDevice to a MITK-IGT NavigationData-Filterpipeline
*
* This class is the source of most navigation pipelines. It encapsulates a mitk::TrackingDevice
* and provides the position and orientation of the connected mitk::TrackingTool objects
* as NavigationData objects. Note, that the number of outputs of TrackingDeviceSource
* is equal to the number of tools connected to the TrackingDevice at the time
* SetTrackingDevice() is called. If tools are added to the TrackingDevice later,
* there will not be additional outputs in TrackingDeviceSource. You have to call
* SetTrackingDevice() again to add the new tools as additional outputs of the filter.
* Otherwise TrackingDeviceSource will raise an std::out_of_range exception when the filter pipeline is executed.
* the tool number corresponds with the output number, e.g. trackingDevice-GetTool(0) is
* the tool that will produce trackingDeviceSourceFilter->GetOutput().
* \warning If a tool is removed from the tracking device, there will be a mismatch between
* the outputs and the tool number!
*
* \ingroup IGT
*/
class MITKIGT_EXPORT TrackingDeviceSource : public NavigationDataSource
{
public:
mitkClassMacro(TrackingDeviceSource, NavigationDataSource);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* \brief sets the tracking device that will be used as a source for tracking data
*/
virtual void SetTrackingDevice(mitk::TrackingDevice* td);
/**
* \brief returns the tracking device that is used by this filter
*/
itkGetConstObjectMacro(TrackingDevice, mitk::TrackingDevice);
/**
* \brief Establishes a connection to the tracking device. If there is already a connection
* the method does nothing.
* \warning. Will throw a std::invalid_argument exception if no tracking device was
* set with SetTrackingDevice(). Will throw a std::runtime_error if the tracking device
* returns an error.
*/
void Connect();
/**
* \brief Closes the connection to the tracking device
* \warning. Will throw a std::invalid_argument exception if no tracking device was
* set with SetTrackingDevice(). Will throw a std::runtime_error if the tracking device
* returns an error.
*/
void Disconnect();
/**
* \brief starts tracking.
* This needs to be called before Update() or GetOutput()->Update(). If the device is already tracking
* the method does nothing.
* \warning. Will throw a std::invalid_argument exception if no tracking device was
* set with SetTrackingDevice(). Will throw a std::runtime_error if the tracking device
* returns an error.
*/
void StartTracking();
/**
* \brief stops tracking.
* \warning. Will throw a std::invalid_argument exception if no tracking device was
* set with SetTrackingDevice(). Will throw a std::runtime_error if the tracking device
* returns an error.
*/
void StopTracking();
/**
* \brief returns true if a connection to the tracking device is established
*
*/
virtual bool IsConnected();
/**
* \brief returns true if tracking is in progress
*
*/
virtual bool IsTracking();
/**
* \brief Used for pipeline update
*/
void UpdateOutputInformation() override;
protected:
TrackingDeviceSource();
~TrackingDeviceSource() override;
/**
* \brief filter execute method
*
* queries the tracking device for new position and orientation data for all tools
* and updates its output NavigationData objects with it.
* \warning Will raise a std::out_of_range exception, if tools were added to the
* tracking device after it was set as input for this filter
*/
void GenerateData() override;
/**
* \brief Create the necessary outputs for the TrackingTool objects in m_TrackingDevice
*
* This Method is called internally whenever outputs need to be reset. Old Outputs are deleted when called.
**/
void CreateOutputs();
mitk::TrackingDevice::Pointer m_TrackingDevice; ///< the tracking device that is used as a source for this filter object
};
} // namespace mitk
#endif /* MITKTrackingDeviceSource_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGT/IO/mitkNavigationDataPlayer.h b/Modules/IGT/IO/mitkNavigationDataPlayer.h
index 3f916dcc4b..ff629034dc 100644
--- a/Modules/IGT/IO/mitkNavigationDataPlayer.h
+++ b/Modules/IGT/IO/mitkNavigationDataPlayer.h
@@ -1,99 +1,99 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKNavigationDataPlayer_H_HEADER_INCLUDED_
#define MITKNavigationDataPlayer_H_HEADER_INCLUDED_
#include <mitkNavigationDataPlayerBase.h>
#include <itkMultiThreader.h>
namespace mitk {
/**Documentation
* \brief This class is used to play recorded (see mitkNavigationDataRecorder class) NavigationDataSets.
*
* TODO
*
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataPlayer : public NavigationDataPlayerBase
{
public:
mitkClassMacro(NavigationDataPlayer, NavigationDataPlayerBase);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
enum PlayerState { PlayerStopped, PlayerRunning, PlayerPaused };
typedef mitk::NavigationData::TimeStampType TimeStampType;
/**
* \brief Used for pipeline update just to tell the pipeline that we always have to update
*/
void UpdateOutputInformation() override;
/**
* \brief This method starts the player.
*
* The method mitk::NavigationDataPlayer::SetNavigationDataSet() has to be called before.
*
* @throw mitk::IGTException If m_NavigationDataSet is null.
*/
void StartPlaying();
/**
* \brief Stops the player and closes the stream.
* After a call of StopPlaying(), StartPlaying() must be called to get new
* output data.
*/
void StopPlaying();
/**
* \brief This method pauses the player. If you want to play again call Resume()
*/
void Pause();
/**
* \brief This method resumes the player when it was paused.
*/
void Resume();
PlayerState GetCurrentPlayerState();
TimeStampType GetTimeStampSinceStart();
protected:
NavigationDataPlayer();
~NavigationDataPlayer() override;
/**
* \brief Set outputs to the navigation data object corresponding to current time.
*/
void GenerateData() override;
PlayerState m_CurPlayerState;
/**
* \brief The start time of the playing. Set in the method mitk::NavigationDataPlayer::StartPlaying().
*/
TimeStampType m_StartPlayingTimeStamp;
/**
* \brief Stores the time when a pause began.
*/
TimeStampType m_PauseTimeStamp;
TimeStampType m_TimeStampSinceStart;
};
} // namespace mitk
#endif /* MITKNavigationDataPlayer_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGT/IO/mitkNavigationDataPlayerBase.h b/Modules/IGT/IO/mitkNavigationDataPlayerBase.h
index dedc0fa109..80c92a0455 100644
--- a/Modules/IGT/IO/mitkNavigationDataPlayerBase.h
+++ b/Modules/IGT/IO/mitkNavigationDataPlayerBase.h
@@ -1,114 +1,114 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKNavigationDataPlayerBase_H_HEADER_INCLUDED_
#define MITKNavigationDataPlayerBase_H_HEADER_INCLUDED_
#include "mitkNavigationDataSource.h"
#include "mitkNavigationDataSet.h"
namespace mitk{
/**
* \brief Base class for using mitk::NavigationData as a filter source.
* Subclasses can play objects of mitk::NavigationDataSet.
*
* Each subclass has to check the state of m_Repeat and do or do not repeat
* the playing accordingly.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataPlayerBase
: public NavigationDataSource
{
public:
- mitkClassMacro(NavigationDataPlayerBase, NavigationDataSource)
+ mitkClassMacro(NavigationDataPlayerBase, NavigationDataSource);
/**
* \brief Set to true if the data player should repeat the outputs.
*/
- itkSetMacro(Repeat, bool)
+ itkSetMacro(Repeat, bool);
/**
* \return Returns if the data player should repeat the outputs.
*/
- itkGetMacro(Repeat, bool)
+ itkGetMacro(Repeat, bool);
/**
* \brief Used for pipeline update just to tell the pipeline that we always have to update.
*/
void UpdateOutputInformation() override;
- itkGetMacro(NavigationDataSet, NavigationDataSet::Pointer)
+ itkGetMacro(NavigationDataSet, NavigationDataSet::Pointer);
/**
* \brief Set mitk::NavigationDataSet for playing.
* Player is initialized by call to mitk::NavigationDataPlayerBase::InitPlayer()
* inside this method. Method must be called before this object can be used as
* a filter source.
*
* @param navigationDataSet mitk::NavigationDataSet which will be played by this player.
*/
void SetNavigationDataSet(NavigationDataSet::Pointer navigationDataSet);
/**
* \brief Getter for the size of the mitk::NavigationDataSet used in this object.
*
* @return Returns the number of navigation data snapshots available in the player.
*/
unsigned int GetNumberOfSnapshots();
unsigned int GetCurrentSnapshotNumber();
/**
* \brief This method checks if player arrived at end of file.
*
* @return true if last mitk::NavigationData object is in the outputs, false otherwise
*/
bool IsAtEnd();
protected:
NavigationDataPlayerBase();
~NavigationDataPlayerBase() override;
/**
* \brief Every subclass hast to implement this method. See ITK filter documentation for details.
*/
void GenerateData() override = 0;
/**
* \brief Initializes the outputs of this NavigationDataSource.
* Aftwer calling this method, the first Navigationdata from the loaded Navigationdataset is loaded into the outputs.
*/
void InitPlayer();
/**
* \brief Convenience method for subclasses.
* When there are no further mitk::NavigationData objects available, this
* method can be called in the implementation of mitk::NavigationDataPlayerBase::GenerateData().
*/
void GraftEmptyOutput();
/**
* \brief If the player should repeat outputs. Default is false.
*/
bool m_Repeat;
NavigationDataSet::Pointer m_NavigationDataSet;
/**
* \brief Iterator always points to the NavigationData object which is in the outputs at the moment.
*/
mitk::NavigationDataSet::NavigationDataSetConstIterator m_NavigationDataSetIterator;
};
} // namespace mitk
#endif /* MITKNavigationDataSequentialPlayer_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGT/IO/mitkNavigationDataRecorder.h b/Modules/IGT/IO/mitkNavigationDataRecorder.h
index dcc4aa6c60..7ca347743a 100644
--- a/Modules/IGT/IO/mitkNavigationDataRecorder.h
+++ b/Modules/IGT/IO/mitkNavigationDataRecorder.h
@@ -1,129 +1,130 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_NavigationDataRecorder_H
#define _MITK_NavigationDataRecorder_H
#include "mitkNavigationDataToNavigationDataFilter.h"
#include "mitkNavigationData.h"
#include "mitkNavigationDataSet.h"
namespace mitk
{
/**Documentation
* \brief This class records NavigationData objects into NavigationDataSets.
*
* The recording is started with the call of the method StartRecording(). Now
* every Update() stores the current state of the added NavigationDatas into the NavigationDataSet.
* With StopRecording() the stream is stopped, but can be resumed anytime.
* To start recording to a new NavigationDataSet, call ResetRecording();
*
* \warning Do not add inputs while the recorder ist recording. The recorder can't handle that and will cause a nullpointer exception.
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataRecorder : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro( NavigationDataRecorder, NavigationDataToNavigationDataFilter );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/**
* \brief Returns whether the NavigationDataRecorder is currently recording or not
*/
itkGetMacro(Recording, bool);
/**
* \brief Returns the set that contains all of the recorded data.
*/
itkGetMacro(NavigationDataSet, mitk::NavigationDataSet::Pointer);
/**
* \brief Sets a limit of recorded data sets / frames. Recording will be stopped if the number is reached. values < 1 disable this behaviour. Default is -1.
*/
itkSetMacro(RecordCountLimit, int);
/**
* \brief Returns whether to use the navigationdata's time stamp or to create a new one upon recording.
*/
itkGetMacro(StandardizeTime, bool);
/**
* \brief If set to false, the navigationdata's timestamp will be used. If set to true, the recorder
* will generate a timestamp when it copies the data to the navigationdataset.
*/
itkSetMacro(StandardizeTime, bool);
/**
* \brief If set to false, invalid navigationDatas will also be used. If set to true, the recorder
* will record only valid data. Standard is false.
*/
itkSetMacro(RecordOnlyValidData, bool);
/**
* \brief Returns whether to use valid data only.
*/
itkGetMacro(RecordOnlyValidData, bool);
/**
* \brief Starts recording NavigationData into the NavigationDataSet
*/
virtual void StartRecording();
/**
* \brief Stops StopsRecording to the NavigationDataSet.
*
* Recording can be resumed to the same Dataset by just calling StartRecording() again.
* Call ResetRecording() to start recording to a new Dataset;
*/
virtual void StopRecording();
/**
* \brief Resets the Datasets and the timestamp, so a new recording can happen.
*
* Do not forget to save the old Dataset, it will be lost after calling this function.
*/
virtual void ResetRecording();
/**
* \brief Returns the number of time steps that were recorded in the current set.
* Warning: This Method does NOT Stop Recording!
*/
virtual int GetNumberOfRecordedSteps();
protected:
void GenerateData() override;
NavigationDataRecorder();
~NavigationDataRecorder() override;
unsigned int m_NumberOfInputs; ///< counts the numbers of added input NavigationDatas
mitk::NavigationDataSet::Pointer m_NavigationDataSet;
bool m_Recording; ///< indicates whether the recording is started or not
bool m_StandardizeTime; ///< indicates whether one should use the timestamps in NavigationData or create new timestamps upon recording
bool m_StandardizedTimeInitialized; ///< set to true the first time start recording is called.
int m_RecordCountLimit; ///< limits the number of frames, recording will be stopped if the limit is reached. -1 disables the limit
bool m_RecordOnlyValidData; ///< indicates whether only valid data is recorded
};
}
#endif // #define _MITK_POINT_SET_SOURCE_H
diff --git a/Modules/IGT/IO/mitkNavigationToolReader.h b/Modules/IGT/IO/mitkNavigationToolReader.h
index 7813b3c007..c317757ea6 100644
--- a/Modules/IGT/IO/mitkNavigationToolReader.h
+++ b/Modules/IGT/IO/mitkNavigationToolReader.h
@@ -1,72 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef NAVIGATIONTOOLREADER_H_INCLUDED
#define NAVIGATIONTOOLREADER_H_INCLUDED
//itk headers
#include <itkObjectFactory.h>
//mitk headers
#include <mitkCommon.h>
#include "mitkNavigationTool.h"
#include "mitkDataStorage.h"
#include "mitkNavigationToolStorageDeserializer.h"
#include <MitkIGTExports.h>
namespace mitk {
/**Documentation
* \brief This class offers methods to read objects of the class NavigationTool from the
* harddisc. The tools have to be saved in a special format by the class NavigationToolWriter
* to be loadable.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationToolReader : public itk::Object
{
friend class mitk::NavigationToolStorageDeserializer;
public:
mitkClassMacroItkParent(NavigationToolReader,itk::Object);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* @brief This method reads a navigation tool from a file.
* @param filename The filename where the tool is stored, "C:\temp\myTool.igtTool" for example.
* @return Returns a pointer to the tool which was read. Returns nullptr, if something went
* wrong and no tool was read. In this case you may also want the error message which is availiable
* from the method GetErrorMessage().
*/
mitk::NavigationTool::Pointer DoRead(std::string filename);
itkGetMacro(ErrorMessage,std::string);
protected:
NavigationToolReader();
~NavigationToolReader() override;
std::string m_ErrorMessage;
std::string m_ToolfilePath; //This path is used to store the toolfiles. It must be available through the whole MITK run.
mitk::NavigationTool::Pointer ConvertDataNodeToNavigationTool(mitk::DataNode::Pointer node, std::string toolPath);
//################### protected help methods ########################
std::string GetFileWithoutPath(std::string FileWithPath);
mitk::PointSet::Pointer ConvertStringToPointSet(std::string string);
mitk::Point3D ConvertStringToPoint(std::string string);
mitk::Quaternion ConvertStringToQuaternion(std::string string);
void split(std::string& text, std::string& separators, std::vector<std::string>& words);
};
} // namespace mitk
#endif //NAVIGATIONTOOLREADER
diff --git a/Modules/IGT/IO/mitkNavigationToolStorageSerializer.h b/Modules/IGT/IO/mitkNavigationToolStorageSerializer.h
index b4b6fdf2c2..e762abbe78 100644
--- a/Modules/IGT/IO/mitkNavigationToolStorageSerializer.h
+++ b/Modules/IGT/IO/mitkNavigationToolStorageSerializer.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef NAVIGATIONTOOLSTORAGESERIALIZER_H_INCLUDED
#define NAVIGATIONTOOLSTORAGESERIALIZER_H_INCLUDED
//itk headers
#include <itkObjectFactory.h>
//mitk headers
#include <mitkCommon.h>
#include "mitkNavigationToolStorage.h"
#include <MitkIGTExports.h>
namespace mitk {
/**Documentation
* \brief This class offers methods to save an object of the class NavigationToolStorage
* to the harddisc.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationToolStorageSerializer : public itk::Object
{
public:
mitkClassMacroItkParent(NavigationToolStorageSerializer,itk::Object);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* @brief Saves a mitk navigation tool storage to a file.
* @throw mitk::IGTIOException Throws an exception if the given filename cannot be opened for writing or
* if the temp directory is not accessible.
*/
void Serialize(const std::string& filename, mitk::NavigationToolStorage::Pointer storage);
protected:
NavigationToolStorageSerializer();
~NavigationToolStorageSerializer() override;
std::string convertIntToString(int i);
std::string m_tempDirectory;
};
} // namespace mitk
#endif //NAVIGATIONTOOLSTORAGESERIALIZER
diff --git a/Modules/IGT/IO/mitkNavigationToolWriter.h b/Modules/IGT/IO/mitkNavigationToolWriter.h
index e34ae0b9a1..e52e2a5175 100644
--- a/Modules/IGT/IO/mitkNavigationToolWriter.h
+++ b/Modules/IGT/IO/mitkNavigationToolWriter.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef NAVIGATIONTOOLWRITER_H_INCLUDED
#define NAVIGATIONTOOLWRITER_H_INCLUDED
//itk headers
#include <itkObjectFactory.h>
//mitk headers
#include <mitkCommon.h>
#include "mitkNavigationTool.h"
#include "mitkNavigationToolStorageSerializer.h"
#include <MitkIGTExports.h>
namespace mitk
{
/**Documentation
* \brief This class offers methods to write objects of the class navigation tool permanently
* to the harddisk. The objects are saved in a special fileformat which can be read
* by the class NavigationToolReader to restore the object.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationToolWriter : public itk::Object
{
friend class mitk::NavigationToolStorageSerializer;
public:
mitkClassMacroItkParent(NavigationToolWriter,itk::Object);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* @brief Writes a navigation tool to a file.
* @param FileName The filename (complete, with path, C:/temp/myTool.igtTool for example)
* @param Tool The tool which should be written to the file.
* @return Returns true if the file was written successfully, false if not. In the second
* case you can get the error message by using the method GetErrorMessage().
*/
bool DoWrite(std::string FileName,mitk::NavigationTool::Pointer Tool);
itkGetMacro(ErrorMessage,std::string);
protected:
NavigationToolWriter();
~NavigationToolWriter() override;
std::string m_ErrorMessage;
mitk::DataNode::Pointer ConvertToDataNode(mitk::NavigationTool::Pointer Tool);
std::string GetFileWithoutPath(std::string FileWithPath);
std::string ConvertPointSetToString(mitk::PointSet::Pointer pointSet);
std::string ConvertPointToString(mitk::Point3D point);
std::string ConvertQuaternionToString(mitk::Quaternion quat);
};
} // namespace mitk
#endif //NAVIGATIONTOOLWRITER
diff --git a/Modules/IGT/Rendering/mitkCameraVisualization.h b/Modules/IGT/Rendering/mitkCameraVisualization.h
index 1717a07b49..32ff8c7c89 100644
--- a/Modules/IGT/Rendering/mitkCameraVisualization.h
+++ b/Modules/IGT/Rendering/mitkCameraVisualization.h
@@ -1,120 +1,120 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef CAMERAVISUALIZATION_H_INCLUDED
#define CAMERAVISUALIZATION_H_INCLUDED
#include "mitkCommon.h"
#include "mitkNavigationDataToNavigationDataFilter.h"
#include "mitkBaseRenderer.h"
namespace mitk {
/**Documentation
* \brief CameraVisualization controls the camera according to the spatial information of the navigation data
*
* The camera of the renderer will be placed at the position of the navigation data and oriented according to
* its orientation and the camera specific information "direction of projection", "view up", "focal length", "view angle"
*
* \ingroup IGT
*/ class MITKIGT_EXPORT CameraVisualization : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro(CameraVisualization, NavigationDataToNavigationDataFilter);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* \brief sets the direction of projection of the camera of the renderer in tool coordinates
*/
itkSetMacro(DirectionOfProjectionInToolCoordinates, mitk::Vector3D);
/**
* \brief sets the view up vector of the camera of the renderer in tool coordinates
*/
itkSetMacro(ViewUpInToolCoordinates, mitk::Vector3D);
/**
* \brief sets the focal length of the camera
*/
itkSetMacro(FocalLength, float);
/**
* \brief returns the direction of projection of the camera of the renderer in tool coordinates
*/
itkGetConstMacro(DirectionOfProjectionInToolCoordinates, mitk::Vector3D);
/**
* \brief returns the view up vector of the camera of the renderer in tool coordinates
*/
itkGetConstMacro(ViewUpInToolCoordinates, mitk::Vector3D);
/**
* \brief returns the focal length of the camera
*/
itkGetConstMacro(FocalLength, float);
/**
* \brief sets renderer that visualizes the navigation data
*/
virtual void SetRenderer( mitk::BaseRenderer* renderer );
/**
* \brief returns the renderer that visualizes the navigation data
*/
virtual const mitk::BaseRenderer* GetRenderer();
/**Documentation
*\brief Set all filter parameters as the PropertyList p
*
* This method reads the following properties from the PropertyList (name : data type):
* - "CameraVisualization_DirectionOfProjectionInToolCoordinates" : mitk::Vector3DProperty
* - "CameraVisualization_ViewUpInToolCoordinates" : mitk::Vector3DProperty
* - "CameraVisualization_FocalLength" : mitk::FloatProperty
* - "CameraVisualization_ViewAngle" : mitk::FloatProperty
*/
void SetParameters(const mitk::PropertyList* p) override;
/**Documentation
*\brief Get all filter parameters as a PropertyList
*
* This method returns a PropertyList containing the following
* properties (name : data type):
* - "CameraVisualization_DirectionOfProjectionInToolCoordinates" : mitk::Vector3DProperty
* - "CameraVisualization_ViewUpInToolCoordinates" : mitk::Vector3DProperty
* - "CameraVisualization_FocalLength" : mitk::FloatProperty
* - "CameraVisualization_ViewAngle" : mitk::FloatProperty
* The returned PropertyList must be assigned to a
* SmartPointer immediately, or else it will get destroyed.
*/
mitk::PropertyList::ConstPointer GetParameters() const override;
protected:
CameraVisualization();
~CameraVisualization() override;
/**Documentation
* \brief filter execute method
*
* positions and orients camera according to the position and orientation hold in the NavigationData
*/
void GenerateData() override;
mitk::BaseRenderer::Pointer m_Renderer; ///< renderer that visualizes the navigation data-
Vector3D m_DirectionOfProjectionInToolCoordinates; ///< vector of the direction of projection in tool coordinates
Vector3D m_ViewUpInToolCoordinates; ///< view up vector in tool coordinates
Vector3D m_DirectionOfProjection; ///< vector of the current direction of view of the camera in world coordinates
Point3D m_CameraPosition; ///< current position of the camera
ScalarType m_FocalLength; ///< focal length of the camera: distance between camera position and focal point.
};
} // namespace mitk
#endif
diff --git a/Modules/IGT/Rendering/mitkNavigationDataObjectVisualizationFilter.h b/Modules/IGT/Rendering/mitkNavigationDataObjectVisualizationFilter.h
index baaeef99b8..bbfd2df5ba 100644
--- a/Modules/IGT/Rendering/mitkNavigationDataObjectVisualizationFilter.h
+++ b/Modules/IGT/Rendering/mitkNavigationDataObjectVisualizationFilter.h
@@ -1,152 +1,153 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKNAVIGATIONDATAOBJECTVISUALIZATIONFILTER_H_HEADER_INCLUDED_
#define MITKNAVIGATIONDATAOBJECTVISUALIZATIONFILTER_H_HEADER_INCLUDED_
#include "mitkNavigationDataToNavigationDataFilter.h"
#include "mitkNavigationData.h"
#include "mitkBaseData.h"
namespace mitk {
/**
* \brief Class that reads NavigationData from input and transfers the information to the geometry of the associated BaseData
*
* Derived from NavigationDataToNavigationDataFilter
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataObjectVisualizationFilter : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro(NavigationDataObjectVisualizationFilter, NavigationDataToNavigationDataFilter);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/** Defines the rotation modes of this tracking device which results in different representations
* of quaternions.
*
* - Standard: normal representation, rawdata from the device is not changed (DEFAULT)
*
* - Transposed: the rotation is stored transposed, which is (by mistake!) expected by some older MITK classes due
* to an ambigious method naming in VNL.
*
* CAUTION: The rotation mode can only be changed for backward compatibility of old WRONG code.
* PLEASE DO NOT CHANGE THE ROTATION MODE UNLESS YOU ARE KNOWING EXACTLY WHAT YOU ARE DOING!
*
* use SetRotationMode to change the mode.
*/
enum RotationMode {RotationStandard, RotationTransposed};
/**
* \brief Smart Pointer type to a BaseData.
*/
typedef BaseData::ConstPointer RepresentationPointer;
/**
* \brief STL map of index to BaseData . Using map to be able to set non continuous indices
*/
typedef std::map<unsigned int, RepresentationPointer> RepresentationPointerMap;
/**
* \brief Size type of an std::vector
*/
typedef RepresentationPointerMap::size_type RepresentationPointerMapSizeType;
/**
* \brief Set the representation object of the input
*
* \param data The BaseData to be associated to the index
* \param index the index with which data will be associated
*/
void SetRepresentationObject(unsigned int index, BaseData* data);
/**
* \brief Get the representation object associated with the index idx
*
* \param idx the corresponding input number with which the BaseData is associated
* \return Returns the desired BaseData if it exists for the given input; Returns nullptr
* if no BaseData was found.
*/
const BaseData* GetRepresentationObject(unsigned int idx);
virtual void SetTransformPosition(unsigned int index, bool applyTransform); ///< if set to true, the filter will use the position part of the input navigation data at the given index to transform the representation object. If set to false, it will not. If no value is set, it defaults to true.
virtual bool GetTransformPosition(unsigned int index) const; ///< returns whether position part of the input navigation data at the given index is used for the transformation of the representation object.
virtual void TransformPositionOn(unsigned int index); ///< sets the TransformPosition flag to true for the given index
virtual void TransformPositionOff(unsigned int index); ///< sets the TransformPosition flag to false for the given index
virtual void SetTransformOrientation(unsigned int index, bool applyTransform); ///< if set to true, the filter will use the orientation part of the input navigation data at the given index to transform the representation object. If set to false, it will not. If no value is set, it defaults to true.
virtual bool GetTransformOrientation(unsigned int index) const; ///< returns whether orientation part of the input navigation data at the given index is used for the transformation of the representation object.
virtual void TransformOrientationOn(unsigned int index); ///< sets the TransformOrientation flag to true for the given index
virtual void TransformOrientationOff(unsigned int index); ///< sets the TransformOrientation flag to false for the given index
/** @brief Defines an offset for a representation object. This offset is applied before the object is visualized.
* If no offset is given, no offset will be used. To deactivate the offset just set it to nullptr. The offset is deactivated by default.
* @param offset The new offset which will be set. Set to nullptr to deactivate the offset.
*/
void SetOffset(int index, mitk::AffineTransform3D::Pointer offset);
/** Sets the rotation mode of this class. See documentation of enum RotationMode for details
* on the different modes.
* CAUTION: The rotation mode can only be changed for backward compatibility of old WRONG code.
* PLEASE DO NOT CHANGE THE ROTATION MODE UNLESS YOU ARE KNOWING EXACTLY WHAT YOU ARE DOING!
*/
virtual void SetRotationMode(RotationMode r);
/** @return Returns the offset of a represenation object. Returns nullptr if there is no offset. */
mitk::AffineTransform3D::Pointer GetOffset(int index);
/**
*\brief Get the number of added BaseData associated to NavigationData
* \return Returns the size of the internal map
*/
RepresentationPointerMapSizeType GetNumberOfToolRepresentations() const
{
return m_RepresentationList.size();
}
/*
* \brief Transfer the information from the input to the associated BaseData
*/
void GenerateData() override;
protected:
typedef std::map<itk::ProcessObject::DataObjectPointerArraySizeType, bool> BooleanInputMap;
typedef std::map<unsigned int, mitk::AffineTransform3D::Pointer> OffsetPointerMap;
/**
* \brief Constructor
**/
NavigationDataObjectVisualizationFilter();
/**
* \brief Destructor
**/
~NavigationDataObjectVisualizationFilter() override;
/**
* \brief An array of the BaseData which represent the tools.
*/
RepresentationPointerMap m_RepresentationList;
BooleanInputMap m_TransformPosition; ///< if set to true, the filter will use the position part of the input navigation data at the given index for the calculation of the transform. If no entry for the index exists, it defaults to true.
BooleanInputMap m_TransformOrientation; ///< if set to true, the filter will use the orientation part of the input navigation data at the given index for the calculation of the transform. If no entry for the index exists, it defaults to true.
OffsetPointerMap m_OffsetList;
private:
RotationMode m_RotationMode; ///< defines the rotation mode Standard or Transposed, Standard is default
};
} // namespace mitk
#endif /* MITKNAVIGATIONDATAOBJECTVISUALIZATIONFILTER_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGT/Rendering/mitkNavigationDataSliceVisualization.h b/Modules/IGT/Rendering/mitkNavigationDataSliceVisualization.h
index 03d42fba8c..179edc46f7 100644
--- a/Modules/IGT/Rendering/mitkNavigationDataSliceVisualization.h
+++ b/Modules/IGT/Rendering/mitkNavigationDataSliceVisualization.h
@@ -1,135 +1,135 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKNAVIGATIONDATASLICEVISUALIZATION_H_HEADER_INCLUDED_
#define MITKNAVIGATIONDATASLICEVISUALIZATION_H_HEADER_INCLUDED_
#include "mitkNavigationDataToNavigationDataFilter.h"
#include "mitkBaseRenderer.h"
#include "mitkVector.h"
namespace mitk
{
/**Documentation
* \brief Control the position and orientation of rendered slices with NavigationData
*
* A NavigationDataToNavigationDataFilter that takes NavigationData as input and
* sets the position and, optionally, the orientation of the slice plane for a
* user-specified renderer.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataSliceVisualization : public NavigationDataToNavigationDataFilter
{
public:
- mitkClassMacro(NavigationDataSliceVisualization, NavigationDataToNavigationDataFilter)
- itkNewMacro(Self)
+ mitkClassMacro(NavigationDataSliceVisualization, NavigationDataToNavigationDataFilter);
+ itkNewMacro(Self);
enum ViewDirection
{
/**
* Tracked slice planes are NOT re-oriented, only the position
* of the slice plane is controlled by the input navigation data.
*/
Axial = 0,
Sagittal,
Frontal,
/**
* Axial plane "tilted" about the lateral vector so that it is coplanar
* with the tool trajectory
*/
AxialOblique,
/**
* Sagittal plane "tilted" about the axial vector so that it is coplanar
* with the tool trajectory
*/
SagittalOblique,
/**
* Slice plane normal to the tool trajectory
*/
Oblique
};
/**
* \brief Set/get the renderer that visualizes the navigation data
*/
- itkSetObjectMacro(Renderer,BaseRenderer)
- itkGetConstObjectMacro(Renderer,BaseRenderer)
+ itkSetObjectMacro(Renderer,BaseRenderer);
+ itkGetConstObjectMacro(Renderer,BaseRenderer);
/**
* \brief Set/get the tip offset used for plane tracking
*
* This is an additional offset vector applied to the input navigation
* data. It is defined in tool tip coordinates. In other words:
*
* \code
* position_slice = position_input + orient_input.rotate(TipOffset)
* \endcode
*
* Default is [0,0,0].
*/
- itkSetMacro(TipOffset, Vector3D)
- itkGetConstMacro(TipOffset,Vector3D)
+ itkSetMacro(TipOffset, Vector3D);
+ itkGetConstMacro(TipOffset,Vector3D);
/**
* \brief Set/get the tool trajectory used to define the cutting plane
* normal direction.
*
* This vector, defined in tool tip coordinates, applies only when the
* ViewDirection is Oblique.
*
* Default is [0,0,-1].
*/
virtual void SetToolTrajectory(Vector3D direction);
- itkGetConstMacro(ToolTrajectory, Vector3D)
+ itkGetConstMacro(ToolTrajectory, Vector3D);
/**
* \brief Set/get the world vertical vector used to define the y-axis of the
* cutting plane
*
* This vector, defined in world coordinates, applies only when the
* ViewDirection is Oblique. It is projected onto the cutting plane to
* define the vertical orientation of the slice.
*
* The direction of this vector does not matter (i.e. [0,1,0] is the same
* as [0,-1,0]). The direction will be determined automatically by
* choosing the one that is closest to the direction of the y-axis of the
* PlaneGeometry before each update. This way, the anatomical axis
* directions that get set initially will be maintained after every update
* of this filter.
*
* Default is [0,1,0].
*/
- itkSetMacro(WorldVerticalVector, Vector3D)
- itkGetConstMacro(WorldVerticalVector, Vector3D)
+ itkSetMacro(WorldVerticalVector, Vector3D);
+ itkGetConstMacro(WorldVerticalVector, Vector3D);
/**
* \brief Set/get the orientation of the sliced plane
*
* Default is Axial.
*/
- itkSetEnumMacro(ViewDirection,ViewDirection)
- itkGetEnumMacro(ViewDirection,ViewDirection)
+ itkSetEnumMacro(ViewDirection,ViewDirection);
+ itkGetEnumMacro(ViewDirection,ViewDirection);
protected:
NavigationDataSliceVisualization();
void GenerateData() override;
BaseRenderer::Pointer m_Renderer;
Vector3D m_TipOffset;
Vector3D m_ToolTrajectory;
Vector3D m_WorldVerticalVector;
ViewDirection m_ViewDirection;
};
} // end namespace mitk
#endif // NEMOSLICEVISUALIZATIONFILTER_H
diff --git a/Modules/IGT/TrackingDevices/mitkClaronInterface.h b/Modules/IGT/TrackingDevices/mitkClaronInterface.h
index 5afd084729..40e8531e77 100644
--- a/Modules/IGT/TrackingDevices/mitkClaronInterface.h
+++ b/Modules/IGT/TrackingDevices/mitkClaronInterface.h
@@ -1,145 +1,145 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKCLARONINTERFACE_H_HEADER_INCLUDED_
#define MITKCLARONINTERFACE_H_HEADER_INCLUDED_
#define MTC(func) {int r = func; if (r!=mtOK) printf("MTC error: %s\n",MTLastErrorString()); };
#include <vector>
#include <string>
#include <MitkIGTExports.h>
#include "mitkCommon.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
#ifdef _WIN64 //Defined for applications for Win64.
typedef long mtHandle;
#else
typedef int mtHandle;
#endif
namespace mitk
{
typedef int claronToolHandle;
/** Documentation:
* \brief An object of this class represents the interface to the MicronTracker. The methods of this class
* are calling the c-functions which are provided by the MTC-library. If the MicronTracker is not in
* use, which means the CMake-variable "MITK_USE_MICRON_TRACKER" is set to OFF, this class is replaced
* by a stub class called "ClaronInterfaceStub".
* \ingroup IGT
*/
class MITKIGT_EXPORT ClaronInterface : public itk::Object
{
public:
mitkClassMacroItkParent(ClaronInterface,itk::Object);
- itkFactorylessNewMacro(Self)
+ itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
/**
* \brief Initialization of claroninterface.
* \param calibrationDir The directory where the device can find the camera calibration file.
* \param toolFilesDir The directory for the tool files.
*/
void Initialize(std::string calibrationDir, std::string toolFilesDir);
/**
* \brief Opens the connection to the device and makes it ready to track tools.
* \return Returns true if there is a connection to the device and the device is ready to track tools, false if not.
*/
bool StartTracking();
/**
* \brief Clears all resources. After this method have been called the system isn't ready to track any longer.
* \return Returns true if the operation was succesful, false if not.
*/
bool StopTracking();
/**
* \return Returns all tools which have been detected at the last frame grab.
*/
std::vector<claronToolHandle> GetAllActiveTools();
/**
* \return Returns the position of the tooltip. If no tooltip is defined the Method returns the position of the tool.
*/
std::vector<double> GetTipPosition(claronToolHandle c);
/**
* \return Returns the quarternions of the tooltip. If no tooltip is defined the Method returns the quarternions of the tool.
*/
std::vector<double> GetTipQuaternions(claronToolHandle c);
/**
* \return Returns the position of the tool
*/
std::vector<double> GetPosition(claronToolHandle c);
/**
* \return Returns the quaternion of the tool.
*/
std::vector<double> GetQuaternions(claronToolHandle c);
/**
* \return Returns the name of the tool. This name is given by the calibration file.
* \param c The handle of the tool, which name should be given back.
*/
const char* GetName(claronToolHandle c);
/**
* \brief Grabs a frame from the camera.
*/
void GrabFrame();
/**
* \return Returns wether the tracking device is tracking or not.
*/
bool IsTracking();
/**
* \return Returns wether the MicronTracker is installed (means wether the C-Make-Variable "MITK_USE_MICRON_TRACKER" is set ON),
* so returns true in this case. This is because the class mitkClaronInterfaceStub, in which the same Method returns false
* is used otherways.
*/
bool IsMicronTrackerInstalled();
protected:
/**
* \brief standard constructor
*/
ClaronInterface();
/**
* \brief standard destructor
*/
~ClaronInterface() override;
/** \brief Variable is true if the device is tracking at the moment, false if not.*/
bool isTracking;
/** \brief Variable which holds the directory which should contain the file BumbleBee_6400420.calib. This directory is needed by the MTC library.*/
char calibrationDir[512];
/** \brief Variable which holds a directory with some tool files in it. All this tools are trackable when the path is given to the MTC library.*/
char markerDir[512];
//Some handles to communicate with the MTC library.
mtHandle IdentifiedMarkers;
mtHandle PoseXf;
mtHandle CurrCamera;
mtHandle IdentifyingCamera;
//------------------------------------------------
};
}//mitk
#endif
diff --git a/Modules/IGT/TrackingDevices/mitkClaronInterfaceStub.h b/Modules/IGT/TrackingDevices/mitkClaronInterfaceStub.h
index e07cc52311..48b6d8bde8 100644
--- a/Modules/IGT/TrackingDevices/mitkClaronInterfaceStub.h
+++ b/Modules/IGT/TrackingDevices/mitkClaronInterfaceStub.h
@@ -1,115 +1,115 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKCLARONINTERFACE_H_HEADER_INCLUDED_
#define MITKCLARONINTERFACE_H_HEADER_INCLUDED_
#include <vector>
#include <string>
#include <MitkIGTExports.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
#include "mitkCommon.h"
typedef int mtHandle;
namespace mitk
{
typedef int claronToolHandle;
/** Documentation:
* \brief An object of this class represents the interface to the MicronTracker. Normally the methods of this class
* are calling the c-functions which are provided by the MTC-library. But in this case the MicronTracker is
* not installed and so we only have stubs here. These stubs send error messages when you try to call the
* methods.
* \ingroup IGT
*/
class MITKIGT_EXPORT ClaronInterface : public itk::Object
{
public:
mitkClassMacroItkParent(ClaronInterface, itk::Object);
- itkFactorylessNewMacro(Self)
+ itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
/**
* \brief Initialization of claroninterface.
* \param calibrationDir The directory where the device can find the camera calibration file.
* \param toolFilesDir The directory for the tool files.
*/
void Initialize(std::string calibrationDir, std::string toolFilesDir);
/**
* \brief This is only a stub, please switch the cmake variable USE_MICRON_TRACKER to on if you want to use the Microntracker.
*/
bool StartTracking();
/**
* \brief This is only a stub, please switch the cmake variable USE_MICRON_TRACKER to on if you want to use the Microntracker.
*/
bool StopTracking();
/**
* \brief This is only a stub, please switch the cmake variable USE_MICRON_TRACKER to on if you want to use the Microntracker.
*/
std::vector<claronToolHandle> GetAllActiveTools();
/**
* \brief This is only a stub, please switch the cmake variable USE_MICRON_TRACKER to on if you want to use the Microntracker.
*/
std::vector<double> GetTipPosition(claronToolHandle c);
/**
* \brief This is only a stub, please switch the cmake variable USE_MICRON_TRACKER to on if you want to use the Microntracker.
*/
std::vector<double> GetTipQuaternions(claronToolHandle c);
/**
* \brief This is only a stub, please switch the cmake variable USE_MICRON_TRACKER to on if you want to use the Microntracker.
*/
std::vector<double> GetPosition(claronToolHandle c);
/**
* \brief This is only a stub, please switch the cmake variable USE_MICRON_TRACKER to on if you want to use the Microntracker.
*/
std::vector<double> GetQuaternions(claronToolHandle c);
/**
* \brief This is only a stub, please switch the cmake variable USE_MICRON_TRACKER to on if you want to use the Microntracker.
*/
const char* GetName(claronToolHandle c);
/**
* \brief This is only a stub, please switch the cmake variable USE_MICRON_TRACKER to on if you want to use the Microntracker.
*/
void GrabFrame();
/**
* \return Returns wether the MicronTracker is installed (means wether the C-Make-Variable "MITK_USE_MICRON_TRACKER" is set),
* so returns false in this case.
*/
bool IsMicronTrackerInstalled();
protected:
/**
* \brief standard constructor
*/
ClaronInterface();
/**
* \brief standard destructor
*/
~ClaronInterface() override;
};
}//mitk
#endif
diff --git a/Modules/IGT/TrackingDevices/mitkClaronTool.h b/Modules/IGT/TrackingDevices/mitkClaronTool.h
index 6978768584..3575653442 100644
--- a/Modules/IGT/TrackingDevices/mitkClaronTool.h
+++ b/Modules/IGT/TrackingDevices/mitkClaronTool.h
@@ -1,82 +1,82 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKCLARONTOOL_H_HEADER_INCLUDED_
#define MITKCLARONTOOL_H_HEADER_INCLUDED_
#include <mitkClaronInterface.h>
#include <mitkTrackingTool.h>
#include <itkFastMutexLock.h>
namespace mitk
{
class ClaronTrackingDevice;
/** Documentation:
* \brief An object of this class represents a MicronTracker 2 tool.
* A tool has to be added to a tracking device which will then
* continuously update the tool coordinates.
* \ingroup IGT
*/
class MITKIGT_EXPORT ClaronTool : public TrackingTool
{
public:
friend class ClaronTrackingDevice;
mitkClassMacro(ClaronTool, TrackingTool);
/**
* \brief Loads a tool calibration file. Without this file the tool can not be tracked!
*/
bool LoadFile(const char* filename);
/**
* \brief Loads a tool calibration file. Without this file the tool can not be tracked!
*/
bool LoadFile(std::string filename);
std::string GetFile();
/**
* \brief Sets the handle of the tool.
* \param handle The new handle of the tool.
*/
void SetToolHandle (claronToolHandle handle);
/**
* \return Returns the calibration name which is used to identify the tool.
*/
std::string GetCalibrationName();
/**
* \brief Sets the calibration name of the tool. Be careful, only use this method if you know what you are doing.
* If you want to change the tool name use the method setToolName instead!
*/
void SetCalibrationName(std::string name);
/**
* @return Returns the tool handle of the tool.
*/
claronToolHandle GetToolHandle();
protected:
- itkFactorylessNewMacro(Self)
+ itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
ClaronTool();
~ClaronTool() override;
/** \brief Tool handle variable from tracking device */
claronToolHandle m_ToolHandle;
/** \brief Variable which holds the Tool's calibration name */
std::string m_CalibrationName;
/** \brief Variable to check filename's format and to get back complete filename */
std::string m_Filename;
};
}//mitk
#endif // MITKCLARONTOOL_H_HEADER_INCLUDED_
diff --git a/Modules/IGT/TrackingDevices/mitkClaronTrackingDevice.h b/Modules/IGT/TrackingDevices/mitkClaronTrackingDevice.h
index 82646a1d38..64c8591528 100644
--- a/Modules/IGT/TrackingDevices/mitkClaronTrackingDevice.h
+++ b/Modules/IGT/TrackingDevices/mitkClaronTrackingDevice.h
@@ -1,165 +1,165 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKCLARONTRACKINGDEVICE_H_HEADER_INCLUDED_
#define MITKCLARONTRACKINGDEVICE_H_HEADER_INCLUDED_
#include <vector>
#include <mitkIGTConfig.h>
#include <mitkTrackingDevice.h>
#include <mitkClaronTool.h>
#include <itkMultiThreader.h>
//only include MicronTracker if cmake Variable is on else the ClaronInterfaceStub is included
#ifdef MITK_USE_MICRON_TRACKER
#include <mitkClaronInterface.h>
#else
#include <mitkClaronInterfaceStub.h>
#endif
namespace mitk
{
/** Documentation:
* \brief An object of this class represents the MicronTracker device. You can add tools to this
* device, then open the connection and start tracking. The tracking device will then
* continuously update the tool coordinates.
* \ingroup IGT
*/
class MITKIGT_EXPORT ClaronTrackingDevice : public TrackingDevice
{
public:
mitkClassMacro(ClaronTrackingDevice, TrackingDevice);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* @returns Returns true if the MicronTracker is installed on this build (means activated in CMAKE). False if not.
*/
bool IsDeviceInstalled() override;
/**
* \brief Starts the tracking.
* \return Returns true if the tracking is started. Throws an exception if an error occures.
* @throw mitk::IGTHardwareException Throws an exception if there is an error during start tracking.
*/
bool StartTracking() override;
/**
* \brief Stops the tracking.
* \return Returns true if the tracking is stopped.
*/
bool StopTracking() override;
/**
* \brief Opens the connection to the device. This have to be done before the tracking is started.
* @throw mitk::IGTHardwareException Throws an exception if there is an error during open connection.
*/
bool OpenConnection() override;
/**
* \brief Closes the connection and clears all resources.
*/
bool CloseConnection() override;
/**
* \return Returns the number of tools which have been added to the device.
*/
unsigned int GetToolCount() const override;
/**
* \param toolNumber The number of the tool which should be given back.
* \return Returns the tool which the number "toolNumber". Returns nullptr, if there is
* no tool with this number.
*/
TrackingTool* GetTool(unsigned int toolNumber) const override;
/**
* \brief Create a new Claron tool with toolName and fileName and add it to the list of tools
*
* This method will create a new ClaronTool object, load the tool definition file fileName,
* set the tool name toolName and then add it to the list of tools.
* It returns a pointer of type mitk::TrackingTool to the tool
* that can be used to read tracking data from it.
* This is the only way to add tools to ClaronTrackingDevice.
*
* \warning adding tools is not possible in tracking mode, only in setup and ready.
*/
mitk::TrackingTool* AddTool(const char* toolName, const char* fileName);
/**
* \return Returns whether the MicronTracker is installed (means whether the C-Make-Variable "MITK_USE_MICRON_TRACKER" is set),
* so returns false in this case.
* \deprecatedSince{2014_03} This method is deprecated, please use the static method IsDeviceInstalled() instead.
*/
DEPRECATED(bool IsMicronTrackerInstalled());
/** @brief Sets the directory where the calibration file of the MicronTracker can be found. */
itkSetMacro(CalibrationDir,std::string);
/** @brief Gets the current calibration directory. */
itkGetMacro(CalibrationDir,std::string);
protected:
ClaronTrackingDevice();
~ClaronTrackingDevice() override;
/**
* \brief Adds a tool to the tracking device.
*
* \param tool The tool which will be added.
* \return Returns true if the tool has been added, false otherwise.
*/
bool InternalAddTool(ClaronTool::Pointer tool);
/**
* \brief This method tracks tools as long as the variable m_Mode is set to "Tracking".
* Tracking tools means grabbing frames from the camera an updating the tools.
* @throw mitk::IGTHardwareException Throws an exception if there is an error during tracking of tools.
*/
void TrackTools();
/**
* \brief Automatically detects tools in field of measurement of the tracking device.
* Tools can only be detected if their calibration file is availiable in the directory
* for calibration files.
* \return Returns all detected Tools.
*/
std::vector<ClaronTool::Pointer> DetectTools();
/**
* \return Returns all tools of the tracking device.
*/
std::vector<ClaronTool::Pointer> GetAllTools();
/**
* \return Gives back the device which is represented by an object of the class ClaronInterface.
*/
ClaronInterface* GetDevice();
static ITK_THREAD_RETURN_TYPE ThreadStartTracking(void* data);
std::vector<ClaronTool::Pointer> m_AllTools; ///< vector holding all tools
ClaronInterface::Pointer m_Device; ///< represents the interface to the tracking hardware
itk::MultiThreader::Pointer m_MultiThreader;
int m_ThreadID;
/** \brief The directory where the camera calibration files can be found */
std::string m_CalibrationDir;
/** \brief The directory where the tool calibration files can be found */
std::string m_ToolfilesDir;
};
}//mitk
#endif /* MITKCLARONTRACKINGDEVICE_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGT/TrackingDevices/mitkItkNonUniformBSpline.h b/Modules/IGT/TrackingDevices/mitkItkNonUniformBSpline.h
index b7d760d76e..95a9bc3b83 100644
--- a/Modules/IGT/TrackingDevices/mitkItkNonUniformBSpline.h
+++ b/Modules/IGT/TrackingDevices/mitkItkNonUniformBSpline.h
@@ -1,206 +1,206 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
/*===================================================================
This file is based heavily on a corresponding ITK filter.
===================================================================*/
/*********************************
This file was taken from ITK, CVS version 1.8 to circumvent a bug in ITK release 3.18 (see http://public.kitware.com/Bug/view.php?id=10633
*********************************/
#ifndef __itkNonUniformBSpline_h
#define __itkNonUniformBSpline_h
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include <vector>
#include "itkPoint.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkArray.h"
namespace itk {
/**
* \class NonUniformBSpline
* \brief BSpline with nonuniform knot spacing.
* \warning This class was taken from an earlier ITK version and slightly modified.
* The original itkNonUniformBSpline is deprecated in ITK 4.3. Currently, the
* mitkItkNonUniformBSpline is only used inside the virtual tracking device.
*
* This class is a bspline with nonuniform knot spacing. The
* use can specify a set of points and a set of knots and the
* spline will attempt to find the control points which will
* cause the spline to interpolate the points.
*/
template < unsigned int TDimension = 3 >
class NonUniformBSpline
: public Object
{
public:
/**
Typedefs
*/
typedef NonUniformBSpline Self;
typedef Object Superclass;
typedef SmartPointer < Self > Pointer;
typedef SmartPointer < const Self > ConstPointer;
typedef double ScalarType;
typedef itk::Point< ScalarType, TDimension > PointType;
typedef std::vector < PointType > PointListType;
typedef PointListType * PointListPointer;
typedef std::vector < double > KnotListType;
typedef std::vector<double> CoordinateListType;
typedef itk::Point<double, TDimension > ControlPointType;
typedef std::vector< ControlPointType > ControlPointListType;
typedef ControlPointListType * ControlPointListPointer;
typedef std::vector<double> ChordLengthListType;
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Method for creation through the object factory. */
itkTypeMacro( NonUniformBSpline, Object );
/**
* Set points which the spline will attempt to interpolate.
*/
void SetPoints( PointListType & newPoints );
/**
* Get the points the spline is trying to interpolate.
*/
const PointListType & GetPoints() const;
/**
* Set the knot vector. Knots may be nonuniformly spaced.
* Knots will be rescaled to be between 0 and 1.
*/
void SetKnots( KnotListType & newKnots);
/**
* Get the knot vector.
*/
const KnotListType & GetKnots() const;
/**
* Computes the chord lengths based on the points.
*/
void ComputeChordLengths();
/**
* Methods for evaluating the spline.
* The parameterization is always between 0 and 1.
*/
PointType EvaluateSpline(const Array<double> & p) const;
PointType EvaluateSpline( double t ) const;
/**
* Compute the control points.
*/
void ComputeControlPoints();
/**
* Set the control points for the spline.
*/
void SetControlPoints( ControlPointListType& ctrlpts );
/**
* Get the control points for the spline
*/
const ControlPointListType & GetControlPoints() const;
/**
* Evaluate the basis functions directly.
* order - order of the basis function, i.e. 3 = cubic.
* i - basis function number, zero based.
* t - parameter of the spline.
*/
double NonUniformBSplineFunctionRecursive(unsigned int order, unsigned int i, double t) const;
/**
* Set the order of the spline.
*/
itkSetMacro( SplineOrder, unsigned int );
itkGetConstReferenceMacro( SplineOrder, unsigned int );
protected:
/**
* Constructor
*/
NonUniformBSpline();
/**
* Virtual destructor
*/
~NonUniformBSpline() override;
/**
* Method to print the object.
*/
void PrintSelf( std::ostream& os, Indent indent ) const override;
/**
* Points that the spline attempts to intepolate.
*/
PointListType m_Points;
/**
* The knots of spline.
*/
KnotListType m_Knots;
/**
* The control points of the spline.
*/
ControlPointListType m_ControlPoints;
/**
* The chord length computed from m_Points.
*/
ChordLengthListType m_ChordLength;
/**
* The cumulative chord length computed from m_Points
*/
ChordLengthListType m_CumulativeChordLength;
/**
* The order of the spline.
*/
unsigned int m_SplineOrder;
/**
* The spatial dimension. Saved from the template parameter.
*/
unsigned int m_SpatialDimension;
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "mitkItkNonUniformBSpline.txx"
#endif
#endif // __itkNonUniformBSpline_h
diff --git a/Modules/IGT/TrackingDevices/mitkMicroBirdTool.h b/Modules/IGT/TrackingDevices/mitkMicroBirdTool.h
index 3788c89255..9b35225fe2 100644
--- a/Modules/IGT/TrackingDevices/mitkMicroBirdTool.h
+++ b/Modules/IGT/TrackingDevices/mitkMicroBirdTool.h
@@ -1,38 +1,38 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKMICROBIRDTOOL_H_HEADER_INCLUDED_
#define MITKMICROBIRDTOOL_H_HEADER_INCLUDED_
#include <mitkTrackingTool.h>
namespace mitk {
//##Documentation
//## \brief Implementation of a MicroBird tool
//##
//##
//## \ingroup IGT
class MITKIGT_EXPORT MicroBirdTool : public TrackingTool
{
public:
mitkClassMacro(MicroBirdTool, TrackingTool);
- itkFactorylessNewMacro(Self)
+ itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
protected:
MicroBirdTool();
virtual ~MicroBirdTool();
};
} // namespace mitk
#endif /* MITKMICROBIRDTOOL_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGT/TrackingDevices/mitkMicroBirdTrackingDevice.h b/Modules/IGT/TrackingDevices/mitkMicroBirdTrackingDevice.h
index 3bb9ab44d5..564cd6703f 100644
--- a/Modules/IGT/TrackingDevices/mitkMicroBirdTrackingDevice.h
+++ b/Modules/IGT/TrackingDevices/mitkMicroBirdTrackingDevice.h
@@ -1,137 +1,137 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKMIRCOBIRDTRACKINGDEVICE_H_HEADER_INCLUDED
#define MITKMIRCOBIRDTRACKINGDEVICE_H_HEADER_INCLUDED
#include "mitkTrackingDevice.h"
#include <MitkIGTExports.h>
#include <itkMultiThreader.h>
#include <list>
#include "mitkTrackingTypes.h"
#include "mitkMicroBirdTool.h"
#include "PCIBird3.h"
namespace mitk {
/**Documentation
* \brief superclass for specific MIRCOBIRD tracking Devices
*
* This class connects to a Ascension Microbird tracking device.
* You can not add tools manually. All connected tools are discovered
* during OpenConnection() and added automatically. Retrieve them with
* GetTool(unsigned int toolNumber) and GetToolCount() after a call to
* OpenConnection().
*
* \ingroup IGT
*/
class MITKIGT_EXPORT MicroBirdTrackingDevice : public TrackingDevice
{
public:
mitkClassMacro(MicroBirdTrackingDevice, TrackingDevice);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**Documentation
* \brief Set the type of the microBird Tracking Device because it can not yet handle this itself
*/
itkSetMacro(Type,TrackingDeviceType);
/**Documentation
* \brief Builds up the connection (loads tools, initializes and enables them)
*/
virtual bool OpenConnection();
/**Documentation
* \brief Closes the connection
**/
virtual bool CloseConnection();
/**Documentation
* \brief Start the tracking.
*
* A new thread is created, which reads the position and orientation information of each tool and stores them inside the tools.
**/
virtual bool StartTracking();
/**Documentation
* \brief here we use the superclass method.
**/
virtual bool StopTracking();
/**Documentation
* \brief returns a tracking tool that contains positional information about one of the sensors
**/
virtual TrackingTool* GetTool(unsigned int toolNumber);
/**Documentation
* \brief returns a the number of attached sensors
**/
virtual unsigned int GetToolCount() const;
/**Documentation
* \brief returns description of most recent error.
**/
itkGetStringMacro(ErrorMessage);
protected:
void HandleError(int errorCode);
bool CompareError(int errorCode, int errorConstant);
typedef TrackingTool ToolType;
typedef std::vector<ToolType::Pointer> ToolContainerType;
MicroBirdTrackingDevice();
virtual ~MicroBirdTrackingDevice();
/**Documentation
* \brief returns a tracking tool that contains positional information about one of the sensors
**/
ToolType* GetMicroBirdTool(unsigned int toolNumber);
virtual void InvalidateAll(); ///< invalidates all tools (on stoptracking, closeconnection)
bool SwitchTransmitter(bool switchOn);///< Switches the transmitter on resp. off
/**Documentation
* \brief tracks the position and orientation of all tools until StopTracking() is called.
*
* This function should only be executed by a new thread (through StartTracking() and ThreadStartTracking())
*/
virtual void TrackTools();
static ITK_THREAD_RETURN_TYPE ThreadStartTracking(void* data); ///< Helper function, because the itk::MultiThreader can only start a new thread with a static member function
itkSetStringMacro(ErrorMessage);
itk::FastMutexLock::Pointer m_ToolsMutex;
ToolContainerType m_Tools;
std::string m_ErrorMessage;
itk::MultiThreader::Pointer m_MultiThreader;
int m_ThreadID;
//DOUBLE_POSITION_MATRIX_TIME_Q_RECORD record, *pRecord; ///< One tracking data record (matrix orientation format)
DOUBLE_POSITION_QUATERNION_TIME_Q_RECORD record, *pRecord; ///< One tracking data record (quaternion orientation format)
SYSTEM_CONFIGURATION m_SystemConfig; ///< The system configuration - used to specify its use
SENSOR_CONFIGURATION *m_SensorConfig; ///< The sensor configuration - used to get and set the sensor properties
TRANSMITTER_CONFIGURATION *m_TransmitterConfig; ///< The transmitter configuration - used to get and set the transmitter properties
BOOL m_metric; ///< Specifies whether metric measurement is used
double m_measurementRate; ///< Specifies the measurement rate - default set to maximum
double m_pl; ///< Specifies the power line frequency (Europe 50Hz, USA 60Hz)
bool m_agcModeBoth; ///< AGC (automatic gain control) mode flag
AGC_MODE_TYPE m_agc;
};
} // namespace mitk
#endif /* MITKMIRCOBIRDTRACKINGDEVICE_H_HEADER_INCLUDED*/
diff --git a/Modules/IGT/TrackingDevices/mitkNDIPassiveTool.h b/Modules/IGT/TrackingDevices/mitkNDIPassiveTool.h
index 5a8c20a827..8e03b9054f 100644
--- a/Modules/IGT/TrackingDevices/mitkNDIPassiveTool.h
+++ b/Modules/IGT/TrackingDevices/mitkNDIPassiveTool.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKNDIPASSIVETOOL_H_HEADER_INCLUDED_
#define MITKNDIPASSIVETOOL_H_HEADER_INCLUDED_
#include <mitkTrackingTool.h>
#include "mitkTrackingTypes.h"
namespace mitk
{
class NDITrackingDevice;
/**Documentation
* \brief Implementation of a passive NDI optical tool
*
* implements the TrackingTool interface and has the ability to
* load an srom file that contains the marker configuration for that tool
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NDIPassiveTool : public TrackingTool
{
public:
friend class NDITrackingDevice;
/**
* \brief tracking priority for NDI tracking devices
*/
enum TrackingPriority
{
Static = 'S',
Dynamic = 'D',
ButtonBox = 'B'
};
mitkClassMacro(NDIPassiveTool, TrackingTool);
virtual bool LoadSROMFile(const char* filename); ///< load a srom tool description file
virtual const unsigned char* GetSROMData() const; ///< get loaded srom file as unsigned char array
virtual unsigned int GetSROMDataLength() const; ///< get length of SROMData char array
itkSetStringMacro(PortHandle); ///< get port handle under which the tool is registered in the tracking device
itkGetStringMacro(PortHandle); ///< set port handle under which the tool is registered in the tracking device
itkSetMacro(TrackingPriority, TrackingPriority); ///< set tracking priority that the ndi tracking device should use
itkGetConstMacro(TrackingPriority, TrackingPriority); ///< get tracking priority that the ndi tracking device should use
itkSetStringMacro(SerialNumber); ///< set serial number of the tool
itkGetStringMacro(SerialNumber); ///< get serial number of the tool
itkGetStringMacro(File); ///< get file from which this tool was loaded
protected:
- itkFactorylessNewMacro(Self)
+ itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
NDIPassiveTool();
~NDIPassiveTool() override;
unsigned char* m_SROMData; ///< content of the srom tool description file
unsigned int m_SROMDataLength; ///< length of the srom tool description file
TrackingPriority m_TrackingPriority; ///< priority for this tool
std::string m_PortHandle; ///< port handle for this tool
std::string m_SerialNumber; ///< serial number for this tool
std::string m_File; ///< the original file from which this tool was loaded
};
} // namespace mitk
#endif /* MITKNDIPASSIVETOOL_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGT/TrackingDevices/mitkNDIProtocol.h b/Modules/IGT/TrackingDevices/mitkNDIProtocol.h
index e1647a835b..babdfa37cd 100644
--- a/Modules/IGT/TrackingDevices/mitkNDIProtocol.h
+++ b/Modules/IGT/TrackingDevices/mitkNDIProtocol.h
@@ -1,163 +1,162 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKNDIPROTOCOL_H_HEADER_INCLUDED_
#define MITKNDIPROTOCOL_H_HEADER_INCLUDED_
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <MitkIGTExports.h>
#include "mitkSerialCommunication.h"
#include "mitkNDIPassiveTool.h"
namespace mitk
{
class NDITrackingDevice;
/**Documentation
* \brief Error codes of NDI tracking devices
*/
enum NDIErrorCode
{
NDIOKAY = 0,
NDIERROR = 1,
SERIALINTERFACENOTSET,
SERIALSENDERROR,
SERIALRECEIVEERROR,
SROMFILETOOLARGE,
SROMFILETOOSMALL,
NDICRCERROR, // reply has crc error, local computer detected the error
NDIINVALIDCOMMAND,
NDICOMMANDTOOLONG,
NDICOMMANDTOOSHORT,
NDICRCDOESNOTMATCH, // command had crc error, tracking device detected the error
NDITIMEOUT,
NDIUNABLETOSETNEWCOMMPARAMETERS,
NDIINCORRECTNUMBEROFPARAMETERS,
NDIINVALIDPORTHANDLE,
NDIINVALIDTRACKINGPRIORITY,
NDIINVALIDLED,
NDIINVALIDLEDSTATE,
NDICOMMANDINVALIDINCURRENTMODE,
NDINOTOOLFORPORT,
NDIPORTNOTINITIALIZED,
NDISYSTEMNOTINITIALIZED,
NDIUNABLETOSTOPTRACKING,
NDIUNABLETOSTARTTRACKING,
NDIINITIALIZATIONFAILED,
NDIINVALIDVOLUMEPARAMETERS,
NDICANTSTARTDIAGNOSTICMODE,
NDICANTINITIRDIAGNOSTICS,
NDIFAILURETOWRITESROM,
NDIENABLEDTOOLSNOTSUPPORTED,
NDICOMMANDPARAMETEROUTOFRANGE,
NDINOMEMORYAVAILABLE,
NDIPORTHANDLENOTALLOCATED,
NDIPORTHASBECOMEUNOCCUPIED,
NDIOUTOFHANDLES,
NDIINCOMPATIBLEFIRMWAREVERSIONS,
NDIINVALIDPORTDESCRIPTION,
NDIINVALIDOPERATIONFORDEVICE,
NDIWARNING,
NDIUNKNOWNERROR,
NDIUNEXPECTEDREPLY,
UNKNOWNHANDLERETURNED,
TRACKINGDEVICERESET,
TRACKINGDEVICENOTSET
};
/**Documentation
* \brief The NDI Protocol class provides building and parsing of
* command strings and answers to and from a NDI tracking device.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NDIProtocol : public itk::Object
{
public:
mitkClassMacroItkParent(NDIProtocol, itk::Object);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
-
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
itkSetObjectMacro(TrackingDevice, NDITrackingDevice);
typedef mitk::SerialCommunication::PortNumber PortNumber; ///< Port number of the serial connection
typedef mitk::SerialCommunication::BaudRate BaudRate; ///< Baud rate of the serial connection
typedef mitk::SerialCommunication::DataBits DataBits; ///< Number of data bits used in the serial connection
typedef mitk::SerialCommunication::Parity Parity; ///< Parity mode used in the serial connection
typedef mitk::SerialCommunication::StopBits StopBits; ///< Number of stop bits used in the serial connection
typedef mitk::SerialCommunication::HardwareHandshake HardwareHandshake; ///< Hardware handshake mode of the serial connection
typedef mitk::NDIPassiveTool::TrackingPriority TrackingPriority; ///< Tracking priority used for tracking a tool
/**
* \brief Gives information about the tool which is assosiated with the port handle. Writes portInfo to the string.
*/
NDIErrorCode APIREV(std::string* revision);
NDIErrorCode PHINF(std::string portHandle, std::string* portInfo);
NDIErrorCode PSOUT(std::string portHandle, std::string state); ///< Set GPIO Output (Aurora)
NDIErrorCode COMM(mitk::SerialCommunication::BaudRate baudRate, mitk::SerialCommunication::DataBits dataBits, mitk::SerialCommunication::Parity parity, mitk::SerialCommunication::StopBits stopBits, mitk::SerialCommunication::HardwareHandshake hardwareHandshake); ///< Change Serial Communication Parameters
NDIErrorCode INIT(); ///< Initialize the Measurement System
NDIErrorCode DSTART(); ///< Start the Diagnostic Mode
NDIErrorCode DSTOP(); ///< Stop the Diagnostic Mode
NDIErrorCode IRINIT(); ///< Initialize the System to Check for Infrared
NDIErrorCode IRCHK(bool* IRdetected); ///< This version of IRCHK uses only the simple "presence of infrared light" call, that returns a binary "IR detected/no IR detected" answer
NDIErrorCode PHSR(PHSRQueryType queryType, std::string* portHandles); ///< Port Handle Search. Will write returned port handles to the string portHandles
NDIErrorCode PHF(std::string* portHandle); ///< Port Handle Free. Frees the port handle.
NDIErrorCode PHRQ(std::string* portHandle); ///< Port Handle Request. Will request a Port Handle for a wireless tool and return it in the string portHandle
NDIErrorCode PVWR(std::string* portHandle, const unsigned char* sromData, unsigned int sromDataLength); ///< Port Virtual Write. Writes an SROM Image data to a tool
NDIErrorCode PINIT(std::string* portHandle); ///< Port Initialize. Will initialize a Port that has been acquired with PHRQ and has been assigned a SROM File with PVWR
NDIErrorCode PENA(std::string* portHandle, TrackingPriority prio); ///< Port Enable. Will enable a port that has been initialized with PINIT.
NDIErrorCode PDIS(std::string* portHandle); ///< Port Disable. Will disable a port that has been enabled with PENA
NDIErrorCode IRATE(IlluminationActivationRate rate); ///< Setting the illuminator rate. Will set the refresh rate for the illuminator for wireless tools
NDIErrorCode BEEP(unsigned char count); ///< Sounding the measurement system beeper. The tracking system will beep one to nine times
NDIErrorCode SFLIST(std::string* info); ///< Returns information about the supported feature of the tracking system
NDIErrorCode TSTART(bool resetFrameCounter = false); ///< Start Tracking Mode. The tracking system must be in setup mode and must be initialized.
NDIErrorCode TSTOP(); ///< Stop Tracking Mode. The tracking system must be in Tracking mode.
NDIErrorCode TX(bool trackIndividualMarkers = false, MarkerPointContainerType* markerPositions = nullptr); ///< Report transformations in text mode. Optionally, individual markers can be tracked
NDIErrorCode BX(); ///< Report transformations in binary mode.
NDIErrorCode POS3D(MarkerPointContainerType* markerPositions); ///< Report 3D Positions of single markers. can only be used in diagnostics mode
NDIErrorCode VER(mitk::TrackingDeviceType& t); ///< returns if the tracking device is a Polaris or an Aurora system
NDIErrorCode VSEL(mitk::TrackingDeviceData deviceData); ///< Sets the tracking volume to the given type. Check available tracking volumes with SFLIST first
NDIErrorCode TX1000(MarkerPointContainerType* markerPositions); ///< Report transformations in text mode.
unsigned int ByteToNbBitsOn(char& c) const; ///<
itkGetConstMacro(UseCRC, bool); ///< Get whether to append a CRC16 checksum to each message
itkSetMacro(UseCRC, bool); ///< Set whether to append a CRC16 checksum to each message
itkBooleanMacro(UseCRC); ///< Set whether to append a CRC16 checksum to each message
protected:
NDIProtocol();
~NDIProtocol() override;
/**Documentation
* Reads the reply from the tracking device and checks if it is either "OKAY" or "ERROR##".
* if it reads an error, it returns the equivalent NDIErrorCode
* Replies other than OKAY or ERROR result in an NDIUNEXPECTEDREPLY
*/
NDIErrorCode ParseOkayError();
/**Documentation
* Sends the command command to the tracking system and checks for OKAY and ERROR as replies
* This is used by commands like INIT, DSTART, DSTOP,... that do not need parameters
* or special parsing of replies
*/
NDIErrorCode GenericCommand(const std::string command, const std::string* parameter = nullptr);
/**Documentation
* \brief returns the error code for an Error String returned from the NDI tracking device
*/
NDIErrorCode GetErrorCode(const std::string* input);
NDITrackingDevice* m_TrackingDevice; ///< tracking device to which the commands will be send
bool m_UseCRC; ///< whether to append a CRC16 checksum to each message
};
} // namespace mitk
#endif /* MITKNDIPROTOCOL_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGT/TrackingDevices/mitkNDITrackingDevice.h b/Modules/IGT/TrackingDevices/mitkNDITrackingDevice.h
index 2789da021a..7a160e34e1 100644
--- a/Modules/IGT/TrackingDevices/mitkNDITrackingDevice.h
+++ b/Modules/IGT/TrackingDevices/mitkNDITrackingDevice.h
@@ -1,330 +1,330 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKNDITRACKINGDEVICE_H_HEADER_INCLUDED_C1C2FCD2
#define MITKNDITRACKINGDEVICE_H_HEADER_INCLUDED_C1C2FCD2
#include "mitkTrackingDevice.h"
#include <MitkIGTExports.h>
#include <itkMultiThreader.h>
#include "itkFastMutexLock.h"
#include <vector>
#include "mitkNDIProtocol.h"
#include "mitkNDIPassiveTool.h"
#include "mitkSerialCommunication.h"
namespace mitk
{
class NDIProtocol;
/** Documentation
* \brief superclass for specific NDI tracking Devices that use serial communication.
*
* implements the TrackingDevice interface for NDI tracking devices (POLARIS, AURORA)
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NDITrackingDevice : public TrackingDevice
{
friend class NDIProtocol;
public:
typedef std::vector<NDIPassiveTool::Pointer> Tool6DContainerType; ///< List of 6D tools of the correct type for this tracking device
typedef mitk::TrackingDeviceType NDITrackingDeviceType; ///< This enumeration includes the two types of NDI tracking devices (Polaris, Aurora).
typedef mitk::SerialCommunication::PortNumber PortNumber; ///< Port number of the serial connection
typedef mitk::SerialCommunication::BaudRate BaudRate; ///< Baud rate of the serial connection
typedef mitk::SerialCommunication::DataBits DataBits; ///< Number of data bits used in the serial connection
typedef mitk::SerialCommunication::Parity Parity; ///< Parity mode used in the serial connection
typedef mitk::SerialCommunication::StopBits StopBits; ///< Number of stop bits used in the serial connection
typedef mitk::SerialCommunication::HardwareHandshake HardwareHandshake; ///< Hardware handshake mode of the serial connection
typedef mitk::NDIPassiveTool::TrackingPriority TrackingPriority; ///< Tracking priority used for tracking a tool
mitkClassMacro(NDITrackingDevice, TrackingDevice);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* \brief Set the type of the NDI Tracking Device because it can not jet handle this itself
*/
//itkSetMacro(Type, TrackingDeviceType);
/**
* \brief initialize the connection to the tracking device
*
* OpenConnection() establishes the connection to the tracking device by:
* - initializing the serial port with the given parameters (port number, baud rate, ...)
* - connection to the tracking device
* - initializing the device
* - initializing all manually added passive tools (user supplied srom file)
* - initializing active tools that are connected to the tracking device
* @throw mitk::IGTHardwareException Throws an exception if there are errors while connecting to the device.
* @throw mitk::IGTException Throws a normal IGT exception if an error occures which is not related to the hardware.
*/
bool OpenConnection() override;
/**
* \brief Closes the connection
*
* CloseConnection() resets the tracking device, invalidates all tools and then closes the serial port.
*/
bool CloseConnection() override;
/** @throw mitk::IGTHardwareException Throws an exception if there are errors while connecting to the device. */
bool InitializeWiredTools();
/** Sets the rotation mode of this class. See documentation of enum RotationMode for details
* on the different modes.
*/
void SetRotationMode(RotationMode r) override;
/**
* \brief TestConnection() tries to connect to a NDI tracking device on the current port/device and returns which device it has found
*
* TestConnection() tries to connect to a NDI tracking device on the current port/device.
* \return It returns the type of the device that answers at the port/device. Throws an exception if no device is available on that port.
* @throw mitk::IGTHardwareException Throws an exception if there are errors while connecting to the device.
*/
virtual mitk::TrackingDeviceType TestConnection();
/**
* \brief retrieves all wired tools from the tracking device
*
* This method queries the tracking device for all wired tools, initializes them and creates TrackingTool representation objects
* for them
* \return True if the method was executed successful.
* @throw mitk::IGTHardwareException Throws an exception if there are errors while connecting to the device.
* @throw mitk::IGTException Throws a normal IGT exception if an error occures which is not related to the hardware.
*/
bool DiscoverWiredTools();
/**
* \brief Start the tracking.
*
* A new thread is created, which continuously reads the position and orientation information of each tool and stores them inside the tools.
* Depending on the current operation mode (see SetOperationMode()), either the 6D tools (ToolTracking6D), 5D tools (ToolTracking5D),
* 3D marker positions (MarkerTracking3D) or both 6D tools and 3D markers (HybridTracking) are updated.
* Call StopTracking() to stop the tracking thread.
*/
bool StartTracking() override;
/**
* \brief return the tool with index toolNumber
*/
TrackingTool* GetTool(unsigned int toolNumber) const override;
mitk::TrackingTool* GetToolByName(std::string name) const override;
/**
* \brief return current number of tools
*/
unsigned int GetToolCount() const override;
/**
* \brief Create a passive 6D tool with toolName and fileName and add it to the list of tools
*
* This method will create a new NDIPassiveTool object, load the SROM file fileName,
* set the tool name toolName and the tracking priority p and then add
* it to the list of tools. It returns a pointer of type mitk::TrackingTool to the tool
* that can be used to read tracking data from it.
* This is the only way to add tools to NDITrackingDevice.
* @throw mitk::IGTHardwareException Throws an exception if there are errors while adding the tool.
*
* \warning adding tools is not possible in tracking mode, only in setup and ready.
*/
mitk::TrackingTool* AddTool(const char* toolName, const char* fileName, TrackingPriority p = NDIPassiveTool::Dynamic);
/**
* \brief Remove a passive 6D tool from the list of tracked tools.
*
* \warning removing tools is not possible in tracking mode, only in setup and ready modes.
*/
virtual bool RemoveTool(TrackingTool* tool);
/**
* \brief reloads the srom file and reinitializes the tool
*/
virtual bool UpdateTool(mitk::TrackingTool* tool);
virtual void SetPortNumber(const PortNumber _arg); ///< set port number for serial communication
itkGetConstMacro(PortNumber, PortNumber); ///< returns the port number for serial communication
virtual void SetDeviceName(std::string _arg); ///< set device name (e.g. COM1, /dev/ttyUSB0). If this is set, PortNumber will be ignored
itkGetStringMacro(DeviceName); ///< returns the device name for serial communication
virtual void SetBaudRate(const BaudRate _arg); ///< set baud rate for serial communication
itkGetConstMacro(BaudRate, BaudRate); ///< returns the baud rate for serial communication
virtual void SetDataBits(const DataBits _arg); ///< set number of data bits
itkGetConstMacro(DataBits, DataBits); ///< returns the data bits for serial communication
virtual void SetParity(const Parity _arg); ///< set parity mode
itkGetConstMacro(Parity, Parity); ///< returns the parity mode
virtual void SetStopBits(const StopBits _arg); ///< set number of stop bits
itkGetConstMacro(StopBits, StopBits); ///< returns the number of stop bits
virtual void SetHardwareHandshake(const HardwareHandshake _arg); ///< set use hardware handshake for serial communication
itkGetConstMacro(HardwareHandshake, HardwareHandshake); ///< returns the hardware handshake setting
virtual void SetIlluminationActivationRate(const IlluminationActivationRate _arg); ///< set activation rate of IR illumator for polaris
itkGetConstMacro(IlluminationActivationRate, IlluminationActivationRate); ///< returns the activation rate of IR illumator for polaris
virtual void SetDataTransferMode(const DataTransferMode _arg); ///< set data transfer mode to text (TX) or binary (BX). \warning: only TX is supportet at the moment
itkGetConstMacro(DataTransferMode, DataTransferMode); ///< returns the data transfer mode
virtual bool Beep(unsigned char count); ///< Beep the tracking device 1 to 9 times
NDIErrorCode GetErrorCode(const std::string* input); ///< returns the error code for a string that contains an error code in hexadecimal format
virtual bool SetOperationMode(OperationMode mode); ///< set operation mode to 6D tool tracking, 3D marker tracking or 6D&3D hybrid tracking (see OperationMode)
virtual OperationMode GetOperationMode(); ///< get current operation mode
/**
* \brief Get 3D marker positions (operation mode must be set to MarkerTracking3D or HybridTracking)
*/
virtual bool GetMarkerPositions(MarkerPointContainerType* markerpositions);
/**
* \brief Get major revision number from tracking device
* should not be called directly after starting to track
**/
virtual int GetMajorFirmwareRevisionNumber();
/**
* \brief Get revision number from tracking device as string
* should not be called directly after starting to track
**/
virtual const char* GetFirmwareRevisionNumber();
/** @return Returns true if this device can autodetects its tools. */
bool AutoDetectToolsAvailable() override;
/** @return Returns true if it is possible to add a single tool. True for Polaris, false for Aurora.*/
bool AddSingleToolIsAvailable() override;
/** Autodetects tools from this device and returns them as a navigation tool storage.
* @return Returns the detected tools. Returns an empty storage if no tools are present
* or if detection is not possible
*/
mitk::NavigationToolStorage::Pointer AutoDetectTools() override;
protected:
typedef std::vector<std::string> NDITrackingVolumeContainerType; ///< vector of tracking volumes
typedef std::vector<int> TrackingVolumeDimensionType; ///< List of the supported tracking volume dimensions.
/**
* \brief Get number of supported tracking volumes, a vector containing the supported volumes and
* a vector containing the signed dimensions in mm. For each volume 10 boundaries are stored in the order of
* the supported volumes (see AURORA API GUIDE: SFLIST p.54).
**/
virtual bool GetSupportedVolumes(unsigned int* numberOfVolumes, NDITrackingVolumeContainerType* volumes, TrackingVolumeDimensionType* volumesDimensions);
/**
* \brief Sets the desired tracking volume. Returns true if the volume type could be set. It is set in the OpenConnection() Method and sets the tracking volume out of m_Data.
* @throw mitk::IGTHardwareException Throws an IGT hardware exception if the volume could not be set.
**/
virtual bool SetVolume(mitk::TrackingDeviceData volume);
/**
* \brief Add a passive 6D tool to the list of tracked tools. This method is used by AddTool
* @throw mitk::IGTHardwareException Throws an exception if there are errors while adding the tool.
* \warning adding tools is not possible in tracking mode, only in setup and ready.
*/
virtual bool InternalAddTool(NDIPassiveTool* tool);
/* Methods for NDIProtocol friend class */
virtual void InvalidateAll(); ///< invalidate all tools
NDIPassiveTool* GetInternalTool(std::string portHandle); ///< returns the tool object that has been assigned the port handle or nullptr if no tool can be found
/**
* \brief free all port handles that need to be freed
*
* This method retrieves a list of all port handles that need to be freed (e.g. tool got disconnected)
* and frees the handles at the tracking device and it removes the tools from the internal tool list
* \warning This method can remove TrackingTools from the tool list! After calling this method, GetTool(i) could return
* a different tool, because tool indices could have changed.
* @throw mitk::IGTHardwareException Throws an exception if there are errors while communicating with the device.
* \return returns NDIOKAY if everything was sucessfull, returns an error code otherwise
*/
NDIErrorCode FreePortHandles();
NDIErrorCode Send(const std::string* message, bool addCRC = true); ///< Send message to tracking device
NDIErrorCode Receive(std::string* answer, unsigned int numberOfBytes); ///< receive numberOfBytes bytes from tracking device
NDIErrorCode ReceiveByte(char* answer); ///< lightweight receive function, that reads just one byte
NDIErrorCode ReceiveLine(std::string* answer); ///< receive characters until the first LF (The LF is included in the answer string)
void ClearSendBuffer(); ///< empty send buffer of serial communication interface
void ClearReceiveBuffer(); ///< empty receive buffer of serial communication interface
const std::string CalcCRC(const std::string* input); ///< returns the CRC16 for input as a std::string
public:
/**
* \brief TrackTools() continuously polls serial interface for new 6d tool positions until StopTracking is called.
*
* Continuously tracks the 6D position of all tools until StopTracking() is called.
* This function is executed by the tracking thread (through StartTracking() and ThreadStartTracking()).
* It should not be called directly.
* @throw mitk::IGTHardwareException Throws an exception if there are errors while tracking the tools.
*/
virtual void TrackTools();
/**
* \brief continuously polls serial interface for new 3D marker positions until StopTracking is called.
*
* Continuously tracks the 3D position of all markers until StopTracking() is called.
* This function is executed by the tracking thread (through StartTracking() and ThreadStartTracking()).
* It should not be called directly.
*/
virtual void TrackMarkerPositions();
/**
* \brief continuously polls serial interface for new 3D marker positions and 6D tool positions until StopTracking is called.
*
* Continuously tracks the 3D position of all markers and the 6D position of all tools until StopTracking() is called.
* This function is executed by the tracking thread (through StartTracking() and ThreadStartTracking()).
* It should not be called directly.
*/
virtual void TrackToolsAndMarkers();
/**
* \brief static start method for the tracking thread.
*/
static ITK_THREAD_RETURN_TYPE ThreadStartTracking(void* data);
protected:
NDITrackingDevice(); ///< Constructor
~NDITrackingDevice() override; ///< Destructor
std::string m_DeviceName;///< Device Name
PortNumber m_PortNumber; ///< COM Port Number
BaudRate m_BaudRate; ///< COM Port Baud Rate
DataBits m_DataBits; ///< Number of Data Bits per token
Parity m_Parity; ///< Parity mode for communication
StopBits m_StopBits; ///< number of stop bits per token
HardwareHandshake m_HardwareHandshake; ///< use hardware handshake for serial port connection
///< which tracking volume is currently used (if device supports multiple volumes) (\warning This parameter is not used yet)
IlluminationActivationRate m_IlluminationActivationRate; ///< update rate of IR illuminator for Polaris
DataTransferMode m_DataTransferMode; ///< use TX (text) or BX (binary) (\warning currently, only TX mode is supported)
Tool6DContainerType m_6DTools; ///< list of 6D tools
itk::FastMutexLock::Pointer m_ToolsMutex; ///< mutex for coordinated access of tool container
mitk::SerialCommunication::Pointer m_SerialCommunication; ///< serial communication interface
itk::FastMutexLock::Pointer m_SerialCommunicationMutex; ///< mutex for coordinated access of serial communication interface
NDIProtocol::Pointer m_DeviceProtocol; ///< create and parse NDI protocol strings
itk::MultiThreader::Pointer m_MultiThreader; ///< creates tracking thread that continuously polls serial interface for new tracking data
int m_ThreadID; ///< ID of tracking thread
OperationMode m_OperationMode; ///< tracking mode (6D tool tracking, 3D marker tracking,...)
itk::FastMutexLock::Pointer m_MarkerPointsMutex; ///< mutex for marker point data container
MarkerPointContainerType m_MarkerPoints; ///< container for markers (3D point tracking mode)
};
} // namespace mitk
#endif /* MITKNDITRACKINGDEVICE_H_HEADER_INCLUDED_C1C2FCD2 */
diff --git a/Modules/IGT/TrackingDevices/mitkPolhemusTool.h b/Modules/IGT/TrackingDevices/mitkPolhemusTool.h
index 6d059a986f..b16589a3b5 100644
--- a/Modules/IGT/TrackingDevices/mitkPolhemusTool.h
+++ b/Modules/IGT/TrackingDevices/mitkPolhemusTool.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPolhemusTOOL_H_HEADER_INCLUDED_
#define MITKPolhemusTOOL_H_HEADER_INCLUDED_
#include <mitkPolhemusInterface.h>
#include <mitkTrackingTool.h>
#include <itkFastMutexLock.h>
namespace mitk
{
class PolhemusTrackingDevice;
/** Documentation:
* \brief An object of this class represents a tool of a Polhemus tracking device.
* A tool has to be added to a tracking device which will then
* continuously update the tool coordinates.
* \ingroup IGT
*/
class MITKIGT_EXPORT PolhemusTool : public TrackingTool
{
public:
friend class PolhemusTrackingDevice;
mitkClassMacro(PolhemusTool, TrackingTool);
enum DistortionLevel
{
UNDEFINED, ///< Distortion level is not determined.
NO_DISTORTION, ///< System operational with a good quality magnetic signal.
MINOR_DISTORTION, ///< System operational with a marginal magnetic signal.
SIGNIFICANT_DISTORTION ///< System operational with a poor magnetic signal.
};
/**
* \brief Sets the port of the tool. (e.g. 1 for port "SENS 1" etc.)
*/
virtual void SetToolPort(int _ToolPort);
/**
* \brief Sets the port of the tool. (e.g. 1 for port "SENS 1" etc.)
*/
virtual int GetToolPort();
/**
* \brief Sets the distortion level by mapping the integer value (read from the response frame) to the corresponding enumeration literal.
*
* According to the Polhemus Liberty documentation:
* - 0 means system operational with a good quality magnetic signal. No distortion.
* - 1 means system operational with a marginal magnetic signal. Minor distortion.
* - 2 means system operational with a poor magnetic signal. Significant distortion.
*
* \param level The distortion level represented as 0, 1 or 2.
*/
void SetDistortionLevel(const int level);
/**
* \brief Returns the distortion level.
* \return The distortion level. UNDEFINED, if distortion level is not determined.
*/
DistortionLevel GetDistortionLevel() const;
protected:
- itkFactorylessNewMacro(Self)
+ itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
PolhemusTool();
virtual ~PolhemusTool();
//This is the port, on which the tool is connected. It is identical with the "ToolIdentifier" set on NavigationDataTools.
//If tool is connected on port "SENS 2", the m_ToolPort is 2 etc.
int m_ToolPort;
DistortionLevel m_DistortionLevel;
};
}//mitk
#endif // MITKPolhemusTOOL_H_HEADER_INCLUDED_
diff --git a/Modules/IGT/TrackingDevices/mitkPolhemusTrackingDevice.h b/Modules/IGT/TrackingDevices/mitkPolhemusTrackingDevice.h
index e1e94cee7e..0041bfa508 100644
--- a/Modules/IGT/TrackingDevices/mitkPolhemusTrackingDevice.h
+++ b/Modules/IGT/TrackingDevices/mitkPolhemusTrackingDevice.h
@@ -1,161 +1,161 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPolhemusTRACKINGDEVICE_H_HEADER_INCLUDED_
#define MITKPolhemusTRACKINGDEVICE_H_HEADER_INCLUDED_
#include <vector>
#include <mitkIGTConfig.h>
#include <mitkTrackingDevice.h>
#include <mitkPolhemusTool.h>
#include <itkMultiThreader.h>
namespace mitk
{
/** Documentation:
* \brief An object of this class represents Polhemus tracking device. You can add tools to this
* device, then open the connection and start tracking. The tracking device will then
* continuously update the tool coordinates.
* The tools which are used by Polhemus need to be connected to the correct port.
* The port of the tool is stored as m_ToolPort in PolhemusTool AND as identifier in the NavigationTool (ToolStorage).
* \ingroup IGT
*/
class MITKIGT_EXPORT PolhemusTrackingDevice : public TrackingDevice
{
public:
mitkClassMacro(PolhemusTrackingDevice, TrackingDevice);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* \brief Starts the tracking.
* \return Returns true if the tracking is started. Throws an exception if an error occures.
* @throw mitk::IGTHardwareException Throws an exception if there is an error during start tracking.
*/
virtual bool StartTracking() override;
/**
* \brief Stops the tracking.
* \return Returns true if the tracking is stopped.
*/
virtual bool StopTracking() override;
/**
* \brief Opens the connection to the device. This have to be done before the tracking is started.
* @throw mitk::IGTHardwareException Throws an exception if there is an error during open connection.
*/
virtual bool OpenConnection() override;
/**
* \brief Closes the connection and clears all resources.
*/
virtual bool CloseConnection() override;
/**
* \return Returns the number of tools which have been added to the device.
*/
virtual unsigned int GetToolCount() const override;
/**
* \param toolNumber The number of the tool which should be given back.
* \return Returns the tool which the number "toolNumber". Returns NULL, if there is
* no tool with this number.
*/
TrackingTool* GetTool(unsigned int toolNumber) const override;
/**
* \brief Create a new Polhemus tool with toolName and add it to the list of tools
*
* This method will create a new PolhemusTool object,
* set the tool name toolName and then add it to the list of tools.
* It returns a pointer of type mitk::TrackingTool to the tool
* that can be used to read tracking data from it.
* This is the only way to add tools to PolhemusTrackingDevice.
*
* \warning adding tools is not possible in tracking mode, only in setup and ready.
*/
mitk::TrackingTool* AddTool(const char* toolName, int toolPort);
bool IsDeviceInstalled();
/** @return Returns true if this device can autodetects its tools. */
virtual bool AutoDetectToolsAvailable();
/** Autodetects tools from this device and returns them as a navigation tool storage.
* @return Returns the detected tools. Returns an empty storage if no tools are present
* or if detection is not possible
*/
virtual mitk::NavigationToolStorage::Pointer AutoDetectTools();
/** Enables/disables hemisphere tracking for all sensors. */
void SetHemisphereTrackingEnabled(bool _HemisphereTrackingEnabled);
/** Is Hemisphere Tracking Enabled for this tool? */
bool GetHemisphereTrackingEnabled(int _tool);
/** Toggles the current hemisphere. Parameter _tool describes, for which tool the hemisphere should change. Default -1 toggles all tools.*/
void ToggleHemisphere(int _tool = -1);
/** Sets the Hemisphere of tool _tool to the vector _hemisphere */
void SetHemisphere(int _tool, mitk::Vector3D _hemisphere);
/** Get the Hemisphere for _tool as mitk vector */
mitk::Vector3D GetHemisphere(int _tool);
/** Adjust the Hemisphere for this tool. User needs to make sure, that the tool is located in hemisphere (1|0|0) when calling this function.
In contrast to SetHemisphere(1,0,0), this method restores the original HemisphereTracking settings at the end. */
void AdjustHemisphere(int _tool);
protected:
PolhemusTrackingDevice();
~PolhemusTrackingDevice();
/**
* \brief Adds a tool to the tracking device.
*
* \param tool The tool which will be added.
* \return Returns true if the tool has been added, false otherwise.
*/
bool InternalAddTool(PolhemusTool::Pointer tool);
/**
* \brief This method tracks tools as long as the variable m_Mode is set to "Tracking".
* Tracking tools means grabbing frames from the camera an updating the tools.
* @throw mitk::IGTHardwareException Throws an exception if there is an error during tracking of tools.
*/
void TrackTools();
/**
* \return Returns all tools of the tracking device.
*/
std::vector<PolhemusTool::Pointer> GetAllTools();
/**
* \return Gives back the device which is represented by an object of the class PolhemusInterface.
*/
PolhemusInterface* GetDevice();
static ITK_THREAD_RETURN_TYPE ThreadStartTracking(void* data);
std::vector<PolhemusTool::Pointer> m_AllTools; ///< vector holding all tools
PolhemusInterface::Pointer m_Device; ///< represents the interface to the tracking hardware
itk::MultiThreader::Pointer m_MultiThreader;
int m_ThreadID;
bool m_HemisphereTrackingEnabled;
};
}//mitk
#endif /* MITKPolhemusTRACKINGDEVICE_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGT/TrackingDevices/mitkTrackingTool.h b/Modules/IGT/TrackingDevices/mitkTrackingTool.h
index cbd0e86832..f33b54b249 100644
--- a/Modules/IGT/TrackingDevices/mitkTrackingTool.h
+++ b/Modules/IGT/TrackingDevices/mitkTrackingTool.h
@@ -1,101 +1,101 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKTRACKINGTOOL_H_HEADER_INCLUDED_
#define MITKTRACKINGTOOL_H_HEADER_INCLUDED_
#include <itkObject.h>
#include <MitkIGTExports.h>
#include <mitkCommon.h>
#include <mitkNumericTypes.h>
#include <itkFastMutexLock.h>
namespace mitk
{
/**Documentation
* \brief Interface for all Tracking Tools
*
* This class is a complete TrackingTool implementation. It can either be used directly by
* TrackingDevices, or be subclassed for more specific implementations.
* mitk::MicroBirdTrackingDevice uses this class to manage its tools. Other tracking devices
* uses specialized versions of this class (e.g. mitk::NDITrackingTool)
*
* The TrackingTool class holds all coordinate transforms associated with tracking of a tool.
* The sensor attached to the tool is localized in the global tracking coordinate system (m_Position, m_Orientation).
* A tool tip (m_ToolTipPosition) can be defined in sensor coordinates.
* The tool axis defines the main axis of the tool and is defined as the negative z-axis of the tool tip coordinate system
* The main axis of the representation object of the tool (e.g. a surface) has to be defined along the negative z-axis
* \imageMacro{TrackingTool.png,"Coordinate transforms associated to the tracking tool.",3}
*
* \ingroup IGT
*/
class MITKIGT_EXPORT TrackingTool : public itk::Object
{
public:
- mitkClassMacroItkParent(TrackingTool, itk::Object)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacroItkParent(TrackingTool, itk::Object);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void PrintSelf(std::ostream& os, itk::Indent indent) const override;
virtual const char* GetToolName() const; ///< every tool has a name thatgit can be used to identify it.
virtual void SetToolName(const std::string _arg); ///< Sets the name of the tool
virtual void SetToolName(const char* _arg); ///< Sets the name of the tool
Point3D GetToolTipPosition() const; ///< returns the tool tip in tool coordinates, which where set by SetToolTip
Quaternion GetToolAxisOrientation() const; ///< returns the transformation of the tool axis with respect to the MITK-IGT main tool axis (0,0,-1)
virtual void SetToolTipPosition(Point3D toolTipPosition, Quaternion orientation, ScalarType eps=0.0); ///< defines a tool tip for this tool in tool coordinates. GetPosition() and GetOrientation() return the data of the tool tip if it is defined. By default no tooltip is defined.
virtual bool IsToolTipSet() const; ///< returns true if a tool tip is set, false if not
virtual void GetPosition(Point3D& position) const; ///< returns the current position of the tool as an array of three floats (in the tracking device coordinate system)
virtual void SetPosition(Point3D position); ///< sets the position
virtual void GetOrientation(Quaternion& orientation) const; ///< returns the current orientation of the tool as a quaternion in a mitk::Point4D (in the tracking device coordinate system)
virtual void SetOrientation(Quaternion orientation); ///< sets the orientation as a quaternion
virtual bool Enable(); ///< enables the tool, so that it will be tracked
virtual bool Disable(); ///< disables the tool, so that it will not be tracked anymore
virtual bool IsEnabled() const; ///< returns whether the tool is enabled or disabled
virtual void SetDataValid(bool isDataValid); ///< sets if the tracking data (position & orientation) is valid
virtual bool IsDataValid() const; ///< returns true if the current position data is valid (no error during tracking, tracking error below threshold, ...)
virtual float GetTrackingError() const; ///< returns one value that corresponds to the overall tracking error.
virtual void SetTrackingError(float error); ///< sets the tracking error
virtual const char* GetErrorMessage() const; ///< if the data is not valid, ErrorMessage should contain a string explaining why it is invalid (the Set-method should be implemented in subclasses, it should not be accessible by the user)
virtual void SetErrorMessage(const char* _arg); ///< sets the error message
itkSetMacro(IGTTimeStamp, double) ///< Sets the IGT timestamp of the tracking tool object (time in milliseconds)
itkGetConstMacro(IGTTimeStamp, double) ///< Gets the IGT timestamp of the tracking tool object (time in milliseconds). Returns 0 if the timestamp was not set.
protected:
TrackingTool();
~TrackingTool() override;
std::string m_ToolName; ///< every tool has a name that can be used to identify it.
std::string m_ErrorMessage; ///< if a tool is invalid, this member should contain a human readable explanation of why it is invalid
double m_IGTTimeStamp; ///< contains the time at which the tracking data was recorded
itk::FastMutexLock::Pointer m_MyMutex; ///< mutex to control concurrent access to the tool
Point3D m_Position; ///< holds the position of the tool in global tracking coordinates
Quaternion m_Orientation; ///< holds the orientation of the tool´in global tracking coordinates
float m_TrackingError; ///< holds the tracking error of the tool
bool m_Enabled; ///< if true, tool is enabled and should receive tracking updates from the tracking device
bool m_DataValid; ///< if true, data in m_Position and m_Orientation is valid, e.g. true tracking data
Point3D m_ToolTipPosition; ///< holds the position of the tool tip in the coordinate system of the tracking sensor
Quaternion m_ToolAxisOrientation; ///< holds the rotation of the sensor coordinate system such that the z-axis coincides with the main tool axis e.g. obtained by a tool calibration
bool m_ToolTipSet;
};
} // namespace mitk
#endif /* MITKTRACKINGTOOL_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGT/TrackingDevices/mitkTrackingVolumeGenerator.h b/Modules/IGT/TrackingDevices/mitkTrackingVolumeGenerator.h
index e229cabf5d..2f0bcb232d 100644
--- a/Modules/IGT/TrackingDevices/mitkTrackingVolumeGenerator.h
+++ b/Modules/IGT/TrackingDevices/mitkTrackingVolumeGenerator.h
@@ -1,103 +1,104 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKTRACKINGVOLUMEGENERATOR_H
#define MITKTRACKINGVOLUMEGENERATOR_H
#include "MitkIGTExports.h"
#include <mitkSurfaceSource.h>
#include "mitkTrackingTypes.h"
#include "mitkTrackingDevice.h"
namespace mitk
{
/**Documentation
* \brief An instance of this class represents a generator wich generates the tracking volume of a
* given tracking device as a mitk:Surface.
*
* To generate the specific dimensions of the tracking volume of a tracking device
* the methods SetTrackingDeviceType(trackingdevicetype) or SetTrackingDevice (tracker) have to be called first. Otherwise
* the TrackingDeviceType is set to "TrackingSystemNotSpecified".
* After setting the trackingdevice type, the update() method has to be called.
* Now the method GetOutput() delivers the generatet TrackingVolume as mitk:Surface
*
* The coordinate system of die TrackingVolume is the same as the coordination system of the tracking device.
*
* For tracking devices that have a modifiable tracking volume (e.g. VirtualTrackingDevice,
* this class produces a tracking volume with default values.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT TrackingVolumeGenerator : public mitk::SurfaceSource
{
public:
- mitkClassMacro(TrackingVolumeGenerator, mitk::SurfaceSource)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(TrackingVolumeGenerator, mitk::SurfaceSource);
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/**
* \brief Deprecated! Use set DeviceData instead.
* Sets the tracking device type of the volume. Warning: there are different possible volumes for some device types.
* In this case a default volume is chosen automatically. All tracking volumes are defined by TrackingDeviceData
* objects (see file mitkTrackingTypes.h) for a list.
*
* After setting the device type the tracking volume gets generated (by a default volume for this type as mentioned above)
* and set to the correct dimensions in the correct coordinate system. The TV of a VirtualTrackingDevice is always a 400*400 cube.
* \param type The type of the tracking device (currently supported:NDIAurora, NDIPolaris, ClaronMicron, IntuitiveDaVinci and the VirtualTracker; see file mitkTrackingTypes.h for a always up to date list).
*/
void SetTrackingDeviceType(mitk::TrackingDeviceType deviceType);
/**
* \return Returns the tracking device type of the current device. Warning: there are different possible volumes for some device types.
* Use GetTrackingDeviceData to get a unambiguous assignment to a tracking volume.
*/
mitk::TrackingDeviceType GetTrackingDeviceType() const;
/**
* \brief Sets the tracking device data object which will be used to generate the volume. Each tracking device data object
* has an unambiguous assignment to a tracking volume. See file mitkTrackingTypes.h for a list of all availiable object.
*/
void SetTrackingDeviceData(mitk::TrackingDeviceData deviceData);
/**
* \return Returns the current tracking device data of the generator. See file mitkTrackingTypes.h for the definition of tracking device data objects.
*/
mitk::TrackingDeviceData GetTrackingDeviceData() const;
/**
* \brief Deprecated! Use set DeviceData instead. Sets the tracking device type of the volume. After doing this
* the tracking volume gets generated and is set to the correct dimensions in the correct
* coordinate system. The TV of a VirtualTrackingDevice is always a 400*400 cube.
* \param tracker The tracking device the tracking volume has to be created for (currently supported: NDIAurora, NDIPolaris, ClaronMicron, IntuitiveDaVinci and the VirtualTracker; see file mitkTrackingTypes.h for a always up to date list).
*/
void SetTrackingDevice(mitk::TrackingDevice::Pointer tracker);
protected:
TrackingVolumeGenerator();
/** \brief Holds the current tracking device data object, which is used to generate the volume. */
mitk::TrackingDeviceData m_Data;
void GenerateData() override;
};
}
#endif // MITKTRACKINGVOLUMEGENERATOR_H
diff --git a/Modules/IGT/TrackingDevices/mitkVirtualTrackingDevice.h b/Modules/IGT/TrackingDevices/mitkVirtualTrackingDevice.h
index 2e55a579cc..4787c43cea 100644
--- a/Modules/IGT/TrackingDevices/mitkVirtualTrackingDevice.h
+++ b/Modules/IGT/TrackingDevices/mitkVirtualTrackingDevice.h
@@ -1,216 +1,215 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKVIRTUALTRACKINGDEVICE_H_HEADER_INCLUDED_
#define MITKVIRTUALTRACKINGDEVICE_H_HEADER_INCLUDED_
#include <MitkIGTExports.h>
#include <mitkTrackingDevice.h>
#include <mitkVirtualTrackingTool.h>
#include <itkMultiThreader.h>
#include "itkFastMutexLock.h"
#include <vector>
namespace mitk
{
/** Documentation
* \brief Class representing a tracking device which generates random positions / orientations.
* No hardware is needed for tracking device.
*
* This TrackingDevice class does not interface with a physical tracking device. It simulates
* a tracking device by moving the tools on a randomly generated spline path.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT VirtualTrackingDevice : public TrackingDevice
{
public:
mitkClassMacro(VirtualTrackingDevice, TrackingDevice);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
-
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* \brief Sets the refresh rate of the virtual tracking device in ms
* \warning This refresh rate is not guaranteed. A thread is used to refresh the positions
* of the virtual tools. However, this thread may not run at all during this refresh time period.
* \return Sets the refresh rate of the virtual tracking device in ms
*/
- itkSetMacro(RefreshRate, unsigned int)
+ itkSetMacro(RefreshRate, unsigned int);
/**
* \brief Returns the refresh rate in ms.
* \return Returns the refresh rate in ms.
*/
- itkGetConstMacro(RefreshRate, unsigned int)
+ itkGetConstMacro(RefreshRate, unsigned int);
/**
* \brief Starts the tracking.
*
* After StartTracking() is called,
* the tools will move on their spline paths with a constant velocity that can be set with
* SetToolSpeed(). The standard velocity is 10 seconds for one complete cycle along the spline path.
* \warning tool speed is not yet used in the current version
* \return Returns true if the tracking is started. Returns false if there was an error.
*/
bool StartTracking() override;
/**
* \brief Stops the tracking.
* \return Returns true if the tracking is stopped. Returns false if there was an error.
*/
bool StopTracking() override;
/**
* \brief Opens the connection to the device. This have to be done before the tracking is started.
* @throw mitk::IGTException Throws an exception if there are two less control points to start the the virtual device.
*/
bool OpenConnection() override;
/**
* \brief Closes the connection and clears all resources.
*/
bool CloseConnection() override;
/**
* \return Returns the number of tools which have been added to the device.
*/
unsigned int GetToolCount() const override;
/**
* \param toolNumber The number of the tool which should be given back.
* \return Returns the tool which the number "toolNumber". Returns nullptr, if there is
* no tool with this number.
*/
TrackingTool* GetTool(unsigned int toolNumber) const override;
/**
* \brief Adds a tool to the tracking device.
*
* The tool will have a random path on which it will move around. The path is created with a
* spline function and random control points inside the tracking volume.
*
* \param toolName The tool which will be added.
* \return Returns true if the tool has been added, false otherwise.
*/
TrackingTool* AddTool(const char* toolName);
/**
* \brief Set the tracking volume bounds
*
* This will set the tracking volume as an axis aligned bounding box
* defined by the six bounds values xMin, xMax, yMin, yMax, zMin, zMax.
* Note that the random path of existing tools will not be updated with the new
* tracking volume. Tools that are created after calling SetBounds() will use the
* new tracking volume
*/
itkSetVectorMacro(Bounds, mitk::ScalarType, 6);
/**
* \brief return the tracking volume bounds
*
* This will return the tracking volume as an axis aligned bounding box
* defined by the six bounds values xMin, xMax, yMin, yMax, zMin, zMax
*/
const mitk::ScalarType* GetBounds() const
{
return m_Bounds;
};
/**
* \brief return the approximate length of the spline for tool with index idx in millimeter
*
* if the index idx is not a
* valid tool index, a std::invalid_argument exception is thrown.
* GetSplineChordLength() returns the distance between all control points of the
* spline in millimeter. This can be used as an approximation for the length of the spline path.
*/
mitk::ScalarType GetSplineChordLength(unsigned int idx);
/**
* \brief sets the speed of the tool idx in rounds per second
*
* The virtual tools will travel along a closed spline path.
* This method sets the speed of a tool as a factor of how many rounds per second
* the tool should move. A setting of 1.0 will indicate one complete round per second.
* Together with GetSplineChordLength(), the speed in millimeter per second can be estimated.
* roundsPerSecond must be positive and larger than 0.0001.
* \warning Tool speed is currently not used.
* \TODO: use tool speed
*/
void SetToolSpeed(unsigned int idx, mitk::ScalarType roundsPerSecond);
/**
* \brief enable addition of Gaussian Noise to tracking coordinates
*/
void EnableGaussianNoise();
/**
* \brief disable addition of Gaussian Noise to Trackin coordinates
*/
void DisableGaussianNoise();
/**
* \brief sets the mean distribution and the standard deviation for the Gaussian Noise
*
*/
void SetParamsForGaussianNoise(double meanDistribution, double deviationDistribution);
/**
* \brief returns the mean distribution for the Gaussian Noise
*/
double GetMeanDistribution();
/**
* \brief returns the deviation distribution for the Gaussian Noise
*/
double GetDeviationDistribution();
protected:
VirtualTrackingDevice();
~VirtualTrackingDevice() override;
/**
* \brief This method tracks tools as long as the variable m_Mode is set to "Tracking".
* Tracking tools means generating random numbers for the tool position and orientation.
* @throw mitk::IGTException Throws an mitk::IGTException if there is an error during virtual tool tracking.
*/
void TrackTools();
void InitializeSpline(mitk::VirtualTrackingTool* t); ///< initializes the spline path of the tool t with random control points inside the current tracking volume
static ITK_THREAD_RETURN_TYPE ThreadStartTracking(void* data); ///< static start method for tracking thread
typedef mitk::VirtualTrackingTool::SplineType::ControlPointType ControlPointType;
ControlPointType GetRandomPoint(); ///< returns a random position inside the tracking volume (defined by m_Bounds)
mitk::VirtualTrackingTool* GetInternalTool(unsigned int idx);
typedef std::vector<VirtualTrackingTool::Pointer> ToolContainer; ///< container type for tracking tools
ToolContainer m_AllTools; ///< container for all tracking tools
itk::FastMutexLock::Pointer m_ToolsMutex; ///< mutex for coordinated access of tool container
itk::MultiThreader::Pointer m_MultiThreader; ///< MultiThreader that starts continuous tracking update
int m_ThreadID;
unsigned int m_RefreshRate; ///< refresh rate of the internal tracking thread in milliseconds (NOT refreshs per second!)
unsigned int m_NumberOfControlPoints; ///< number of control points for the random path generation
mitk::ScalarType m_Bounds[6]; ///< bounding box of the tracking volume stored as {xMin, xMax, yMin, yMax, zMin, zMax}
bool m_GaussianNoiseEnabled; ///< adding Gaussian Noise to tracking coordinates or not, false by default
double m_MeanDistributionParam; /// mean distribution for Gaussion Noise, 0.0 by default
double m_DeviationDistributionParam; ///< deviation distribution for Gaussian Noise, 1.0 by default
};
}//mitk
#endif /* MITKVIRTUALTRACKINGDEVICE_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGTBase/include/mitkLinuxRealTimeClock.h b/Modules/IGTBase/include/mitkLinuxRealTimeClock.h
index aa0076c604..3b6dee7787 100644
--- a/Modules/IGTBase/include/mitkLinuxRealTimeClock.h
+++ b/Modules/IGTBase/include/mitkLinuxRealTimeClock.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKLINUXREALTIMECLOCK_H_HEADER_INCLUDED_
#define MITKLINUXREALTIMECLOCK_H_HEADER_INCLUDED_
#include "mitkRealTimeClock.h"
#include "MitkIGTBaseExports.h"
namespace mitk {
/**
* \brief RealTimeClock for linux-systems
*
* This class provides realtimeclock for linux-systems.
* It uses gettimeofday to acquire a current time-value as accurately
* as possible.
*
* \return Returns the current time since the Epoch (01.01.1970) in milliseconds as a double
*
* \ingroup IGT
*/
class MITKIGTBASE_EXPORT LinuxRealTimeClock : public RealTimeClock
{
public:
mitkClassMacro(mitk::LinuxRealTimeClock, mitk::RealTimeClock);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* \brief basic contructor
*/
LinuxRealTimeClock();
/**
* \brief basic contructor
*/
~LinuxRealTimeClock() override;
/**
* \brief returns the current time in milliseconds as a double
*/
double GetCurrentStamp() override;
}; //namespace
}
#endif /* MITKLINUXREALTIMECLOCK_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGTBase/include/mitkWindowsRealTimeClock.h b/Modules/IGTBase/include/mitkWindowsRealTimeClock.h
index 7841c3351c..f3e71427c3 100644
--- a/Modules/IGTBase/include/mitkWindowsRealTimeClock.h
+++ b/Modules/IGTBase/include/mitkWindowsRealTimeClock.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKWINDOWSREALTIMECLOCK_H_HEADER_INCLUDED_
#define MITKWINDOWSREALTIMECLOCK_H_HEADER_INCLUDED_
#include "MitkIGTBaseExports.h"
#include "mitkRealTimeClock.h"
namespace mitk {
/**
* \brief realtimeclock implementation for windows-systems
*
* This class provides a RealTimeClock for windows-systems.
* Internally, it uses the QueryPerformanceCounter and the QueryPerformaceFrequency.
* It polls the current tick-counter, that counts from bootup.
* is supposed to be the most accurate time you can get on a windows-system.
*
* \ingroup Navigation
*/
class MITKIGTBASE_EXPORT WindowsRealTimeClock : public RealTimeClock
{
public:
mitkClassMacro(WindowsRealTimeClock, mitk::RealTimeClock);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* \brief basic contructor
*/
WindowsRealTimeClock();
/**
* \brief basic destructor
*/
virtual ~WindowsRealTimeClock();
/**
* \brief returns the current time in milliseconds as a double
*
* Uses the QueryPerformanceCounter to acquire an accurate time.
* (Ticks counted / Frequency) = time in ms
*/
virtual double GetCurrentStamp();
/**
* \brief returns the QueryPerformanceFrequency
*/
virtual LARGE_INTEGER GetFrequency();
protected:
void SetFrequency();
/**
* \brief Frequency needed to calculate time from tick-counter
*/
LARGE_INTEGER m_Frequency;
}; //namespace
}
#endif /* MITKWINDOWSREALTIMECLOCK_H_HEADER_INCLUDED_ */
diff --git a/Modules/IGTUI/files.cmake b/Modules/IGTUI/files.cmake
index 5773331a13..5c6808a6d6 100644
--- a/Modules/IGTUI/files.cmake
+++ b/Modules/IGTUI/files.cmake
@@ -1,113 +1,112 @@
set(CPP_FILES
Qmitk/QmitkTrackingDeviceWidget.cpp
Qmitk/QmitkTrackingDeviceConfigurationWidget.cpp
Qmitk/QmitkNDIConfigurationWidget.cpp
Qmitk/QmitkFiducialRegistrationWidget.cpp
Qmitk/QmitkNDIToolDelegate.cpp
Qmitk/QmitkNavigationToolManagementWidget.cpp
Qmitk/QmitkIGTLoggerWidget.cpp
Qmitk/QmitkUpdateTimerWidget.cpp
Qmitk/QmitkToolDistanceWidget.cpp
Qmitk/QmitkToolTrackingStatusWidget.cpp
Qmitk/QmitkTrackingSourcesCheckBoxPanelWidget.cpp
Qmitk/QmitkIGTPlayerWidget.cpp
Qmitk/QmitkIGTConnectionWidget.cpp
Qmitk/QmitkToolSelectionWidget.cpp
Qmitk/QmitkNavigationToolCreationWidget.cpp
Qmitk/QmitkNavigationDataSourceSelectionWidget.cpp
Qmitk/QmitkInteractiveTransformationWidget.cpp
Qmitk/QmitkNavigationToolStorageSelectionWidget.cpp
Qmitk/QmitkNavigationDataPlayerControlWidget.cpp
Qmitk/QmitkNavigationDataSequentialPlayerControlWidget.cpp
Qmitk/QmitkNDIAuroraWidget.cpp
Qmitk/QmitkNDIPolarisWidget.cpp
Qmitk/QmitkMicronTrackerWidget.cpp
Qmitk/QmitkNPOptitrackWidget.cpp
Qmitk/QmitkVirtualTrackerWidget.cpp
Qmitk/QmitkOpenIGTLinkWidget.cpp
Qmitk/mitkTrackingDeviceWidgetCollection.cpp
Qmitk/QmitkTrackingDeviceConfigurationWidgetScanPortsWorker.cpp
Qmitk/QmitkTrackingDeviceConfigurationWidgetConnectionWorker.cpp
Qmitk/QmitkNDIAbstractDeviceWidget.cpp
Qmitk/QmitkAbstractTrackingDeviceWidget.cpp
Qmitk/QmitkIGTCommonHelper.cpp
)
set(UI_FILES
Qmitk/QmitkNavigationToolManagementWidgetControls.ui
Qmitk/QmitkTrackingDeviceConfigurationWidgetControls.ui
Qmitk/QmitkNDIConfigurationWidget.ui
Qmitk/QmitkFiducialRegistrationWidget.ui
Qmitk/QmitkIGTLoggerWidgetControls.ui
Qmitk/QmitkUpdateTimerWidgetControls.ui
Qmitk/QmitkToolDistanceWidgetControls.ui
Qmitk/QmitkToolTrackingStatusWidgetControls.ui
Qmitk/QmitkTrackingSourcesCheckBoxPanelWidgetControls.ui
Qmitk/QmitkIGTPlayerWidgetControls.ui
Qmitk/QmitkIGTConnectionWidgetControls.ui
Qmitk/QmitkToolSelectionWidgetControls.ui
Qmitk/QmitkNavigationToolCreationWidget.ui
Qmitk/QmitkNavigationDataSourceSelectionWidgetControls.ui
Qmitk/QmitkInteractiveTransformationWidgetControls.ui
Qmitk/QmitkNavigationToolStorageSelectionWidgetControls.ui
Qmitk/QmitkNavigationDataPlayerControlWidget.ui
Qmitk/QmitkNavigationDataSequentialPlayerControlWidget.ui
Qmitk/QmitkNDIAuroraWidget.ui
Qmitk/QmitkNDIPolarisWidget.ui
Qmitk/QmitkMicronTrackerWidget.ui
Qmitk/QmitkNPOptitrackWidget.ui
Qmitk/QmitkVirtualTrackerWidget.ui
Qmitk/QmitkOpenIGTLinkWidget.ui
)
set(MOC_H_FILES
Qmitk/QmitkNavigationToolManagementWidget.h
Qmitk/QmitkTrackingDeviceWidget.h
Qmitk/QmitkTrackingDeviceConfigurationWidget.h
Qmitk/QmitkNDIConfigurationWidget.h
Qmitk/QmitkFiducialRegistrationWidget.h
Qmitk/QmitkNDIToolDelegate.h
Qmitk/QmitkIGTLoggerWidget.h
Qmitk/QmitkUpdateTimerWidget.h
Qmitk/QmitkToolDistanceWidget.h
Qmitk/QmitkToolTrackingStatusWidget.h
Qmitk/QmitkTrackingSourcesCheckBoxPanelWidget.h
Qmitk/QmitkIGTPlayerWidget.h
Qmitk/QmitkIGTConnectionWidget.h
Qmitk/QmitkToolSelectionWidget.h
Qmitk/QmitkNavigationToolCreationWidget.h
Qmitk/QmitkNavigationDataSourceSelectionWidget.h
Qmitk/QmitkInteractiveTransformationWidget.h
Qmitk/QmitkNavigationToolStorageSelectionWidget.h
Qmitk/QmitkNavigationDataPlayerControlWidget.h
Qmitk/QmitkNavigationDataSequentialPlayerControlWidget.h
Qmitk/QmitkNDIAuroraWidget.h
Qmitk/QmitkNDIPolarisWidget.h
Qmitk/QmitkMicronTrackerWidget.h
Qmitk/QmitkNPOptitrackWidget.h
Qmitk/QmitkVirtualTrackerWidget.h
Qmitk/QmitkOpenIGTLinkWidget.h
Qmitk/QmitkTrackingDeviceConfigurationWidgetScanPortsWorker.h
Qmitk/QmitkTrackingDeviceConfigurationWidgetConnectionWorker.h
Qmitk/QmitkNDIAbstractDeviceWidget.h
Qmitk/QmitkAbstractTrackingDeviceWidget.h
- Qmitk/QmitkIGTCommonHelper.h
)
if(MITK_USE_POLHEMUS_TRACKER)
set(CPP_FILES ${CPP_FILES} Qmitk/QmitkPolhemusTrackerWidget.cpp)
set(UI_FILES ${UI_FILES} Qmitk/QmitkPolhemusTrackerWidget.ui)
set(MOC_H_FILES ${MOC_H_FILES} Qmitk/QmitkPolhemusTrackerWidget.h)
endif(MITK_USE_POLHEMUS_TRACKER)
set(QRC_FILES
resources/IGTUI.qrc
)
diff --git a/Modules/IOExt/Internal/mitkIOExtObjectFactory.h b/Modules/IOExt/Internal/mitkIOExtObjectFactory.h
index 631fa8f294..3ac2264d7f 100644
--- a/Modules/IOExt/Internal/mitkIOExtObjectFactory.h
+++ b/Modules/IOExt/Internal/mitkIOExtObjectFactory.h
@@ -1,49 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef COREEXTOBJECTFACTORY_H_INCLUDED
#define COREEXTOBJECTFACTORY_H_INCLUDED
#include "mitkCoreObjectFactoryBase.h"
namespace mitk
{
class IOExtObjectFactory : public CoreObjectFactoryBase
{
public:
- mitkClassMacro(IOExtObjectFactory, CoreObjectFactoryBase) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(IOExtObjectFactory, CoreObjectFactoryBase);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
void SetDefaultProperties(mitk::DataNode *node) override;
const char *GetFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap() override;
const char *GetSaveFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap() override;
private:
IOExtObjectFactory();
~IOExtObjectFactory() override;
void CreateFileExtensionsMap();
MultimapType m_FileExtensionsMap;
MultimapType m_SaveFileExtensionsMap;
itk::ObjectFactoryBase::Pointer m_ParRecFileIOFactory;
itk::ObjectFactoryBase::Pointer m_VtkUnstructuredGridIOFactory;
itk::ObjectFactoryBase::Pointer m_StlVolumeTimeSeriesIOFactory;
itk::ObjectFactoryBase::Pointer m_VtkVolumeTimeSeriesIOFactory;
itk::ObjectFactoryBase::Pointer m_UnstructuredGridVtkWriterFactory;
};
}
#endif
diff --git a/Modules/IOExt/Internal/mitkParRecFileReader.h b/Modules/IOExt/Internal/mitkParRecFileReader.h
index c88615c87f..b83c244c61 100644
--- a/Modules/IOExt/Internal/mitkParRecFileReader.h
+++ b/Modules/IOExt/Internal/mitkParRecFileReader.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef PARRECFILEREADER_H_HEADER_INCLUDED_C1F48A22
#define PARRECFILEREADER_H_HEADER_INCLUDED_C1F48A22
#include "mitkCommon.h"
#include "mitkFileReader.h"
#include "mitkImageSource.h"
namespace mitk
{
//##Documentation
//## @brief Reader to read files in Philips PAR/REC file format
class ParRecFileReader : public ImageSource, public FileReader
{
public:
mitkClassMacro(ParRecFileReader, FileReader);
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkSetStringMacro(FileName);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkSetStringMacro(FileName);
itkGetStringMacro(FileName);
itkSetStringMacro(FilePrefix);
itkGetStringMacro(FilePrefix);
itkSetStringMacro(FilePattern);
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
protected:
void GenerateData() override;
void GenerateOutputInformation() override;
ParRecFileReader();
~ParRecFileReader() override;
//##Description
//## @brief Time when Header was last read
itk::TimeStamp m_ReadHeaderTime;
protected:
std::string m_FileName;
std::string m_RecFileName;
std::string m_FilePrefix;
std::string m_FilePattern;
};
} // namespace mitk
#endif /* PARRECFILEREADER_H_HEADER_INCLUDED_C1F48A22 */
diff --git a/Modules/IOExt/Internal/mitkStlVolumeTimeSeriesReader.h b/Modules/IOExt/Internal/mitkStlVolumeTimeSeriesReader.h
index 3fb1582f0f..ade0900ff5 100644
--- a/Modules/IOExt/Internal/mitkStlVolumeTimeSeriesReader.h
+++ b/Modules/IOExt/Internal/mitkStlVolumeTimeSeriesReader.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _Stl_VOLUME_TIME_SERIES_READER__H_
#define _Stl_VOLUME_TIME_SERIES_READER__H_
#include "mitkCommon.h"
#include "mitkFileSeriesReader.h"
#include "mitkSurfaceSource.h"
namespace mitk
{
//##Documentation
//## @brief Reader to read a series of volume files in stl-format
class StlVolumeTimeSeriesReader : public SurfaceSource, public FileSeriesReader
{
public:
mitkClassMacro(StlVolumeTimeSeriesReader, FileSeriesReader);
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkSetStringMacro(FileName);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkSetStringMacro(FileName);
itkGetStringMacro(FileName);
itkSetStringMacro(FilePrefix);
itkGetStringMacro(FilePrefix);
itkSetStringMacro(FilePattern);
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
protected:
void GenerateData() override;
StlVolumeTimeSeriesReader();
~StlVolumeTimeSeriesReader() override;
//##Description
//## @brief Time when Header was last read
itk::TimeStamp m_ReadHeaderTime;
};
} // namespace mitk
#endif
diff --git a/Modules/IOExt/Internal/mitkUnstructuredGridVtkWriter.h b/Modules/IOExt/Internal/mitkUnstructuredGridVtkWriter.h
index da2c281512..50ca0dd2fd 100644
--- a/Modules/IOExt/Internal/mitkUnstructuredGridVtkWriter.h
+++ b/Modules/IOExt/Internal/mitkUnstructuredGridVtkWriter.h
@@ -1,137 +1,139 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_UNSTRUCTURED_GRID_VTK_WRITER__H_
#define _MITK_UNSTRUCTURED_GRID_VTK_WRITER__H_
#include <itkProcessObject.h>
#include <mitkFileWriterWithInformation.h>
#include <vtkUnstructuredGridWriter.h>
#include <vtkXMLPUnstructuredGridWriter.h>
#include <vtkXMLUnstructuredGridWriter.h>
#include "mitkUnstructuredGrid.h"
namespace mitk
{
/**
* @brief VTK-based writer for mitk::UnstructuredGrid
*
* The mitk::UnstructuredGrid is written using the VTK-writer-type provided as the
* template argument. If the mitk::UnstructuredGrid contains multiple points of
* time, multiple files are written. The life-span (time-bounds) of each
* each point of time is included in the filename according to the
* following scheme:
* &lt;filename&gt;_S&lt;timebounds[0]&gt;E&lt;timebounds[1]&gt;_T&lt;framenumber&gt;
* (S=start, E=end, T=time).
* Writing of multiple files according to a given filename pattern is not
* yet supported.
*/
template <class VTKWRITER>
class UnstructuredGridVtkWriter : public mitk::FileWriterWithInformation
{
public:
mitkClassMacro(UnstructuredGridVtkWriter, mitk::FileWriterWithInformation);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
mitkWriterMacro;
/**
* Sets the filename of the file to write.
* @param _arg the name of the file to write.
*/
itkSetStringMacro(FileName);
/**
* @returns the name of the file to be written to disk.
*/
itkGetStringMacro(FileName);
/**
* @warning multiple write not (yet) supported
*/
itkSetStringMacro(FilePrefix);
/**
* @warning multiple write not (yet) supported
*/
itkGetStringMacro(FilePrefix);
/**
* @warning multiple write not (yet) supported
*/
itkSetStringMacro(FilePattern);
/**
* @warning multiple write not (yet) supported
*/
itkGetStringMacro(FilePattern);
using FileWriter::SetInput;
/**
* Sets the 0'th input object for the filter.
* @param input the first input for the filter.
*/
void SetInput(BaseData *input);
/**
* @returns the 0'th input object of the filter.
*/
const UnstructuredGrid *GetInput();
/**
* Returns false if an error happened during writing
*/
itkGetMacro(Success, bool);
/**
* @brief Return the possible file extensions for the data type associated with the writer
*/
std::vector<std::string> GetPossibleFileExtensions() override;
std::string GetSupportedBaseData() const override { return UnstructuredGrid::GetStaticNameOfClass(); }
// FileWriterWithInformation methods
const char *GetDefaultFilename() override;
const char *GetFileDialogPattern() override;
const char *GetDefaultExtension() override;
bool CanWriteBaseDataType(BaseData::Pointer data) override;
void DoWrite(BaseData::Pointer data) override;
protected:
/**
* Constructor.
*/
UnstructuredGridVtkWriter();
/**
* Virtual destructor.
*/
~UnstructuredGridVtkWriter() override;
void ExecuteWrite(VTKWRITER *vtkWriter);
void GenerateData() override;
std::string m_FileName;
std::string m_FilePrefix;
std::string m_FilePattern;
bool m_Success;
};
}
#endif // _MITK_UNSTRUCTURED_GRID_VTK_WRITER__H_
diff --git a/Modules/IOExt/Internal/mitkUnstructuredGridVtkWriterFactory.h b/Modules/IOExt/Internal/mitkUnstructuredGridVtkWriterFactory.h
index 684f12b1dc..996f95fb32 100644
--- a/Modules/IOExt/Internal/mitkUnstructuredGridVtkWriterFactory.h
+++ b/Modules/IOExt/Internal/mitkUnstructuredGridVtkWriterFactory.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef UNSTRUCTURED_GRID_WRITERFACTORY_H_HEADER_INCLUDED
#define UNSTRUCTURED_GRID_WRITERFACTORY_H_HEADER_INCLUDED
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"
namespace mitk
{
class UnstructuredGridVtkWriterFactory : public itk::ObjectFactoryBase
{
public:
- mitkClassMacroItkParent(mitk::UnstructuredGridVtkWriterFactory, itk::ObjectFactoryBase)
+ mitkClassMacroItkParent(mitk::UnstructuredGridVtkWriterFactory, itk::ObjectFactoryBase);
/** Class methods used to interface with the registered factories. */
const char *GetITKSourceVersion(void) const override;
const char *GetDescription(void) const override;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
/**
* Register one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void RegisterOneFactory(void))
{
static bool IsRegistered = false;
if (!IsRegistered)
{
UnstructuredGridVtkWriterFactory::Pointer ugVtkWriterFactory = UnstructuredGridVtkWriterFactory::New();
ObjectFactoryBase::RegisterFactory(ugVtkWriterFactory);
IsRegistered = true;
}
}
protected:
UnstructuredGridVtkWriterFactory();
~UnstructuredGridVtkWriterFactory() override;
private:
UnstructuredGridVtkWriterFactory(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
#endif // UNSTRUCTURED_GRID_WRITERFACTORY_H_HEADER_INCLUDED
diff --git a/Modules/IOExt/Internal/mitkVtkVolumeTimeSeriesReader.h b/Modules/IOExt/Internal/mitkVtkVolumeTimeSeriesReader.h
index 095ca62e43..bcd6d49847 100644
--- a/Modules/IOExt/Internal/mitkVtkVolumeTimeSeriesReader.h
+++ b/Modules/IOExt/Internal/mitkVtkVolumeTimeSeriesReader.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _Vtk_VOLUME_TIME_SERIES_READER__H_
#define _Vtk_VOLUME_TIME_SERIES_READER__H_
#include "mitkCommon.h"
#include "mitkFileSeriesReader.h"
#include "mitkSurfaceSource.h"
namespace mitk
{
//##Documentation
//## @brief Reader to read a series of volume files in Vtk-format
class VtkVolumeTimeSeriesReader : public SurfaceSource, public FileSeriesReader
{
public:
mitkClassMacro(VtkVolumeTimeSeriesReader, FileReader);
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkSetStringMacro(FileName);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkSetStringMacro(FileName);
itkGetStringMacro(FileName);
itkSetStringMacro(FilePrefix);
itkGetStringMacro(FilePrefix);
itkSetStringMacro(FilePattern);
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
protected:
void GenerateData() override;
VtkVolumeTimeSeriesReader();
~VtkVolumeTimeSeriesReader() override;
//##Description
//## @brief Time when Header was last read
itk::TimeStamp m_ReadHeaderTime;
};
} // namespace mitk
#endif
diff --git a/Modules/ImageDenoising/itkLocalVariationImageFilter.h b/Modules/ImageDenoising/itkLocalVariationImageFilter.h
index 5270b407a4..ed72c320b0 100644
--- a/Modules/ImageDenoising/itkLocalVariationImageFilter.h
+++ b/Modules/ImageDenoising/itkLocalVariationImageFilter.h
@@ -1,109 +1,110 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __itkLocalVariationImageFilter_h
#define __itkLocalVariationImageFilter_h
#include "itkImage.h"
#include "itkImageToImageFilter.h"
namespace itk
{
template <class TPixelType>
class SquaredEuclideanMetric
{
public:
static double Calc(TPixelType p);
};
/** \class LocalVariationImageFilter
* \brief Calculates the local variation in each pixel
*
* Reference: Tony F. Chan et al., The digital TV filter and nonlinear denoising
*
* \sa Image
* \sa Neighborhood
* \sa NeighborhoodOperator
* \sa NeighborhoodIterator
*
* \ingroup IntensityImageFilters
*/
template <class TInputImage, class TOutputImage>
class LocalVariationImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
{
public:
/** Extract dimension from input and output image. */
itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
/** Convenient typedefs for simplifying declarations. */
typedef TInputImage InputImageType;
typedef TOutputImage OutputImageType;
/** Standard class typedefs. */
typedef LocalVariationImageFilter Self;
typedef ImageToImageFilter<InputImageType, OutputImageType> Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(LocalVariationImageFilter, ImageToImageFilter);
/** Image typedef support. */
typedef typename InputImageType::PixelType InputPixelType;
typedef typename OutputImageType::PixelType OutputPixelType;
typedef typename InputImageType::RegionType InputImageRegionType;
typedef typename OutputImageType::RegionType OutputImageRegionType;
typedef typename InputImageType::SizeType InputSizeType;
/** MedianImageFilter needs a larger input requested region than
* the output requested region. As such, MedianImageFilter needs
* to provide an implementation for GenerateInputRequestedRegion()
* in order to inform the pipeline execution model.
*
* \sa ImageToImageFilter::GenerateInputRequestedRegion() */
void GenerateInputRequestedRegion() override;
protected:
LocalVariationImageFilter();
~LocalVariationImageFilter() override {}
void PrintSelf(std::ostream &os, Indent indent) const override;
/** MedianImageFilter can be implemented as a multithreaded filter.
* Therefore, this implementation provides a ThreadedGenerateData()
* routine which is called for each processing thread. The output
* image data is allocated automatically by the superclass prior to
* calling ThreadedGenerateData(). ThreadedGenerateData can only
* write to the portion of the output image specified by the
* parameter "outputRegionForThread"
*
* \sa ImageToImageFilter::ThreadedGenerateData(),
* ImageToImageFilter::GenerateData() */
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override;
private:
LocalVariationImageFilter(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkLocalVariationImageFilter.txx"
#endif
#endif // LocalVariationImageFilter
diff --git a/Modules/ImageDenoising/itkTotalVariationDenoisingImageFilter.h b/Modules/ImageDenoising/itkTotalVariationDenoisingImageFilter.h
index 8720a8d4f3..33a75de868 100644
--- a/Modules/ImageDenoising/itkTotalVariationDenoisingImageFilter.h
+++ b/Modules/ImageDenoising/itkTotalVariationDenoisingImageFilter.h
@@ -1,100 +1,101 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __itkTotalVariationDenoisingImageFilter_h
#define __itkTotalVariationDenoisingImageFilter_h
#include "itkCastImageFilter.h"
#include "itkImage.h"
#include "itkImageToImageFilter.h"
#include "itkTotalVariationSingleIterationImageFilter.h"
namespace itk
{
/** \class TotalVariationDenoisingImageFilter
* \brief Applies a total variation denoising filter to an image
*
* Reference: Tony F. Chan et al., The digital TV filter and nonlinear denoising
*
* \sa Image
* \sa Neighborhood
* \sa NeighborhoodOperator
* \sa NeighborhoodIterator
*
* \ingroup IntensityImageFilters
*/
template <class TInputImage, class TOutputImage>
class TotalVariationDenoisingImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
{
public:
/** Extract dimension from input and output image. */
itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
/** Convenient typedefs for simplifying declarations. */
typedef TInputImage InputImageType;
typedef TOutputImage OutputImageType;
/** Standard class typedefs. */
typedef TotalVariationDenoisingImageFilter Self;
typedef ImageToImageFilter<InputImageType, OutputImageType> Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(TotalVariationDenoisingImageFilter, ImageToImageFilter);
/** Image typedef support. */
typedef typename InputImageType::PixelType InputPixelType;
typedef typename OutputImageType::PixelType OutputPixelType;
typedef typename InputImageType::RegionType InputImageRegionType;
typedef typename OutputImageType::RegionType OutputImageRegionType;
typedef typename InputImageType::SizeType InputSizeType;
typedef TotalVariationSingleIterationImageFilter<TOutputImage, TOutputImage> SingleIterationFilterType;
typedef typename itk::CastImageFilter<TInputImage, TOutputImage> CastType;
itkSetMacro(Lambda, double);
itkGetMacro(Lambda, double);
itkSetMacro(NumberIterations, int);
itkGetMacro(NumberIterations, int);
protected:
TotalVariationDenoisingImageFilter();
~TotalVariationDenoisingImageFilter() override {}
void PrintSelf(std::ostream &os, Indent indent) const override;
void GenerateData() override;
double m_Lambda;
int m_NumberIterations;
private:
TotalVariationDenoisingImageFilter(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkTotalVariationDenoisingImageFilter.txx"
#endif
#endif //__itkTotalVariationDenoisingImageFilter__
diff --git a/Modules/ImageDenoising/itkTotalVariationSingleIterationImageFilter.h b/Modules/ImageDenoising/itkTotalVariationSingleIterationImageFilter.h
index e408161153..ff9c0c02e5 100644
--- a/Modules/ImageDenoising/itkTotalVariationSingleIterationImageFilter.h
+++ b/Modules/ImageDenoising/itkTotalVariationSingleIterationImageFilter.h
@@ -1,118 +1,119 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __itkTotalVariationSingleIterationImageFilter_h
#define __itkTotalVariationSingleIterationImageFilter_h
#include "itkImage.h"
#include "itkImageToImageFilter.h"
namespace itk
{
/** \class TotalVariationSingleIterationImageFilter
* \brief Applies a total variation denoising filter to an image
*
* Reference: Tony F. Chan et al., The digital TV filter and nonlinear denoising
*
* \sa Image
* \sa Neighborhood
* \sa NeighborhoodOperator
* \sa NeighborhoodIterator
*
* \ingroup IntensityImageFilters
*/
template <class TInputImage, class TOutputImage>
class TotalVariationSingleIterationImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
{
public:
/** Extract dimension from input and output image. */
itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
/** Convenient typedefs for simplifying declarations. */
typedef TInputImage InputImageType;
typedef TOutputImage OutputImageType;
typedef itk::Image<float, InputImageDimension> LocalVariationImageType;
/** Standard class typedefs. */
typedef TotalVariationSingleIterationImageFilter Self;
typedef ImageToImageFilter<InputImageType, OutputImageType> Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(TotalVariationSingleIterationImageFilter, ImageToImageFilter);
/** Image typedef support. */
typedef typename InputImageType::PixelType InputPixelType;
typedef typename OutputImageType::PixelType OutputPixelType;
typedef typename InputImageType::RegionType InputImageRegionType;
typedef typename OutputImageType::RegionType OutputImageRegionType;
typedef typename InputImageType::SizeType InputSizeType;
/** A larger input requested region than
* the output requested region is required.
* Therefore, an implementation for GenerateInputRequestedRegion()
* is provided.
*
* \sa ImageToImageFilter::GenerateInputRequestedRegion() */
void GenerateInputRequestedRegion() override;
itkSetMacro(Lambda, double);
itkGetMacro(Lambda, double);
void SetOriginalImage(InputImageType *in) { this->m_OriginalImage = in; }
typename InputImageType::Pointer GetOriginialImage() { return this->m_OriginalImage; }
protected:
TotalVariationSingleIterationImageFilter();
~TotalVariationSingleIterationImageFilter() override {}
void PrintSelf(std::ostream &os, Indent indent) const override;
/** MedianImageFilter can be implemented as a multithreaded filter.
* Therefore, this implementation provides a ThreadedGenerateData()
* routine which is called for each processing thread. The output
* image data is allocated automatically by the superclass prior to
* calling ThreadedGenerateData(). ThreadedGenerateData can only
* write to the portion of the output image specified by the
* parameter "outputRegionForThread"
*
* \sa ImageToImageFilter::ThreadedGenerateData(),
* ImageToImageFilter::GenerateData() */
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override;
void BeforeThreadedGenerateData() override;
typename LocalVariationImageType::Pointer m_LocalVariation;
typename InputImageType::Pointer m_OriginalImage;
double m_Lambda;
private:
TotalVariationSingleIterationImageFilter(const Self &);
void operator=(const Self &);
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkTotalVariationSingleIterationImageFilter.txx"
#endif
#endif //__itkTotalVariationSingleIterationImageFilter__
diff --git a/Modules/ImageDenoising/mitkBilateralFilter.h b/Modules/ImageDenoising/mitkBilateralFilter.h
index 964990e2fc..0e48dd42df 100644
--- a/Modules/ImageDenoising/mitkBilateralFilter.h
+++ b/Modules/ImageDenoising/mitkBilateralFilter.h
@@ -1,72 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkBilateralFilter_h
#define __mitkBilateralFilter_h
#include "MitkImageDenoisingExports.h"
// MITK
#include "mitkImageToImageFilter.h"
#include <itkImage.h>
#include <mitkImage.h>
namespace mitk
{
class MITKIMAGEDENOISING_EXPORT BilateralFilter : public ImageToImageFilter
{
public:
mitkClassMacro(BilateralFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkSetMacro(DomainSigma, float);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkSetMacro(DomainSigma, float);
itkSetMacro(RangeSigma, float);
itkSetMacro(AutoKernel, bool);
itkSetMacro(KernelRadius, unsigned int);
itkGetMacro(DomainSigma, float);
itkGetMacro(RangeSigma, float);
itkGetMacro(AutoKernel, bool);
itkGetMacro(KernelRadius, unsigned int);
protected:
/*!
\brief standard constructor
*/
BilateralFilter();
/*!
\brief standard destructor
*/
~BilateralFilter() override;
/*!
\brief Method generating the output information of this filter (e.g. image dimension, image type, etc.).
The interface ImageToImageFilter requires this implementation. Everything is taken from the input image.
*/
void GenerateOutputInformation() override;
/*!
\brief Method generating the output of this filter. Called in the updated process of the pipeline.
This method generates the smoothed output image.
*/
void GenerateData() override;
/*!
\brief Internal templated method calling the ITK bilteral filter. Here the actual filtering is performed.
*/
template <typename TPixel, unsigned int VImageDimension>
void ItkImageProcessing(const itk::Image<TPixel, VImageDimension> *itkImage);
float m_DomainSigma; /// Sigma of the gaussian kernel. See ITK docu
float m_RangeSigma; /// Sigma of the range mask kernel. See ITK docu
bool m_AutoKernel; // true: kernel size is calculated from DomainSigma. See ITK Doc; false: set by m_KernelRadius
unsigned int m_KernelRadius; // use in combination with m_AutoKernel = true
};
} // END mitk namespace
#endif
diff --git a/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilter.h b/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilter.h
index 6a7ede7531..e584d4202f 100644
--- a/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilter.h
+++ b/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilter.h
@@ -1,113 +1,113 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkExtractDirectedPlaneImageFilter_h_Included
#define mitkExtractDirectedPlaneImageFilter_h_Included
#include "mitkImageToImageFilter.h"
#include <MitkImageExtractionExports.h>
#include "mitkVtkResliceInterpolationProperty.h"
#include "vtkImageReslice.h"
#define setMacro(name, type) \
virtual void Set##name(type _arg) \
{ \
if (this->m_##name != _arg) \
{ \
this->m_##name = _arg; \
} \
}
#define getMacro(name, type) \
virtual type Get##name() { return m_##name; }
class vtkPoints;
namespace mitk
{
/**
\deprecated This class is deprecated. Use mitk::ExtractSliceFilter instead.
\sa ExtractSliceFilter
\brief Extracts a 2D slice of arbitrary geometry from a 3D or 4D image.
\sa mitkImageMapper2D
\ingroup ImageToImageFilter
This class takes a 3D or 4D mitk::Image as input and tries to extract one slice from it.
This slice can be arbitrary oriented in space. The 2D slice is resliced by a
vtk::ResliceImage filter if not perpendicular to the input image.
The world geometry of the plane to be extracted image must be given as an input
to the filter in order to correctly calculate world coordinates of the extracted slice.
Setting a timestep from which the plane should be extracted is optional.
Output will not be set if there was a problem extracting the desired slice.
Last contributor: $Author: T. Schwarz$
*/
class MITKIMAGEEXTRACTION_EXPORT ExtractDirectedPlaneImageFilter : public ImageToImageFilter
{
public:
mitkClassMacro(ExtractDirectedPlaneImageFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkSetMacro(WorldGeometry, PlaneGeometry *);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkSetMacro(WorldGeometry, PlaneGeometry *);
// The Reslicer is accessible to configure the desired interpolation;
// (See vtk::ImageReslice class for documentation).
// Misusage is at your own risk...
itkGetMacro(Reslicer, vtkImageReslice *);
// The target timestep in a 4D image from which the 2D plane is supposed
// to be extracted.
itkSetMacro(TargetTimestep, unsigned int);
itkGetMacro(TargetTimestep, unsigned int);
itkSetMacro(InPlaneResampleExtentByGeometry, bool);
itkGetMacro(InPlaneResampleExtentByGeometry, bool);
setMacro(ResliceInterpolationProperty, VtkResliceInterpolationProperty *);
itkGetMacro(ResliceInterpolationProperty, VtkResliceInterpolationProperty *);
setMacro(IsMapperMode, bool);
getMacro(IsMapperMode, bool);
protected:
ExtractDirectedPlaneImageFilter(); // purposely hidden
~ExtractDirectedPlaneImageFilter() override;
void GenerateData() override;
void GenerateOutputInformation() override;
bool CalculateClippedPlaneBounds(const BaseGeometry *boundingGeometry,
const PlaneGeometry *planeGeometry,
double *bounds);
bool LineIntersectZero(vtkPoints *points, int p1, int p2, double *bounds);
const PlaneGeometry *m_WorldGeometry;
vtkImageReslice *m_Reslicer;
unsigned int m_TargetTimestep;
bool m_InPlaneResampleExtentByGeometry;
int m_ThickSlicesMode;
int m_ThickSlicesNum;
bool m_IsMapperMode;
VtkResliceInterpolationProperty *m_ResliceInterpolationProperty;
};
} // namespace mitk
#endif // mitkExtractDirectedPlaneImageFilter_h_Included
diff --git a/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilterNew.h b/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilterNew.h
index c4d80cf1ab..db2c01511f 100644
--- a/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilterNew.h
+++ b/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilterNew.h
@@ -1,98 +1,99 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkExtractDirectedPlaneImageFilterNew_h_Included
#define mitkExtractDirectedPlaneImageFilterNew_h_Included
#include "itkImage.h"
#include "mitkITKImageImport.h"
#include "mitkImageToImageFilter.h"
#include <MitkImageExtractionExports.h>
namespace mitk
{
/**
\deprecated This class is deprecated. Use mitk::ExtractSliceFilter instead.
\sa ExtractSliceFilter
\brief A filter that can extract a 2D slice from a 3D or 4D image especially if the image`s axes are rotated
\sa ContourTool
\sa SegTool2D
\sa ExtractImageFilter
\sa OverwriteSliceImageFilter
\sa OverwriteDirectedPlaneImageFilter
\ingroup Process
\ingroup Reliver
There is a separate page describing the general design of QmitkInteractiveSegmentation: \ref
QmitkSegmentationTechnicalPage
This class takes an 3D or 4D mitk::Image as input and extracts a slice from it. If you work with a 4D image as input
you have to specify the
desired timestep at which the slice shall be extracted, otherwise the lowest given timestep is selected by default.
The special feature of this filter is, that the planes of the input image can be rotated in any way. To assure a
proper extraction you have to
set the currentWorldPlaneGeometry with you can obtain from the BaseRenderer, respectively the positionEvent send by
the renderer.
The output will not be set if there was a problem with the input image
$Author: fetzer $
*/
class MITKIMAGEEXTRACTION_EXPORT ExtractDirectedPlaneImageFilterNew : public ImageToImageFilter
{
public:
mitkClassMacro(ExtractDirectedPlaneImageFilterNew, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
\brief Set macro for the current worldgeometry
\a Parameter The current wordgeometry that describes the position (rotation, translation)
of the plane (and therefore the slice to be extracted) in our 3D(+t) image
*/
itkSetMacro(CurrentWorldPlaneGeometry, BaseGeometry *);
/**
* \deprecatedSince{2014_10} Please use SetCurrentWorldPlaneGeometry
*/
DEPRECATED(void SetCurrentWorldGeometry2D(BaseGeometry *geo)) { SetCurrentWorldPlaneGeometry(geo); };
itkSetMacro(ImageGeometry, BaseGeometry *);
/**
\brief Set macro for the current timestep
\a Parameter The timestep of the image from which the slice shall be extracted
*/
itkSetMacro(ActualInputTimestep, int);
protected:
ExtractDirectedPlaneImageFilterNew();
~ExtractDirectedPlaneImageFilterNew() override;
void GenerateData() override;
void GenerateOutputInformation() override;
private:
const BaseGeometry *m_CurrentWorldPlaneGeometry;
const BaseGeometry *m_ImageGeometry;
int m_ActualInputTimestep;
template <typename TPixel, unsigned int VImageDimension>
void ItkSliceExtraction(const itk::Image<TPixel, VImageDimension> *inputImage);
};
} // namespace
#endif
diff --git a/Modules/ImageExtraction/mitkExtractImageFilter.h b/Modules/ImageExtraction/mitkExtractImageFilter.h
index 513435797f..83b08e7009 100644
--- a/Modules/ImageExtraction/mitkExtractImageFilter.h
+++ b/Modules/ImageExtraction/mitkExtractImageFilter.h
@@ -1,110 +1,111 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkExtractImageFilter_h_Included
#define mitkExtractImageFilter_h_Included
#include "mitkCommon.h"
#include "mitkImageToImageFilter.h"
#include <MitkImageExtractionExports.h>
#include "itkImage.h"
namespace mitk
{
/**
\deprecated This class is deprecated. Use mitk::ExtractSliceFilter instead.
\sa ExtractSliceFilter
\brief Extracts a 2D slice from a 3D image.
\sa SegTool2D
\sa OverwriteSliceImageFilter
\ingroup Process
\ingroup ToolManagerEtAl
There is a separate page describing the general design of QmitkInteractiveSegmentation: \ref
QmitkSegmentationTechnicalPage
This class takes a 3D mitk::Image as input and tries to extract one slice from it.
Two parameters determine which slice is extracted: the "slice dimension" is that one, which is constant for all
points in the plane, e.g. axial would mean 2.
The "slice index" is the slice index in the image direction you specified with "affected dimension". Indices count
from zero.
Output will not be set if there was a problem extracting the desired slice.
Last contributor: $Author$
*/
class MITKIMAGEEXTRACTION_EXPORT ExtractImageFilter : public ImageToImageFilter
{
public:
mitkClassMacro(ExtractImageFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
\brief Which slice to extract (first one has index 0).
*/
itkSetMacro(SliceIndex, unsigned int);
itkGetConstMacro(SliceIndex, unsigned int);
/**
\brief The orientation of the slice to be extracted.
\a Parameter SliceDimension Number of the dimension which is constant for all pixels of the desired slice (e.g. 2
for axial)
*/
itkSetMacro(SliceDimension, unsigned int);
itkGetConstMacro(SliceDimension, unsigned int);
/**
\brief Time step of the image to be extracted.
*/
itkSetMacro(TimeStep, unsigned int);
itkGetConstMacro(TimeStep, unsigned int);
typedef enum DirectionCollapseStrategyEnum {
DIRECTIONCOLLAPSETOUNKOWN = 0,
DIRECTIONCOLLAPSETOIDENTITY = 1,
DIRECTIONCOLLAPSETOSUBMATRIX = 2,
DIRECTIONCOLLAPSETOGUESS = 3
} DIRECTIONCOLLAPSESTRATEGY;
/**
\brief Collapse strategy to be used.
*/
itkSetMacro(DirectionCollapseToStrategy, DIRECTIONCOLLAPSESTRATEGY);
itkGetConstMacro(DirectionCollapseToStrategy, DIRECTIONCOLLAPSESTRATEGY);
protected:
ExtractImageFilter(); // purposely hidden
~ExtractImageFilter() override;
void GenerateOutputInformation() override;
void GenerateInputRequestedRegion() override;
void GenerateData() override;
template <typename TPixel, unsigned int VImageDimension>
void ItkImageProcessing(const itk::Image<TPixel, VImageDimension> *image);
unsigned int m_SliceIndex;
unsigned int m_SliceDimension;
unsigned int m_TimeStep;
DIRECTIONCOLLAPSESTRATEGY m_DirectionCollapseToStrategy;
};
} // namespace
#endif
diff --git a/Modules/ImageStatistics/mitkHotspotMaskGenerator.h b/Modules/ImageStatistics/mitkHotspotMaskGenerator.h
index dbe0bbf1f1..724538410e 100644
--- a/Modules/ImageStatistics/mitkHotspotMaskGenerator.h
+++ b/Modules/ImageStatistics/mitkHotspotMaskGenerator.h
@@ -1,181 +1,179 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKHOTSPOTCALCULATOR_H
#define MITKHOTSPOTCALCULATOR_H
#include <itkObject.h>
#include <mitkImage.h>
#include <itkImage.h>
#include <itkTimeStamp.h>
#include <stdexcept>
#include <MitkImageStatisticsExports.h>
#include <mitkImageTimeSelector.h>
#include <mitkMaskGenerator.h>
namespace mitk
{
/**
* @brief The HotspotMaskGenerator class is used when a hotspot has to be found in an image. A hotspot is
* the region of the image where the mean intensity is maximal (=brightest spot). It is usually used in PET scans.
* The identification of the hotspot is done as follows: First a cubic (or circular, if image is 2d)
* mask of predefined size is generated. This mask is then convolved with the input image (in fourier domain).
* The maximum value of the convolved image then corresponds to the hotspot.
* If a maskGenerator is set, only the pixels of the convolved image where the corresponding mask is == @a label
* are searched for the maximum value.
*/
class MITKIMAGESTATISTICS_EXPORT HotspotMaskGenerator: public MaskGenerator
{
public:
/** Standard Self typedef */
typedef HotspotMaskGenerator Self;
typedef MaskGenerator Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
- itkNewMacro(Self)
-
- /** Runtime information support. */
- itkTypeMacro(HotspotMaskGenerator, MaskGenerator)
+ itkNewMacro(Self); /** Runtime information support. */
+ itkTypeMacro(HotspotMaskGenerator, MaskGenerator);
/**
@brief Set the input image. Required for this class
*/
void SetInputImage(mitk::Image::Pointer inputImage);
/**
@brief Set a mask (can be nullptr if no mask is desired)
*/
void SetMask(MaskGenerator::Pointer mask);
/**
@brief Set the radius of the hotspot (in MM)
*/
void SetHotspotRadiusInMM(double radiusInMillimeter);
const double& GetHotspotRadiusinMM() const;
/**
@brief Define whether the hotspot must be completely inside the image. Default is true
*/
void SetHotspotMustBeCompletelyInsideImage(bool hotspotCompletelyInsideImage);
bool GetHotspotMustBeCompletelyInsideImage() const;
/**
@brief If a maskGenerator is set, this detemines which mask value is used
*/
void SetLabel(unsigned short label);
/**
@brief Computes and returns the hotspot mask. The hotspot mask has the same size as the input image. The hopspot has value 1, the remaining pixels are set to 0
*/
mitk::Image::Pointer GetMask() override;
/**
@brief Returns the image index where the hotspot is located
*/
vnl_vector<int> GetHotspotIndex();
/**
@brief Returns the index where the convolution image is minimal (darkest spot in image)
*/
vnl_vector<int> GetConvolutionImageMinIndex();
/**
* @brief SetTimeStep is used to set the time step for which the mask is to be generated
* @param timeStep
*/
void SetTimeStep(unsigned int timeStep) override;
protected:
HotspotMaskGenerator();
~HotspotMaskGenerator() override;
class ImageExtrema
{
public:
bool Defined;
double Max;
double Min;
vnl_vector<int> MaxIndex;
vnl_vector<int> MinIndex;
ImageExtrema()
:Defined(false)
,Max(itk::NumericTraits<double>::min())
,Min(itk::NumericTraits<double>::max())
{
}
};
private:
/** \brief Returns size of convolution kernel depending on spacing and radius. */
template <unsigned int VImageDimension>
itk::Size<VImageDimension>
CalculateConvolutionKernelSize(double spacing[VImageDimension], double radiusInMM);
/** \brief Generates image of kernel which is needed for convolution. */
template <unsigned int VImageDimension>
itk::SmartPointer< itk::Image<float, VImageDimension> >
GenerateHotspotSearchConvolutionKernel(double spacing[VImageDimension], double radiusInMM);
/** \brief Convolves image with spherical kernel image. Used for hotspot calculation. */
template <typename TPixel, unsigned int VImageDimension>
itk::SmartPointer< itk::Image<TPixel, VImageDimension> >
GenerateConvolutionImage( const itk::Image<TPixel, VImageDimension>* inputImage );
/** \brief Fills pixels of the spherical hotspot mask. */
template < typename TPixel, unsigned int VImageDimension>
void
FillHotspotMaskPixels( itk::Image<TPixel, VImageDimension>* maskImage,
itk::Point<double, VImageDimension> sphereCenter,
double sphereRadiusInMM);
/** \brief */
template <typename TPixel, unsigned int VImageDimension>
void
CalculateHotspotMask(itk::Image<TPixel, VImageDimension>* inputImage,
typename itk::Image<unsigned short, VImageDimension>::Pointer maskImage,
unsigned int label);
template <typename TPixel, unsigned int VImageDimension >
ImageExtrema CalculateExtremaWorld( const itk::Image<TPixel, VImageDimension>* inputImage,
typename itk::Image<unsigned short, VImageDimension>::Pointer maskImage,
double neccessaryDistanceToImageBorderInMM,
unsigned int label);
bool IsUpdateRequired() const;
HotspotMaskGenerator(const HotspotMaskGenerator &);
HotspotMaskGenerator & operator=(const HotspotMaskGenerator &);
MaskGenerator::Pointer m_Mask;
mitk::Image::Pointer m_internalImage;
itk::Image<unsigned short, 2>::Pointer m_internalMask2D;
itk::Image<unsigned short, 3>::Pointer m_internalMask3D;
double m_HotspotRadiusinMM;
bool m_HotspotMustBeCompletelyInsideImage;
unsigned short m_Label;
vnl_vector<int> m_ConvolutionImageMinIndex, m_ConvolutionImageMaxIndex;
unsigned long m_InternalMaskUpdateTime;
};
}
#endif // MITKHOTSPOTCALCULATOR
diff --git a/Modules/ImageStatistics/mitkIgnorePixelMaskGenerator.h b/Modules/ImageStatistics/mitkIgnorePixelMaskGenerator.h
index 1b251671ed..08b70337fd 100644
--- a/Modules/ImageStatistics/mitkIgnorePixelMaskGenerator.h
+++ b/Modules/ImageStatistics/mitkIgnorePixelMaskGenerator.h
@@ -1,85 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKIGNOREPIXELMASKGEN_
#define MITKIGNOREPIXELMASKGEN_
#include <mitkImage.h>
#include <MitkImageStatisticsExports.h>
#include <mitkMaskGenerator.h>
#include <limits>
#include <itkImage.h>
namespace mitk
{
/**
* @brief The IgnorePixelMaskGenerator class is used to generate a mask that is zero for specific pixel values in the input image. This class requires an input image.
*/
class MITKIMAGESTATISTICS_EXPORT IgnorePixelMaskGenerator: public MaskGenerator
{
public:
/** Standard Self typedef */
typedef IgnorePixelMaskGenerator Self;
typedef MaskGenerator Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
typedef double RealType;
/** Method for creation through the object factory. */
- itkNewMacro(Self)
-
- /** Runtime information support. */
- itkTypeMacro(IgnorePixelMaskGenerator, MaskGenerator)
+ itkNewMacro(Self); /** Runtime information support. */
+ itkTypeMacro(IgnorePixelMaskGenerator, MaskGenerator);
/**
* @brief The mask will be 0 there inputImage==pixelValue and 1 otherwise
*/
void SetIgnoredPixelValue(RealType pixelValue);
/**
* @brief Computes and returns the mask
*/
mitk::Image::Pointer GetMask() override;
/**
* @brief SetTimeStep is used to set the time step for which the mask is to be generated
* @param timeStep
*/
void SetTimeStep(unsigned int timeStep) override;
protected:
IgnorePixelMaskGenerator():
m_IgnoredPixelValue(std::numeric_limits<RealType>::min())
{
m_TimeStep = 0;
m_InternalMaskUpdateTime = 0;
m_InternalMask = mitk::Image::New();
}
~IgnorePixelMaskGenerator() override{}
template <typename TPixel, unsigned int VImageDimension>
void InternalCalculateMask(typename itk::Image<TPixel, VImageDimension>* image);
private:
bool IsUpdateRequired() const;
RealType m_IgnoredPixelValue;
unsigned long m_InternalMaskUpdateTime;
};
}
#endif
diff --git a/Modules/ImageStatistics/mitkImageMaskGenerator.h b/Modules/ImageStatistics/mitkImageMaskGenerator.h
index 730732498f..eed0de6aa6 100644
--- a/Modules/ImageStatistics/mitkImageMaskGenerator.h
+++ b/Modules/ImageStatistics/mitkImageMaskGenerator.h
@@ -1,63 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkBinaryMaskGenerator
#define mitkBinaryMaskGenerator
#include <mitkImage.h>
#include <MitkImageStatisticsExports.h>
#include <mitkMaskGenerator.h>
#include <itkObject.h>
#include <itkSmartPointer.h>
namespace mitk
{
class MITKIMAGESTATISTICS_EXPORT ImageMaskGenerator: public MaskGenerator
{
public:
/** Standard Self typedef */
typedef ImageMaskGenerator Self;
typedef MaskGenerator Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
- itkNewMacro(Self)
-
- /** Runtime information support. */
- itkTypeMacro(BinaryImageMaskGenerator, MaskGenerator)
+ itkNewMacro(Self); /** Runtime information support. */
+ itkTypeMacro(BinaryImageMaskGenerator, MaskGenerator);
mitk::Image::Pointer GetMask() override;
void SetTimeStep(unsigned int timeStep) override;
void SetImageMask(mitk::Image::Pointer maskImage);
protected:
ImageMaskGenerator():Superclass(){
m_InternalMaskUpdateTime = 0;
m_InternalMask = mitk::Image::New();
}
private:
bool IsUpdateRequired() const;
void UpdateInternalMask();
mitk::Image::Pointer m_internalMaskImage;
unsigned long m_InternalMaskUpdateTime;
};
}
#endif
diff --git a/Modules/ImageStatistics/mitkImageStatisticsCalculator.h b/Modules/ImageStatistics/mitkImageStatisticsCalculator.h
index fb24c60b41..b3489707c5 100644
--- a/Modules/ImageStatistics/mitkImageStatisticsCalculator.h
+++ b/Modules/ImageStatistics/mitkImageStatisticsCalculator.h
@@ -1,122 +1,120 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKIMAGESTATISTICSCALCULATOR
#define MITKIMAGESTATISTICSCALCULATOR
#include <MitkImageStatisticsExports.h>
#include <mitkImage.h>
#include <mitkMaskGenerator.h>
#include <mitkImageStatisticsContainer.h>
namespace mitk
{
class MITKIMAGESTATISTICS_EXPORT ImageStatisticsCalculator: public itk::Object
{
public:
/** Standard Self typedef */
typedef ImageStatisticsCalculator Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
- itkNewMacro(Self)
-
- /** Runtime information support. */
- itkTypeMacro(ImageStatisticsCalculator_v2, itk::Object)
+ itkNewMacro(Self); /** Runtime information support. */
+ itkTypeMacro(ImageStatisticsCalculator_v2, itk::Object);
typedef double statisticsValueType;
typedef std::map<std::string, statisticsValueType> statisticsMapType;
typedef itk::Statistics::Histogram<double> HistogramType;
typedef unsigned short MaskPixelType;
using LabelIndex = ImageStatisticsContainer::LabelIndex;
/**Documentation
@brief Set the image for which the statistics are to be computed.*/
void SetInputImage(const mitk::Image* image);
/**Documentation
@brief Set the mask generator that creates the mask which is to be used to calculate statistics. If no more mask is desired simply set @param mask to nullptr*/
void SetMask(mitk::MaskGenerator* mask);
/**Documentation
@brief Set this if more than one mask should be applied (for instance if a IgnorePixelValueMask were to be used alongside with a segmentation).
Both masks are combined using pixel wise AND operation. The secondary mask does not have to be the same size than the primary but they need to have some overlap*/
void SetSecondaryMask(mitk::MaskGenerator* mask);
/**Documentation
@brief Set number of bins to be used for histogram statistics. If Bin size is set after number of bins, bin size will be used instead!*/
void SetNBinsForHistogramStatistics(unsigned int nBins);
/**Documentation
@brief Retrieve the number of bins used for histogram statistics. Careful: The return value does not indicate whether NBins or BinSize is used.
That solely depends on which parameter has been set last.*/
unsigned int GetNBinsForHistogramStatistics() const;
/**Documentation
@brief Set bin size to be used for histogram statistics. If nbins is set after bin size, nbins will be used instead!*/
void SetBinSizeForHistogramStatistics(double binSize);
/**Documentation
@brief Retrieve the bin size for histogram statistics. Careful: The return value does not indicate whether NBins or BinSize is used.
That solely depends on which parameter has been set last.*/
double GetBinSizeForHistogramStatistics() const;
/**Documentation
@brief Returns the statistics for label @a label. If these requested statistics are not computed yet the computation is done as well.
For performance reasons, statistics for all labels in the image are computed at once.
*/
ImageStatisticsContainer* GetStatistics(LabelIndex label=1);
protected:
ImageStatisticsCalculator(){
m_nBinsForHistogramStatistics = 100;
m_binSizeForHistogramStatistics = 10;
m_UseBinSizeOverNBins = false;
};
private:
//Calculates statistics for each timestep for image
template < typename TPixel, unsigned int VImageDimension > void InternalCalculateStatisticsUnmasked(
typename itk::Image< TPixel, VImageDimension >* image, const TimeGeometry* timeGeometry, TimeStepType timeStep);
template < typename TPixel, unsigned int VImageDimension > void InternalCalculateStatisticsMasked(
typename itk::Image< TPixel, VImageDimension >* image, const TimeGeometry* timeGeometry,
unsigned int timeStep);
template < typename TPixel, unsigned int VImageDimension >
double GetVoxelVolume(typename itk::Image<TPixel, VImageDimension>* image) const;
bool IsUpdateRequired(LabelIndex label) const;
mitk::Image::ConstPointer m_Image;
mitk::Image::Pointer m_ImageTimeSlice;
mitk::Image::ConstPointer m_InternalImageForStatistics;
mitk::MaskGenerator::Pointer m_MaskGenerator;
mitk::Image::Pointer m_InternalMask;
mitk::MaskGenerator::Pointer m_SecondaryMaskGenerator;
mitk::Image::Pointer m_SecondaryMask;
unsigned int m_nBinsForHistogramStatistics;
double m_binSizeForHistogramStatistics;
bool m_UseBinSizeOverNBins;
std::map<LabelIndex,ImageStatisticsContainer::Pointer> m_StatisticContainers;
};
}
#endif // MITKIMAGESTATISTICSCALCULATOR
diff --git a/Modules/ImageStatistics/mitkImageStatisticsContainer.h b/Modules/ImageStatistics/mitkImageStatisticsContainer.h
index 2948bca5b9..f9a3842d04 100644
--- a/Modules/ImageStatistics/mitkImageStatisticsContainer.h
+++ b/Modules/ImageStatistics/mitkImageStatisticsContainer.h
@@ -1,162 +1,162 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKIMAGESTATISTICSCONTAINER
#define MITKIMAGESTATISTICSCONTAINER
#include <MitkImageStatisticsExports.h>
#include <mitkBaseData.h>
#include <itkHistogram.h>
#include <mitkImageStatisticsConstants.h>
#include <boost/variant.hpp>
namespace mitk
{
/**
@brief Container class for storing a StatisticsObject for each timestep.
Stored statistics are:
- for the defined statistics, see GetAllStatisticNames
- Histogram of Pixel Values
*/
class MITKIMAGESTATISTICS_EXPORT ImageStatisticsContainer : public mitk::BaseData
{
public:
- mitkClassMacro(ImageStatisticsContainer, mitk::BaseData)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(ImageStatisticsContainer, mitk::BaseData);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
using HistogramType = itk::Statistics::Histogram<double>;
using RealType = double;
using LabelIndex = unsigned int;
using IndexType = vnl_vector<int>;
using VoxelCountType = unsigned long;
using StatisticsVariantType = boost::variant<RealType, VoxelCountType, IndexType >;
using StatisticsMapType = std::map < std::string, StatisticsVariantType>;
using StatisticsKeyType = std::string;
void SetRequestedRegionToLargestPossibleRegion() override {}
bool RequestedRegionIsOutsideOfTheBufferedRegion() override { return false; }
bool VerifyRequestedRegion() override { return true; }
void SetRequestedRegion(const itk::DataObject*) override {}
/**
@brief Container class for storing the computed image statistics.
@details The statistics are stored in a map <name,value> with value as boost::variant<RealType, VoxelCountType, IndexType >.
The type used to create the boost::variant is important as only this type can be recovered lateron.
*/
class MITKIMAGESTATISTICS_EXPORT ImageStatisticsObject {
public:
ImageStatisticsObject();
/**
@brief Adds a statistic to the statistics object
@details if already a statistic with that name is included, it is overwritten
*/
void AddStatistic(const std::string& key, StatisticsVariantType value);
using StatisticNameVector = std::vector<std::string>;
/**
@brief Returns the names of the default statistics
@details The order is derived from the image statistics plugin.
*/
static const StatisticNameVector& GetDefaultStatisticNames();
/**
@brief Returns the names of all custom statistics (defined at runtime and no default names).
*/
const StatisticNameVector& GetCustomStatisticNames() const;
/**
@brief Returns the names of all statistics (default and custom defined)
Additional custom keys are added at the end in a sorted order.
*/
StatisticNameVector GetAllStatisticNames() const;
StatisticNameVector GetExistingStatisticNames() const;
bool HasStatistic(const std::string& name) const;
/**
@brief Converts the requested value to the defined type
@param name defined string on creation (AddStatistic)
@exception if no statistics with key name was found.
*/
template <typename TType>
TType GetValueConverted(const std::string& name) const
{
auto value = GetValueNonConverted(name);
return boost::get<TType>(value);
}
/**
@brief Returns the requested value
@exception if no statistics with key name was found.
*/
StatisticsVariantType GetValueNonConverted(const std::string& name) const;
void Reset();
HistogramType::ConstPointer m_Histogram=nullptr;
private:
StatisticsMapType m_Statistics;
StatisticNameVector m_CustomNames;
static const StatisticNameVector m_DefaultNames;
};
using TimeStepMapType = std::map<TimeStepType, ImageStatisticsObject>;
unsigned int GetNumberOfTimeSteps() const;
/**
@brief Deletes all stored values*/
void Reset();
/**
@brief Returns the statisticObject for the given Timestep
@pre timeStep must be valid
*/
const ImageStatisticsObject& GetStatisticsForTimeStep(TimeStepType timeStep) const;
/**
@brief Sets the statisticObject for the given Timestep
@pre timeStep must be valid
*/
void SetStatisticsForTimeStep(TimeStepType timeStep, ImageStatisticsObject statistics);
/**
@brief Checks if the Time step exists
@pre timeStep must be valid
*/
bool TimeStepExists(TimeStepType timeStep) const;
protected:
ImageStatisticsContainer();
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
private:
itk::LightObject::Pointer InternalClone() const override;
void SetTimeStepMap(TimeStepMapType map);
TimeStepMapType m_TimeStepMap;
};
MITKIMAGESTATISTICS_EXPORT ImageStatisticsContainer::ImageStatisticsObject::StatisticNameVector GetAllStatisticNames(const ImageStatisticsContainer* container);
MITKIMAGESTATISTICS_EXPORT ImageStatisticsContainer::ImageStatisticsObject::StatisticNameVector GetAllStatisticNames(std::vector<ImageStatisticsContainer::ConstPointer> containers);
}
#endif // MITKIMAGESTATISTICSCONTAINER
diff --git a/Modules/ImageStatistics/mitkMaskGenerator.h b/Modules/ImageStatistics/mitkMaskGenerator.h
index b8a9253b87..76d976c777 100644
--- a/Modules/ImageStatistics/mitkMaskGenerator.h
+++ b/Modules/ImageStatistics/mitkMaskGenerator.h
@@ -1,78 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKMASKGENERATOR
#define MITKMASKGENERATOR
#include <MitkImageStatisticsExports.h>
#include <mitkImage.h>
#include <itkRegion.h>
#include <itkObject.h>
#include <itkSmartPointer.h>
namespace mitk
{
/**
* \class MaskGenerator
* \brief Base Class for all Mask Generators. Mask generators are classes that provide functionality for the
* creation of binary (or unsigned short) masks that can be applied to an image. See dervied classes for more
* information.
*/
class MITKIMAGESTATISTICS_EXPORT MaskGenerator: public itk::Object
{
public:
/** Standard Self typedef */
typedef MaskGenerator Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
- itkNewMacro(Self)
-
- /** Runtime information support. */
- itkTypeMacro(MaskGenerator, itk::Object)
+ itkNewMacro(Self); /** Runtime information support. */
+ itkTypeMacro(MaskGenerator, itk::Object);
//~MaskGenerator();
/**
* @brief GetMask must be overridden by derived classes.
* @return mitk::Image::Pointer of generated mask
*/
virtual mitk::Image::Pointer GetMask();
/**
* @brief GetReferenceImage per default returns the inputImage (as set by SetInputImage). If no input image is set it will return a nullptr.
*/
virtual mitk::Image::ConstPointer GetReferenceImage();
/**
* @brief SetInputImage is used to set the input image to the mask generator. Some subclasses require an input image, others don't. See the documentation of the specific Mask Generator for more information.
*/
void SetInputImage(mitk::Image::ConstPointer inputImg);
virtual void SetTimeStep(unsigned int timeStep);
protected:
MaskGenerator();
unsigned int m_TimeStep;
mitk::Image::Pointer m_InternalMask;
mitk::Image::ConstPointer m_inputImage;
private:
};
}
#endif // MITKMASKGENERATOR
diff --git a/Modules/ImageStatistics/mitkMaskUtilities.h b/Modules/ImageStatistics/mitkMaskUtilities.h
index 08965afab5..d8de340c32 100644
--- a/Modules/ImageStatistics/mitkMaskUtilities.h
+++ b/Modules/ImageStatistics/mitkMaskUtilities.h
@@ -1,81 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKMASKUTIL
#define MITKMASKUTIL
#include <MitkImageStatisticsExports.h>
#include <mitkImage.h>
#include <itkImage.h>
namespace mitk
{
/**
* @brief Utility class for mask operations. It checks whether an image and a mask are compatible (spacing, orientation, etc...)
* and it can also crop an image to the LargestPossibleRegion of the Mask
*/
template <class TPixel, unsigned int VImageDimension>
class MITKIMAGESTATISTICS_EXPORT MaskUtilities: public itk::Object
{
public:
/** Standard Self typedef */
typedef MaskUtilities Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
- itkNewMacro(Self)
-
- /** Runtime information support. */
- itkTypeMacro(MaskUtilities, itk::Object)
+ itkNewMacro(Self); /** Runtime information support. */
+ itkTypeMacro(MaskUtilities, itk::Object);
typedef itk::Image<TPixel, VImageDimension> ImageType;
typedef itk::Image<unsigned short, VImageDimension> MaskType;
/**
* @brief Set image
*/
void SetImage(ImageType* image);
/**
* @brief Set mask
*/
void SetMask(MaskType* mask);
/**
* @brief Checks whether mask and image are compatible for joint access (as via iterators).
* Spacing and direction must be the same between the two and they must be aligned. Also, the mask must be completely inside the image
*/
bool CheckMaskSanity();
/**
* @brief Crops the image to the LargestPossibleRegion of the mask
*/
typename itk::Image<TPixel, VImageDimension>::Pointer ExtractMaskImageRegion();
protected:
MaskUtilities(): m_Image(nullptr), m_Mask(nullptr){}
~MaskUtilities() override{}
private:
itk::Image<TPixel, VImageDimension>* m_Image;
itk::Image<unsigned short, VImageDimension>* m_Mask;
};
}
#ifndef ITK_MANUAL_INSTANTIATION
#include <mitkMaskUtilities.cpp>
#endif
#endif
diff --git a/Modules/ImageStatistics/mitkPlanarFigureMaskGenerator.h b/Modules/ImageStatistics/mitkPlanarFigureMaskGenerator.h
index 0c8898b46d..449c5c487f 100644
--- a/Modules/ImageStatistics/mitkPlanarFigureMaskGenerator.h
+++ b/Modules/ImageStatistics/mitkPlanarFigureMaskGenerator.h
@@ -1,145 +1,143 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPLANARFIGUREMASKGENERATOR
#define MITKPLANARFIGUREMASKGENERATOR
#include <MitkImageStatisticsExports.h>
#include <itkImage.h>
#include <itkVTKImageExport.h>
#include <itkVTKImageImport.h>
#include <mitkImage.h>
#include <mitkMaskGenerator.h>
#include <mitkPlanarFigure.h>
#include <vtkImageExport.h>
#include <vtkImageImport.h>
#include <vtkSmartPointer.h>
namespace mitk
{
/**
* \class PlanarFigureMaskGenerator
* \brief Derived from MaskGenerator. This class is used to convert a mitk::PlanarFigure into a binary image mask
*/
class MITKIMAGESTATISTICS_EXPORT PlanarFigureMaskGenerator : public MaskGenerator
{
public:
/** Standard Self typedef */
typedef PlanarFigureMaskGenerator Self;
typedef MaskGenerator Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
- itkNewMacro(Self)
-
- /** Runtime information support. */
- itkTypeMacro(PlanarFigureMaskGenerator, MaskGenerator)
+ itkNewMacro(Self); /** Runtime information support. */
+ itkTypeMacro(PlanarFigureMaskGenerator, MaskGenerator);
/**
* @brief GetMask Computes and returns the mask
* @return mitk::Image::Pointer of the generated mask
*/
mitk::Image::Pointer GetMask() override;
void SetPlanarFigure(mitk::PlanarFigure::Pointer planarFigure);
mitk::Image::ConstPointer GetReferenceImage() override;
/**
* @brief SetTimeStep is used to set the time step for which the mask is to be generated
* @param timeStep
*/
void SetTimeStep(unsigned int timeStep) override;
itkGetConstMacro(PlanarFigureAxis, unsigned int);
itkGetConstMacro(PlanarFigureSlice, unsigned int);
protected:
PlanarFigureMaskGenerator()
: Superclass(),
m_ReferenceImage(nullptr),
m_PlanarFigureAxis(0),
m_InternalMaskUpdateTime(0),
m_PlanarFigureSlice(0)
{
m_InternalMask = mitk::Image::New();
}
private:
void CalculateMask();
template <typename TPixel, unsigned int VImageDimension>
void InternalCalculateMaskFromPlanarFigure(const itk::Image<TPixel, VImageDimension> *image, unsigned int axis);
template <typename TPixel, unsigned int VImageDimension>
void InternalCalculateMaskFromOpenPlanarFigure(const itk::Image<TPixel, VImageDimension> *image, unsigned int axis);
mitk::Image::ConstPointer extract2DImageSlice(unsigned int axis, unsigned int slice);
bool GetPrincipalAxis(const BaseGeometry *geometry, Vector3D vector, unsigned int &axis);
/** Connection from ITK to VTK */
template <typename ITK_Exporter, typename VTK_Importer>
void ConnectPipelines(ITK_Exporter exporter, vtkSmartPointer<VTK_Importer> importer)
{
importer->SetUpdateInformationCallback(exporter->GetUpdateInformationCallback());
importer->SetPipelineModifiedCallback(exporter->GetPipelineModifiedCallback());
importer->SetWholeExtentCallback(exporter->GetWholeExtentCallback());
importer->SetSpacingCallback(exporter->GetSpacingCallback());
importer->SetOriginCallback(exporter->GetOriginCallback());
importer->SetScalarTypeCallback(exporter->GetScalarTypeCallback());
importer->SetNumberOfComponentsCallback(exporter->GetNumberOfComponentsCallback());
importer->SetPropagateUpdateExtentCallback(exporter->GetPropagateUpdateExtentCallback());
importer->SetUpdateDataCallback(exporter->GetUpdateDataCallback());
importer->SetDataExtentCallback(exporter->GetDataExtentCallback());
importer->SetBufferPointerCallback(exporter->GetBufferPointerCallback());
importer->SetCallbackUserData(exporter->GetCallbackUserData());
}
/** Connection from VTK to ITK */
template <typename VTK_Exporter, typename ITK_Importer>
void ConnectPipelines(vtkSmartPointer<VTK_Exporter> exporter, ITK_Importer importer)
{
importer->SetUpdateInformationCallback(exporter->GetUpdateInformationCallback());
importer->SetPipelineModifiedCallback(exporter->GetPipelineModifiedCallback());
importer->SetWholeExtentCallback(exporter->GetWholeExtentCallback());
importer->SetSpacingCallback(exporter->GetSpacingCallback());
importer->SetOriginCallback(exporter->GetOriginCallback());
importer->SetScalarTypeCallback(exporter->GetScalarTypeCallback());
importer->SetNumberOfComponentsCallback(exporter->GetNumberOfComponentsCallback());
importer->SetPropagateUpdateExtentCallback(exporter->GetPropagateUpdateExtentCallback());
importer->SetUpdateDataCallback(exporter->GetUpdateDataCallback());
importer->SetDataExtentCallback(exporter->GetDataExtentCallback());
importer->SetBufferPointerCallback(exporter->GetBufferPointerCallback());
importer->SetCallbackUserData(exporter->GetCallbackUserData());
}
bool IsUpdateRequired() const;
mitk::PlanarFigure::Pointer m_PlanarFigure;
itk::Image<unsigned short, 2>::Pointer m_InternalITKImageMask2D;
mitk::Image::ConstPointer m_InternalTimeSliceImage;
mitk::Image::ConstPointer m_ReferenceImage;
unsigned int m_PlanarFigureAxis;
unsigned long m_InternalMaskUpdateTime;
unsigned int m_PlanarFigureSlice;
};
} // namespace mitk
#endif // MITKPLANARFIGUREMASKGENERATOR
diff --git a/Modules/ImageStatistics/mitkPointSetDifferenceStatisticsCalculator.h b/Modules/ImageStatistics/mitkPointSetDifferenceStatisticsCalculator.h
index bc66ef47fa..7aae261e87 100644
--- a/Modules/ImageStatistics/mitkPointSetDifferenceStatisticsCalculator.h
+++ b/Modules/ImageStatistics/mitkPointSetDifferenceStatisticsCalculator.h
@@ -1,106 +1,106 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_PointSetDifferenceStatisticsCalculator_H
#define _MITK_PointSetDifferenceStatisticsCalculator_H
#include <itkObject.h>
#include <MitkImageStatisticsExports.h>
#include "mitkImageStatisticsCalculator.h"
#include <mitkPointSet.h>
namespace mitk
{
/**
* \brief Class for calculating the difference between two corresponding point sets.
* The user can access the single distances between corresponding points as well as a complete statistic (mean, sd, rms, median, max, min)
* The point sets must be of equal size!
*/
class MITKIMAGESTATISTICS_EXPORT PointSetDifferenceStatisticsCalculator : public itk::Object
{
public:
mitkClassMacroItkParent( PointSetDifferenceStatisticsCalculator, itk::Object );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
mitkNewMacro2Param(PointSetDifferenceStatisticsCalculator,mitk::PointSet::Pointer,mitk::PointSet::Pointer);
/*!
\brief set point sets to be compared
*/
void SetPointSets(mitk::PointSet::Pointer pSet1, mitk::PointSet::Pointer pSet2);
/*!
\brief returns a vector holding the differences between the corresponding points of the point sets
*/
std::vector<double> GetDifferences();
/*!
\brief returns a vector holding the squared differences between the corresponding points of the point sets
*/
std::vector<double> GetSquaredDifferences();
/*!
\brief returns the mean distance of all corresponding points of the point sets
*/
double GetMean();
/*!
\brief returns the standard deviation of the distances between all corresponding points of the point sets
*/
double GetSD();
/*!
\brief returns the variance of the distances between all corresponding points of the point sets
*/
double GetVariance();
/*!
\brief returns the root mean squared distance of all corresponding points of the point sets
*/
double GetRMS();
/*!
\brief returns the median distance of all corresponding points of the point sets
*/
double GetMedian();
/*!
\brief returns the maximal distance of all corresponding points of the point sets
*/
double GetMax();
/*!
\brief returns the minimal distance of all corresponding points of the point sets
*/
double GetMin();
/*!
\brief returns the total number of corresponding points of the point sets
*/
double GetNumberOfPoints();
protected:
PointSetDifferenceStatisticsCalculator();
PointSetDifferenceStatisticsCalculator(mitk::PointSet::Pointer,mitk::PointSet::Pointer);
~PointSetDifferenceStatisticsCalculator() override;
/*!
\brief Method for computing the complete statistics of the differences between the given point sets.
*/
void ComputeStatistics();
mitk::ImageStatisticsContainer::ImageStatisticsObject m_Statistics; ///< struct holding the statistics
std::vector<double> m_DifferencesVector; ///< vector holding the differences between the corresponding points
std::vector<double> m_SquaredDifferencesVector; ///< vector holding the squared differences between the corresponding points
mitk::PointSet::Pointer m_PointSet1; ///< first point set used for comparison
mitk::PointSet::Pointer m_PointSet2; ///< second point set used for comparison
bool m_StatisticsCalculated; ///< flag indicating whether statistics are already calculated or not.
};
}
#endif // #define _MITK_PointSetDifferenceStatisticsCalculator_H
diff --git a/Modules/ImageStatistics/mitkPointSetStatisticsCalculator.h b/Modules/ImageStatistics/mitkPointSetStatisticsCalculator.h
index 5c406d2f50..84f5e36b5d 100644
--- a/Modules/ImageStatistics/mitkPointSetStatisticsCalculator.h
+++ b/Modules/ImageStatistics/mitkPointSetStatisticsCalculator.h
@@ -1,118 +1,118 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_PointSetSTATISTICSCALCULATOR_H
#define _MITK_PointSetSTATISTICSCALCULATOR_H
#include <itkObject.h>
#include <MitkImageStatisticsExports.h>
#include <mitkPointSet.h>
namespace mitk
{
/**
* \brief Class for calculating statistics (like standard derivation, RMS, mean, etc.) for a PointSet.
*/
class MITKIMAGESTATISTICS_EXPORT PointSetStatisticsCalculator : public itk::Object
{
public:
mitkClassMacroItkParent( PointSetStatisticsCalculator, itk::Object );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
mitkNewMacro1Param(PointSetStatisticsCalculator,mitk::PointSet::Pointer);
/** @brief Sets the point set which will be analysed. */
void SetPointSet(mitk::PointSet::Pointer pSet);
/** @return Returns the mean position of the analysed point set (only valid navigation data). Returns [0;0;0] if there is no valid navigation data.*/
mitk::Point3D GetPositionMean();
/** @return Returns the standard derivation of each component (x, y and z) of the analysed point set (only valid navigation data). Returns [0;0;0] if there is no valid navigation data.*/
mitk::Vector3D GetPositionStandardDeviation();
/** @return Returns the sample standard derivation of each component (x, y and z) of the analysed point set (only valid navigation data). Returns [0;0;0] if there is no valid navigation data.*/
mitk::Vector3D GetPositionSampleStandardDeviation();
/** @return Returns the mean distance to the mean postion (=mean error) of the analysed point set (only valid navigation data). Returns 0 if there is no valid navigation data. */
double GetPositionErrorMean();
/** @return Returns the standard derivation of the errors of all positions of the analysed point set (only valid navigation data). Returns 0 if there is no valid navigation data. */
double GetPositionErrorStandardDeviation();
/** @return Returns the sample standard derivation of the errors of all positions of the analysed point set (only valid navigation data). Returns 0 if there is no valid navigation data. */
double GetPositionErrorSampleStandardDeviation();
/** @return Returns the RMS of the errors of all positions of the analysed point set (only valid navigation data). Returns 0 if there is no valid navigation data. */
double GetPositionErrorRMS();
/** @return Returns the median of the errors of all positions of the analysed point set (only valid navigation data). Returns 0 if there is no valid navigation data. */
double GetPositionErrorMedian();
/** @return Returns the maximum of the errors of all positions of the analysed point set (only valid navigation data). Returns 0 if there is no valid navigation data. */
double GetPositionErrorMax();
/** @return Returns the minimum of the errors of all positions of the analysed point set (only valid navigation data). Returns 0 if there is no valid navigation data. */
double GetPositionErrorMin();
//#####################################################################################################
//this both methods are used by another class an so they are public... perhaps we want to move them
//out of this class because they have nothing to do with point sets.
/** @return returns the standard derivation of the given list (NOT of the point set).*/
double GetStabw(std::vector<double> list);
/** @return returns the sample standard derivation of the given list (NOT of the point set).*/
double GetSampleStabw(std::vector<double> list);
//#####################################################################################################
protected:
PointSetStatisticsCalculator();
explicit PointSetStatisticsCalculator(mitk::PointSet::Pointer);
~PointSetStatisticsCalculator() override;
// TODO: Remove the std::vector<mitk::Point3D> data structure and use mitk::PointSet everywhere
/** @return Returns a list with the distances to the mean of the list */
std::vector<double> GetErrorList(std::vector<mitk::Point3D> list);
/** @return Returns the mean of the point list. Returns [0;0;0] if the list is empty. */
mitk::Point3D GetMean(std::vector<mitk::Point3D> list);
/** @brief Converts a point set to a vector of Point3D. */
std::vector<mitk::Point3D> PointSetToVector(mitk::PointSet::Pointer pSet);
/** @return Returns true if all positions in the evaluated points set are equal. False if not. */
bool CheckIfAllPositionsAreEqual();
mitk::PointSet::Pointer m_PointSet;
double GetMean(std::vector<double> list);
double GetMedian(std::vector<double> list);
double GetMax(std::vector<double> list);
double GetMin(std::vector<double> list);
};
}
#endif // #define _MITK_PointSetSTATISTICSCALCULATOR_H
diff --git a/Modules/ImageStatistics/mitkStatisticsToImageRelationRule.h b/Modules/ImageStatistics/mitkStatisticsToImageRelationRule.h
index c6f0ad0b23..e2a2cbd736 100644
--- a/Modules/ImageStatistics/mitkStatisticsToImageRelationRule.h
+++ b/Modules/ImageStatistics/mitkStatisticsToImageRelationRule.h
@@ -1,32 +1,32 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkStatisticsToImageRelationRule_h
#define mitkStatisticsToImageRelationRule_h
#include <MitkImageStatisticsExports.h>
#include "mitkGenericIDRelationRule.h"
namespace mitk
{
class MITKIMAGESTATISTICS_EXPORT StatisticsToImageRelationRule : public mitk::GenericIDRelationRule
{
public:
- mitkClassMacroItkParent(StatisticsToImageRelationRule, mitk::GenericIDRelationRule)
- itkNewMacro(Self)
+ mitkClassMacroItkParent(StatisticsToImageRelationRule, mitk::GenericIDRelationRule);
+ itkNewMacro(Self);
protected:
StatisticsToImageRelationRule();
};
}
#endif
diff --git a/Modules/ImageStatistics/mitkStatisticsToMaskRelationRule.h b/Modules/ImageStatistics/mitkStatisticsToMaskRelationRule.h
index 2164d23826..b1b86d66b2 100644
--- a/Modules/ImageStatistics/mitkStatisticsToMaskRelationRule.h
+++ b/Modules/ImageStatistics/mitkStatisticsToMaskRelationRule.h
@@ -1,32 +1,32 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkStatisticsToMaskRelationRule_h
#define mitkStatisticsToMaskRelationRule_h
#include <MitkImageStatisticsExports.h>
#include "mitkGenericIDRelationRule.h"
namespace mitk
{
class MITKIMAGESTATISTICS_EXPORT StatisticsToMaskRelationRule : public mitk::GenericIDRelationRule
{
public:
- mitkClassMacroItkParent(StatisticsToMaskRelationRule, mitk::GenericIDRelationRule)
- itkNewMacro(Self)
+ mitkClassMacroItkParent(StatisticsToMaskRelationRule, mitk::GenericIDRelationRule);
+ itkNewMacro(Self);
protected:
StatisticsToMaskRelationRule();
};
}
#endif
diff --git a/Modules/LegacyGL/mitkVtkGLMapperWrapper.h b/Modules/LegacyGL/mitkVtkGLMapperWrapper.h
index 2bdd03d696..a2f6813ab0 100644
--- a/Modules/LegacyGL/mitkVtkGLMapperWrapper.h
+++ b/Modules/LegacyGL/mitkVtkGLMapperWrapper.h
@@ -1,82 +1,82 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKVtkGLMapperWrapper_H_HEADER
#define MITKVtkGLMapperWrapper_H_HEADER
#include "mitkBaseRenderer.h"
#include "mitkGLMapper.h"
#include "mitkLocalStorageHandler.h"
#include "mitkVtkMapper.h"
#include <MitkLegacyGLExports.h>
#include <vtkSmartPointer.h>
class vtkGLMapperProp;
namespace mitk
{
/**
* @brief Vtk-based 2D mapper for PointSet
*/
class MITKLEGACYGL_EXPORT VtkGLMapperWrapper : public VtkMapper
{
public:
mitkClassMacro(VtkGLMapperWrapper, VtkMapper);
- mitkNewMacro1Param(Self, GLMapper::Pointer)
+ mitkNewMacro1Param(Self, GLMapper::Pointer);
- itkCloneMacro(Self)
+ itkCloneMacro(Self);
- /** \brief returns the a prop assembly */
- vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
+ /** \brief returns the a prop assembly */
+ vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
/** \brief Internal class holding the mapper, actor, etc. for each of the 3 2D render windows */
class LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/* constructor */
LocalStorage();
/* destructor */
~LocalStorage() override;
vtkSmartPointer<vtkGLMapperProp> m_GLMapperProp;
};
void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor *actor) override;
void MitkRender(mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) override;
void Update(BaseRenderer *renderer) override;
void SetDataNode(DataNode *node) override;
DataNode *GetDataNode() const override;
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
protected:
GLMapper::Pointer m_MitkGLMapper;
/* constructor */
VtkGLMapperWrapper(GLMapper::Pointer mitkGLMapper);
/* destructor */
~VtkGLMapperWrapper() override;
void Enable2DOpenGL(mitk::BaseRenderer *);
void Disable2DOpenGL();
};
} // namespace mitk
#endif /* MITKVtkGLMapperWrapper_H_HEADER_INCLUDED_C1902626 */
diff --git a/Modules/LegacyIO/mitkFileSeriesReader.h b/Modules/LegacyIO/mitkFileSeriesReader.h
index 95ed19613d..45a206cc87 100644
--- a/Modules/LegacyIO/mitkFileSeriesReader.h
+++ b/Modules/LegacyIO/mitkFileSeriesReader.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __MITK_FILE_SERIES_READER__H_
#define __MITK_FILE_SERIES_READER__H_
#include <MitkLegacyIOExports.h>
#include <mitkCommon.h>
#include <mitkFileReader.h>
#include <string>
#include <vector>
namespace mitk
{
/**
* Provides a function which generates a list of files from
* a given prefix and pattern.
* Subclasses may use this function to load a series of files.
*
* @deprecatedSince{2014_10}
*/
class MITKLEGACYIO_EXPORT FileSeriesReader : public FileReader
{
public:
- mitkClassMacro(FileSeriesReader, FileReader)
+ mitkClassMacro(FileSeriesReader, FileReader);
typedef std::vector<std::string> MatchedFileNames;
virtual MatchedFileNames GetMatchedFileNames();
protected:
FileSeriesReader();
~FileSeriesReader() override;
virtual bool GenerateFileList();
std::string m_FileName;
std::string m_FilePrefix;
std::string m_FilePattern;
MatchedFileNames m_MatchedFileNames;
};
}
#endif
diff --git a/Modules/LegacyIO/mitkImageWriter.h b/Modules/LegacyIO/mitkImageWriter.h
index 8151f9efa0..e9f67d016d 100644
--- a/Modules/LegacyIO/mitkImageWriter.h
+++ b/Modules/LegacyIO/mitkImageWriter.h
@@ -1,169 +1,171 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_IMAGE_WRITER__H_
#define _MITK_IMAGE_WRITER__H_
#include <MitkLegacyIOExports.h>
#include <mitkFileWriterWithInformation.h>
namespace mitk
{
class Image;
/**
* @brief Writer for mitk::Image
*
* Uses the given extension (SetExtension) to decide the format to write
* (.mhd is default, .pic, .tif, .png, .jpg supported yet).
* @ingroup MitkLegacyIOModule
* @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileWriterRegistry instead.
*/
class MITKLEGACYIO_EXPORT ImageWriter : public mitk::FileWriterWithInformation
{
public:
mitkClassMacro(ImageWriter, mitk::FileWriter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
mitkWriterMacro;
/**
* Sets the filename of the file to write.
* @param _arg the name of the file to write.
*/
void SetFileName(const char *fileName) override;
virtual void SetFileName(const std::string &fileName);
/**
* @returns the name of the file to be written to disk.
*/
itkGetStringMacro(FileName);
/**
* \brief Explicitly set the extension to be added to the filename.
* @param _arg to be added to the filename, including a "."
* (e.g., ".mhd").
*/
virtual void SetExtension(const char *extension);
virtual void SetExtension(const std::string &extension);
/**
* \brief Get the extension to be added to the filename.
* @returns the extension to be added to the filename (e.g.,
* ".mhd").
*/
itkGetStringMacro(Extension);
/**
* \brief Set the extension to be added to the filename to the default
*/
void SetDefaultExtension();
/**
* @warning multiple write not (yet) supported
*/
itkSetStringMacro(FilePrefix);
/**
* @warning multiple write not (yet) supported
*/
itkGetStringMacro(FilePrefix);
/**
* @warning multiple write not (yet) supported
*/
itkSetStringMacro(FilePattern);
/**
* @warning multiple write not (yet) supported
*/
itkGetStringMacro(FilePattern);
/**
* Sets the 0'th input object for the filter.
* @param input the first input for the filter.
*/
void SetInput(mitk::Image *input);
//##Documentation
//## @brief Return the possible file extensions for the data type associated with the writer
std::vector<std::string> GetPossibleFileExtensions() override;
std::string GetSupportedBaseData() const override;
/**
* @brief Return the extension to be added to the filename.
*/
std::string GetFileExtension() override;
/**
* @brief Check if the Writer can write the Content of the
*/
bool CanWriteDataType(DataNode *) override;
/**
* @brief Return the MimeType of the saved File.
*/
std::string GetWritenMIMEType() override;
using Superclass::SetInput;
/**
* @brief Set the DataTreenode as Input. Important: The Writer always have a SetInput-Function.
*/
virtual void SetInput(DataNode *);
/**
* @returns the 0'th input object of the filter.
*/
const mitk::Image *GetInput();
// FileWriterWithInformation methods
const char *GetDefaultFilename() override;
const char *GetFileDialogPattern() override;
const char *GetDefaultExtension() override;
bool CanWriteBaseDataType(BaseData::Pointer data) override;
void DoWrite(BaseData::Pointer data) override;
void SetUseCompression(bool useCompression);
protected:
/**
* Constructor.
*/
ImageWriter();
/**
* Virtual destructor.
*/
~ImageWriter() override;
void GenerateData() override;
virtual void WriteByITK(mitk::Image *image, const std::string &fileName);
std::string m_FileName;
std::string m_FileNameWithoutExtension;
std::string m_FilePrefix;
std::string m_FilePattern;
std::string m_Extension;
std::string m_MimeType;
bool m_UseCompression;
};
}
#endif //_MITK_IMAGE_WRITER__H_
diff --git a/Modules/LegacyIO/mitkImageWriterFactory.h b/Modules/LegacyIO/mitkImageWriterFactory.h
index 629ca47bb1..424fcd2198 100644
--- a/Modules/LegacyIO/mitkImageWriterFactory.h
+++ b/Modules/LegacyIO/mitkImageWriterFactory.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef IMAGEWRITERFACTORY_H_HEADER_INCLUDED
#define IMAGEWRITERFACTORY_H_HEADER_INCLUDED
#include <MitkLegacyIOExports.h>
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"
namespace mitk
{
/**
* @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
*/
class DEPRECATED() MITKLEGACYIO_EXPORT ImageWriterFactory : public itk::ObjectFactoryBase
{
public:
- mitkClassMacroItkParent(mitk::ImageWriterFactory, itk::ObjectFactoryBase)
+ mitkClassMacroItkParent(mitk::ImageWriterFactory, itk::ObjectFactoryBase);
/** Class methods used to interface with the registered factories. */
const char *GetITKSourceVersion(void) const override;
const char *GetDescription(void) const override;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
/**
* Register one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void RegisterOneFactory(void))
{
static bool IsRegistered = false;
if (!IsRegistered)
{
ImageWriterFactory::Pointer imageWriterFactory = ImageWriterFactory::New();
ObjectFactoryBase::RegisterFactory(imageWriterFactory);
IsRegistered = true;
}
}
protected:
ImageWriterFactory();
~ImageWriterFactory() override;
private:
ImageWriterFactory(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
#endif
diff --git a/Modules/LegacyIO/mitkItkImageFileReader.h b/Modules/LegacyIO/mitkItkImageFileReader.h
index dafc68791b..744d17a65b 100644
--- a/Modules/LegacyIO/mitkItkImageFileReader.h
+++ b/Modules/LegacyIO/mitkItkImageFileReader.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef ItkImageFileReader_H_HEADER_INCLUDED
#define ItkImageFileReader_H_HEADER_INCLUDED
#include "mitkFileReader.h"
#include "mitkImageSource.h"
#include <MitkLegacyIOExports.h>
namespace mitk
{
//##Documentation
//## @brief Reader to read file formats supported by itk
//## @ingroup MitkLegacyIOModule
//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
class MITKLEGACYIO_EXPORT ItkImageFileReader : public ImageSource, public FileReader
{
public:
mitkClassMacro(ItkImageFileReader, FileReader);
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkSetStringMacro(FileName);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkSetStringMacro(FileName);
itkGetStringMacro(FileName);
itkSetStringMacro(FilePrefix);
itkGetStringMacro(FilePrefix);
itkSetStringMacro(FilePattern);
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
protected:
void GenerateData() override;
ItkImageFileReader();
~ItkImageFileReader() override;
std::string m_FileName;
std::string m_FilePrefix;
std::string m_FilePattern;
};
} // namespace mitk
#endif /* ItkImageFileReader_H_HEADER_INCLUDED */
diff --git a/Modules/LegacyIO/mitkPointSetReader.h b/Modules/LegacyIO/mitkPointSetReader.h
index b3b84f6b2c..eb4cc27c51 100644
--- a/Modules/LegacyIO/mitkPointSetReader.h
+++ b/Modules/LegacyIO/mitkPointSetReader.h
@@ -1,139 +1,141 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_POINT_SET_READER__H_
#define _MITK_POINT_SET_READER__H_
#include <MitkLegacyIOExports.h>
#include <mitkFileReader.h>
#include <mitkPointSetSource.h>
#include <stack>
#include <string>
#include <tinyxml.h>
#include <vtkXMLParser.h>
namespace mitk
{
/**
* @brief reads xml representations of mitk::PointSets from a file
*
* Reader for xml files containing one or multiple xml represenations of
* mitk::PointSets. If multiple mitk::PointSets are stored in one file,
* these are assigned to multiple outputs of the filter. The number of point
* sets which have be read can be retrieven by a call to GetNumberOfOutputs()
* after the pipeline update().
* The reader is able to read the old 3D Pointsets without the "specification" and "timeseries" tags and the new 4D
* Pointsets.
* @note loading point sets from multiple files according to a given file pattern
* is not yet supported!
*
* @ingroup MitkLegacyIOModule
*
* @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
*/
class MITKLEGACYIO_EXPORT PointSetReader : public PointSetSource, public FileReader
{
public:
mitkClassMacro(PointSetReader, FileReader);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/**
* @brief Sets the filename of the file to be read
* @param _arg the filename of the point set xml-file
*/
itkSetStringMacro(FileName);
/**
* @brief Returns the filename of the point set xml-file.
* @returns the filename of the point set xml-file.
*/
itkGetStringMacro(FileName);
/**
* @warning multiple load not (yet) supported
*/
itkSetStringMacro(FilePrefix);
/**
* @warning multiple load not (yet) supported
*/
itkGetStringMacro(FilePrefix);
/**
* @warning multiple load not (yet) supported
*/
itkSetStringMacro(FilePattern);
/**
* @warning multiple load not (yet) supported
*/
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
/**
* @returns whether the last read attempt was successful or not.
*/
bool GetSuccess() const;
protected:
/**
* Constructor
*/
PointSetReader();
/**
* Virtual destructor
*/
~PointSetReader() override;
/**
* Actually reads the point sets from the given file
*/
void GenerateData() override;
virtual mitk::PointSet::Pointer ReadPoint(mitk::PointSet::Pointer newPointSet,
TiXmlElement *currentTimeSeries,
unsigned int currentTimeStep);
/**
* Does nothing in the current implementation
*/
void GenerateOutputInformation() override;
/**
* Resizes the output-objects according to the given number.
* @param num the new number of output objects.
*/
virtual void ResizeOutputs(const unsigned int &num);
/**
* Checks if the given file has appropriate
* read access.
* @returns true if the file exists and may be read
* or false otherwise.
*/
virtual int CanReadFile(const char *name);
std::string m_FileName;
std::string m_FilePrefix;
std::string m_FilePattern;
bool m_Success;
};
}
#endif
diff --git a/Modules/LegacyIO/mitkPointSetWriter.h b/Modules/LegacyIO/mitkPointSetWriter.h
index 43536bd4b3..0789e8c685 100644
--- a/Modules/LegacyIO/mitkPointSetWriter.h
+++ b/Modules/LegacyIO/mitkPointSetWriter.h
@@ -1,252 +1,254 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_POINT_SET_WRITER__H_
#define _MITK_POINT_SET_WRITER__H_
#include <MitkLegacyIOExports.h>
#include <itkProcessObject.h>
#include <mitkFileWriter.h>
#include <mitkPointSet.h>
namespace mitk
{
/**
* @brief XML-based writer for mitk::PointSets
*
* XML-based writer for mitk::PointSets. Multiple PointSets can be written in
* a single XML file by simply setting multiple inputs to the filter.
* Writing of multiple XML files according to a given filename pattern is not
* yet supported.
*
* @ingroup MitkLegacyIOModule
*
* @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
*/
class MITKLEGACYIO_EXPORT PointSetWriter : public mitk::FileWriter
{
public:
mitkClassMacro(PointSetWriter, mitk::FileWriter);
mitkWriterMacro;
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
typedef mitk::PointSet InputType;
typedef InputType::Pointer InputTypePointer;
/**
* Sets the filename of the file to write.
* @param FileName the name of the file to write.
*/
itkSetStringMacro(FileName);
/**
* @returns the name of the file to be written to disk.
*/
itkGetStringMacro(FileName);
/**
* @warning multiple write not (yet) supported
*/
itkSetStringMacro(FilePrefix);
/**
* @warning multiple write not (yet) supported
*/
itkGetStringMacro(FilePrefix);
/**
* @warning multiple write not (yet) supported
*/
itkSetStringMacro(FilePattern);
/**
* @warning multiple write not (yet) supported
*/
itkGetStringMacro(FilePattern);
/**
* Sets the 0'th input object for the filter.
* @param input the first input for the filter.
*/
void SetInput(InputType *input);
/**
* Sets the n'th input object for the filter. If num is
* larger than GetNumberOfInputs() the number of inputs is
* resized appropriately.
* @param input the n'th input for the filter.
*/
void SetInput(const unsigned int &num, InputType *input);
/**
* @returns the 0'th input object of the filter.
*/
PointSet *GetInput();
/**
* @param num the index of the desired output object.
* @returns the n'th input object of the filter.
*/
PointSet *GetInput(const unsigned int &num);
/**
* @brief Return the possible file extensions for the data type associated with the writer
*/
std::vector<std::string> GetPossibleFileExtensions() override;
std::string GetSupportedBaseData() const override;
/**
* @brief Return the extension to be added to the filename.
*/
std::string GetFileExtension() override;
/**
* @brief Check if the Writer can write the Content of the
*/
bool CanWriteDataType(DataNode *) override;
/**
* @brief Return the MimeType of the saved File.
*/
std::string GetWritenMIMEType() override;
using mitk::FileWriter::SetInput;
/**
* @brief Set the DataTreenode as Input. Important: The Writer always have a SetInput-Function.
*/
virtual void SetInput(DataNode *);
/**
* @returns whether the last write attempt was successful or not.
*/
bool GetSuccess() const;
protected:
/**
* Constructor.
*/
PointSetWriter();
/**
* Virtual destructor.
*/
~PointSetWriter() override;
/**
* Writes the XML file
*/
void GenerateData() override;
/**
* Resizes the number of inputs of the writer.
* The inputs are initialized by empty PointSets
* @param num the new number of inputs
*/
virtual void ResizeInputs(const unsigned int &num);
/**
* Converts an arbitrary type to a string. The type has to
* support the << operator. This works fine at least for integral
* data types as float, int, long etc.
* @param value the value to convert
* @returns the string representation of value
*/
template <typename T>
std::string ConvertToString(T value);
/**
* Writes an XML representation of the given point set to
* an outstream. The XML-Header an root node is not included!
* @param pointSet the point set to be converted to xml
* @param out the stream to write to.
*/
void WriteXML(mitk::PointSet *pointSet, std::ofstream &out);
/**
* Writes an standard xml header to the given stream.
* @param file the stream in which the header is written.
*/
void WriteXMLHeader(std::ofstream &file);
/** Write a start element tag */
void WriteStartElement(const char *const tag, std::ofstream &file);
/**
* Write an end element tag
* End-Elements following character data should pass indent = false.
*/
void WriteEndElement(const char *const tag, std::ofstream &file, const bool &indent = true);
/** Write character data inside a tag. */
void WriteCharacterData(const char *const data, std::ofstream &file);
/** Write a start element tag */
void WriteStartElement(std::string &tag, std::ofstream &file);
/** Write an end element tag */
void WriteEndElement(std::string &tag, std::ofstream &file, const bool &indent = true);
/** Write character data inside a tag. */
void WriteCharacterData(std::string &data, std::ofstream &file);
/** Writes empty spaces to the stream according to m_IndentDepth and m_Indent */
void WriteIndent(std::ofstream &file);
std::string m_FileName;
std::string m_FilePrefix;
std::string m_FilePattern;
std::string m_Extension;
std::string m_MimeType;
unsigned int m_IndentDepth;
unsigned int m_Indent;
bool m_Success;
public:
static const char *XML_POINT_SET;
static const char *XML_TIME_SERIES;
static const char *XML_TIME_SERIES_ID;
static const char *XML_POINT_SET_FILE;
static const char *XML_FILE_VERSION;
static const char *XML_POINT;
static const char *XML_SPEC;
static const char *XML_ID;
static const char *XML_X;
static const char *XML_Y;
static const char *XML_Z;
static const char *VERSION_STRING;
};
}
#endif
diff --git a/Modules/LegacyIO/mitkPointSetWriterFactory.h b/Modules/LegacyIO/mitkPointSetWriterFactory.h
index df0c53b6e1..bbc056c1e7 100644
--- a/Modules/LegacyIO/mitkPointSetWriterFactory.h
+++ b/Modules/LegacyIO/mitkPointSetWriterFactory.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef POINTSETWRITERFACTORY_H_HEADER_INCLUDED
#define POINTSETWRITERFACTORY_H_HEADER_INCLUDED
#include <MitkLegacyIOExports.h>
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"
namespace mitk
{
/**
* @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
*/
class DEPRECATED() MITKLEGACYIO_EXPORT PointSetWriterFactory : public itk::ObjectFactoryBase
{
public:
- mitkClassMacroItkParent(mitk::PointSetWriterFactory, itk::ObjectFactoryBase)
+ mitkClassMacroItkParent(mitk::PointSetWriterFactory, itk::ObjectFactoryBase);
/** Class methods used to interface with the registered factories. */
const char *GetITKSourceVersion(void) const override;
const char *GetDescription(void) const override;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
/**
* Register one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void RegisterOneFactory(void))
{
static bool IsRegistered = false;
if (!IsRegistered)
{
PointSetWriterFactory::Pointer pointSetWriterFactory = PointSetWriterFactory::New();
ObjectFactoryBase::RegisterFactory(pointSetWriterFactory);
IsRegistered = true;
}
}
protected:
PointSetWriterFactory();
~PointSetWriterFactory() override;
private:
PointSetWriterFactory(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
#endif
diff --git a/Modules/LegacyIO/mitkRawImageFileReader.h b/Modules/LegacyIO/mitkRawImageFileReader.h
index 3d01cf6bde..70e58713fb 100644
--- a/Modules/LegacyIO/mitkRawImageFileReader.h
+++ b/Modules/LegacyIO/mitkRawImageFileReader.h
@@ -1,103 +1,103 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef RawImageFileReader_H_HEADER_INCLUDED
#define RawImageFileReader_H_HEADER_INCLUDED
#include "itkVector.h"
#include "mitkFileReader.h"
#include "mitkImageSource.h"
#include <MitkLegacyIOExports.h>
namespace mitk
{
//##Documentation
//## @brief Reader to read raw image files
/** The user must set the dimensionality, the dimensions and the pixel type. If they are incorrect, the image will
* not be opened or the visualization will be incorrect. */
//## @ingroup MitkLegacyIOModule
//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
class DEPRECATED() MITKLEGACYIO_EXPORT RawImageFileReader : public ImageSource, public FileReader
{
public:
mitkClassMacro(RawImageFileReader, FileReader);
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkSetMacro(FileName, std::string);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkSetMacro(FileName, std::string);
itkSetStringMacro(FileName);
itkGetMacro(FileName, std::string);
itkGetStringMacro(FileName);
itkSetMacro(FilePrefix, std::string);
itkSetStringMacro(FilePrefix);
itkGetMacro(FilePrefix, std::string);
itkGetStringMacro(FilePrefix);
itkSetMacro(FilePattern, std::string);
itkSetStringMacro(FilePattern);
itkGetMacro(FilePattern, std::string);
itkGetStringMacro(FilePattern);
/** Supported pixel types. */
typedef enum { UCHAR, SCHAR, USHORT, SSHORT, UINT, SINT, FLOAT, DOUBLE } IOPixelType;
itkSetMacro(PixelType, IOPixelType);
/** Endianity of bits. */
typedef enum { LITTLE, BIG } EndianityType;
itkSetMacro(Endianity, EndianityType);
itkSetMacro(Dimensionality, int);
itkGetMacro(Dimensionality, int);
/** Image dimensions must be set one by one, starting from dimension 0. */
void SetDimensions(unsigned int i, unsigned int dim);
unsigned int GetDimensions(unsigned int i) const;
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
protected:
RawImageFileReader();
~RawImageFileReader() override;
void GenerateData() override;
template <typename TPixel, unsigned int VImageDimensions>
void TypedGenerateData();
/** Name of file to be read.*/
std::string m_FileName;
/** File prefix. */
std::string m_FilePrefix;
/** File pattern. */
std::string m_FilePattern;
/** Pixel type of image to be read. Must be of type IOPixelType. */
IOPixelType m_PixelType;
/** Dimensionality of file to be read. Can be 2 or 3. */
int m_Dimensionality;
/** Endianity. Must be set to LITTLE or BIG. Default is BIG. */
EndianityType m_Endianity;
/** Vector containing dimensions of image to be read. */
itk::Vector<int, 3> m_Dimensions;
};
} // namespace mitk
#endif /* RawImageFileReader_H_HEADER_INCLUDED */
diff --git a/Modules/LegacyIO/mitkSTLFileReader.h b/Modules/LegacyIO/mitkSTLFileReader.h
index bf7ad78e4b..ad768797f3 100644
--- a/Modules/LegacyIO/mitkSTLFileReader.h
+++ b/Modules/LegacyIO/mitkSTLFileReader.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef STLFileReader_H_HEADER_INCLUDED
#define STLFileReader_H_HEADER_INCLUDED
#include "mitkSurfaceSource.h"
#include <MitkLegacyIOExports.h>
namespace mitk
{
//##Documentation
//## @brief Reader to read files in stl-format
//## @ingroup MitkLegacyIOModule
//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
class MITKLEGACYIO_EXPORT STLFileReader : public SurfaceSource
{
public:
mitkClassMacro(STLFileReader, SurfaceSource);
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkSetStringMacro(FileName);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkSetStringMacro(FileName);
itkGetStringMacro(FileName);
itkSetStringMacro(FilePrefix);
itkGetStringMacro(FilePrefix);
itkSetStringMacro(FilePattern);
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
protected:
void GenerateData() override;
STLFileReader();
~STLFileReader() override;
std::string m_FileName, m_FilePrefix, m_FilePattern;
};
} // namespace mitk
#endif /* STLFileReader_H_HEADER_INCLUDED */
diff --git a/Modules/LegacyIO/mitkSurfaceVtkWriter.h b/Modules/LegacyIO/mitkSurfaceVtkWriter.h
index 652a13efd6..a788273a44 100644
--- a/Modules/LegacyIO/mitkSurfaceVtkWriter.h
+++ b/Modules/LegacyIO/mitkSurfaceVtkWriter.h
@@ -1,200 +1,202 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_SURFACE_VTK_WRITER__H_
#define _MITK_SURFACE_VTK_WRITER__H_
#include <iomanip>
#include <vtkPolyDataWriter.h>
#include <vtkSTLWriter.h>
#include <vtkXMLPolyDataWriter.h>
#include <MitkLegacyIOExports.h>
#include <itkProcessObject.h>
#include <mitkFileWriterWithInformation.h>
#include <mitkPointSet.h>
#include <mitkSurface.h>
#include <vtkSmartPointer.h>
class vtkTransformPolyDataFilter;
namespace mitk
{
/**
* @brief VTK-based writer for mitk::Surface
*
* The mitk::Surface is written using the VTK-writer-type provided as the
* template argument. If the mitk::Surface contains multiple points of
* time, multiple files are written. The life-span (time-bounds) of each
* each point of time is included in the filename according to the
* following scheme:
* &lt;filename&gt;_S&lt;timebounds[0]&gt;E&lt;timebounds[1]&gt;_T&lt;framenumber&gt;
* (S=start, E=end, T=time).
* Writing of multiple files according to a given filename pattern is not
* yet supported.
* @ingroup MitkLegacyIOModule
*
* @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
*/
template <class VTKWRITER>
class MITKLEGACYIO_EXPORT SurfaceVtkWriter : public mitk::FileWriterWithInformation
{
public:
mitkClassMacro(SurfaceVtkWriter, mitk::FileWriter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
mitkWriterMacro;
typedef VTKWRITER VtkWriterType;
/**
* Sets the filename of the file to write.
* @param _arg the name of the file to write.
*/
itkSetStringMacro(FileName);
/**
* @returns the name of the file to be written to disk.
*/
itkGetStringMacro(FileName);
/**
* \brief Explicitly set the extension to be added to the filename.
* @param _arg to be added to the filename, including a "."
* (e.g., ".vtk").
*
* Partial template specialization is used for some vtk-writer types
* to set a default extension.
*/
itkSetStringMacro(Extension);
/**
* \brief Get the extension to be added to the filename.
* @returns the extension to be added to the filename (e.g.,
* ".vtk").
*/
itkGetStringMacro(Extension);
/**
* \brief Set the extension to be added to the filename to the default
*
* Partial template specialization is used for some vtk-writer types
* to define the default extension.
*/
void SetDefaultExtension();
/**
* @warning multiple write not (yet) supported
*/
itkSetStringMacro(FilePrefix);
/**
* @warning multiple write not (yet) supported
*/
itkGetStringMacro(FilePrefix);
/**
* @warning multiple write not (yet) supported
*/
itkSetStringMacro(FilePattern);
/**
* @warning multiple write not (yet) supported
*/
itkGetStringMacro(FilePattern);
/**
* Sets the 0'th input object for the filter.
* @param input the first input for the filter.
*/
void SetInput(mitk::Surface *input);
/**
* @returns the 0'th input object of the filter.
*/
const mitk::Surface *GetInput();
/**
* @brief Return the extension to be added to the filename.
*/
std::string GetFileExtension() override;
/**
* @brief Check if the Writer can write the Content of the DataTreenode.
*/
bool CanWriteDataType(DataNode *) override;
/**
* @brief Return the MimeType of the saved File.
*/
std::string GetWritenMIMEType() override;
using Superclass::SetInput;
/**
* @brief Set the DataTreenode as Input. Important: The Writer always have a SetInput-Function.
*/
virtual void SetInput(DataNode *);
VtkWriterType *GetVtkWriter() { return m_VtkWriter; }
/**
* @brief Return the possible file extensions for the data type associated with the writer
*/
std::vector<std::string> GetPossibleFileExtensions() override;
std::string GetSupportedBaseData() const override { return Surface::GetStaticNameOfClass(); }
const char *GetDefaultFilename() override;
const char *GetFileDialogPattern() override;
const char *GetDefaultExtension() override;
bool CanWriteBaseDataType(BaseData::Pointer data) override;
void DoWrite(BaseData::Pointer data) override;
protected:
/**
* Constructor.
*/
SurfaceVtkWriter();
/**
* Virtual destructor.
*/
~SurfaceVtkWriter() override;
void GenerateData() override;
void ExecuteWrite(VtkWriterType *vtkWriter);
std::string m_FileName;
std::string m_FilePrefix;
std::string m_FilePattern;
std::string m_Extension;
std::string m_MimeType;
vtkSmartPointer<VtkWriterType> m_VtkWriter;
bool m_WriterWriteHasReturnValue;
};
#ifndef MitkLegacyIO_EXPORTS
extern template class SurfaceVtkWriter<vtkSTLWriter>;
extern template class SurfaceVtkWriter<vtkPolyDataWriter>;
extern template class SurfaceVtkWriter<vtkXMLPolyDataWriter>;
#endif
}
#endif //_MITK_SURFACE_VTK_WRITER__H_
diff --git a/Modules/LegacyIO/mitkSurfaceVtkWriterFactory.h b/Modules/LegacyIO/mitkSurfaceVtkWriterFactory.h
index 63069b661d..60c8c32e41 100644
--- a/Modules/LegacyIO/mitkSurfaceVtkWriterFactory.h
+++ b/Modules/LegacyIO/mitkSurfaceVtkWriterFactory.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef SURFACEWRITERFACTORY_H_HEADER_INCLUDED
#define SURFACEWRITERFACTORY_H_HEADER_INCLUDED
#include <MitkLegacyIOExports.h>
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"
namespace mitk
{
/**
* @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
*/
class DEPRECATED() MITKLEGACYIO_EXPORT SurfaceVtkWriterFactory : public itk::ObjectFactoryBase
{
public:
- mitkClassMacroItkParent(mitk::SurfaceVtkWriterFactory, itk::ObjectFactoryBase)
+ mitkClassMacroItkParent(mitk::SurfaceVtkWriterFactory, itk::ObjectFactoryBase);
/** Class methods used to interface with the registered factories. */
const char *GetITKSourceVersion(void) const override;
const char *GetDescription(void) const override;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
/**
* Register one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void RegisterOneFactory(void))
{
static bool IsRegistered = false;
if (!IsRegistered)
{
SurfaceVtkWriterFactory::Pointer surfaceVtkWriterFactory = SurfaceVtkWriterFactory::New();
ObjectFactoryBase::RegisterFactory(surfaceVtkWriterFactory);
IsRegistered = true;
}
}
protected:
SurfaceVtkWriterFactory();
~SurfaceVtkWriterFactory() override;
private:
SurfaceVtkWriterFactory(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
#endif
diff --git a/Modules/LegacyIO/mitkVtiFileReader.h b/Modules/LegacyIO/mitkVtiFileReader.h
index 375ada5b20..3d4ac146b4 100644
--- a/Modules/LegacyIO/mitkVtiFileReader.h
+++ b/Modules/LegacyIO/mitkVtiFileReader.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef VtiFileReader_H_HEADER_INCLUDED
#define VtiFileReader_H_HEADER_INCLUDED
#include "mitkFileReader.h"
#include "mitkImageSource.h"
#include <MitkLegacyIOExports.h>
namespace mitk
{
//##Documentation
//## @brief Reader to read image files in vtk file format
//## @ingroup MitkLegacyIOModule
//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
class DEPRECATED() MITKLEGACYIO_EXPORT VtiFileReader : public ImageSource, public FileReader
{
public:
mitkClassMacro(VtiFileReader, FileReader);
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkSetStringMacro(FileName);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkSetStringMacro(FileName);
itkGetStringMacro(FileName);
itkSetStringMacro(FilePrefix);
itkGetStringMacro(FilePrefix);
itkSetStringMacro(FilePattern);
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
protected:
VtiFileReader();
~VtiFileReader() override;
void GenerateData() override;
//##Description
//## @brief Time when Header was last read
// itk::TimeStamp m_ReadHeaderTime;
protected:
std::string m_FileName;
std::string m_FilePrefix;
std::string m_FilePattern;
};
} // namespace mitk
#endif /* VtiFileReader_H_HEADER_INCLUDED */
diff --git a/Modules/LegacyIO/mitkVtkImageReader.h b/Modules/LegacyIO/mitkVtkImageReader.h
index 04fcda9c87..2ad5a34e45 100644
--- a/Modules/LegacyIO/mitkVtkImageReader.h
+++ b/Modules/LegacyIO/mitkVtkImageReader.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef VtkImageReader_H_HEADER_INCLUDED
#define VtkImageReader_H_HEADER_INCLUDED
#include "mitkFileReader.h"
#include "mitkImageSource.h"
#include <MitkLegacyIOExports.h>
namespace mitk
{
//##Documentation
//## @brief Reader to read image files in vtk file format
//## @ingroup MitkLegacyIOModule
//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
class DEPRECATED() MITKLEGACYIO_EXPORT VtkImageReader : public ImageSource, public FileReader
{
public:
mitkClassMacro(VtkImageReader, FileReader);
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkSetStringMacro(FileName);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkSetStringMacro(FileName);
itkGetStringMacro(FileName);
itkSetStringMacro(FilePrefix);
itkGetStringMacro(FilePrefix);
itkSetStringMacro(FilePattern);
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
protected:
VtkImageReader();
~VtkImageReader() override;
void GenerateData() override;
//##Description
//## @brief Time when Header was last read
// itk::TimeStamp m_ReadHeaderTime;
protected:
std::string m_FileName;
std::string m_FilePrefix;
std::string m_FilePattern;
};
} // namespace mitk
#endif /* VtkImageReader_H_HEADER_INCLUDED */
diff --git a/Modules/LegacyIO/mitkVtkSurfaceReader.h b/Modules/LegacyIO/mitkVtkSurfaceReader.h
index e9442dd420..43eda5431b 100644
--- a/Modules/LegacyIO/mitkVtkSurfaceReader.h
+++ b/Modules/LegacyIO/mitkVtkSurfaceReader.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef VtkSurfaceReader_H_HEADER_INCLUDED
#define VtkSurfaceReader_H_HEADER_INCLUDED
#include "mitkSurfaceSource.h"
#include <MitkLegacyIOExports.h>
namespace mitk
{
//##Documentation
//## @brief Reader to read surface files in vtk-format
//## @ingroup MitkLegacyIOModule
//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
class MITKLEGACYIO_EXPORT VtkSurfaceReader : public SurfaceSource
{
public:
mitkClassMacro(VtkSurfaceReader, SurfaceSource);
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkSetStringMacro(FileName);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkSetStringMacro(FileName);
itkGetStringMacro(FileName);
itkSetStringMacro(FilePrefix);
itkGetStringMacro(FilePrefix);
itkSetStringMacro(FilePattern);
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
protected:
void GenerateData() override;
VtkSurfaceReader();
~VtkSurfaceReader() override;
std::string m_FileName, m_FilePrefix, m_FilePattern;
};
} // namespace mitk
#endif /* VtkSurfaceReader_H_HEADER_INCLUDED */
diff --git a/Modules/MapperExt/include/mitkEnhancedPointSetVtkMapper3D.h b/Modules/MapperExt/include/mitkEnhancedPointSetVtkMapper3D.h
index 79d4a4c1bd..20ac8bd42b 100644
--- a/Modules/MapperExt/include/mitkEnhancedPointSetVtkMapper3D.h
+++ b/Modules/MapperExt/include/mitkEnhancedPointSetVtkMapper3D.h
@@ -1,117 +1,119 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKEnhancedPointSetVtkMapper3D_H_HEADER_INCLUDED_C1907273
#define MITKEnhancedPointSetVtkMapper3D_H_HEADER_INCLUDED_C1907273
#include "MitkMapperExtExports.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkPointSet.h"
#include "mitkVector.h"
#include "mitkVtkMapper.h"
class vtkActor;
class vtkAssembly;
class vtkSphereSource;
class vtkCubeSource;
class vtkConeSource;
class vtkCylinderSource;
class vtkTubeFilter;
class vtkProp;
namespace mitk
{
/**
* \brief Alternative Vtk-based 3D mapper for mitk::PointSet
*
* This class renders mitk::PointSet objects in 3D views. It resembles the
* standard mitk::PointSetVtkMapper3D, but is designed to enable single
* points to be rendered with individual appearances.
*
* Instead of assembling one vtkPolyData object containing all points,
* a list of VTK source objects (spheres, cubes, cones, ...) is maintained.
* Therefore, the application can change the appearance and/or type of a
* specific point at runtime, without having to rebuild the
*
* You should use this class instead of the standard mapper if you
*
* - change the PointSet very often (by adding or removing points)
* - need different representations for points (+++)
* - want to change the point representation frequently (+++)
*
* Note: the class is still in experimental stage, and the points above
* marked with (+++) are not yet working correctly. Also, drawing lines
* between points (contour mode) is not yet supported. The class will be
* extended so that point representations are stored in a lookup table,
* which is indexed by point data from the rendered PointSet.
*
* \warn This mapper requires the PointData container to be the same size
* as the point container.
*
* \sa PointSetVtkMapper3D
*/
class MITKMAPPEREXT_EXPORT EnhancedPointSetVtkMapper3D : public VtkMapper
{
public:
mitkClassMacro(EnhancedPointSetVtkMapper3D, VtkMapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
virtual const mitk::PointSet *GetInput();
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
void UpdateVtkTransform(mitk::BaseRenderer *renderer) override;
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
LocalStorageHandler<BaseLocalStorage> m_LSH;
protected:
EnhancedPointSetVtkMapper3D();
~EnhancedPointSetVtkMapper3D() override;
void RemoveEntryFromSourceMaps(mitk::PointSet::PointIdentifier pointID);
void DeleteVtkObject(vtkObject *o); // functor for stl_each in destructor
// update all vtk sources, mappers, actors with current data and properties
void UpdateVtkObjects();
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor *actor) override;
typedef mitk::PointSet::PointIdentifier PointIdentifier;
typedef std::map<PointIdentifier, vtkSphereSource *> SphereSourceMap;
typedef std::map<PointIdentifier, vtkCubeSource *> CubeSourceMap;
typedef std::map<PointIdentifier, vtkConeSource *> ConeSourceMap;
typedef std::map<PointIdentifier, vtkCylinderSource *> CylinderSourceMap;
typedef std::pair<vtkActor *, mitk::PointSpecificationType> ActorAndPointType;
typedef std::map<PointIdentifier, ActorAndPointType> ActorMap;
SphereSourceMap m_SphereSources; // stores all sphere sources
CubeSourceMap m_CubeSources; // stores all cube sources
ConeSourceMap m_ConeSources; // stores all cone sources
CylinderSourceMap m_CylinderSources; // stores all cylinder sources
ActorMap m_PointActors; // stores an actor for each point(referenced by its ID) and the currently used pointspec =
// which source type is generating the polydata
vtkActor *m_Contour;
vtkTubeFilter *m_ContourSource;
vtkAssembly *m_PropAssembly; // this contains everything, this will be returned by GetVtkProp()
};
} // namespace mitk
#endif /* MITKEnhancedPointSetVtkMapper3D_H_HEADER_INCLUDED_C1907273 */
diff --git a/Modules/MapperExt/include/mitkGPUVolumeMapper3D.h b/Modules/MapperExt/include/mitkGPUVolumeMapper3D.h
index 1b7f5f0fdb..46fff93757 100644
--- a/Modules/MapperExt/include/mitkGPUVolumeMapper3D.h
+++ b/Modules/MapperExt/include/mitkGPUVolumeMapper3D.h
@@ -1,160 +1,162 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKGPUVOLUMEMAPPER3D_H_HEADER_INCLUDED
#define MITKGPUVOLUMEMAPPER3D_H_HEADER_INCLUDED
// MITK
#include "MitkMapperExtExports.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkImage.h"
#include "mitkVtkMapper.h"
// VTK
#include <vtkFixedPointVolumeRayCastMapper.h>
#include <vtkGPUVolumeRayCastMapper.h>
#include <vtkImageChangeInformation.h>
#include <vtkSmartPointer.h>
#include <vtkVersionMacros.h>
#include <vtkVolumeProperty.h>
#include "vtkMitkGPUVolumeRayCastMapper.h"
namespace mitk
{
/************************************************************************/
/* Properties that influence the mapper are:
*
* - \b "level window": for the level window of the volume data
* - \b "LookupTable" : for the lookup table of the volume data
* - \b "TransferFunction" (mitk::TransferFunctionProperty): for the used transfer function of the volume data
************************************************************************/
//##Documentation
//## @brief Vtk-based mapper for VolumeData
//##
//## @ingroup Mapper
class MITKMAPPEREXT_EXPORT GPUVolumeMapper3D : public VtkMapper
{
public:
mitkClassMacro(GPUVolumeMapper3D, VtkMapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
virtual const mitk::Image *GetInput();
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
void ApplyProperties(vtkActor *actor, mitk::BaseRenderer *renderer) override;
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
/** Returns true if this Mapper currently allows for Level-of-Detail rendering.
* This reflects whether this Mapper currently invokes StartEvent, EndEvent, and
* ProgressEvent on BaseRenderer. */
bool IsLODEnabled(BaseRenderer *renderer = nullptr) const override;
bool IsMIPEnabled(BaseRenderer *renderer = nullptr);
bool IsGPUEnabled(BaseRenderer *renderer = nullptr);
bool IsRAYEnabled(BaseRenderer *renderer = nullptr);
void MitkRenderVolumetricGeometry(mitk::BaseRenderer *renderer) override;
protected:
GPUVolumeMapper3D();
~GPUVolumeMapper3D() override;
bool IsRenderable(mitk::BaseRenderer *renderer);
void InitCommon();
void DeinitCommon();
void InitCPU(mitk::BaseRenderer *renderer);
void DeinitCPU(mitk::BaseRenderer *renderer);
void GenerateDataCPU(mitk::BaseRenderer *renderer);
bool InitGPU(mitk::BaseRenderer *renderer);
void DeinitGPU(mitk::BaseRenderer *);
void GenerateDataGPU(mitk::BaseRenderer *);
bool InitRAY(mitk::BaseRenderer *renderer);
void DeinitRAY(mitk::BaseRenderer *renderer);
void GenerateDataRAY(mitk::BaseRenderer *renderer);
void InitVtkMapper(mitk::BaseRenderer *renderer);
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
void CreateDefaultTransferFunctions();
void UpdateTransferFunctions(mitk::BaseRenderer *renderer);
vtkSmartPointer<vtkVolume> m_Volumenullptr;
bool m_commonInitialized;
vtkSmartPointer<vtkImageChangeInformation> m_UnitSpacingImageFilter;
vtkSmartPointer<vtkPiecewiseFunction> m_DefaultOpacityTransferFunction;
vtkSmartPointer<vtkPiecewiseFunction> m_DefaultGradientTransferFunction;
vtkSmartPointer<vtkColorTransferFunction> m_DefaultColorTransferFunction;
vtkSmartPointer<vtkPiecewiseFunction> m_BinaryOpacityTransferFunction;
vtkSmartPointer<vtkPiecewiseFunction> m_BinaryGradientTransferFunction;
vtkSmartPointer<vtkColorTransferFunction> m_BinaryColorTransferFunction;
class LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
// NO SMARTPOINTER HERE
vtkRenderWindow *m_VtkRenderWindow;
bool m_cpuInitialized;
vtkSmartPointer<vtkVolume> m_VolumeCPU;
vtkSmartPointer<vtkFixedPointVolumeRayCastMapper> m_MapperCPU;
vtkSmartPointer<vtkVolumeProperty> m_VolumePropertyCPU;
bool m_gpuSupported;
bool m_gpuInitialized;
vtkSmartPointer<vtkVolume> m_VolumeGPU;
vtkSmartPointer<vtkVolumeProperty> m_VolumePropertyGPU;
bool m_raySupported;
bool m_rayInitialized;
vtkSmartPointer<vtkVolume> m_VolumeRAY;
vtkSmartPointer<vtkGPUVolumeRayCastMapper> m_MapperRAY;
vtkSmartPointer<vtkVolumeProperty> m_VolumePropertyRAY;
LocalStorage()
{
m_VtkRenderWindow = nullptr;
m_cpuInitialized = false;
m_gpuInitialized = false;
m_gpuSupported = true; // assume initially gpu slicing is supported
m_rayInitialized = false;
m_raySupported = true; // assume initially gpu raycasting is supported
}
~LocalStorage() override
{
if (m_cpuInitialized && m_MapperCPU && m_VtkRenderWindow)
m_MapperCPU->ReleaseGraphicsResources(m_VtkRenderWindow);
if (m_rayInitialized && m_MapperRAY && m_VtkRenderWindow)
m_MapperRAY->ReleaseGraphicsResources(m_VtkRenderWindow);
}
};
mitk::LocalStorageHandler<LocalStorage> m_LSH;
};
} // namespace mitk
#endif /* MITKVOLUMEDATAVTKMAPPER3D_H_HEADER_INCLUDED */
diff --git a/Modules/MapperExt/include/mitkMeshMapper2D.h b/Modules/MapperExt/include/mitkMeshMapper2D.h
index 776be3b4e5..30926d3089 100644
--- a/Modules/MapperExt/include/mitkMeshMapper2D.h
+++ b/Modules/MapperExt/include/mitkMeshMapper2D.h
@@ -1,51 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKMESHMAPPER2D_H_HEADER_INCLUDED
#define MITKMESHMAPPER2D_H_HEADER_INCLUDED
#include "MitkMapperExtExports.h"
#include "mitkCommon.h"
#include "mitkGLMapper.h"
namespace mitk
{
class BaseRenderer;
class Mesh;
/**
* \brief OpenGL-based mapper to display a mesh in a 2D window
*
* \todo implement for AbstractTransformGeometry.
* \ingroup Mapper
*/
class MITKMAPPEREXT_EXPORT MeshMapper2D : public GLMapper
{
public:
mitkClassMacro(MeshMapper2D, GLMapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/** @brief Get the Mesh to map */
const mitk::Mesh *GetInput(void);
void Paint(mitk::BaseRenderer *renderer) override;
protected:
MeshMapper2D();
~MeshMapper2D() override;
};
} // namespace mitk
#endif /* MITKMESHMapper2D_H_HEADER_INCLUDED */
diff --git a/Modules/MapperExt/include/mitkMeshVtkMapper3D.h b/Modules/MapperExt/include/mitkMeshVtkMapper3D.h
index 2a33a7d372..59391e03f4 100644
--- a/Modules/MapperExt/include/mitkMeshVtkMapper3D.h
+++ b/Modules/MapperExt/include/mitkMeshVtkMapper3D.h
@@ -1,85 +1,87 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKMESHVTKMAPPER3D_H_HEADER_INCLUDED
#define MITKMESHVTKMAPPER3D_H_HEADER_INCLUDED
#include "MitkMapperExtExports.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkMesh.h"
#include "mitkVtkMapper.h"
#include <vtkAppendPolyData.h>
#include <vtkCellArray.h>
#include <vtkFloatArray.h>
#include <vtkLinearTransform.h>
#include <vtkPointData.h>
#include <vtkPoints.h>
#include <vtkPolyData.h>
#include <vtkSphereSource.h>
#include <vtkTextSource.h>
#include <vtkTransformPolyDataFilter.h>
#include <vtkTubeFilter.h>
#include <vtkVectorText.h>
class vtkActor;
class vtkAssembly;
class vtkFollower;
class vtkPolyDataMapper;
class vtkPropAssembly;
namespace mitk
{
/**
* \brief Vtk-based mapper for PointList
* \ingroup Mapper
*/
class MITKMAPPEREXT_EXPORT MeshVtkMapper3D : public VtkMapper
{
public:
mitkClassMacro(MeshVtkMapper3D, VtkMapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
virtual const mitk::Mesh *GetInput();
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
void UpdateVtkTransform(mitk::BaseRenderer *renderer) override;
LocalStorageHandler<BaseLocalStorage> m_LSH;
protected:
MeshVtkMapper3D();
~MeshVtkMapper3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
void ResetMapper(BaseRenderer *renderer) override;
vtkPropAssembly *m_PropAssembly;
vtkActor *m_SpheresActor;
vtkActor *m_ContourActor;
vtkPolyDataMapper *m_ContourMapper;
vtkPolyDataMapper *m_SpheresMapper;
vtkPolyDataMapper *m_TextVtkPolyDataMapper;
vtkAppendPolyData *m_Spheres;
vtkPolyData *m_Contour;
};
} // namespace mitk
#endif /* MITKMESHVTKMAPPER3D_H_HEADER_INCLUDED*/
diff --git a/Modules/MapperExt/include/mitkSplineVtkMapper3D.h b/Modules/MapperExt/include/mitkSplineVtkMapper3D.h
index a26bc7610d..c4792712f3 100644
--- a/Modules/MapperExt/include/mitkSplineVtkMapper3D.h
+++ b/Modules/MapperExt/include/mitkSplineVtkMapper3D.h
@@ -1,85 +1,87 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_SPLINE_VTK_MAPPER_3D__H
#define _MITK_SPLINE_VTK_MAPPER_3D__H
#include "MitkMapperExtExports.h"
#include "mitkPointSetVtkMapper3D.h"
class vtkActor;
class vtkAssembly;
namespace mitk
{
/**
* @brief Vtk-based mapper for Splines.
*
* The mapper inherits from mitk::PointSetVTKMapper3D and renders a spline in 3D, using a mitk pointset as input.
*
*
* Properties that can be set for splines which affect the mitk::SplineVtkMapper3D are:
*
* - \b "line width": (FloatProperty) width of the spline
*
* There might be still some other, deprecated properties. These will not be documented anymore.
* Please check the source if you really need them.
*
* @ingroup Mapper
*/
class MITKMAPPEREXT_EXPORT SplineVtkMapper3D : public PointSetVtkMapper3D
{
public:
mitkClassMacro(SplineVtkMapper3D, PointSetVtkMapper3D);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
void UpdateVtkTransform(mitk::BaseRenderer *renderer) override;
bool SplinesAreAvailable();
vtkPolyData *GetSplinesPolyData();
vtkActor *GetSplinesActor();
virtual void UpdateSpline();
itkSetMacro(SplineResolution, unsigned int);
itkGetMacro(SplineResolution, unsigned int);
protected:
SplineVtkMapper3D();
~SplineVtkMapper3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
void ApplyAllProperties(BaseRenderer *renderer, vtkActor *actor) override;
vtkActor *m_SplinesActor;
vtkPropAssembly *m_SplineAssembly;
bool m_SplinesAvailable;
bool m_SplinesAddedToAssembly;
unsigned int m_SplineResolution;
itk::TimeStamp m_SplineUpdateTime;
};
} // namespace mitk
#endif
diff --git a/Modules/MapperExt/include/mitkUnstructuredGridMapper2D.h b/Modules/MapperExt/include/mitkUnstructuredGridMapper2D.h
index 513837f470..b71100bcd6 100644
--- a/Modules/MapperExt/include/mitkUnstructuredGridMapper2D.h
+++ b/Modules/MapperExt/include/mitkUnstructuredGridMapper2D.h
@@ -1,105 +1,107 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MitkPointSetSliceLMapper2D_H
#define MitkPointSetSliceLMapper2D_H
#include "MitkMapperExtExports.h"
#include "mitkColorProperty.h"
#include "mitkCommon.h"
#include "mitkGLMapper.h"
#include "mitkProperties.h"
#include "mitkTransferFunction.h"
#include "mitkVtkScalarModeProperty.h"
class vtkPointSetSlicer;
class vtkPlane;
class vtkLookupTable;
class vtkPointSet;
class vtkScalarsToColors;
class vtkPiecewiseFunction;
class vtkAbstractMapper3D;
namespace mitk
{
class BaseRenderer;
/**
* @brief OpenGL-based mapper to display a 2d cut through a poly data
* OpenGL-based mapper to display a 2D cut through a poly data. The result is
* normally a line. This class can be added to any data object, which is
* rendered in 3D via a vtkPolyData.
*/
class MITKMAPPEREXT_EXPORT UnstructuredGridMapper2D : public GLMapper
{
public:
mitkClassMacro(UnstructuredGridMapper2D, GLMapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/**
* Renders a cut through a pointset by cutting trough the n-cells,
* producing (n-1)-cells.
* @param renderer the render to render in.
*/
void Paint(mitk::BaseRenderer *renderer) override;
LocalStorageHandler<BaseLocalStorage> m_LSH;
protected:
UnstructuredGridMapper2D();
~UnstructuredGridMapper2D() override;
void GenerateDataForRenderer(BaseRenderer *) override;
/**
* Determines, if the associated BaseData is mapped three-dimensionally (mapper-slot id 2)
* with a class convertable to vtkAbstractMapper3D().
* @returns nullptr if it is not convertable or the appropriate Mapper otherwise
*/
virtual vtkAbstractMapper3D *GetVtkAbstractMapper3D(BaseRenderer *renderer);
/**
* Determines the pointset object to be cut.
* returns the pointset if possible, otherwise nullptr.
*/
virtual vtkPointSet *GetVtkPointSet(BaseRenderer *renderer, int time = 0);
/**
* Determines the LookupTable used by the associated vtkMapper.
* returns the LUT if possible, otherwise nullptr.
*/
virtual vtkScalarsToColors *GetVtkLUT(BaseRenderer *renderer);
/**
* Checks if this mapper can be used to generate cuts through the associated
* base data.
* @return true if yes or false if not.
*/
virtual bool IsConvertibleToVtkPointSet(BaseRenderer *renderer);
vtkPlane *m_Plane;
vtkPointSetSlicer *m_Slicer;
vtkPointSet *m_VtkPointSet;
vtkScalarsToColors *m_ScalarsToColors;
vtkPiecewiseFunction *m_ScalarsToOpacity;
mitk::ColorProperty::Pointer m_Color;
mitk::IntProperty::Pointer m_LineWidth;
mitk::BoolProperty::Pointer m_Outline;
mitk::BoolProperty::Pointer m_ScalarVisibility;
mitk::VtkScalarModeProperty::Pointer m_ScalarMode;
};
} // namespace mitk
#endif /* MitkPointSetSliceLMapper2D_H */
diff --git a/Modules/MapperExt/include/mitkUnstructuredGridVtkMapper3D.h b/Modules/MapperExt/include/mitkUnstructuredGridVtkMapper3D.h
index 618d2f81cb..c2b520c224 100644
--- a/Modules/MapperExt/include/mitkUnstructuredGridVtkMapper3D.h
+++ b/Modules/MapperExt/include/mitkUnstructuredGridVtkMapper3D.h
@@ -1,83 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_UNSTRUCTURED_GRID_VTK_MAPPER_3D_H_
#define _MITK_UNSTRUCTURED_GRID_VTK_MAPPER_3D_H_
#include "MitkMapperExtExports.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkUnstructuredGrid.h"
#include "mitkVtkMapper.h"
#include <vtkActor.h>
#include <vtkAssembly.h>
#include <vtkDataSetTriangleFilter.h>
#include <vtkVolume.h>
#include "vtkUnstructuredGridMapper.h"
#include <vtkUnstructuredGridVolumeRayCastMapper.h>
#include <vtkProjectedTetrahedraMapper.h>
#include <vtkUnstructuredGridVolumeZSweepMapper.h>
namespace mitk
{
//##Documentation
//## @brief Vtk-based mapper for UnstructuredGrid
//##
//## @ingroup Mapper
class MITKMAPPEREXT_EXPORT UnstructuredGridVtkMapper3D : public VtkMapper
{
public:
mitkClassMacro(UnstructuredGridVtkMapper3D, VtkMapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
virtual const mitk::UnstructuredGrid *GetInput();
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
void ApplyProperties(vtkActor * /*actor*/, mitk::BaseRenderer *renderer) override;
LocalStorageHandler<BaseLocalStorage> m_LSH;
protected:
UnstructuredGridVtkMapper3D();
~UnstructuredGridVtkMapper3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
void ResetMapper(BaseRenderer * /*renderer*/) override;
void SetProperties(mitk::BaseRenderer *renderer);
vtkAssembly *m_Assembly;
vtkActor *m_Actor;
vtkActor *m_ActorWireframe;
vtkVolume *m_Volume;
vtkDataSetTriangleFilter *m_VtkTriangleFilter;
vtkUnstructuredGridMapper *m_VtkDataSetMapper;
vtkUnstructuredGridMapper *m_VtkDataSetMapper2;
vtkUnstructuredGridVolumeRayCastMapper *m_VtkVolumeRayCastMapper;
vtkProjectedTetrahedraMapper *m_VtkPTMapper;
vtkUnstructuredGridVolumeZSweepMapper *m_VtkVolumeZSweepMapper;
};
} // namespace mitk
#endif /* _MITK_UNSTRUCTURED_GRID_VTK_MAPPER_3D_H_ */
diff --git a/Modules/MapperExt/include/mitkVectorImageMapper2D.h b/Modules/MapperExt/include/mitkVectorImageMapper2D.h
index 6555ee96ea..1f0cf605e3 100644
--- a/Modules/MapperExt/include/mitkVectorImageMapper2D.h
+++ b/Modules/MapperExt/include/mitkVectorImageMapper2D.h
@@ -1,88 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_VECTOR_IMAGE_MAPPER_2D__H_
#define _MITK_VECTOR_IMAGE_MAPPER_2D__H_
#include "MitkMapperExtExports.h"
#include "mitkCommon.h"
#include "mitkGLMapper.h"
#include "mitkImage.h"
class vtkLookupTable;
class vtkScalarsToColors;
class vtkImageReslice;
class vtkPolyData;
class vtkGlyph2D;
class vtkPlane;
class vtkCutter;
namespace mitk
{
class BaseRenderer;
class PlaneGeometry;
class MITKMAPPEREXT_EXPORT VectorImageMapper2D : public GLMapper
{
public:
mitkClassMacro(VectorImageMapper2D, GLMapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) typedef double vtkScalarType;
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self) typedef double vtkScalarType;
/**
* @returns the image held by the associated with the mapper or the image
* which has been explicitly set by SetImage(...)
*/
const mitk::Image *GetInput(void);
void Paint(mitk::BaseRenderer *renderer) override;
/**
* Explicitly set an vector image. This image will be used for
* rendering instead of the image returned by GetData()
*/
itkSetConstObjectMacro(Image, mitk::Image);
/**
* Get the explicitly set image
* @returns nullptr if no Image has been set instead of GetData();
*/
itkGetConstObjectMacro(Image, mitk::Image);
virtual void PaintCells(vtkPolyData *contour,
const PlaneGeometry * /*worldGeometry*/,
vtkLinearTransform *vtktransform,
BaseRenderer *renderer,
vtkScalarsToColors *lut,
mitk::Color color,
float lwidth,
double *spacing);
protected:
int GetCurrentTimeStep(mitk::BaseData *data, mitk::BaseRenderer *renderer);
VectorImageMapper2D();
~VectorImageMapper2D() override;
mitk::Image::ConstPointer m_Image;
vtkLookupTable *m_LUT;
vtkPlane *m_Plane;
vtkCutter *m_Cutter;
};
} // namespace mitk
#endif
diff --git a/Modules/MapperExt/include/mitkVolumeMapperVtkSmart3D.h b/Modules/MapperExt/include/mitkVolumeMapperVtkSmart3D.h
index d2c6e6ccba..9745bc07c2 100644
--- a/Modules/MapperExt/include/mitkVolumeMapperVtkSmart3D.h
+++ b/Modules/MapperExt/include/mitkVolumeMapperVtkSmart3D.h
@@ -1,79 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKVTKSMARTVOLUMEMAPPER_H_HEADER_INCLUDED
#define MITKVTKSMARTVOLUMEMAPPER_H_HEADER_INCLUDED
// MITK
#include "MitkMapperExtExports.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkImage.h"
#include "mitkVtkMapper.h"
// VTK
#include <vtkImageChangeInformation.h>
#include <vtkSmartPointer.h>
#include <vtkVersionMacros.h>
#include <vtkVolumeProperty.h>
#include <vtkSmartVolumeMapper.h>
#include <vtkImageData.h>
#include <vtkImageChangeInformation.h>
class vtkRenderingOpenGL2ObjectFactory;
class vtkRenderingVolumeOpenGL2ObjectFactory;
namespace mitk
{
//##Documentation
//## @brief Vtk-based mapper for VolumeData
//##
//## @ingroup Mapper
class MITKMAPPEREXT_EXPORT VolumeMapperVtkSmart3D : public VtkMapper
{
public:
mitkClassMacro(VolumeMapperVtkSmart3D, VtkMapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
void ApplyProperties(vtkActor *actor, mitk::BaseRenderer *renderer) override;
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
protected:
VolumeMapperVtkSmart3D();
~VolumeMapperVtkSmart3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
void createMapper(vtkImageData*);
void createVolume();
void createVolumeProperty();
vtkImageData* GetInputImage();
vtkSmartPointer<vtkVolume> m_Volume;
vtkSmartPointer<vtkImageChangeInformation> m_ImageChangeInformation;
vtkSmartPointer<vtkSmartVolumeMapper> m_SmartVolumeMapper;
vtkSmartPointer<vtkVolumeProperty> m_VolumeProperty;
vtkSmartPointer<vtkRenderingOpenGL2ObjectFactory> m_RenderingOpenGL2ObjectFactory;
vtkSmartPointer<vtkRenderingVolumeOpenGL2ObjectFactory> m_RenderingVolumeOpenGL2ObjectFactory;
void UpdateTransferFunctions(mitk::BaseRenderer *renderer);
void UpdateRenderMode(mitk::BaseRenderer *renderer);
};
} // namespace mitk
#endif /* MITKVTKSMARTVOLUMEMAPPER_H_HEADER_INCLUDED */
diff --git a/Modules/MapperExt/test/CMakeLists.txt b/Modules/MapperExt/test/CMakeLists.txt
index 73f9b305cf..bcc0538ea2 100644
--- a/Modules/MapperExt/test/CMakeLists.txt
+++ b/Modules/MapperExt/test/CMakeLists.txt
@@ -1,5 +1,5 @@
mitk_create_module_tests()
-if(TARGET ${TESTDRIVER} AND MITK_ENABLE_RENDERING_TESTING)
+if(TARGET ${TESTDRIVER})
set_property(TEST mitkSplineVtkMapper3DTest PROPERTY RUN_SERIAL TRUE)
endif()
diff --git a/Modules/MapperExt/test/files.cmake b/Modules/MapperExt/test/files.cmake
index 6e0a4d2dcf..ace07fe6e0 100644
--- a/Modules/MapperExt/test/files.cmake
+++ b/Modules/MapperExt/test/files.cmake
@@ -1,8 +1,3 @@
set(MODULE_TESTS
+ mitkSplineVtkMapper3DTest.cpp
)
-
-if(MITK_ENABLE_RENDERING_TESTING)
- list(APPEND MODULE_TESTS
- mitkSplineVtkMapper3DTest.cpp
- )
-endif()
diff --git a/Modules/MatchPointRegistration/Rendering/mitkRegEvaluationMapper2D.h b/Modules/MatchPointRegistration/Rendering/mitkRegEvaluationMapper2D.h
index a4a832edbe..934346fb63 100644
--- a/Modules/MatchPointRegistration/Rendering/mitkRegEvaluationMapper2D.h
+++ b/Modules/MatchPointRegistration/Rendering/mitkRegEvaluationMapper2D.h
@@ -1,245 +1,245 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_REG_EVALUATION_MAPPER_2D_H
#define MITK_REG_EVALUATION_MAPPER_2D_H
//MatchPoint
#include <mapRegistration.h>
#include "mitkRegEvaluationObject.h"
//MITK
#include <mitkCommon.h>
//MITK Rendering
#include "mitkBaseRenderer.h"
#include "mitkVtkMapper.h"
#include "mitkExtractSliceFilter.h"
//VTK
#include <vtkSmartPointer.h>
#include <vtkPropAssembly.h>
//MITK
#include "MitkMatchPointRegistrationExports.h"
class vtkActor;
class vtkPolyDataMapper;
class vtkPlaneSource;
class vtkImageData;
class vtkLookupTable;
class vtkImageExtractComponents;
class vtkImageReslice;
class vtkImageChangeInformation;
class vtkPoints;
class vtkMitkThickSlicesFilter;
class vtkPolyData;
class vtkMitkApplyLevelWindowToRGBFilter;
class vtkMitkLevelWindowFilter;
namespace mitk {
/** \brief Mapper to resample and display 2D slices of registration evaluation visualization.
* \ingroup Mapper
*/
class MITKMATCHPOINTREGISTRATION_EXPORT RegEvaluationMapper2D : public VtkMapper
{
public:
/** Standard class typedefs. */
mitkClassMacro( RegEvaluationMapper2D,VtkMapper );
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const mitk::DataNode* GetTargetNode(void);
const mitk::DataNode* GetMovingNode(void);
/** \brief Get the target image to map */
const mitk::Image *GetTargetImage(void);
/** \brief Get the moving image to map */
const mitk::Image *GetMovingImage(void);
/** \brief Get the target image to map */
const mitk::MAPRegistrationWrapper *GetRegistration(void);
/** \brief Checks whether this mapper needs to update itself and generate
* data. */
void Update(mitk::BaseRenderer * renderer) override;
//### methods of MITK-VTK rendering pipeline
vtkProp* GetVtkProp(mitk::BaseRenderer* renderer) override;
//### end of methods of MITK-VTK rendering pipeline
/** \brief Internal class holding the mapper, actor, etc. for each of the 3 2D render windows */
/**
* To render transveral, coronal, and sagittal, the mapper is called three times.
* For performance reasons, the corresponding data for each view is saved in the
* internal helper class LocalStorage. This allows rendering n views with just
* 1 mitkMapper using n vtkMapper.
* */
class MITKMATCHPOINTREGISTRATION_EXPORT LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkActor> m_Actor;
vtkSmartPointer<vtkPropAssembly> m_Actors;
/** \brief Mapper of a 2D render window. */
vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
/** \brief Current slice of a 2D render window.*/
vtkSmartPointer<vtkImageData> m_EvaluationImage;
/** \brief Empty vtkPolyData that is set when rendering geometry does not
* intersect the image geometry.
* \warning This member variable is set to nullptr,
* if no image geometry is inside the plane geometry
* of the respective render window. Any user of this
* slice has to check whether it is set to nullptr!
*/
vtkSmartPointer<vtkPolyData> m_EmptyPolyData;
/** \brief Plane on which the slice is rendered as texture. */
vtkSmartPointer<vtkPlaneSource> m_Plane;
/** \brief The texture which is used to render the current slice. */
vtkSmartPointer<vtkTexture> m_Texture;
/** \brief The lookuptables for colors and level window */
vtkSmartPointer<vtkLookupTable> m_ColorLookupTable;
vtkSmartPointer<vtkLookupTable> m_DefaultLookupTable;
/** \brief The actual reslicer (one per renderer) */
mitk::ExtractSliceFilter::Pointer m_Reslicer;
/** part of the target image that is relevant for the rendering*/
mitk::Image::Pointer m_slicedTargetImage;
/** part of the moving image mapped into the slicedTargetImage
geometry*/
mitk::Image::Pointer m_slicedMappedImage;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief mmPerPixel relation between pixel and mm. (World spacing).*/
mitk::ScalarType* m_mmPerPixel;
/** \brief This filter is used to apply the level window to target image. */
vtkSmartPointer<vtkMitkLevelWindowFilter> m_TargetLevelWindowFilter;
/** \brief This filter is used to apply the level window to moving image. */
vtkSmartPointer<vtkMitkLevelWindowFilter> m_MappedLevelWindowFilter;
vtkSmartPointer<vtkImageExtractComponents> m_TargetExtractFilter;
vtkSmartPointer<vtkImageExtractComponents> m_MappedExtractFilter;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage() override;
};
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
/** \brief Get the LocalStorage corresponding to the current renderer. */
LocalStorage* GetLocalStorage(mitk::BaseRenderer* renderer);
/** \brief Set the default properties for general image rendering. */
static void SetDefaultProperties(mitk::DataNode* node, mitk::BaseRenderer* renderer = nullptr, bool overwrite = false);
protected:
/** \brief Transforms the actor to the actual position in 3D.
* \param renderer The current renderer corresponding to the render window.
*/
void TransformActor(mitk::BaseRenderer* renderer);
/** \brief Generates a plane according to the size of the resliced image in milimeters.
*
* \image html texturedPlane.png
*
* In VTK a vtkPlaneSource is defined through three points. The origin and two
* points defining the axes of the plane (see VTK documentation). The origin is
* set to (xMin; yMin; Z), where xMin and yMin are the minimal bounds of the
* resliced image in space. Z is relevant for blending and the layer property.
* The center of the plane (C) is also the center of the view plane (cf. the image above).
*
* \note For the standard MITK view with three 2D render windows showing three
* different slices, three such planes are generated. All these planes are generated
* in the XY-plane (even if they depict a YZ-slice of the volume).
*
*/
void GeneratePlane(mitk::BaseRenderer* renderer, double planeBounds[6]);
/** Default constructor */
RegEvaluationMapper2D();
/** Default deconstructor */
~RegEvaluationMapper2D() override;
/** \brief Does the actual resampling, without rendering the image yet.
* All the data is generated inside this method. The vtkProp (or Actor)
* is filled with content (i.e. the resliced image).
*
* After generation, a 4x4 transformation matrix(t) of the current slice is obtained
* from the vtkResliceImage object via GetReslicesAxis(). This matrix is
* applied to each textured plane (actor->SetUserTransform(t)) to transform everything
* to the actual 3D position (cf. the following image).
*
* \image html cameraPositioning3D.png
*
*/
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
void PrepareContour( mitk::DataNode* datanode, LocalStorage * localStorage );
void PrepareDifference( LocalStorage * localStorage );
void PrepareWipe(mitk::DataNode* datanode, LocalStorage * localStorage, const Point2D& currentIndex2D);
void PrepareCheckerBoard( mitk::DataNode* datanode, LocalStorage * localStorage );
void PrepareColorBlend( LocalStorage * localStorage );
void PrepareBlend( mitk::DataNode* datanode, LocalStorage * localStorage );
/** \brief This method uses the vtkCamera clipping range and the layer property
* to calcualte the depth of the object (e.g. image or contour). The depth is used
* to keep the correct order for the final VTK rendering.*/
float CalculateLayerDepth(mitk::BaseRenderer* renderer);
/** \brief This method applies (or modifies) the lookuptable for all types of images.
* \warning To use the lookup table, the property 'Lookup Table' must be set and a 'Image Rendering.Mode'
* which uses the lookup table must be set.
*/
void ApplyLookuptable(mitk::BaseRenderer* renderer, const mitk::DataNode* dataNode, vtkMitkLevelWindowFilter* levelFilter);
/**
* @brief ApplyLevelWindow Apply the level window for the given renderer.
* \warning To use the level window, the property 'LevelWindow' must be set and a 'Image Rendering.Mode' which uses the level window must be set.
* @param renderer Level window for which renderer?
*/
void ApplyLevelWindow(mitk::BaseRenderer *renderer, const mitk::DataNode* dataNode, vtkMitkLevelWindowFilter* levelFilter);
/** \brief Set the opacity of the actor. */
void ApplyOpacity( mitk::BaseRenderer* renderer );
/**
* \brief Calculates whether the given rendering geometry intersects the
* given SlicedGeometry3D.
*
* This method checks if the given PlaneGeometry intersects the given
* SlicedGeometry3D. It calculates the distance of the PlaneGeometry to all
* 8 cornerpoints of the SlicedGeometry3D. If all distances have the same
* sign (all positive or all negative) there is no intersection.
* If the distances have different sign, there is an intersection.
**/
bool RenderingGeometryIntersectsImage( const PlaneGeometry* renderingGeometry, SlicedGeometry3D* imageGeometry );
};
} // namespace mitk
#endif /* MITKRegEvaluationMapper2D_H_HEADER_INCLUDED_C10E906E */
diff --git a/Modules/ModelFit/include/mitkBinaryImageToLabelSetImageFilter.h b/Modules/ModelFit/include/mitkBinaryImageToLabelSetImageFilter.h
index b4aa90543c..9c817e68ab 100644
--- a/Modules/ModelFit/include/mitkBinaryImageToLabelSetImageFilter.h
+++ b/Modules/ModelFit/include/mitkBinaryImageToLabelSetImageFilter.h
@@ -1,63 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkBinaryImageToLabelSetImageFilter_h
#define mitkBinaryImageToLabelSetImageFilter_h
#include <mitkImageToImageFilter.h>
#include "mitkCommon.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/** \brief Converts an binary image to a LabelSetImage. The amount of labels equals the connected components.
*/
class MITKMODELFIT_EXPORT BinaryImageToLabelSetImageFilter : public ImageToImageFilter
{
public:
mitkClassMacro(BinaryImageToLabelSetImageFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void SetInput(const InputImageType* image) override;
void SetInput(unsigned int index, const InputImageType* image) override;
itkSetMacro(FullyConnected, bool);
itkGetConstMacro(FullyConnected, bool);
itkSetMacro(ForegroundValue, unsigned int);
itkGetConstMacro(ForegroundValue, unsigned int);
itkSetMacro(OutputIsLabelSetImage, bool);
itkGetConstMacro(OutputIsLabelSetImage, bool);
private:
using Superclass::SetInput;
BinaryImageToLabelSetImageFilter() = default;
~BinaryImageToLabelSetImageFilter() override = default;
template <typename TPixel, unsigned int VImageDimension>
void ApplyBinaryImageToLabelMapFilter(const itk::Image<TPixel, VImageDimension>* inputImage);
void GenerateData() override;
void VerifyInputInformation() override;
void VerifyInputImage(const mitk::Image* inputImage);
bool m_FullyConnected = true;
unsigned int m_ForegroundValue = 1;
bool m_OutputIsLabelSetImage = false;
};
}
#endif
diff --git a/Modules/ModelFit/include/mitkModelFitInfo.h b/Modules/ModelFit/include/mitkModelFitInfo.h
index 9cc162070e..8189181357 100644
--- a/Modules/ModelFit/include/mitkModelFitInfo.h
+++ b/Modules/ModelFit/include/mitkModelFitInfo.h
@@ -1,202 +1,202 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkModelFitInfo_h
#define mitkModelFitInfo_h
#include <itkMutexLockHolder.h>
#include <itkSimpleFastMutexLock.h>
#include <mitkDataStorage.h>
#include "mitkModelFitConstants.h"
#include "mitkModelFitParameter.h"
#include "mitkModelFitStaticParameterMap.h"
#include "mitkScalarListLookupTable.h"
#include "mitkModelFitUIDHelper.h"
#include "mitkModelParameterizerBase.h"
#include "mitkModelTraitsInterface.h"
#include "MitkModelFitExports.h"
namespace mitk
{
namespace modelFit
{
/**
* @brief Data class that stores all information about a modelfit that is relevant to the
* visualization and stored as properties in the result nodes.
*/
class MITKMODELFIT_EXPORT ModelFitInfo : public itk::LightObject
{
public:
typedef mitk::NodeUIDType UIDType;
typedef std::vector<Parameter::Pointer> ParamListType;
typedef ParamListType::const_iterator ConstIterType;
- mitkClassMacroItkParent(ModelFitInfo, itk::LightObject)
- itkSimpleNewMacro(ModelFitInfo)
+ mitkClassMacroItkParent(ModelFitInfo, itk::LightObject);
+ itkSimpleNewMacro(ModelFitInfo);
ModelFitInfo() :
x(mitk::ModelFitConstants::MODEL_X_VALUE_DEFAULT()),
xAxisName(mitk::ModelFitConstants::XAXIS_NAME_VALUE_DEFAULT()),
yAxisName(mitk::ModelFitConstants::YAXIS_NAME_VALUE_DEFAULT())
{
}
/**
* @brief Adds the given parameter to this fit's parameter list if it doesn't
* exist already.
* @param p The param that should be added to this fit's parameter list.
*/
void AddParameter(Parameter::Pointer p);
/**
* @brief Searches for the parameter with the given name and type in the fit's
* parameter list and returns it.
* @param name The name of the desired parameter.
* @param type The type of the desired parameter.
* @return The parameter with the given name on success or NULL otherwise.
*/
Parameter::ConstPointer GetParameter(const std::string& name, const Parameter::Type& type)
const;
/**
* @brief Searches for the parameter with the given name and type in the fit's
* parameter list and deletes it if it exists.
* @param name The name of the desired parameter.
* @param type The type of the desired parameter.
*/
void DeleteParameter(const std::string& name, const Parameter::Type& type);
/**Return const reference to the parameter list.*/
const ParamListType& GetParameters() const;
/** ModelFitConstants::MODEL_NAME_PROPERTY_NAME */
std::string modelName;
/** ModelFitConstants::MODEL_TYPE_PROPERTY_NAME */
std::string modelType;
/** ModelFitConstants::MODEL_FUNCTION_PROPERTY_NAME */
std::string function;
/** ModelFitConstants::MODEL_FUNCTION_CLASS_PROPERTY_NAME */
std::string functionClassID;
/** ModelFitConstants::MODEL_X_PROPERTY_NAME */
std::string x;
/** ModelFitConstants::XAXIS_NAME_PROPERTY_NAME */
std::string xAxisName;
/** ModelFitConstants::XAXIS_UNIT_PROPERTY_NAME */
std::string xAxisUnit;
/** ModelFitConstants::YAXIS_NAME_PROPERTY_NAME */
std::string yAxisName;
/** ModelFitConstants::YAXIS_UNIT_PROPERTY_NAME */
std::string yAxisUnit;
/** ModelFitConstants::FIT_UID_PROPERTY_NAME */
UIDType uid;
/** ModelFitConstants::FIT_NAME_PROPERTY_NAME */
std::string fitName;
/** ModelFitConstants::FIT_TYPE_PROPERTY_NAME */
std::string fitType;
/** ModelFitConstants::FIT_STATIC_PARAMETERS_PROPERTY_NAME */
StaticParameterMap staticParamMap;
/** ModelFitConstants::FIT_INPUT_ROIUID_PROPERTY_NAME */
UIDType roiUID;
/** ModelFitConstants::FIT_INPUT_IMAGEUID_PROPERTY_NAME */
UIDType inputUID;
/** ModelFitConstants::FIT_INPUT_DATA_PROPERTY_NAME */
ScalarListLookupTable inputData;
mitk::Image::Pointer inputImage;
private:
typedef ParamListType::iterator IterType;
typedef itk::MutexLockHolder<itk::SimpleFastMutexLock> LockType;
ParamListType parameterList;
itk::SimpleFastMutexLock mutex;
};
/**
* @brief Reads the string property with the given name from the data of the given node
* and returns its value. Throws a ModelFitException if the property doesn't exist.
* @param node The node whose property value should be returned.
* @param prop The name of the property that should be read.
* @return The value of the found property.
* @throw ModelFitException If the property doesn't exist or returns an empty string.
*/
MITKMODELFIT_EXPORT const std::string GetMandatoryProperty(const mitk::DataNode* node,
const std::string& prop);
/**
* @brief Reads the string property with the given name from the given base data and
* returns its value. Throws a ModelFitException if the property doesn't exist.
* @param data The data whose property value should be returned.
* @param prop The name of the property that should be read.
* @return The value of the found property.
* @throw ModelFitException If the property doesn't exist or returns an empty string.
*/
MITKMODELFIT_EXPORT const std::string GetMandatoryProperty(const mitk::BaseData* data,
const std::string& prop);
/**
* @brief Creates a new ModelFitInfo instance from the nodes in the passed storage.
* The fit will be identified by the passed UID. Returns the instance on
* success.
* @param uid The uid of the fit that should get its ModelFitInfo created and which identifies the nodes in the storage.
* @param storage Pointer to the data storage containing any potential relevantThe nodes.
* @return The newly created modelfit on success or NULL otherwise.
*/
MITKMODELFIT_EXPORT ModelFitInfo::Pointer CreateFitInfoFromNode(const ModelFitInfo::UIDType& uid,
const mitk::DataStorage* storage);
/** creates a new ModelFitInfo instance from a passed modal instance and his traits instance*
* @param usedModel Pointer to a model which was used for a fit, which should get a fit info created.
* @param modelTraits Pointer to traits interface for the model that was used for the fit.
* @param inputImage Pointer to the input image. If it has no UID yet, a property will be added to the node.
* @param fitType String identifying the type of the fit (e.g. ROI based or voxel based)
* @param fitName Optional human readable name of the fit.
* @param roiUID UID of the ROI, if one was used.
* @return The newly created modelfit on success or NULL otherwise.*/
MITKMODELFIT_EXPORT ModelFitInfo::Pointer CreateFitInfoFromModelParameterizer(
const ModelParameterizerBase* usedParameterizer, mitk::BaseData* inputImage,
const std::string& fitType, const std::string& fitName = "", const NodeUIDType roiUID = "");
/** @overload
Overloaded version that allows additional definition of optional input data for the fit.*/
MITKMODELFIT_EXPORT ModelFitInfo::Pointer CreateFitInfoFromModelParameterizer(
const ModelParameterizerBase* usedParameterizer, mitk::BaseData* inputImage,
const std::string& fitType, const ScalarListLookupTable& inputData, const std::string& fitName = "",
const NodeUIDType roiUID = "");
/** Returns all nodes that belong to the fit indicated by the passed UID.
* @param fitUID The uid of the fit that is relevant for the query.
* @param storage Pointer to the data storage containing any potential relevant nodes.
* @return The set of found nodes or null if storage is not valid.
*/
MITKMODELFIT_EXPORT DataStorage::SetOfObjects::ConstPointer GetNodesOfFit(
const ModelFitInfo::UIDType& fitUID,
const mitk::DataStorage* storage);
typedef std::set<ModelFitInfo::UIDType> NodeUIDSetType;
/** Returns the UIDs of all fits that are derived (directly or indirectly from the passed node).
* @param node The node which defines the parent node. It will be searched in his derived nodes for fits.
* @param storage Pointer to the data storage containing any potential relevant nodes.
* @return The set of found uid will be returned.
*/
MITKMODELFIT_EXPORT NodeUIDSetType GetFitUIDsOfNode(const mitk::DataNode* node,
const mitk::DataStorage* storage);
}
}
#endif // mitkModelFit_h
diff --git a/Modules/ModelFit/include/mitkModelFitParameter.h b/Modules/ModelFit/include/mitkModelFitParameter.h
index 35bc60b29a..14cf751133 100644
--- a/Modules/ModelFit/include/mitkModelFitParameter.h
+++ b/Modules/ModelFit/include/mitkModelFitParameter.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkModelFitParameter_h
#define mitkModelFitParameter_h
#include <mitkImage.h>
#include "mitkModelFitUIDHelper.h"
#include "MitkModelFitExports.h"
namespace mitk
{
namespace modelFit
{
/**
* @brief Data class that stores all information about a modelfit parameter.
* Such a parameter is going to be fitted for the according model.
*/
class MITKMODELFIT_EXPORT Parameter : public itk::LightObject
{
public:
- mitkClassMacroItkParent(Parameter, itk::LightObject)
- itkSimpleNewMacro(Parameter)
+ mitkClassMacroItkParent(Parameter, itk::LightObject);
+ itkSimpleNewMacro(Parameter);
enum Type
{
ParameterType,
DerivedType,
CriterionType,
EvaluationType
};
Parameter();
/** ModelFitConstants::PARAMETER_NAME_PROPERTY_NAME */
std::string name;
/** ModelFitConstants::PARAMETER_TYPE_PROPERTY_NAME */
Type type;
/** ModelFitConstants::PARAMETER_UNIT_PROPERTY_NAME */
std::string unit;
/** ModelFitConstants::PARAMETER_SCALE_PROPERTY_NAME */
float scale;
/** Corresponding image */
mitk::Image::ConstPointer image;
};
/** Extracts the parameter information stored in the data instance and returns it as parameter instance.
* If the data does not encode an parameter/fit result a Null pointer will be returned.
* @param data The data instance that contains parameter information that should be extracted.
* @return The newly created parameter instance on success or NULL otherwise.
*/
MITKMODELFIT_EXPORT Parameter::Pointer ExtractParameterFromData(const mitk::BaseData* data);
}
}
#endif // mitkModelFitParameter_h
diff --git a/Modules/Multilabel/mitkLabelSet.h b/Modules/Multilabel/mitkLabelSet.h
index 83d479c03c..ed8b689f47 100644
--- a/Modules/Multilabel/mitkLabelSet.h
+++ b/Modules/Multilabel/mitkLabelSet.h
@@ -1,235 +1,239 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkLabelSet_H_
#define __mitkLabelSet_H_
#include "MitkMultilabelExports.h"
#include <mitkLookupTable.h>
#include <mitkMessage.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <mitkLabel.h>
namespace mitk
{
//
// Documentation
// @brief LabelSet containing the labels corresponding to a segmentation session.
// @ingroup Data
//
class MITKMULTILABEL_EXPORT LabelSet : public itk::Object
{
public:
mitkClassMacroItkParent(LabelSet, itk::Object);
itkNewMacro(Self);
typedef mitk::Label::PixelType PixelType;
typedef std::map<PixelType, Label::Pointer> LabelContainerType;
typedef LabelContainerType::const_iterator LabelContainerConstIteratorType;
typedef LabelContainerType::iterator LabelContainerIteratorType;
/**
* \brief AddLabelEvent is emitted whenever a new label has been added to the LabelSet.
*
* Observers should register to this event by calling myLabelSet->AddLabelEvent.AddListener(myObject,
* MyObject::MyMethod).
* After registering, myObject->MyMethod() will be called every time a new label has been added to the LabelSet.
* Observers should unregister by calling myLabelSet->AddLabelEvent.RemoveListener(myObject, MyObject::MyMethod).
*
* member variable is not needed to be locked in multi-threaded scenarios since the LabelSetEvent is a typedef for
* a Message1 object which is thread safe
*/
Message<> AddLabelEvent;
/**
* \brief RemoveLabelEvent is emitted whenever a new label has been removed from the LabelSet.
*
* Observers should register to this event by calling myLabelSet->RemoveLabelEvent.AddListener(myObject,
* MyObject::MyMethod).
* After registering, myObject->MyMethod() will be called every time a new label has been removed from the LabelSet.
* Observers should unregister by calling myLabelSet->RemoveLabelEvent.RemoveListener(myObject, MyObject::MyMethod).
*
* member variable is not needed to be locked in multi-threaded scenarios since the LabelSetEvent is a typedef for
* a Message object which is thread safe
*/
Message<> RemoveLabelEvent;
/**
* \brief ModifyLabelEvent is emitted whenever a label has been modified from the LabelSet.
*
* Observers should register to this event by calling myLabelSet->ModifyLabelEvent.AddListener(myObject,
* MyObject::MyMethod).
* After registering, myObject->MyMethod() will be called every time a new label has been removed from the LabelSet.
* Observers should unregister by calling myLabelSet->ModifyLabelEvent.RemoveListener(myObject, MyObject::MyMethod).
*
* member variable is not needed to be locked in multi-threaded scenarios since the LabelSetEvent is a typedef for
* a Message object which is thread safe
*/
Message<> ModifyLabelEvent;
/**
* \brief ActiveLabelEvent is emitted whenever a label has been set as active in the LabelSet.
*/
Message1<PixelType> ActiveLabelEvent;
/**
* \brief AllLabelsModifiedEvent is emitted whenever a new label has been removed from the LabelSet.
*
* Observers should register to this event by calling myLabelSet->AllLabelsModifiedEvent.AddListener(myObject,
* MyObject::MyMethod).
* After registering, myObject->MyMethod() will be called every time a new label has been removed from the LabelSet.
* Observers should unregister by calling myLabelSet->AllLabelsModifiedEvent.RemoveListener(myObject,
* MyObject::MyMethod).
*
* member variable is not needed to be locked in multi-threaded scenarios since the LabelSetEvent is a typedef for
* a Message object which is thread safe
*/
Message<> AllLabelsModifiedEvent;
/** \brief Returns a const iterator poiting to the begining of the container.
*/
LabelContainerConstIteratorType IteratorConstBegin() const;
/** \brief Returns a const iterator pointing to the end of the container.
*/
LabelContainerConstIteratorType IteratorConstEnd() const;
/** \brief Returns a iterator poiting to the begining of the container.
*/
LabelContainerIteratorType IteratorBegin();
/** \brief Returns a iterator pointing to the end of the container.
*/
LabelContainerIteratorType IteratorEnd();
/** \brief
* Recall itk::Object::Modified event from a label and send a ModifyLabelEvent
*/
void OnLabelModified();
/** \brief
*/
void SetLayer(unsigned int);
/** \brief
*/
void SetActiveLabel(PixelType);
/** \brief
*/
void RemoveLabel(PixelType);
/** \brief
*/
bool ExistLabel(PixelType);
/** \brief
*/
void AddLabel(mitk::Label *label);
/** \brief
*/
void AddLabel(const std::string &name, const Color &color);
/** \brief
*/
void RenameLabel(PixelType, const std::string &, const Color &);
/** \brief
*/
unsigned int GetNumberOfLabels() const;
/** \brief
*/
void SetAllLabelsVisible(bool);
/** \brief
*/
void SetAllLabelsLocked(bool);
/** \brief
*/
void RemoveAllLabels();
void SetNextActiveLabel();
/** \brief
*/
Label *GetActiveLabel() { return GetLabel(m_ActiveLabelValue); }
/** \brief
*/
const Label *GetActiveLabel() const { return GetLabel(m_ActiveLabelValue); }
/** \brief
*/
Label *GetLabel(PixelType pixelValue);
/** \brief
*/
const Label *GetLabel(PixelType pixelValue) const;
- itkGetMacro(Layer, int) itkGetConstMacro(Layer, int) itkGetModifiableObjectMacro(LookupTable, mitk::LookupTable)
+ itkGetMacro(Layer, int);
+
+ itkGetConstMacro(Layer, int);
+
+ itkGetModifiableObjectMacro(LookupTable, mitk::LookupTable);
/** \brief
*/
void SetLookupTable(LookupTable *lut);
/** \brief
*/
void UpdateLookupTable(PixelType pixelValue);
protected:
LabelSet();
LabelSet(const LabelSet &);
- mitkCloneMacro(Self)
+ mitkCloneMacro(Self);
~LabelSet() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
LabelContainerType m_LabelContainer;
LookupTable::Pointer m_LookupTable;
PixelType m_ActiveLabelValue;
unsigned int m_Layer;
};
/**
* @brief Equal A function comparing two label sets for beeing equal in data
*
* @ingroup MITKTestingAPI
*
* Following aspects are tested for equality:
* - LabelSetmembers
* - Label container (map)
*
* @param rightHandSide An image to be compared
* @param leftHandSide An image to be compared
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return true, if all subsequent comparisons are true, false otherwise
*/
MITKMULTILABEL_EXPORT bool Equal(const mitk::LabelSet &leftHandSide,
const mitk::LabelSet &rightHandSide,
ScalarType eps,
bool verbose);
} // namespace mitk
#endif // __mitkLabelSet_H_
diff --git a/Modules/Multilabel/mitkLabelSetImage.h b/Modules/Multilabel/mitkLabelSetImage.h
index 6ae1fd5e08..e65e6752e8 100644
--- a/Modules/Multilabel/mitkLabelSetImage.h
+++ b/Modules/Multilabel/mitkLabelSetImage.h
@@ -1,339 +1,340 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkLabelSetImage_H_
#define __mitkLabelSetImage_H_
#include <mitkImage.h>
#include <mitkLabelSet.h>
#include <MitkMultilabelExports.h>
namespace mitk
{
//##Documentation
//## @brief LabelSetImage class for handling labels and layers in a segmentation session.
//##
//## Handles operations for adding, removing, erasing and editing labels and layers.
//## @ingroup Data
class MITKMULTILABEL_EXPORT LabelSetImage : public Image
{
public:
- mitkClassMacro(LabelSetImage, Image) itkNewMacro(Self)
+ mitkClassMacro(LabelSetImage, Image);
+ itkNewMacro(Self);
typedef mitk::Label::PixelType PixelType;
/**
* \brief BeforeChangeLayerEvent (e.g. used for GUI integration)
* As soon as active labelset should be changed, the signal emits.
* Emitted by SetActiveLayer(int layer);
*/
Message<> BeforeChangeLayerEvent;
/**
* \brief AfterchangeLayerEvent (e.g. used for GUI integration)
* As soon as active labelset was changed, the signal emits.
* Emitted by SetActiveLayer(int layer);
*/
Message<> AfterChangeLayerEvent;
/**
* @brief Initialize an empty mitk::LabelSetImage using the information
* of an mitk::Image
* @param image the image which is used for initializing the mitk::LabelSetImage
*/
using mitk::Image::Initialize;
void Initialize(const mitk::Image *image) override;
/**
* \brief */
void Concatenate(mitk::LabelSetImage *image);
/**
* \brief */
void ClearBuffer();
/**
* @brief Merges the mitk::Label with a given target value with the active label
*
* @param pixelValue the value of the label that should be the new merged label
* @param sourcePixelValue the value of the label that should be merged into the specified one
* @param layer the layer in which the merge should be performed
*/
void MergeLabel(PixelType pixelValue, PixelType sourcePixelValue, unsigned int layer = 0);
/**
* @brief Merges a list of mitk::Labels with the mitk::Label that has a specific value
*
* @param pixelValue the value of the label that should be the new merged label
* @param vectorOfSourcePixelValues the list of label values that should be merge into the specified one
* @param layer the layer in which the merge should be performed
*/
void MergeLabels(PixelType pixelValue, std::vector<PixelType>& vectorOfSourcePixelValues, unsigned int layer = 0);
/**
* \brief */
void UpdateCenterOfMass(PixelType pixelValue, unsigned int layer = 0);
/**
* @brief Removes labels from the mitk::LabelSet of given layer.
* Calls mitk::LabelSetImage::EraseLabels() which also removes the labels from within the image.
* @param VectorOfLabelPixelValues a list of labels to be removed
* @param layer the layer in which the labels should be removed
*/
void RemoveLabels(std::vector<PixelType> &VectorOfLabelPixelValues, unsigned int layer = 0);
/**
* @brief Erases the label with the given value in the given layer from the underlying image.
* The label itself will not be erased from the respective mitk::LabelSet. In order to
* remove the label itself use mitk::LabelSetImage::RemoveLabels()
* @param pixelValue the label which will be remove from the image
* @param layer the layer in which the label should be removed
*/
void EraseLabel(PixelType pixelValue, unsigned int layer = 0);
/**
* @brief Similar to mitk::LabelSetImage::EraseLabel() this funtion erase a list of labels from the image
* @param VectorOfLabelPixelValues the list of labels that should be remove
* @param layer the layer for which the labels should be removed
*/
void EraseLabels(std::vector<PixelType> &VectorOfLabelPixelValues, unsigned int layer = 0);
/**
* \brief Returns true if the value exists in one of the labelsets*/
bool ExistLabel(PixelType pixelValue) const;
/**
* @brief Checks if a label exists in a certain layer
* @param pixelValue the label value
* @param layer the layer in which should be searched for the label
* @return true if the label exists otherwise false
*/
bool ExistLabel(PixelType pixelValue, unsigned int layer) const;
/**
* \brief Returns true if the labelset exists*/
bool ExistLabelSet(unsigned int layer) const;
/**
* @brief Returns the active label of a specific layer
* @param layer the layer ID for which the active label should be returned
* @return the active label of the specified layer
*/
mitk::Label *GetActiveLabel(unsigned int layer = 0);
/**
* @brief Returns the mitk::Label with the given pixelValue and for the given layer
* @param pixelValue the pixel value of the label
* @param layer the layer in which the labels should be located
* @return the mitk::Label if available otherwise nullptr
*/
mitk::Label *GetLabel(PixelType pixelValue, unsigned int layer = 0) const;
/**
* @brief Returns the currently active mitk::LabelSet
* @return the mitk::LabelSet of the active layer or nullptr if non is present
*/
mitk::LabelSet *GetActiveLabelSet();
/**
* @brief Gets the mitk::LabelSet for the given layer
* @param layer the layer for which the mitk::LabelSet should be retrieved
* @return the respective mitk::LabelSet or nullptr if non exists for the given layer
*/
mitk::LabelSet *GetLabelSet(unsigned int layer = 0);
const mitk::LabelSet *GetLabelSet(unsigned int layer = 0) const;
/**
* @brief Gets the ID of the currently active layer
* @return the ID of the active layer
*/
unsigned int GetActiveLayer() const;
/**
* @brief Get the number of all existing mitk::Labels for a given layer
* @param layer the layer ID for which the active mitk::Labels should be retrieved
* @return the number of all existing mitk::Labels for the given layer
*/
unsigned int GetNumberOfLabels(unsigned int layer = 0) const;
/**
* @brief Returns the number of all labels summed up across all layers
* @return the overall number of labels across all layers
*/
unsigned int GetTotalNumberOfLabels() const;
// This function will need to be ported to an external class
// it requires knowledge of pixeltype and dimension and includes
// too much algorithm to be sensibly part of a data class
///**
// * \brief */
// void SurfaceStamp(mitk::Surface* surface, bool forceOverwrite);
/**
* \brief */
mitk::Image::Pointer CreateLabelMask(PixelType index, bool useActiveLayer = true, unsigned int layer = 0);
/**
* @brief Initialize a new mitk::LabelSetImage by an given image.
* For all distinct pixel values of the parameter image new labels will
* be created. If the number of distinct pixel values exceeds mitk::Label::MAX_LABEL_VALUE
* a new layer will be created
* @param image the image which is used for initialization
*/
void InitializeByLabeledImage(mitk::Image::Pointer image);
/**
* \brief */
void MaskStamp(mitk::Image *mask, bool forceOverwrite);
/**
* \brief */
void SetActiveLayer(unsigned int layer);
/**
* \brief */
unsigned int GetNumberOfLayers() const;
/**
* @brief Adds a new layer to the LabelSetImage. The new layer will be set as the active one
* @param layer a mitk::LabelSet which will be set as new layer.
* @return the layer ID of the new layer
*/
unsigned int AddLayer(mitk::LabelSet::Pointer layer = nullptr);
/**
* \brief Add a layer based on a provided mitk::Image
* \param layerImage is added to the vector of label images
* \param lset a label set that will be added to the new layer if provided
*\return the layer ID of the new layer
*/
unsigned int AddLayer(mitk::Image::Pointer layerImage, mitk::LabelSet::Pointer lset = nullptr);
/**
* \brief Add a LabelSet to an existing layer
*
* This will replace an existing labelSet if one exists. Throws an exceptions if you are trying
* to add a labelSet to a non-existing layer.
*
* If there are no labelSets for layers with an id less than layerIdx default ones will be added
* for them.
*
* \param layerIdx The index of the layer the LabelSet should be added to
* \param labelSet The LabelSet that should be added
*/
void AddLabelSetToLayer(const unsigned int layerIdx, const mitk::LabelSet::Pointer labelSet);
/**
* @brief Removes the active layer and the respective mitk::LabelSet and image information.
* The new active layer is the one below, if exists
*/
void RemoveLayer();
/**
* \brief */
mitk::Image *GetLayerImage(unsigned int layer);
const mitk::Image *GetLayerImage(unsigned int layer) const;
void OnLabelSetModified();
/**
* @brief Sets the label which is used as default exterior label when creating a new layer
* @param label the label which will be used as new exterior label
*/
void SetExteriorLabel(mitk::Label *label);
/**
* @brief Gets the mitk::Label which is used as default exterior label
* @return the exterior mitk::Label
*/
mitk::Label *GetExteriorLabel();
const mitk::Label *GetExteriorLabel() const;
protected:
- mitkCloneMacro(Self)
+ mitkCloneMacro(Self);
LabelSetImage();
LabelSetImage(const LabelSetImage &other);
~LabelSetImage() override;
template <typename ImageType1, typename ImageType2>
void ChangeLayerProcessing(ImageType1 *source, ImageType2 *target);
template <typename TPixel, unsigned int VImageDimension>
void LayerContainerToImageProcessing(itk::Image<TPixel, VImageDimension> *source, unsigned int layer);
template <typename TPixel, unsigned int VImageDimension>
void ImageToLayerContainerProcessing(itk::Image<TPixel, VImageDimension> *source, unsigned int layer) const;
template <typename ImageType>
void CalculateCenterOfMassProcessing(ImageType *input, PixelType index, unsigned int layer);
template <typename ImageType>
void ClearBufferProcessing(ImageType *input);
template <typename ImageType>
void EraseLabelProcessing(ImageType *input, PixelType index, unsigned int layer);
// template < typename ImageType >
// void ReorderLabelProcessing( ImageType* input, int index, int layer);
template <typename ImageType>
void MergeLabelProcessing(ImageType *input, PixelType pixelValue, PixelType index);
template <typename ImageType>
void ConcatenateProcessing(ImageType *input, mitk::LabelSetImage *other);
template <typename ImageType>
void MaskStampProcessing(ImageType *input, mitk::Image *mask, bool forceOverwrite);
template <typename LabelSetImageType, typename ImageType>
void InitializeByLabeledImageProcessing(LabelSetImageType *input, ImageType *other);
std::vector<LabelSet::Pointer> m_LabelSetContainer;
std::vector<Image::Pointer> m_LayerContainer;
int m_ActiveLayer;
bool m_activeLayerInvalid;
mitk::Label::Pointer m_ExteriorLabel;
};
/**
* @brief Equal A function comparing two label set images for beeing equal in meta- and imagedata
*
* @ingroup MITKTestingAPI
*
* Following aspects are tested for equality:
* - LabelSetImage members
* - working image data
* - layer image data
* - labels in label set
*
* @param rightHandSide An image to be compared
* @param leftHandSide An image to be compared
* @param eps Tolerance for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return true, if all subsequent comparisons are true, false otherwise
*/
MITKMULTILABEL_EXPORT bool Equal(const mitk::LabelSetImage &leftHandSide,
const mitk::LabelSetImage &rightHandSide,
ScalarType eps,
bool verbose);
} // namespace mitk
#endif // __mitkLabelSetImage_H_
diff --git a/Modules/Multilabel/mitkLabelSetImageToSurfaceThreadedFilter.h b/Modules/Multilabel/mitkLabelSetImageToSurfaceThreadedFilter.h
index 4b62f4f28b..421884889a 100644
--- a/Modules/Multilabel/mitkLabelSetImageToSurfaceThreadedFilter.h
+++ b/Modules/Multilabel/mitkLabelSetImageToSurfaceThreadedFilter.h
@@ -1,46 +1,46 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkLabelSetImageToSurfaceThreadedFilter_H_
#define __mitkLabelSetImageToSurfaceThreadedFilter_H_
#include "mitkSegmentationSink.h"
#include "mitkSurface.h"
#include <MitkMultilabelExports.h>
namespace mitk
{
class MITKMULTILABEL_EXPORT LabelSetImageToSurfaceThreadedFilter : public SegmentationSink
{
public:
- mitkClassMacro(LabelSetImageToSurfaceThreadedFilter, SegmentationSink)
- mitkAlgorithmNewMacro(LabelSetImageToSurfaceThreadedFilter);
+ mitkClassMacro(LabelSetImageToSurfaceThreadedFilter, SegmentationSink);
+ mitkAlgorithmNewMacro(LabelSetImageToSurfaceThreadedFilter);
protected:
LabelSetImageToSurfaceThreadedFilter(); // use smart pointers
~LabelSetImageToSurfaceThreadedFilter() override;
void Initialize(const NonBlockingAlgorithm *other = nullptr) override;
bool ReadyToRun() override;
bool ThreadedUpdateFunction() override; // will be called from a thread after calling StartAlgorithm
void ThreadedUpdateSuccessful() override; // will be called from a thread after calling StartAlgorithm
private:
int m_RequestedLabel;
Surface::Pointer m_Result;
};
} // namespace
#endif // __mitkLabelSetImageToSurfaceThreadedFilter_H_
diff --git a/Modules/Multilabel/mitkMultilabelObjectFactory.h b/Modules/Multilabel/mitkMultilabelObjectFactory.h
index 5ad525a210..072f959e0e 100644
--- a/Modules/Multilabel/mitkMultilabelObjectFactory.h
+++ b/Modules/Multilabel/mitkMultilabelObjectFactory.h
@@ -1,49 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MULTILABELOBJECTFACTORY_H_INCLUDED
#define MULTILABELOBJECTFACTORY_H_INCLUDED
#include "mitkCoreObjectFactoryBase.h"
#include <mitkAbstractFileIO.h>
namespace mitk
{
class MultilabelObjectFactory : public CoreObjectFactoryBase
{
public:
mitkClassMacro(MultilabelObjectFactory, CoreObjectFactoryBase);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) Mapper::Pointer
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self) Mapper::Pointer
CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
void SetDefaultProperties(mitk::DataNode *node) override;
const char *GetFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap() override;
const char *GetSaveFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap() override;
protected:
MultilabelObjectFactory();
~MultilabelObjectFactory() override;
void CreateFileExtensionsMap();
MultimapType m_FileExtensionsMap;
MultimapType m_SaveFileExtensionsMap;
private:
itk::ObjectFactoryBase::Pointer m_LabelSetImageIOFactory;
itk::ObjectFactoryBase::Pointer m_LabelSetImageWriterFactory;
std::vector<mitk::AbstractFileIO *> m_FileIOs;
};
}
#endif
diff --git a/Modules/OpenCL/mitkOclDataSet.h b/Modules/OpenCL/mitkOclDataSet.h
index d86597a586..e55e41b063 100644
--- a/Modules/OpenCL/mitkOclDataSet.h
+++ b/Modules/OpenCL/mitkOclDataSet.h
@@ -1,130 +1,130 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkOclDataSet_h
#define __mitkOclDataSet_h
#define GPU_DATA 0
#define CPU_DATA 1
#include <mitkImage.h>
#include "MitkOpenCLExports.h"
#include "mitkOclBaseData.h"
#include "mitkOpenCLActivator.h"
#include <mitkException.h>
namespace mitk {
/*!
* \brief Class implementing processing of arbitrary data sets for GPU Image Processing
*
* The class holds a pointer to the data stored in RAM and performs an
* on-demand-copy to the graphics memory. It is the basic data structure for all
* mitk::oclDataSetToDataSetFilter classes
*/
class MITKOPENCL_EXPORT OclDataSet : public OclBaseData
{
public:
mitkClassMacro(OclDataSet, OclBaseData);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/*! \brief Copies the RAM-stored data to GMEM */
virtual int TransferDataToGPU(cl_command_queue);
/*! \brief Copies the in GMEM stored data to RAM */
virtual void* TransferDataToCPU(cl_command_queue);
/*! \brief Returns the pointer to the referenced data */
void* GetData()
{
return m_Data;
}
/** Returns the pointer to the GPU buffer */
cl_mem GetGPUBuffer();
/** Create the GPU buffer for image
*
*/
cl_mem CreateGPUBuffer();
/** \brief Returns the status of the image buffer
*
* @param _type The flag to specify the buffer type ( GPU / CPU )
*/
bool IsModified(int _type);
using OclBaseData::Modified;
/** \brief Set the modified flag for one of the buffers
*
* @param _type The flag to specify the buffer type ( GPU / CPU )
*/
void Modified(int _type);
/** \brief Initialze the OclDataSet with data. */
void SetData(void* data)
{
this->m_cpuModified = true;
this->m_gpuModified = false;
m_Data = data;
}
/*! \brief returns the amount of elements in the DataSet */
size_t GetBufferSize() const
{
return this->m_bufferSize;
}
short GetBytesPerElement() const
{
return this->m_BpE;
}
/** @brief Set the amount of elements in buffer*/
void SetBufferSize(size_t size);
/** @brief Set the DataSet memory Size per Element in Bytes*/
void SetBpE(unsigned short BpE);
protected:
/*! \brief Constructor */
OclDataSet();
/** @brief Destructor */
virtual ~OclDataSet();
/*! GMEM Image buffer */
cl_mem m_gpuBuffer;
/*! GPU Context the Buffer was created in, needed for access */
cl_context m_context;
private:
/*! GMEM Buffer Size in elements*/
size_t m_bufferSize;
bool m_gpuModified;
bool m_cpuModified;
/*! Reference to the data */
void* m_Data;
/*! Bytes per Element in Buffer*/
unsigned short m_BpE;
};
}
#endif //__mitkOclDataSet_h
diff --git a/Modules/OpenCL/mitkOclImage.h b/Modules/OpenCL/mitkOclImage.h
index 08311589d4..e828239823 100644
--- a/Modules/OpenCL/mitkOclImage.h
+++ b/Modules/OpenCL/mitkOclImage.h
@@ -1,201 +1,201 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkOclImage_h
#define __mitkOclImage_h
#define GPU_DATA 0
#define CPU_DATA 1
#define MAX_DIMS 20
#include <mitkImage.h>
#include "MitkOpenCLExports.h"
#include "mitkOclBaseData.h"
#include "mitkOclImageFormats.h"
#include "mitkOpenCLActivator.h"
#include <mitkException.h>
#define SHORT_IM mitk::MakeScalarPixelType<short>()
#define FLOAT_IM mitk::MakeScalarPixelType<float>()
namespace mitk {
/*!
* \brief Class implementing the image format for GPU Image Processing
*
* The class holds a pointer to the mitk::Image stored in RAM and performs an
* on-demand-copy to the graphics memory. It is the basic data structure for all
* mitk::oclImageToImageFilter classes
* @throw This class may throw an ImageTypeIsNotSupportedByGPU, if the image
* format is supported by the GPU.
*/
class MITKOPENCL_EXPORT OclImage : public OclBaseData
{
public:
mitkClassMacro(OclImage, OclBaseData);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/*! \brief Copies the RAM-stored data to GMEM */
virtual int TransferDataToGPU(cl_command_queue);
/*! \brief Copies the in GMEM stored data to RAM */
virtual void* TransferDataToCPU(cl_command_queue);
/*! \brief Returns the pointer to the referenced mitk::Image */
Image::Pointer GetMITKImage()
{
return m_Image;
}
/*! \brief Checks whether gpuImage is a valid clImage object
when an oclImage gets created by an image to image filter, the output image is created
by clCreateBuffer() because it is not in general possible to write to clImage directly
*/
cl_mem GetGPUImage(cl_command_queue);
/** Returns the pointer to the GPU buffer */
cl_mem GetGPUBuffer()
{
return this->m_gpuImage;
}
/** Create the GPU buffer for image
*
*/
cl_mem CreateGPUImage(unsigned int, unsigned int, unsigned int, unsigned int);
/** \brief Returns the status of the image buffer
*
* @param _type The flag to specify the buffer type ( GPU / CPU )
*/
bool IsModified(int _type);
using OclBaseData::Modified;
/** \brief Set the modified flag for one of the buffers
*
* @param _type The flag to specify the buffer type ( GPU / CPU )
*/
void Modified(int _type);
/** @brief Initialize the internal variable of type mitk::Image.
*/
void InitializeMITKImage();
/** \brief Initialze the OclImage with an mitkImage. */
void InitializeByMitkImage(mitk::Image::Pointer _image);
/*! \brief returns the specified image dimension size */
int GetDimension(int) const;
/*! \brief returns the dimensionality of the image */
int GetDimension() const
{
return this->m_dim;
}
/*! \brief returns the pointer to the array of image sizes */
unsigned int* GetDimensions(){ return this->m_Dims; }
/*! \brief returns the spacing of the image for specified dimension */
float GetSpacing(int);
/*! \brief Returns the image offset (needed for WorldToIndex Transform */
void GetOffset(float*) const;
/** @brief Set the pixel type for the image to be used
*/
void SetPixelType(const cl_image_format*);
short GetBytesPerPixel() const
{
return this->m_BpE;
}
/** @brief Get the currently used pixel type
@returns OpenCL Image Format struct
*/
const cl_image_format* GetPixelType() const
{
return &(this->m_proposedFormat);
}
/** @brief Set the image dimensions through an unsigned int array */
void SetDimensions(unsigned int* Dims);
/** @brief Set the dimensionality of the image */
void SetDimension(unsigned short dim);
protected:
/*! \brief Constructor */
OclImage();
/** @brief Destructor */
virtual ~OclImage();
/*! GMEM Image buffer */
cl_mem m_gpuImage;
/*! GPU Context the Image Buffer was created in, needed for access */
cl_context m_context;
/*! GMEM Buffer Size */
unsigned int m_bufferSize;
private:
cl_image_format ConvertPixelTypeToOCLFormat();
bool m_gpuModified;
bool m_cpuModified;
/*! Reference to mitk::Image */
Image::Pointer m_Image;
unsigned short m_dim;
unsigned int* m_Dims;
unsigned short m_BpE;
cl_int AllocateGPUImage();
/** Bool flag to signalize if the proposed format is supported on currend HW.
For value 'false', the transfer kernel has to be called to fit the data to
the supported format */
bool m_formatSupported;
/** Supported format, defined using oclImageFormats */
cl_image_format m_supportedFormat;
/** Proposed format for image */
cl_image_format m_proposedFormat;
};
/**
* @brief The ImageTypeIsNotSupportedByGPU class specialized exception class for unsupported
* image formats. If this exception is thrown, try other graphics device.
*/
class ImageTypeIsNotSupportedByGPU : public Exception
{
public:
mitkExceptionClassMacro(ImageTypeIsNotSupportedByGPU,Exception)
};
}
#endif //__mitkOclImage_h
diff --git a/Modules/OpenCL/mitkOclImageFormats.h b/Modules/OpenCL/mitkOclImageFormats.h
index 2400afb9ab..3d91a8c429 100644
--- a/Modules/OpenCL/mitkOclImageFormats.h
+++ b/Modules/OpenCL/mitkOclImageFormats.h
@@ -1,118 +1,118 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkOclImageFormats_h
#define __mitkOclImageFormats_h
//mitk
#include <mitkCommon.h>
#include <mitkLogMacros.h>
//itk
#include <itkLightObject.h>
#include <itkObjectFactory.h>
//ocl
#include "mitkOclUtils.h"
#include <MitkOpenCLExports.h>
#define MAX_FORMATS 10
#define MAX_DATA_TYPES 12
namespace mitk
{
/**
@class oclImageFormats
@brief A class handling the (un)supported OpenCL Image formats.
This class checks whether a format is supported or not and acts accordingly.
*/
class MITKOPENCL_EXPORT OclImageFormats : public itk::LightObject
{
public:
mitkClassMacroItkParent(OclImageFormats, itk::LightObject);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** @brief Checks if format supported.
@param format The image format to be checked for support.
@return True if the parameter is supported.
*/
bool IsFormatSupported(cl_image_format* format);
/** @brief Finds one supported image format similar to the given format.
In case the input format is supported, the output format will contain the same value.
@param inputformat The (unsupported) image format
@param outputformat A supported image format
@return True if a supported format was changed.
*/
bool GetNearestSupported(cl_image_format* inputformat, cl_image_format* outputformat);
/**
* @brief SetGPUContext Set the GPU context. Must be called before using this class!
* @param context GPU context in cl format.
*/
void SetGPUContext( cl_context context );
protected:
/** @brief Get and store all available infos
* @throw Throws an mitk::Exception if the GPU context was not defined.
*/
void CollectAvailableFormats();
/**
* @brief OclImageFormats Constructor
*/
OclImageFormats();
/** @brief Destructor (default) */
virtual ~OclImageFormats();
private:
/** @brief Store the given format into the table
* Todo: what table? Where? Why is it called sort?
@param formats A pointer to an array of image formats
Todo: What formats?
@param count Size of the formats array (i.e. how many formats are to be sorted).
@param val an intern value to distinguish between read/write/readwrite type
Todo: what is val?
@param dim Specifies the target image dimension (default IMAGE_2D).
*/
void SortFormats( cl_image_format* formats, cl_uint count, int val=1 , int dims = 2);
/** @brief Get the byte offset to the image support fields.
Todo: What means support field? What is this offset used for? In what unit is it returned?*/
unsigned int GetOffset( cl_image_format format );
using itk::LightObject::PrintSelf;
/** @brief Print all supported formats (in a table) for both 2D and 3D IMAGE */
void PrintSelf();
/** An array to hold the information about IMAGE_2D supported formats. */
unsigned char* m_Image2DSupport;
/** An array to hold the information about IMAGE_3D supported formats. */
unsigned char* m_Image3DSupport;
/** the OpenCL context */
cl_context m_GpuContext;
};
}
#endif // __mitkOclImageFormats_h
diff --git a/Modules/OpenCVVideoSupport/Commands/mitkBasicCombinationOpenCVImageFilter.h b/Modules/OpenCVVideoSupport/Commands/mitkBasicCombinationOpenCVImageFilter.h
index f3b77dddc5..62f921470e 100644
--- a/Modules/OpenCVVideoSupport/Commands/mitkBasicCombinationOpenCVImageFilter.h
+++ b/Modules/OpenCVVideoSupport/Commands/mitkBasicCombinationOpenCVImageFilter.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkBasicCombinationOpenCVImageFilter_h
#define mitkBasicCombinationOpenCVImageFilter_h
#include "mitkAbstractOpenCVImageFilter.h"
//itk headers
#include "itkObjectFactory.h"
namespace mitk {
class MITKOPENCVVIDEOSUPPORT_EXPORT BasicCombinationOpenCVImageFilter : public AbstractOpenCVImageFilter
{
public:
mitkClassMacro(BasicCombinationOpenCVImageFilter, AbstractOpenCVImageFilter);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* \brief Apply list of filters to the given image.
* \return false if one of the filter returns false. Be careful, that the image could already be changed when the function returned false.
*/
bool OnFilterImage( cv::Mat& image ) override;
/**
* \brief Push an additional filter to the list of filters for applying to an image.
*/
void PushFilter( AbstractOpenCVImageFilter::Pointer filter );
/**
* \brief Remove and return the last filter added to the list of filters.
* \return last filter added to the list of filters
*/
AbstractOpenCVImageFilter::Pointer PopFilter( );
/**
* \brief Remove the given filter from the list of filters.
* \return true if the filter was on the list, false if it wasn't
*/
bool RemoveFilter( AbstractOpenCVImageFilter::Pointer filter );
/**
* \brief Get the information if the given filter is on the filter list.
* \return true if the filter is on the list, false otherwise
*/
bool GetIsFilterOnTheList( AbstractOpenCVImageFilter::Pointer filter );
/**
* \brief Get the information if no filter is on the filter list.
* \return true if the filter list if empty, false otherwise
*/
bool GetIsEmpty();
protected:
/**
* \brief All filters applied to the given image during call of mitk::mitkBasicCombinationOpenCVImageFilter::FilterImage().
*/
std::vector<AbstractOpenCVImageFilter::Pointer> m_FilterList;
};
} // namespace mitk
#endif // mitkBasicCombinationOpenCVImageFilter_h
diff --git a/Modules/OpenCVVideoSupport/Commands/mitkConvertGrayscaleOpenCVImageFilter.h b/Modules/OpenCVVideoSupport/Commands/mitkConvertGrayscaleOpenCVImageFilter.h
index e0885b1fcc..f1522f94b8 100644
--- a/Modules/OpenCVVideoSupport/Commands/mitkConvertGrayscaleOpenCVImageFilter.h
+++ b/Modules/OpenCVVideoSupport/Commands/mitkConvertGrayscaleOpenCVImageFilter.h
@@ -1,40 +1,40 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkConvertGrayscaleOpenCVImageFilter_h
#define mitkConvertGrayscaleOpenCVImageFilter_h
#include "mitkAbstractOpenCVImageFilter.h"
//itk headers
#include "itkObjectFactory.h"
namespace mitk {
class MITKOPENCVVIDEOSUPPORT_EXPORT ConvertGrayscaleOpenCVImageFilter : public AbstractOpenCVImageFilter
{
public:
mitkClassMacro(ConvertGrayscaleOpenCVImageFilter, AbstractOpenCVImageFilter);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* \brief Converts given image to grayscale.
* \return always true
*/
bool OnFilterImage( cv::Mat& image ) override;
};
} // namespace mitk
#endif // mitkConvertGrayscaleOpenCVImageFilter_h
diff --git a/Modules/OpenCVVideoSupport/Commands/mitkCropOpenCVImageFilter.h b/Modules/OpenCVVideoSupport/Commands/mitkCropOpenCVImageFilter.h
index 8c1ddc5c19..1dca0cf45b 100644
--- a/Modules/OpenCVVideoSupport/Commands/mitkCropOpenCVImageFilter.h
+++ b/Modules/OpenCVVideoSupport/Commands/mitkCropOpenCVImageFilter.h
@@ -1,75 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkAbstractOpenCVImageFilter_h
#define mitkAbstractOpenCVImageFilter_h
#include "mitkAbstractOpenCVImageFilter.h"
#include "opencv2/core.hpp"
//itk headers
#include <itkObjectFactory.h>
namespace mitk {
class MITKOPENCVVIDEOSUPPORT_EXPORT CropOpenCVImageFilter : public AbstractOpenCVImageFilter
{
public:
mitkClassMacro(CropOpenCVImageFilter, AbstractOpenCVImageFilter);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
CropOpenCVImageFilter( );
/**
* \brief Crops image to rectangle given by mitk::CropOpenCVImageFilter::SetCropRegion.
* \return false if no crop region was set or the crop region width is zero, true otherwise.
*/
bool OnFilterImage( cv::Mat& image ) override;
/**
* \brief Set region of interest for cropping.
*/
void SetCropRegion( cv::Rect cropRegion );
/**
* \brief Set region of interest for cropping.
*/
void SetCropRegion( int topLeftX, int topLeftY, int bottomRightX, int bottomRightY );
/**
* \brief Returns region, which was set by mitk::CropOpenCVImageFilter::SetCropRegion().
*/
cv::Rect GetCropRegion( );
/**
* \return True if a non-empty crop region was set before.
*/
bool GetIsCropRegionEmpty( );
protected:
/**
* \brief Defines the region which will be cropped from the image.
*/
cv::Rect m_CropRegion;
/**
* \brief True if no image was filtered since last set of a crop region.
*/
bool m_NewCropRegionSet;
};
} // namespace mitk
#endif // mitkAbstractOpenCVImageFilter_h
diff --git a/Modules/OpenCVVideoSupport/Commands/mitkGrabCutOpenCVImageFilter.h b/Modules/OpenCVVideoSupport/Commands/mitkGrabCutOpenCVImageFilter.h
index 9a2fce68e5..774101d459 100644
--- a/Modules/OpenCVVideoSupport/Commands/mitkGrabCutOpenCVImageFilter.h
+++ b/Modules/OpenCVVideoSupport/Commands/mitkGrabCutOpenCVImageFilter.h
@@ -1,285 +1,287 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKGRABCUTOPENCVIMAGEFILTER_H
#define MITKGRABCUTOPENCVIMAGEFILTER_H
// mitk headers
#include "mitkAbstractOpenCVImageFilter.h"
#include "mitkVector.h"
// itk headers
#include "itkObjectFactory.h"
#include "itkMutexLock.h"
// opencv headers
#include <opencv2/core.hpp>
namespace itk {
template<unsigned int T> class Index;
template<class T> class SmartPointer;
class MultiThreader;
class ConditionVariable;
class FastMutexLock;
}
namespace mitk {
class PointSet;
/**
* \brief Makes the OpenCV GrabCut filter available as OpenCVImageFilter.
*
* Image filtering is done asynchronly by using a worker thread as GrabCut segmentation
* can take up to some seconds. Calling the mitk::GrabCutOpenCVImageFilter::OnFilterImage()
* method sets just the input image and wakes up the worker thread. It is not guaranteed
* that every image gets segmented. If multiple new images where set before a segmentation
* was finished, only the last new image gets segmented afterwards.
*
* At least foreground model points have to be set by
* mitk::GrabCutOpenCVImageFilter::SetModelPoints() before a segmentation can be performed.
* The worder thread will not be waken up before any model points were set.
*
* When a new segmentation is ready, mitk::GrabCutOpenCVImageFilter::GetCurrentImageId()
* returns a new image id. The segmentation can be got then by calling
* mitk::GrabCutOpenCVImageFilter::GetResultMask(),
* mitk::GrabCutOpenCVImageFilter::GetResultContours() or
* mitk::GrabCutOpenCVImageFilter::GetResultContourWithPixel().
*/
class MITKOPENCVVIDEOSUPPORT_EXPORT GrabCutOpenCVImageFilter : public AbstractOpenCVImageFilter
{
public:
/** \brief List holding image indices of the model points. */
typedef std::vector<itk::Index<2> > ModelPointsList;
- mitkClassMacro(GrabCutOpenCVImageFilter, AbstractOpenCVImageFilter)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(GrabCutOpenCVImageFilter, AbstractOpenCVImageFilter);
+
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
GrabCutOpenCVImageFilter();
~GrabCutOpenCVImageFilter() override;
/**
* \brief Implementation of the virtual image filtering method.
* The input image is copied to a member attribute, but the actual filtering is not done
* in this method. Instead a worker thread is waken up every time this method is called,
* if foreground model points were set before.
*
* \param OpenCV image to be segmentated
* \return false if an empty image was set, true otherwise
*/
bool OnFilterImage( cv::Mat& image ) override;
/**
* \brief Sets a list of image indices as foreground model points.
* \param foregroundPoints List of image indices which definitely belong to the foreground.
*/
void SetModelPoints(ModelPointsList foregroundPoints);
/**
* \brief Sets a list of image indices as foreground and another list as background model points.
* \param foregroundPoints List of image indices which definitely belong to the foreground.
* \param backgroundPoints List of image indices which definitely belong to the background.
*/
void SetModelPoints(ModelPointsList foregroundPoints, ModelPointsList backgroundPoints);
/**
* \brief Sets a mask where every non-zero pixel is treated as a foreground model pixel.
*/
void SetModelPoints(cv::Mat foregroundMask);
/**
* \brief Sets masks specifying foreground and background points.
* \param foregroundMask every non-zero pixel is treated as a foreground model pixel
* \param backgroundMask every non-zero pixel is treated as a background model pixel
*/
void SetModelPoints(cv::Mat foregroundMask, cv::Mat backgroundMask);
/**
* \brief Set a size of which each model point is dilated before image filtering.
* The more color information of the foreground object the GrabCut filter gets the better
* the result will be. Therefore the foreground pixels can be dilated before filtering. The
* caller is responsible for setting a dilation size so that no foreground model pixels will
* be indeed part of the background after dilation.
*
* Dilation is done to the background model pixles as well, if there are any set for the
* filter.
*
* \param modelPointsDilationSize how many pixels are added in every direction, 0 sets back to no dilation
*/
void SetModelPointsDilationSize(int modelPointsDilationSize);
/**
* \brief Use only the region around the foreground model points for the segmentation.
*
* This is mainly for reasons of segmentation speed and has the drawback that the foreground
* model points (plus the given additional border) have to cover the whole foreground object.
*
* The segmentation filter can be set back to using the whole image by calling
* mitk::GrabCutOpenCVImageFilter::SetUseFullImage().
*
* \param additionalBorder size of the border around the foreground points which will be used for segmentation, too
*/
void SetUseOnlyRegionAroundModelPoints(unsigned int additionalBorder);
/**
* \brief The full image is used as input for the segmentation.
* This method sets the behaviour back to the default behaviour in case
* mitk::GrabCutOpenCVImageFilter::SetUseOnlyRegionAroundModelPoints() was
* called before.
*/
void SetUseFullImage();
/**
* \brief Getter for the rectangle used for the area of segmentation.
* See mitk::GrabCutOpenCVImageFilter::SetUseOnlyRegionAroundModelPoints().
* This method is mainly for debugging purposes and may be removed in
* the future.
*/
cv::Rect GetRegionAroundModelPoints();
/**
* \brief Getter for an ascending id of the current result image.
* The id will be increased for every segmentation that is produced by the worker thread.
* It can be used to determine if a new segmentation was produced since the last time a
* segmentation was got from this filter.
*
* int lastResultImageId = grabCutFilter->GetResultImageId();
* // do something
* if ( lastResultImageId != grabCutFilter->GetResultImageId() )
* // get new segmentation
*/
int GetResultImageId();
/**
* \brief Getter for the result mask of the current segmentation.
* The result of this method is not necessarily consistent with the result of
* mitk::GrabCutOpenCVImageFilter::GetResultContours() if they are called afterwards.
* The segmentation may have changed in the meantime. One should decide if he needs
* a mask or a contour or convert one into the other on his own.
* \return image of the size of the input image where all pixels segmented as foreground are non-zero
*/
cv::Mat GetResultMask();
/**
* \brief Getter for the contours of the current segmentation.
*
* A segmentation can consist of multiple regions therefore a list of contours
* is returned. If one needs only one specific region he can call
* mitk::GrabCutOpenCVImageFilter::GetResultContourWithPixel().
*
* This result of this method is not necessarily consistent with the result of
* mitk::GrabCutOpenCVImageFilter::GetResultContours() if they are called afterwards.
* The segmentation may have changed in the meantime. One should decide if he needs
* a mask or a contour or convert one into the other on his own.
*
* \return List containing lists of pixel indices for every contour.
*/
std::vector<ModelPointsList> GetResultContours();
/**
* \brief Getter for one specific contour of the current segmentation.
*
* Can be used if only one (of possible multiple contours) is needed. A pixel index
* must be given to select from the contours. This could be one of the foreground
* model pixels for example. If other criteria are needed to distinguish the contours
* mitk::GrabCutOpenCVImageFilter::GetResultContours() can be used instead and therefore
* contour selection can be done by hand then.
*
* This result of this method is not necessarily consistent with the result of
* mitk::GrabCutOpenCVImageFilter::GetResultContours() if they are called afterwards.
* The segmentation may have changed in the meantime. One should decide if he needs
* a mask or a contour or convert one into the other on his own.
*
* \param pixelIndex index of a pixel which lies inside the contour
* \return list of pixel indices for the selected contour
*/
ModelPointsList GetResultContourWithPixel(itk::Index<2> pixelIndex);
protected:
/** \brief Creates an image mask for GrabCut algorithm by using the foreground and background point sets.
* Background and foreground points will be dilated by the size set by
* mitk::GrabCutOpenCVImageFilter::SetModelPointsDilationSize().
*/
cv::Mat GetMaskFromPointSets();
/**
* \brief Creates a bounding box around all pixels which aren't propably background.
* The bounding box is widened as specified by
* mitk::GrabCutOpenCVImageFilter::SetUseOnlyRegionAroundModelPoints().
*/
cv::Rect GetBoundingRectFromMask(cv::Mat mask);
/**
* \brief Performs a GrabCut segmentation of the given input image.
* \param input image on which the segmentation will be performed
* \param mask foreground and background pixels used as basis for segmentation
* \return mask with every pixel of the segmented foreground object set non-zero
*/
cv::Mat RunSegmentation(cv::Mat input, cv::Mat mask);
/**
* \brief Creates a list of points from every non-zero pixel of the given mask.
*/
ModelPointsList ConvertMaskToModelPointsList(cv::Mat mask);
int m_ModelPointsDilationSize;
bool m_UseOnlyRegionAroundModelPoints;
unsigned int m_AdditionalWidth;
cv::Rect m_BoundingBox;
ModelPointsList m_ForegroundPoints;
ModelPointsList m_BackgroundPoints;
cv::Mat m_InputImage;
cv::Mat m_GrabCutMask;
cv::Mat m_ResultMask;
unsigned int m_CurrentProcessImageNum;
/** \brief id of the image currently set as m_InputImage */
int m_InputImageId;
/** \brief id of the image which segmentation result is currently present in m_ResultMask */
int m_ResultImageId;
private:
/**
* \brief Worker thread for doing the segmentation.
* It blocks every time a image was segmented and will be waken up again by
* the mitk::GrabCutOpenCVImageFilter::OnFilterImage() method.
*
* \param pInfoStruct pointer to the GrabCutOpenCVImageFilter object
* \return
*/
static ITK_THREAD_RETURN_TYPE SegmentationWorker(void* pInfoStruct);
int m_ThreadId;
/** \brief worker thread will terminate after the next wakeup if set to true */
bool m_StopThread;
itk::SmartPointer<itk::MultiThreader> m_MultiThreader;
itk::SmartPointer<itk::ConditionVariable> m_WorkerBarrier;
/** \brief mutex for guarding m_InputImage and m_InputImageId */
itk::SmartPointer<itk::FastMutexLock> m_ImageMutex;
/** \brief mutex for guarding m_ResultMask and m_ResultImageId */
itk::SmartPointer<itk::FastMutexLock> m_ResultMutex;
/** \brief mutex for guarding m_ForegroundPoints and m_BackgroundPoints */
itk::SmartPointer<itk::FastMutexLock> m_PointSetsMutex;
};
} // namespace mitk
#endif // MITKGRABCUTOPENCVIMAGEFILTER_H
diff --git a/Modules/OpenCVVideoSupport/mitkImageToOpenCVImageFilter.h b/Modules/OpenCVVideoSupport/mitkImageToOpenCVImageFilter.h
index a47f41721f..ed14d1c57a 100644
--- a/Modules/OpenCVVideoSupport/mitkImageToOpenCVImageFilter.h
+++ b/Modules/OpenCVVideoSupport/mitkImageToOpenCVImageFilter.h
@@ -1,97 +1,97 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkImageToOpenCVImageFilter_h
#define mitkImageToOpenCVImageFilter_h
#include <mitkCommon.h>
#include <mitkImage.h>
#include <mitkWeakPointer.h>
#include <itkOpenCVImageBridge.h>
#include <MitkOpenCVVideoSupportExports.h>
#include <opencv2/core.hpp>
#include "mitkImageSliceSelector.h"
namespace mitk
{
///
/// \brief A pseudo-filter for creating OpenCV images from MITK images with the option of copying data or referencing it
///
class MITKOPENCVVIDEOSUPPORT_EXPORT ImageToOpenCVImageFilter : public itk::Object
{
public:
typedef itk::RGBPixel< unsigned char > UCRGBPixelType;
typedef itk::RGBPixel< unsigned short > USRGBPixelType;
typedef itk::RGBPixel< float > FloatRGBPixelType;
typedef itk::RGBPixel< double > DoubleRGBPixelType;
mitkClassMacroItkParent(ImageToOpenCVImageFilter, itk::Object);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
///
/// \brief set the input MITK image
///
void SetImage( mitk::Image* _Image );
///
/// \brief get the input MITK image
///
mitk::Image* GetImage();
///
/// \brief get the input MITK image
///
bool CheckImage(mitk::Image* image);
///
/// RUNS the conversion and returns the produced image as cv::Mat.
/// \return the produced OpenCVImage or an empty image if an error occured
///
cv::Mat GetOpenCVMat();
//##Documentation
//## @brief Convenient method to set a certain slice of a 3D or 4D mitk::Image as input to convert it to an openCV image
//##
//## This methods sets the input. Call GetOpenCVMat() to get the image.
//##
//## @param mitkImage - the image that should be converted to an openCVImage
//## @param timeStep - the time step, which is converted to openCV
//## @param slice - the slice which is converted to openCV
void SetInputFromTimeSlice(Image::Pointer mitkImage, int timeStep, int slice);
protected:
///
/// the actual templated conversion method
///
template<typename TPixel, unsigned int VImageDimension>
void ItkImageProcessing( itk::Image<TPixel,VImageDimension>* image );
ImageToOpenCVImageFilter();
~ImageToOpenCVImageFilter() override;
///
/// Saves if the filter should copy the data or just reference it
///
mitk::WeakPointer<mitk::Image> m_Image;
cv::Mat m_OpenCVImage;
private:
ImageSliceSelector::Pointer m_sliceSelector;
};
} // namespace
#endif // mitkImageToOpenCVImageFilter_h
diff --git a/Modules/OpenCVVideoSupport/mitkMovieGeneratorOpenCV.h b/Modules/OpenCVVideoSupport/mitkMovieGeneratorOpenCV.h
index 09f7c9561b..f677abe127 100755
--- a/Modules/OpenCVVideoSupport/mitkMovieGeneratorOpenCV.h
+++ b/Modules/OpenCVVideoSupport/mitkMovieGeneratorOpenCV.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MovieGeneratorOpenCV_H_HEADER_INCLUDED
#define MovieGeneratorOpenCV_H_HEADER_INCLUDED
#include "mitkMovieGenerator.h"
#include <MitkOpenCVVideoSupportExports.h>
#include <memory.h>
#include <cstring>
// OpenCV includes
#include "cv.h"
#include "highgui.h"
namespace mitk {
class MITKOPENCVVIDEOSUPPORT_EXPORT MovieGeneratorOpenCV : public MovieGenerator
{
public:
mitkClassMacro(MovieGeneratorOpenCV, MovieGenerator);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void SetFileName( const char *fileName ) override;
void SetFourCCCodec(char* codec)
{
m_FourCCCodec = codec;
}
void SetFrameRate(unsigned int rate) override;
///
/// if true the movie will be cutted by a 10 pixel margin
/// in order to remove the standard mitk coloured borders
/// default: true
///
void SetRemoveColouredFrame(bool);
protected:
MovieGeneratorOpenCV();
//! called directly before the first frame is added
bool InitGenerator() override;
//! used to add a frame
bool AddFrame( void *data ) override;
//! called after the last frame is added
bool TerminateGenerator() override;
//! name of output file
std::string m_sFile;
//! frame rate
int m_dwRate;
private:
CvVideoWriter* m_aviWriter;
IplImage * m_currentFrame;
char * m_FourCCCodec;
bool m_RemoveColouredFrame;
};
} // namespace mitk
#endif /* MovieGeneratorOpenCV_H_HEADER_INCLUDED */
diff --git a/Modules/OpenCVVideoSupport/mitkOpenCVToMitkImageFilter.h b/Modules/OpenCVVideoSupport/mitkOpenCVToMitkImageFilter.h
index d42d510172..283f91bc90 100644
--- a/Modules/OpenCVVideoSupport/mitkOpenCVToMitkImageFilter.h
+++ b/Modules/OpenCVVideoSupport/mitkOpenCVToMitkImageFilter.h
@@ -1,95 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkOpenCVToMitkImageFilter_h
#define mitkOpenCVToMitkImageFilter_h
// mitk includes
#include <MitkOpenCVVideoSupportExports.h>
#include <mitkCommon.h>
#include <mitkImageSource.h>
// itk includes
#include <itkMacro.h>
#include <itkFastMutexLock.h>
#include <itkImage.h>
// OpenCV includes
#include <opencv2/core.hpp>
namespace mitk
{
///
/// \brief Filter for creating MITK RGB Images from an OpenCV image
///
class MITKOPENCVVIDEOSUPPORT_EXPORT OpenCVToMitkImageFilter : public ImageSource
{
public:
typedef itk::RGBPixel< unsigned char > UCRGBPixelType;
typedef itk::RGBPixel< unsigned short > USRGBPixelType;
typedef itk::RGBPixel< float > FloatRGBPixelType;
typedef itk::RGBPixel< double > DoubleRGBPixelType;
///
/// the static function for the conversion
///
template <typename TPixel, unsigned int VImageDimension>
static Image::Pointer ConvertCVMatToMitkImage(const cv::Mat input);
mitkClassMacro(OpenCVToMitkImageFilter, ImageSource);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
///
/// sets an iplimage as input
///
void SetOpenCVImage(const IplImage* image);
//itkGetMacro(OpenCVImage, const IplImage*);
///
/// sets an opencv mat as input (will be used if OpenCVImage Ipl image is 0)
///
void SetOpenCVMat(const cv::Mat& image);
itkGetMacro(OpenCVMat, cv::Mat);
OutputImageType* GetOutput(void);
//##Documentation
//## @brief Convenient method to insert an openCV image as a slice at a
//## certain time step into a 3D or 4D mitk::Image.
//##
//## @param openCVImage - the image that is inserted into the mitk Image
//## @param mitkImage - pointer to the mitkImage, which is changed by this method!
//## @param timeStep - the time step, at which the openCVImage is inserted
//##
//## @attention The parameter mitkImage will be changed!
void InsertOpenCVImageAsMitkTimeSlice(const cv::Mat openCVImage, Image::Pointer mitkImage, int timeStep);
protected:
OpenCVToMitkImageFilter(); // purposely hidden
~OpenCVToMitkImageFilter() override;
void GenerateData() override;
protected:
Image::Pointer m_Image;
cv::Mat m_OpenCVMat;
itk::FastMutexLock::Pointer m_ImageMutex;
itk::FastMutexLock::Pointer m_OpenCVMatMutex;
};
} // namespace mitk
#endif // mitkOpenCVToMitkImageFilter_h
diff --git a/Modules/OpenCVVideoSupport/mitkOpenCVVideoSource.h b/Modules/OpenCVVideoSupport/mitkOpenCVVideoSource.h
index 61848cf2e8..e0bc23ccfc 100644
--- a/Modules/OpenCVVideoSupport/mitkOpenCVVideoSource.h
+++ b/Modules/OpenCVVideoSupport/mitkOpenCVVideoSource.h
@@ -1,197 +1,197 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _mitk_OpenCVVideo_Source_h_
#define _mitk_OpenCVVideo_Source_h_
#include "mitkConfig.h"
#include "mitkVideoSource.h"
#include "mitkUndistortCameraImage.h"
// HighGui camera interface: a convenient way for grabbing from a video capture (on windows VfW is used)
#include <opencv2/highgui.hpp>
// For Providing ITK Image Interface
#include "itkRGBPixel.h"
#include "itkImage.h"
#include "itkImageRegionIterator.h"
#include "mitkOpenCVImageSource.h"
namespace mitk
{
/**
* Interface for acquiring video data using Intel's OPENCV library.
* Video data may either be provided from a file or a grabbing device.
* At the moment, OPENCV includes two separated modules for this grabbing, but only HighGui is
* used here.
* Initialize via SetVideoFileInput() or SetVideoCameraInput(), start processing with StartCapturing();
*/
class MITKOPENCVVIDEOSUPPORT_EXPORT OpenCVVideoSource :
virtual public VideoSource, virtual public OpenCVImageSource
{
public:
typedef itk::RGBPixel< unsigned char > CharPixelType;
typedef itk::FixedArray <float,3> HSVPixelType;
typedef itk::Image< CharPixelType , 2 > RGBPixelImageType;
typedef itk::Image<HSVPixelType,2> HSVPixelImageType;
typedef itk::ImageRegionIterator< RGBPixelImageType > RGBConstIteratorType;
typedef itk::ImageRegionIterator< HSVPixelImageType > HSVConstIteratorType;
mitkClassMacro( OpenCVVideoSource, VideoSource );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
////##Documentation
////## @brief sets a video file as input device. One video frame is being processed by updating the renderwindow.
////## Notice: Which codecs and file formats are supported depends on the back end library.
////## Common Function that currently uses HighGui Lib for video playback
virtual void SetVideoFileInput(const char * filename, bool repeatVideo, bool useCVCAMLib = false);
////##Documentation
////##@brief Initializes capturing video from camera.
////## Common Function for use either with HIGHGUI or with CVCAM library
////## On windows: if you use CVCAM Library, you can pass -1 as camera index for a selection menu
virtual void SetVideoCameraInput(int cameraindex, bool useCVCAMLib = false);
////##Documentation
////## The function GetVideoCaptureProperty retrieves the specified property of camera or video file from HIGHGUI LIBRARY.
////## Video input has to be initialized before call, that means: at least one frame has to be grabbed already.
////## The property_id identifier can be the following:
////## CV_CAP_PROP_POS_MSEC film current position in milliseconds or video capture timestamp
////## CV_CAP_PROP_POS_FRAMES 0-based index of the frame to be decoded/captured next
////## CV_CAP_PROP_POS_AVI_RATIO relative position of video file (0 - start of the film, 1 - end of the film)
////## CV_CAP_PROP_FRAME_WIDTH width of frames in the video stream
////## CV_CAP_PROP_FRAME_HEIGHT height of frames in the video stream
////## CV_CAP_PROP_FPS frame rate
////## CV_CAP_PROP_FOURCC 4-character code of codec
////## CV_CAP_PROP_FRAME_COUNT number of frames in video file
////## See OpenCV Highgui documentation for more details ( http://opencvlibrary.sourceforge.net/HighGui )
virtual double GetVideoCaptureProperty(int property_id);
////##Documentation
////## @brief sets the specified property of video capturing from HIGHGUI LIBRARY.
////## Notice: Some properties only can be set using a video file as input devices, others using a camera.
////## See OpenCV Highgui documentation for more details ( http://opencvlibrary.sourceforge.net/HighGui )
virtual int SetVideoCaptureProperty(int property_id, double value);
virtual void GetCurrentFrameAsOpenCVImage(IplImage * image);
///
/// \return a copy of the image as opencv 2 Mat
///
cv::Mat GetImage() override;
virtual const IplImage * GetCurrentFrame();
////##Documentation
////## @brief returns the current video data as an ITK image.
virtual void GetCurrentFrameAsItkHSVPixelImage(HSVPixelImageType::Pointer &Image);
////##Documentation
////## @brief assigns the grabbing devices for acquiring the next frame.
void FetchFrame() override;
////##Documentation
////## @brief returns a pointer to the image data array for opengl rendering.
unsigned char * GetVideoTexture() override;
////##Documentation
////## @brief starts the video capturing.
void StartCapturing() override;
////##Documentation
////## @brief stops the video capturing.
void StopCapturing() override;
////##Documentation
////## @brief rotate image according to the set angle.
virtual IplImage* FlipImage(IplImage* input);
////##Documentation
////## @brief EnableOnlineImageUndistortion allows for an online image undistortion directly after capturing an image.
////## The function has to be called after setting up the video input; the result is made accessible via the normal
////## GetCurrentFrame... functions.
virtual void EnableOnlineImageUndistortion(mitk::Point3D focal, mitk::Point3D principal, mitk::Point4D distortion);
////##Documentation
////## @brief DisableOnlineImageUndistortion is used to disable the automatic image undistortion.
virtual void DisableOnlineImageUndistortion();
///
/// \return true if image undistorsion is enabled
///
virtual bool OnlineImageUndistortionEnabled() const;
void PauseCapturing() override;
///
/// Returns the video file name (maybe empty if a grabbing device is used)
///
itkGetConstMacro( VideoFileName, std::string );
virtual void SetEnableXAxisFlip(bool enable);
virtual void SetEnableYAxisFlip(bool enable);
///
/// Returns the GrabbingDeviceNumber (maybe -1 if a video file is used)
///
itkGetConstMacro( GrabbingDeviceNumber, short );
itkGetMacro( RepeatVideo, bool );
itkSetMacro( RepeatVideo, bool );
protected:
OpenCVVideoSource();
~OpenCVVideoSource() override;
///
/// Resets the whole class for capturing from a new device
///
void Reset();
////##Documentation
////## @brief internally used for converting the current video frame to a texture for opengl rendering,
////## so that GetVideoTexture() can be used.
void UpdateVideoTexture();
// Helper functions
void sleep(unsigned int ms);
void RGBtoHSV(float r, float g, float b, float &h, float &s, float &v);
// HighGUI Library capture device
CvCapture * m_VideoCapture;
// current Video image
IplImage * m_CurrentImage;
unsigned char* m_CurrentVideoTexture;
IplImage * m_PauseImage;
///
/// saves the video file name (is empty if a grabbing device is used or if this is not initialized)
std::string m_VideoFileName;
///
/// saves the grabbing device number (is -1 if a videofilename is used or if this is not initialized)
short m_GrabbingDeviceNumber;
// Repeat a video file
bool m_RepeatVideo;
// Switch between CVCAM Lib and HighGui Lib
bool m_UseCVCAMLib;
// On-the-fly undistortion of the captured video image
bool m_UndistortImage;
mitk::UndistortCameraImage::Pointer m_UndistortCameraImage;
/**
* Flag to enable or disable video flipping by X Axis.
**/
bool m_FlipXAxisEnabled;
/**
* Flag to enable or disable video flipping by Y Axis.
**/
bool m_FlipYAxisEnabled;
};
}
#endif // Header
diff --git a/Modules/OpenCVVideoSupport/mitkUndistortCameraImage.h b/Modules/OpenCVVideoSupport/mitkUndistortCameraImage.h
index f17d0acd85..b2ffc3aa30 100644
--- a/Modules/OpenCVVideoSupport/mitkUndistortCameraImage.h
+++ b/Modules/OpenCVVideoSupport/mitkUndistortCameraImage.h
@@ -1,126 +1,126 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkUndistortCameraImage_h
#define __mitkUndistortCameraImage_h
#include "mitkCommon.h"
#include <MitkOpenCVVideoSupportExports.h>
#include "itkObject.h"
#include "mitkPoint.h"
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
/*!
\brief UndistortCameraImage
This class is used to undistort camera images. Before any undistortion the class has to be initialized using the functions:
SetFocalLength(),SetPrinzipalPoint() and SetCameraDistortion().
After this you can either use UndistortPixel() to undistort a single pixel's coordinates or UndistortImage() to undistort an
OpenCV image.
A faster version of UndistortImage() is UndistortImageFast(), however, it has to be initialized once with SetUndistortImageFastInfo()
instead of the Set... methods before use.
\sa QmitkFunctionality
\ingroup Functionalities
*/
namespace mitk
{
class MITKOPENCVVIDEOSUPPORT_EXPORT UndistortCameraImage : public itk::Object
{
public:
mitkClassMacroItkParent(UndistortCameraImage,itk::Object);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/// Initialization ///
/*
* Set the camera's intrinsic focal length
*/
void SetFocalLength(float fc_x, float fc_y)
{
m_fcX = fc_x; m_fcY = fc_y;
}
/*
* Set the camera's intrinsic principal point
*/
void SetPrincipalPoint(float cc_x, float cc_y)
{
m_ccX = cc_x; m_ccY = cc_y;
}
/*
* Set the camera's intrinsic distortion parameters
*/
void SetCameraDistortion(float kc1, float kc2, float kc3, float kc4)
{
m_distortionMatrixData[0] = kc1; m_distortionMatrixData[1] = kc2;
m_distortionMatrixData[2] = kc3; m_distortionMatrixData[3] = kc4;
}
/*
* Pre-Calculates matrices for the later use of UndistortImageFast()
*/
void InitRemapUndistortion(int sizeX, int sizeY);
/// USAGE ///
/*
* Undistort a single pixel, returns undistorted pixel
*/
mitk::Point2D UndistortPixel(const mitk::Point2D& src);
/*
* Complete undistortion of an OpenCV image, including all calculations
*/
void UndistortImage(IplImage* src, IplImage* dst);
/*
* Complete undistortion of an OpenCV image, using pre-calculated matrices from SetUndistortImageFastInfo()
* The use of only a source parameter will cause the source to be overwritten.
* NOTE: Using the Fast undistortion methods does not require a initialization via the Set... methods.
*/
void UndistortImageFast( IplImage * src, IplImage* dst = nullptr );
void SetUndistortImageFastInfo(float in_dF1, float in_dF2,
float in_dPrincipalX, float in_dPrincipalY,
float in_Dist[4], float ImageSizeX, float ImageSizeY);
UndistortCameraImage();
~UndistortCameraImage() override;
protected:
// principal point and focal length parameters
float m_ccX, m_ccY, m_fcX, m_fcY;
// undistortion parameters
float m_distortionMatrixData[4];
// intrinsic camera parameters
float m_intrinsicMatrixData[9];
// precalculated matrices for fast image undistortion with UndistortImageFast()
CvMat * m_mapX, * m_mapY;
// intrinsic and undistortion camera matrices
CvMat m_intrinsicMatrix, m_distortionMatrix;
// temp image
IplImage * m_tempImage;
CvMat *m_DistortionCoeffs;
CvMat *m_CameraMatrix;
};
}
#endif
diff --git a/Modules/OpenCVVideoSupport/mitkVideoInputSource.h b/Modules/OpenCVVideoSupport/mitkVideoInputSource.h
index 398009c062..dd5a21f94a 100644
--- a/Modules/OpenCVVideoSupport/mitkVideoInputSource.h
+++ b/Modules/OpenCVVideoSupport/mitkVideoInputSource.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _mitk_VideoInput_Source_h_
#define _mitk_VideoInput_Source_h_
#include "mitkConfig.h"
#include "mitkOpenCVVideoSource.h"
#include "mitkUndistortCameraImage.h"
#include <MitkOpenCVVideoSupportExports.h>
class videoInput;
namespace mitk
{
class MITKOPENCVVIDEOSUPPORT_EXPORT VideoInputSource : public OpenCVVideoSource
{
public:
mitkClassMacro( VideoInputSource, OpenCVVideoSource );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
////##Documentation
////## @brief All functions behave like OpenCVVideoSource to the outside.
//void GetCurrentFrameAsOpenCVImage(IplImage * image);
void FetchFrame();
////##Documentation
////## @brief returns a pointer to the image data array for opengl rendering.
//unsigned char * GetVideoTexture();
void StartCapturing();
void StopCapturing();
void SetVideoCameraInput(int cameraindex, bool useCVCAMLib);
void SetVideoFileInput(const char * filename, bool repeatVideo, bool useCVCAMLib);
itkGetConstMacro(ShowSettingsWindow, bool);
itkSetMacro(ShowSettingsWindow, bool);
itkGetMacro(VideoInput, bool);
protected:
VideoInputSource();
virtual ~VideoInputSource();
videoInput* m_VideoInput;
int m_DeviceNumber;
int m_CaptureSize;
// current Video image
unsigned char* m_CurrentVideoTexture;
///
/// Show vendor specific settings window?
///
bool m_ShowSettingsWindow;
};
}
#endif // Header
diff --git a/Modules/OpenIGTLink/DeviceSources/mitkIGTL2DImageDeviceSource.h b/Modules/OpenIGTLink/DeviceSources/mitkIGTL2DImageDeviceSource.h
index 5d00b9db33..5fd9ead617 100644
--- a/Modules/OpenIGTLink/DeviceSources/mitkIGTL2DImageDeviceSource.h
+++ b/Modules/OpenIGTLink/DeviceSources/mitkIGTL2DImageDeviceSource.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef IGTL2DIMAGEDEVICESOURCE_H_HEADER_INCLUDED_
#define IGTL2DIMAGEDEVICESOURCE_H_HEADER_INCLUDED_
#include "mitkIGTLDeviceSource.h"
namespace mitk {
/**
* \brief Connects a mitk::IGTLDevice to a
* MITK-OpenIGTLink-Message-Filter-Pipeline
*
* This class is the source of most OpenIGTLink pipelines. It encapsulates a
* mitk::IGTLDevice and provides the information/messages of the connected
* OpenIGTLink devices as igtl::MessageBase objects. Note, that there is just
* one single output.
*
*/
class MITKOPENIGTLINK_EXPORT IGTL2DImageDeviceSource : public IGTLDeviceSource
{
public:
mitkClassMacro(IGTL2DImageDeviceSource, IGTLDeviceSource);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
protected:
IGTL2DImageDeviceSource();
~IGTL2DImageDeviceSource() override;
/**
* \brief filter execute method
*
* queries the OpenIGTLink device for new messages and updates its output
* igtl::MessageBase objects with it.
* \warning Will raise a std::out_of_range exception, if tools were added to
* the OpenIGTLink device after it was set as input for this filter
*/
void GenerateData() override;
};
} // namespace mitk
#endif /* MITKIGTLDeviceSource_H_HEADER_INCLUDED_ */
diff --git a/Modules/OpenIGTLink/DeviceSources/mitkIGTL3DImageDeviceSource.h b/Modules/OpenIGTLink/DeviceSources/mitkIGTL3DImageDeviceSource.h
index d84186a3df..9824f4a3a2 100644
--- a/Modules/OpenIGTLink/DeviceSources/mitkIGTL3DImageDeviceSource.h
+++ b/Modules/OpenIGTLink/DeviceSources/mitkIGTL3DImageDeviceSource.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef IGTL3DIMAGEDEVICESOURCE_H_HEADER_INCLUDED_
#define IGTL3DIMAGEDEVICESOURCE_H_HEADER_INCLUDED_
#include "mitkIGTLDeviceSource.h"
namespace mitk {
/**
* \brief Connects a mitk::IGTLDevice to a
* MITK-OpenIGTLink-Message-Filter-Pipeline
*
* This class is the source of most OpenIGTLink pipelines. It encapsulates a
* mitk::IGTLDevice and provides the information/messages of the connected
* OpenIGTLink devices as igtl::MessageBase objects. Note, that there is just
* one single output.
*
*/
class MITKOPENIGTLINK_EXPORT IGTL3DImageDeviceSource : public IGTLDeviceSource
{
public:
mitkClassMacro(IGTL3DImageDeviceSource, IGTLDeviceSource);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
protected:
IGTL3DImageDeviceSource();
~IGTL3DImageDeviceSource() override;
/**
* \brief filter execute method
*
* queries the OpenIGTLink device for new messages and updates its output
* igtl::MessageBase objects with it.
* \warning Will raise a std::out_of_range exception, if tools were added to
* the OpenIGTLink device after it was set as input for this filter
*/
void GenerateData() override;
};
} // namespace mitk
#endif /* MITKIGTLDeviceSource_H_HEADER_INCLUDED_ */
diff --git a/Modules/OpenIGTLink/mitkIGTLClient.h b/Modules/OpenIGTLink/mitkIGTLClient.h
index aff947c35b..df687806c5 100644
--- a/Modules/OpenIGTLink/mitkIGTLClient.h
+++ b/Modules/OpenIGTLink/mitkIGTLClient.h
@@ -1,89 +1,89 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKIGTLCLIENT_H
#define MITKIGTLCLIENT_H
#include "mitkIGTLDevice.h"
#include <MitkOpenIGTLinkExports.h>
namespace mitk
{
/**
* \brief Superclass for OpenIGTLink clients
*
* Implements the IGTLDevice interface for IGTLClients. In certain points it
* behaves different than the IGTLServer. The client connects directly to a
* server (it cannot connect to two different servers). Therefore, it has to
* check only this one connection.
*
* \ingroup OpenIGTLink
*/
class MITKOPENIGTLINK_EXPORT IGTLClient : public IGTLDevice
{
public:
- mitkClassMacro(IGTLClient, IGTLDevice)
- mitkNewMacro1Param(Self, bool)
- itkCloneMacro(Self)
+ mitkClassMacro(IGTLClient, IGTLDevice);
+ mitkNewMacro1Param(Self, bool);
+ itkCloneMacro(Self);
/**
* \brief Establishes the connection between this client and the IGTL server.
*
* @throw mitk::Exception Throws an exception if the client is not in Setup
* mode or if it cannot connect to the defined host.
*/
bool OpenConnection() override;
/**
* \brief Returns the number of connections of this device
*
* A client can connect to one sever only, therefore, the number is either 0
* or 1
*/
unsigned int GetNumberOfConnections() override;
protected:
/** Constructor */
IGTLClient(bool ReadFully);
/** Destructor */
~IGTLClient() override;
/**
* \brief Call this method to receive a message.
*
* The message will be saved in the receive queue. If the connection is lost
* it will stop the communication.
*/
void Receive() override;
/**
* \brief Call this method to send a message.
*
* The message will be read from the queue.
*/
void Send() override;
/**
* \brief Stops the communication with the given socket.
*
* The client uses just one socket. Therefore, calling this function causes
* the stop of the communication.
*
*/
void StopCommunicationWithSocket(igtl::Socket*) override;
};
} // namespace mitk
#endif /* MITKIGTLCLIENT_H */
diff --git a/Modules/OpenIGTLink/mitkIGTLDevice.h b/Modules/OpenIGTLink/mitkIGTLDevice.h
index afcd827967..57695c0f64 100644
--- a/Modules/OpenIGTLink/mitkIGTLDevice.h
+++ b/Modules/OpenIGTLink/mitkIGTLDevice.h
@@ -1,413 +1,413 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKIGTLDEVICE_H
#define MITKIGTLDEVICE_H
#include "mitkCommon.h"
//itk
#include "itkObject.h"
#include "itkFastMutexLock.h"
#include "itkMultiThreader.h"
//igtl
#include "igtlSocket.h"
#include "igtlMessageBase.h"
#include "igtlTransformMessage.h"
//mitkIGTL
#include "MitkOpenIGTLinkExports.h"
#include "mitkIGTLMessageFactory.h"
#include "mitkIGTLMessageQueue.h"
#include "mitkIGTLMessage.h"
namespace mitk {
/**
* \brief Interface for all OpenIGTLink Devices
*
* Defines the methods that are common for all devices using OpenIGTLink. It
* can open/close a connection, start/stop a communication and send/receive
* messages.
*
* It uses message queues to store the incoming and outgoing mails. They are
* configurable, you can set buffering on and off.
*
* The device is in one of three different states: Setup, Ready or Running.
* Setup is the initial state. From this state on you can call
* OpenConnection() and arrive in the Ready state. From the Ready state you
* call StartCommunication() to arrive in the Running state. Now the device
* is continuosly checking for new connections, receiving messages and
* sending messages. This runs in a seperate thread. To stop the communication
* call StopCommunication() (to arrive in Ready state) or CloseConnection()
* (to arrive in the Setup state).
*
* \ingroup OpenIGTLink
*
*/
class MITKOPENIGTLINK_EXPORT IGTLDevice : public itk::Object
{
public:
- mitkClassMacroItkParent(IGTLDevice, itk::Object)
+ mitkClassMacroItkParent(IGTLDevice, itk::Object);
IGTLDevice(bool ReadFully);
/**
* \brief Type for state variable.
* The IGTLDevice is always in one of these states.
*
*/
enum IGTLDeviceState { Setup, Ready, Running };
/**
* \brief Opens a connection to the device
*
* This may only be called if there is currently no connection to the
* device. If OpenConnection() is successful, the object will change from
* Setup state to Ready state.
*/
virtual bool OpenConnection() = 0;
/**
* \brief Closes the connection to the device
*
* This may only be called if there is currently a connection to the
* device, but device is not running (e.g. object is in Ready state)
*/
virtual bool CloseConnection();
/**
* \brief Stops the communication between the two devices
*
* This may only be called if the device is in Running state.
*/
virtual bool StopCommunication();
/**
* \brief Starts the communication between the two devices
*
* This may only be called if the device is in Ready state.
*/
bool StartCommunication();
/**
* \brief Continuously calls the given function
*
* This may only be called if the device is in Running state and only from
* a seperate thread.
*
* \param ComFunction function pointer that specifies the method to be executed
* \param mutex the mutex that corresponds to the function pointer
*/
void RunCommunication(void (IGTLDevice::*ComFunction)(void), itk::FastMutexLock* mutex);
/**
* \brief Adds the given message to the sending queue
*
* This may only be called after the connection to the device has been
* established with a call to OpenConnection(). Note that the message
* is not send directly. This method just adds it to the send queue.
* \param msg The message to be added to the sending queue
*/
void SendMessage(mitk::IGTLMessage::Pointer msg);
/**
* \brief Returns current object state (Setup, Ready or Running)
*/
IGTLDeviceState GetState() const;
/**
* \brief Returns the oldest message in the command queue
* \return The oldest message from the command queue.
*/
igtl::MessageBase::Pointer GetNextCommand();
/**
* \brief Returns the oldest message in the receive queue
* \return The oldest message from the receive queue
*/
igtl::ImageMessage::Pointer GetNextImage2dMessage();
igtl::ImageMessage::Pointer GetNextImage3dMessage();
igtl::TransformMessage::Pointer GetNextTransformMessage();
igtl::TrackingDataMessage::Pointer GetNextTrackingDataMessage();
igtl::StringMessage::Pointer GetNextStringMessage();
igtl::MessageBase::Pointer GetNextMiscMessage();
/**
* \brief Sets the port number of the device
*/
itkSetMacro(PortNumber, int);
/**
* \brief Returns the port number of the device
*/
itkGetMacro(PortNumber, int);
/**
* \brief Sets the ip/hostname of the device
*/
itkSetMacro(Hostname, std::string);
/**
* \brief Returns the ip/hostname of the device
*/
itkGetMacro(Hostname, std::string);
/**
* \brief Returns the name of this device
*/
itkGetConstMacro(Name, std::string);
/**
* \brief Sets the name of this device
*/
itkSetMacro(Name, std::string);
/**
* \brief Advises this IGTL Device to always block until the whole message is read.
*/
itkSetMacro(ReadFully, bool);
/**
* \brief Returns a const reference to the receive queue
*/
itkGetConstMacro(MessageQueue, mitk::IGTLMessageQueue::Pointer);
/**
* \brief Returns the message factory
*/
itkGetMacro(MessageFactory, mitk::IGTLMessageFactory::Pointer);
/**
* \brief static start method for the sending thread.
* \param data a void pointer to the IGTLDevice object.
*/
static ITK_THREAD_RETURN_TYPE ThreadStartSending(void* data);
/**
* \brief static start method for the receiving thread.
* \param data a void pointer to the IGTLDevice object.
*/
static ITK_THREAD_RETURN_TYPE ThreadStartReceiving(void* data);
/**
* \brief static start method for the connection thread.
* \param data a void pointer to the IGTLDevice object.
*/
static ITK_THREAD_RETURN_TYPE ThreadStartConnecting(void* data);
/**
* \brief TestConnection() tries to connect to a IGTL device on the current
* ip and port
*
* \todo Implement this method. Send a status message and check the answer.
*
* TestConnection() tries to connect to a IGTL server on the current
* ip and port and returns which device it has found.
* \return It returns the type of the device that answers. Throws an
* exception
* if no device is available on that ip/port.
* @throw mitk::Exception Throws an exception if there are errors
* while connecting to the device.
*/
virtual bool TestConnection();
/**
* \brief Send RTS message of given type
*/
bool SendRTSMessage(const char* type);
/**
* \brief Sets the buffering mode of the given queue
*/
void EnableNoBufferingMode(mitk::IGTLMessageQueue::Pointer queue,
bool enable = true);
void EnableNoBufferingMode(bool enable = true);
/**
* \brief Returns the number of connections of this device
*/
virtual unsigned int GetNumberOfConnections() = 0;
itkGetMacro(LogMessages, bool);
itkSetMacro(LogMessages, bool);
protected:
/**
* \brief Sends a message.
*
* This may only be called after the connection to the device has been
* established with a call to OpenConnection(). This method uses the given
* socket to send the given MessageReceivedEvent
*
* \param msg the message to be sent
* \param socket the socket used to communicate with the other device
*
* \retval IGTL_STATUS_OK the message was sent
* \retval IGTL_STATUS_UNKONWN_ERROR the message was not sent because an
* unknown error occurred
*/
unsigned int SendMessagePrivate(mitk::IGTLMessage::Pointer msg,
igtl::Socket::Pointer socket);
/**
* \brief Call this method to receive a message.
*
* The message will be saved in the receive queue.
*/
virtual void Receive() = 0;
/**
* \brief Call this method to receive a message from the given device.
*
* The message will be saved in the receive queue.
*
* \param device the socket that connects this device with the other one.
*
* \retval IGTL_STATUS_OK a message or a command was received
* \retval IGTL_STATUS_NOT_PRESENT the socket is not connected anymore
* \retval IGTL_STATUS_TIME_OUT the socket timed out
* \retval IGTL_STATUS_CHECKSUM_ERROR the checksum of the received msg was
* incorrect
* \retval IGTL_STATUS_UNKNOWN_ERROR an unknown error occurred
*/
unsigned int ReceivePrivate(igtl::Socket* device);
/**
* \brief Call this method to send a message. The message will be read from
* the queue.
*/
virtual void Send() = 0;
/**
* \brief Call this method to check for other devices that want to connect
* to this one.
*
* In case of a client this method is doing nothing. In case of a server it
* is checking for other devices and if there is one it establishes a
* connection.
*/
virtual void Connect();
/**
* \brief Stops the communication with the given socket
*
*/
virtual void StopCommunicationWithSocket(igtl::Socket* socket) = 0;
/**
* \brief change object state
*/
void SetState(IGTLDeviceState state);
IGTLDevice();
~IGTLDevice() override;
/** current object state (Setup, Ready or Running) */
IGTLDeviceState m_State;
/** the name of this device */
std::string m_Name;
/** signal used to stop the thread*/
bool m_StopCommunication;
/** mutex to control access to m_StopCommunication */
itk::FastMutexLock::Pointer m_StopCommunicationMutex;
/** mutex used to make sure that the send thread is just started once */
itk::FastMutexLock::Pointer m_SendingFinishedMutex;
/** mutex used to make sure that the receive thread is just started once */
itk::FastMutexLock::Pointer m_ReceivingFinishedMutex;
/** mutex used to make sure that the connect thread is just started once */
itk::FastMutexLock::Pointer m_ConnectingFinishedMutex;
/** mutex to control access to m_State */
itk::FastMutexLock::Pointer m_StateMutex;
/** the hostname or ip of the device */
std::string m_Hostname;
/** the port number of the device */
int m_PortNumber;
/** the socket used to communicate with other IGTL devices */
igtl::Socket::Pointer m_Socket;
/** The message receive queue */
mitk::IGTLMessageQueue::Pointer m_MessageQueue;
/** A message factory that provides the New() method for all msg types */
mitk::IGTLMessageFactory::Pointer m_MessageFactory;
bool m_LogMessages;
private:
/** creates worker thread that continuously polls interface for new
messages */
itk::MultiThreader::Pointer m_MultiThreader;
/** ID of sending thread */
int m_SendThreadID;
/** ID of receiving thread */
int m_ReceiveThreadID;
/** ID of connecting thread */
int m_ConnectThreadID;
/** Always try to read the full message. */
bool m_ReadFully;
};
/**
* \brief connect to this Event to get notified when a message was successfully sent
*
* \note This event is invoked in the communication thread, therefore do not use it to make
* changes in the GUI!!! Use the QT signal slot system to decouple this call from the com thread
* */
itkEventMacro(MessageSentEvent, itk::AnyEvent);
/**
* \brief connect to this Event to get notified when a message was received
*
* \note Check if you can invoke this events like this or if you have to make
* it thread-safe. They are not invoked in the main thread!!!
* */
itkEventMacro(MessageReceivedEvent, itk::AnyEvent);
/**
* \brief connect to this Event to get notified when a command was received
*
* \note Check if you can invoke this events like this or if you have to make
* it thread-safe. They are not invoked in the main thread!!!
* */
itkEventMacro(CommandReceivedEvent, itk::AnyEvent);
/**
* \brief connect to this Event to get notified when another igtl device
* connects with this device.
*
* \note Check if you can invoke this events like this or if you have to make
* it thread-safe. They are not invoked in the main thread!!!
* */
itkEventMacro(NewClientConnectionEvent, itk::AnyEvent);
/**
* \brief connect to this Event to get notified when this device looses the
* connection to a socket.
*
* \note Check if you can invoke this events like this or if you have to make
* it thread-safe. They are not invoked in the main thread!!!
* */
itkEventMacro(LostConnectionEvent, itk::AnyEvent);
} // namespace mitk
#endif /* MITKIGTLDEVICE_H */
diff --git a/Modules/OpenIGTLink/mitkIGTLDeviceSource.h b/Modules/OpenIGTLink/mitkIGTLDeviceSource.h
index 085212edd7..7d0a85be70 100644
--- a/Modules/OpenIGTLink/mitkIGTLDeviceSource.h
+++ b/Modules/OpenIGTLink/mitkIGTLDeviceSource.h
@@ -1,205 +1,205 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef IGTLDEVICESOURCE_H_HEADER_INCLUDED_
#define IGTLDEVICESOURCE_H_HEADER_INCLUDED_
#include "mitkIGTLDevice.h"
#include "mitkIGTLMessageSource.h"
namespace mitk {
/**
* \brief Connects a mitk::IGTLDevice to a
* MITK-OpenIGTLink-Message-Filter-Pipeline
*
* This class is the source of most OpenIGTLink pipelines. It encapsulates a
* mitk::IGTLDevice and provides the information/messages of the connected
* OpenIGTLink devices as igtl::MessageBase objects. Note, that there is just
* one single output.
*
*/
class MITKOPENIGTLINK_EXPORT IGTLDeviceSource : public IGTLMessageSource
{
public:
mitkClassMacro(IGTLDeviceSource, IGTLMessageSource);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
*\brief These Constants are used in conjunction with Microservices
*/
static const std::string US_PROPKEY_IGTLDEVICENAME;
/**
* \brief sets the OpenIGTLink device that will be used as a data source
*/
virtual void SetIGTLDevice(mitk::IGTLDevice* td);
/**
* \brief returns the OpenIGTLink device that is used by this filter
*/
itkGetObjectMacro(IGTLDevice, mitk::IGTLDevice);
/**
*\brief Registers this object as a Microservice, making it available to every
* module and/or plugin. To unregister, call UnregisterMicroservice().
*/
void RegisterAsMicroservice() override;
/**
* \brief Establishes a connection to the OpenIGTLink device. If there is
* already a connection the method does nothing.
* \warning. Will throw a std::invalid_argument exception if no OpenIGTLink
* device was set with SetIGTLDevice(). Will throw a std::runtime_error if
* the OpenIGTLink device returns an error.
*/
void Connect();
/**
* \brief Closes the connection to the OpenIGTLink device
* \warning. Will throw a std::invalid_argument exception if no OpenIGTLink
* device was set with SetIGTLDevice(). Will throw a std::runtime_error if
* the OpenIGTLink device returns an error.
*/
void Disconnect();
/**
* \brief starts the communication of the device.
* This needs to be called before Update() or GetOutput()->Update(). If the
* device is already communicating the method does nothing.
* \warning. Will throw a std::invalid_argument exception if no OpenIGTLink
* device was set with SetIGTLDevice(). Will throw a std::runtime_error if
* the OpenIGTLink device returns an error.
*/
void StartCommunication();
/**
* \brief stops the communication of the device.
* \warning. Will throw a std::invalid_argument exception if no OpenIGTLink
* device was set with SetIGTLDevice(). Will throw a std::runtime_error if
* the OpenIGTLink device returns an error.
*/
void StopCommunication();
/**
* \brief returns true if a connection to the OpenIGTLink device is established
*
*/
virtual bool IsConnected();
/**
* \brief returns true if communication is in progress
*
*/
virtual bool IsCommunicating();
/**
* \brief Used for pipeline update
*/
void UpdateOutputInformation() override;
protected:
IGTLDeviceSource();
~IGTLDeviceSource() override;
/**
* \brief filter execute method
*
* queries the OpenIGTLink device for new messages and updates its output
* igtl::MessageBase objects with it.
* \warning Will raise a std::out_of_range exception, if tools were added to
* the OpenIGTLink device after it was set as input for this filter
*/
void GenerateData() override;
/**
* \brief Create the necessary outputs for the m_IGTLDevice
*
* This Method is called internally whenever outputs need to be reset. Old
* Outputs are deleted when called.
**/
void CreateOutputs();
/**
* \brief This method is called when the IGTL device hold by this class
* receives a new message
**/
virtual void OnIncomingMessage();
/**
* \brief This method is called when the IGTL device hold by this class
* receives a new command
**/
virtual void OnIncomingCommand();
/**
* \brief This method is called when the IGTL device lost the connection to the other side
**/
virtual void OnLostConnection();
/**
* \brief Removes all observers that listen to the igtl device
**/
virtual void RemoveObservers();
using Superclass::SetInput;
/**
* \brief Set input with id idx of this filter
*
*/
virtual void SetInput( unsigned int idx, const IGTLMessage* msg );
/**
* \brief Get the input of this filter
*/
const IGTLMessage* GetInput(void) const;
/**
* \brief Get the input with id idx of this filter
*/
const IGTLMessage* GetInput(unsigned int idx) const;
/**
* \brief Get the input with name messageName of this filter
*/
const IGTLMessage* GetInput(std::string msgName) const;
/**
*\brief return the index of the input with name msgName, throw
* std::invalid_argument exception if that name was not found
*
* \warning if a subclass has inputs that have different data type than
* mitk::IGTLMessage, they have to overwrite this method
*/
DataObjectPointerArraySizeType GetInputIndex(std::string msgName);
/**
*\brief return the index of the output with name msgName, -1 if no output
* with that name was found
*
* \warning if a subclass has outputs that have different data type than
* mitk::IGTLMessage, they have to overwrite this method
*/
DataObjectPointerArraySizeType GetOutputIndex(std::string msgName);
/** the OpenIGTLink device that is used as a source for this filter object*/
mitk::IGTLDevice::Pointer m_IGTLDevice;
/** observer tags */
unsigned int m_LostConnectionObserverTag;
unsigned int m_IncomingCommandObserverTag;
unsigned int m_IncomingMessageObserverTag;
};
} // namespace mitk
#endif /* MITKIGTLDeviceSource_H_HEADER_INCLUDED_ */
diff --git a/Modules/OpenIGTLink/mitkIGTLDummyMessage.h b/Modules/OpenIGTLink/mitkIGTLDummyMessage.h
index 40521f95d5..9ebd122a2b 100644
--- a/Modules/OpenIGTLink/mitkIGTLDummyMessage.h
+++ b/Modules/OpenIGTLink/mitkIGTLDummyMessage.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKIGTLDUMMYMESSAGE_H
#define MITKIGTLDUMMYMESSAGE_H
#include "MitkOpenIGTLinkExports.h"
#include "igtlObject.h"
#include "igtlStringMessage.h"
#include "mitkIGTLMessageCloneHandler.h"
namespace mitk
{
/**
* \class IGTLDummyMessage
* \brief This class is a dummy message to show how to implement a new message type
*/
class MITKOPENIGTLINK_EXPORT IGTLDummyMessage : public igtl::StringMessage
{
public:
typedef IGTLDummyMessage Self;
typedef StringMessage Superclass;
typedef igtl::SmartPointer<Self> Pointer;
typedef igtl::SmartPointer<const Self> ConstPointer;
- igtlTypeMacro( mitk::IGTLDummyMessage, igtl::StringMessage )
- igtlNewMacro( mitk::IGTLDummyMessage )
+ igtlTypeMacro(mitk::IGTLDummyMessage, igtl::StringMessage);
+ igtlNewMacro(mitk::IGTLDummyMessage);
public:
/**
* Set dummy string
*/
void SetDummyString( const std::string& dummyString );
/**
* Get dummy string
*/
std::string GetDummyString();
/**
* Returns a clone of itself
*/
igtl::MessageBase::Pointer Clone() override ;
protected:
IGTLDummyMessage();
~IGTLDummyMessage() override;
std::string m_dummyString;
};
-mitkIGTMessageCloneClassMacro(IGTLDummyMessage, DummyMsgCloneHandler)
+mitkIGTMessageCloneClassMacro(IGTLDummyMessage, DummyMsgCloneHandler);
} // namespace mitk
#endif
diff --git a/Modules/OpenIGTLink/mitkIGTLMessageCloneHandler.h b/Modules/OpenIGTLink/mitkIGTLMessageCloneHandler.h
index 7facc15ea6..a097b1beab 100644
--- a/Modules/OpenIGTLink/mitkIGTLMessageCloneHandler.h
+++ b/Modules/OpenIGTLink/mitkIGTLMessageCloneHandler.h
@@ -1,83 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKIGTLMESSAGECLONE_H_
#define MITKIGTLMESSAGECLONE_H_
#include "itkObject.h"
#include "mitkCommon.h"
#include "igtlObject.h"
#include "igtlMacro.h"
#include "igtlSocket.h"
#include "igtlMessageBase.h"
#include "MitkOpenIGTLinkExports.h"
namespace mitk
{
/**Documentation
* \brief Base class for clone handlers for igtl::MessageBase derived message
* types
*
* To enable new message types a clone function must be defined and added to the
* message factory.
*
*/
class MITKOPENIGTLINK_EXPORT IGTLMessageCloneHandler: public itk::Object
{
public:
- mitkClassMacroItkParent(IGTLMessageCloneHandler, itk::Object)
+ mitkClassMacroItkParent(IGTLMessageCloneHandler, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
public:
virtual igtl::MessageBase::Pointer Clone(igtl::MessageBase*) { return nullptr; }
protected:
IGTLMessageCloneHandler() {}
~IGTLMessageCloneHandler() override {}
};
/**
* Description:
* The mitkIGTMessageCloneClassMacro() macro is to help developers to
* define message clone handler classes. It generates a chlid class of
* mitk::IGTLMessageCloneHandler.
* The developer only needs to implement Clone() after calling this macro.
* The following code shows how to define a handler that processes IMAGE message:
*
* mitkIGTMessageCloneClassMacro(igtl::ImageMessage, TestImageMessageHandler);
* igtl::MessageBase::Pointer
* TestImageMessageHandler::Clone(igtl::MessageBase * message)
* {
* // do something
* }
**/
#define mitkIGTMessageCloneClassMacro(messagetype, classname) \
class classname : public ::mitk::IGTLMessageCloneHandler \
{ \
public: \
mitkClassMacro(classname, mitk::IGTLMessageCloneHandler); \
itkFactorylessNewMacro(Self); \
itkCloneMacro(Self); \
public: \
virtual igtl::MessageBase::Pointer Clone(igtl::MessageBase*); \
protected: \
classname(){} \
~classname() {} \
};
} // namespace mitk
#endif // MITKIGTLMESSAGECLONE_H_
diff --git a/Modules/OpenIGTLink/mitkIGTLMessageFactory.h b/Modules/OpenIGTLink/mitkIGTLMessageFactory.h
index dcc1ccc648..45291f62f2 100644
--- a/Modules/OpenIGTLink/mitkIGTLMessageFactory.h
+++ b/Modules/OpenIGTLink/mitkIGTLMessageFactory.h
@@ -1,148 +1,148 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKIGTLMESSAGEFACTORYH_HEADER_INCLUDED_
#define MITKIGTLMESSAGEFACTORYH_HEADER_INCLUDED_
#include "MitkOpenIGTLinkExports.h"
#include "mitkCommon.h"
#include "igtlMessageBase.h"
#include "igtlMessageHeader.h"
#include "mitkIGTLMessageCloneHandler.h"
namespace mitk {
/**
* \brief Factory class of supported OpenIGTLink message types
*
* This class is a factory for the creation of OpenIGTLink messages. It stores
* pairs of type and pointer to the message new method. Available standard types
* are already added but you can also add your custom types at runtime.
*
*/
class MITKOPENIGTLINK_EXPORT IGTLMessageFactory : public itk::Object
{
public:
- mitkClassMacroItkParent(IGTLMessageFactory, itk::Object)
+ mitkClassMacroItkParent(IGTLMessageFactory, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief Function pointer for storing New() static methods of
* igtl::MessageBase classes
*/
typedef igtl::MessageBase::Pointer (*PointerToMessageBaseNew)();
/**
* \brief Add message type name and pointer to IGTL message new function and
* the clone handler
* \param messageTypeName The name of the message type
* \param messageTypeNewPointer Function pointer to the message type new
* function (e.g. (PointerToMessageBaseNew)&igtl::ImageMessage::New )
* \param cloneHandler pointer to the message clone object
*/
void AddMessageType(std::string messageTypeName,
IGTLMessageFactory::PointerToMessageBaseNew messageTypeNewPointer,
mitk::IGTLMessageCloneHandler::Pointer cloneHandler);
/**
* \brief Add message type name and pointer to IGTL message new function
* Usage:
* AddMessageType("IMAGE", (PointerToMessageBaseNew)&igtl::ImageMessage::New);
* \param messageTypeName The name of the message type
* \param messageTypeNewPointer Function pointer to the message type new
* function (e.g. (PointerToMessageBaseNew)&igtl::ImageMessage::New )
*/
virtual void AddMessageNewMethod(std::string messageTypeName,
IGTLMessageFactory::PointerToMessageBaseNew messageTypeNewPointer);
/**
* \brief Get pointer to message type new function, or nullptr if the message
* type not registered
* Usage:
* igtl::MessageBase::Pointer message = GetMessageTypeNewPointer("IMAGE")();
*/
virtual IGTLMessageFactory::PointerToMessageBaseNew GetMessageTypeNewPointer(
std::string messageTypeName);
/**
* \brief Creates a new message instance fitting to the given type.
*
* If this type is not registered it returns nullptr
* Usage:
* igtl::MessageBase::Pointer message = CreateInstance("IMAGE");
*/
igtl::MessageBase::Pointer CreateInstance(std::string messageTypeName);
/**
* \brief Creates a new message according to the given header
* \param msg The message header that defines the type of the message
* This method checks the data type and creates a new message according to the
* type.
*/
igtl::MessageBase::Pointer CreateInstance(igtl::MessageHeader::Pointer msg);
/**
* \brief Adds a clone function for the specified message type
* \param msgTypeName The name of the message type
* \param msgCloneHandler Function pointer to the message clone function
* (e.g. TBD )
*/
virtual void AddMessageCloneHandler(std::string msgTypeName,
mitk::IGTLMessageCloneHandler::Pointer msgCloneHandler);
/**
* \brief Get pointer to message type clone function, or nullptr if the message
* type is not registered
* Usage:
* igtl::TransformMessage::Pointer original = igtl::TransformMessage::New();
* igtl::MessageBase::Pointer message =
* GetCloneHandler("IMAGE")->Clone(original);
*/
virtual mitk::IGTLMessageCloneHandler::Pointer
GetCloneHandler(std::string messageTypeName);
/**
* \brief Clones the given message according to the available clone methods
* \param msg The message that has to be cloned
* This method checks the data type and clones the message according to this
* type.
*/
igtl::MessageBase::Pointer Clone(igtl::MessageBase::Pointer msg);
/**
* \brief Returns available get messages
*/
std::list<std::string> GetAvailableMessageRequestTypes();
protected:
IGTLMessageFactory();
~IGTLMessageFactory() override;
/**
* \brief Map igt message types and the Clone() methods
*/
std::map<std::string,mitk::IGTLMessageCloneHandler::Pointer> m_CloneHandlers;
/**
* \brief Map igt message types and the New() static methods of igtl::MessageBase
* classes
*/
std::map<std::string, PointerToMessageBaseNew> m_NewMethods;
private:
IGTLMessageFactory(const IGTLMessageFactory&);
};
}
#endif
diff --git a/Modules/OpenIGTLink/mitkIGTLMessageProvider.h b/Modules/OpenIGTLink/mitkIGTLMessageProvider.h
index c4f9a8e839..1b158d0f56 100644
--- a/Modules/OpenIGTLink/mitkIGTLMessageProvider.h
+++ b/Modules/OpenIGTLink/mitkIGTLMessageProvider.h
@@ -1,221 +1,221 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef IGTLMESSAGEPROVIDER_H_HEADER_INCLUDED_
#define IGTLMESSAGEPROVIDER_H_HEADER_INCLUDED_
#include "mitkIGTLDevice.h"
#include "mitkIGTLDeviceSource.h"
//itk
#include "itkCommand.h"
namespace mitk {
/**
* \brief Provides information/objects from a MITK-Pipeline to other OpenIGTLink
* devices
*
* This class is intended as the drain of the pipeline. Other OpenIGTLink
* devices connect with the IGTLDevice hold by this provider. The other device
* asks for a certain data type. The provider checks if there are other
* IGTLMessageSources available that provide this data type. If yes the provider
* connects with this source and sends the message to the requesting device.
*
* If a STT message was received the provider looks for fitting messageSources.
* Once found it connects with it, starts a timing thread (which updates the
* pipeline) and sends the result to the requesting device.
*
* If a GET message was received the provider just calls an update of the
* found source and sends the result without connecting to the source.
*
* If a STP message was received it stops the thread and disconnects from the
* previous source.
*
* So far the provider can just connect with one source.
*
* \ingroup OpenIGTLink
*/
class MITKOPENIGTLINK_EXPORT IGTLMessageProvider : public IGTLDeviceSource
{
public:
mitkClassMacro(IGTLMessageProvider, IGTLDeviceSource);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef itk::SimpleMemberCommand<mitk::IGTLMessageProvider> ProviderCommand;
/**
* \brief sends the msg to the requesting client
*
* Note: so far it broadcasts the message to all registered clients
*/
void Send(mitk::IGTLMessage::Pointer msg);
/**
* \brief Starts the streaming of the given message source with the given fps.
*/
void StartStreamingOfSource(mitk::IGTLMessageSource* src,
unsigned int fps);
/**
* \brief Stops the streaming of the given message source.
*/
void StopStreamingOfSource(mitk::IGTLMessageSource* src);
/**
* \brief Stops the streaming of all message source.
*/
void StopStreamingOfAllSources();
/**
* \brief Returns the streaming state.
*/
bool IsStreaming();
/**
* \brief Get method for the streaming time
*/
itkGetMacro(StreamingTime, unsigned int);
void Update() override;
protected:
IGTLMessageProvider();
~IGTLMessageProvider() override;
/**
* \brief filter execute method
*
* queries the OpenIGTLink device for new messages and updates its output
* igtl::MessageBase objects with it.
* \warning Will raise a std::out_of_range exception, if tools were added to
* the OpenIGTLink device after it was set as input for this filter
*/
void GenerateData() override;
/**
* \brief Create the necessary outputs for the m_IGTLDevice
*
* This Method is called internally whenever outputs need to be reset. Old
* Outputs are deleted when called.
**/
void CreateOutputs();
/**
* \brief This method is called when the IGTL device hold by this class
* receives a new message
**/
void OnIncomingMessage() override;
/**
* \brief This method is called when the IGTL device hold by this class
* receives a new command
**/
void OnIncomingCommand() override;
/**
* \brief This method is called when the IGTL device lost the connection to the other side
**/
void OnLostConnection() override;
/**
*\brief Connects the input of this filter to the outputs of the given
* IGTLMessageSource
*
* This method does not support smartpointer. use FilterX.GetPointer() to
* retrieve a dumbpointer.
*/
void ConnectTo( mitk::IGTLMessageSource* UpstreamFilter );
/**
*\brief Disconnects this filter from the outputs of the given
* IGTLMessageSource
*
* This method does not support smartpointer. use FilterX.GetPointer() to
* retrieve a dumbpointer.
*/
void DisconnectFrom( mitk::IGTLMessageSource* UpstreamFilter );
/**
* \brief Looks for microservices that provide messages with the requested
* type.
**/
mitk::IGTLMessageSource::Pointer GetFittingSource(const char* requestedType);
/** Invokes the start streaming event. This separate method is required, because it
* has to be started from the main thread. (It is used as callback function)
*/
void InvokeStartStreamingEvent();
/** Invokes the stop streaming event. This separate method is required, because it
* has to be started from the main thread. (It is used as callback function)
*/
void InvokeStopStreamingEvent();
private:
/**
* \brief a command that has to be executed in the main thread
*/
ProviderCommand::Pointer m_StreamingCommand;
ProviderCommand::Pointer m_StopStreamingCommand;
///**
// * \brief Timer thread for generating a continuous time signal for the stream
// *
// * Everyt time the time is passed a time signal is invoked.
// *
// * \param pInfoStruct pointer to the mitkIGTLMessageProvider object
// * \return
// */
//static ITK_THREAD_RETURN_TYPE TimerThread(void* pInfoStruct);
//int m_ThreadId;
///** \brief timer thread will terminate after the next wakeup if set to true */
//bool m_StopStreamingThread;
//itk::SmartPointer<itk::MultiThreader> m_MultiThreader;
/** \brief the time used for streaming */
unsigned int m_StreamingTime;
/** \brief mutex for guarding m_Time */
itk::SmartPointer<itk::FastMutexLock> m_StreamingTimeMutex;
///** \brief mutex for guarding m_StopStreamingThread */
//itk::SmartPointer<itk::FastMutexLock> m_StopStreamingThreadMutex;
/** \brief flag to indicate if the provider is streaming */
bool m_IsStreaming;
};
/**
* \brief connect to this Event to get notified when a stream is requested
*
* \note It is necessary to do the following things to have streaming support: 1. listen to this
* event. 2. When emitted start a timer with the given interval. 3. In the timeout method of
* this timer call IGTLMessageProvider::Update. 4. Also listen to the StreamingStopRequiredEvent
* and stop the timer imdediately.
* */
itkEventMacro(StreamingStartRequiredEvent, itk::AnyEvent);
/**
* \brief connect to this Event to get notified when a stream shall be stopped
*
* \note It is necessary to connect to this event and stop the streaming timer when called.
* */
itkEventMacro(StreamingStopRequiredEvent, itk::AnyEvent);
} // namespace mitk
#endif /* MITKIGTLMESSAGEPROVIDER_H_HEADER_INCLUDED_ */
diff --git a/Modules/OpenIGTLink/mitkIGTLMessageQueue.h b/Modules/OpenIGTLink/mitkIGTLMessageQueue.h
index 8a4e52ab52..0863ecc23a 100644
--- a/Modules/OpenIGTLink/mitkIGTLMessageQueue.h
+++ b/Modules/OpenIGTLink/mitkIGTLMessageQueue.h
@@ -1,139 +1,139 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef IGTLMessageQueue_H
#define IGTLMessageQueue_H
#include "MitkOpenIGTLinkExports.h"
#include "itkObject.h"
#include "itkFastMutexLock.h"
#include "mitkCommon.h"
#include <deque>
#include <mitkIGTLMessage.h>
//OpenIGTLink
#include "igtlMessageBase.h"
#include "igtlImageMessage.h"
#include "igtlStringMessage.h"
#include "igtlTrackingDataMessage.h"
#include "igtlTransformMessage.h"
namespace mitk {
/**
* \class IGTLMessageQueue
* \brief Thread safe message queue to store OpenIGTLink messages.
*
* \ingroup OpenIGTLink
*/
class MITKOPENIGTLINK_EXPORT IGTLMessageQueue : public itk::Object
{
public:
- mitkClassMacroItkParent(mitk::IGTLMessageQueue, itk::Object)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacroItkParent(mitk::IGTLMessageQueue, itk::Object);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* \brief Different buffering types
* Infinit buffering means that you can push as many messages as you want
* NoBuffering means that the queue just stores a single message
*/
enum BufferingType { Infinit, NoBuffering };
void PushSendMessage(mitk::IGTLMessage::Pointer message);
/**
* \brief Adds the message to the queue
*/
void PushMessage(igtl::MessageBase::Pointer message);
/**
* \brief Adds the message to the queue
*/
void PushCommandMessage(igtl::MessageBase::Pointer message);
/**
* \brief Returns and removes the oldest message from the queue
*/
igtl::MessageBase::Pointer PullMiscMessage();
igtl::ImageMessage::Pointer PullImage2dMessage();
igtl::ImageMessage::Pointer PullImage3dMessage();
igtl::TrackingDataMessage::Pointer PullTrackingMessage();
igtl::MessageBase::Pointer PullCommandMessage();
igtl::StringMessage::Pointer PullStringMessage();
igtl::TransformMessage::Pointer PullTransformMessage();
mitk::IGTLMessage::Pointer PullSendMessage();
/**
* \brief Get the number of messages in the queue
*/
int GetSize();
/**
* \brief Returns a string with information about the oldest message in the
* queue
*/
std::string GetNextMsgInformationString();
/**
* \brief Returns the device type of the oldest message in the queue
*/
std::string GetNextMsgDeviceType();
/**
* \brief Returns a string with information about the oldest message in the
* queue
*/
std::string GetLatestMsgInformationString();
/**
* \brief Returns the device type of the oldest message in the queue
*/
std::string GetLatestMsgDeviceType();
/**
*/
void EnableNoBufferingMode(bool enable);
protected:
IGTLMessageQueue();
~IGTLMessageQueue() override;
protected:
/**
* \brief Mutex to take car of the queue
*/
itk::FastMutexLock::Pointer m_Mutex;
/**
* \brief the queue that stores pointer to the inserted messages
*/
std::deque< igtl::MessageBase::Pointer > m_CommandQueue;
std::deque< igtl::ImageMessage::Pointer > m_Image2dQueue;
std::deque< igtl::ImageMessage::Pointer > m_Image3dQueue;
std::deque< igtl::TransformMessage::Pointer > m_TransformQueue;
std::deque< igtl::TrackingDataMessage::Pointer > m_TrackingDataQueue;
std::deque< igtl::StringMessage::Pointer > m_StringQueue;
std::deque< igtl::MessageBase::Pointer > m_MiscQueue;
std::deque< mitk::IGTLMessage::Pointer > m_SendQueue;
igtl::MessageBase::Pointer m_Latest_Message;
/**
* \brief defines the kind of buffering
*/
BufferingType m_BufferingType;
};
}
#endif
diff --git a/Modules/OpenIGTLink/mitkIGTLServer.h b/Modules/OpenIGTLink/mitkIGTLServer.h
index 1ae329b689..62a085d328 100644
--- a/Modules/OpenIGTLink/mitkIGTLServer.h
+++ b/Modules/OpenIGTLink/mitkIGTLServer.h
@@ -1,124 +1,124 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKIGTLSERVER_H
#define MITKIGTLSERVER_H
#include "mitkIGTLDevice.h"
#include <MitkOpenIGTLinkExports.h>
namespace mitk
{
/**
* \brief Superclass for OpenIGTLink server
*
* Implements the IGTLDevice interface for IGTLServers. In certain points it
* behaves different than the IGTLClient. The client connects directly to a
* server (it cannot connect to two different servers) while the server can
* connect to several clients. Therefore, it is necessary for the server to
* have a list with registered sockets.
*
* \ingroup OpenIGTLink
*/
class MITKOPENIGTLINK_EXPORT IGTLServer : public IGTLDevice
{
public:
- mitkClassMacro(IGTLServer, IGTLDevice)
- mitkNewMacro1Param(Self, bool)
- itkCloneMacro(Self)
+ mitkClassMacro(IGTLServer, IGTLDevice);
+ mitkNewMacro1Param(Self, bool);
+ itkCloneMacro(Self);
- typedef std::list<igtl::Socket::Pointer> SocketListType;
+ typedef std::list<igtl::Socket::Pointer> SocketListType;
typedef SocketListType::iterator SocketListIteratorType;
/**
* \brief Initialize the connection for the IGTLServer
*
*
* OpenConnection() starts the IGTLServer socket so that clients can connect
* to it.
* @throw mitk::Exception Throws an exception if the given port is occupied.
*/
bool OpenConnection() override;
/**
* \brief Closes the connection to the device
*
* This may only be called if there is currently a connection to the
* device, but device is not running (e.g. object is in Ready state)
*/
bool CloseConnection() override;
/**
* \brief Returns the number of client connections of this device
*/
unsigned int GetNumberOfConnections() override;
protected:
/** Constructor */
IGTLServer(bool ReadFully);
/** Destructor */
~IGTLServer() override;
/**
* \brief Call this method to check for other devices that want to connect
* to this one.
*
* In case of a client this method is doing nothing. In case of a server it
* is checking for other devices and if there is one it establishes a
* connection and adds the socket to m_RegisteredClients.
*/
void Connect() override;
/**
* \brief Call this method to receive a message.
*
* The message will be saved in the receive queue.
*/
void Receive() override;
/**
* \brief Call this method to send a message.
* The message will be read from the queue. So far the message is send to all
* connected sockets (broadcast).
*/
void Send() override;
/**
* \brief Stops the communication with the given sockets.
*
* This method removes the given sockets from the registered clients list
*
*/
virtual void StopCommunicationWithSocket(SocketListType& toBeRemovedSockets);
/**
* \brief Stops the communication with the given socket.
*
* This method removes the given socket from the registered clients list
*
*/
void StopCommunicationWithSocket(igtl::Socket* client) override;
/**
* \brief A list with all registered clients
*/
SocketListType m_RegisteredClients;
/** mutex to control access to m_RegisteredClients */
itk::FastMutexLock::Pointer m_ReceiveListMutex;
/** mutex to control access to m_RegisteredClients */
itk::FastMutexLock::Pointer m_SentListMutex;
};
} // namespace mitk
#endif /* MITKIGTLSERVER_H */
diff --git a/Modules/Persistence/mitkPropertyListsXmlFileReaderAndWriter.h b/Modules/Persistence/mitkPropertyListsXmlFileReaderAndWriter.h
index ef129a9eb0..57de09355f 100644
--- a/Modules/Persistence/mitkPropertyListsXmlFileReaderAndWriter.h
+++ b/Modules/Persistence/mitkPropertyListsXmlFileReaderAndWriter.h
@@ -1,46 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkXmlSceneIO_h_included
#define mitkXmlSceneIO_h_included
#include "mitkDataStorage.h"
class TiXmlElement;
namespace mitk
{
class PropertyListsXmlFileReaderAndWriter;
class PropertyListsXmlFileReaderAndWriter : public itk::Object
{
public:
static const char *GetPropertyListIdElementName();
mitkClassMacroItkParent(PropertyListsXmlFileReaderAndWriter, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
bool WriteLists(const std::string &fileName,
const std::map<std::string, mitk::PropertyList::Pointer> &_PropertyLists) const;
bool ReadLists(const std::string &fileName,
std::map<std::string, mitk::PropertyList::Pointer> &_PropertyLists) const;
protected:
PropertyListsXmlFileReaderAndWriter();
~PropertyListsXmlFileReaderAndWriter() override;
bool PropertyFromXmlElem(std::string &name, mitk::BaseProperty::Pointer &prop, TiXmlElement *elem) const;
bool PropertyToXmlElem(const std::string &name, const mitk::BaseProperty *prop, TiXmlElement *elem) const;
};
}
#endif
diff --git a/Modules/Pharmacokinetics/include/mitkCurveDescriptionParameterBase.h b/Modules/Pharmacokinetics/include/mitkCurveDescriptionParameterBase.h
index 2bbbb63f3a..6dcc47bd8f 100644
--- a/Modules/Pharmacokinetics/include/mitkCurveDescriptionParameterBase.h
+++ b/Modules/Pharmacokinetics/include/mitkCurveDescriptionParameterBase.h
@@ -1,76 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef CURVEDESCRIPTIONPARAMETERBASE_H
#define CURVEDESCRIPTIONPARAMETERBASE_H
#include <iostream>
#include <itkArray.h>
#include <itkArray2D.h>
#include <itkObject.h>
#include <mitkModelBase.h>
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
/** Base class for functor that compute descriptive values for
a curve (e.g. like Area under the Curve, Time to peek, maximum,...)
@remark The derived classes must be implemented thread safe because GetCurveDescriptionParameter()
and GetDescriptionParameterName() of one instance may be called in
multi-threaded context (e.g. DescriptionParameterImageGeneratorBase
and derived classes). */
class MITKPHARMACOKINETICS_EXPORT CurveDescriptionParameterBase : public itk::Object
{
public:
typedef CurveDescriptionParameterBase Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
- itkTypeMacro(CurveDescriptionParameterBase, itk::Object)
+ itkTypeMacro(CurveDescriptionParameterBase, itk::Object);
typedef itk::Array<double> CurveType;
typedef itk::Array<double> CurveGridType;
typedef double CurveDescriptionParameterResultType;
typedef std::string CurveDescriptionParameterNameType;
typedef std::vector<CurveDescriptionParameterResultType> DescriptionParameterResultsType;
typedef std::vector<CurveDescriptionParameterNameType> DescriptionParameterNamesType;
/** Returns the concrete description values for a curve.
* @pre Curve value vector and curve grid must have the same size*/
DescriptionParameterResultsType GetCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const;
/**Return the names of all descrition values that will be computed by the class.
* @post The order of names equales the order of the results of GetCurveDescriptionParameter().*/
virtual DescriptionParameterNamesType GetDescriptionParameterName() const = 0 ;
protected:
/** Slot to implement the computation of the descriptor values.*/
virtual DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const = 0;
CurveDescriptionParameterBase();
~CurveDescriptionParameterBase() override;
private:
//No copy constructor allowed
CurveDescriptionParameterBase(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif // CURVEDESCRIPTIONPARAMETERBASE_H
diff --git a/Modules/Pharmacokinetics/include/mitkImageGenerationHelper.h b/Modules/Pharmacokinetics/include/mitkImageGenerationHelper.h
index 7425b2cc62..7bb7f5ba22 100644
--- a/Modules/Pharmacokinetics/include/mitkImageGenerationHelper.h
+++ b/Modules/Pharmacokinetics/include/mitkImageGenerationHelper.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __MITK_IMAGEGENERATIONHELPER_H
#define __MITK_IMAGEGENERATIONHELPER_H
#include "itkImage.h"
#include "itkImageRegionIterator.h"
#include "mitkImage.h"
#include "mitkImagePixelReadAccessor.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
/** @todo #3 this is a helper class for generating a 4D dynamic image of dimensions (x,y,z, t) from an itk::Array<double> (t)
* The Array will be set at every (x,y,z), so the result is a homogeneous image in 3D, with the 4th dimension as the Array.
* Function GenerateDynamicImageMITK was copied from TestingHelper/TestArtifactGenerator. Maybe there is a better way to do this.
*/
class MITKPHARMACOKINETICS_EXPORT ImageGenerationHelper : public itk::Object
{
public:
mitkClassMacroItkParent(ImageGenerationHelper, ::itk::Object);
itkNewMacro(Self);
typedef itk::Image<int> TestImageType;
typedef itk::Array<double> TimeGridType;
typedef itk::Array<double> CurveType;
itkSetMacro(DimX, unsigned int);
itkSetMacro(DimY, unsigned int);
itkSetMacro(DimZ, unsigned int);
itkGetConstReferenceMacro(DimX, unsigned int);
itkGetConstReferenceMacro(DimY, unsigned int);
itkGetConstReferenceMacro(DimZ, unsigned int);
itkSetMacro(Grid,TimeGridType);
itkGetConstReferenceMacro(Grid,TimeGridType);
itkSetMacro(Curve, CurveType);
- itkGetConstReferenceMacro(Curve,CurveType)
+ itkGetConstReferenceMacro(Curve,CurveType);
Image::Pointer GenerateDynamicImageMITK();
private:
ImageGenerationHelper(): m_DimX(0), m_DimY(0), m_DimZ(0) {};
~ImageGenerationHelper() override{};
mitk::Image::Pointer GenerateTestFrame(unsigned int timePointIndex);
unsigned int m_DimX, m_DimY, m_DimZ;
TimeGridType m_Grid;
CurveType m_Curve;
};
}
#endif //__MITK_IMAGEGENERATIONHELPER_H
diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModel.h b/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModel.h
index 6e58a6ac4b..df838a4be3 100644
--- a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModel.h
+++ b/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModel.h
@@ -1,128 +1,128 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKNUMERICTWOCOMPARTMENTEXCHANGEMODEL_H
#define MITKNUMERICTWOCOMPARTMENTEXCHANGEMODEL_H
#include "mitkAIFBasedModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
/** @class NumericTwoCompartmentExchangeModel
* @brief Implementation of the numeric model function of the 2 Compartment Exchange model, using an Aterial Input Function
* The Model calculates the measured Concentration-Time-Curve from the mass balance equations of the 2-tissue compartent Model
*
* vp * dCp(t)/dt = F * (CA(t) - Cp(t)) - PS * (Cp(t) - Ci(t))
* ve * dCi(t)/dt = PS * (Cp(t) - Ci(t))
*
* with concentration curve Cp(t) of the Blood Plasma p and Ce(t) of the Extracellular Extravascular Space(EES)(interstitial volume). CA(t) is the aterial concentration, i.e. the AIF
* Cp(t) and Ce(t) are found numerical via Runge-Kutta methode, implemented in Boosts numeric library ODEINT. Here we use a runge_kutta_cash_karp54 stepper with
* adaptive step size and error controll.
* From the resulting curves Cp(t) and Ce(t) the measured concentration Ctotal(t) is found vial
*
* Ctotal(t) = vp * Cp(t) + ve * Ce(t)
*
* where vp=Vp/VT and ve=Ve/VT are the portion of Plasma/EES volume Vp/Ve of the total volume VT respectively.
* The parameters PS, F, vp and ve are subject to the fitting routine*/
class MITKPHARMACOKINETICS_EXPORT NumericTwoCompartmentExchangeModel : public AIFBasedModelBase
{
public:
typedef NumericTwoCompartmentExchangeModel Self;
typedef AIFBasedModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Run-time type information (and related methods). */
- itkTypeMacro(NumericTwoCompartmentExchangeModel, ModelBase)
+ itkTypeMacro(NumericTwoCompartmentExchangeModel, ModelBase);
typedef std::vector<double> state_type;
static const std::string MODEL_DISPLAY_NAME;
static const std::string NAME_PARAMETER_F;
static const std::string NAME_PARAMETER_PS;
static const std::string NAME_PARAMETER_ve;
static const std::string NAME_PARAMETER_vp;
static const std::string NAME_STATIC_PARAMETER_ODEINTStepSize;
static const std::string UNIT_PARAMETER_F;
static const std::string UNIT_PARAMETER_PS;
static const std::string UNIT_PARAMETER_ve;
static const std::string UNIT_PARAMETER_vp;
static const unsigned int POSITION_PARAMETER_F;
static const unsigned int POSITION_PARAMETER_PS;
static const unsigned int POSITION_PARAMETER_ve;
static const unsigned int POSITION_PARAMETER_vp;
static const unsigned int NUMBER_OF_PARAMETERS;
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
itkGetConstReferenceMacro(ODEINTStepSize, double);
itkSetMacro(ODEINTStepSize, double);
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParamterUnitMapType GetParameterUnits() const override;
ParameterNamesType GetStaticParameterNames() const override;
ParametersSizeType GetNumberOfStaticParameters() const override;
protected:
NumericTwoCompartmentExchangeModel();
~NumericTwoCompartmentExchangeModel() override;
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
void SetStaticParameter(const ParameterNameType& name, const StaticParameterValuesType& values) override;
StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const override;
void PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
private:
//No copy constructor allowed
NumericTwoCompartmentExchangeModel(const Self& source);
void operator=(const Self&); //purposely not implemented
double m_ODEINTStepSize;
};
}
#endif // MITKNUMERICTWOCOMPARTMENTEXCHANGEMODEL_H
diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModel.h b/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModel.h
index ef9e30d44d..c6db4c5991 100644
--- a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModel.h
+++ b/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModel.h
@@ -1,97 +1,97 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKNUMERICTWOTISSUECOMPARTMENTMODEL_H
#define MITKNUMERICTWOTISSUECOMPARTMENTMODEL_H
#include "mitkAIFBasedModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT NumericTwoTissueCompartmentModel : public AIFBasedModelBase
{
public:
typedef NumericTwoTissueCompartmentModel Self;
typedef AIFBasedModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Run-time type information (and related methods). */
- itkTypeMacro(NumericTwoTissueCompartmentModel, ModelBase)
+ itkTypeMacro(NumericTwoTissueCompartmentModel, ModelBase);
typedef std::vector<double> state_type;
/** Model Specifications */
static const std::string MODEL_DISPLAY_NAME;
static const std::string NAME_PARAMETER_K1;
static const std::string NAME_PARAMETER_k2;
static const std::string NAME_PARAMETER_k3;
static const std::string NAME_PARAMETER_k4;
static const std::string NAME_PARAMETER_VB;
static const std::string UNIT_PARAMETER_K1;
static const std::string UNIT_PARAMETER_k2;
static const std::string UNIT_PARAMETER_k3;
static const std::string UNIT_PARAMETER_k4;
static const std::string UNIT_PARAMETER_VB;
static const unsigned int POSITION_PARAMETER_K1;
static const unsigned int POSITION_PARAMETER_k2;
static const unsigned int POSITION_PARAMETER_k3;
static const unsigned int POSITION_PARAMETER_k4;
static const unsigned int POSITION_PARAMETER_VB;
static const unsigned int NUMBER_OF_PARAMETERS;
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParamterUnitMapType GetParameterUnits() const override;
protected:
NumericTwoTissueCompartmentModel();
~NumericTwoTissueCompartmentModel() override;
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
void PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
private:
//No copy constructor allowed
NumericTwoTissueCompartmentModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif // MITKNUMERICTWOTISSUECOMPARTMENTMODEL_H
diff --git a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModel.h b/Modules/Pharmacokinetics/include/mitkThreeStepLinearModel.h
index 4d600d23fb..69c5a4e84b 100644
--- a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModel.h
+++ b/Modules/Pharmacokinetics/include/mitkThreeStepLinearModel.h
@@ -1,123 +1,123 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKTHREESTEPLINEARMODEL_H
#define MITKTHREESTEPLINEARMODEL_H
#include "mitkModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT ThreeStepLinearModel : public mitk::ModelBase
{
public:
typedef ThreeStepLinearModel Self;
typedef mitk::ModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::ParameterNameType ParameterNameType;
typedef Superclass::ParametersSizeType ParametersSizeType;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Run-time type information (and related methods). */
- itkTypeMacro(ThreeStepLinearModel, ModelBase)
+ itkTypeMacro(ThreeStepLinearModel, ModelBase);
static const std::string MODEL_DISPLAY_NAME;
static const std::string NAME_PARAMETER_S0;
static const std::string NAME_PARAMETER_t1;
static const std::string NAME_PARAMETER_t2;
static const std::string NAME_PARAMETER_a1;
static const std::string NAME_PARAMETER_a2;
static const std::string NAME_PARAMETER_b1;
static const std::string NAME_PARAMETER_b2;
static const std::string UNIT_PARAMETER_S0;
static const std::string UNIT_PARAMETER_t1;
static const std::string UNIT_PARAMETER_t2;
static const std::string UNIT_PARAMETER_a1;
static const std::string UNIT_PARAMETER_a2;
static const std::string UNIT_PARAMETER_b1;
static const std::string UNIT_PARAMETER_b2;
static const unsigned int POSITION_PARAMETER_S0;
static const unsigned int POSITION_PARAMETER_t1;
static const unsigned int POSITION_PARAMETER_t2;
static const unsigned int POSITION_PARAMETER_a1;
static const unsigned int POSITION_PARAMETER_a2;
static const unsigned int POSITION_PARAMETER_b1;
static const unsigned int POSITION_PARAMETER_b2;
static const unsigned int NUMBER_OF_PARAMETERS;
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
FunctionStringType GetFunctionString() const override;
std::string GetXName() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParamterUnitMapType GetParameterUnits() const override;
ParameterNamesType GetStaticParameterNames() const override;
ParametersSizeType GetNumberOfStaticParameters() const override;
ParameterNamesType GetDerivedParameterNames() const override;
ParametersSizeType GetNumberOfDerivedParameters() const override;
ParamterUnitMapType GetDerivedParameterUnits() const override;
protected:
ThreeStepLinearModel() {};
~ThreeStepLinearModel() override{};
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType&
parameters) const override;
void SetStaticParameter(const ParameterNameType& name,
const StaticParameterValuesType& values) override;
StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const override;
private:
//No copy constructor allowed
ThreeStepLinearModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif // MITKTHREESTEPLINEARMODEL_H
diff --git a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModel.h b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModel.h
index 1781c9bd5d..ed4afbd0f5 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModel.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModel.h
@@ -1,114 +1,113 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKTWOCOMPARTMENTEXCHANGEMODEL_H
#define MITKTWOCOMPARTMENTEXCHANGEMODEL_H
#include "mitkAIFBasedModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
/** @class TwoCompartmentExchangeModel
* @brief Implementation of the analystical model function of the Physiological Pharmacokinetic Brix model, using an Aterial Input Function
* The Model calculates the Concentration-Time-Curve as a convolution of the Aterial Input funciton CA(t) and a tissue specific
* residue function R(t). The Residue funktion consists of two parts: The Residue funktion Qp(t) of the Blood Plasma p and the residue funktion Qi(t) of the
* interstitial volume I.
* Ctotal(t) = vp * Cp(t) + fi * Ci(t) = [vp * Qp(t) + fi * Qi(t)] conv CA(t)
* = Qtotal(t) conv CA(t)
* where vp=Vp/VT and fi=Vi/VT are the portion of Plasma/interstitial volume Vp/VI of the total volume VT respectively.
* The Residuefunctions are described by
* Qp(t) = F/Vp * PS/Vp * 1/(l2 - l1) *[ µ2 exp(l1*t) - µ1 exp(l2*t)]* sig(t)
* Qi(t) = F/Vp * PS/Vi * 1/(l1 - l2) *[ exp(l1*t) - exp(l2*t)]* sig(t)
* = F/Vp * PS/Vp * vp/fi * 1/(l1 - l2) *[ exp(l1*t) - exp(l2*t)]* sig(t)
* with
* l1/2 = -1/2 (PS/Vp * vp/fi + PS/Vp + F/Vp) +/- sqrt((PS/Vp * vp/fi + PS/Vp + F/Vp)² - 4* F/Vp * PS/Vp * vp/fi)
* µ1/2 = F/Vp * Vp/PS + 1 + Vp/PS* l1/2
*
* The parameters PS/Vp, F/Vp, vp and fi are subject to the fitting routine*/
class MITKPHARMACOKINETICS_EXPORT TwoCompartmentExchangeModel : public AIFBasedModelBase
{
public:
typedef TwoCompartmentExchangeModel Self;
typedef AIFBasedModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Run-time type information (and related methods). */
- itkTypeMacro(TwoCompartmentExchangeModel, ModelBase)
-
+ itkTypeMacro(TwoCompartmentExchangeModel, ModelBase);
/** Model Specifications */
static const std::string MODEL_DISPLAY_NAME;
static const std::string NAME_PARAMETER_F;
static const std::string NAME_PARAMETER_PS;
static const std::string NAME_PARAMETER_ve;
static const std::string NAME_PARAMETER_vp;
static const unsigned int POSITION_PARAMETER_F;
static const unsigned int POSITION_PARAMETER_PS;
static const unsigned int POSITION_PARAMETER_ve;
static const unsigned int POSITION_PARAMETER_vp;
static const std::string UNIT_PARAMETER_F;
static const std::string UNIT_PARAMETER_PS;
static const std::string UNIT_PARAMETER_ve;
static const std::string UNIT_PARAMETER_vp;
static const unsigned int NUMBER_OF_PARAMETERS;
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParamterUnitMapType GetParameterUnits() const override;
protected:
TwoCompartmentExchangeModel();
~TwoCompartmentExchangeModel() override;
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
void PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
private:
//No copy constructor allowed
TwoCompartmentExchangeModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif // MITKTWOCOMPARTMENTEXCHANGEMODEL_H
diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModel.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModel.h
index ad11c269cf..9777963a90 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModel.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModel.h
@@ -1,93 +1,92 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKTWOTISSUECOMPARTMENTFDGMODEL_H
#define MITKTWOTISSUECOMPARTMENTFDGMODEL_H
#include "mitkAIFBasedModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT TwoTissueCompartmentFDGModel : public AIFBasedModelBase
{
public:
typedef TwoTissueCompartmentFDGModel Self;
typedef AIFBasedModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Run-time type information (and related methods). */
- itkTypeMacro(TwoTissueCompartmentFDGModel, ModelBase)
-
+ itkTypeMacro(TwoTissueCompartmentFDGModel, ModelBase);
/** Model Specifications */
static const std::string MODEL_DISPLAY_NAME;
static const std::string NAME_PARAMETER_K1;
static const std::string NAME_PARAMETER_k2;
static const std::string NAME_PARAMETER_k3;
static const std::string NAME_PARAMETER_VB;
static const std::string UNIT_PARAMETER_K1;
static const std::string UNIT_PARAMETER_k2;
static const std::string UNIT_PARAMETER_k3;
static const std::string UNIT_PARAMETER_VB;
static const unsigned int POSITION_PARAMETER_K1;
static const unsigned int POSITION_PARAMETER_k2;
static const unsigned int POSITION_PARAMETER_k3;
static const unsigned int POSITION_PARAMETER_VB;
static const unsigned int NUMBER_OF_PARAMETERS;
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParamterUnitMapType GetParameterUnits() const override;
protected:
TwoTissueCompartmentFDGModel();
~TwoTissueCompartmentFDGModel() override;
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
void PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
private:
//No copy constructor allowed
TwoTissueCompartmentFDGModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif // MITKTWOTISSUECOMPARTMENTFDGMODEL_H
diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModel.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModel.h
index e21bbe6360..71758d3953 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModel.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModel.h
@@ -1,95 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKTWOTISSUECOMPARTMENTMODEL_H
#define MITKTWOTISSUECOMPARTMENTMODEL_H
#include "mitkAIFBasedModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT TwoTissueCompartmentModel : public AIFBasedModelBase
{
public:
typedef TwoTissueCompartmentModel Self;
typedef AIFBasedModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Run-time type information (and related methods). */
- itkTypeMacro(TwoTissueCompartmentModel, ModelBase)
-
+ itkTypeMacro(TwoTissueCompartmentModel, ModelBase);
/** Model Specifications */
static const std::string MODEL_DISPLAY_NAME;
static const std::string NAME_PARAMETER_K1;
static const std::string NAME_PARAMETER_k2;
static const std::string NAME_PARAMETER_k3;
static const std::string NAME_PARAMETER_k4;
static const std::string NAME_PARAMETER_VB;
static const std::string UNIT_PARAMETER_K1;
static const std::string UNIT_PARAMETER_k2;
static const std::string UNIT_PARAMETER_k3;
static const std::string UNIT_PARAMETER_k4;
static const std::string UNIT_PARAMETER_VB;
static const unsigned int POSITION_PARAMETER_K1;
static const unsigned int POSITION_PARAMETER_k2;
static const unsigned int POSITION_PARAMETER_k3;
static const unsigned int POSITION_PARAMETER_k4;
static const unsigned int POSITION_PARAMETER_VB;
static const unsigned int NUMBER_OF_PARAMETERS;
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParamterUnitMapType GetParameterUnits() const override;
protected:
TwoTissueCompartmentModel();
~TwoTissueCompartmentModel() override;
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
void PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
private:
//No copy constructor allowed
TwoTissueCompartmentModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif // MITKTWOTISSUECOMPARTMENTMODEL_H
diff --git a/Modules/PhotoacousticsLib/include/mitkPAComposedVolume.h b/Modules/PhotoacousticsLib/include/mitkPAComposedVolume.h
index 6a0486c8ab..b41915ef83 100644
--- a/Modules/PhotoacousticsLib/include/mitkPAComposedVolume.h
+++ b/Modules/PhotoacousticsLib/include/mitkPAComposedVolume.h
@@ -1,86 +1,86 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPHOTOACOUSTICCOMPOSEDVOLUME_H
#define MITKPHOTOACOUSTICCOMPOSEDVOLUME_H
#include <MitkPhotoacousticsLibExports.h>
#include <mitkPAInSilicoTissueVolume.h>
#include <mitkPAFluenceYOffsetPair.h>
#include <vector>
//Includes for smart pointer usage
#include "mitkCommon.h"
#include "itkLightObject.h"
namespace mitk {
namespace pa {
/**
* @brief The ComposedVolume class provides the means to systematically collect nrrd files that correspond to
* different simulation slices of the same InSilicoTissueVolume.
*
* An instance of this class is needed for the SlicedVolumeGenerator
*/
class MITKPHOTOACOUSTICSLIB_EXPORT ComposedVolume : public itk::Object
{
public:
- mitkClassMacroItkParent(ComposedVolume, itk::Object)
- mitkNewMacro1Param(Self, InSilicoTissueVolume::Pointer)
-
- /**
- * @brief fluenceYOffsetPair
- *
- * @param nrrdFile path to the nrrd file on hard drive
- */
- void AddSlice(mitk::pa::FluenceYOffsetPair::Pointer fluenceYOffsetPair);
+ mitkClassMacroItkParent(ComposedVolume, itk::Object);
+ mitkNewMacro1Param(Self, InSilicoTissueVolume::Pointer);
+
+ /**
+ * @brief fluenceYOffsetPair
+ *
+ * @param nrrdFile path to the nrrd file on hard drive
+ */
+ void AddSlice(mitk::pa::FluenceYOffsetPair::Pointer fluenceYOffsetPair);
/**
* @brief GetNumberOfFluenceComponents
* @return the number of fluence components encapsuled by this ComposedVolume.
*/
int GetNumberOfFluenceComponents();
/**
* @brief GetFluenceValue
* @param fluenceComponent
* @param x
* @param y
* @param z
* @return the fluence value for a specific fluence component index at the given 3D location.
*/
double GetFluenceValue(int fluenceComponent, int x, int y, int z);
/**
* @brief GetYOffsetForFluenceComponentInPixels
* @param fluenceComponent
* @return the y-offset value for a given fluence component index.
*/
int GetYOffsetForFluenceComponentInPixels(int fluenceComponent);
void Sort();
itkGetMacro(GroundTruthVolume, InSilicoTissueVolume::Pointer);
protected:
ComposedVolume(InSilicoTissueVolume::Pointer groundTruthVolume);
~ComposedVolume() override;
private:
int m_FluenceComponents;
InSilicoTissueVolume::Pointer m_GroundTruthVolume;
std::vector<mitk::pa::FluenceYOffsetPair::Pointer> m_FluenceValues;
};
}
}
#endif // MITKPHOTOACOUSTICCOMPOSEDVOLUME_H
diff --git a/Modules/PhotoacousticsLib/include/mitkPAFluenceYOffsetPair.h b/Modules/PhotoacousticsLib/include/mitkPAFluenceYOffsetPair.h
index 23d09944c5..1d73fd4d94 100644
--- a/Modules/PhotoacousticsLib/include/mitkPAFluenceYOffsetPair.h
+++ b/Modules/PhotoacousticsLib/include/mitkPAFluenceYOffsetPair.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPAFLUENCEYOFFSETPAIR_H
#define MITKPAFLUENCEYOFFSETPAIR_H
#include <MitkPhotoacousticsLibExports.h>
#include <itkMacro.h>
#include "mitkCommon.h"
#include "itkLightObject.h"
#include <mitkPAVolume.h>
namespace mitk
{
namespace pa {
class MITKPHOTOACOUSTICSLIB_EXPORT FluenceYOffsetPair : public itk::LightObject
{
public:
- mitkClassMacroItkParent(FluenceYOffsetPair, itk::LightObject)
- mitkNewMacro2Param(Self, mitk::pa::Volume::Pointer, double)
+ mitkClassMacroItkParent(FluenceYOffsetPair, itk::LightObject);
+ mitkNewMacro2Param(Self, mitk::pa::Volume::Pointer, double);
- FluenceYOffsetPair(const FluenceYOffsetPair::Pointer other);
+ FluenceYOffsetPair(const FluenceYOffsetPair::Pointer other);
const FluenceYOffsetPair &operator=(const FluenceYOffsetPair::Pointer other)
{
if (this == other)
return *this;
m_FluenceValue = other->GetFluenceValue();
m_YOffsetInCentimeters = other->GetYOffsetInCentimeters();
return *this;
}
mitk::pa::Volume::Pointer GetFluenceValue() const;
double GetYOffsetInCentimeters() const;
private:
FluenceYOffsetPair(mitk::pa::Volume::Pointer fluenceValue, double yOffset);
~FluenceYOffsetPair() override;
mitk::pa::Volume::Pointer m_FluenceValue;
double m_YOffsetInCentimeters;
};
}
}
#endif // MITKPHOTOACOUSTICCOMPOSEDVOLUME_H
diff --git a/Modules/PhotoacousticsLib/include/mitkPAInSilicoTissueVolume.h b/Modules/PhotoacousticsLib/include/mitkPAInSilicoTissueVolume.h
index c540b5e165..f72151ada8 100644
--- a/Modules/PhotoacousticsLib/include/mitkPAInSilicoTissueVolume.h
+++ b/Modules/PhotoacousticsLib/include/mitkPAInSilicoTissueVolume.h
@@ -1,160 +1,160 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPHOTOACOUSTICVOLUME_H
#define MITKPHOTOACOUSTICVOLUME_H
#include <MitkPhotoacousticsLibExports.h>
#include <mitkImage.h>
#include <mitkProperties.h>
#include <mitkPATissueGeneratorParameters.h>
#include <mitkPAVolume.h>
//Includes for smart pointer usage
#include "mitkCommon.h"
#include "itkLightObject.h"
namespace mitk {
namespace pa {
class MITKPHOTOACOUSTICSLIB_EXPORT InSilicoTissueVolume : public itk::LightObject
{
public:
- mitkClassMacroItkParent(InSilicoTissueVolume, itk::LightObject)
- mitkNewMacro2Param(Self, TissueGeneratorParameters::Pointer, std::mt19937*)
+ mitkClassMacroItkParent(InSilicoTissueVolume, itk::LightObject);
+ mitkNewMacro2Param(Self, TissueGeneratorParameters::Pointer, std::mt19937*);
enum SegmentationType
{
AIR = -1,
BACKGROUND = 0,
VESSEL = 1,
FAT = 2,
SKIN = 3
};
/**
* @brief ConvertToMitkImage
* @return a pointer to an mitk image containing this volume.
*/
mitk::Image::Pointer ConvertToMitkImage();
/**
* @brief SetVolumeValues sets the values for aborption, scattering and anisotropy at the specified voxel location.
*
* @param x
* @param y
* @param z
* @param absorption
* @param scattering
* @param anisotropy
* @param segmentType
*/
void SetVolumeValues(int x, int y, int z, double absorption, double scattering, double anisotropy, SegmentationType segmentType);
/**
* @brief SetVolumeValues sets the values for aborption, scattering and anisotropy at the specified voxel location.
*
* @param x
* @param y
* @param z
* @param absorption
* @param scattering
* @param anisotropy
*/
void SetVolumeValues(int x, int y, int z, double absorption, double scattering, double anisotropy);
/**
* @brief IsInsideVolume
*
* @param x
* @param y
* @param z
* @return true if the voxel location is inside the volume
*/
bool IsInsideVolume(int x, int y, int z);
/**
* @brief AddDoubleProperty adds a persistent property to the volume, which will be exported to the mitk image.
*
* @param label
* @param value
*/
void AddDoubleProperty(std::string label, double value);
/**
* @brief AddIntProperty adds a persistent property to the volume, which will be exported to the mitk image.
*
* @param label
* @param value
*/
void AddIntProperty(std::string label, int value);
Volume::Pointer GetAbsorptionVolume();
Volume::Pointer GetScatteringVolume();
Volume::Pointer GetAnisotropyVolume();
Volume::Pointer GetSegmentationVolume();
void SetAbsorptionVolume(Volume::Pointer volume);
void SetScatteringVolume(Volume::Pointer volume);
void SetAnisotropyVolume(Volume::Pointer volume);
void SetSegmentationVolume(Volume::Pointer volume);
double GetSpacing();
void SetSpacing(double spacing);
void FinalizeVolume();
itkGetMacro(TissueParameters, TissueGeneratorParameters::Pointer);
itkGetMacro(TDim, unsigned int);
static InSilicoTissueVolume::Pointer New(mitk::pa::Volume::Pointer absorptionVolume,
Volume::Pointer scatteringVolume,
Volume::Pointer anisotropyVolume,
Volume::Pointer segmentationVolume,
TissueGeneratorParameters::Pointer tissueParameters,
mitk::PropertyList::Pointer propertyList);
protected:
InSilicoTissueVolume(TissueGeneratorParameters::Pointer parameters, std::mt19937* rng);
InSilicoTissueVolume(Volume::Pointer absorptionVolume,
Volume::Pointer scatteringVolume,
Volume::Pointer anisotropyVolume,
Volume::Pointer segmentationVolume,
TissueGeneratorParameters::Pointer tissueParameters,
mitk::PropertyList::Pointer propertyList);
~InSilicoTissueVolume() override;
mitk::pa::Volume::Pointer m_AbsorptionVolume;
mitk::pa::Volume::Pointer m_ScatteringVolume;
mitk::pa::Volume::Pointer m_AnisotropyVolume;
mitk::pa::Volume::Pointer m_SegmentationVolume;
TissueGeneratorParameters::Pointer m_TissueParameters;
unsigned int m_TDim;
double m_InitialBackgroundAbsorption;
std::mt19937* m_Rng;
void RandomizeTissueCoefficients(long rngSeed, bool useRngSeed, double percentage);
mitk::PropertyList::Pointer m_PropertyList;
private:
void FillZLayer(int x, int y, double startIdx, double endIdx,
double absorption, double scattering, double anisotropy,
SegmentationType segmentationType);
void AddSkinAndAirLayers();
void UpdatePropertyList();
};
}
}
#endif // MITKPHOTOACOUSTICVOLUME_H
diff --git a/Modules/PhotoacousticsLib/include/mitkPALightSource.h b/Modules/PhotoacousticsLib/include/mitkPALightSource.h
index 7542ae0a0b..b45d72f0b8 100644
--- a/Modules/PhotoacousticsLib/include/mitkPALightSource.h
+++ b/Modules/PhotoacousticsLib/include/mitkPALightSource.h
@@ -1,178 +1,179 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPHOTOACOUSTICLIGHTSOURCE_H
#define MITKPHOTOACOUSTICLIGHTSOURCE_H
#include <mitkCommon.h>
#include "MitkPhotoacousticsLibExports.h"
//Includes for smart pointer usage
#include "mitkCommon.h"
#include "itkObject.h"
#include "itkMacro.h"
#include <tinyxml.h>
namespace mitk {
namespace pa {
/**
* @brief The LightSource class
* The representation of a LightSource
*/
class MITKPHOTOACOUSTICSLIB_EXPORT LightSource : public itk::Object
{
public:
- mitkClassMacroItkParent(LightSource, itk::Object)
- itkFactorylessNewMacro(Self)
- mitkNewMacro2Param(Self, TiXmlElement*, bool)
+ mitkClassMacroItkParent(LightSource, itk::Object);
+ itkFactorylessNewMacro(Self);
+ mitkNewMacro2Param(Self, TiXmlElement*, bool);
- const std::string XML_TAG_X_ANGLE = "xAngle";
+ const std::string XML_TAG_X_ANGLE = "xAngle";
const std::string XML_TAG_Y_ANGLE = "yAngle";
const std::string XML_TAG_PHOTON_DIRECTION = "PhotonDirection";
const std::string XML_TAG_MINIMUM = "min";
const std::string XML_TAG_MAXIMUM = "max";
const std::string XML_TAG_MODE = "mode";
const std::string XML_TAG_ENERGY = "energy";
const std::string XML_TAG_SPAWN_TYPE = "SpawnType";
const std::string XML_TAG_SPAWN_TYPE_POINT = "POINT";
const std::string XML_TAG_SPAWN_TYPE_RECTANGLE = "RECTANGLE";
const std::string XML_TAG_SPAWN_TYPE_CIRCLE = "CIRCLE";
const std::string XML_TAG_X = "x";
const std::string XML_TAG_Y = "y";
const std::string XML_TAG_Z = "z";
const std::string XML_TAG_R = "r";
const std::string XML_TAG_X_LENGTH = "xLength";
const std::string XML_TAG_Y_LENGTH = "yLength";
const std::string XML_TAG_Z_LENGTH = "zLength";
enum SpawnType
{
POINT, RECTANGLE, CIRCLE
};
enum DistributionMode
{
UNIFORM, GAUSSIAN
};
struct PhotonInformation
{
double xPosition;
double yPosition;
double zPosition;
double xAngle;
double yAngle;
double zAngle;
};
PhotonInformation GetNextPhoton(double rnd1, double rnd2, double rnd3,
double rnd4, double rnd5, double gau1, double gau2);
bool IsValid();
LightSource(TiXmlElement* element, bool verbose);
LightSource();
~LightSource() override;
void ParseAngle(TiXmlElement* direction, std::string angle);
- itkGetMacro(SpawnType, SpawnType)
- itkSetMacro(SpawnType, SpawnType)
+ itkGetMacro(SpawnType, SpawnType);
- itkGetMacro(SpawnLocationX, double)
- itkSetMacro(SpawnLocationX, double)
+ itkSetMacro(SpawnType, SpawnType);
- itkGetMacro(SpawnLocationY, double)
- itkSetMacro(SpawnLocationY, double)
+ itkGetMacro(SpawnLocationX, double);
- itkGetMacro(SpawnLocationZ, double)
- itkSetMacro(SpawnLocationZ, double)
+ itkSetMacro(SpawnLocationX, double);
+ itkGetMacro(SpawnLocationY, double);
+ itkSetMacro(SpawnLocationY, double);
+ itkGetMacro(SpawnLocationZ, double);
- itkGetMacro(SpawnLocationXLength, double)
- itkSetMacro(SpawnLocationXLength, double)
+ itkSetMacro(SpawnLocationZ, double);
- itkGetMacro(SpawnLocationYLength, double)
- itkSetMacro(SpawnLocationYLength, double)
+ itkGetMacro(SpawnLocationXLength, double);
- itkGetMacro(SpawnLocationZLength, double)
- itkSetMacro(SpawnLocationZLength, double)
+ itkSetMacro(SpawnLocationXLength, double);
+ itkGetMacro(SpawnLocationYLength, double);
+ itkSetMacro(SpawnLocationYLength, double);
+ itkGetMacro(SpawnLocationZLength, double);
- itkGetMacro(SpawnLocationRadius, double)
- itkSetMacro(SpawnLocationRadius, double)
+ itkSetMacro(SpawnLocationZLength, double);
- itkGetMacro(Energy, double)
- itkSetMacro(Energy, double)
+ itkGetMacro(SpawnLocationRadius, double);
- itkGetMacro(AngleXMinimum, double)
- itkSetMacro(AngleXMinimum, double)
+ itkSetMacro(SpawnLocationRadius, double);
+ itkGetMacro(Energy, double);
+ itkSetMacro(Energy, double);
+ itkGetMacro(AngleXMinimum, double);
- itkGetMacro(AngleXMaximum, double)
- itkSetMacro(AngleXMaximum, double)
+ itkSetMacro(AngleXMinimum, double);
- itkGetMacro(AngleYMinimum, double)
- itkSetMacro(AngleYMinimum, double)
+ itkGetMacro(AngleXMaximum, double);
- itkGetMacro(AngleYMaximum, double)
- itkSetMacro(AngleYMaximum, double)
+ itkSetMacro(AngleXMaximum, double);
+ itkGetMacro(AngleYMinimum, double);
+ itkSetMacro(AngleYMinimum, double);
+ itkGetMacro(AngleYMaximum, double);
- itkGetMacro(AngleXMode, DistributionMode)
- itkSetMacro(AngleXMode, DistributionMode)
+ itkSetMacro(AngleYMaximum, double);
- itkGetMacro(AngleYMode, DistributionMode)
- itkSetMacro(AngleYMode, DistributionMode)
+ itkGetMacro(AngleXMode, DistributionMode);
- itkGetMacro(Verbose, bool)
- itkSetMacro(Verbose, bool)
+ itkSetMacro(AngleXMode, DistributionMode);
+ itkGetMacro(AngleYMode, DistributionMode);
+ itkSetMacro(AngleYMode, DistributionMode);
+ itkGetMacro(Verbose, bool);
+
+ itkSetMacro(Verbose, bool);
protected:
const double TWO_PI = 2.0*3.14159265358979323846;
SpawnType m_SpawnType;
double m_SpawnLocationX;
double m_SpawnLocationY;
double m_SpawnLocationZ;
double m_SpawnLocationXLength;
double m_SpawnLocationYLength;
double m_SpawnLocationZLength;
double m_SpawnLocationRadius;
double m_Energy;
double m_AngleXMinimum;
double m_AngleXMaximum;
double m_AngleYMinimum;
double m_AngleYMaximum;
DistributionMode m_AngleXMode;
DistributionMode m_AngleYMode;
bool m_IsValid;
bool m_Verbose;
struct TransformResult
{
double z0;
double z1;
};
void ParsePhotonDirection(TiXmlElement* element);
void ParseEnergy(TiXmlElement* element);
void ParsePhotonSpawnArea(TiXmlElement* element);
TransformResult BoxMuellerTransform(double u1, double u2, double mu, double sigma);
};
}
}
#endif // MITKPHOTOACOUSTICLIGHTSOURCE_H
diff --git a/Modules/PhotoacousticsLib/include/mitkPALinearSpectralUnmixingFilter.h b/Modules/PhotoacousticsLib/include/mitkPALinearSpectralUnmixingFilter.h
index 1401f1c9ae..fa03b40789 100644
--- a/Modules/PhotoacousticsLib/include/mitkPALinearSpectralUnmixingFilter.h
+++ b/Modules/PhotoacousticsLib/include/mitkPALinearSpectralUnmixingFilter.h
@@ -1,99 +1,100 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKLINEARPHOTOACOUSTICSPECTRALUNMIXINGFILTER_H
#define MITKLINEARPHOTOACOUSTICSPECTRALUNMIXINGFILTER_H
#include <mitkPASpectralUnmixingFilterBase.h>
#include <MitkPhotoacousticsLibExports.h>
namespace mitk {
namespace pa {
/**
* \brief This filter is subclass of the spectral unmixing filter base. All algorithms in this class are
* based on the Eigen open source c++ library. It takes a multispectral pixel as input and returns a vector
* with the unmixing result.
*
* Input:
* - endmemberMatrix Eigen Matrix with number of chromophores colums and number of wavelengths rows so matrix element (i,j) contains
* the absorbtion of chromophore j @ wavelength i taken from the database by PropertyElement method.
* - inputVector Eigen Vector containing values of one pixel of XY-plane image with number of wavelength rows (z-dimension of a sequenece)
* so the pixelvalue of the first wavelength is stored in inputVector[0] and so on.
*
* Output:
* - Eigen vector with unmixing result of one multispectral pixel. The ith element of the vector corresponds to the ith entry of the
* m_Chromophore vector.
*
* Algorithms (see AlgortihmType enum):
* - HOUSEHOLDERQR computes the solution by QR decomposition
* - COLPIVHOUSEHOLDERQR computes the solution by QR decomposition
* - FULLPIVHOUSEHOLDERQR computes the solution by QR decomposition
* - LDLT computes the solution by Cholesky decomposition
* - LLT computes the solution by Cholesky decomposition
* - JACOBISVD computes the solution by singular value decomposition uses least square solver
*
* Possible exceptions:
* - "algorithm not working": doesn't work now (2018/06/19)
* - "404 VIGRA ALGORITHM NOT FOUND": Algorithm not implemented
*/
class MITKPHOTOACOUSTICSLIB_EXPORT LinearSpectralUnmixingFilter : public SpectralUnmixingFilterBase
{
public:
- mitkClassMacro(LinearSpectralUnmixingFilter, SpectralUnmixingFilterBase)
- itkFactorylessNewMacro(Self)
+ mitkClassMacro(LinearSpectralUnmixingFilter, SpectralUnmixingFilterBase);
+
+ itkFactorylessNewMacro(Self);
/**
* \brief Contains all implemented Eigen algorithms for spectral unmixing. For detailed information of the algorithms look at the
* mitkPALinearSpectralUnmixingFilter.h documentation (section Algorithms).
*/
enum AlgortihmType
{
HOUSEHOLDERQR,
LDLT,
LLT,
COLPIVHOUSEHOLDERQR,
JACOBISVD,
FULLPIVLU,
FULLPIVHOUSEHOLDERQR
};
/**
* \brief Takes a mitk::pa::LinearSpectralUnmixingFilter::AlgortihmType and fix it for usage at the "SpectralUnmixingAlgorithm" method.
* @param algorithmName has to be a mitk::pa::LinearSpectralUnmixingFilter::AlgortihmType
*/
void SetAlgorithm(AlgortihmType inputAlgorithmName);
protected:
LinearSpectralUnmixingFilter();
~LinearSpectralUnmixingFilter() override;
/**
* \brief overrides the baseclass method with a mehtod to calculate the spectral unmixing result vector. Herain the class performs the
* algorithm set by the "SetAlgorithm" method and writes the result into a Eigen vector which is the return value.
* @param endmemberMatrix Matrix with number of chromophores colums and number of wavelengths rows so matrix element (i,j) contains
* the absorbtion of chromophore j @ wavelength i taken from the database by PropertyElement method.
* @param inputVector Vector containing values of one pixel of XY-plane image with number of wavelength rows (z-dimension of a sequenece)
* so the pixelvalue of the first wavelength is stored in inputVector[0] and so on.
* @throws if the algorithmName is not a member of the enum VigraAlgortihmType
* @throws if one chooses the ldlt/llt solver which doens't work yet
*/
Eigen::VectorXf SpectralUnmixingAlgorithm(Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic> endmemberMatrix,
Eigen::VectorXf inputVector) override;
private:
AlgortihmType algorithmName;
};
}
}
#endif // MITKLINEARPHOTOACOUSTICSPECTRALUNMIXINGFILTER_H
diff --git a/Modules/PhotoacousticsLib/include/mitkPAMonteCarloThreadHandler.h b/Modules/PhotoacousticsLib/include/mitkPAMonteCarloThreadHandler.h
index e22c4130af..0c8e02f381 100644
--- a/Modules/PhotoacousticsLib/include/mitkPAMonteCarloThreadHandler.h
+++ b/Modules/PhotoacousticsLib/include/mitkPAMonteCarloThreadHandler.h
@@ -1,91 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKMONTECARLOTHREADHANDLER_H
#define MITKMONTECARLOTHREADHANDLER_H
#include <mitkCommon.h>
#include <MitkPhotoacousticsLibExports.h>
#include <mutex>
//Includes for smart pointer usage
#include "mitkCommon.h"
#include "itkLightObject.h"
namespace mitk {
namespace pa {
/**
* @brief The PhotoacousticStatefulObject class
* Designed for inheritence. Provides a state member variable and convenience methods to check
* for the state.
*/
class MITKPHOTOACOUSTICSLIB_EXPORT MonteCarloThreadHandler : public itk::LightObject
{
public:
- mitkClassMacroItkParent(MonteCarloThreadHandler, itk::LightObject)
- mitkNewMacro2Param(MonteCarloThreadHandler, long, bool)
- mitkNewMacro3Param(MonteCarloThreadHandler, long, bool, bool)
+ mitkClassMacroItkParent(MonteCarloThreadHandler, itk::LightObject);
+ mitkNewMacro2Param(MonteCarloThreadHandler, long, bool);
+ mitkNewMacro3Param(MonteCarloThreadHandler, long, bool, bool);
- long GetNextWorkPackage();
+ long GetNextWorkPackage();
void SetPackageSize(long sizeInMilliseconsOrNumberOfPhotons);
itkGetMacro(NumberPhotonsToSimulate, long);
itkGetMacro(NumberPhotonsRemaining, long);
itkGetMacro(WorkPackageSize, long);
itkGetMacro(SimulationTime, long);
itkGetMacro(SimulateOnTimeBasis, bool);
itkGetMacro(Verbose, bool);
protected:
long m_NumberPhotonsToSimulate;
long m_NumberPhotonsRemaining;
long m_WorkPackageSize;
long m_SimulationTime;
long m_Time;
bool m_SimulateOnTimeBasis;
bool m_Verbose;
std::mutex m_MutexRemainingPhotonsManipulation;
/**
* @brief PhotoacousticThreadhandler
* @param timInMilliseconsOrNumberofPhotons
* @param simulateOnTimeBasis
*/
MonteCarloThreadHandler(long timInMilliseconsOrNumberofPhotons, bool simulateOnTimeBasis);
/**
* @brief PhotoacousticThreadhandler
* @param timInMilliseconsOrNumberofPhotons
* @param simulateOnTimeBasis
* @param verbose
*/
MonteCarloThreadHandler(long timInMilliseconsOrNumberofPhotons, bool simulateOnTimeBasis, bool verbose);
~MonteCarloThreadHandler() override;
};
/**
* @brief Equal A function comparing two thread handlers for beeing equal
*
* @param rightHandSide A object to be compared
* @param leftHandSide A object to be compared
* @param eps tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose flag indicating if the user wants detailed console output or not.
* @return true, if all subsequent comparisons are true, false otherwise
*/
MITKPHOTOACOUSTICSLIB_EXPORT bool Equal(const MonteCarloThreadHandler::Pointer leftHandSide,
const MonteCarloThreadHandler::Pointer rightHandSide, double eps, bool verbose);
}
}
#endif // MITKMONTECARLOTHREADHANDLER_H
diff --git a/Modules/PhotoacousticsLib/include/mitkPAProbe.h b/Modules/PhotoacousticsLib/include/mitkPAProbe.h
index 331e303748..711af98b47 100644
--- a/Modules/PhotoacousticsLib/include/mitkPAProbe.h
+++ b/Modules/PhotoacousticsLib/include/mitkPAProbe.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPHOTOACOUSTICPROBE_H
#define MITKPHOTOACOUSTICPROBE_H
#include <MitkPhotoacousticsLibExports.h>
#include <mitkCommon.h>
//Includes for smart pointer usage
#include "mitkCommon.h"
#include "itkLightObject.h"
#include "mitkPALightSource.h"
#include <vector>
#include <tinyxml.h>
namespace mitk {
namespace pa {
/**
* @brief The Probe class
* The representation of a Probe
*/
class MITKPHOTOACOUSTICSLIB_EXPORT Probe : public itk::LightObject
{
public:
- mitkClassMacroItkParent(Probe, itk::LightObject)
- mitkNewMacro2Param(Self, std::string, bool)
- mitkNewMacro2Param(Self, const char*, bool)
+ mitkClassMacroItkParent(Probe, itk::LightObject);
+ mitkNewMacro2Param(Self, std::string, bool);
+ mitkNewMacro2Param(Self, const char*, bool);
- const std::string XML_TAG_PROBE = "Probe";
+ const std::string XML_TAG_PROBE = "Probe";
const std::string XML_TAG_LIGHT_SOURCE = "LightSource";
LightSource::PhotonInformation GetNextPhoton(double rng1, double rnd2, double rnd3, double rnd4,
double rnd5, double rnd6, double rnd7, double rnd8);
bool IsValid();
Probe(std::string xmlFile, bool verbose);
Probe(const char* fileStream, bool verbose);
~Probe() override;
protected:
std::vector<LightSource::Pointer> m_LightSources;
bool m_IsValid;
double m_TotalEnergy;
bool m_Verbose;
void InitProbe(TiXmlDocument document);
};
}
}
#endif // MITKPHOTOACOUSTICPROBE_H
diff --git a/Modules/PhotoacousticsLib/include/mitkPAPropertyCalculator.h b/Modules/PhotoacousticsLib/include/mitkPAPropertyCalculator.h
index 11fe2fc675..a83738b207 100644
--- a/Modules/PhotoacousticsLib/include/mitkPAPropertyCalculator.h
+++ b/Modules/PhotoacousticsLib/include/mitkPAPropertyCalculator.h
@@ -1,75 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPHOTOACOUSTICPROPERTYCALCULATOR_H
#define MITKPHOTOACOUSTICPROPERTYCALCULATOR_H
#include "MitkPhotoacousticsLibExports.h"
//Includes for smart pointer usage
#include "mitkCommon.h"
#include "itkLightObject.h"
namespace mitk {
namespace pa {
class MITKPHOTOACOUSTICSLIB_EXPORT PropertyCalculator : public itk::LightObject
{
public:
- mitkClassMacroItkParent(PropertyCalculator, itk::LightObject)
- itkFactorylessNewMacro(Self)
+ mitkClassMacroItkParent(PropertyCalculator, itk::LightObject);
+ itkFactorylessNewMacro(Self);
struct Properties
{
double mua;
double mus;
double g;
};
enum TissueType
{
AIR = 1,
BLOOD = 2,
EPIDERMIS = 3,
FAT = 4,
STANDARD_TISSUE = 5
};
enum ChromophoreType
{
OXYGENATED = 1,
DEOXYGENATED = 2,
WATER = 3,
FATTY = 4,
MELANIN = 5,
ONEENDMEMBER = 6
};
double GetAbsorptionForWavelength(
ChromophoreType chromophoreType, int wavelength);
Properties CalculatePropertyForSpecificWavelength(
TissueType tissueType, int wavelength, double oxygenSaturatonInFraction = 0);
protected:
PropertyCalculator();
~PropertyCalculator() override;
bool m_Valid = false;
std::map<int, std::map<int, double>> m_SpectralLibMap;
};
}
}
#endif // MITKPHOTOACOUSTICPROPERTYCALCULATOR_H
diff --git a/Modules/PhotoacousticsLib/include/mitkPASimulationBatchGeneratorParameters.h b/Modules/PhotoacousticsLib/include/mitkPASimulationBatchGeneratorParameters.h
index 32d99f98a6..d17c010833 100644
--- a/Modules/PhotoacousticsLib/include/mitkPASimulationBatchGeneratorParameters.h
+++ b/Modules/PhotoacousticsLib/include/mitkPASimulationBatchGeneratorParameters.h
@@ -1,66 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPHOTOACOUSTICSimulationBatchGENERATORPARAMETERS_H
#define MITKPHOTOACOUSTICSimulationBatchGENERATORPARAMETERS_H
#include <MitkPhotoacousticsLibExports.h>
#include <mitkPAVesselMeanderStrategy.h>
//Includes for smart pointer usage
#include "mitkCommon.h"
#include "itkLightObject.h"
namespace mitk {
namespace pa {
class MITKPHOTOACOUSTICSLIB_EXPORT SimulationBatchGeneratorParameters : public itk::Object
{
public:
- mitkClassMacroItkParent(SimulationBatchGeneratorParameters, itk::Object)
- itkFactorylessNewMacro(Self)
+ mitkClassMacroItkParent(SimulationBatchGeneratorParameters, itk::Object);
+ itkFactorylessNewMacro(Self);
+ itkSetMacro(VolumeIndex, unsigned int);
+ itkSetMacro(NrrdFilePath, std::string);
+ itkSetMacro(TissueName, std::string);
+ itkSetMacro(BinaryPath, std::string);
+ itkSetMacro(NumberOfPhotons, long);
+ itkSetMacro(YOffsetLowerThresholdInCentimeters, double);
+ itkSetMacro(YOffsetUpperThresholdInCentimeters, double);
+ itkSetMacro(YOffsetStepInCentimeters, double);
+ itkGetMacro(VolumeIndex, unsigned int);
- itkSetMacro(VolumeIndex, unsigned int)
- itkSetMacro(NrrdFilePath, std::string)
- itkSetMacro(TissueName, std::string)
- itkSetMacro(BinaryPath, std::string)
- itkSetMacro(NumberOfPhotons, long)
- itkSetMacro(YOffsetLowerThresholdInCentimeters, double)
- itkSetMacro(YOffsetUpperThresholdInCentimeters, double)
- itkSetMacro(YOffsetStepInCentimeters, double)
+ itkGetMacro(NrrdFilePath, std::string);
- itkGetMacro(VolumeIndex, unsigned int)
- itkGetMacro(NrrdFilePath, std::string)
- itkGetMacro(TissueName, std::string)
- itkGetMacro(BinaryPath, std::string)
- itkGetMacro(NumberOfPhotons, long)
- itkGetMacro(YOffsetLowerThresholdInCentimeters, double)
- itkGetMacro(YOffsetUpperThresholdInCentimeters, double)
- itkGetMacro(YOffsetStepInCentimeters, double)
+ itkGetMacro(TissueName, std::string);
+
+ itkGetMacro(BinaryPath, std::string);
+ itkGetMacro(NumberOfPhotons, long);
+ itkGetMacro(YOffsetLowerThresholdInCentimeters, double);
+ itkGetMacro(YOffsetUpperThresholdInCentimeters, double);
+ itkGetMacro(YOffsetStepInCentimeters, double);
protected:
SimulationBatchGeneratorParameters();
~SimulationBatchGeneratorParameters() override;
private:
unsigned int m_VolumeIndex;
std::string m_NrrdFilePath;
std::string m_TissueName;
std::string m_BinaryPath;
long m_NumberOfPhotons;
double m_YOffsetLowerThresholdInCentimeters;
double m_YOffsetUpperThresholdInCentimeters;
double m_YOffsetStepInCentimeters;
};
}
}
#endif // MITKPHOTOACOUSTICSimulationBatchGENERATORPARAMETERS_H
diff --git a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterLagrange.h b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterLagrange.h
index 53b09221d9..d99e73e310 100644
--- a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterLagrange.h
+++ b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterLagrange.h
@@ -1,37 +1,36 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERLAGRANGE_H
#define MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERLAGRANGE_H
#include <mitkPASpectralUnmixingFilterBase.h>
#include <MitkPhotoacousticsLibExports.h>
namespace mitk {
namespace pa {
class MITKPHOTOACOUSTICSLIB_EXPORT SpectralUnmixingFilterLagrange : public SpectralUnmixingFilterBase
{
public:
- mitkClassMacro(SpectralUnmixingFilterLagrange, SpectralUnmixingFilterBase)
- //itkFactorylessNewMacro(Self)
+ mitkClassMacro(SpectralUnmixingFilterLagrange, SpectralUnmixingFilterBase);
protected:
SpectralUnmixingFilterLagrange();
~SpectralUnmixingFilterLagrange() override;
private:
};
}
}
#endif // MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERLAGRANGE_H
diff --git a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterSimplex.h b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterSimplex.h
index eb908b6266..c5ca41dbe3 100644
--- a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterSimplex.h
+++ b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterSimplex.h
@@ -1,49 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERSIMPLEX_H
#define MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERSIMPLEX_H
#include <mitkPASpectralUnmixingFilterBase.h>
#include <MitkPhotoacousticsLibExports.h>
namespace mitk {
namespace pa {
class MITKPHOTOACOUSTICSLIB_EXPORT SpectralUnmixingFilterSimplex : public SpectralUnmixingFilterBase
{
public:
- mitkClassMacro(SpectralUnmixingFilterSimplex, SpectralUnmixingFilterBase)
- itkFactorylessNewMacro(Self)
+ mitkClassMacro(SpectralUnmixingFilterSimplex, SpectralUnmixingFilterBase);
+
+ itkFactorylessNewMacro(Self);
protected:
SpectralUnmixingFilterSimplex();
~SpectralUnmixingFilterSimplex() override;
private:
Eigen::VectorXf SpectralUnmixingAlgorithm(Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic> EndmemberMatrix,
Eigen::VectorXf inputVector) override;
int factorial(int n);
virtual Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic> GenerateA(Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic> EndmemberMatrix,
Eigen::VectorXf inputVector, int i);
Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic> GenerateD2(Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic> A);
float simplexVolume(Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic> Matrix);
virtual Eigen::VectorXf Normalization(Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic> EndmemberMatrix,
Eigen::VectorXf inputVector);
};
}
}
#endif // MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERSIMPLEX_H
diff --git a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterVigra.h b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterVigra.h
index fe27824f26..24b8cae547 100644
--- a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterVigra.h
+++ b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterVigra.h
@@ -1,104 +1,104 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERVIGRA_H
#define MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERVIGRA_H
#include <mitkPASpectralUnmixingFilterBase.h>
#include <MitkPhotoacousticsLibExports.h>
#include <mitkPALinearSpectralUnmixingFilter.h>
namespace mitk {
namespace pa {
/**
* \brief This filter is subclass of the spectral unmixing filter base. All algorithms in this class are
* based on the vigra open source c++ library. It takes a multispectral pixel as input and returns a vector
* with the unmixing result.
*
* Input:
* - endmemberMatrix Eigen Matrix with number of chromophores colums and number of wavelengths rows so matrix element (i,j) contains
* the absorbtion of chromophore j @ wavelength i taken from the database by PropertyElement method.
* - inputVector Eigen Vector containing values of one pixel of XY-plane image with number of wavelength rows (z-dimension of a sequenece)
* so the pixelvalue of the first wavelength is stored in inputVector[0] and so on.
*
* Output:
* - Eigen vector with unmixing result of one multispectral pixel. The ith element of the vector corresponds to the ith entry of the
* m_Chromophore vector.
*
* Algorithms (see VigraAlgortihmType enum):
* - LARS algorithm minimizes (A*x-b)^2 s.t. x>=0 using least angle regression
* - GOLDFARB minimizes (A*x-b)^2 s.t. x>=0 using the Goldfarb-Idnani algorithm
* - WEIGHTED minimizes transpose(A*x-b)*diag(weights)*(A*x-b) using QR decomposition
* - LS minimizes (A*x-b)^2 using QR decomposition
*
* Possible exceptions:
* - "404 VIGRA ALGORITHM NOT FOUND": Algorithm not implemented
*/
class MITKPHOTOACOUSTICSLIB_EXPORT SpectralUnmixingFilterVigra : public SpectralUnmixingFilterBase
{
public:
- mitkClassMacro(SpectralUnmixingFilterVigra, SpectralUnmixingFilterBase)
- itkFactorylessNewMacro(Self)
+ mitkClassMacro(SpectralUnmixingFilterVigra, SpectralUnmixingFilterBase);
+ itkFactorylessNewMacro(Self);
/**
* \brief Contains all implemented Vigra algorithms for spectral unmixing. For detailed information of the algorithms look at the
* mitkPASpectralUnmixingFilterVigra.h documentation (section Algorithms).
*/
enum VigraAlgortihmType
{
LARS,
GOLDFARB,
WEIGHTED,
LS
};
/**
* \brief AddWeight takes integers and writes them at the end of the weightsvec vector. The first call of the method then
* corresponds to the first input image/wavelength and so on.
* @param weight is a percentage (integer) between 1 and 100
*/
void AddWeight(unsigned int weight);
/**
* \brief Takes a mitk::pa::SpectralUnmixingFilterVigra::VigraAlgortihmType and fix it for usage at the "SpectralUnmixingAlgorithm"
* method.
* @param algorithmName has to be a mitk::pa::SpectralUnmixingFilterVigra::VigraAlgortihmType
*/
void SetAlgorithm(VigraAlgortihmType inputAlgorithmName);
protected:
SpectralUnmixingFilterVigra();
~SpectralUnmixingFilterVigra() override;
/**
* \brief overrides the baseclass method with a mehtod to calculate the spectral unmixing result vector. Herain it first converts the
* Eigen inputs to the Vigra class. Afterwards the class performs the algorithm set by the "SetAlgorithm" method and writes the result
* into a Eigen vector which is the return value.
* @param endmemberMatrix Matrix with number of chromophores colums and number of wavelengths rows so matrix element (i,j) contains
* the absorbtion of chromophore j @ wavelength i taken from the database by PropertyElement method.
* @param inputVector Vector containing values of one pixel of XY-plane image with number of wavelength rows (z-dimension of a sequenece)
* so the pixelvalue of the first wavelength is stored in inputVector[0] and so on.
* @throws if the algorithmName is not a member of the enum VigraAlgortihmType
*/
Eigen::VectorXf SpectralUnmixingAlgorithm(Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic> EndmemberMatrix,
Eigen::VectorXf inputVector) override;
private:
std::vector<double> weightsvec;
SpectralUnmixingFilterVigra::VigraAlgortihmType algorithmName;
};
}
}
#endif // MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERVIGRA_H
diff --git a/Modules/PhotoacousticsLib/include/mitkPATissueGeneratorParameters.h b/Modules/PhotoacousticsLib/include/mitkPATissueGeneratorParameters.h
index 904bb78083..6e249f2b06 100644
--- a/Modules/PhotoacousticsLib/include/mitkPATissueGeneratorParameters.h
+++ b/Modules/PhotoacousticsLib/include/mitkPATissueGeneratorParameters.h
@@ -1,213 +1,212 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPHOTOACOUSTICTISSUEGENERATORPARAMETERS_H
#define MITKPHOTOACOUSTICTISSUEGENERATORPARAMETERS_H
#include <MitkPhotoacousticsLibExports.h>
#include <mitkPAVesselMeanderStrategy.h>
//Includes for smart pointer usage
#include "mitkCommon.h"
#include "itkLightObject.h"
namespace mitk {
namespace pa {
class MITKPHOTOACOUSTICSLIB_EXPORT TissueGeneratorParameters : public itk::Object
{
public:
- mitkClassMacroItkParent(TissueGeneratorParameters, itk::Object)
- itkFactorylessNewMacro(Self)
+ mitkClassMacroItkParent(TissueGeneratorParameters, itk::Object);
+ itkFactorylessNewMacro(Self);
/**
* Callback function definition of a VesselMeanderStrategy
*/
typedef void (VesselMeanderStrategy::*CalculateNewVesselPositionCallback)
(Vector::Pointer, double, std::mt19937*);
- itkGetMacro(XDim, int)
- itkGetMacro(YDim, int)
- itkGetMacro(ZDim, int)
- itkGetMacro(VoxelSpacingInCentimeters, double)
- itkGetMacro(DoPartialVolume, bool)
- itkGetMacro(UseRngSeed, bool)
- itkGetMacro(RngSeed, long)
- itkGetMacro(RandomizePhysicalProperties, bool)
- itkGetMacro(RandomizePhysicalPropertiesPercentage, double)
- itkGetMacro(ForceVesselsMoveAlongYDirection, bool)
-
- itkGetMacro(MinBackgroundAbsorption, double)
- itkGetMacro(MaxBackgroundAbsorption, double)
- itkGetMacro(BackgroundScattering, double)
- itkGetMacro(BackgroundAnisotropy, double)
- itkGetMacro(AirAbsorption, double)
- itkGetMacro(AirScattering, double)
- itkGetMacro(AirAnisotropy, double)
- itkGetMacro(AirThicknessInMillimeters, double)
- itkGetMacro(SkinAbsorption, double)
- itkGetMacro(SkinScattering, double)
- itkGetMacro(SkinAnisotropy, double)
- itkGetMacro(SkinThicknessInMillimeters, double)
-
- itkGetMacro(CalculateNewVesselPositionCallback, CalculateNewVesselPositionCallback)
- itkGetMacro(MinNumberOfVessels, int)
- itkGetMacro(MaxNumberOfVessels, int)
- itkGetMacro(MinVesselBending, double)
- itkGetMacro(MaxVesselBending, double)
- itkGetMacro(MinVesselAbsorption, double)
- itkGetMacro(MaxVesselAbsorption, double)
- itkGetMacro(MinVesselRadiusInMillimeters, double)
- itkGetMacro(MaxVesselRadiusInMillimeters, double)
- itkGetMacro(VesselBifurcationFrequency, int)
- itkGetMacro(MinVesselScattering, double)
- itkGetMacro(MaxVesselScattering, double)
- itkGetMacro(MinVesselAnisotropy, double)
- itkGetMacro(MaxVesselAnisotropy, double)
- itkGetMacro(MinVesselZOrigin, double)
- itkGetMacro(MaxVesselZOrigin, double)
-
- itkGetMacro(MCflag, double)
- itkGetMacro(MCLaunchflag, double)
- itkGetMacro(MCBoundaryflag, double)
- itkGetMacro(MCLaunchPointX, double)
- itkGetMacro(MCLaunchPointY, double)
- itkGetMacro(MCLaunchPointZ, double)
- itkGetMacro(MCFocusPointX, double)
- itkGetMacro(MCFocusPointY, double)
- itkGetMacro(MCFocusPointZ, double)
- itkGetMacro(MCTrajectoryVectorX, double)
- itkGetMacro(MCTrajectoryVectorY, double)
- itkGetMacro(MCTrajectoryVectorZ, double)
- itkGetMacro(MCRadius, double)
- itkGetMacro(MCWaist, double)
-
- itkSetMacro(XDim, int)
- itkSetMacro(YDim, int)
- itkSetMacro(ZDim, int)
- itkSetMacro(VoxelSpacingInCentimeters, double)
- itkSetMacro(DoPartialVolume, bool)
- itkSetMacro(UseRngSeed, bool)
- itkSetMacro(RngSeed, long)
- itkSetMacro(RandomizePhysicalProperties, bool)
- itkSetMacro(RandomizePhysicalPropertiesPercentage, double)
- itkSetMacro(ForceVesselsMoveAlongYDirection, bool)
-
- itkSetMacro(MinBackgroundAbsorption, double)
- itkSetMacro(MaxBackgroundAbsorption, double)
- itkSetMacro(BackgroundScattering, double)
- itkSetMacro(BackgroundAnisotropy, double)
- itkSetMacro(AirAbsorption, double)
- itkSetMacro(AirScattering, double)
- itkSetMacro(AirAnisotropy, double)
- itkSetMacro(AirThicknessInMillimeters, double)
- itkSetMacro(SkinAbsorption, double)
- itkSetMacro(SkinScattering, double)
- itkSetMacro(SkinAnisotropy, double)
- itkSetMacro(SkinThicknessInMillimeters, double)
-
- itkSetMacro(CalculateNewVesselPositionCallback, CalculateNewVesselPositionCallback)
- itkSetMacro(MinNumberOfVessels, int)
- itkSetMacro(MaxNumberOfVessels, int)
- itkSetMacro(MinVesselBending, double)
- itkSetMacro(MaxVesselBending, double)
- itkSetMacro(MinVesselAbsorption, double)
- itkSetMacro(MaxVesselAbsorption, double)
- itkSetMacro(MinVesselRadiusInMillimeters, double)
- itkSetMacro(MaxVesselRadiusInMillimeters, double)
- itkSetMacro(VesselBifurcationFrequency, int)
- itkSetMacro(MinVesselScattering, double)
- itkSetMacro(MaxVesselScattering, double)
- itkSetMacro(MinVesselAnisotropy, double)
- itkSetMacro(MaxVesselAnisotropy, double)
- itkSetMacro(MinVesselZOrigin, double)
- itkSetMacro(MaxVesselZOrigin, double)
-
- itkSetMacro(MCflag, double)
- itkSetMacro(MCLaunchflag, double)
- itkSetMacro(MCBoundaryflag, double)
- itkSetMacro(MCLaunchPointX, double)
- itkSetMacro(MCLaunchPointY, double)
- itkSetMacro(MCLaunchPointZ, double)
- itkSetMacro(MCFocusPointX, double)
- itkSetMacro(MCFocusPointY, double)
- itkSetMacro(MCFocusPointZ, double)
- itkSetMacro(MCTrajectoryVectorX, double)
- itkSetMacro(MCTrajectoryVectorY, double)
- itkSetMacro(MCTrajectoryVectorZ, double)
- itkSetMacro(MCRadius, double)
- itkSetMacro(MCWaist, double)
+ itkGetMacro(XDim, int);
+
+ itkGetMacro(YDim, int);
+
+ itkGetMacro(ZDim, int);
+
+ itkGetMacro(VoxelSpacingInCentimeters, double);
+ itkGetMacro(DoPartialVolume, bool);
+ itkGetMacro(UseRngSeed, bool);
+ itkGetMacro(RngSeed, long);
+ itkGetMacro(RandomizePhysicalProperties, bool);
+ itkGetMacro(RandomizePhysicalPropertiesPercentage, double);
+ itkGetMacro(ForceVesselsMoveAlongYDirection, bool);
+ itkGetMacro(MinBackgroundAbsorption, double);
+ itkGetMacro(MaxBackgroundAbsorption, double);
+ itkGetMacro(BackgroundScattering, double);
+ itkGetMacro(BackgroundAnisotropy, double);
+ itkGetMacro(AirAbsorption, double);
+ itkGetMacro(AirScattering, double);
+ itkGetMacro(AirAnisotropy, double);
+ itkGetMacro(AirThicknessInMillimeters, double);
+ itkGetMacro(SkinAbsorption, double);
+ itkGetMacro(SkinScattering, double);
+ itkGetMacro(SkinAnisotropy, double);
+ itkGetMacro(SkinThicknessInMillimeters, double);
+ itkGetMacro(CalculateNewVesselPositionCallback, CalculateNewVesselPositionCallback);
+ itkGetMacro(MinNumberOfVessels, int);
+ itkGetMacro(MaxNumberOfVessels, int);
+ itkGetMacro(MinVesselBending, double);
+ itkGetMacro(MaxVesselBending, double);
+ itkGetMacro(MinVesselAbsorption, double);
+ itkGetMacro(MaxVesselAbsorption, double);
+ itkGetMacro(MinVesselRadiusInMillimeters, double);
+ itkGetMacro(MaxVesselRadiusInMillimeters, double);
+ itkGetMacro(VesselBifurcationFrequency, int);
+ itkGetMacro(MinVesselScattering, double);
+ itkGetMacro(MaxVesselScattering, double);
+ itkGetMacro(MinVesselAnisotropy, double);
+ itkGetMacro(MaxVesselAnisotropy, double);
+ itkGetMacro(MinVesselZOrigin, double);
+ itkGetMacro(MaxVesselZOrigin, double);
+ itkGetMacro(MCflag, double);
+ itkGetMacro(MCLaunchflag, double);
+ itkGetMacro(MCBoundaryflag, double);
+ itkGetMacro(MCLaunchPointX, double);
+ itkGetMacro(MCLaunchPointY, double);
+ itkGetMacro(MCLaunchPointZ, double);
+ itkGetMacro(MCFocusPointX, double);
+ itkGetMacro(MCFocusPointY, double);
+ itkGetMacro(MCFocusPointZ, double);
+ itkGetMacro(MCTrajectoryVectorX, double);
+ itkGetMacro(MCTrajectoryVectorY, double);
+ itkGetMacro(MCTrajectoryVectorZ, double);
+ itkGetMacro(MCRadius, double);
+ itkGetMacro(MCWaist, double);
+ itkSetMacro(XDim, int);
+ itkSetMacro(YDim, int);
+ itkSetMacro(ZDim, int);
+ itkSetMacro(VoxelSpacingInCentimeters, double);
+ itkSetMacro(DoPartialVolume, bool);
+ itkSetMacro(UseRngSeed, bool);
+ itkSetMacro(RngSeed, long);
+ itkSetMacro(RandomizePhysicalProperties, bool);
+ itkSetMacro(RandomizePhysicalPropertiesPercentage, double);
+ itkSetMacro(ForceVesselsMoveAlongYDirection, bool);
+ itkSetMacro(MinBackgroundAbsorption, double);
+ itkSetMacro(MaxBackgroundAbsorption, double);
+ itkSetMacro(BackgroundScattering, double);
+ itkSetMacro(BackgroundAnisotropy, double);
+ itkSetMacro(AirAbsorption, double);
+ itkSetMacro(AirScattering, double);
+ itkSetMacro(AirAnisotropy, double);
+ itkSetMacro(AirThicknessInMillimeters, double);
+ itkSetMacro(SkinAbsorption, double);
+ itkSetMacro(SkinScattering, double);
+ itkSetMacro(SkinAnisotropy, double);
+ itkSetMacro(SkinThicknessInMillimeters, double);
+ itkSetMacro(CalculateNewVesselPositionCallback, CalculateNewVesselPositionCallback);
+ itkSetMacro(MinNumberOfVessels, int);
+ itkSetMacro(MaxNumberOfVessels, int);
+ itkSetMacro(MinVesselBending, double);
+ itkSetMacro(MaxVesselBending, double);
+ itkSetMacro(MinVesselAbsorption, double);
+ itkSetMacro(MaxVesselAbsorption, double);
+ itkSetMacro(MinVesselRadiusInMillimeters, double);
+ itkSetMacro(MaxVesselRadiusInMillimeters, double);
+ itkSetMacro(VesselBifurcationFrequency, int);
+ itkSetMacro(MinVesselScattering, double);
+ itkSetMacro(MaxVesselScattering, double);
+ itkSetMacro(MinVesselAnisotropy, double);
+ itkSetMacro(MaxVesselAnisotropy, double);
+ itkSetMacro(MinVesselZOrigin, double);
+ itkSetMacro(MaxVesselZOrigin, double);
+ itkSetMacro(MCflag, double);
+
+ itkSetMacro(MCLaunchflag, double);
+
+ itkSetMacro(MCBoundaryflag, double);
+
+ itkSetMacro(MCLaunchPointX, double);
+ itkSetMacro(MCLaunchPointY, double);
+ itkSetMacro(MCLaunchPointZ, double);
+ itkSetMacro(MCFocusPointX, double);
+ itkSetMacro(MCFocusPointY, double);
+ itkSetMacro(MCFocusPointZ, double);
+ itkSetMacro(MCTrajectoryVectorX, double);
+ itkSetMacro(MCTrajectoryVectorY, double);
+ itkSetMacro(MCTrajectoryVectorZ, double);
+ itkSetMacro(MCRadius, double);
+ itkSetMacro(MCWaist, double);
protected:
TissueGeneratorParameters();
~TissueGeneratorParameters() override;
private:
int m_XDim;
int m_YDim;
int m_ZDim;
double m_VoxelSpacingInCentimeters;
bool m_DoPartialVolume;
bool m_UseRngSeed;
long m_RngSeed;
bool m_RandomizePhysicalProperties;
double m_RandomizePhysicalPropertiesPercentage;
bool m_ForceVesselsMoveAlongYDirection;
double m_MinBackgroundAbsorption;
double m_MaxBackgroundAbsorption;
double m_BackgroundScattering;
double m_BackgroundAnisotropy;
double m_AirAbsorption;
double m_AirScattering;
double m_AirAnisotropy;
double m_AirThicknessInMillimeters;
double m_SkinAbsorption;
double m_SkinScattering;
double m_SkinAnisotropy;
double m_SkinThicknessInMillimeters;
CalculateNewVesselPositionCallback m_CalculateNewVesselPositionCallback;
int m_MinNumberOfVessels;
int m_MaxNumberOfVessels;
double m_MinVesselBending;
double m_MaxVesselBending;
double m_MinVesselAbsorption;
double m_MaxVesselAbsorption;
double m_MinVesselRadiusInMillimeters;
double m_MaxVesselRadiusInMillimeters;
int m_VesselBifurcationFrequency;
double m_MinVesselScattering;
double m_MaxVesselScattering;
double m_MinVesselAnisotropy;
double m_MaxVesselAnisotropy;
double m_MinVesselZOrigin;
double m_MaxVesselZOrigin;
double m_MCflag;
double m_MCLaunchflag;
double m_MCBoundaryflag;
double m_MCLaunchPointX;
double m_MCLaunchPointY;
double m_MCLaunchPointZ;
double m_MCFocusPointX;
double m_MCFocusPointY;
double m_MCFocusPointZ;
double m_MCTrajectoryVectorX;
double m_MCTrajectoryVectorY;
double m_MCTrajectoryVectorZ;
double m_MCRadius;
double m_MCWaist;
};
}
}
#endif // MITKPHOTOACOUSTICTISSUEGENERATORPARAMETERS_H
diff --git a/Modules/PhotoacousticsLib/include/mitkPAVector.h b/Modules/PhotoacousticsLib/include/mitkPAVector.h
index 163d59f17f..0134624acd 100644
--- a/Modules/PhotoacousticsLib/include/mitkPAVector.h
+++ b/Modules/PhotoacousticsLib/include/mitkPAVector.h
@@ -1,132 +1,132 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKSMARTVECTOR_H
#define MITKSMARTVECTOR_H
#include <mitkVector.h>
#include <random>
#include <MitkPhotoacousticsLibExports.h>
//Includes for smart pointer usage
#include "mitkCommon.h"
#include "itkLightObject.h"
namespace mitk {
namespace pa {
class MITKPHOTOACOUSTICSLIB_EXPORT Vector : public itk::LightObject
{
public:
- mitkClassMacroItkParent(Vector, itk::LightObject)
- itkFactorylessNewMacro(Self)
+ mitkClassMacroItkParent(Vector, itk::LightObject);
+ itkFactorylessNewMacro(Self);
/**
* @brief GetNorm calculates the length of this vector.
* @return the euclidean norm
*/
double GetNorm();
double GetElement(unsigned short index);
void SetElement(unsigned short index, double value);
/**
* @brief Normalize normalizes this vector. After calling this GetNorm() will return 1.
*/
void Normalize();
void SetValue(Vector::Pointer value);
/**
* @brief RandomizeByPercentage alters this vector randomly by [-percentage, percentage] of the bendingFactor.
*
* @param percentage
* @param bendingFactor
*/
void RandomizeByPercentage(double percentage, double bendingFactor, std::mt19937* rng);
/**
* @brief Randomize randomizes this vector to be [lowerLimit, upperLimit] in each element
*
* @param xLowerLimit
* @param xUpperLimit
* @param yLowerLimit
* @param yUpperLimit
* @param zLowerLimit
* @param zUpperLimit
*/
void Randomize(double xLowerLimit, double xUpperLimit, double yLowerLimit, double yUpperLimit, double zLowerLimit, double zUpperLimit, std::mt19937* rng);
/**
* @brief Randomize randomizes this vector to be [0, limit] in each element
*
* @param xLimit
* @param yLimit
* @param zLimit
*/
void Randomize(double xLimit, double yLimit, double zLimit, std::mt19937* rng);
/**
* @brief Randomize randomizes this vector to be [-1, 1] in each element
*/
void Randomize(std::mt19937* rng);
/**
* @brief Rotate rotates this Vector around the x, y and z axis with the given angles in radians
*
* @param thetaChange rotation of the inclination angle in radians
* @param phiChange rotation of the azimuthal angle in radians
*/
void Rotate(double xAngle, double yAngle);
/**
* @brief Scale scales this Vector with the given factor
*
* @param factor the scaling factor
*
* If a negative number is provided, the direction of the vector will be inverted.
*/
void Scale(double factor);
/**
* @brief Clone create a deep copy of this vector
*
* @return a new vector with the same values.
*/
Vector::Pointer Clone();
void Subtract(Vector::Pointer other);
void Add(Vector::Pointer other);
protected:
Vector();
~Vector() override;
void PrintSelf(std::ostream& os, itk::Indent indent) const override;
private:
mitk::Vector3D m_Vector;
};
/**
* @brief Equal A function comparing two vectors for beeing equal
*
* @param rightHandSide A Vector to be compared
* @param leftHandSide A Vector to be compared
* @param eps tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose flag indicating if the user wants detailed console output or not.
* @return true, if all subsequent comparisons are true, false otherwise
*/
MITKPHOTOACOUSTICSLIB_EXPORT bool Equal(const Vector::Pointer leftHandSide, const Vector::Pointer rightHandSide, double eps, bool verbose);
}
}
#endif // MITKSMARTVECTOR_H
diff --git a/Modules/PhotoacousticsLib/include/mitkPAVessel.h b/Modules/PhotoacousticsLib/include/mitkPAVessel.h
index 57dae2bac4..18e929d23a 100644
--- a/Modules/PhotoacousticsLib/include/mitkPAVessel.h
+++ b/Modules/PhotoacousticsLib/include/mitkPAVessel.h
@@ -1,113 +1,113 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKVESSEL_H
#define MITKVESSEL_H
#include "mitkVector.h"
#include "mitkPAVesselMeanderStrategy.h"
#include "mitkPAInSilicoTissueVolume.h"
#include "mitkPAVector.h"
#include "mitkPAVesselProperties.h"
#include "mitkPAVesselDrawer.h"
#include <MitkPhotoacousticsLibExports.h>
//Includes for smart pointer usage
#include "mitkCommon.h"
#include "itkLightObject.h"
namespace mitk {
namespace pa {
class MITKPHOTOACOUSTICSLIB_EXPORT Vessel : public itk::LightObject
{
public:
- mitkClassMacroItkParent(Vessel, itk::LightObject)
- mitkNewMacro1Param(Self, VesselProperties::Pointer)
-
- /**
- * Callback function definition of a VesselMeanderStrategy
- */
- typedef void (VesselMeanderStrategy::*CalculateNewVesselPositionCallback)
- (Vector::Pointer, double, std::mt19937*);
+ mitkClassMacroItkParent(Vessel, itk::LightObject);
+ mitkNewMacro1Param(Self, VesselProperties::Pointer);
+
+ /**
+ * Callback function definition of a VesselMeanderStrategy
+ */
+ typedef void (VesselMeanderStrategy::*CalculateNewVesselPositionCallback)
+ (Vector::Pointer, double, std::mt19937*);
/**
* @brief ExpandVessel makes this Vessel expand one step in its current direction.
* After expanding, the vessel will draw itself into the given InSilicoTissueVolume.
*
* @param volume volume for the vessel to draw itself in
* @param calculateNewPosition a callback function of the VesselMeanderStrategy class.
* It is used to calculate the final position after taking the step.
* @param bendingFactor a metric of how much the Vessel should bend. If set to 0 the vessel will go in a straight line.
*/
void ExpandVessel(mitk::pa::InSilicoTissueVolume::Pointer volume,
CalculateNewVesselPositionCallback calculateNewPosition, double bendingFactor, std::mt19937* rng);
/**
* @brief CanBifurcate
* @return true if the Vessel is ready to Bifurcate()
*/
bool CanBifurcate();
/**
* @brief Bifurcate bifurcates this vessel into two new ones. Makes sure that the volume of the vessels stays the same.
*
* @return a new vessel split up from the current one.
*/
Vessel::Pointer Bifurcate(std::mt19937* rng);
/**
* @brief IsFinished
* @return true if the vessel cannot expand any further
*/
bool IsFinished();
itkGetConstMacro(VesselProperties, VesselProperties::Pointer);
protected:
Vessel(VesselProperties::Pointer parameters);
~Vessel() override;
private:
const double MINIMUM_VESSEL_RADIUS = 0.1;
const double NEW_RADIUS_MINIMUM_RELATIVE_SIZE = 0.6;
const double NEW_RADIUS_MAXIMUM_RELATIVE_SIZE = 0.8;
VesselMeanderStrategy::Pointer m_VesselMeanderStrategy;
bool m_Finished;
double m_WalkedDistance;
std::uniform_real_distribution<> m_RangeDistribution;
std::uniform_real_distribution<> m_SignDistribution;
std::uniform_real_distribution<> m_RadiusRangeDistribution;
int GetSign(std::mt19937* rng);
VesselProperties::Pointer m_VesselProperties;
VesselDrawer::Pointer m_VesselDrawer;
};
/**
* @brief Equal A function comparing two vessels for beeing equal
*
* @param rightHandSide A vessel to be compared
* @param leftHandSide A vessel to be compared
* @param eps tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose flag indicating if the user wants detailed console output or not.
* @return true, if all subsequent comparisons are true, false otherwise
*/
MITKPHOTOACOUSTICSLIB_EXPORT bool Equal(const Vessel::Pointer leftHandSide, const Vessel::Pointer rightHandSide, double eps, bool verbose);
}
}
#endif // MITKVESSEL_H
diff --git a/Modules/PhotoacousticsLib/include/mitkPAVesselMeanderStrategy.h b/Modules/PhotoacousticsLib/include/mitkPAVesselMeanderStrategy.h
index e282eab94d..e6b249c8a5 100644
--- a/Modules/PhotoacousticsLib/include/mitkPAVesselMeanderStrategy.h
+++ b/Modules/PhotoacousticsLib/include/mitkPAVesselMeanderStrategy.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKVESSELMEANDERSTRATEGY_H
#define MITKVESSELMEANDERSTRATEGY_H
#include "mitkVector.h"
#include "mitkPAVector.h"
#include <MitkPhotoacousticsLibExports.h>
//Includes for smart pointer usage
#include "mitkCommon.h"
#include "itkLightObject.h"
namespace mitk {
namespace pa {
class MITKPHOTOACOUSTICSLIB_EXPORT VesselMeanderStrategy : public itk::LightObject
{
public:
- mitkClassMacroItkParent(VesselMeanderStrategy, itk::LightObject)
- itkFactorylessNewMacro(Self)
+ mitkClassMacroItkParent(VesselMeanderStrategy, itk::LightObject);
+ itkFactorylessNewMacro(Self);
/**
* @brief CalculateNewPositionInStraightLine calculates the new position by just following the direction vector.
* @param direction
* @param bendingFactor
*/
void CalculateNewDirectionVectorInStraightLine(Vector::Pointer direction, double bendingFactor, std::mt19937* rng);
/**
* @brief CalculateRandomlyDivergingPosition calculates the new position by modifying the direction vector randomly,
* proportional to the selected bendingFactor. This means, that the vessels will bend in each expansion step,
* if bendingFactor > 0.
*
* @param direction
* @param bendingFactor
*/
void CalculateNewRandomlyDivergingDirectionVector(Vector::Pointer direction, double bendingFactor, std::mt19937* rng);
protected:
VesselMeanderStrategy();
~VesselMeanderStrategy() override;
const double RANDOMIZATION_PERCENTAGE = 0.4;
};
}
}
#endif // MITKVESSELMEANDERSTRATEGY_H
diff --git a/Modules/PhotoacousticsLib/include/mitkPAVesselTree.h b/Modules/PhotoacousticsLib/include/mitkPAVesselTree.h
index b3e67c8e79..5a51cd2823 100644
--- a/Modules/PhotoacousticsLib/include/mitkPAVesselTree.h
+++ b/Modules/PhotoacousticsLib/include/mitkPAVesselTree.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKVESSELSTRUCTURE_H
#define MITKVESSELSTRUCTURE_H
//std includes
#include <vector>
//mitk includes
#include "mitkPAVessel.h"
#include "mitkPAInSilicoTissueVolume.h"
#include <MitkPhotoacousticsLibExports.h>
//Includes for smart pointer usage
#include "mitkCommon.h"
#include "itkLightObject.h"
namespace mitk {
namespace pa {
class MITKPHOTOACOUSTICSLIB_EXPORT VesselTree : public itk::LightObject
{
public:
- mitkClassMacroItkParent(VesselTree, itk::LightObject)
- mitkNewMacro1Param(Self, VesselProperties::Pointer)
+ mitkClassMacroItkParent(VesselTree, itk::LightObject);
+ mitkNewMacro1Param(Self, VesselProperties::Pointer);
- /**
- * @brief Step Performs a simulation step, in which all subvessels of this VesselTree are expanded.
- *
- * @param volume
- * @param calculateNewPosition
- * @param bendingFactor
- */
- void Step(InSilicoTissueVolume::Pointer volume,
- Vessel::CalculateNewVesselPositionCallback calculateNewPosition,
- double bendingFactor, std::mt19937* rng);
+ /**
+ * @brief Step Performs a simulation step, in which all subvessels of this VesselTree are expanded.
+ *
+ * @param volume
+ * @param calculateNewPosition
+ * @param bendingFactor
+ */
+ void Step(InSilicoTissueVolume::Pointer volume,
+ Vessel::CalculateNewVesselPositionCallback calculateNewPosition,
+ double bendingFactor, std::mt19937* rng);
/**
* @brief IsFinished
* @return true if no subvessel can be expanded.
*/
bool IsFinished();
itkGetConstMacro(CurrentSubvessels, std::vector<Vessel::Pointer>*);
protected:
VesselTree(VesselProperties::Pointer initialProperties);
~VesselTree() override;
private:
std::vector<Vessel::Pointer>* m_CurrentSubvessels;
};
MITKPHOTOACOUSTICSLIB_EXPORT bool Equal(const VesselTree::Pointer leftHandSide, const VesselTree::Pointer rightHandSide, double eps, bool verbose);
}
}
#endif // MITKVESSELSTRUCTURE_H
diff --git a/Modules/PhotoacousticsLib/test/files.cmake b/Modules/PhotoacousticsLib/test/files.cmake
index c6a200ad69..c36e74635f 100644
--- a/Modules/PhotoacousticsLib/test/files.cmake
+++ b/Modules/PhotoacousticsLib/test/files.cmake
@@ -1,40 +1,40 @@
set(MODULE_TESTS
# IMPORTANT: If you plan to deactivate / comment out a test please write a bug number to the commented out line of code.
#
# Example: #mitkMyTest #this test is commented out because of bug 12345
#
# It is important that the bug is open and that the test will be activated again before the bug is closed. This assures that
# no test is forgotten after it was commented out. If there is no bug for your current problem, please add a new one and
# mark it as critical.
################## ON THE FENCE TESTS #################################################
# none
################## DISABLED TESTS #####################################################
# mitkMCThreadHandlerTest.cpp #Timing issue on VMs
# mitkPhotoacousticIOTest.cpp #Not suitable for large scale testing as it performs IO actions.
################# RUNNING TESTS #######################################################
mitkSlicedVolumeGeneratorTest.cpp
mitkPhotoacousticTissueGeneratorTest.cpp
mitkPhotoacousticVectorTest.cpp
mitkPhotoacoustic3dVolumeTest.cpp
mitkPhotoacousticVolumeTest.cpp
mitkPhotoacousticVesselTreeTest.cpp
mitkMcxyzXmlTest.cpp
mitkPhotoacousticComposedVolumeTest.cpp
mitkPhotoacousticNoiseGeneratorTest.cpp
mitkSimulationBatchGeneratorTest.cpp
mitkPropertyCalculatorTest.cpp
- mitkSpectralUnmixingTest.cpp
+ # mitkSpectralUnmixingTest.cpp (See T27024)
mitkPhotoacousticVesselMeanderStrategyTest.cpp
mitkPhotoacousticVesselTest.cpp
)
set(RESOURCE_FILES
pointsource.xml
circlesource.xml
rectanglesource.xml
twopointsources.xml
allsources.xml
)
diff --git a/Modules/PlanarFigure/include/mitkExtrudePlanarFigureFilter.h b/Modules/PlanarFigure/include/mitkExtrudePlanarFigureFilter.h
index bda249af0f..f85e32d4d5 100644
--- a/Modules/PlanarFigure/include/mitkExtrudePlanarFigureFilter.h
+++ b/Modules/PlanarFigure/include/mitkExtrudePlanarFigureFilter.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkExtrudePlanarFigureFilter_h
#define mitkExtrudePlanarFigureFilter_h
#include <MitkPlanarFigureExports.h>
#include <itkProcessObject.h>
#include <mitkCommon.h>
#include <mitkVector.h>
namespace mitk
{
class PlanarFigure;
class Surface;
class MITKPLANARFIGURE_EXPORT ExtrudePlanarFigureFilter : public itk::ProcessObject
{
public:
mitkClassMacroItkParent(ExtrudePlanarFigureFilter, itk::ProcessObject);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkGetMacro(Length, ScalarType);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkGetMacro(Length, ScalarType);
itkSetMacro(Length, ScalarType);
itkGetMacro(NumberOfSegments, unsigned int);
itkSetMacro(NumberOfSegments, unsigned int);
itkGetMacro(TwistAngle, ScalarType);
itkSetMacro(TwistAngle, ScalarType);
itkGetMacro(BendAngle, ScalarType);
itkSetClampMacro(BendAngle, ScalarType, -360, 360);
itkGetMacro(BendDirection, Vector2D);
mitkSetConstReferenceMacro(BendDirection, Vector2D);
itkGetMacro(FlipDirection, bool);
itkSetMacro(FlipDirection, bool);
itkGetMacro(FlipNormals, bool);
itkSetMacro(FlipNormals, bool);
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override;
DataObjectPointer MakeOutput(const DataObjectIdentifierType &name) override;
using Superclass::SetInput;
void SetInput(mitk::PlanarFigure *planarFigure);
using Superclass::GetOutput;
mitk::Surface *GetOutput();
protected:
ExtrudePlanarFigureFilter();
~ExtrudePlanarFigureFilter() override;
void GenerateData() override;
void GenerateOutputInformation() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
private:
ScalarType m_Length;
unsigned int m_NumberOfSegments;
ScalarType m_TwistAngle;
ScalarType m_BendAngle;
Vector2D m_BendDirection;
bool m_FlipDirection;
bool m_FlipNormals;
};
}
#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarAngle.h b/Modules/PlanarFigure/include/mitkPlanarAngle.h
index 5db0957d10..a33eeccc4c 100644
--- a/Modules/PlanarFigure/include/mitkPlanarAngle.h
+++ b/Modules/PlanarFigure/include/mitkPlanarAngle.h
@@ -1,70 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_PLANAR_ANGLE_H_
#define _MITK_PLANAR_ANGLE_H_
#include "mitkPlanarFigure.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure to display an angle
* through three control points
*/
class MITKPLANARFIGURE_EXPORT PlanarAngle : public PlanarFigure
{
public:
mitkClassMacro(PlanarAngle, PlanarFigure);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) public :
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self) public :
// Feature identifiers
const unsigned int FEATURE_ID_ANGLE;
/** \brief Place figure in its minimal configuration (a point at least)
* onto the given 2D geometry.
*
* Must be implemented in sub-classes.
*/
// virtual void Initialize();
/** \brief Angle has 3 control points per definition. */
unsigned int GetMinimumNumberOfControlPoints() const override { return 3; }
/** \brief Angle has 3 control points per definition. */
unsigned int GetMaximumNumberOfControlPoints() const override { return 3; }
bool Equals(const mitk::PlanarFigure &other) const override;
protected:
PlanarAngle();
mitkCloneMacro(Self);
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
/** \brief Calculates feature quantities of the planar figure. */
void EvaluateFeaturesInternal() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
private:
};
} // namespace mitk
#endif //_MITK_PLANAR_ANGLE_H_
diff --git a/Modules/PlanarFigure/include/mitkPlanarArrow.h b/Modules/PlanarFigure/include/mitkPlanarArrow.h
index affb172ad7..4fd9e165eb 100644
--- a/Modules/PlanarFigure/include/mitkPlanarArrow.h
+++ b/Modules/PlanarFigure/include/mitkPlanarArrow.h
@@ -1,80 +1,82 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_PLANAR_ARROW_H_
#define _MITK_PLANAR_ARROW_H_
#include "mitkPlanarFigure.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure representing an arrow
* through two control points
*/
class MITKPLANARFIGURE_EXPORT PlanarArrow : public PlanarFigure
{
public:
mitkClassMacro(PlanarArrow, PlanarFigure);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/** \brief Place figure in its minimal configuration (a point at least)
* onto the given 2D geometry.
*
* Must be implemented in sub-classes.
*/
// virtual void Initialize();
/** \brief Line has 2 control points per definition. */
unsigned int GetMinimumNumberOfControlPoints() const override
{
return 2;
}
/** \brief Line has 2 control points per definition. */
unsigned int GetMaximumNumberOfControlPoints() const override { return 2; }
void SetArrowTipScaleFactor(float scale);
bool Equals(const mitk::PlanarFigure &other) const override;
protected:
PlanarArrow();
mitkCloneMacro(Self);
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
/** \brief Calculates feature quantities of the planar figure. */
void EvaluateFeaturesInternal() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
// Feature identifiers
const unsigned int FEATURE_ID_LENGTH;
// ScaleFactor defining size of helper-lines in relation to display size
float m_ArrowTipScaleFactor;
private:
};
} // namespace mitk
#endif //_MITK_PLANAR_ARROW_H_
diff --git a/Modules/PlanarFigure/include/mitkPlanarBezierCurve.h b/Modules/PlanarFigure/include/mitkPlanarBezierCurve.h
index 4ddff9eb0e..b6a4801051 100644
--- a/Modules/PlanarFigure/include/mitkPlanarBezierCurve.h
+++ b/Modules/PlanarFigure/include/mitkPlanarBezierCurve.h
@@ -1,60 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPlanarBezierCurve_h
#define mitkPlanarBezierCurve_h
#include <MitkPlanarFigureExports.h>
#include <mitkPlanarFigure.h>
namespace mitk
{
class MITKPLANARFIGURE_EXPORT PlanarBezierCurve : public PlanarFigure
{
public:
- mitkClassMacro(PlanarBezierCurve, PlanarFigure) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(PlanarBezierCurve, PlanarFigure);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
unsigned int GetNumberOfSegments() const;
void SetNumberOfSegments(unsigned int numSegments);
/**
* \brief Returns the id of the control-point that corresponds to the given
* polyline-point.
*/
int GetControlPointForPolylinePoint(int indexOfPolylinePoint, int polyLineIndex) const override;
unsigned int GetMaximumNumberOfControlPoints() const override;
unsigned int GetMinimumNumberOfControlPoints() const override;
bool IsHelperToBePainted(unsigned int index) const override;
const unsigned int FEATURE_ID_LENGTH;
bool Equals(const mitk::PlanarFigure &other) const override;
protected:
PlanarBezierCurve();
- mitkCloneMacro(Self)
+ mitkCloneMacro(Self);
void EvaluateFeaturesInternal() override;
void GenerateHelperPolyLine(double, unsigned int) override;
void GeneratePolyLine() override;
private:
Point2D ComputeDeCasteljauPoint(ScalarType t);
std::vector<mitk::Point2D> m_DeCasteljauPoints;
unsigned int m_NumberOfSegments;
};
}
#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarCircle.h b/Modules/PlanarFigure/include/mitkPlanarCircle.h
index d1e56619bf..e51cd66d03 100644
--- a/Modules/PlanarFigure/include/mitkPlanarCircle.h
+++ b/Modules/PlanarFigure/include/mitkPlanarCircle.h
@@ -1,98 +1,100 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_PLANAR_CIRCLE_H_
#define _MITK_PLANAR_CIRCLE_H_
#include "mitkPlanarFigure.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure representing a circle
* through two control points
*/
class MITKPLANARFIGURE_EXPORT PlanarCircle : public PlanarFigure
{
public:
mitkClassMacro(PlanarCircle, PlanarFigure);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/** \brief Place figure in its minimal configuration (a point at least)
* onto the given 2D geometry.
*
* Must be implemented in sub-classes.
*/
// virtual void Initialize();
bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = false) override;
/** \brief Circle has 2 control points per definition. */
unsigned int GetMinimumNumberOfControlPoints() const override { return 2; }
/** \brief Circle has 2 control points per definition. */
unsigned int GetMaximumNumberOfControlPoints() const override { return 2; }
/** \brief Sets the minimum radius
*/
void SetMinimumRadius(double radius) { m_MinRadius = radius; }
/** \brief Gets the minimum radius
*/
double GetMinimumRadius() { return m_MinRadius; }
/** \brief Sets the maximum radius
*/
void SetMaximumRadius(double radius) { m_MaxRadius = radius; }
/** \brief Gets the minimum radius
*/
double GetMaximumRadius() { return m_MaxRadius; }
void ActivateMinMaxRadiusContstraints(bool active) { m_MinMaxRadiusContraintsActive = active; }
bool SetCurrentControlPoint(const Point2D &point) override;
bool Equals(const mitk::PlanarFigure &other) const override;
protected:
PlanarCircle();
mitkCloneMacro(Self);
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
/** \brief Spatially constrain control points of second (orthogonal) line */
Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override;
/** \brief Calculates feature quantities of the planar figure. */
void EvaluateFeaturesInternal() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
// Feature identifiers
const unsigned int FEATURE_ID_RADIUS;
const unsigned int FEATURE_ID_DIAMETER;
const unsigned int FEATURE_ID_AREA;
// Member variables:
double m_MinRadius;
double m_MaxRadius;
bool m_MinMaxRadiusContraintsActive;
private:
};
} // namespace mitk
#endif //_MITK_PLANAR_CIRCLE_H_
diff --git a/Modules/PlanarFigure/include/mitkPlanarCross.h b/Modules/PlanarFigure/include/mitkPlanarCross.h
index 9fe7d0a536..228c9a8082 100644
--- a/Modules/PlanarFigure/include/mitkPlanarCross.h
+++ b/Modules/PlanarFigure/include/mitkPlanarCross.h
@@ -1,112 +1,114 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_PLANAR_CROSS_H_
#define _MITK_PLANAR_CROSS_H_
#include "mitkPlanarFigure.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure modeling a cross with two orthogonal lines
* on a plane.
*
* The cross consists of two two orthogonal lines, which are defined by four control points
* lying on a plane. The two control points of the first line are freely placable within
* the bounds of the underlying 2D geometry, while the two control points of the second line
* are ensured to meet the following constraints:
*
* 1.) The lines must be orthogonal to each other
* 2.) The second line must lie within the 2D area defined by the first line
* 3.) The two lines must intersect (at least with their boundaries)
*
* When placing the second line interactively, a graphical helper polyline is provided to the
* user to indicate the position and orthogonal orientation of the line if it would be placed
* at the current mouse position.
*
* When modifying one of the lines by interactively moving its control points, the respective
* other line is deleted and the user is prompted to draw it again.
*
* The class provide a special mode for drawing single lines (SingleLineModeOn/Off); in this
* case, interaction stops after the first line has been placed.
*
* The class provides the lengths of both lines via the "feature" interface, ordered by size.
*
* \sa PlanarFigureMapper2D
*/
class MITKPLANARFIGURE_EXPORT PlanarCross : public PlanarFigure
{
public:
mitkClassMacro(PlanarCross, PlanarFigure);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/** \brief Indicates whether the PlanarFigure shall represent only a single line instead of an
* orthogonal cross. */
void SetSingleLineMode(bool singleLineMode);
/** \brief Indicates whether the PlanarFigure shall represent only a single line instead of an
* orthogonal cross. */
bool GetSingleLineMode() const;
/** \brief Indicates whether the PlanarFigure shall represent only a single line instead of an
* orthogonal cross. */
itkBooleanMacro(SingleLineMode); // No need to reimplement; calls SetSingleLineMode()
/** \brief PlanarCross has either two or four control points, depending on the operation mode. */
unsigned int GetMinimumNumberOfControlPoints() const override { return this->GetSingleLineMode() ? 2 : 4; }
/** \brief PlanarCross has either two or four control points, depending on the operation mode. */
unsigned int GetMaximumNumberOfControlPoints() const override { return this->GetSingleLineMode() ? 2 : 4; }
/** \brief The cross shall be reset to a single line when a control point is selected. */
bool ResetOnPointSelect() override;
bool ResetOnPointSelectNeeded() const override;
/** \brief Returns the number of features available for this PlanarCross (1 or 2). */
unsigned int GetNumberOfFeatures() const override;
bool Equals(const mitk::PlanarFigure &other) const override;
protected:
PlanarCross();
mitkCloneMacro(Self);
/** \brief Spatially constrain control points of second (orthogonal) line */
Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override;
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
/** \brief Calculates feature quantities of the planar figure. */
void EvaluateFeaturesInternal() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
// Feature identifiers
const unsigned int FEATURE_ID_LONGESTDIAMETER;
const unsigned int FEATURE_ID_SHORTAXISDIAMETER;
private:
/** Internal method for applying spatial constraints. */
virtual Point2D InternalApplyControlPointConstraints(unsigned int index, const Point2D &point);
};
} // namespace mitk
#endif //_MITK_PLANAR_CROSS_H_
diff --git a/Modules/PlanarFigure/include/mitkPlanarDoubleEllipse.h b/Modules/PlanarFigure/include/mitkPlanarDoubleEllipse.h
index 5beca41270..1245cfdb49 100644
--- a/Modules/PlanarFigure/include/mitkPlanarDoubleEllipse.h
+++ b/Modules/PlanarFigure/include/mitkPlanarDoubleEllipse.h
@@ -1,57 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPlanarDoubleEllipse_h
#define mitkPlanarDoubleEllipse_h
#include <MitkPlanarFigureExports.h>
#include <mitkPlanarFigure.h>
namespace mitk
{
class MITKPLANARFIGURE_EXPORT PlanarDoubleEllipse : public PlanarFigure
{
public:
mitkClassMacro(PlanarDoubleEllipse, PlanarFigure);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
unsigned int GetNumberOfSegments() const;
void SetNumberOfSegments(unsigned int numSegments);
unsigned int GetMaximumNumberOfControlPoints() const override;
unsigned int GetMinimumNumberOfControlPoints() const override;
bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = true) override;
const unsigned int FEATURE_ID_MAJOR_AXIS;
const unsigned int FEATURE_ID_MINOR_AXIS;
const unsigned int FEATURE_ID_THICKNESS;
bool Equals(const mitk::PlanarFigure &other) const override;
protected:
PlanarDoubleEllipse();
- mitkCloneMacro(Self)
+ mitkCloneMacro(Self);
mitk::Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override;
void EvaluateFeaturesInternal() override;
void GenerateHelperPolyLine(double, unsigned int) override;
void GeneratePolyLine() override;
private:
unsigned int m_NumberOfSegments;
bool m_ConstrainCircle;
bool m_ConstrainThickness;
};
}
#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarEllipse.h b/Modules/PlanarFigure/include/mitkPlanarEllipse.h
index f3d84c08e9..384653df1b 100644
--- a/Modules/PlanarFigure/include/mitkPlanarEllipse.h
+++ b/Modules/PlanarFigure/include/mitkPlanarEllipse.h
@@ -1,99 +1,99 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_PLANAR_ELLIPSE_H_
#define _MITK_PLANAR_ELLIPSE_H_
#include "mitkPlanarFigure.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure representing a circle
* through two control points
*/
class MITKPLANARFIGURE_EXPORT PlanarEllipse : public PlanarFigure
{
public:
- mitkClassMacro(PlanarEllipse, PlanarFigure)
-
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(PlanarEllipse, PlanarFigure);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** \brief Place figure in its minimal configuration (a point at least)
* onto the given 2D geometry.
*
* Must be implemented in sub-classes.
*/
void PlaceFigure(const Point2D &point) override;
bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = true) override;
/** \brief Ellipse has 3 control points per definition. */
unsigned int GetMinimumNumberOfControlPoints() const override { return 4; }
/** \brief Ellipse has 3 control points per definition. */
unsigned int GetMaximumNumberOfControlPoints() const override { return 4; }
/** \brief Sets the minimum radius
*/
void SetMinimumRadius(double radius) { m_MinRadius = radius; }
/** \brief Gets the minimum radius
*/
double GetMinimumRadius() { return m_MinRadius; }
/** \brief Sets the maximum radius
*/
void SetMaximumRadius(double radius) { m_MaxRadius = radius; }
/** \brief Gets the minimum radius
*/
double GetMaximumRadius() { return m_MaxRadius; }
void ActivateMinMaxRadiusContstraints(bool active) { m_MinMaxRadiusContraintsActive = active; }
/** \brief Treat ellipse as circle (equal radii)
*/
void SetTreatAsCircle(bool active) { m_TreatAsCircle = active; }
bool Equals(const mitk::PlanarFigure &other) const override;
const unsigned int FEATURE_ID_MAJOR_AXIS;
const unsigned int FEATURE_ID_MINOR_AXIS;
const unsigned int FEATURE_ID_AREA;
protected:
PlanarEllipse();
mitkCloneMacro(Self);
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
/** \brief Spatially constrain control points of second (orthogonal) line */
Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override;
/** \brief Calculates feature quantities of the planar figure. */
void EvaluateFeaturesInternal() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
// Member variables:
double m_MinRadius;
double m_MaxRadius;
bool m_MinMaxRadiusContraintsActive;
bool m_TreatAsCircle;
private:
};
} // namespace mitk
#endif //_MITK_PLANAR_ELLIPSE_H_
diff --git a/Modules/PlanarFigure/include/mitkPlanarFigure.h b/Modules/PlanarFigure/include/mitkPlanarFigure.h
index 7420d33bca..a7ecf3483a 100644
--- a/Modules/PlanarFigure/include/mitkPlanarFigure.h
+++ b/Modules/PlanarFigure/include/mitkPlanarFigure.h
@@ -1,378 +1,379 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_PLANAR_FIGURE_H_
#define _MITK_PLANAR_FIGURE_H_
#include "mitkBaseData.h"
#include "mitkCommon.h"
#include <MitkPlanarFigureExports.h>
#include <deque>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Base-class for geometric planar (2D) figures, such as
* lines, circles, rectangles, polygons, etc.
*
* \warning Currently does not support time-resolved data handling
*
* Behavior and appearance of PlanarFigures are controlled by various properties; for a detailed
* list of appearance properties see mitk::PlanarFigureMapper2D
*
* The following properties control general PlanarFigure behavior:
*
* <ul>
* <li>"selected": true if the planar figure is selected
* <li>"planarfigure.ishovering": true if the mouse "hovers" over the planar figure
* <li>"planarfigure.iseditable": true if the planar figure can be edited (otherwise,
* it can only be picked/selected, but its control points cannot be edited); default is true
* <li>"planarfigure.isextendable": true if new control points can be inserted into the list of control points;
* default is false
* </ul>
*
*
* TODO: Implement local 2D transform (including center of rotation...)
*
*/
class MITKPLANARFIGURE_EXPORT PlanarFigure : public BaseData
{
public:
- mitkClassMacro(PlanarFigure, BaseData) itkCloneMacro(Self)
+ mitkClassMacro(PlanarFigure, BaseData);
+ itkCloneMacro(Self);
typedef Point2D PolyLineElement;
typedef itk::VectorContainer<unsigned long, bool> BoolContainerType;
typedef std::deque<Point2D> ControlPointListType;
typedef std::vector<PolyLineElement> PolyLineType;
/** \brief Sets the 2D geometry on which this figure will be placed.
*
* In most cases, this is a Geometry already owned by another object, e.g.
* describing the slice of the image on which measurements will be
* performed.
*/
virtual void SetPlaneGeometry(mitk::PlaneGeometry *geometry);
/** \brief Returns (previously set) 2D geometry of this figure. */
virtual const PlaneGeometry *GetPlaneGeometry() const;
/** \brief True if the planar figure is closed.
*
* Default is false. The "closed" boolean property must be set in sub-classes. */
virtual bool IsClosed() const;
/** \brief True if the planar figure has been placed (and can be
* displayed/interacted with). */
virtual bool IsPlaced() const { return m_FigurePlaced; };
/** \brief Place figure at the given point (in 2D index coordinates) onto
* the given 2D geometry.
*
* By default, the first two control points of the figure are set to the
* passed point. Further points can be set via AddControlPoint(), if the
* current number of control points is below the maximum number of control
* points.
*
* Can be re-implemented in sub-classes as needed.
*/
virtual void PlaceFigure(const Point2D &point);
/**
* \brief Adds / inserts new control-points
*
* This method adds a new control-point with the coordinates defined by point at the given index.
* If 'index' == -1 or index is greater than the number of control-points the new point is appended
* to the back of the list of control points.
* If a control-point already exists for 'index', an additional point is inserted at that position.
* It is not possible to add more points if the maximum number of control-points (GetMaximumNumberOfControlPoints())
* has been reached.
*/
virtual bool AddControlPoint(const Point2D &point, int index = -1);
virtual bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = false);
virtual bool SetCurrentControlPoint(const Point2D &point);
/** \brief Returns the current number of 2D control points defining this figure. */
unsigned int GetNumberOfControlPoints() const;
/** \brief Returns the minimum number of control points needed to represent
* this figure.
*
* Must be implemented in sub-classes.
*/
virtual unsigned int GetMinimumNumberOfControlPoints() const = 0;
/** \brief Returns the maximum number of control points allowed for
* this figure (e.g. 3 for triangles).
*
* Must be implemented in sub-classes.
*/
virtual unsigned int GetMaximumNumberOfControlPoints() const = 0;
/** \brief Selects currently active control points. */
virtual bool SelectControlPoint(unsigned int index);
/** \brief Deselect control point; no control point active. */
virtual bool DeselectControlPoint();
/** \brief Return currently selected control point. */
virtual int GetSelectedControlPoint() const { return m_SelectedControlPoint; }
/** \brief Returns specified control point in 2D world coordinates. */
Point2D GetControlPoint(unsigned int index) const;
/**
* \brief Returns the id of the control-point that corresponds to the given
* polyline-point.
*/
virtual int GetControlPointForPolylinePoint(int indexOfPolylinePoint, int polyLineIndex) const;
/** \brief Returns specified control point in world coordinates. */
Point3D GetWorldControlPoint(unsigned int index) const;
/** \brief Returns the polyline representing the planar figure
* (for rendering, measurements, etc.). */
const PolyLineType GetPolyLine(unsigned int index);
/** \brief Returns the polyline representing the planar figure
* (for rendering, measurments, etc.). */
const PolyLineType GetPolyLine(unsigned int index) const;
/** \brief Returns the polyline that should be drawn the same size at every scale
* (for text, angles, etc.). */
const PolyLineType GetHelperPolyLine(unsigned int index, double mmPerDisplayUnit, unsigned int displayHeight);
/** \brief Sets the position of the PreviewControlPoint. Automatically sets it visible.*/
void SetPreviewControlPoint(const Point2D &point);
/** \brief Marks the PreviewControlPoint as invisible.*/
void ResetPreviewContolPoint();
/** \brief Returns whether or not the PreviewControlPoint is visible.*/
bool IsPreviewControlPointVisible() const;
/** \brief Returns the coordinates of the PreviewControlPoint. */
Point2D GetPreviewControlPoint() const;
/** \brief Returns the number of features available for this PlanarFigure
* (such as, radius, area, ...). */
virtual unsigned int GetNumberOfFeatures() const;
/** \brief Returns the name (identifier) of the specified features. */
const char *GetFeatureName(unsigned int index) const;
/** \brief Returns the physical unit of the specified features. */
const char *GetFeatureUnit(unsigned int index) const;
/** Returns quantity of the specified feature (e.g., length, radius,
* area, ... ) */
double GetQuantity(unsigned int index) const;
/** \brief Returns true if the feature with the specified index exists and
* is active (an inactive feature may e.g. be the area of a non-closed
* polygon. */
bool IsFeatureActive(unsigned int index) const;
/** \brief Returns true if the feature with the specified index exists and is set visible */
bool IsFeatureVisible(unsigned int index) const;
/** \brief Defines if the feature with the specified index will be shown as an
* Annotation in the RenderWindow */
void SetFeatureVisible(unsigned int index, bool visible);
/** \brief Calculates quantities of all features of this planar figure. */
virtual void EvaluateFeatures();
/** \brief Intherited from parent */
void UpdateOutputInformation() override;
/** \brief Intherited from parent */
void SetRequestedRegionToLargestPossibleRegion() override;
/** \brief Intherited from parent */
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
/** \brief Intherited from parent */
bool VerifyRequestedRegion() override;
/** \brief Intherited from parent */
void SetRequestedRegion(const itk::DataObject *data) override;
/** \brief Returns the current number of polylines */
virtual unsigned short GetPolyLinesSize();
/** \brief Returns the current number of helperpolylines */
virtual unsigned short GetHelperPolyLinesSize() const;
/** \brief Returns whether a helper polyline should be painted or not */
virtual bool IsHelperToBePainted(unsigned int index) const;
/** \brief Returns true if the planar figure is reset to "add points" mode
* when a point is selected.
*
* Default return value is false. Subclasses can overwrite this method and
* execute any reset / initialization statements required. */
virtual bool ResetOnPointSelect();
virtual bool ResetOnPointSelectNeeded() const;
/** \brief removes the point with the given index from the list of controlpoints. */
virtual void RemoveControlPoint(unsigned int index);
/** \brief Removes last control point */
virtual void RemoveLastControlPoint();
/** \brief Allow sub-classes to apply constraints on control points.
*
* Sub-classes can define spatial constraints to certain control points by
* overwriting this method and returning a constrained point. By default,
* the points are constrained by the image bounds. */
virtual Point2D ApplyControlPointConstraints(unsigned int /*index*/, const Point2D &point);
/**
* \brief Compare two PlanarFigure objects
* Note: all subclasses have to implement the method on their own.
*/
virtual bool Equals(const mitk::PlanarFigure &other) const;
/** \brief Set the initial number of control points of the planar figure */
void ResetNumberOfControlPoints(int numberOfControlPoints);
protected:
PlanarFigure();
PlanarFigure(const Self &other);
/** Adds feature (e.g., circumference, radius, angle, ...) to feature vector
* of a planar figure object and returns integer ID for the feature element.
* Should be called in sub-class constructors. */
virtual unsigned int AddFeature(const char *featureName, const char *unitName);
/** Sets the name of the specified feature. INTERNAL METHOD. */
void SetFeatureName(unsigned int index, const char *featureName);
/** Sets the physical unit of the specified feature. INTERNAL METHOD. */
void SetFeatureUnit(unsigned int index, const char *unitName);
/** Sets quantity of the specified feature. INTERNAL METHOD. */
void SetQuantity(unsigned int index, double quantity);
/** Sets the specified feature as active. INTERAL METHOD. */
void ActivateFeature(unsigned int index);
/** Sets the specified feature as active. INTERAL METHOD. */
void DeactivateFeature(unsigned int index);
/** \brief Generates the poly-line representation of the planar figure.
* Must be implemented in sub-classes. */
virtual void GeneratePolyLine() = 0;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.
* Must be implemented in sub-classes. */
virtual void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) = 0;
/** \brief Calculates quantities of all features of this planar figure.
* Must be implemented in sub-classes. */
virtual void EvaluateFeaturesInternal() = 0;
/** \brief Initializes the TimeGeometry describing the (time-resolved)
* geometry of this figure. Note that each time step holds one PlaneGeometry.
*/
void InitializeTimeGeometry(unsigned int timeSteps = 1) override;
/** \brief defines the number of PolyLines that will be available */
void SetNumberOfPolyLines(unsigned int numberOfPolyLines);
/** \brief Append a point to the PolyLine # index */
void AppendPointToPolyLine(unsigned int index, PolyLineElement element);
/** \brief clears the list of PolyLines. Call before re-calculating a new Polyline. */
void ClearPolyLines();
/** \brief defines the number of HelperPolyLines that will be available */
void SetNumberOfHelperPolyLines(unsigned int numberOfHelperPolyLines);
/** \brief Append a point to the HelperPolyLine # index */
void AppendPointToHelperPolyLine(unsigned int index, PolyLineElement element);
/** \brief clears the list of HelperPolyLines. Call before re-calculating a new HelperPolyline. */
void ClearHelperPolyLines();
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
ControlPointListType m_ControlPoints;
unsigned int m_NumberOfControlPoints;
// Currently selected control point; -1 means no point selected
int m_SelectedControlPoint;
std::vector<PolyLineType> m_PolyLines;
std::vector<PolyLineType> m_HelperPolyLines;
BoolContainerType::Pointer m_HelperPolyLinesToBePainted;
// this point is used to store the coordiantes an additional 'ControlPoint' that is rendered
// when the mouse cursor is above the figure (and not a control-point) and when the
// property 'planarfigure.isextendable' is set to true
Point2D m_PreviewControlPoint;
bool m_PreviewControlPointVisible;
bool m_FigurePlaced;
private:
// not implemented to prevent PlanarFigure::New() calls which would create an itk::Object.
static Pointer New();
struct Feature
{
Feature(const char *name, const char *unit) : Name(name), Unit(unit), Quantity(0.0), Active(true), Visible(true)
{
}
std::string Name;
std::string Unit;
double Quantity;
bool Active;
bool Visible;
};
itk::LightObject::Pointer InternalClone() const override = 0;
PlaneGeometry *m_PlaneGeometry;
bool m_PolyLineUpToDate;
bool m_HelperLinesUpToDate;
bool m_FeaturesUpToDate;
// Vector of features available for this geometric figure
typedef std::vector<Feature> FeatureVectorType;
FeatureVectorType m_Features;
unsigned long m_FeaturesMTime;
// this pair is used to store the mmInDisplayUnits (m_DisplaySize.first) and the displayHeight
// (m_DisplaySize.second)
// that the helperPolyLines have been calculated for.
// It's used to determine whether or not GetHelperPolyLine() needs to recalculate the HelperPolyLines.
std::pair<double, unsigned int> m_DisplaySize;
};
MITKPLANARFIGURE_EXPORT bool Equal(const mitk::PlanarFigure &leftHandSide,
const mitk::PlanarFigure &rightHandSide,
ScalarType eps,
bool verbose);
} // namespace mitk
#endif //_MITK_PLANAR_FIGURE_H_
diff --git a/Modules/PlanarFigure/include/mitkPlanarFigureControlPointStyleProperty.h b/Modules/PlanarFigure/include/mitkPlanarFigureControlPointStyleProperty.h
index 9950ae3576..0e7a156240 100644
--- a/Modules/PlanarFigure/include/mitkPlanarFigureControlPointStyleProperty.h
+++ b/Modules/PlanarFigure/include/mitkPlanarFigureControlPointStyleProperty.h
@@ -1,82 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPlanarFigureControlPointStyleProperty_h
#define mitkPlanarFigureControlPointStyleProperty_h
#include "mitkEnumerationProperty.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
/**
* \brief Defines the rendering style of control points for PlanarFigure objects.
* \sa mitk::PlanarFigureMapper2D
* @ingroup MitkPlanarFigureModule
*
* Used by PlanarFigureMapper2D to determine which of several control point shapes to use.
* Currently this is basically the choice between squares and circles. If more options
* are implemented, this class should be enhanced.
*
* After construction, the default shape is a square.
*
*/
class MITKPLANARFIGURE_EXPORT PlanarFigureControlPointStyleProperty : public EnumerationProperty
{
public:
mitkClassMacro(PlanarFigureControlPointStyleProperty, EnumerationProperty);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
mitkNewMacro1Param(PlanarFigureControlPointStyleProperty, const IdType &);
mitkNewMacro1Param(PlanarFigureControlPointStyleProperty, const std::string &);
typedef enum { Square, Circle } Shape;
virtual Shape GetShape();
virtual void SetShape(Shape);
protected:
PlanarFigureControlPointStyleProperty();
PlanarFigureControlPointStyleProperty(const IdType &value);
/**
* Constructor. Sets the decoration type to the given value. If it is not
* valid, the representation is set to none
*/
PlanarFigureControlPointStyleProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the standard enumeration types with corresponding strings.
*/
virtual void AddEnumTypes();
private:
// purposely not implemented
PlanarFigureControlPointStyleProperty &operator=(const PlanarFigureControlPointStyleProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
} // end of namespace mitk
#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarFigureInteractor.h b/Modules/PlanarFigure/include/mitkPlanarFigureInteractor.h
index 7c6001084c..69a7cf348b 100644
--- a/Modules/PlanarFigure/include/mitkPlanarFigureInteractor.h
+++ b/Modules/PlanarFigure/include/mitkPlanarFigureInteractor.h
@@ -1,200 +1,201 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPLANARFIGUREINTERACTOR_H_HEADER_INCLUDED
#define MITKPLANARFIGUREINTERACTOR_H_HEADER_INCLUDED
#include <MitkPlanarFigureExports.h>
#include "mitkCommon.h"
#include "mitkDataInteractor.h"
#include "mitkNumericTypes.h"
#pragma GCC visibility push(default)
#include <itkEventObject.h>
#pragma GCC visibility pop
namespace mitk
{
class DataNode;
class PlaneGeometry;
class PlanarFigure;
class PositionEvent;
class BaseRenderer;
class InteractionPositionEvent;
class StateMachineAction;
#pragma GCC visibility push(default)
// Define events for PlanarFigure interaction notifications
itkEventMacro(PlanarFigureEvent, itk::AnyEvent);
itkEventMacro(StartPlacementPlanarFigureEvent, PlanarFigureEvent);
itkEventMacro(EndPlacementPlanarFigureEvent, PlanarFigureEvent);
itkEventMacro(SelectPlanarFigureEvent, PlanarFigureEvent);
itkEventMacro(StartInteractionPlanarFigureEvent, PlanarFigureEvent);
itkEventMacro(EndInteractionPlanarFigureEvent, PlanarFigureEvent);
itkEventMacro(StartHoverPlanarFigureEvent, PlanarFigureEvent);
itkEventMacro(EndHoverPlanarFigureEvent, PlanarFigureEvent);
itkEventMacro(ContextMenuPlanarFigureEvent, PlanarFigureEvent);
#pragma GCC visibility pop
/**
* \brief Interaction with mitk::PlanarFigure objects via control-points
*
* @ingroup MitkPlanarFigureModule
*/
class MITKPLANARFIGURE_EXPORT PlanarFigureInteractor : public DataInteractor
{
public:
mitkClassMacro(PlanarFigureInteractor, DataInteractor);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** \brief Sets the amount of precision */
void SetPrecision(ScalarType precision);
/** \brief Sets the minimal distance between two control points. */
void SetMinimumPointDistance(ScalarType minimumDistance);
protected:
PlanarFigureInteractor();
~PlanarFigureInteractor() override;
void ConnectActionsAndFunctions() override;
//////// Conditions ////////
bool CheckFigurePlaced(const InteractionEvent *interactionEvent);
bool CheckFigureHovering(const InteractionEvent *interactionEvent);
bool CheckControlPointHovering(const InteractionEvent *interactionEvent);
bool CheckSelection(const InteractionEvent *interactionEvent);
bool CheckPointValidity(const InteractionEvent *interactionEvent);
bool CheckFigureFinished(const InteractionEvent *interactionEvent);
bool CheckResetOnPointSelect(const InteractionEvent *interactionEvent);
bool CheckFigureOnRenderingGeometry(const InteractionEvent *interactionEvent);
bool CheckMinimalFigureFinished(const InteractionEvent *interactionEvent);
bool CheckFigureIsExtendable(const InteractionEvent *interactionEvent);
bool CheckFigureIsDeletable(const InteractionEvent *interactionEvent);
bool CheckFigureIsEditable(const InteractionEvent *interactionEvent);
//////// Actions ////////
void FinalizeFigure(StateMachineAction *, InteractionEvent *interactionEvent);
void MoveCurrentPoint(StateMachineAction *, InteractionEvent *interactionEvent);
void DeselectPoint(StateMachineAction *, InteractionEvent *interactionEvent);
void AddPoint(StateMachineAction *, InteractionEvent *interactionEvent);
void AddInitialPoint(StateMachineAction *, InteractionEvent *interactionEvent);
void StartHovering(StateMachineAction *, InteractionEvent *interactionEvent);
void EndHovering(StateMachineAction *, InteractionEvent *interactionEvent);
void DeleteFigure(StateMachineAction *, InteractionEvent *interactionEvent);
void PerformPointResetOnSelect(StateMachineAction *, InteractionEvent *interactionEvent);
void SetPreviewPointPosition(StateMachineAction *, InteractionEvent *interactionEvent);
void HidePreviewPoint(StateMachineAction *, InteractionEvent *interactionEvent);
void HideControlPoints(StateMachineAction *, InteractionEvent *interactionEvent);
void RemoveSelectedPoint(StateMachineAction *, InteractionEvent *interactionEvent);
void RequestContextMenu(StateMachineAction *, InteractionEvent *interactionEvent);
void SelectFigure(StateMachineAction *, InteractionEvent *interactionEvent);
void SelectPoint(StateMachineAction *, InteractionEvent *interactionEvent);
void EndInteraction(StateMachineAction *, InteractionEvent *interactionEvent);
bool FilterEvents(InteractionEvent *interactionEvent, DataNode *) override;
/**
\brief Used when clicking to determine if a point is too close to the previous point.
*/
bool IsMousePositionAcceptableAsNewControlPoint(const mitk::InteractionPositionEvent *positionEvent,
const PlanarFigure *);
bool TransformPositionEventToPoint2D(const InteractionPositionEvent *positionEvent,
const PlaneGeometry *planarFigureGeometry,
Point2D &point2D);
bool TransformObjectToDisplay(const mitk::Point2D &point2D,
mitk::Point2D &displayPoint,
const mitk::PlaneGeometry *objectGeometry,
const mitk::PlaneGeometry *rendererGeometry,
const mitk::BaseRenderer *renderer) const;
/** \brief Returns true if the first specified point is in proximity of the line defined
* the other two point; false otherwise.
*
* Proximity is defined as the rectangle around the line with pre-defined distance
* from the line. */
bool IsPointNearLine(const mitk::Point2D &point,
const mitk::Point2D &startPoint,
const mitk::Point2D &endPoint,
mitk::Point2D &projectedPoint) const;
/** \brief Returns true if the point contained in the passed event (in display coordinates)
* is over the planar figure (with a pre-defined tolerance range); false otherwise. */
int IsPositionOverFigure(const InteractionPositionEvent *positionEvent,
PlanarFigure *planarFigure,
const PlaneGeometry *planarFigureGeometry,
const PlaneGeometry *rendererGeometry,
Point2D &pointProjectedOntoLine) const;
/** \brief Returns the index of the marker (control point) over which the point contained
* in the passed event (in display coordinates) currently is; -1 if the point is not over
* a marker. */
int IsPositionInsideMarker(const InteractionPositionEvent *positionEvent,
const PlanarFigure *planarFigure,
const PlaneGeometry *planarFigureGeometry,
const PlaneGeometry *rendererGeometry,
const BaseRenderer *renderer) const;
void LogPrintPlanarFigureQuantities(const PlanarFigure *planarFigure);
void ConfigurationChanged() override;
private:
/** \brief to store the value of precision to pick a point */
ScalarType m_Precision;
/** \brief Store the minimal distance between two control points. */
ScalarType m_MinimumPointDistance;
/** \brief True if the mouse is currently hovering over the image. */
bool m_IsHovering;
bool m_LastPointWasValid;
// mitk::PlanarFigure::Pointer m_PlanarFigure;
};
}
#endif // MITKPLANARFIGUREINTERACTOR_H_HEADER_INCLUDED
diff --git a/Modules/PlanarFigure/include/mitkPlanarFigureMapper2D.h b/Modules/PlanarFigure/include/mitkPlanarFigureMapper2D.h
index ed3523b79b..4d296330b4 100644
--- a/Modules/PlanarFigure/include/mitkPlanarFigureMapper2D.h
+++ b/Modules/PlanarFigure/include/mitkPlanarFigureMapper2D.h
@@ -1,316 +1,318 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_PLANAR_FIGURE_MAPPER_2D_H_
#define MITK_PLANAR_FIGURE_MAPPER_2D_H_
#include "mitkCommon.h"
#include "mitkMapper.h"
#include "mitkPlanarFigure.h"
#include "mitkPlanarFigureControlPointStyleProperty.h"
#include <MitkPlanarFigureExports.h>
#include "vtkNew.h"
#include "vtkPen.h"
class vtkContext2D;
namespace mitk
{
class BaseRenderer;
class Contour;
/**
* \brief OpenGL-based mapper to render display sub-class instances of mitk::PlanarFigure
*
* The appearance of planar figures can be configured through properties. If no properties are specified,
* default values will be used. There are four elements a planar figure consists of:
*
* <ol>
* <li>"line": the main line segments of the planar figure (note: text is drawn in the same style)
* <li>"helperline": additional line segments of planar figures, such as arrow tips, arches of angles, etc.
* <li>"outline": background which is drawn behind the lines and helperlines of the planar figure (optional)
* <li>"marker": the markers (control points) of a planar figure
* <li>"markerline": the lines by which markers (control points) are surrounded
* </ol>
*
* In the following, all appearance-related planar figure properties are listed:
*
* <ol>
* <li>General properties for the planar figure
* <ul>
* <li>"planarfigure.drawoutline": if true, the "outline" lines is drawn
* <li>"planarfigure.drawquantities": if true, the quantities (text) associated with the planar figure is drawn
* <li>"planarfigure.drawname": if true, the name specified by the dataNode is drawn
* <li>"planarfigure.drawshadow": if true, a black shadow is drawn around the planar figure
* <li>"planarfigure.controlpointshape": style of the control points (enum)
* </ul>
* <li>Line widths of planar figure elements
* <ul>
* <li>"planarfigure.line.width": width of "line" segments (float value, in mm)
* <li>"planarfigure.shadow.widthmodifier": the width of the shadow is defined by width of the "line" * this
* modifier
* <li>"planarfigure.outline.width": width of "outline" segments (float value, in mm)
* <li>"planarfigure.helperline.width": width of "helperline" segments (float value, in mm)
* </ul>
* <li>Color/opacity of planar figure elements in normal mode (unselected)
* <ul>
* <li>"planarfigure.default.line.color"
* <li>"planarfigure.default.line.opacity"
* <li>"planarfigure.default.outline.color"
* <li>"planarfigure.default.outline.opacity"
* <li>"planarfigure.default.helperline.color"
* <li>"planarfigure.default.helperline.opacity"
* <li>"planarfigure.default.markerline.color"
* <li>"planarfigure.default.markerline.opacity"
* <li>"planarfigure.default.marker.color"
* <li>"planarfigure.default.marker.opacity"
* </ul>
* <li>Color/opacity of planar figure elements in hover mode (mouse-over)
* <ul>
* <li>"planarfigure.hover.line.color"
* <li>"planarfigure.hover.line.opacity"
* <li>"planarfigure.hover.outline.color"
* <li>"planarfigure.hover.outline.opacity"
* <li>"planarfigure.hover.helperline.color"
* <li>"planarfigure.hover.helperline.opacity"
* <li>"planarfigure.hover.markerline.color"
* <li>"planarfigure.hover.markerline.opacity"
* <li>"planarfigure.hover.marker.color"
* <li>"planarfigure.hover.marker.opacity"
* </ul>
* <li>Color/opacity of planar figure elements in selected mode
* <ul>
* <li>"planarfigure.selected.line.color"
* <li>"planarfigure.selected.line.opacity"
* <li>"planarfigure.selected.outline.color"
* <li>"planarfigure.selected.outline.opacity"
* <li>"planarfigure.selected.helperline.color"
* <li>"planarfigure.selected.helperline.opacity"
* <li>"planarfigure.selected.markerline.color;"
* <li>"planarfigure.selected.markerline.opacity"
* <li>"planarfigure.selected.marker.color"
* <li>"planarfigure.selected.marker.opacity"
* </ul>
* </ol>
*
* @ingroup MitkPlanarFigureModule
*/
class MITKPLANARFIGURE_EXPORT PlanarFigureMapper2D : public Mapper
{
public:
mitkClassMacro(PlanarFigureMapper2D, Mapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/**
* reimplemented from Baseclass
*/
void MitkRender(mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) override;
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
/** \brief Apply color and opacity properties read from the PropertyList.
* The actor is not used in the GLMappers. Called by mapper subclasses.
*/
void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor *actor = nullptr) override;
protected:
enum PlanarFigureDisplayMode
{
PF_DEFAULT = 0,
PF_HOVER = 1,
PF_SELECTED = 2,
PF_COUNT = 3 // helper variable
};
PlanarFigureMapper2D();
~PlanarFigureMapper2D() override;
/**
* \brief Renders all the lines defined by the PlanarFigure.
*
* This method renders all the lines that are defined by the PlanarFigure.
* That includes the mainlines and helperlines as well as their shadows
* and the outlines.
*
* This method already takes responsibility for the setting of the relevant
* openGL attributes to reduce unnecessary setting of these attributes.
* (e.g. no need to set color twice if it's the same)
*/
void RenderLines(const PlanarFigureDisplayMode lineDisplayMode,
mitk::PlanarFigure *planarFigure,
mitk::Point2D &anchorPoint,
const mitk::PlaneGeometry *planarFigurePlaneGeometry,
const mitk::PlaneGeometry *rendererPlaneGeometry,
const mitk::BaseRenderer *renderer);
/**
* \brief Renders the quantities of the figure below the text annotations.
*/
void RenderQuantities(const mitk::PlanarFigure *planarFigure,
mitk::BaseRenderer *renderer,
const mitk::Point2D anchorPoint,
double &annotationOffset,
float globalOpacity,
const PlanarFigureDisplayMode lineDisplayMode);
/**
* \brief Renders the text annotations.
*/
void RenderAnnotations(mitk::BaseRenderer *renderer,
const std::string name,
const mitk::Point2D anchorPoint,
float globalOpacity,
const PlanarFigureDisplayMode lineDisplayMode,
double &annotationOffset);
/**
* \brief Renders the control-points.
*/
void RenderControlPoints(const mitk::PlanarFigure *planarFigure,
const PlanarFigureDisplayMode lineDisplayMode,
const mitk::PlaneGeometry *planarFigurePlaneGeometry,
const mitk::PlaneGeometry *rendererPlaneGeometry,
mitk::BaseRenderer *renderer);
void TransformObjectToDisplay(const mitk::Point2D &point2D,
mitk::Point2D &displayPoint,
const mitk::PlaneGeometry *objectGeometry,
const mitk::PlaneGeometry *,
const mitk::BaseRenderer *renderer);
void DrawMarker(const mitk::Point2D &point,
float *lineColor,
float lineOpacity,
float *markerColor,
float markerOpacity,
float lineWidth,
PlanarFigureControlPointStyleProperty::Shape shape,
const mitk::PlaneGeometry *objectGeometry,
const mitk::PlaneGeometry *rendererGeometry,
const mitk::BaseRenderer *renderer);
/**
* \brief Actually paints the polyline defined by the figure.
*/
void PaintPolyLine(const mitk::PlanarFigure::PolyLineType vertices,
bool closed,
Point2D &anchorPoint,
const PlaneGeometry *planarFigurePlaneGeometry,
const PlaneGeometry *rendererPlaneGeometry,
const mitk::BaseRenderer *renderer);
/**
* \brief Internally used by RenderLines() to draw the mainlines using
* PaintPolyLine().
*/
void DrawMainLines(mitk::PlanarFigure *figure,
Point2D &anchorPoint,
const PlaneGeometry *planarFigurePlaneGeometry,
const PlaneGeometry *rendererPlaneGeometry,
const mitk::BaseRenderer *renderer);
/**
* \brief Internally used by RenderLines() to draw the helperlines using
* PaintPolyLine().
*/
void DrawHelperLines(mitk::PlanarFigure *figure,
Point2D &anchorPoint,
const PlaneGeometry *planarFigurePlaneGeometry,
const PlaneGeometry *rendererPlaneGeometry,
const mitk::BaseRenderer *renderer);
void InitializeDefaultPlanarFigureProperties();
void InitializePlanarFigurePropertiesFromDataNode(const mitk::DataNode *node);
void SetColorProperty(float property[3][3], PlanarFigureDisplayMode mode, float red, float green, float blue)
{
property[mode][0] = red;
property[mode][1] = green;
property[mode][2] = blue;
}
void SetFloatProperty(float *property, PlanarFigureDisplayMode mode, float value) { property[mode] = value; }
/**
* \brief Callback that sets m_NodeModified to true.
*
* This method set the bool flag m_NodeModified to true. It's a callback
* that is executed when a itk::ModifiedEvet is invoked on our
* DataNode.
*/
void OnNodeModified();
void Initialize(mitk::BaseRenderer *renderer);
private:
bool m_IsSelected;
bool m_IsHovering;
bool m_DrawOutline;
bool m_DrawQuantities;
bool m_DrawShadow;
bool m_DrawControlPoints;
bool m_DrawName;
bool m_DrawDashed;
bool m_DrawHelperDashed;
bool m_AnnotationsShadow;
std::string m_AnnotationFontFamily;
bool m_DrawAnnotationBold;
bool m_DrawAnnotationItalic;
int m_AnnotationSize;
// the width of the shadow is defined as 'm_LineWidth * m_ShadowWidthFactor'
float m_LineWidth;
float m_ShadowWidthFactor;
float m_OutlineWidth;
float m_HelperlineWidth;
// float m_PointWidth;
float m_DevicePixelRatio;
PlanarFigureControlPointStyleProperty::Shape m_ControlPointShape;
float m_LineColor[3][3];
float m_LineOpacity[3];
float m_OutlineColor[3][3];
float m_OutlineOpacity[3];
float m_HelperlineColor[3][3];
float m_HelperlineOpacity[3];
float m_MarkerlineColor[3][3];
float m_MarkerlineOpacity[3];
float m_MarkerColor[3][3];
float m_MarkerOpacity[3];
float m_AnnotationColor[3][3];
// Bool flag that represents whether or not the DataNode has been modified.
bool m_NodeModified;
// Observer-tag for listening to itk::ModifiedEvents on the DataNode
unsigned long m_NodeModifiedObserverTag;
// Bool flag that indicates if a node modified observer was added
bool m_NodeModifiedObserverAdded;
bool m_Initialized;
vtkNew<vtkContext2D> m_Context;
vtkSmartPointer<vtkPen> m_Pen;
};
} // namespace mitk
#endif /* MITK_PLANAR_FIGURE_MAPPER_2D_H_ */
diff --git a/Modules/PlanarFigure/include/mitkPlanarFigureObjectFactory.h b/Modules/PlanarFigure/include/mitkPlanarFigureObjectFactory.h
index 8dc13433cd..d524154b3f 100644
--- a/Modules/PlanarFigure/include/mitkPlanarFigureObjectFactory.h
+++ b/Modules/PlanarFigure/include/mitkPlanarFigureObjectFactory.h
@@ -1,54 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef PLANARFIGUREOBJECTFACTORY_H_INCLUDED
#define PLANARFIGUREOBJECTFACTORY_H_INCLUDED
#include "mitkCoreObjectFactoryBase.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class MITKPLANARFIGURE_EXPORT PlanarFigureObjectFactory : public CoreObjectFactoryBase
{
public:
- mitkClassMacro(PlanarFigureObjectFactory, CoreObjectFactoryBase) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(PlanarFigureObjectFactory, CoreObjectFactoryBase);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
~PlanarFigureObjectFactory() override;
Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
void SetDefaultProperties(mitk::DataNode *node) override;
const char *GetFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap() override;
const char *GetSaveFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap() override;
DEPRECATED(void RegisterIOFactories());
protected:
PlanarFigureObjectFactory();
void CreateFileExtensionsMap();
MultimapType m_FileExtensionsMap;
MultimapType m_SaveFileExtensionsMap;
private:
itk::ObjectFactoryBase::Pointer m_PlanarFigureIOFactory;
itk::ObjectFactoryBase::Pointer m_PlanarFigureWriterFactory;
};
}
#endif // PLANARFIGUREOBJECTFACTORY_H_INCLUDED
diff --git a/Modules/PlanarFigure/include/mitkPlanarFigureReader.h b/Modules/PlanarFigure/include/mitkPlanarFigureReader.h
index d47da18ea8..c565b99055 100644
--- a/Modules/PlanarFigure/include/mitkPlanarFigureReader.h
+++ b/Modules/PlanarFigure/include/mitkPlanarFigureReader.h
@@ -1,146 +1,148 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_PlanarFigureReader__H_
#define _MITK_PlanarFigureReader__H_
#include "mitkFileReader.h"
#include "mitkPlanarFigureSource.h"
#include <MitkPlanarFigureExports.h>
#include <list>
class TiXmlElement;
namespace mitk
{
/**
* @brief reads xml representations of mitk::PlanarFigure from a file
*
* Reader for xml files containing one or multiple xml represenations of
* mitk::PlanarFigure. If multiple mitk::PlanarFigure are stored in one file,
* these are assigned to multiple outputs of the filter.
* @ingroup MitkPlanarFigureModule
*/
class MITKPLANARFIGURE_EXPORT PlanarFigureReader : public PlanarFigureSource, public FileReader
{
public:
mitkClassMacro(PlanarFigureReader, FileReader);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/**
* @brief Sets the filename of the file to be read
* @param _arg the filename of the point set xml-file
*/
itkSetStringMacro(FileName);
/**
* @brief Returns the filename of the point set xml-file.
* @returns the filename of the point set xml-file.
*/
itkGetStringMacro(FileName);
/**
* @warning multiple load not (yet) supported
*/
itkSetStringMacro(FilePrefix);
/**
* @warning multiple load not (yet) supported
*/
itkGetStringMacro(FilePrefix);
/**
* @warning multiple load not (yet) supported
*/
itkSetStringMacro(FilePattern);
/**
* @warning multiple load not (yet) supported
*/
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
/**
* @returns whether the last read attempt was successful or not.
*/
itkGetConstMacro(Success, bool);
protected:
typedef std::list<double> DoubleList;
/**
* Constructor
*/
PlanarFigureReader();
/**
* Virtual destructor
*/
~PlanarFigureReader() override;
/**
* Actually reads the point sets from the given file
*/
void GenerateData() override;
/**
* Does nothing in the current implementation
*/
void GenerateOutputInformation() override;
/**
* Resizes the output-objects according to the given number.
* @param num the new number of output objects.
*/
virtual void ResizeOutputs(const unsigned int &num);
/**
* Checks if the given file has appropriate
* read access.
* @returns true if the file exists and may be read
* or false otherwise.
*/
virtual int CanReadFile(const char *name);
/**
* \brief parses the element for the attributes x,y,z and returns a mitk::Vector3D filled with these values
* \param[in] e the TiXmlElement that will be parsed
* \return returns a mitk::Vector3D with the values x,y,z
*/
mitk::Vector3D GetVectorFromXMLNode(TiXmlElement *e);
/**
* \brief parses the element for the attributes x,y,z and returns a mitk::Point3D filled with these values
* \param[in] e the TiXmlElement that will be parsed
* \return returns a mitk::Point3D with the values x,y,z
*/
mitk::Point3D GetPointFromXMLNode(TiXmlElement *e);
/**
* \brief parses the element for the attributes name0 to nameN, where "name" and the number of attributes
* to read are passed as argument. Returns a list of double vales.
* \param[in] e the TiXmlElement that will be parsed
* \param[in] attributeNameBase the basic name of the parameters
* \param[in] count the number of parameters
* \return returns a mitk::Point3D with the values x,y,z
*/
DoubleList GetDoubleAttributeListFromXMLNode(TiXmlElement *e, const char *attributeNameBase, unsigned int count);
std::string m_FileName;
std::string m_FilePrefix;
std::string m_FilePattern;
bool m_Success;
};
}
#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarFigureSource.h b/Modules/PlanarFigure/include/mitkPlanarFigureSource.h
index 400ec5af79..a37f3d3382 100644
--- a/Modules/PlanarFigure/include/mitkPlanarFigureSource.h
+++ b/Modules/PlanarFigure/include/mitkPlanarFigureSource.h
@@ -1,72 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPlanarFigureSOURCE_H_HEADER_INCLUDED
#define MITKPlanarFigureSOURCE_H_HEADER_INCLUDED
#include "mitkBaseDataSource.h"
#include "mitkCommon.h"
#include "mitkPlanarFigure.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
/**
* @brief Base class for all filters which have an object of type
* mitk::PlanarFigure as output
*
* Base class for all filters which have an object of type mitk::PlanarFigure
* as output. mitk::PlanarFigureSources do not provide support
* for streaming, that is, that the requested region is always the largest
* possible region.
* @ingroup MitkPlanarFigureModule
*/
class MITKPLANARFIGURE_EXPORT PlanarFigureSource : public mitk::BaseDataSource
{
public:
- mitkClassMacro(PlanarFigureSource, BaseDataSource) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(PlanarFigureSource, BaseDataSource);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef mitk::PlanarFigure OutputType;
typedef OutputType::Pointer OutputTypePointer;
typedef itk::DataObject::Pointer DataObjectPointer;
mitkBaseDataSourceGetOutputDeclarations
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer
MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
/**
* Generates the input requested region simply by calling the equivalent
* method of the superclass.
*/
void GenerateInputRequestedRegion() override;
protected:
PlanarFigureSource();
~PlanarFigureSource() override;
};
} // namespace mitk
#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarFigureToPlanarFigureFilter.h b/Modules/PlanarFigure/include/mitkPlanarFigureToPlanarFigureFilter.h
index 3300311ae7..c8f07e551c 100644
--- a/Modules/PlanarFigure/include/mitkPlanarFigureToPlanarFigureFilter.h
+++ b/Modules/PlanarFigure/include/mitkPlanarFigureToPlanarFigureFilter.h
@@ -1,58 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPlanarFigureToPlanarFigureFilter_H_HEADER_INCLUDED
#define MITKPlanarFigureToPlanarFigureFilter_H_HEADER_INCLUDED
#include "mitkCommon.h"
#include "mitkPlanarFigure.h"
#include "mitkPlanarFigureSource.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
/**
* @brief Base class for all filters which have an object of type
* mitk::PlanarFigure as input and output
*
* Base class for all filters which have an object of type mitk::PlanarFigure
* as input and output.
* @ingroup MitkPlanarFigureModule
*/
class MITKPLANARFIGURE_EXPORT PlanarFigureToPlanarFigureFilter : public mitk::PlanarFigureSource
{
public:
mitkClassMacro(PlanarFigureToPlanarFigureFilter, PlanarFigureSource);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef PlanarFigure InputType;
typedef InputType::Pointer InputTypePointer;
typedef itk::DataObject::Pointer DataObjectPointer;
using Superclass::SetInput;
virtual void SetInput(const InputType *figure);
virtual void SetInput(unsigned int idx, const InputType *figure);
virtual const InputType *GetInput();
virtual const InputType *GetInput(unsigned int idx);
virtual void CreateOutputsForAllInputs();
protected:
PlanarFigureToPlanarFigureFilter();
~PlanarFigureToPlanarFigureFilter() override;
};
} // namespace mitk
#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarFigureVtkMapper3D.h b/Modules/PlanarFigure/include/mitkPlanarFigureVtkMapper3D.h
index 4ff8ddfa77..35d2f3c3c3 100644
--- a/Modules/PlanarFigure/include/mitkPlanarFigureVtkMapper3D.h
+++ b/Modules/PlanarFigure/include/mitkPlanarFigureVtkMapper3D.h
@@ -1,63 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPlanarFigureVtkMapper3D_h
#define mitkPlanarFigureVtkMapper3D_h
#include <MitkPlanarFigureExports.h>
#include <mitkVtkMapper.h>
#include <vtkSmartPointer.h>
namespace mitk
{
class MITKPLANARFIGURE_EXPORT PlanarFigureVtkMapper3D : public VtkMapper
{
class LocalStorage
{
public:
LocalStorage();
~LocalStorage();
vtkSmartPointer<vtkActor> m_Actor;
unsigned long m_LastMTime;
private:
LocalStorage(const LocalStorage &);
LocalStorage &operator=(const LocalStorage &);
};
public:
static void SetDefaultProperties(DataNode *, BaseRenderer * = nullptr, bool = false);
mitkClassMacro(PlanarFigureVtkMapper3D, VtkMapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void ApplyColorAndOpacityProperties(BaseRenderer *renderer, vtkActor *actor) override;
void ApplyPlanarFigureProperties(BaseRenderer *renderer, vtkActor *actor);
vtkProp *GetVtkProp(BaseRenderer *renderer) override;
void UpdateVtkTransform(BaseRenderer *) override;
private:
PlanarFigureVtkMapper3D();
~PlanarFigureVtkMapper3D() override;
PlanarFigureVtkMapper3D(const Self &);
Self &operator=(const Self &);
void GenerateDataForRenderer(BaseRenderer *renderer) override;
LocalStorageHandler<LocalStorage> m_LocalStorageHandler;
bool m_FillPf;
};
}
#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarFigureWriter.h b/Modules/PlanarFigure/include/mitkPlanarFigureWriter.h
index b8d1dfc97f..ff4fc6476e 100644
--- a/Modules/PlanarFigure/include/mitkPlanarFigureWriter.h
+++ b/Modules/PlanarFigure/include/mitkPlanarFigureWriter.h
@@ -1,196 +1,198 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_PlanarFigure_WRITER__H_
#define _MITK_PlanarFigure_WRITER__H_
#include <MitkPlanarFigureExports.h>
#include <itkProcessObject.h>
#include <mitkFileWriterWithInformation.h>
#include <mitkPlanarFigure.h>
class TiXmlElement;
namespace mitk
{
/**
* @brief XML-based writer for mitk::PlanarFigures
*
* XML-based writer for mitk::PlanarFigures.
* @ingroup MitkPlanarFigureModule
*/
class MITKPLANARFIGURE_EXPORT PlanarFigureWriter : public mitk::FileWriterWithInformation
{
public:
mitkClassMacro(PlanarFigureWriter, mitk::FileWriter);
mitkWriterMacro;
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
typedef mitk::PlanarFigure InputType;
typedef InputType::Pointer InputTypePointer;
/**
* Sets the filename of the file to write.
* @param FileName the name of the file to write.
*/
itkSetStringMacro(FileName);
/**
* @returns the name of the file to be written to disk.
*/
itkGetStringMacro(FileName);
/**
* @warning multiple write not (yet) supported
*/
itkSetStringMacro(FilePrefix);
/**
* @warning multiple write not (yet) supported
*/
itkGetStringMacro(FilePrefix);
/**
* @warning multiple write not (yet) supported
*/
itkSetStringMacro(FilePattern);
/**
* @warning multiple write not (yet) supported
*/
itkGetStringMacro(FilePattern);
using Superclass::SetInput;
/**
* Sets the 0'th input object for the filter.
* @param input the first input for the filter.
*/
void SetInput(InputType *input);
/**
* Sets the n'th input object for the filter. If num is
* larger than GetNumberOfInputs() the number of inputs is
* resized appropriately.
* @param input the n'th input for the filter.
*/
void SetInput(const unsigned int &num, InputType *input);
/**
* @returns the 0'th input object of the filter.
*/
PlanarFigure *GetInput();
/**
* @param num the index of the desired output object.
* @returns the n'th input object of the filter.
*/
PlanarFigure *GetInput(const unsigned int &num);
/**
* @brief Return the possible file extensions for the data type associated with the writer
*/
std::vector<std::string> GetPossibleFileExtensions() override;
/**
* @brief Return the extension to be added to the filename.
*/
std::string GetFileExtension() override;
/**
* @brief Check if the Writer can write the Content of the
*/
bool CanWriteDataType(DataNode *) override;
/**
* @brief Return the MimeType of the saved File.
*/
std::string GetWritenMIMEType() override;
/**
* @brief Set the DataTreenode as Input. Important: The Writer always have a SetInput-Function.
*/
virtual void SetInput(DataNode *);
std::string GetSupportedBaseData() const override;
/**
* @returns whether the last write attempt was successful or not.
*/
itkGetConstMacro(Success, bool);
const char *GetDefaultFilename() override { return "PlanarFigure.pf"; }
const char *GetFileDialogPattern() override { return "Planar Figure Files (*.pf)"; }
const char *GetDefaultExtension() override { return ".pf"; }
bool CanWriteBaseDataType(BaseData::Pointer data) override
{
return dynamic_cast<mitk::PlanarFigure *>(data.GetPointer());
}
void DoWrite(BaseData::Pointer data) override
{
if (CanWriteBaseDataType(data))
{
this->SetInput(dynamic_cast<mitk::PlanarFigure *>(data.GetPointer()));
this->Update();
}
}
/**
@brief CAUTION: It's up to the user to call this function to release the
memory buffer after use in case the file writer has written to its memory array.
See mitkFileWriter base class. */
void ReleaseMemory() override;
protected:
/**
* Constructor.
*/
PlanarFigureWriter();
/**
* Virtual destructor.
*/
~PlanarFigureWriter() override;
/**
* Writes the a .pf file in xml format that contains all input planar figures
*/
void GenerateData() override;
/**
* Resizes the number of inputs of the writer.
* The inputs are initialized by empty PlanarFigures
* @param num the new number of inputs
*/
virtual void ResizeInputs(const unsigned int &num);
/**Documentation
* \brief creates a TinyXML element that contains x, y, and z values
*
* \param[in] name the name of the XML element
* \param[in] v the vector or point that contains the x, y and z values
* \return returns a TiXmlElement named name and three attributes x, y and z.
*/
TiXmlElement *CreateXMLVectorElement(const char *name, itk::FixedArray<mitk::ScalarType, 3> v);
std::string m_FileName;
std::string m_FilePrefix;
std::string m_FilePattern;
std::string m_Extension;
std::string m_MimeType;
bool m_Success;
};
}
#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarFourPointAngle.h b/Modules/PlanarFigure/include/mitkPlanarFourPointAngle.h
index 7f7d79ec98..a70cda2a97 100644
--- a/Modules/PlanarFigure/include/mitkPlanarFourPointAngle.h
+++ b/Modules/PlanarFigure/include/mitkPlanarFourPointAngle.h
@@ -1,71 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_PLANAR_FOURPOINTANGLE_H_
#define _MITK_PLANAR_FOURPOINTANGLE_H_
#include "mitkPlanarFigure.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure representing a four point
* angle, which is defined by two non-intersecting lines in 2D. Each of those lines
* is defined by two control points.
*/
class MITKPLANARFIGURE_EXPORT PlanarFourPointAngle : public PlanarFigure
{
public:
mitkClassMacro(PlanarFourPointAngle, PlanarFigure);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) public :
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self) public :
// Feature identifiers
const unsigned int FEATURE_ID_ANGLE;
/** \brief Place figure in its minimal configuration (a point at least)
* onto the given 2D geometry.
*
* Must be implemented in sub-classes.
*/
// virtual void Initialize();
/** \brief Four point angle has 4 control points per definition. */
unsigned int GetMinimumNumberOfControlPoints() const override { return 4; }
/** \brief Four point angle has 4 control points per definition. */
unsigned int GetMaximumNumberOfControlPoints() const override { return 4; }
bool Equals(const mitk::PlanarFigure &other) const override;
protected:
PlanarFourPointAngle();
mitkCloneMacro(Self);
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
/** \brief Calculates feature quantities of the planar figure. */
void EvaluateFeaturesInternal() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
private:
};
} // namespace mitk
#endif //_MITK_PLANAR_FOURPOINTANGLE_H_
diff --git a/Modules/PlanarFigure/include/mitkPlanarLine.h b/Modules/PlanarFigure/include/mitkPlanarLine.h
index f867e246b0..8f5bfe2476 100644
--- a/Modules/PlanarFigure/include/mitkPlanarLine.h
+++ b/Modules/PlanarFigure/include/mitkPlanarLine.h
@@ -1,75 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_PLANAR_LINE_H_
#define _MITK_PLANAR_LINE_H_
#include "mitkPlanarFigure.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure representing a line
* through two control points
*/
class MITKPLANARFIGURE_EXPORT PlanarLine : public PlanarFigure
{
public:
mitkClassMacro(PlanarLine, PlanarFigure);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/** \brief Place figure in its minimal configuration (a point at least)
* onto the given 2D geometry.
*
* Must be implemented in sub-classes.
*/
// virtual void Initialize();
/** \brief Line has 2 control points per definition. */
unsigned int GetMinimumNumberOfControlPoints() const override
{
return 2;
}
/** \brief Line has 2 control points per definition. */
unsigned int GetMaximumNumberOfControlPoints() const override { return 2; }
bool Equals(const mitk::PlanarFigure &other) const override;
protected:
PlanarLine();
mitkCloneMacro(Self);
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
/** \brief Calculates feature quantities of the planar figure. */
void EvaluateFeaturesInternal() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
// Feature identifiers
const unsigned int FEATURE_ID_LENGTH;
private:
};
} // namespace mitk
#endif //_MITK_PLANAR_LINE_H_
diff --git a/Modules/PlanarFigure/include/mitkPlanarPolygon.h b/Modules/PlanarFigure/include/mitkPlanarPolygon.h
index 743e6632e3..d9d6df2d73 100644
--- a/Modules/PlanarFigure/include/mitkPlanarPolygon.h
+++ b/Modules/PlanarFigure/include/mitkPlanarPolygon.h
@@ -1,88 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_PLANAR_POLYGON_H_
#define _MITK_PLANAR_POLYGON_H_
#include "mitkPlanarFigure.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure representing a polygon
* with two or more control points
*/
class MITKPLANARFIGURE_EXPORT PlanarPolygon : public PlanarFigure
{
public:
mitkClassMacro(PlanarPolygon, PlanarFigure);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/** \brief Set whether the polygon should be closed between first and last control point or not. */
virtual void SetClosed(bool closed);
itkBooleanMacro(Closed); // Calls SetClosed(); no need to re-implement
/** \brief Place figure in its minimal configuration (a point at least)
* onto the given 2D geometry.
*
* Must be implemented in sub-classes.
*/
// virtual void Initialize();
/** \brief Polygon has 3 control points per definition. */
unsigned int GetMinimumNumberOfControlPoints() const override { return 3; }
/** \brief Polygon maximum number of control points is principally not limited. */
unsigned int GetMaximumNumberOfControlPoints() const override { return 1000; }
std::vector<mitk::Point2D> CheckForLineIntersection(const Point2D &p1, const Point2D &p2) const;
bool Equals(const mitk::PlanarFigure &other) const override;
protected:
PlanarPolygon();
mitkCloneMacro(Self);
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
/** \brief Calculates feature quantities of the planar figure. */
void EvaluateFeaturesInternal() override;
bool CheckForLineIntersection(const mitk::Point2D &p1,
const mitk::Point2D &p2,
const mitk::Point2D &p3,
const mitk::Point2D &p4,
Point2D &intersection) const;
bool CheckForLineIntersection(const mitk::Point2D &p1,
const mitk::Point2D &p2,
const mitk::Point2D &p3,
const mitk::Point2D &p4) const;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
const unsigned int FEATURE_ID_CIRCUMFERENCE;
const unsigned int FEATURE_ID_AREA;
private:
};
} // namespace mitk
#endif //_MITK_PLANAR_POLYGON_H_
diff --git a/Modules/PlanarFigure/include/mitkPlanarRectangle.h b/Modules/PlanarFigure/include/mitkPlanarRectangle.h
index a7aea7f3dd..7b5bb883d7 100644
--- a/Modules/PlanarFigure/include/mitkPlanarRectangle.h
+++ b/Modules/PlanarFigure/include/mitkPlanarRectangle.h
@@ -1,74 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_PLANAR_RECTANGLE_H_
#define _MITK_PLANAR_RECTANGLE_H_
#include "mitkPlanarPolygon.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure representing a polygon
* with two or more control points
*/
class MITKPLANARFIGURE_EXPORT PlanarRectangle : public PlanarFigure
{
public:
mitkClassMacro(PlanarRectangle, PlanarFigure);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/** \brief Place figure in its minimal configuration (a point at least)
* onto the given 2D geometry.
*
* Must be implemented in sub-classes.
*/
// virtual void Initialize();
void PlaceFigure(const Point2D &point) override;
/** \brief Polygon has 2 control points per definition. */
unsigned int GetMinimumNumberOfControlPoints() const override { return 4; }
/** \brief Polygon maximum number of control points is principally not limited. */
unsigned int GetMaximumNumberOfControlPoints() const override { return 4; }
bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = false) override;
protected:
PlanarRectangle();
mitkCloneMacro(Self);
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
/** \brief Calculates feature quantities of the planar figure. */
void EvaluateFeaturesInternal() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
const unsigned int FEATURE_ID_CIRCUMFERENCE;
const unsigned int FEATURE_ID_AREA;
bool Equals(const mitk::PlanarFigure &other) const override;
private:
};
} // namespace mitk
#endif //_MITK_PLANAR_POLYGON_H_
diff --git a/Modules/PlanarFigure/include/mitkPlanarSubdivisionPolygon.h b/Modules/PlanarFigure/include/mitkPlanarSubdivisionPolygon.h
index ef655677e4..f38346a939 100644
--- a/Modules/PlanarFigure/include/mitkPlanarSubdivisionPolygon.h
+++ b/Modules/PlanarFigure/include/mitkPlanarSubdivisionPolygon.h
@@ -1,82 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_PLANAR_SUBDIVISION_POLYGON_H_
#define _MITK_PLANAR_SUBDIVISION_POLYGON_H_
#include "mitkPlanarFigure.h"
#include "mitkPlanarPolygon.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure representing a polygon
* with two or more control points
*/
class MITKPLANARFIGURE_EXPORT PlanarSubdivisionPolygon : public PlanarPolygon
{
public:
mitkClassMacro(PlanarSubdivisionPolygon, PlanarFigure);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/** \brief Subdivision Polygon has 3 control points per definition. */
unsigned int GetMinimumNumberOfControlPoints() const override
{
return 3;
}
/** \brief Polygon maximum number of control points is principally not limited. */
unsigned int GetMaximumNumberOfControlPoints() const override { return 1000; }
/** \brief How many times should we generate a round of subdivisions? */
unsigned int GetSubdivisionRounds() const { return m_SubdivisionRounds; }
void SetSubdivisionRounds(int subdivisionRounds) { m_SubdivisionRounds = subdivisionRounds; }
/**
* \brief Returns the id of the control-point that corresponds to the given
* polyline-point.
*/
int GetControlPointForPolylinePoint(int indexOfPolylinePoint, int polyLineIndex) const override;
/** \brief Parameter w_tension defines the tension.
* the higher w_tension, the lower the "tension" on points.
* Rule: 0 < w_tension < 0.1
* 0.0625 (1 / 16) seems to be a good value.
*/
float GetTensionParameter() const { return m_TensionParameter; }
void SetTensionParameter(float tensionParameter) { m_TensionParameter = tensionParameter; }
std::vector<mitk::Point2D> CheckForLineIntersection(const Point2D &p1, const Point2D &p2) const;
void IncreaseSubdivisions();
void DecreaseSubdivisions();
bool Equals(const mitk::PlanarFigure &other) const override;
protected:
PlanarSubdivisionPolygon();
mitkCloneMacro(Self);
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
float m_TensionParameter;
int m_SubdivisionRounds;
private:
};
} // namespace mitk
#endif //_MITK_PLANAR_SUBDIVISION_POLYGON_H_
diff --git a/Modules/PlanarFigure/src/IO/mitkPlanarFigureSerializer.h b/Modules/PlanarFigure/src/IO/mitkPlanarFigureSerializer.h
index e456a42521..7e91e16463 100644
--- a/Modules/PlanarFigure/src/IO/mitkPlanarFigureSerializer.h
+++ b/Modules/PlanarFigure/src/IO/mitkPlanarFigureSerializer.h
@@ -1,34 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPlanarFigureSerializer_h_included
#define mitkPlanarFigureSerializer_h_included
#include "mitkBaseDataSerializer.h"
namespace mitk
{
/**
\brief Serializes mitk::Surface for mitk::SceneIO
*/
class PlanarFigureSerializer : public BaseDataSerializer
{
public:
- mitkClassMacro(PlanarFigureSerializer, BaseDataSerializer) itkFactorylessNewMacro(Self)
- itkCloneMacro(Self) std::string Serialize() override;
+ mitkClassMacro(PlanarFigureSerializer, BaseDataSerializer);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self) std::string Serialize() override;
protected:
PlanarFigureSerializer();
~PlanarFigureSerializer() override;
};
} // namespace
#endif
diff --git a/Modules/PlanarFigure/src/IO/mitkPlanarFigureWriterFactory.h b/Modules/PlanarFigure/src/IO/mitkPlanarFigureWriterFactory.h
index 9047ecc077..b0f8d30e96 100644
--- a/Modules/PlanarFigure/src/IO/mitkPlanarFigureWriterFactory.h
+++ b/Modules/PlanarFigure/src/IO/mitkPlanarFigureWriterFactory.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef PLANARFIGURE_WRITERFACTORY_H_HEADER_INCLUDED
#define PLANARFIGURE_WRITERFACTORY_H_HEADER_INCLUDED
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"
namespace mitk
{
class PlanarFigureWriterFactory : public itk::ObjectFactoryBase
{
public:
- mitkClassMacroItkParent(mitk::PlanarFigureWriterFactory, itk::ObjectFactoryBase)
+ mitkClassMacroItkParent(mitk::PlanarFigureWriterFactory, itk::ObjectFactoryBase);
/** Class methods used to interface with the registered factories. */
const char *GetITKSourceVersion(void) const override;
const char *GetDescription(void) const override;
/** Method for class instantiation. */
- itkFactorylessNewMacro(Self)
+ itkFactorylessNewMacro(Self);
/**
* Register one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void RegisterOneFactory(void));
/**
* UnRegister one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void UnRegisterOneFactory(void));
protected:
PlanarFigureWriterFactory();
~PlanarFigureWriterFactory() override;
private:
PlanarFigureWriterFactory(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
static itk::ObjectFactoryBase::Pointer GetInstance();
};
} // end namespace mitk
#endif // PLANARFIGURE_WRITERFACTORY_H_HEADER_INCLUDED
diff --git a/Modules/PlanarFigure/test/CMakeLists.txt b/Modules/PlanarFigure/test/CMakeLists.txt
index 55f7454d12..d6f5cf2a16 100644
--- a/Modules/PlanarFigure/test/CMakeLists.txt
+++ b/Modules/PlanarFigure/test/CMakeLists.txt
@@ -1,155 +1,153 @@
MITK_CREATE_MODULE_TESTS()
if(TARGET ${TESTDRIVER})
mitk_use_modules(TARGET ${TESTDRIVER} PACKAGES VTK|vtkTestingRendering)
set(testcaseBasename mitkViewportRenderingTest)
# set verbose to 1 to get a list of all defined test cases during CMake configuration
set(verbose 0)
# viewportTest():
#
# 1. Sets up a scene with a DICOM image, several planar figures, an STL file
# 2. Modifies the viewport of the VTK renderer to only a part of the render window
# 3. Compares the rendering result against an expected version
#
# Parameters determine the size and position of the viewport and the render window
# The expected result is mitkViewportRenderingTest_${testPostfix}.png
#
function(viewportTest
testPostfix # postfix to uniquely identify the test case
rwWidth rwHeight # "rw" = render window
vpLeft vpBottom vpWidth vpHeight # "vp" = viewport
# list of images/files for visualization
)
set(data ${ARGN}) # use all ADDITIONAL parameters after vpHeight as filenames
# transform the input parameters in required test parameters
math(EXPR vpRight "${vpLeft} + ${vpWidth}")
math(EXPR vpTop "${vpBottom} + ${vpHeight}")
#message(STATUS "Testing viewport of ${vpWidth}x${vpHeight} at ${vpLeft},${vpBottom} in render window of size ${rwWidth}x${rwHeight} ('${testPostfix}')")
# add the actual test
mitkAddCustomModuleTest(
mitkViewportRenderingTest_${testPostfix}
mitkViewportRenderingTest
${rwWidth} ${rwHeight}
${vpLeft} ${vpBottom}
${vpRight} ${vpTop}
${data}
-V ${MITK_DATA_DIR}/RenderingTestData/viewport/mitkViewportRenderingTest_${testPostfix}.png #corresponding reference screenshot
)
set_property(TEST mitkViewportRenderingTest_${testPostfix}
PROPERTY RUN_SERIAL TRUE)
endfunction()
function(getFirstCharacter string charVar)
string(SUBSTRING ${string} 0 1 c)
set(${charVar} ${c} PARENT_SCOPE)
endfunction()
# The following lines loop over several variations of aspect ratios for
# - render window
# - a viewport within this render window
# - an input image (defines the input world geometry)
# ---------------------------------------------------------------------
#
# Render window
# - Square
# - Landscape
# - Portrait
#
# Viewport
# - Square
# - Landscape
# - Portrait
#
# World / Image
# - Square
# - Landscape
# - Portrait
#
- if(MITK_ENABLE_RENDERING_TESTING) ### since the rendering test's do not run in ubuntu, yet, we build them only for other systems or if the user explicitly sets the variable MITK_ENABLE_RENDERING_TESTING
foreach(renderWindowAspect Square Landscape Portrait)
foreach(viewportAspect Square Landscape Portrait)
foreach(worldAspect Square Landscape Portrait)
getFirstCharacter(${renderWindowAspect} renderWindowAspectSymbol)
getFirstCharacter(${viewportAspect} viewportAspectSymbol)
getFirstCharacter(${worldAspect} worldAspectSymbol)
# construct test case name from various aspect ratios
set(testCaseShortname "r${renderWindowAspectSymbol}v${viewportAspectSymbol}w${worldAspectSymbol}")
# construct test image name from aspect ratio
set(testImage ${MITK_DATA_DIR}/RenderingTestData/viewport/input_${worldAspect}/SCSFREN.dcm) # nice DICOM name encoding and gray value test image
set(testObjects
${MITK_DATA_DIR}/RenderingTestData/PlanarFigures/Line1.pf
${MITK_DATA_DIR}/RenderingTestData/PlanarFigures/Path1.pf
${MITK_DATA_DIR}/RenderingTestData/PlanarFigures/FourPointAngle1.pf
${MITK_DATA_DIR}/RenderingTestData/PlanarFigures/Rectangle1.pf
${MITK_DATA_DIR}/binary.stl
)
# render window size
if (renderWindowAspect STREQUAL Landscape)
set(renderWindowWidth 600)
else()
set(renderWindowWidth 500)
endif()
if (renderWindowAspect STREQUAL Portrait)
set(renderWindowHeight 600)
else()
set(renderWindowHeight 500)
endif()
# viewport size
if (viewportAspect STREQUAL Landscape)
set(viewportWidth 450)
else()
set(viewportWidth 300)
endif()
if (viewportAspect STREQUAL Portrait)
set(viewportHeight 450)
else()
set(viewportHeight 300)
endif()
# world size
if (worldAspect STREQUAL Portrait)
set(worldWidth 300)
set(worldHeight 420)
elseif (worldAspect STREQUAL Landscape)
set(worldWidth 420)
set(worldHeight 300)
else()
set(worldWidth 512)
set(worldHeight 512)
endif()
# Summary
set(viewportX 30)
set(viewportY 45)
if (verbose)
message(STATUS "(${testCaseShortname}) "
"Render window ${renderWindowAspect} (${renderWindowWidth}x${renderWindowHeight}), "
"Viewport ${viewportAspect} (${viewportWidth}x${viewportHeight}+${viewportX}+${viewportY}), "
"World ${worldAspect} (${worldWidth}x${worldHeight})"
)
endif()
viewPortTest(${testCaseShortname}
${renderWindowWidth} ${renderWindowHeight}
${viewportX} ${viewportY}
${viewportWidth} ${viewportHeight}
${testImage}
${testObjects})
endforeach()
endforeach()
endforeach()
- endif() # endif MITK_ENABLE_RENDERING_TESTING
endif() # endif TARGET ${TESTDRIVER}
diff --git a/Modules/PlanarFigure/test/files.cmake b/Modules/PlanarFigure/test/files.cmake
index 5644cbb13b..7cccdb7726 100644
--- a/Modules/PlanarFigure/test/files.cmake
+++ b/Modules/PlanarFigure/test/files.cmake
@@ -1,18 +1,12 @@
set(MODULE_TESTS
mitkPlanarCrossTest.cpp
mitkPlanarPolygonTest.cpp
mitkPlanarSubdivisionPolygonTest.cpp
mitkPlanarFigureIOTest.cpp
mitkPlanarArrowTest.cpp
+ mitkPlanarFigureInteractionTest.cpp
)
set(MODULE_CUSTOM_TESTS
mitkViewportRenderingTest.cpp
)
-
-if(MITK_ENABLE_RENDERING_TESTING) #since mitkInteractionTestHelper is currently creating a vtkRenderWindow
-set(MODULE_TESTS
- ${MODULE_TESTS}
- mitkPlanarFigureInteractionTest.cpp
-)
-endif()
diff --git a/Modules/QtWidgets/files.cmake b/Modules/QtWidgets/files.cmake
index db1772bbdd..970d05401a 100644
--- a/Modules/QtWidgets/files.cmake
+++ b/Modules/QtWidgets/files.cmake
@@ -1,128 +1,135 @@
file(GLOB_RECURSE H_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/include/*")
set(CPP_FILES
QmitkAbstractDataStorageModel.cpp
QmitkAbstractMultiWidget.cpp
QmitkApplicationCursor.cpp
QmitkDataStorageComboBox.cpp
QmitkDataStorageDefaultListModel.cpp
+ QmitkDataStorageHistoryModel.cpp
QmitkDataStorageListModel.cpp
QmitkDataStorageTableModel.cpp
QmitkDataStorageSimpleTreeModel.cpp
QmitkDataStorageTreeModel.cpp
QmitkDataStorageTreeModelInternalItem.cpp
QmitkDnDDataNodeWidget.cpp
QmitkFileReaderOptionsDialog.cpp
QmitkFileReaderWriterOptionsWidget.cpp
QmitkFileWriterOptionsDialog.cpp
QmitkInteractionSchemeToolBar.cpp
QmitkIOUtil.cpp
QmitkLevelWindowPresetDefinitionDialog.cpp
QmitkLevelWindowRangeChangeDialog.cpp
QmitkLevelWindowWidgetContextMenu.cpp
QmitkLevelWindowWidget.cpp
QmitkLineEditLevelWindowWidget.cpp
QmitkMemoryUsageIndicatorView.cpp
QmitkMouseModeSwitcher.cpp
QmitkMimeTypes.cpp
QmitkMultiWidgetConfigurationToolBar.cpp
QmitkMultiWidgetLayoutManager.cpp
QmitkMultiWidgetLayoutSelectionWidget.cpp
QmitkNodeDescriptor.cpp
QmitkColoredNodeDescriptor.cpp
QmitkNodeDescriptorManager.cpp
QmitkProgressBar.cpp
QmitkPropertiesTableEditor.cpp
QmitkPropertiesTableModel.cpp
QmitkPropertyDelegate.cpp
QmitkRegisterClasses.cpp
QmitkRenderingManager.cpp
QmitkRenderingManagerFactory.cpp
QmitkRenderWindow.cpp
QmitkRenderWindowMenu.cpp
QmitkRenderWindowWidget.cpp
QmitkServiceListWidget.cpp
QmitkSliderLevelWindowWidget.cpp
QmitkStdMultiWidget.cpp
QmitkMxNMultiWidget.cpp
QmitkDataStorageComboBoxWithSelectNone.cpp
QmitkDataStorageFilterProxyModel.cpp
QmitkPropertyItem.cpp
QmitkPropertyItemDelegate.cpp
QmitkPropertyItemModel.cpp
QmitkStyleManager.cpp
QmitkAbstractDataStorageInspector.cpp
+ QmitkDataStorageFavoriteNodesInspector.cpp
QmitkDataStorageListInspector.cpp
QmitkDataStorageTreeInspector.cpp
+ QmitkDataStorageSelectionHistoryInspector.cpp
QmitkModelViewSelectionConnector.cpp
mitkIDataStorageInspectorProvider.cpp
mitkQtWidgetsActivator.cpp
mitkDataStorageInspectorGenerator.cpp
QmitkOverlayWidget.cpp
QmitkNodeDetailsDialog.cpp
)
set(MOC_H_FILES
include/QmitkAbstractDataStorageModel.h
include/QmitkAbstractMultiWidget.h
include/QmitkDataStorageComboBox.h
include/QmitkDataStorageTableModel.h
include/QmitkDataStorageTreeModel.h
include/QmitkDataStorageSimpleTreeModel.h
include/QmitkDataStorageDefaultListModel.h
include/QmitkDnDDataNodeWidget.h
include/QmitkFileReaderOptionsDialog.h
include/QmitkFileReaderWriterOptionsWidget.h
include/QmitkFileWriterOptionsDialog.h
include/QmitkInteractionSchemeToolBar.h
include/QmitkLevelWindowPresetDefinitionDialog.h
include/QmitkLevelWindowRangeChangeDialog.h
include/QmitkLevelWindowWidgetContextMenu.h
include/QmitkLevelWindowWidget.h
include/QmitkLineEditLevelWindowWidget.h
include/QmitkMemoryUsageIndicatorView.h
include/QmitkMouseModeSwitcher.h
include/QmitkMultiWidgetConfigurationToolBar.h
include/QmitkMultiWidgetLayoutManager.h
include/QmitkMultiWidgetLayoutSelectionWidget.h
include/QmitkNodeDescriptor.h
include/QmitkColoredNodeDescriptor.h
include/QmitkNodeDescriptorManager.h
include/QmitkProgressBar.h
include/QmitkPropertiesTableEditor.h
include/QmitkPropertyDelegate.h
include/QmitkRenderingManager.h
include/QmitkRenderWindow.h
include/QmitkRenderWindowMenu.h
include/QmitkRenderWindowWidget.h
include/QmitkServiceListWidget.h
include/QmitkSliderLevelWindowWidget.h
include/QmitkStdMultiWidget.h
include/QmitkMxNMultiWidget.h
include/QmitkDataStorageComboBoxWithSelectNone.h
include/QmitkPropertyItemDelegate.h
include/QmitkPropertyItemModel.h
- include/QmitkDataStorageListInspector.h
include/QmitkAbstractDataStorageInspector.h
+ include/QmitkDataStorageFavoriteNodesInspector.h
+ include/QmitkDataStorageListInspector.h
include/QmitkDataStorageTreeInspector.h
+ include/QmitkDataStorageHistoryModel.h
+ include/QmitkDataStorageSelectionHistoryInspector.h
include/QmitkModelViewSelectionConnector.h
include/QmitkOverlayWidget.h
include/QmitkNodeDetailsDialog.h
)
set(UI_FILES
src/QmitkFileReaderOptionsDialog.ui
src/QmitkFileWriterOptionsDialog.ui
src/QmitkLevelWindowPresetDefinition.ui
src/QmitkLevelWindowWidget.ui
src/QmitkLevelWindowRangeChange.ui
src/QmitkMemoryUsageIndicator.ui
src/QmitkMultiWidgetLayoutSelectionWidget.ui
src/QmitkServiceListWidgetControls.ui
src/QmitkDataStorageListInspector.ui
src/QmitkDataStorageTreeInspector.ui
+ src/QmitkDataStorageSelectionHistoryInspector.ui
)
set(QRC_FILES
resource/Qmitk.qrc
)
diff --git a/Modules/QtWidgets/include/QmitkAbstractDataStorageInspector.h b/Modules/QtWidgets/include/QmitkAbstractDataStorageInspector.h
index 9c2100f766..1f0fc6c9e3 100644
--- a/Modules/QtWidgets/include/QmitkAbstractDataStorageInspector.h
+++ b/Modules/QtWidgets/include/QmitkAbstractDataStorageInspector.h
@@ -1,127 +1,129 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QMITKABSTRACTDATASTORAGEINSPECTOR_H
#define QMITKABSTRACTDATASTORAGEINSPECTOR_H
#include <QmitkModelViewSelectionConnector.h>
#include <MitkQtWidgetsExports.h>
// mitk core
#include <mitkDataStorage.h>
#include <mitkNodePredicateBase.h>
// qt
#include <QWidget>
class QAbstractItemVew;
/**
-* @brief This abstract class is a convinient base class for easy implementation of widgets that
+* @brief This abstract class is a convenient base class for easy implementation of widgets that
* offer a specific view onto a given DataStorage instance to inspect its contents.
* One may also get the selection in this inspector of the data storage.
*/
class MITKQTWIDGETS_EXPORT QmitkAbstractDataStorageInspector : public QWidget
{
Q_OBJECT
public:
+
~QmitkAbstractDataStorageInspector() override;
/**
* @brief Sets the data storage that will be used /monitored by the widget.
*
* @param dataStorage A pointer to the data storage to set.
*/
void SetDataStorage(mitk::DataStorage* dataStorage);
/**
* @brief Sets the node predicate and updates the widget, according to the node predicate.
*
* @param nodePredicate A pointer to node predicate.
*/
virtual void SetNodePredicate(mitk::NodePredicateBase* nodePredicate);
mitk::NodePredicateBase* GetNodePredicate() const;
using NodeList = QList<mitk::DataNode::Pointer>;
/** Returns the list of currently selected nodes.*/
NodeList GetSelectedNodes() const;
/** Returns an pointer to the view that is used in the inspector to show the content.*/
virtual QAbstractItemView* GetView() = 0;
virtual const QAbstractItemView* GetView() const = 0;
/** Returns the setting of the internal connector. It can be changed by SetSelectOnlyVisibleNodes()*/
bool GetSelectOnlyVisibleNodes() const;
using SelectionMode = QAbstractItemView::SelectionMode;
+
/** Sets the selection mode of the inspector.*/
virtual void SetSelectionMode(SelectionMode mode) = 0;
virtual SelectionMode GetSelectionMode() const = 0;
Q_SIGNALS:
/**
* @brief A signal that will be emitted if the selected node has changed.
*
* @param nodes A list of data nodes that are newly selected.
*/
void CurrentSelectionChanged(NodeList nodes);
public Q_SLOTS:
/**
* @brief Change the selection modus of the item view's selection model.
*
* If true, an incoming selection will be filtered (reduced) to only those nodes that are visible by the current view.
* An outgoing selection can then at most contain the filtered nodes.
* If false, the incoming non-visible selection will be stored and later added to the outgoing selection,
* to include the original selection that could not be modified.
* The part of the original selection, that is non-visible are the nodes that are not
*
* @param selectOnlyVisibleNodes The bool value to define the selection modus.
*/
void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes);
/**
* @brief Transform a list of data nodes into a model selection and set this as a new selection of the
* selection model of the private member item view.
*
* The function filters the given list of nodes according to the 'm_SelectOnlyVisibleNodes' member variable. If
* necessary, the non-visible nodes are stored. This is done if 'm_SelectOnlyVisibleNodes' is false: In this case
* the selection may be filtered and only a subset of the selected nodes may be visible and therefore (de-)selectable
* in the data storage viewer. By storing the non-visible nodes it is possible to send the new, modified selection
* but also include the selected nodes from the original selection that could not be modified (see 'SetSelectOnlyVisibleNodes').
*
* @param nodes A list of data nodes that should be newly selected.
*/
void SetCurrentSelection(NodeList selectedNodes);
protected Q_SLOTS:
void OnSelectionChanged(NodeList selectedNodes);
protected:
/** Helper function is called if data storage or predicate is changed to (re) initialize the widget correctly.
Implement the function in derived classes.*/
virtual void Initialize() = 0;
mitk::WeakPointer<mitk::DataStorage> m_DataStorage;
mitk::NodePredicateBase::Pointer m_NodePredicate;
std::unique_ptr<QmitkModelViewSelectionConnector> m_Connector;
QmitkAbstractDataStorageInspector(QWidget* parent = nullptr);
};
#endif // QMITKABSTRACTDATASTORAGEMODEL_H
diff --git a/Modules/QtWidgets/include/QmitkDataStorageDefaultListModel.h b/Modules/QtWidgets/include/QmitkDataStorageDefaultListModel.h
index 2de2f0a400..100af89c77 100644
--- a/Modules/QtWidgets/include/QmitkDataStorageDefaultListModel.h
+++ b/Modules/QtWidgets/include/QmitkDataStorageDefaultListModel.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QMITKDATASTORAGEDEFAULTLISTMODEL_H
#define QMITKDATASTORAGEDEFAULTLISTMODEL_H
#include <MitkQtWidgetsExports.h>
// qt widgets module
#include <QmitkAbstractDataStorageModel.h>
/**
* @brief The 'QmitkDataStorageDefaultListModel' is a basic list model, derived from the 'QmitkAbstractDataStorageModel'.
* It provides functions to accept a data storage and a node predicate in order to customize the model data nodes.
* Furthermore it overrides the functions of 'QAbstractItemModel' to create a simple qt list model.
* This model can be used in conjunction with a 'QmitkDataStorageSelectionConnector'.
*/
class MITKQTWIDGETS_EXPORT QmitkDataStorageDefaultListModel : public QmitkAbstractDataStorageModel
{
Q_OBJECT
public:
QmitkDataStorageDefaultListModel(QObject *parent);
// override from 'QmitkAbstractDataStorageModel'
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void DataStorageChanged() override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodePredicateChanged() override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeAdded(const mitk::DataNode* node) override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeChanged(const mitk::DataNode* node) override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeRemoved(const mitk::DataNode* node) override;
// override pure virtual from 'QAbstractItemModel'
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex &child) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
// override for customization
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
-private:
+protected:
- void UpdateModelData();
+ virtual void UpdateModelData();
std::vector<mitk::DataNode::Pointer> m_DataNodes;
};
#endif // QMITKDATASTORAGEDEFAULTLISTMODEL_H
diff --git a/Modules/QtWidgets/include/QmitkDataStorageFavoriteNodesInspector.h b/Modules/QtWidgets/include/QmitkDataStorageFavoriteNodesInspector.h
new file mode 100644
index 0000000000..53a1c49a4f
--- /dev/null
+++ b/Modules/QtWidgets/include/QmitkDataStorageFavoriteNodesInspector.h
@@ -0,0 +1,53 @@
+/*============================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center (DKFZ)
+All rights reserved.
+
+Use of this source code is governed by a 3-clause BSD license that can be
+found in the LICENSE file.
+
+============================================================================*/
+
+#ifndef QMITKDATASTORAGEFAVORITENODESINSPECTOR_H
+#define QMITKDATASTORAGEFAVORITENODESINSPECTOR_H
+
+#include <MitkQtWidgetsExports.h>
+
+#include <QmitkDataStorageListInspector.h>
+
+#include "mitkNodePredicateProperty.h"
+
+/*
+* @brief This is an inspector that offers a simple list view on favorite nodes of a data storage.
+*/
+class MITKQTWIDGETS_EXPORT QmitkDataStorageFavoriteNodesInspector : public QmitkDataStorageListInspector
+{
+ Q_OBJECT
+
+public:
+
+ QmitkDataStorageFavoriteNodesInspector(QWidget* parent = nullptr);
+
+ /**
+ * @brief Overrides the corresponding function of QmitkAbstractDataStorageInspector:
+ * The custom favorite nodes predicate is added to the parameter predicate
+ * which results in a combined node predicate that always filters nodes according
+ * to their favorite-property-state.
+ *
+ * @param nodePredicate A pointer to a node predicate.
+ */
+ void SetNodePredicate(mitk::NodePredicateBase* nodePredicate) override;
+
+protected Q_SLOTS:
+
+ void OnFavoriteNodesButtonClicked();
+
+private:
+
+ mitk::NodePredicateProperty::Pointer m_FavoriteNodeSelectionPredicate;
+
+};
+
+#endif // QMITKDATASTORAGEFAVORITENODESINSPECTOR_H
diff --git a/Modules/QtWidgets/include/QmitkDataStorageHistoryModel.h b/Modules/QtWidgets/include/QmitkDataStorageHistoryModel.h
new file mode 100644
index 0000000000..8e77a6d8f5
--- /dev/null
+++ b/Modules/QtWidgets/include/QmitkDataStorageHistoryModel.h
@@ -0,0 +1,48 @@
+/*============================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center (DKFZ)
+All rights reserved.
+
+Use of this source code is governed by a 3-clause BSD license that can be
+found in the LICENSE file.
+
+============================================================================*/
+
+#ifndef QMITKDATASTORAGEHISTORYMODEL_H
+#define QMITKDATASTORAGEHISTORYMODEL_H
+
+#include <MitkQtWidgetsExports.h>
+
+#include <QmitkDataStorageDefaultListModel.h>
+
+/**
+* @brief Internal DataStorage model to represent the history of node selections.
+*
+* The model will present all nodes in the history under the following conditions
+* - the nodes are sorted by selection time (lifo -> last is first)
+* - node must be in the storage
+* - node must be valid
+* - node will only be in the history once.
+*
+*/
+
+class MITKQTWIDGETS_EXPORT QmitkDataStorageHistoryModel : public QmitkDataStorageDefaultListModel
+{
+ Q_OBJECT
+
+public:
+
+ QmitkDataStorageHistoryModel(QObject *parent);
+
+ /** Adds the passed node to the history. If the node is already in the history, old instances will be removed.
+ If the passed node is nullptr, it will be ignored.*/
+ static void AddNodeToHistory(mitk::DataNode* node);
+ static void ResetHistory();
+
+protected:
+ void UpdateModelData() override;
+};
+
+#endif // QMITKDATASTORAGEHISTORYMODEL_H
diff --git a/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.h b/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.h
index 65ffd67736..44c32549e4 100644
--- a/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.h
+++ b/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.h
@@ -1,75 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __QMITK_DATA_STORAGE_INSPECTOR_PROVIDER_BASE_H
#define __QMITK_DATA_STORAGE_INSPECTOR_PROVIDER_BASE_H
#include <memory>
// Microservices
#include <usGetModuleContext.h>
#include <usServiceProperties.h>
#include <usServiceRegistration.h>
// MITK
#include <mitkIDataStorageInspectorProvider.h>
/**
* @brief Base class for DataStorage inspector provider.
+ *
+ * This class is the default implementation for a inspector provider. You can template it with
+ * the respective inspector class to directly use it.
*/
template <class TInspector>
class QmitkDataStorageInspectorProviderBase : public mitk::IDataStorageInspectorProvider
{
public:
QmitkAbstractDataStorageInspector* CreateInspector() const override;
std::string GetInspectorID() const override;
std::string GetInspectorDisplayName() const override;
std::string GetInspectorDescription() const override;
us::ServiceRegistration<mitk::IDataStorageInspectorProvider> RegisterService(
us::ModuleContext *context = us::GetModuleContext());
void UnregisterService();
QmitkDataStorageInspectorProviderBase(const std::string& id);
QmitkDataStorageInspectorProviderBase(const std::string& id, const std::string& displayName, const std::string& desc= "" );
~QmitkDataStorageInspectorProviderBase() override;
protected:
QmitkDataStorageInspectorProviderBase(const QmitkDataStorageInspectorProviderBase &other);
QmitkDataStorageInspectorProviderBase &operator=(const QmitkDataStorageInspectorProviderBase &other) = delete;
virtual us::ServiceProperties GetServiceProperties() const;
/**
* \brief Set the service ranking for this file reader.
*
* Default is zero and should only be chosen differently for a reason.
* The ranking is used to determine which provider to use if several
* equivalent providers have been found.
* It may be used to replace a default provider from MITK in your own project.
*/
void SetRanking(int ranking);
int GetRanking() const;
private:
class Impl;
std::unique_ptr<Impl> d;
};
#ifndef ITK_MANUAL_INSTANTIATION
#include "QmitkDataStorageInspectorProviderBase.tpp"
#endif
#endif /* __QMITK_DATA_STORAGE_INSPECTOR_PROVIDER_BASE_H */
diff --git a/Modules/QtWidgets/include/QmitkDataStorageSelectionHistoryInspector.h b/Modules/QtWidgets/include/QmitkDataStorageSelectionHistoryInspector.h
new file mode 100644
index 0000000000..80ba29e334
--- /dev/null
+++ b/Modules/QtWidgets/include/QmitkDataStorageSelectionHistoryInspector.h
@@ -0,0 +1,49 @@
+/*============================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center (DKFZ)
+All rights reserved.
+
+Use of this source code is governed by a 3-clause BSD license that can be
+found in the LICENSE file.
+
+============================================================================*/
+
+#ifndef QMITKDATASTORAGESELECTIONHISTORYINSPECTOR_H
+#define QMITKDATASTORAGESELECTIONHISTORYINSPECTOR_H
+
+#include <MitkQtWidgetsExports.h>
+
+#include <QmitkAbstractDataStorageInspector.h>
+#include <QSortFilterProxyModel>
+
+#include "ui_QmitkDataStorageSelectionHistoryInspector.h"
+
+/*
+* @brief This is an inspector that offers a simple list view on the last selected nodes (in chronologic order) in a data storage.
+*/
+class MITKQTWIDGETS_EXPORT QmitkDataStorageSelectionHistoryInspector : public QmitkAbstractDataStorageInspector
+{
+ Q_OBJECT
+
+public:
+ QmitkDataStorageSelectionHistoryInspector(QWidget* parent = nullptr);
+
+ QAbstractItemView* GetView() override;
+ const QAbstractItemView* GetView() const override;
+
+ void SetSelectionMode(SelectionMode mode) override;
+ SelectionMode GetSelectionMode() const override;
+
+ static void AddNodeToHistory(mitk::DataNode* node);
+ static void ResetHistory();
+
+protected:
+ void Initialize() override;
+
+ QmitkAbstractDataStorageModel* m_StorageModel;
+ Ui_QmitkDataStorageSelectionHistoryInspector m_Controls;
+};
+
+#endif // QMITKDATASTORAGESELECTIONHISTORYINSPECTOR_H
diff --git a/Modules/QtWidgets/include/QmitkModelViewSelectionConnector.h b/Modules/QtWidgets/include/QmitkModelViewSelectionConnector.h
index 08ba039adc..8a502c8f93 100644
--- a/Modules/QtWidgets/include/QmitkModelViewSelectionConnector.h
+++ b/Modules/QtWidgets/include/QmitkModelViewSelectionConnector.h
@@ -1,151 +1,152 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QMITKMODELVIEWSELECTIONCONNECTOR_H
#define QMITKMODELVIEWSELECTIONCONNECTOR_H
#include <MitkQtWidgetsExports.h>
// qt widgets module
#include <QmitkAbstractDataStorageModel.h>
// qt
#include <QAbstractItemView>
/**
-* @brief The 'QmitkModelViewSelectionConnector' is used to handle the selections of a model-view-pair.
+* @brief The 'QmitkModelViewSelectionConnector' is used to handle the selections of a model-view-pair and to synchornize them with external node selections
+* (e.g. communicated by the application).
*
-* The class accepts a view and a model, which are used to react to selection changes. This class is able to propagate selection changes
+* The class accepts a view and its model, which are used to react to selection changes. This class is able to propagate selection changes
* to and receive from its surrounding class.
*
* The model-view-pair can be added as a selection listener to a selection service. This should be done by using 'AddPostSelectionListener'
* with the existing selection service of the surrounding 'QmitkAbstractView'.
* The model-view-pair can be set as a selection provider. This should be done by using 'SetAsSelectionProvider' with the existing
* selection provider of the surrounding 'QmitkAbstractView'.
*
* The 'QmitkModelViewSelectionConnector' offers a public slot and signal that can be used to set / propagate the selected
* nodes in the current view:
* The 'SetCurrentSelection'-slot finds the indices of the given selected nodes in its internal data storage model and
* changes the selection of the internal data storage model accordingly.
* The 'CurrentSelectionChanged'-signal sends a list of selected nodes to its environment.
* The 'CurrentSelectionChanged'-signal is emitted by the 'ChangeModelSelection'-function, which transforms the internal item view's
* selection into a data node list. The 'ChangeModelSelection'-function is called whenever the selection of the item view's
* selection model changes.
*/
class MITKQTWIDGETS_EXPORT QmitkModelViewSelectionConnector : public QObject
{
Q_OBJECT
public:
QmitkModelViewSelectionConnector();
/**
* @brief Set the view whose selection model is used to propagate or receive selection changes. Use the view's data model
* to transform selected nodes into model indexes and vice versa.
*
* @pre The view's data model needs to be a 'QmitkAbstractDataStorageModel'. If so, the data model is received from
* the view and stored as a private member.
* The data model must return 'mitk::DataNode::Pointer' objects for model indexes if the role is 'QmitkDataNodeRole'.
* @throw mitk::Exception, if the view is invalid or the view's data model is not a valid 'QmitkAbstractDataStorageModel'.
*
* @param view The view to set.
*/
void SetView(QAbstractItemView* view);
/**
* @brief Retrieve the currently selected nodes (equals the last CurrentSelectionChanged values).
*/
QList<mitk::DataNode::Pointer> GetSelectedNodes() const;
bool GetSelectOnlyVisibleNodes() const;
Q_SIGNALS:
/**
* @brief A signal that will be emitted by the 'ChangeModelSelection'-function. This happens if the selection model
* of the private member item view has changed.
*
* @param nodes A list of data nodes that are newly selected.
*/
void CurrentSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
public Q_SLOTS:
/**
* @brief Change the selection mode of the item view's selection model.
*
* If true, an incoming selection will be filtered (reduced) to only those nodes that are visible to the current view.
* An outgoing selection can then at most contain the filtered nodes.
* If false, the incoming non-visible selection will be stored and later added to the outgoing selection,
* to include the part of the original selection that was not visible.
* The part of the original selection, that is non-visible are the nodes that do not met the predicate of the
* associated QmitkAbstractDataStorageModel.
*
* @param selectOnlyVisibleNodes The bool value to define the selection modus.
*/
void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes);
/**
* @brief Transform a list of data nodes into a model selection and set this as a new selection of the
* selection model of the private member item view.
*
* The function filters the given list of nodes according to the 'm_SelectOnlyVisibleNodes' member variable. If
* necessary, the non-visible nodes are stored. This is done if 'm_SelectOnlyVisibleNodes' is false: In this case
* the selection may be filtered and only a subset of the selected nodes may be visible and therefore (de-)selectable
* in the data storage viewer. By storing the non-visible nodes it is possible to send the new, modified selection
* but also include the selected nodes from the original selection that could not be modified (see 'SetSelectOnlyVisibleNodes').
*
* @param nodes A list of data nodes that should be newly selected.
*/
void SetCurrentSelection(QList<mitk::DataNode::Pointer> selectedNodes);
private Q_SLOTS:
/**
* @brief Transform a model selection into a data node list and emit the 'CurrentSelectionChanged'-signal.
*
* The function adds the selected nodes from the original selection that could not be modified, if
* 'm_SelectOnlyVisibleNodes' is false.
* This slot is internally connected to the 'selectionChanged'-signal of the selection model of the private member item view.
*
* @param selected The newly selected items.
* @param deselected The newly deselected items.
*/
void ChangeModelSelection(const QItemSelection& selected, const QItemSelection& deselected);
private:
QmitkAbstractDataStorageModel* m_Model;
QAbstractItemView* m_View;
bool m_SelectOnlyVisibleNodes;
QList<mitk::DataNode::Pointer> m_NonVisibleSelection;
/*
* @brief Retrieve the currently selected nodes from the selection model of the private member item view by
* transforming the selection indexes into a data node list.
*
* In order to transform the indices into data nodes, the private data storage model must return
* 'mitk::DataNode::Pointer' objects for model indexes if the role is QmitkDataNodeRole.
*/
QList<mitk::DataNode::Pointer> GetInternalSelectedNodes() const;
/*
* @brief Filter the list of given nodes such that only those nodes are used that are valid
* when using the data storage model's node predicate.
* If no node predicate was set or the data storage model is invalid, the input list
* of given nodes is returned.
*/
QList<mitk::DataNode::Pointer> FilterNodeList(const QList<mitk::DataNode::Pointer>& nodes) const;
};
/*
* @brief Return true, if the nodes in the list of two given selections are equal (Sorting is ignored. Any permutation is valid.)*/
bool MITKQTWIDGETS_EXPORT EqualNodeSelections(const QList<mitk::DataNode::Pointer>& selection1, const QList<mitk::DataNode::Pointer>& selection2);
#endif // QMITKMODELVIEWSELECTIONCONNECTOR_H
diff --git a/Modules/QtWidgets/src/QmitkDataStorageDefaultListModel.cpp b/Modules/QtWidgets/src/QmitkDataStorageDefaultListModel.cpp
index 66b4b31d54..e73950da81 100644
--- a/Modules/QtWidgets/src/QmitkDataStorageDefaultListModel.cpp
+++ b/Modules/QtWidgets/src/QmitkDataStorageDefaultListModel.cpp
@@ -1,168 +1,178 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include <QmitkDataStorageDefaultListModel.h>
// qt widgets module
#include "QmitkCustomVariants.h"
#include "QmitkEnums.h"
#include "QmitkNodeDescriptorManager.h"
QmitkDataStorageDefaultListModel::QmitkDataStorageDefaultListModel(QObject *parent) : QmitkAbstractDataStorageModel(parent)
{
}
void QmitkDataStorageDefaultListModel::DataStorageChanged()
{
UpdateModelData();
}
void QmitkDataStorageDefaultListModel::NodePredicateChanged()
{
UpdateModelData();
}
void QmitkDataStorageDefaultListModel::NodeAdded(const mitk::DataNode* /*node*/)
{
UpdateModelData();
}
-void QmitkDataStorageDefaultListModel::NodeChanged(const mitk::DataNode* /*node*/)
+void QmitkDataStorageDefaultListModel::NodeChanged(const mitk::DataNode* node)
{
- // nothing here, since the "'NodeChanged'-event is currently sent far too often
- //UpdateModelData();
+ // since the "NodeChanged" event is sent quite often, we check here, if it is relevant for this model
+ if (m_NodePredicate.IsNull() || m_NodePredicate->CheckNode(node))
+ {
+ UpdateModelData();
+ return;
+ }
+
+ // not relevant - need to check if we have to remove it
+ if (std::find(m_DataNodes.begin(), m_DataNodes.end(), node) != m_DataNodes.end())
+ {
+ UpdateModelData();
+ }
}
void QmitkDataStorageDefaultListModel::NodeRemoved(const mitk::DataNode* /*node*/)
{
UpdateModelData();
}
QModelIndex QmitkDataStorageDefaultListModel::index(int row, int column, const QModelIndex &parent) const
{
bool hasIndex = this->hasIndex(row, column, parent);
if (hasIndex)
{
return this->createIndex(row, column);
}
return QModelIndex();
}
QModelIndex QmitkDataStorageDefaultListModel::parent(const QModelIndex &/*child*/) const
{
return QModelIndex();
}
int QmitkDataStorageDefaultListModel::rowCount(const QModelIndex &parent) const
{
if (parent.isValid())
{
return 0;
}
return m_DataNodes.size();
}
int QmitkDataStorageDefaultListModel::columnCount(const QModelIndex &parent) const
{
if (parent.isValid())
{
return 0;
}
return 1;
}
QVariant QmitkDataStorageDefaultListModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid() || index.model() != this)
{
return QVariant();
}
if(index.row() < 0 || index.row() >= static_cast<int>(m_DataNodes.size()))
{
return QVariant();
}
mitk::DataNode::Pointer dataNode = m_DataNodes.at(index.row());
QString nodeName = QString::fromStdString(dataNode->GetName());
if (nodeName.isEmpty())
nodeName = "unnamed";
if (role == Qt::DisplayRole)
return nodeName;
else if (role == Qt::ToolTipRole)
return nodeName;
else if (role == Qt::DecorationRole)
{
QmitkNodeDescriptor *nodeDescriptor = QmitkNodeDescriptorManager::GetInstance()->GetDescriptor(dataNode);
return nodeDescriptor->GetIcon(dataNode);
}
else if (role == QmitkDataNodeRole)
{
return QVariant::fromValue<mitk::DataNode::Pointer>(mitk::DataNode::Pointer(dataNode));
}
else if (role == QmitkDataNodeRawPointerRole)
{
return QVariant::fromValue<mitk::DataNode *>(dataNode);
}
return QVariant();
}
QVariant QmitkDataStorageDefaultListModel::headerData(int /*section*/, Qt::Orientation /*orientation*/, int /*role*/) const
{
return QVariant(tr("Nodes"));
}
Qt::ItemFlags QmitkDataStorageDefaultListModel::flags(const QModelIndex &index) const
{
if (index.isValid() && index.model() == this)
{
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}
return Qt::NoItemFlags;
}
void QmitkDataStorageDefaultListModel::UpdateModelData()
{
mitk::DataStorage::SetOfObjects::ConstPointer dataNodes;
if (!m_DataStorage.IsExpired())
{
auto dataStorage = m_DataStorage.Lock();
if (m_NodePredicate.IsNotNull())
{
dataNodes = dataStorage->GetSubset(m_NodePredicate);
}
else
{
dataNodes = dataStorage->GetAll();
}
}
// update the model, so that it will be filled with the nodes of the new data storage
beginResetModel();
m_DataNodes.clear();
// add all (filtered) nodes to the vector of nodes
if (dataNodes != nullptr)
{
for (auto& node : *dataNodes)
{
m_DataNodes.push_back(node);
}
}
endResetModel();
}
diff --git a/Modules/QtWidgets/src/QmitkDataStorageFavoriteNodesInspector.cpp b/Modules/QtWidgets/src/QmitkDataStorageFavoriteNodesInspector.cpp
new file mode 100644
index 0000000000..d3e059bbb3
--- /dev/null
+++ b/Modules/QtWidgets/src/QmitkDataStorageFavoriteNodesInspector.cpp
@@ -0,0 +1,50 @@
+/*============================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center (DKFZ)
+All rights reserved.
+
+Use of this source code is governed by a 3-clause BSD license that can be
+found in the LICENSE file.
+
+============================================================================*/
+
+#include <QmitkDataStorageFavoriteNodesInspector.h>
+
+#include <QmitkDataStorageDefaultListModel.h>
+
+#include "mitkNodePredicateAnd.h"
+
+#include "QPushButton"
+
+QmitkDataStorageFavoriteNodesInspector::QmitkDataStorageFavoriteNodesInspector(QWidget* parent/* = nullptr*/)
+ : QmitkDataStorageListInspector(parent)
+{
+ auto favoriteNodesButton = new QPushButton("Remove selection from favorites", parent);
+ QmitkDataStorageListInspector::m_Controls.verticalLayout->addWidget(favoriteNodesButton, 0, Qt::AlignRight);
+
+ m_FavoriteNodeSelectionPredicate = mitk::NodePredicateProperty::New("org.mitk.selection.favorite", mitk::BoolProperty::New(true));
+ m_NodePredicate = m_FavoriteNodeSelectionPredicate;
+
+ connect(favoriteNodesButton, &QPushButton::clicked, this, &QmitkDataStorageFavoriteNodesInspector::OnFavoriteNodesButtonClicked);
+}
+
+void QmitkDataStorageFavoriteNodesInspector::SetNodePredicate(mitk::NodePredicateBase* nodePredicate)
+{
+ mitk::NodePredicateAnd::Pointer combinedPredicate = mitk::NodePredicateAnd::New();
+
+ combinedPredicate->AddPredicate(m_FavoriteNodeSelectionPredicate);
+ combinedPredicate->AddPredicate(nodePredicate);
+
+ QmitkDataStorageListInspector::SetNodePredicate(combinedPredicate);
+}
+
+void QmitkDataStorageFavoriteNodesInspector::OnFavoriteNodesButtonClicked()
+{
+ auto selectedNodes = GetSelectedNodes();
+ for (auto node : selectedNodes)
+ {
+ node->SetBoolProperty("org.mitk.selection.favorite", false);
+ }
+}
diff --git a/Modules/QtWidgets/src/QmitkDataStorageHistoryModel.cpp b/Modules/QtWidgets/src/QmitkDataStorageHistoryModel.cpp
new file mode 100644
index 0000000000..6bfcd722e3
--- /dev/null
+++ b/Modules/QtWidgets/src/QmitkDataStorageHistoryModel.cpp
@@ -0,0 +1,86 @@
+/*============================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center (DKFZ)
+All rights reserved.
+
+Use of this source code is governed by a 3-clause BSD license that can be
+found in the LICENSE file.
+
+============================================================================*/
+
+#include <QmitkDataStorageHistoryModel.h>
+
+#include "mitkWeakPointer.h"
+#include <deque>
+#include <algorithm>
+#include <mutex>
+
+/** Type of the internal history container.
+ Remark: It stores raw pointer instead of mitk::WeakPointer
+ because this lead to occasional crashes when the application was closed (see T24770 for a similar problem
+ with the same reason*/
+using NodeHistoryType = std::deque< const mitk::DataNode* >;
+
+/** History of node selection. It is sorted from new to old.*/
+NodeHistoryType _nodeHistory;
+std::mutex _historyMutex;
+
+QmitkDataStorageHistoryModel::QmitkDataStorageHistoryModel(QObject *parent) : QmitkDataStorageDefaultListModel(parent)
+{
+}
+
+void QmitkDataStorageHistoryModel::UpdateModelData()
+{
+ std::vector<mitk::DataNode::Pointer> dataNodes;
+ if (!m_DataStorage.IsExpired())
+ {
+ auto dataStorage = m_DataStorage.Lock();
+ mitk::DataStorage::SetOfObjects::ConstPointer nodesCandidats;
+ if (m_NodePredicate.IsNotNull())
+ {
+ nodesCandidats = dataStorage->GetSubset(m_NodePredicate);
+ }
+ else
+ {
+ nodesCandidats = dataStorage->GetAll();
+ }
+
+ const std::lock_guard<std::mutex> lock(_historyMutex);
+
+ for (auto historyNode : _nodeHistory)
+ {
+ auto finding = std::find(nodesCandidats->begin(), nodesCandidats->end(), historyNode);
+ if (finding != nodesCandidats->end())
+ {
+ dataNodes.push_back(*finding);
+ }
+ }
+ }
+
+ // update the model, so that it will be filled with the nodes of the new data storage
+ beginResetModel();
+ m_DataNodes = dataNodes;
+ endResetModel();
+}
+
+void QmitkDataStorageHistoryModel::AddNodeToHistory(mitk::DataNode* node)
+{
+ const std::lock_guard<std::mutex> lock(_historyMutex);
+
+ auto finding = std::find(std::begin(_nodeHistory), std::end(_nodeHistory), node);
+ while (finding != std::end(_nodeHistory))
+ {
+ _nodeHistory.erase(finding);
+ finding = std::find(std::begin(_nodeHistory), std::end(_nodeHistory), node);
+ }
+
+ _nodeHistory.push_front(node);
+}
+
+void QmitkDataStorageHistoryModel::ResetHistory()
+{
+ const std::lock_guard<std::mutex> lock(_historyMutex);
+ _nodeHistory.clear();
+}
diff --git a/Modules/QtWidgets/src/QmitkDataStorageSelectionHistoryInspector.cpp b/Modules/QtWidgets/src/QmitkDataStorageSelectionHistoryInspector.cpp
new file mode 100644
index 0000000000..a9fe9b5722
--- /dev/null
+++ b/Modules/QtWidgets/src/QmitkDataStorageSelectionHistoryInspector.cpp
@@ -0,0 +1,67 @@
+/*============================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center (DKFZ)
+All rights reserved.
+
+Use of this source code is governed by a 3-clause BSD license that can be
+found in the LICENSE file.
+
+============================================================================*/
+
+#include <QmitkDataStorageSelectionHistoryInspector.h>
+
+#include <QmitkDataStorageHistoryModel.h>
+
+QmitkDataStorageSelectionHistoryInspector::QmitkDataStorageSelectionHistoryInspector(QWidget* parent/* = nullptr*/)
+ : QmitkAbstractDataStorageInspector(parent)
+{
+ m_Controls.setupUi(this);
+
+ m_Controls.view->setSelectionMode(QAbstractItemView::ExtendedSelection);
+ m_Controls.view->setSelectionBehavior(QAbstractItemView::SelectRows);
+ m_Controls.view->setAlternatingRowColors(true);
+
+ m_StorageModel = new QmitkDataStorageHistoryModel(this);
+
+ m_Controls.view->setModel(m_StorageModel);
+}
+
+QAbstractItemView* QmitkDataStorageSelectionHistoryInspector::GetView()
+{
+ return m_Controls.view;
+}
+
+const QAbstractItemView* QmitkDataStorageSelectionHistoryInspector::GetView() const
+{
+ return m_Controls.view;
+}
+
+void QmitkDataStorageSelectionHistoryInspector::Initialize()
+{
+ m_StorageModel->SetDataStorage(m_DataStorage.Lock());
+ m_StorageModel->SetNodePredicate(m_NodePredicate);
+
+ m_Connector->SetView(m_Controls.view);
+}
+
+void QmitkDataStorageSelectionHistoryInspector::SetSelectionMode(SelectionMode mode)
+{
+ m_Controls.view->setSelectionMode(mode);
+}
+
+QmitkDataStorageSelectionHistoryInspector::SelectionMode QmitkDataStorageSelectionHistoryInspector::GetSelectionMode() const
+{
+ return m_Controls.view->selectionMode();
+}
+
+void QmitkDataStorageSelectionHistoryInspector::AddNodeToHistory(mitk::DataNode* node)
+{
+ QmitkDataStorageHistoryModel::AddNodeToHistory(node);
+}
+
+void QmitkDataStorageSelectionHistoryInspector::ResetHistory()
+{
+ QmitkDataStorageHistoryModel::ResetHistory();
+}
diff --git a/Modules/QtWidgets/src/QmitkDataStorageSelectionHistoryInspector.ui b/Modules/QtWidgets/src/QmitkDataStorageSelectionHistoryInspector.ui
new file mode 100644
index 0000000000..99d360615f
--- /dev/null
+++ b/Modules/QtWidgets/src/QmitkDataStorageSelectionHistoryInspector.ui
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>QmitkDataStorageSelectionHistoryInspector</class>
+ <widget class="QWidget" name="QmitkDataStorageSelectionHistoryInspector">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QListView" name="view">
+ <property name="editTriggers">
+ <set>QAbstractItemView::NoEditTriggers</set>
+ </property>
+ <property name="alternatingRowColors">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/Modules/QtWidgets/src/mitkQtWidgetsActivator.cpp b/Modules/QtWidgets/src/mitkQtWidgetsActivator.cpp
index f19120728d..deaf7af8b7 100644
--- a/Modules/QtWidgets/src/mitkQtWidgetsActivator.cpp
+++ b/Modules/QtWidgets/src/mitkQtWidgetsActivator.cpp
@@ -1,34 +1,38 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "mitkQtWidgetsActivator.h"
// Micro Services
#include <usModuleActivator.h>
#include <usModuleContext.h>
// Qmitk
#include "QmitkDataStorageInspectorProviderBase.h"
#include "QmitkDataStorageListInspector.h"
#include "QmitkDataStorageTreeInspector.h"
+#include "QmitkDataStorageSelectionHistoryInspector.h"
+#include "QmitkDataStorageFavoriteNodesInspector.h"
void MitkQtWidgetsActivator::Load(us::ModuleContext * /*context*/)
{
m_TreeInspector.reset(new QmitkDataStorageInspectorProviderBase<QmitkDataStorageListInspector>("org.mitk.QmitkDataStorageListInspector", "Simple list", "Displays the filtered content of the data storage in a simple list."));
m_ListInspector.reset(new QmitkDataStorageInspectorProviderBase<QmitkDataStorageTreeInspector>("org.mitk.QmitkDataStorageTreeInspector", "Rendering tree", "Displays the filtered content of the data storage as the current rendering tree. \n(Equals the old data manager view)"));
+ m_HistoryInspector.reset(new QmitkDataStorageInspectorProviderBase<QmitkDataStorageSelectionHistoryInspector>("org.mitk.QmitkDataStorageSelectionHistoryInspector", "Selection history", "Displays the filtered history of all node selections in this application session. \nThe nodes are sorted from new to old selections.\nOnly nodes that are still in the data storage will be displayed."));
+ m_FavoriteNodesInspector.reset(new QmitkDataStorageInspectorProviderBase<QmitkDataStorageFavoriteNodesInspector>("org.mitk.QmitkDataStorageFavoriteNodesInspector", "Favorite nodes list", "Displays the favorite nodes of the data storage in a simple list."));
}
void MitkQtWidgetsActivator::Unload(us::ModuleContext *)
{
}
US_EXPORT_MODULE_ACTIVATOR(MitkQtWidgetsActivator)
diff --git a/Modules/QtWidgets/src/mitkQtWidgetsActivator.h b/Modules/QtWidgets/src/mitkQtWidgetsActivator.h
index 66da400050..6a72708a07 100644
--- a/Modules/QtWidgets/src/mitkQtWidgetsActivator.h
+++ b/Modules/QtWidgets/src/mitkQtWidgetsActivator.h
@@ -1,40 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKQTWIDGETSACTIVATOR_H_
#define MITKQTWIDGETSACTIVATOR_H_
// Micro Services
#include <usModuleActivator.h>
#include <usModuleEvent.h>
#include <usServiceRegistration.h>
#include <usServiceTracker.h>
#include <memory>
#include "mitkIDataStorageInspectorProvider.h"
/*
* This is the module activator for the "QtWidgets" module.
*/
class MitkQtWidgetsActivator : public us::ModuleActivator
{
public:
void Load(us::ModuleContext *context) override;
void Unload(us::ModuleContext *) override;
private:
std::unique_ptr<mitk::IDataStorageInspectorProvider> m_TreeInspector;
std::unique_ptr<mitk::IDataStorageInspectorProvider> m_ListInspector;
+ std::unique_ptr<mitk::IDataStorageInspectorProvider> m_HistoryInspector;
+ std::unique_ptr<mitk::IDataStorageInspectorProvider> m_FavoriteNodesInspector;
};
#endif // MITKCOREACTIVATOR_H_
diff --git a/Modules/QtWidgets/test/files.cmake b/Modules/QtWidgets/test/files.cmake
index e915c0c8b2..370a32a208 100644
--- a/Modules/QtWidgets/test/files.cmake
+++ b/Modules/QtWidgets/test/files.cmake
@@ -1,13 +1,10 @@
# test fails easily on MacOS, rarely on Windows, needs to be fixed before permanent activation (bug 15479)
-if (BUG_15479_FIXED)
-
- set(MODULE_TESTS
- QmitkThreadedLogTest.cpp
- )
+set(MODULE_TESTS )
+if(BUG_15479_FIXED)
+ list(APPEND MODULE_TESTS QmitkThreadedLogTest.cpp)
endif()
-
-set(MODULE_TESTS ${MODULE_TESTS}
+set(MODULE_CUSTOM_TESTS ${MODULE_TESTS}
QmitkDataStorageListModelTest.cpp
)
diff --git a/Modules/Remeshing/mitkACVD.h b/Modules/Remeshing/mitkACVD.h
index 62ee471115..c775d58853 100644
--- a/Modules/Remeshing/mitkACVD.h
+++ b/Modules/Remeshing/mitkACVD.h
@@ -1,101 +1,101 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkACVD_h
#define mitkACVD_h
#include <MitkRemeshingExports.h>
#include <mitkSurface.h>
#include <mitkSurfaceToSurfaceFilter.h>
namespace mitk
{
namespace ACVD
{
/** \brief Remesh a surface and store the result in a new surface.
*
* The %ACVD library is used for remeshing which is based on the paper "Approximated Centroidal Voronoi Diagrams for
* Uniform Polygonal Mesh Coarsening" by S. Valette, and J. M. Chassery.
* There are a few rules of thumbs regarding the ranges of parameters to gain high quality remeshed surfaces:
*
* <ul>
* <li> numVertices is exact, however, if boundaryFixing is enabled, additional vertices are generated at
* boundaries
* <li> %Set gradation to zero in case you want polygons of roughly the same size all over the remeshed surface;
* start with 1 otherwise
* <li> subsampling has direct influence on the quality of the remeshed surface (higher values take more time)
* <li> edgeSplitting is useful for surfaces that contain long and thin triangles but takes a long time
* <li> Leave optimizationLevel set to 1 as greater values result in degenerated polygons
* <li> Irregular shrinking of boundaries during remeshing can be avoided by boundaryFixing, however this results
* in additional, lower quality polygons at boundaries
* </ul>
*
* \param[in] surface Input surface.
* \param[in] t Time step of a four-dimensional input surface, zero otherwise.
* \param[in] numVertices Desired number of vertices in the remeshed surface, set to zero to keep original vertex
* count.
* \param[in] gradation Influence of surface curvature on polygon size.
* \param[in] subsampling Subsample input surface until number of vertices exceeds initial count times this
* parameter.
* \param[in] edgeSplitting Recursively split edges that are longer than the average edge length times this
* parameter.
* \param[in] optimizationLevel Minimize distance between input surface and remeshed surface.
* \param[in] boundaryFixing Keep original surface boundaries by adding additional polygons.
* \return Returns the remeshed surface or nullptr if input surface is invalid.
*/
MITKREMESHING_EXPORT Surface::Pointer Remesh(Surface::ConstPointer surface,
unsigned int t,
int numVertices,
double gradation,
int subsampling = 10,
double edgeSplitting = 0.0,
int optimizationLevel = 1,
bool forceManifold = false,
bool boundaryFixing = false);
/** \brief Encapsulates mitk::ACVD::Remesh function as filter.
*/
class MITKREMESHING_EXPORT RemeshFilter : public mitk::SurfaceToSurfaceFilter
{
public:
mitkClassMacro(RemeshFilter, SurfaceToSurfaceFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkSetMacro(TimeStep, unsigned int);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkSetMacro(TimeStep, unsigned int);
itkSetMacro(NumVertices, int);
itkSetMacro(Gradation, double);
itkSetMacro(Subsampling, int);
itkSetMacro(EdgeSplitting, double);
itkSetMacro(OptimizationLevel, int);
itkSetMacro(ForceManifold, bool);
itkSetMacro(BoundaryFixing, bool);
protected:
void GenerateData() override;
private:
RemeshFilter();
~RemeshFilter() override;
unsigned int m_TimeStep;
int m_NumVertices;
double m_Gradation;
int m_Subsampling;
double m_EdgeSplitting;
int m_OptimizationLevel;
bool m_ForceManifold;
bool m_BoundaryFixing;
};
}
}
#endif
diff --git a/Modules/SceneSerialization/include/mitkSceneIO.h b/Modules/SceneSerialization/include/mitkSceneIO.h
index b55d21bf0a..a7f8c1c457 100644
--- a/Modules/SceneSerialization/include/mitkSceneIO.h
+++ b/Modules/SceneSerialization/include/mitkSceneIO.h
@@ -1,114 +1,115 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkSceneIO_h_included
#define mitkSceneIO_h_included
#include <MitkSceneSerializationExports.h>
#include "mitkDataStorage.h"
#include "mitkNodePredicateBase.h"
#include <Poco/Zip/ZipLocalFileHeader.h>
class TiXmlElement;
namespace mitk
{
class BaseData;
class PropertyList;
class MITKSCENESERIALIZATION_EXPORT SceneIO : public itk::Object
{
public:
mitkClassMacroItkParent(SceneIO, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef DataStorage::SetOfObjects FailedBaseDataListType;
/**
* \brief Load a scene of objects from file
* \return DataStorage with all scene objects and their relations. If loading failed, query GetFailedNodes() and
* GetFailedProperties() for more detail.
*
* Attempts to read the provided file and create objects with
* parent/child relations into a DataStorage.
*
* \param filename full filename of the scene file
* \param storage If given, this DataStorage is used instead of a newly created one
* \param clearStorageFirst If set, the provided DataStorage will be cleared before populating it with the loaded
* objects
*/
virtual DataStorage::Pointer LoadScene(const std::string &filename,
DataStorage *storage = nullptr,
bool clearStorageFirst = false);
/**
* \brief Save a scene of objects to file
* \return True if complete success, false if any problem occurred. Note that a scene file might still be written if
false is returned,
it just will not contain every node/property. If writing failed, query GetFailedNodes() and
GetFailedProperties() for more detail.
*
* Attempts to write a scene file, which contains the nodes of the
* provided DataStorage, their parent/child relations, and properties.
*
* \param storage a DataStorage containing all nodes that should be saved
* \param filename full filename of the scene file
* \param predicate defining which items of the datastorage to use and which not
*/
virtual bool SaveScene(DataStorage::SetOfObjects::ConstPointer sceneNodes,
const DataStorage *storage,
const std::string &filename);
/**
* \brief Get a list of nodes (BaseData containers) that failed to be read/written.
*
* FailedBaseDataListType hold all those nodes that contain BaseData objects
* which could not be read or written during the last call to LoadScene or SaveScene.
*/
const FailedBaseDataListType *GetFailedNodes();
/**
* \brief Get a list of properties that failed to be read/written.
*
* Each entry corresponds to a property which could not
* be (de)serialized. The properties may come from either of
* <ul>
* <li> The BaseData's PropertyList
* <li> The DataNodes's PropertyList
* <li> Any of a DataNodes's render window specific PropertyLists
* </ul>
*/
const PropertyList *GetFailedProperties();
protected:
SceneIO();
~SceneIO() override;
std::string CreateEmptyTempDirectory();
TiXmlElement *SaveBaseData(BaseData *data, const std::string &filenamehint, bool &error);
TiXmlElement *SavePropertyList(PropertyList *propertyList, const std::string &filenamehint);
void OnUnzipError(const void *pSender, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> &info);
void OnUnzipOk(const void *pSender, std::pair<const Poco::Zip::ZipLocalFileHeader, const Poco::Path> &info);
FailedBaseDataListType::Pointer m_FailedNodes;
PropertyList::Pointer m_FailedProperties;
std::string m_WorkingDirectory;
unsigned int m_UnzipErrors;
};
}
#endif
diff --git a/Modules/SceneSerialization/include/mitkSceneReader.h b/Modules/SceneSerialization/include/mitkSceneReader.h
index 3200971036..e01c62bab3 100644
--- a/Modules/SceneSerialization/include/mitkSceneReader.h
+++ b/Modules/SceneSerialization/include/mitkSceneReader.h
@@ -1,31 +1,32 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include <MitkSceneSerializationExports.h>
#include <tinyxml.h>
#include <itkObjectFactory.h>
#include "mitkDataStorage.h"
namespace mitk
{
class MITKSCENESERIALIZATION_EXPORT SceneReader : public itk::Object
{
public:
mitkClassMacroItkParent(SceneReader, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
virtual bool LoadScene(TiXmlDocument &document, const std::string &workingDirectory, DataStorage *storage);
};
}
diff --git a/Modules/SceneSerialization/src/mitkGeometryDataSerializer.h b/Modules/SceneSerialization/src/mitkGeometryDataSerializer.h
index da060b7877..67e42efa95 100644
--- a/Modules/SceneSerialization/src/mitkGeometryDataSerializer.h
+++ b/Modules/SceneSerialization/src/mitkGeometryDataSerializer.h
@@ -1,38 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGeometryDataSerializer_h_included
#define mitkGeometryDataSerializer_h_included
#include "mitkBaseDataSerializer.h"
namespace mitk
{
/**
\brief Serializes mitk::GeometryData for mitk::SceneIO.
\warning depends on mitk::GeometryDataWriterService which is first implemented only for the Geometry3D class!
See current status of that class if you want to use other geomety types.
*/
class GeometryDataSerializer : public BaseDataSerializer
{
public:
mitkClassMacro(GeometryDataSerializer, BaseDataSerializer);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) std::string Serialize() override;
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self) std::string Serialize() override;
protected:
GeometryDataSerializer();
~GeometryDataSerializer() override;
};
} // namespace
#endif
diff --git a/Modules/SceneSerialization/src/mitkImageSerializer.h b/Modules/SceneSerialization/src/mitkImageSerializer.h
index f97af24fad..1cffb0a4f2 100644
--- a/Modules/SceneSerialization/src/mitkImageSerializer.h
+++ b/Modules/SceneSerialization/src/mitkImageSerializer.h
@@ -1,38 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkImageSerializer_h_included
#define mitkImageSerializer_h_included
#include "mitkBaseDataSerializer.h"
namespace mitk
{
/**
\brief Serializes mitk::Image for mitk::SceneIO
*/
class ImageSerializer : public BaseDataSerializer
{
public:
mitkClassMacro(ImageSerializer, BaseDataSerializer);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
std::string Serialize() override;
protected:
ImageSerializer();
~ImageSerializer() override;
};
} // namespace
#endif
diff --git a/Modules/SceneSerialization/src/mitkPointSetSerializer.h b/Modules/SceneSerialization/src/mitkPointSetSerializer.h
index 7bdd09a5ba..ea797c9611 100644
--- a/Modules/SceneSerialization/src/mitkPointSetSerializer.h
+++ b/Modules/SceneSerialization/src/mitkPointSetSerializer.h
@@ -1,34 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPointSetSerializer_h_included
#define mitkPointSetSerializer_h_included
#include "mitkBaseDataSerializer.h"
namespace mitk
{
/**
\brief Serializes mitk::Surface for mitk::SceneIO
*/
class PointSetSerializer : public BaseDataSerializer
{
public:
mitkClassMacro(PointSetSerializer, BaseDataSerializer);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) std::string Serialize() override;
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self) std::string Serialize() override;
protected:
PointSetSerializer();
~PointSetSerializer() override;
};
} // namespace
#endif
diff --git a/Modules/SceneSerialization/src/mitkPropertyListDeserializer.h b/Modules/SceneSerialization/src/mitkPropertyListDeserializer.h
index e269a70a6c..a9e3e4eb67 100644
--- a/Modules/SceneSerialization/src/mitkPropertyListDeserializer.h
+++ b/Modules/SceneSerialization/src/mitkPropertyListDeserializer.h
@@ -1,51 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPropertyListDeserializer_h_included
#define mitkPropertyListDeserializer_h_included
#include "mitkPropertyList.h"
namespace mitk
{
/**
\brief Deserializes a mitk::PropertyList
*/
class PropertyListDeserializer : public itk::Object
{
public:
mitkClassMacroItkParent(PropertyListDeserializer, itk::Object);
itkFactorylessNewMacro(Self) // is this needed? should never be instantiated, only subclasses should
- itkCloneMacro(Self)
-
- itkSetStringMacro(Filename);
+ itkCloneMacro(Self);
+ itkSetStringMacro(Filename);
itkGetStringMacro(Filename);
/**
\brief Reads a propertylist from file
\return success of deserialization
*/
virtual bool Deserialize();
virtual PropertyList::Pointer GetOutput();
protected:
PropertyListDeserializer();
~PropertyListDeserializer() override;
std::string m_Filename;
PropertyList::Pointer m_PropertyList;
};
} // namespace
#endif
diff --git a/Modules/SceneSerialization/src/mitkPropertyListDeserializerV1.h b/Modules/SceneSerialization/src/mitkPropertyListDeserializerV1.h
index 557bd1d42b..a24a181b59 100644
--- a/Modules/SceneSerialization/src/mitkPropertyListDeserializerV1.h
+++ b/Modules/SceneSerialization/src/mitkPropertyListDeserializerV1.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPropertyListDeserializerV1_h_included
#define mitkPropertyListDeserializerV1_h_included
#include "mitkPropertyListDeserializer.h"
namespace mitk
{
/**
\brief Deserializes a mitk::PropertyList
*/
class PropertyListDeserializerV1 : public PropertyListDeserializer
{
public:
mitkClassMacro(PropertyListDeserializerV1, PropertyListDeserializer);
itkFactorylessNewMacro(Self) // is this needed? should never be instantiated, only subclasses should
- itkCloneMacro(Self)
+ itkCloneMacro(Self);
/**
\brief Reads a propertylist from file. Get result via GetOutput()
\return success of deserialization
*/
bool Deserialize() override;
protected:
PropertyListDeserializerV1();
~PropertyListDeserializerV1() override;
};
} // namespace
#endif
diff --git a/Modules/SceneSerialization/src/mitkSceneReaderV1.h b/Modules/SceneSerialization/src/mitkSceneReaderV1.h
index b106b86d6f..d8a937531b 100644
--- a/Modules/SceneSerialization/src/mitkSceneReaderV1.h
+++ b/Modules/SceneSerialization/src/mitkSceneReaderV1.h
@@ -1,73 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "mitkSceneReader.h"
namespace mitk
{
class SceneReaderV1 : public SceneReader
{
public:
mitkClassMacro(SceneReaderV1, SceneReader);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
bool LoadScene(TiXmlDocument &document,
const std::string &workingDirectory,
DataStorage *storage) override;
protected:
/**
\brief tries to create one DataNode from a given XML <node> element
*/
DataNode::Pointer LoadBaseDataFromDataTag(TiXmlElement *dataElement,
const std::string &workingDirectory,
bool &error);
/**
\brief reads all the properties from the XML document and recreates them in node
*/
bool DecorateNodeWithProperties(DataNode *node, TiXmlElement *nodeElement, const std::string &workingDirectory);
/**
\brief Clear a default property list and handle some exceptions.
Called after assigning a BaseData object to a fresh DataNode via SetData().
This call to SetData() would create default properties that have not been
there when saving the scene. Since they can produce problems, we clear the
list and use only those properties that we read from the scene file.
This method also handles some exceptions for backwards compatibility.
Those exceptions are documented directly in the code of the method.
*/
void ClearNodePropertyListWithExceptions(DataNode &node, PropertyList &propertyList);
/**
\brief reads all properties assigned to a base data element and assigns the list to the base data object
The baseDataNodeElem is supposed to be the <properties file="..."> element.
*/
bool DecorateBaseDataWithProperties(BaseData::Pointer data,
TiXmlElement *baseDataNodeElem,
const std::string &workingDir);
typedef std::pair<DataNode::Pointer, std::list<std::string>> NodesAndParentsPair;
typedef std::list<NodesAndParentsPair> OrderedNodesList;
typedef std::map<std::string, DataNode *> IDToNodeMappingType;
typedef std::map<DataNode *, std::string> NodeToIDMappingType;
OrderedNodesList m_OrderedNodePairs;
IDToNodeMappingType m_NodeForID;
NodeToIDMappingType m_IDForNode;
UIDGenerator m_UIDGen;
};
}
diff --git a/Modules/SceneSerialization/src/mitkSurfaceSerializer.h b/Modules/SceneSerialization/src/mitkSurfaceSerializer.h
index 7a5e43529b..bfbfb9ea87 100644
--- a/Modules/SceneSerialization/src/mitkSurfaceSerializer.h
+++ b/Modules/SceneSerialization/src/mitkSurfaceSerializer.h
@@ -1,38 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkSurfaceSerializer_h_included
#define mitkSurfaceSerializer_h_included
#include "mitkBaseDataSerializer.h"
namespace mitk
{
/**
\brief Serializes mitk::Surface for mitk::SceneIO
*/
class SurfaceSerializer : public BaseDataSerializer
{
public:
mitkClassMacro(SurfaceSerializer, BaseDataSerializer);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
std::string Serialize() override;
protected:
SurfaceSerializer();
~SurfaceSerializer() override;
};
} // namespace
#endif
diff --git a/Modules/SceneSerialization/test/CMakeLists.txt b/Modules/SceneSerialization/test/CMakeLists.txt
index 00442dea82..07a93f524e 100644
--- a/Modules/SceneSerialization/test/CMakeLists.txt
+++ b/Modules/SceneSerialization/test/CMakeLists.txt
@@ -1,27 +1,25 @@
MITK_CREATE_MODULE_TESTS(LABELS MITK-Modules)
if(TARGET ${TESTDRIVER})
if(BUILD_TESTING AND MODULE_IS_ENABLED)
add_test(mitkSceneIOTest_Pic3D.nrrd_binary.stl
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTDRIVER}
mitkSceneIOTest
${MITK_DATA_DIR}/Pic3D.nrrd
${MITK_DATA_DIR}/binary.stl
)
set_property(TEST mitkSceneIOTest_Pic3D.nrrd_binary.stl PROPERTY LABELS MITK-Modules)
- if(MITK_ENABLE_RENDERING_TESTING)
mitkAddCustomModuleTest(mitkSceneIOCompatibility_NoRainbowCT mitkSceneIOCompatibilityTest
${MITK_DATA_DIR}/RenderingTestData/SceneFiles/rainbows-post-17547.mitk # scene to load
-V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/rainbows-post-17547.png) # reference rendering
- if (false) # fix not yet integrated
- mitkAddCustomModuleTest(mitkSceneIOCompatibility_SurfaceIntLineWidth mitkSceneIOCompatibilityTest
- ${MITK_DATA_DIR}/RenderingTestData/SceneFiles/surface-pre-18528.mitk # scene to load
- -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/surface-pre-18528.png) # reference rendering
- endif()
- endif()
+ if (FALSE) # fix not yet integrated
+ mitkAddCustomModuleTest(mitkSceneIOCompatibility_SurfaceIntLineWidth mitkSceneIOCompatibilityTest
+ ${MITK_DATA_DIR}/RenderingTestData/SceneFiles/surface-pre-18528.mitk # scene to load
+ -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/surface-pre-18528.png) # reference rendering
+ endif()
endif()
endif()
diff --git a/Modules/SceneSerializationBase/include/mitkLookupTablePropertySerializer.h b/Modules/SceneSerializationBase/include/mitkLookupTablePropertySerializer.h
index 2ef0e043b7..59588423fc 100644
--- a/Modules/SceneSerializationBase/include/mitkLookupTablePropertySerializer.h
+++ b/Modules/SceneSerializationBase/include/mitkLookupTablePropertySerializer.h
@@ -1,56 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkLookupTablePropertySerializer_h_included
#define mitkLookupTablePropertySerializer_h_included
#include "mitkBasePropertySerializer.h"
#include <MitkSceneSerializationBaseExports.h>
namespace mitk
{
/**
\brief Base class for objects that serialize BaseData types.
The name of sub-classes must be deduced from the class name of the object that should be serialized.
The serialization assumes that
\verbatim
If the class derived from BaseData is called GreenData
Then the serializer for this class must be called GreenDataSerializer
\endverbatim
*/
class MITKSCENESERIALIZATIONBASE_EXPORT LookupTablePropertySerializer : public BasePropertySerializer
{
public:
mitkClassMacro(LookupTablePropertySerializer, BasePropertySerializer);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
\brief Serializes given BaseData object.
\return the filename of the newly created file.
This should be overwritten by specific sub-classes.
*/
TiXmlElement *Serialize() override;
BaseProperty::Pointer Deserialize(TiXmlElement *element) override;
protected:
LookupTablePropertySerializer(){};
~LookupTablePropertySerializer() override{};
};
}
// important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
MITK_REGISTER_SERIALIZER(LookupTablePropertySerializer);
#endif
diff --git a/Modules/SceneSerializationBase/include/mitkPropertyListSerializer.h b/Modules/SceneSerializationBase/include/mitkPropertyListSerializer.h
index 01b2b0909e..ffafeff700 100644
--- a/Modules/SceneSerializationBase/include/mitkPropertyListSerializer.h
+++ b/Modules/SceneSerializationBase/include/mitkPropertyListSerializer.h
@@ -1,67 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPropertyListSerializer_h_included
#define mitkPropertyListSerializer_h_included
#include <MitkSceneSerializationBaseExports.h>
#include "mitkPropertyList.h"
#include <itkObjectFactoryBase.h>
class TiXmlElement;
namespace mitk
{
/**
\brief Serializes a mitk::PropertyList
*/
class MITKSCENESERIALIZATIONBASE_EXPORT PropertyListSerializer : public itk::Object
{
public:
mitkClassMacroItkParent(PropertyListSerializer, itk::Object);
itkFactorylessNewMacro(Self) // is this needed? should never be instantiated, only subclasses should
- itkCloneMacro(Self)
-
- itkSetStringMacro(FilenameHint);
+ itkCloneMacro(Self);
+ itkSetStringMacro(FilenameHint);
itkGetStringMacro(FilenameHint);
itkSetStringMacro(WorkingDirectory);
itkGetStringMacro(WorkingDirectory);
itkSetObjectMacro(PropertyList, PropertyList);
/**
\brief Serializes given PropertyList object.
\return the filename of the newly created file.
*/
virtual std::string Serialize();
PropertyList *GetFailedProperties();
protected:
PropertyListSerializer();
~PropertyListSerializer() override;
TiXmlElement *SerializeOneProperty(const std::string &key, const BaseProperty *property);
std::string m_FilenameHint;
std::string m_WorkingDirectory;
PropertyList::Pointer m_PropertyList;
PropertyList::Pointer m_FailedProperties;
};
} // namespace
#endif
diff --git a/Modules/SceneSerializationBase/include/mitkTransferFunctionPropertySerializer.h b/Modules/SceneSerializationBase/include/mitkTransferFunctionPropertySerializer.h
index d5f43fe5ad..786185df13 100644
--- a/Modules/SceneSerializationBase/include/mitkTransferFunctionPropertySerializer.h
+++ b/Modules/SceneSerializationBase/include/mitkTransferFunctionPropertySerializer.h
@@ -1,34 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "mitkBasePropertySerializer.h"
#include "mitkTransferFunctionProperty.h"
namespace mitk
{
class MITKSCENESERIALIZATIONBASE_EXPORT TransferFunctionPropertySerializer : public BasePropertySerializer
{
public:
mitkClassMacro(TransferFunctionPropertySerializer, BasePropertySerializer);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
TiXmlElement *Serialize() override;
BaseProperty::Pointer Deserialize(TiXmlElement *element) override;
static bool SerializeTransferFunction(const char *filename, TransferFunction::Pointer tf);
static TransferFunction::Pointer DeserializeTransferFunction(const char *filePath);
protected:
TransferFunctionPropertySerializer();
~TransferFunctionPropertySerializer() override;
};
} // namespace
diff --git a/Modules/SceneSerializationBase/include/mitkVectorPropertySerializer.h b/Modules/SceneSerializationBase/include/mitkVectorPropertySerializer.h
index 6e395c71f7..72cf35e431 100644
--- a/Modules/SceneSerializationBase/include/mitkVectorPropertySerializer.h
+++ b/Modules/SceneSerializationBase/include/mitkVectorPropertySerializer.h
@@ -1,153 +1,153 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkVectorPropertySerializer_h
#define mitkVectorPropertySerializer_h
#include "mitkBasePropertySerializer.h"
#include "mitkVectorProperty.h"
#include <mitkLexicalCast.h>
namespace mitk
{
/**
\brief Serializes a VectorProperty
Serializes an instance of VectorProperty into a XML structure like
\verbatim
<Values>
<Value idx="0" value="17.3"/>
<Value idx="1" value="7.2"/>
<Value idx="2" value="-17.3"/>
</Values>
\endverbatim
This class is implemented as a template and makes use of std::stringstream
for necessary conversions of specific data types to and from string.
For numeric types, the class adds a precision token to stringstream that
should usually suffice.
*/
template <typename DATATYPE>
class MITKSCENESERIALIZATIONBASE_EXPORT VectorPropertySerializer : public BasePropertySerializer
{
public:
// Expand manually most of mitkClassMacro:
// mitkClassMacro(VectorProperty<DATATYPE>, mitk::BaseProperty);
// This manual expansion is done to override explicitely
// the GetNameOfClass methods
typedef VectorProperty<DATATYPE> PropertyType;
typedef VectorPropertySerializer<DATATYPE> Self;
typedef BasePropertySerializer SuperClass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
std::vector<std::string> GetClassHierarchy() const override { return mitk::GetClassHierarchy<Self>(); }
// This function must return different
// strings in function of the template parameter!
// Serialization depends on this feature.
static const char *GetStaticNameOfClass()
{
// concatenate a prefix dependent on the template type and our own classname
static std::string nameOfClass =
std::string(VectorPropertyDataType<DATATYPE>::prefix()) + "VectorPropertySerializer";
return nameOfClass.c_str();
}
const char *GetNameOfClass() const override { return this->GetStaticNameOfClass(); }
itkFactorylessNewMacro(Self);
- itkCloneMacro(Self)
+ itkCloneMacro(Self);
//! Build an XML version of this property
TiXmlElement *Serialize() override
{
auto listElement = new TiXmlElement("Values");
if (const PropertyType *prop = dynamic_cast<const PropertyType *>(m_Property.GetPointer()))
{
typename PropertyType::VectorType elements = prop->GetValue();
unsigned int index(0);
for (auto listEntry : elements)
{
std::stringstream indexS;
indexS << index++;
auto entryElement = new TiXmlElement("Value");
entryElement->SetAttribute("idx", indexS.str());
entryElement->SetAttribute("value", boost::lexical_cast<std::string>(listEntry));
listElement->LinkEndChild(entryElement);
}
return listElement;
}
else
{
return nullptr;
}
}
//! Construct a property from an XML serialization
BaseProperty::Pointer Deserialize(TiXmlElement *listElement) override
{
typename PropertyType::VectorType datalist;
if (listElement)
{
MITK_DEBUG << "Deserializing " << *listElement;
unsigned int index(0);
std::string valueString;
DATATYPE value;
for (TiXmlElement *valueElement = listElement->FirstChildElement("Value"); valueElement;
valueElement = valueElement->NextSiblingElement("Value"))
{
if (valueElement->QueryValueAttribute("value", &valueString) != TIXML_SUCCESS)
{
MITK_ERROR << "Missing value attribute in <Values> list";
return nullptr;
}
try
{
value = boost::lexical_cast<DATATYPE>(valueString);
}
catch (boost::bad_lexical_cast &e)
{
MITK_ERROR << "Could not parse '" << valueString << "' as number: " << e.what();
return nullptr;
}
datalist.push_back(value);
++index;
}
typename PropertyType::Pointer property = PropertyType::New();
property->SetValue(datalist);
return property.GetPointer();
}
else
{
MITK_ERROR << "Missing <Values> tag.";
}
return nullptr;
}
};
typedef VectorPropertySerializer<double> DoubleVectorPropertySerializer;
typedef VectorPropertySerializer<int> IntVectorPropertySerializer;
} // namespace
#endif
diff --git a/Modules/Segmentation/Algorithms/itkConnectedAdaptiveThresholdImageFilter.h b/Modules/Segmentation/Algorithms/itkConnectedAdaptiveThresholdImageFilter.h
index c55d08cb5f..5aa2485c33 100644
--- a/Modules/Segmentation/Algorithms/itkConnectedAdaptiveThresholdImageFilter.h
+++ b/Modules/Segmentation/Algorithms/itkConnectedAdaptiveThresholdImageFilter.h
@@ -1,121 +1,122 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __itkConnectedAdaptiveThresholdImageFilter_h
#define __itkConnectedAdaptiveThresholdImageFilter_h
#include "itkConnectedThresholdImageFilter.h"
#include "itkImage.h"
namespace itk
{
/** /class ConnectedAdaptiveThreholdImageFilter
* \brief ImageFilter used for processing an image with an adaptive
* iterator (such as itkAdaptiveThresholdIterator)
*
* \ingroup RegionGrowingSegmentation
*/
template <class TInputImage, class TOutputImage>
class ITK_EXPORT ConnectedAdaptiveThresholdImageFilter
: public ConnectedThresholdImageFilter<TInputImage, TOutputImage>
{
public:
/** Standard class typedefs. */
typedef ConnectedAdaptiveThresholdImageFilter Self;
typedef ConnectedThresholdImageFilter<TInputImage, TOutputImage> Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(ConnectedAdaptiveThresholdImageFilter, ConnectedThresholdImageFilter);
typedef TInputImage InputImageType;
typedef TOutputImage OutputImageType;
typedef typename OutputImageType::Pointer OutputImagePointer;
typedef typename InputImageType::IndexType IndexType;
typedef typename InputImageType::PixelType PixelType;
void SetGrowingDirectionIsUpwards(bool upwards) { m_GrowingDirectionIsUpwards = upwards; }
/* Switch between fine and raw leakage detection. */
void SetFineDetectionMode(bool fine)
{
m_FineDetectionMode = fine;
m_DiscardLastPreview = false;
}
int GetSeedpointValue(void) { return m_SeedpointValue; }
int GetLeakagePoint(void) { return m_DetectedLeakagePoint; }
/*
* Correct the position of the seed point, only performed if seed point value is outside threshold range
* @param sizeOfVolume edge length of the square volume in which the search for a "better" seed is performed
*/
IndexType CorrectSeedPointPosition(unsigned int sizeOfVolume, int lowerTh, int upperTh);
/* Sets all voxels in a square volume with the size of @param croppingSize
* and the center point equal to @param seedPoint to the value zero.
*/
void CropMask(unsigned int croppingSize);
/* Modifies the iterator mask to keep all previous segmentation results in the same mask.
* @returnParam largest value in the segmentation mask
*/
unsigned int AdjustIteratorMask();
/* Sets parameters needed for adjusting the iterator mask
* @param iteratorMaskForFineSegmentation pointer to the image containing the complete segmentation result of one
* leaf (inclusively leakage-segmentation)
* @param adjLowerTh lower threshold value of the segmentation without leakage-segmentation
* @param adjLowerTh upper threshold value of the segmentation without leakage-segmentation
* @param discardLeafSegmentation flag if the last segmentation preview ended with a leakage already in the first
* step
*/
void SetParameterForFineSegmentation(TOutputImage *iteratorMaskForFineSegmentation,
unsigned int adjLowerTh,
unsigned int adjUpperTh,
itk::Index<3> seedPoint,
bool discardLeafSegmentation);
TOutputImage *GetResultImage();
protected:
ConnectedAdaptiveThresholdImageFilter();
~ConnectedAdaptiveThresholdImageFilter() override{};
void GenerateData() override;
private:
OutputImagePointer m_OutoutImageMaskFineSegmentation;
bool m_GrowingDirectionIsUpwards;
PixelType m_SeedpointValue;
PixelType m_DetectedLeakagePoint;
PixelType m_InitValue;
unsigned int m_AdjLowerTh;
unsigned int m_AdjUpperTh;
itk::Index<3> m_SeedPointIndex;
/* Flag for switching between raw segmentation and fine segmentation (Bronchial tree segmentation) */
bool m_FineDetectionMode;
bool m_DiscardLastPreview;
bool m_SegmentationCancelled;
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkConnectedAdaptiveThresholdImageFilter.txx"
#endif
#endif
diff --git a/Modules/Segmentation/Algorithms/itkContourExtractor2DImageFilter.h b/Modules/Segmentation/Algorithms/itkContourExtractor2DImageFilter.h
index d7f52aed7e..985cff7fad 100644
--- a/Modules/Segmentation/Algorithms/itkContourExtractor2DImageFilter.h
+++ b/Modules/Segmentation/Algorithms/itkContourExtractor2DImageFilter.h
@@ -1,280 +1,281 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
/*===================================================================
This file is based heavily on a corresponding ITK filter.
===================================================================*/
#ifndef __itkContourExtractor2DImageFilter_h
#define __itkContourExtractor2DImageFilter_h
#include "itkConceptChecking.h"
#include "itkImageToPathFilter.h"
#include "itkNumericTraits.h"
#include "itkPolyLineParametricPath.h"
#include "vcl_deque.h"
#include "vcl_list.h"
#include <itksys/hash_map.hxx>
namespace itk
{
/** \class ContourExtractor2DImageFilter
* \brief Computes a list of PolyLineParametricPath objects from the contours in
* a 2D image.
*
* Uses the "marching squares" method to compute a the iso-valued contours of
* the input 2D image for a given intensity value. Multiple outputs may be
* produced because an image can have multiple contours at a given level, so it
* is advised to call GetNumberOfOutputs() and GetOutput(n) to retrieve all of
* the contours. The contour value to be extracted can be set with
* SetContourValue(). Image intensities will be linearly interpolated to provide
* sub-pixel resolution for the output contours.
*
* The marching squares algorithm is a special case of the marching cubes
* algorithm (Lorensen, William and Harvey E. Cline. Marching Cubes: A High
* Resolution 3D Surface Construction Algorithm. Computer Graphics (SIGGRAPH 87
* Proceedings) 21(4) July 1987, p. 163-170). A simple explanation is available
* here: http://www.essi.fr/~lingrand/MarchingCubes/algo.html
*
* There is a single ambiguous case in the marching squares algorithm: if a
* given 2x2-pixel square has two high-valued and two low-valued pixels, each
* pair diagonally adjacent. (Where high- and low-valued is with respect to the
* contour value sought.) In this case, either the high-valued pixels can be
* connected into the same "object" (where groups of pixels encircled by a given
* contour are considered an object), or the low-valued pixels can be connected.
* This is the "face connected" versus "face + vertex connected" (or 4- versus
* 4-connected) distinction: high-valued pixels most be treated as one, and
* low-valued as the other. By default, high-valued pixels are treated as
* "face-connected" and low-valued pixels are treated as "face + vertex"
* connected. To reverse this, call VertexConnectHighPixelsOn();
*
* Outputs are not guaranteed to be closed paths: contours which intersect the
* image edge will be left open. All other paths will be closed. (The
* closed-ness of a path can be tested by checking whether the beginning point
* is the same as the end point.)
*
* Produced paths are oriented. Following the path from beginning to end, image
* intensity values lower than the contour value are to the left of the path and
* intensity values grater than the contour value are to the right. In other
* words, the image gradient at a path segment is (approximately) in the direct
* of that segment rotated right by 90 degrees, because the image intensity
* values increase from left-to-right across the segment. This means that the
* generated contours will circle clockwise around "hills" of
* above-contour-value intensity, and counter-clockwise around "depressions" of
* below-contour-value intensity. This convention can be reversed by calling
* ReverseContourOrientationOn().
*
* By default the input image's largest possible region will be processed; call
* SetRequestedRegion() to process a different region, or ClearRequestedRegion()
* to revert to the default value. Note that the requested regions are usually
* set on the output; however since paths have no notion of a "region", this
* must be set at the filter level.
*
* This class was contributed to the Insight Journal by Zachary Pincus.
* http://insight-journal.org/midas/handle.php?handle=1926/165
*
* \sa Image
* \sa Path
* \sa PolyLineParametricPath
*
*/
template <class TInputImage>
class ITK_EXPORT ContourExtractor2DImageFilter : public ImageToPathFilter<TInputImage, PolyLineParametricPath<2>>
{
public:
/** Extract dimension from input and output image. */
itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
/** Convenient typedefs for simplifying declarations. */
typedef TInputImage InputImageType;
typedef PolyLineParametricPath<2> OutputPathType;
/** Standard class typedefs. */
typedef ContourExtractor2DImageFilter Self;
typedef ImageToPathFilter<InputImageType, OutputPathType> Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(ContourExtractor2DImageFilter, ImageToPathFilter);
/** Image and path typedef support. */
typedef typename InputImageType::Pointer InputImagePointer;
typedef typename InputImageType::PixelType InputPixelType;
typedef typename InputImageType::IndexType InputIndexType;
typedef typename InputImageType::OffsetType InputOffsetType;
typedef typename InputImageType::RegionType InputRegionType;
typedef typename OutputPathType::Pointer OutputPathPointer;
typedef typename OutputPathType::VertexType VertexType;
typedef typename OutputPathType::VertexListType VertexListType;
/** Real type associated to the input pixel type. */
typedef typename NumericTraits<InputPixelType>::RealType InputRealType;
typedef typename VertexListType::ConstPointer VertexListConstPointer;
/** Control the orientation of the contours with reference to the image
* gradient. (See class documentation.) */
itkSetMacro(ReverseContourOrientation, bool);
itkGetConstReferenceMacro(ReverseContourOrientation, bool);
itkBooleanMacro(ReverseContourOrientation);
/** Control whether high- or low-valued pixels are vertex-connected.
* Default is for low-valued pixels to be vertex-connected.
* (See class documentation.) */
itkSetMacro(VertexConnectHighPixels, bool);
itkGetConstReferenceMacro(VertexConnectHighPixels, bool);
itkBooleanMacro(VertexConnectHighPixels);
/** Control whether the largest possible input region is used, or if a
* custom requested region is to be used. */
void SetRequestedRegion(const InputRegionType region);
itkGetConstReferenceMacro(RequestedRegion, InputRegionType);
void ClearRequestedRegion();
/** Set/Get the image intensity value that the contours should follow.
* This is the equivalent of an iso-value in Marching Squares. */
itkSetMacro(ContourValue, InputRealType);
itkGetConstReferenceMacro(ContourValue, InputRealType);
#ifdef ITK_USE_CONCEPT_CHECKING
/** Begin concept checking */
itkConceptMacro(DimensionShouldBe2, (Concept::SameDimension<itkGetStaticConstMacro(InputImageDimension), 2>));
itkConceptMacro(InputPixelTypeComparable, (Concept::Comparable<InputPixelType>));
itkConceptMacro(InputHasPixelTraitsCheck, (Concept::HasPixelTraits<InputPixelType>));
itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<InputPixelType>));
/** End concept checking */
#endif
protected:
ContourExtractor2DImageFilter();
~ContourExtractor2DImageFilter() override;
void PrintSelf(std::ostream &os, Indent indent) const override;
void GenerateData() override;
/** ContourExtractor2DImageFilter manually controls the input requested
* region via SetRequestedRegion and ClearRequestedRegion, so it must
* override the superclass method. */
void GenerateInputRequestedRegion() override;
private:
VertexType InterpolateContourPosition(InputPixelType fromValue,
InputPixelType toValue,
InputIndexType fromIndex,
InputOffsetType toOffset);
void AddSegment(const VertexType from, const VertexType to);
void FillOutputs();
ContourExtractor2DImageFilter(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
InputRealType m_ContourValue;
bool m_ReverseContourOrientation;
bool m_VertexConnectHighPixels;
bool m_UseCustomRegion;
InputRegionType m_RequestedRegion;
unsigned int m_NumberOfContoursCreated;
// Represent each contour as deque of vertices to facilitate addition of
// nodes at beginning or end. At the end of the processing, we will copy
// the contour into a PolyLineParametricPath.
// We subclass the deque to store an additional bit of information: an
// identification number for each growing contour. We use this number so
// that when it becomes necessary to merge two growing contours, we can
// merge the newer one into the older one. This helps because then we can
// guarantee that the output contour list is ordered from left to right,
// top to bottom (in terms of the first pixel of the contour encountered
// by the marching squares). Currently we make no guarantees that this
// pixel is the first pixel in the contour list, just that the contours
// are so ordered in the output. Ensuring this latter condition (first
// pixel traversed = first pixel in contour) would be possible by either
// changing the merging rules, which would make the contouring operation
// slower, or by storing additional data as to which pixel was first.
class ContourType : public vcl_deque<VertexType>
{
public:
unsigned int m_ContourNumber;
};
// Store all the growing contours in a list. We may need to delete contours
// from anywhere in the sequence (when we merge them together), so we need to
// use a list instead of a vector or similar.
typedef vcl_list<ContourType> ContourContainer;
typedef typename ContourContainer::iterator ContourRef;
// declare the hash function we are using for the hash_map.
struct VertexHash
{
typedef typename VertexType::CoordRepType CoordinateType;
inline size_t operator()(const VertexType &k) const
{
// Xor the hashes of the vertices together, after multiplying the
// first by some number, so that identical (x,y) vertex indices
// don't all hash to the same bucket. This is a decent if not
// optimal hash.
const size_t hashVertex1 = this->float_hash(k[0] * 0xbeef);
const size_t hashVertex2 = this->float_hash(k[1]);
const size_t hashValue = hashVertex1 ^ hashVertex2;
return hashValue;
}
// Define hash function for floats. Based on method from
// http://www.brpreiss.com/books/opus4/html/page217.html
inline size_t float_hash(const CoordinateType &k) const
{
if (k == 0)
{
return 0;
}
int exponent;
CoordinateType mantissa = vcl_frexp(k, &exponent);
size_t value = static_cast<size_t>(vcl_fabs(mantissa));
value = (2 * value - 1) * ~0U;
return value;
}
};
// We use a hash to associate the endpoints of each contour with the
// contour itself. This makes it easy to look up which contour we should add
// a new arc to.
// We can't store the contours themselves in the hashtable because we
// need to have two tables (one to hash from beginpoint -> contour and one
// for endpoint -> contour), and sometimes will remove a contour from the
// tables (if it has been closed or merged with another contour). So in the
// hash table we store a reference to the contour. Because sometimes we will
// need to merge contours, we need to be able to quickly remove contours
// from our list when they have been merged into another. Thus, we store
// an iterator pointing to the contour in the list.
typedef itksys::hash_map<VertexType, ContourRef, VertexHash> VertexToContourMap;
typedef typename VertexToContourMap::iterator VertexMapIterator;
typedef typename VertexToContourMap::value_type VertexContourRefPair;
// The contours we find in the image are stored here
ContourContainer m_Contours;
// And indexed by their beginning and ending points here
VertexToContourMap m_ContourStarts;
VertexToContourMap m_ContourEnds;
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkContourExtractor2DImageFilter.txx"
#endif
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkCalculateSegmentationVolume.h b/Modules/Segmentation/Algorithms/mitkCalculateSegmentationVolume.h
index e94866101b..b2e51ca823 100644
--- a/Modules/Segmentation/Algorithms/mitkCalculateSegmentationVolume.h
+++ b/Modules/Segmentation/Algorithms/mitkCalculateSegmentationVolume.h
@@ -1,48 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_CALCULATE_SEGMENTATION_VOLUME_H_INCLUDET_WAD
#define MITK_CALCULATE_SEGMENTATION_VOLUME_H_INCLUDET_WAD
#include "mitkImageCast.h"
#include "mitkSegmentationSink.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
class MITKSEGMENTATION_EXPORT CalculateSegmentationVolume : public SegmentationSink
{
public:
- mitkClassMacro(CalculateSegmentationVolume, SegmentationSink) mitkAlgorithmNewMacro(CalculateSegmentationVolume);
+ mitkClassMacro(CalculateSegmentationVolume, SegmentationSink);
+ mitkAlgorithmNewMacro(CalculateSegmentationVolume);
protected:
CalculateSegmentationVolume(); // use smart pointers
~CalculateSegmentationVolume() override;
bool ReadyToRun() override;
bool ThreadedUpdateFunction() override; // will be called from a thread after calling StartAlgorithm
template <typename TPixel, unsigned int VImageDimension>
void ItkImageProcessing(itk::Image<TPixel, VImageDimension> *itkImage, TPixel *dummy = nullptr);
private:
unsigned int m_Volume;
Vector3D m_CenterOfMass;
Vector3D m_MinIndexOfBoundingBox;
Vector3D m_MaxIndexOfBoundingBox;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkContourModelSetToImageFilter.h b/Modules/Segmentation/Algorithms/mitkContourModelSetToImageFilter.h
index e60d472662..8530c3ef65 100644
--- a/Modules/Segmentation/Algorithms/mitkContourModelSetToImageFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkContourModelSetToImageFilter.h
@@ -1,90 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_CONTOURMODEL_SOURCE_H
#define _MITK_CONTOURMODEL_SOURCE_H
#include <MitkSegmentationExports.h>
#include <mitkImageSource.h>
namespace mitk
{
class ContourModelSet;
/**
* @brief Fills a given mitk::ContourModelSet into a given mitk::Image
* @ingroup Process
*/
class MITKSEGMENTATION_EXPORT ContourModelSetToImageFilter : public ImageSource
{
public:
- mitkClassMacro(ContourModelSetToImageFilter, ImageSource) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkSetMacro(MakeOutputBinary, bool);
+ mitkClassMacro(ContourModelSetToImageFilter, ImageSource);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkSetMacro(MakeOutputBinary, bool);
itkGetMacro(MakeOutputBinary, bool);
itkBooleanMacro(MakeOutputBinary);
itkSetMacro(TimeStep, unsigned int);
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
const mitk::ContourModelSet *GetInput(void);
using itk::ProcessObject::SetInput;
virtual void SetInput(const mitk::ContourModelSet *input);
/**
* @brief Set the image which will be used to initialize the output of this filter.
* @param refImage the image used to initialize the output image
*/
void SetImage(const mitk::Image *refImage);
const mitk::Image *GetImage(void);
protected:
ContourModelSetToImageFilter();
~ContourModelSetToImageFilter() override;
/**
* @brief Initializes the volume of the output image with zeros
*/
void InitializeOutputEmpty();
bool m_MakeOutputBinary;
unsigned int m_TimeStep;
const mitk::Image *m_ReferenceImage;
};
}
#endif // #_MITK_CONTOURMODEL_SOURCE_H
diff --git a/Modules/Segmentation/Algorithms/mitkContourSetToPointSetFilter.h b/Modules/Segmentation/Algorithms/mitkContourSetToPointSetFilter.h
index 13252e28be..6b036a25ef 100644
--- a/Modules/Segmentation/Algorithms/mitkContourSetToPointSetFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkContourSetToPointSetFilter.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _mitkContourSetToPointSetFilter_h__
#define _mitkContourSetToPointSetFilter_h__
#include "mitkCommon.h"
#include "mitkContourSet.h"
#include "mitkPointSet.h"
#include "mitkPointSetSource.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
/**
*
* @brief Converts a contour set to a point set.
*
* The resulting pointset consists of sample points of all the contours
*
* @ingroup SurfaceFilters
* @ingroup Process
*/
class MITKSEGMENTATION_EXPORT ContourSetToPointSetFilter : public PointSetSource
{
public:
mitkClassMacro(ContourSetToPointSetFilter, PointSetSource);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkSetMacro(Frequency, unsigned int);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkSetMacro(Frequency, unsigned int);
itkGetMacro(Frequency, unsigned int);
void GenerateOutputInformation() override;
void GenerateData() override;
const mitk::ContourSet *GetInput(void);
using Superclass::SetInput;
virtual void SetInput(const mitk::ContourSet *contourSet);
protected:
ContourSetToPointSetFilter();
~ContourSetToPointSetFilter() override;
protected:
unsigned int m_Frequency;
};
} // namespace mitk
#endif // _mitkContourSetToPointSetFilter_h__
diff --git a/Modules/Segmentation/Algorithms/mitkContourUtils.h b/Modules/Segmentation/Algorithms/mitkContourUtils.h
index f22b1e79ea..d9add259f2 100644
--- a/Modules/Segmentation/Algorithms/mitkContourUtils.h
+++ b/Modules/Segmentation/Algorithms/mitkContourUtils.h
@@ -1,67 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkContourUtilshIncludett
#define mitkContourUtilshIncludett
#include "mitkContour.h"
#include "mitkContourModel.h"
#include "mitkImage.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
/**
* \brief Helpful methods for working with contours and images
*
* Legacy support for mitk::Contour
* TODO remove this class when mitk::Contour is removed
*/
class MITKSEGMENTATION_EXPORT ContourUtils : public itk::Object
{
public:
mitkClassMacroItkParent(ContourUtils, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
\brief Projects a contour onto an image point by point. Converts from world to index coordinates.
\param correctionForIpSegmentation adds 0.5 to x and y index coordinates (difference between ipSegmentation and
MITK contours)
*/
ContourModel::Pointer ProjectContourTo2DSlice(Image *slice,
Contour *contourIn3D,
bool correctionForIpSegmentation,
bool constrainToInside);
/**
\brief Projects a slice index coordinates of a contour back into world coordinates.
\param correctionForIpSegmentation subtracts 0.5 to x and y index coordinates (difference between
ipSegmentation and MITK contours)
*/
ContourModel::Pointer BackProjectContourFrom2DSlice(const BaseGeometry *sliceGeometry,
Contour *contourIn2D,
bool correctionForIpSegmentation = false);
/**
\brief Fill a contour in a 2D slice with a specified pixel value.
*/
void FillContourInSlice(Contour *projectedContour, Image *sliceImage, int paintingPixelValue = 1);
protected:
ContourUtils();
~ContourUtils() override;
};
}
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkCorrectorAlgorithm.h b/Modules/Segmentation/Algorithms/mitkCorrectorAlgorithm.h
index 02efb884cf..ae3eba97a3 100644
--- a/Modules/Segmentation/Algorithms/mitkCorrectorAlgorithm.h
+++ b/Modules/Segmentation/Algorithms/mitkCorrectorAlgorithm.h
@@ -1,108 +1,109 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkCorrectorAlgorithmhIncluded
#define mitkCorrectorAlgorithmhIncluded
#include "ipSegmentation.h"
#include "mitkContourModel.h"
#include "mitkImageToImageFilter.h"
#include <MitkSegmentationExports.h>
#include <mitkLabel.h>
#include <itkImage.h>
#define multilabelSegmentationType unsigned short
namespace mitk
{
/**
* This class encapsulates an algorithm, which takes a 2D binary image and a contour.
* The algorithm tests if the line begins and ends inside or outside a segmentation
* and whether areas should be added to or subtracted from the segmentation shape.
*
* This class has two outputs:
* \li the modified input image from GetOutput()
*
* The output image is a combination of the original input with the generated difference image.
*
* \sa CorrectorTool2D
*/
class MITKSEGMENTATION_EXPORT CorrectorAlgorithm : public ImageToImageFilter
{
public:
mitkClassMacro(CorrectorAlgorithm, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef mitk::Label::PixelType DefaultSegmentationDataType;
/**
* \brief User drawn contour
*/
void SetContour(ContourModel *contour) { this->m_Contour = contour; }
itkSetMacro(FillColor, int);
itkGetConstMacro(FillColor, int);
itkSetMacro(EraseColor, int);
itkGetConstMacro(EraseColor, int);
/**
* \brief Calculated difference image.
*/
// itkGetObjectMacro(DifferenceImage, Image);
// used by TobiasHeimannCorrectionAlgorithm
typedef struct
{
int lineStart;
int lineEnd;
bool modified;
std::vector<itk::Index<2>> points;
} TSegData;
protected:
CorrectorAlgorithm();
~CorrectorAlgorithm() override;
// does the actual processing
void GenerateData() override;
bool ImprovedHeimannCorrectionAlgorithm(itk::Image<DefaultSegmentationDataType, 2>::Pointer pic);
bool ModifySegment(const TSegData &segment, itk::Image<DefaultSegmentationDataType, 2>::Pointer pic);
Image::Pointer m_WorkingImage;
ContourModel::Pointer m_Contour;
Image::Pointer m_DifferenceImage;
int m_FillColor;
int m_EraseColor;
private:
template <typename ScalarType>
itk::Index<2> ensureIndexInImage(ScalarType i0, ScalarType i1);
void ColorSegment(const mitk::CorrectorAlgorithm::TSegData &segment,
itk::Image<mitk::CorrectorAlgorithm::DefaultSegmentationDataType, 2>::Pointer pic);
itk::Image<mitk::CorrectorAlgorithm::DefaultSegmentationDataType, 2>::Pointer CloneImage(
itk::Image<mitk::CorrectorAlgorithm::DefaultSegmentationDataType, 2>::Pointer pic);
itk::Index<2> GetFirstPoint(const mitk::CorrectorAlgorithm::TSegData &segment,
itk::Image<mitk::CorrectorAlgorithm::DefaultSegmentationDataType, 2>::Pointer pic);
std::vector<itk::Index<2>> FindSeedPoints(
const mitk::CorrectorAlgorithm::TSegData &segment,
itk::Image<mitk::CorrectorAlgorithm::DefaultSegmentationDataType, 2>::Pointer pic);
int FillRegion(const std::vector<itk::Index<2>> &seedPoints,
itk::Image<mitk::CorrectorAlgorithm::DefaultSegmentationDataType, 2>::Pointer pic);
void OverwriteImage(itk::Image<mitk::CorrectorAlgorithm::DefaultSegmentationDataType, 2>::Pointer source,
itk::Image<mitk::CorrectorAlgorithm::DefaultSegmentationDataType, 2>::Pointer target);
};
}
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkDiffImageApplier.h b/Modules/Segmentation/Algorithms/mitkDiffImageApplier.h
index 65bbc7f9bf..956fe8961c 100644
--- a/Modules/Segmentation/Algorithms/mitkDiffImageApplier.h
+++ b/Modules/Segmentation/Algorithms/mitkDiffImageApplier.h
@@ -1,81 +1,82 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkDiffImageApplier_h_Included
#define mitkDiffImageApplier_h_Included
#include "mitkCommon.h"
#include "mitkImage.h"
#include "mitkOperationActor.h"
#include <MitkSegmentationExports.h>
#include <itkImage.h>
#include <itkObjectFactory.h>
namespace mitk
{
/**
\brief Applies difference images to 3D images.
This class is supposed to execute ApplyDiffImageOperations, which contain information about pixel changes within one
image slice.
Class should be called from the undo stack. At the moment, ApplyDiffImageOperations are only created by
OverwriteSliceImageFilter.
$Author: maleike $
*/
class MITKSEGMENTATION_EXPORT DiffImageApplier : public itk::Object, public OperationActor
{
public:
mitkClassMacroItkParent(DiffImageApplier, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void ExecuteOperation(Operation *operation) override;
static DiffImageApplier *GetInstanceForUndo();
protected:
DiffImageApplier(); // purposely hidden
~DiffImageApplier() override;
template <typename TPixel, unsigned int VImageDimension>
void ItkImageSwitch2DDiff(itk::Image<TPixel, VImageDimension> *image);
template <typename TPixel, unsigned int VImageDimension>
void ItkImageSwitch3DDiff(itk::Image<TPixel, VImageDimension> *image);
template <typename TPixel1, unsigned int VImageDimension1, typename TPixel2, unsigned int VImageDimension2>
void ItkImageProcessing2DDiff(itk::Image<TPixel1, VImageDimension1> *itkImage1,
itk::Image<TPixel2, VImageDimension2> *itkImage2);
template <typename TPixel1, unsigned int VImageDimension1, typename TPixel2, unsigned int VImageDimension2>
void ItkImageProcessing3DDiff(itk::Image<TPixel1, VImageDimension1> *itkImage1,
itk::Image<TPixel2, VImageDimension2> *itkImage2);
template <typename TPixel, unsigned int VImageDimension>
void ItkInvertPixelValues(itk::Image<TPixel, VImageDimension> *itkImage);
Image::Pointer m_Image;
Image::Pointer m_SliceDifferenceImage;
unsigned int m_SliceIndex;
unsigned int m_SliceDimension;
unsigned int m_TimeStep;
unsigned int m_Dimension0;
unsigned int m_Dimension1;
double m_Factor;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkFeatureBasedEdgeDetectionFilter.h b/Modules/Segmentation/Algorithms/mitkFeatureBasedEdgeDetectionFilter.h
index 34bdfb922b..8057ca7175 100644
--- a/Modules/Segmentation/Algorithms/mitkFeatureBasedEdgeDetectionFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkFeatureBasedEdgeDetectionFilter.h
@@ -1,74 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkFeatureBasedEdgeDetectionFilter_h_Included
#define mitkFeatureBasedEdgeDetectionFilter_h_Included
#include <MitkSegmentationExports.h>
#include <mitkImageToUnstructuredGridFilter.h>
namespace mitk
{
/**
* @brief Calculates edges and extracts them as an UnstructuredGrid with respect
* to the given segmentation.
*
* At first the statistic of the grey values within the segmentation is
* calculated. Based on this statistic a thresholding is executed. The
* thresholded image will be processed by morphological filters. The resulting
* image will be used for masking the input image. The masked image is used as
* input for the ImageToPointCloudFilter, which output is an UnstructuredGrid.
*/
class MITKSEGMENTATION_EXPORT FeatureBasedEdgeDetectionFilter : public ImageToUnstructuredGridFilter
{
public:
- mitkClassMacro(FeatureBasedEdgeDetectionFilter, ImageToUnstructuredGridFilter)
-
- itkFactorylessNewMacro(Self)
+ mitkClassMacro(FeatureBasedEdgeDetectionFilter, ImageToUnstructuredGridFilter);
+ itkFactorylessNewMacro(Self);
/** Sets the segmentation for calculating the statistics within that */
void SetSegmentationMask(mitk::Image::Pointer);
protected:
/** This method is called by Update(). */
void GenerateData() override;
/** Initializes the output information */
void GenerateOutputInformation() override;
/** Constructor */
FeatureBasedEdgeDetectionFilter();
/** Destructor */
~FeatureBasedEdgeDetectionFilter() override;
/** Execute a thresholding filter with the given lower and upper bound */
template <typename TPixel, unsigned int VImageDimension>
void ITKThresholding(const itk::Image<TPixel, VImageDimension> *originalImage,
double lower,
double upper,
mitk::Image::Pointer &result);
template <typename TPixel, unsigned int VImageDimension>
void ContourSearch(itk::Image<TPixel, VImageDimension> *originalImage, mitk::Image::Pointer &result);
template <typename TPixel, unsigned int VImageDimension>
void ThreadedClosing(itk::Image<TPixel, VImageDimension> *originalImage, mitk::Image::Pointer &result);
private:
mitk::UnstructuredGrid::Pointer m_PointGrid;
/** The used mask given by the segmentation*/
mitk::Image::Pointer m_SegmentationMask;
};
}
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkImageLiveWireContourModelFilter.h b/Modules/Segmentation/Algorithms/mitkImageLiveWireContourModelFilter.h
index 4092f0369d..e2fd65b038 100644
--- a/Modules/Segmentation/Algorithms/mitkImageLiveWireContourModelFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkImageLiveWireContourModelFilter.h
@@ -1,161 +1,162 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _mitkImageLiveWireContourModelFilter_h__
#define _mitkImageLiveWireContourModelFilter_h__
#include "mitkCommon.h"
#include "mitkContourModel.h"
#include "mitkContourModelSource.h"
#include <MitkSegmentationExports.h>
#include <mitkImage.h>
#include <mitkImageAccessByItk.h>
#include <mitkImageCast.h>
#include <itkShortestPathCostFunctionLiveWire.h>
#include <itkShortestPathImageFilter.h>
namespace mitk
{
/**
\brief Calculates a LiveWire contour between two points in an image.
For defining costs between two pixels specific features are extraced from the image and tranformed into a single cost
value.
\sa ShortestPathCostFunctionLiveWire
The filter is able to create dynamic cost tranfer map and thus use on the fly training.
\Note On the fly training will only be used for next update.
The computation uses the last calculated segment to map cost according to features in the area of the segment.
For time resolved purposes use ImageLiveWireContourModelFilter::SetTimestep( unsigned int ) to create the LiveWire
contour
at a specific timestep.
\ingroup ContourModelFilters
\ingroup Process
*/
class MITKSEGMENTATION_EXPORT ImageLiveWireContourModelFilter : public ContourModelSource
{
public:
mitkClassMacro(ImageLiveWireContourModelFilter, ContourModelSource);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef ContourModel OutputType;
typedef OutputType::Pointer OutputTypePointer;
typedef mitk::Image InputType;
typedef itk::Image<float, 2> InternalImageType;
typedef itk::ShortestPathImageFilter<InternalImageType, InternalImageType> ShortestPathImageFilterType;
typedef itk::ShortestPathCostFunctionLiveWire<InternalImageType> CostFunctionType;
typedef std::vector<itk::Index<2>> ShortestPathType;
/** \brief start point in world coordinates*/
itkSetMacro(StartPoint, mitk::Point3D);
itkGetMacro(StartPoint, mitk::Point3D);
/** \brief end point in woorld coordinates*/
itkSetMacro(EndPoint, mitk::Point3D);
itkGetMacro(EndPoint, mitk::Point3D);
/** \brief Create dynamic cost tranfer map - use on the fly training.
\Note On the fly training will be used for next update only.
The computation uses the last calculated segment to map cost according to features in the area of the segment.
*/
itkSetMacro(UseDynamicCostMap, bool);
itkGetMacro(UseDynamicCostMap, bool);
/** \brief Actual time step
*/
itkSetMacro(TimeStep, unsigned int);
itkGetMacro(TimeStep, unsigned int);
/** \brief Clear all repulsive points used in the cost function
*/
void ClearRepulsivePoints();
/** \brief Set a vector with repulsive points to use in the cost function
*/
void SetRepulsivePoints(const ShortestPathType &points);
/** \brief Add a single repulsive point to the cost function
*/
void AddRepulsivePoint(const itk::Index<2> &idx);
/** \brief Remove a single repulsive point from the cost function
*/
void RemoveRepulsivePoint(const itk::Index<2> &idx);
virtual void SetInput(const InputType *input);
using Superclass::SetInput;
virtual void SetInput(unsigned int idx, const InputType *input);
const InputType *GetInput(void);
const InputType *GetInput(unsigned int idx);
virtual OutputType *GetOutput();
virtual void DumpMaskImage();
/** \brief Create dynamic cost tranfer map - on the fly training*/
bool CreateDynamicCostMap(mitk::ContourModel *path = nullptr);
protected:
ImageLiveWireContourModelFilter();
~ImageLiveWireContourModelFilter() override;
void GenerateOutputInformation() override{};
void GenerateData() override;
void UpdateLiveWire();
/** \brief start point in worldcoordinates*/
mitk::Point3D m_StartPoint;
/** \brief end point in woorldcoordinates*/
mitk::Point3D m_EndPoint;
/** \brief Start point in index*/
mitk::Point3D m_StartPointInIndex;
/** \brief End point in index*/
mitk::Point3D m_EndPointInIndex;
/** \brief The cost function to compute costs between two pixels*/
CostFunctionType::Pointer m_CostFunction;
/** \brief Shortest path filter according to cost function m_CostFunction*/
ShortestPathImageFilterType::Pointer m_ShortestPathFilter;
/** \brief Flag to use a dynmic cost map or not*/
bool m_UseDynamicCostMap;
unsigned int m_TimeStep;
template <typename TPixel, unsigned int VImageDimension>
void ItkPreProcessImage(const itk::Image<TPixel, VImageDimension> *inputImage);
template <typename TPixel, unsigned int VImageDimension>
void CreateDynamicCostMapByITK(const itk::Image<TPixel, VImageDimension> *inputImage,
mitk::ContourModel *path = nullptr);
InternalImageType::Pointer m_InternalImage;
};
}
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkImageToContourFilter.h b/Modules/Segmentation/Algorithms/mitkImageToContourFilter.h
index a2afb0378b..3aff2a90fe 100644
--- a/Modules/Segmentation/Algorithms/mitkImageToContourFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkImageToContourFilter.h
@@ -1,90 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkImageToContourFilter_h_Included
#define mitkImageToContourFilter_h_Included
//#include "MitkSBExports.h"
#include "itkContourExtractor2DImageFilter.h"
#include "itkImage.h"
#include "mitkImage.h"
#include "mitkImageToSurfaceFilter.h"
#include "mitkSurface.h"
#include "vtkCellArray.h"
#include "vtkPolyData.h"
#include "vtkPolygon.h"
#include <MitkSegmentationExports.h>
#include "mitkProgressBar.h"
namespace mitk
{
/**
\brief A filter that can extract contours out of a 2D binary image
This class takes an 2D mitk::Image as input and extracts all contours which are drawn it. The contour
extraction is done by using the itk::ContourExtractor2DImageFilter.
The output is a mitk::Surface.
$Author: fetzer$
*/
class MITKSEGMENTATION_EXPORT ImageToContourFilter : public ImageToSurfaceFilter
{
public:
mitkClassMacro(ImageToContourFilter, ImageToSurfaceFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
\brief Set macro for the geometry of the slice. If it is not set explicitly the geometry will be taken from the
slice
\a Parameter The slice`s geometry
*/
itkSetMacro(SliceGeometry, BaseGeometry *);
// typedef unsigned int VDimension;
typedef itk::PolyLineParametricPath<2> PolyLineParametricPath2D;
typedef PolyLineParametricPath2D::VertexListType ContourPath;
/**
\brief Set whether the mitkProgressBar should be used
\a Parameter true for using the progress bar, false otherwise
*/
void SetUseProgressBar(bool);
/**
\brief Set the stepsize which the progress bar should proceed
\a Parameter The stepsize for progressing
*/
void SetProgressStepSize(unsigned int stepSize);
protected:
ImageToContourFilter();
~ImageToContourFilter() override;
void GenerateData() override;
void GenerateOutputInformation() override;
private:
const BaseGeometry *m_SliceGeometry;
bool m_UseProgressBar;
unsigned int m_ProgressStepSize;
template <typename TPixel, unsigned int VImageDimension>
void Itk2DContourExtraction(const itk::Image<TPixel, VImageDimension> *sliceImage);
}; // class
} // namespace
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkImageToLiveWireContourFilter.h b/Modules/Segmentation/Algorithms/mitkImageToLiveWireContourFilter.h
index a015c14f09..3ca1a5362f 100644
--- a/Modules/Segmentation/Algorithms/mitkImageToLiveWireContourFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkImageToLiveWireContourFilter.h
@@ -1,79 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _mitkImageToLiveWireContourFilter_h__
#define _mitkImageToLiveWireContourFilter_h__
#include "mitkCommon.h"
#include "mitkContourModel.h"
#include "mitkContourModelSource.h"
#include <MitkSegmentationExports.h>
#include <mitkImage.h>
#include <mitkImageAccessByItk.h>
#include <mitkImageCast.h>
namespace mitk
{
/**
*
* \brief
*
* \ingroup ContourModelFilters
* \ingroup Process
*/
class MITKSEGMENTATION_EXPORT ImageToLiveWireContourFilter : public ContourModelSource
{
public:
mitkClassMacro(ImageToLiveWireContourFilter, ContourModelSource);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
typedef ContourModel OutputType;
typedef OutputType::Pointer OutputTypePointer;
typedef mitk::Image InputType;
itkSetMacro(StartPoint, mitk::Point3D);
itkGetMacro(StartPoint, mitk::Point3D);
itkSetMacro(EndPoint, mitk::Point3D);
itkGetMacro(EndPoint, mitk::Point3D);
virtual void SetInput(const InputType *input);
using Superclass::SetInput;
virtual void SetInput(unsigned int idx, const InputType *input);
const InputType *GetInput(void);
const InputType *GetInput(unsigned int idx);
protected:
ImageToLiveWireContourFilter();
~ImageToLiveWireContourFilter() override;
void GenerateData() override;
void GenerateOutputInformation() override{};
mitk::Point3D m_StartPoint;
mitk::Point3D m_EndPoint;
mitk::Point3D m_StartPointInIndex;
mitk::Point3D m_EndPointInIndex;
private:
template <typename TPixel, unsigned int VImageDimension>
void ItkProcessImage(const itk::Image<TPixel, VImageDimension> *inputImage);
};
}
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkManualSegmentationToSurfaceFilter.h b/Modules/Segmentation/Algorithms/mitkManualSegmentationToSurfaceFilter.h
index 61da918c05..6c937699db 100644
--- a/Modules/Segmentation/Algorithms/mitkManualSegmentationToSurfaceFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkManualSegmentationToSurfaceFilter.h
@@ -1,163 +1,164 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITKMANUALSEGMENTATIONTISURFACEFILTER_h__
#define _MITKMANUALSEGMENTATIONTISURFACEFILTER_h__
#include <MitkSegmentationExports.h>
#include <mitkImageToSurfaceFilter.h>
#include <vtkImageGaussianSmooth.h>
#include <vtkImageMedian3D.h>
#include <vtkImageResample.h>
#include <vtkImageThreshold.h>
namespace mitk
{
/**
* @brief Supplies a 3D surface from pre-processed segmentation.
*
* The resulting surface depends on a filter pipeline based on vtkMedian (1) and a Gaussian filter with
* vtkImageGaussianSmooth (2).
* All voxel can be changed to an isotropic representation of the
* image (ATTANTION: the number of voxels in the will change). The
* resulting isotropic image has 1mm isotropic voxel by default. But
* can be varied freely.
*
* @ingroup ImageFilters
* @ingroup Process
*/
class MITKSEGMENTATION_EXPORT ManualSegmentationToSurfaceFilter : public ImageToSurfaceFilter
{
public:
mitkClassMacro(ManualSegmentationToSurfaceFilter, ImageToSurfaceFilter);
typedef double vtkDouble;
/**
* Will pre-process a segmentation voxelwise. The segmentation can use
* a hole fill relating a median filter and smooth by a Gaussian
* filter.
* The image can be interpolated to an isotropic image.
* By default every filter is disabled.
* This method calls CreateSurface from mitkImageToSurfaceFilter and
* does not need a manual call since we use Update().
*/
void GenerateData() override;
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* Supplies a method for setting median filter by a bool value.
*/
itkSetMacro(MedianFilter3D, bool);
/**
* Return state if median filter is enabled.
*/
itkGetConstMacro(MedianFilter3D, bool);
/**
* Enable the median filter (first filter in pipeline).
*/
itkBooleanMacro(MedianFilter3D);
/**
* Supplies a method to enable Interpolation.
*/
itkSetMacro(Interpolation, bool);
/**
* Returns activation state of interpolation filter.
*/
itkGetConstMacro(Interpolation, bool);
/**
* Enable the interpolation filter (second filter in pipeline) for
* isotropic voxel.
*/
itkBooleanMacro(Interpolation);
/**
* Supplies a method for Gaussian filter (third filter in pipeline).
*/
itkSetMacro(UseGaussianImageSmooth, bool);
/**
* Returns activation state of standard deviation filter.
*/
itkGetConstMacro(UseGaussianImageSmooth, bool);
/**
* Enables Gaussian image smooth. As well the threshold for the
* CreateSurface() method will raise the threshold to 49 and changes
* the image range set from 0 to 100. It is made for reasons in
* binary images to prevent conflicts with the used filter. There are
* better results for dividing fore- and background.
*/
itkBooleanMacro(UseGaussianImageSmooth);
/**
* Set standard deviation for Gaussian Filter.
* @param _arg by default 1.5
*/
itkSetMacro(GaussianStandardDeviation, double);
/**
* Returns the standard deviation of the Gaussian filter which will be
* used when filter is enabled.
*/
itkGetConstMacro(GaussianStandardDeviation, double);
/**
* Set the Kernel for Median3DFilter. By default kernel is set to 3x3x3.
* If you choose '1' nothing will be processed in this direction.
*/
void SetMedianKernelSize(int x, int y, int z);
/**
* Returns the kernel size in the first direction.
*/
itkGetConstMacro(MedianKernelSizeX, int);
/**
* Returns the kernel size in the second direction.
*/
itkGetConstMacro(MedianKernelSizeY, int);
/**
* Returns the kernel size in the third direction.
*/
itkGetConstMacro(MedianKernelSizeZ, int);
/**
* Set the values for Spacing in X, Y and Z-Dimension
*/
void SetInterpolation(vtkDouble x, vtkDouble y, vtkDouble z);
protected:
ManualSegmentationToSurfaceFilter();
~ManualSegmentationToSurfaceFilter() override;
bool m_MedianFilter3D;
int m_MedianKernelSizeX, m_MedianKernelSizeY, m_MedianKernelSizeZ;
bool m_UseGaussianImageSmooth; // Gaussian Filter
double m_GaussianStandardDeviation;
bool m_Interpolation;
vtkDouble m_InterpolationX;
vtkDouble m_InterpolationY;
vtkDouble m_InterpolationZ;
}; // namespace
}
#endif //_MITKMANUALSEGMENTATIONTISURFACEFILTER_h__
diff --git a/Modules/Segmentation/Algorithms/mitkOtsuSegmentationFilter.h b/Modules/Segmentation/Algorithms/mitkOtsuSegmentationFilter.h
index 97861021ad..d5ffcb7db2 100644
--- a/Modules/Segmentation/Algorithms/mitkOtsuSegmentationFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkOtsuSegmentationFilter.h
@@ -1,83 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkOtsuSegmentationFilter_h_Included
#define mitkOtsuSegmentationFilter_h_Included
//#include "MitkSBExports.h"
#include "mitkITKImageImport.h"
#include "mitkImage.h"
#include "mitkImageToImageFilter.h"
#include "itkImage.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
/**
\brief A filter that performs a multiple threshold otsu image segmentation.
This class being an mitk::ImageToImageFilter performs a multiple threshold otsu image segmentation based on the
image histogram.
Internally, the itk::OtsuMultipleThresholdsImageFilter is used.
$Author: somebody$
*/
class MITKSEGMENTATION_EXPORT OtsuSegmentationFilter : public ImageToImageFilter
{
public:
typedef unsigned char OutputPixelType;
typedef itk::Image<OutputPixelType, 3> itkOutputImageType;
typedef mitk::ITKImageImport<itkOutputImageType> ImageConverterType;
mitkClassMacro(OtsuSegmentationFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkGetMacro(NumberOfThresholds, unsigned int);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkGetMacro(NumberOfThresholds, unsigned int);
void SetNumberOfThresholds(unsigned int number)
{
if (number < 1)
{
MITK_WARN << "Tried to set an invalid number of thresholds in the OtsuSegmentationFilter.";
return;
}
m_NumberOfThresholds = number;
}
void SetValleyEmphasis(bool useValley) { m_ValleyEmphasis = useValley; }
void SetNumberOfBins(unsigned int number)
{
if (number < 1)
{
MITK_WARN << "Tried to set an invalid number of bins in the OtsuSegmentationFilter.";
return;
}
m_NumberOfBins = number;
}
protected:
OtsuSegmentationFilter();
~OtsuSegmentationFilter() override;
void GenerateData() override;
// virtual void GenerateOutputInformation();
private:
unsigned int m_NumberOfThresholds;
bool m_ValleyEmphasis;
unsigned int m_NumberOfBins;
}; // class
} // namespace
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkOverwriteDirectedPlaneImageFilter.h b/Modules/Segmentation/Algorithms/mitkOverwriteDirectedPlaneImageFilter.h
index ab8206fc04..2b112b0337 100644
--- a/Modules/Segmentation/Algorithms/mitkOverwriteDirectedPlaneImageFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkOverwriteDirectedPlaneImageFilter.h
@@ -1,119 +1,120 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkOverwriteDirectedPlaneImageFilter_h_Included
#define mitkOverwriteDirectedPlaneImageFilter_h_Included
#include "mitkCommon.h"
#include "mitkImageToImageFilter.h"
#include <MitkSegmentationExports.h>
#include <itkImage.h>
namespace mitk
{
/**
\deprecated This class is deprecated. Use mitkVtkImageOverwrite instead.
\sa mitkVtkImageOverwrite
\brief Writes a 2D slice into a 3D image.
\sa SegTool2D
\sa ContourTool
\sa ExtractImageFilter
\ingroup Process
\ingroup Reliver
There is a separate page describing the general design of QmitkInteractiveSegmentation: \ref
QmitkInteractiveSegmentationTechnicalPage
This class takes a 3D mitk::Image as input and tries to replace one slice in it with the second input image, which
is specified
by calling SetSliceImage with a 2D mitk::Image.
Two parameters determine which slice is replaced: the "slice dimension" is that one, which is constant for all
points in the plane, e.g. axial would mean 2.
The "slice index" is the slice index in the image direction you specified with "affected dimension". Indices count
from zero.
This class works with all kind of image types, the only restrictions being that the input is 3D, and the slice image
is 2D.
If requested by SetCreateUndoInformation(true), this class will create instances of ApplyDiffImageOperation for the
undo stack.
These operations will (on user request) be executed by DiffImageApplier to perform undo.
Last contributor: $Author: maleike $
*/
class MITKSEGMENTATION_EXPORT OverwriteDirectedPlaneImageFilter : public ImageToImageFilter
{
public:
mitkClassMacro(OverwriteDirectedPlaneImageFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
\brief Which plane to overwrite
*/
const BaseGeometry *GetPlaneGeometry3D() const
{
return m_PlaneGeometry;
}
void SetPlaneGeometry3D(const BaseGeometry *geometry) { m_PlaneGeometry = geometry; }
/**
\brief Time step of the slice to overwrite
*/
itkSetMacro(TimeStep, unsigned int);
itkGetConstMacro(TimeStep, unsigned int);
/**
\brief Whether to create undo operation in the MITK undo stack
*/
itkSetMacro(CreateUndoInformation, bool);
itkGetConstMacro(CreateUndoInformation, bool);
itkSetObjectMacro(SliceImage, Image);
const Image *GetSliceImage() { return m_SliceImage.GetPointer(); }
const Image *GetLastDifferenceImage() { return m_SliceDifferenceImage.GetPointer(); }
protected:
OverwriteDirectedPlaneImageFilter(); // purposely hidden
~OverwriteDirectedPlaneImageFilter() override;
void GenerateData() override;
template <typename TPixel, unsigned int VImageDimension>
void ItkSliceOverwriting(itk::Image<TPixel, VImageDimension> *input3D);
template <typename TPixel, unsigned int VImageDimension>
void ItkImageSwitch(itk::Image<TPixel, VImageDimension> *image);
template <typename TPixel1, unsigned int VImageDimension1, typename TPixel2, unsigned int VImageDimension2>
void ItkImageProcessing(itk::Image<TPixel1, VImageDimension1> *itkImage1,
itk::Image<TPixel2, VImageDimension2> *itkImage2);
// std::string EventDescription( unsigned int sliceDimension, unsigned int sliceIndex, unsigned int timeStep );
Image::ConstPointer m_SliceImage;
Image::Pointer m_SliceDifferenceImage;
const BaseGeometry *m_PlaneGeometry;
const BaseGeometry *m_ImageGeometry3D;
unsigned int m_TimeStep;
unsigned int m_Dimension0;
unsigned int m_Dimension1;
bool m_CreateUndoInformation;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkOverwriteSliceImageFilter.h b/Modules/Segmentation/Algorithms/mitkOverwriteSliceImageFilter.h
index 40c2de9d15..bbd80153ad 100644
--- a/Modules/Segmentation/Algorithms/mitkOverwriteSliceImageFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkOverwriteSliceImageFilter.h
@@ -1,123 +1,124 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkOverwriteSliceImageFilter_h_Included
#define mitkOverwriteSliceImageFilter_h_Included
#include "mitkCommon.h"
#include "mitkImageToImageFilter.h"
#include <MitkSegmentationExports.h>
#include <itkImage.h>
namespace mitk
{
/**
\deprecated This class is deprecated. Use mitkVtkImageOverwrite instead.
\sa mitkVtkImageOverwrite
\brief Writes a 2D slice into a 3D image.
\sa SegTool2D
\sa ContourTool
\sa ExtractImageFilter
\ingroup Process
\ingroup ToolManagerEtAl
There is a separate page describing the general design of QmitkInteractiveSegmentation: \ref
QmitkInteractiveSegmentationTechnicalPage
This class takes a 3D mitk::Image as input and tries to replace one slice in it with the second input image, which
is specified
by calling SetSliceImage with a 2D mitk::Image.
Two parameters determine which slice is replaced: the "slice dimension" is that one, which is constant for all
points in the plane, e.g. axial would mean 2.
The "slice index" is the slice index in the image direction you specified with "affected dimension". Indices count
from zero.
This class works with all kind of image types, the only restrictions being that the input is 3D, and the slice image
is 2D.
If requested by SetCreateUndoInformation(true), this class will create instances of ApplyDiffImageOperation for the
undo stack.
These operations will (on user request) be executed by DiffImageApplier to perform undo.
Last contributor: $Author$
*/
class MITKSEGMENTATION_EXPORT OverwriteSliceImageFilter : public ImageToImageFilter
{
public:
mitkClassMacro(OverwriteSliceImageFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
\brief Which slice to overwrite (first one has index 0).
*/
itkSetMacro(SliceIndex, unsigned int);
itkGetConstMacro(SliceIndex, unsigned int);
/**
\brief The orientation of the slice to overwrite.
\a Parameter \a SliceDimension Number of the dimension which is constant for all pixels of the desired slices
(e.g. 0 for axial)
*/
itkSetMacro(SliceDimension, unsigned int);
itkGetConstMacro(SliceDimension, unsigned int);
/**
\brief Time step of the slice to overwrite
*/
itkSetMacro(TimeStep, unsigned int);
itkGetConstMacro(TimeStep, unsigned int);
/**
\brief Whether to create undo operation in the MITK undo stack
*/
itkSetMacro(CreateUndoInformation, bool);
itkGetConstMacro(CreateUndoInformation, bool);
itkSetObjectMacro(SliceImage, Image);
const Image *GetSliceImage() { return m_SliceImage.GetPointer(); }
const Image *GetLastDifferenceImage() { return m_SliceDifferenceImage.GetPointer(); }
protected:
OverwriteSliceImageFilter(); // purposely hidden
~OverwriteSliceImageFilter() override;
void GenerateData() override;
template <typename TPixel, unsigned int VImageDimension>
void ItkImageSwitch(itk::Image<TPixel, VImageDimension> *image);
template <typename TPixel1, unsigned int VImageDimension1, typename TPixel2, unsigned int VImageDimension2>
void ItkImageProcessing(const itk::Image<TPixel1, VImageDimension1> *itkImage1,
itk::Image<TPixel2, VImageDimension2> *itkImage2);
std::string EventDescription(unsigned int sliceDimension, unsigned int sliceIndex, unsigned int timeStep);
Image::ConstPointer m_SliceImage;
Image::Pointer m_SliceDifferenceImage;
unsigned int m_SliceIndex;
unsigned int m_SliceDimension;
unsigned int m_TimeStep;
unsigned int m_Dimension0;
unsigned int m_Dimension1;
bool m_CreateUndoInformation;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkSegmentationObjectFactory.h b/Modules/Segmentation/Algorithms/mitkSegmentationObjectFactory.h
index 7ca9e26b73..f204a8d24b 100644
--- a/Modules/Segmentation/Algorithms/mitkSegmentationObjectFactory.h
+++ b/Modules/Segmentation/Algorithms/mitkSegmentationObjectFactory.h
@@ -1,42 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef SEGMENTATIONOBJECTFACTORY_H_INCLUDED
#define SEGMENTATIONOBJECTFACTORY_H_INCLUDED
#include "mitkCoreObjectFactoryBase.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
class MITKSEGMENTATION_EXPORT SegmentationObjectFactory : public CoreObjectFactoryBase
{
public:
mitkClassMacro(SegmentationObjectFactory, CoreObjectFactoryBase);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) Mapper::Pointer
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self) Mapper::Pointer
CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
void SetDefaultProperties(mitk::DataNode *node) override;
const char *GetFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap() override;
const char *GetSaveFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap() override;
void RegisterIOFactories();
protected:
SegmentationObjectFactory();
void CreateFileExtensionsMap();
MultimapType m_FileExtensionsMap;
MultimapType m_SaveFileExtensionsMap;
};
}
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkShapeBasedInterpolationAlgorithm.h b/Modules/Segmentation/Algorithms/mitkShapeBasedInterpolationAlgorithm.h
index 891b91e483..934271b89b 100644
--- a/Modules/Segmentation/Algorithms/mitkShapeBasedInterpolationAlgorithm.h
+++ b/Modules/Segmentation/Algorithms/mitkShapeBasedInterpolationAlgorithm.h
@@ -1,64 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkShapeBasedInterpolationAlgorithm_h_Included
#define mitkShapeBasedInterpolationAlgorithm_h_Included
#include "mitkSegmentationInterpolationAlgorithm.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
/**
* \brief Shape-based binary image interpolation.
*
* This class uses legacy code from ipSegmentation to implement
* the shape-based interpolation algorithm described in
*
* G.T. Herman, J. Zheng, C.A. Bucholtz: "Shape-based interpolation"
* IEEE Computer Graphics & Applications, pp. 69-79,May 1992
*
* Last contributor:
* $Author:$
*/
class MITKSEGMENTATION_EXPORT ShapeBasedInterpolationAlgorithm : public SegmentationInterpolationAlgorithm
{
public:
mitkClassMacro(ShapeBasedInterpolationAlgorithm, SegmentationInterpolationAlgorithm);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
Image::Pointer Interpolate(Image::ConstPointer lowerSlice,
unsigned int lowerSliceIndex,
Image::ConstPointer upperSlice,
unsigned int upperSliceIndex,
unsigned int requestedIndex,
unsigned int sliceDimension,
Image::Pointer resultImage,
unsigned int timeStep,
Image::ConstPointer referenceImage) override;
private:
typedef itk::Image<mitk::ScalarType, 2> DistanceFilterImageType;
template <typename TPixel, unsigned int VImageDimension>
void ComputeDistanceMap(const itk::Image<TPixel, VImageDimension> *, mitk::Image::Pointer &result);
template <typename TPixel, unsigned int VImageDimension>
void InterpolateIntermediateSlice(itk::Image<TPixel, VImageDimension> *result,
const mitk::Image::Pointer &lowerDistanceImage,
const mitk::Image::Pointer &upperDistanceImage,
float ratio);
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkShowSegmentationAsSurface.h b/Modules/Segmentation/Algorithms/mitkShowSegmentationAsSurface.h
index fe67e75e6e..1f9e96975a 100644
--- a/Modules/Segmentation/Algorithms/mitkShowSegmentationAsSurface.h
+++ b/Modules/Segmentation/Algorithms/mitkShowSegmentationAsSurface.h
@@ -1,50 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_SHOW_SEGMENTATION_AS_SURFACE_H_INCLUDET_WAD
#define MITK_SHOW_SEGMENTATION_AS_SURFACE_H_INCLUDET_WAD
#include "mitkSegmentationSink.h"
#include "mitkSurface.h"
#include "mitkUIDGenerator.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
class MITKSEGMENTATION_EXPORT ShowSegmentationAsSurface : public SegmentationSink
{
public:
- mitkClassMacro(ShowSegmentationAsSurface, SegmentationSink) mitkAlgorithmNewMacro(ShowSegmentationAsSurface);
+ mitkClassMacro(ShowSegmentationAsSurface, SegmentationSink);
+ mitkAlgorithmNewMacro(ShowSegmentationAsSurface);
protected:
ShowSegmentationAsSurface(); // use smart pointers
~ShowSegmentationAsSurface() override;
void Initialize(const NonBlockingAlgorithm *other = nullptr) override;
bool ReadyToRun() override;
bool ThreadedUpdateFunction() override; // will be called from a thread after calling StartAlgorithm
void ThreadedUpdateSuccessful() override; // will be called from a thread after calling StartAlgorithm
private:
mitk::Surface::Pointer ConvertBinaryImageToSurface(mitk::Image::Pointer binaryImage);
UIDGenerator m_UIDGeneratorSurfaces;
std::vector<DataNode::Pointer> m_SurfaceNodes;
bool m_IsLabelSetImage;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Controllers/mitkSegmentationInterpolationController.h b/Modules/Segmentation/Controllers/mitkSegmentationInterpolationController.h
index 54ad2a9d0b..fe5c96c85f 100644
--- a/Modules/Segmentation/Controllers/mitkSegmentationInterpolationController.h
+++ b/Modules/Segmentation/Controllers/mitkSegmentationInterpolationController.h
@@ -1,222 +1,223 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkSegmentationInterpolationController_h_Included
#define mitkSegmentationInterpolationController_h_Included
#include "mitkCommon.h"
#include "mitkImage.h"
#include <MitkSegmentationExports.h>
#include <itkImage.h>
#include <itkObjectFactory.h>
#include <map>
#include <vector>
namespace mitk
{
class Image;
/**
\brief Generates interpolations of 2D slices.
\sa QmitkSlicesInterpolator
\sa QmitkInteractiveSegmentation
\ingroup ToolManagerEtAl
There is a separate page describing the general design of QmitkInteractiveSegmentation: \ref
QmitkInteractiveSegmentationTechnicalPage
This class keeps track of the contents of a 3D segmentation image.
\attention mitk::SegmentationInterpolationController assumes that the image contains pixel values of 0 and 1.
After you set the segmentation image using SetSegmentationVolume(), the whole image is scanned for pixels other than
0.
SegmentationInterpolationController registers as an observer to the segmentation image, and repeats the scan
whenvever the
image is modified.
You can prevent this (time consuming) scan if you do the changes slice-wise and send difference images to
SegmentationInterpolationController.
For this purpose SetChangedSlice() should be used. mitk::OverwriteImageFilter already does this every time it
changes a
slice of an image. There is a static method InterpolatorForImage(), which can be used to find out if there already
is an interpolator
instance for a specified image. OverwriteImageFilter uses this to get to know its interpolator.
SegmentationInterpolationController needs to maintain some information about the image slices (in every dimension).
This information is stored internally in m_SegmentationCountInSlice, which is basically three std::vectors (one for
each dimension).
Each item describes one image dimension, each vector item holds the count of pixels in "its" slice. This is perhaps
better to understand
from the following picture (where red items just mean to symbolize "there is some segmentation" - in reality there
is an integer count).
\image html slice_based_segmentation_interpolator.png
$Author$
*/
class MITKSEGMENTATION_EXPORT SegmentationInterpolationController : public itk::Object
{
public:
mitkClassMacroItkParent(SegmentationInterpolationController, itk::Object);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
\brief Find interpolator for a given image.
\return nullptr if there is no interpolator yet.
This method is useful if several "clients" modify the same image and want to access the interpolations.
Then they can share the same object.
*/
static SegmentationInterpolationController *InterpolatorForImage(const Image *);
/**
\brief Block reaction to an images Modified() events.
Blocking the scan of the whole image is especially useful when you are about to change a single slice
of the image. Then you would send a difference image of this single slice to SegmentationInterpolationController
but call image->Modified() anyway. Before calling image->Modified() you should block
SegmentationInterpolationController's reactions to this modified by using this method.
*/
void BlockModified(bool);
/**
\brief Initialize with a whole volume.
Will scan the volume for segmentation pixels (values other than 0) and fill some internal data structures.
You don't have to call this method every time something changes, but only
when several slices at once change.
When you change a single slice, call SetChangedSlice() instead.
*/
void SetSegmentationVolume(const Image *segmentation);
/**
\brief Set a reference image (original patient image) - optional.
If this volume is set (must exactly match the dimensions of the segmentation),
the interpolation algorithm may consider image content to improve the interpolated
(estimated) segmentation.
*/
void SetReferenceVolume(const Image *segmentation);
/**
\brief Update after changing a single slice.
\param sliceDiff is a 2D image with the difference image of the slice determined by sliceDimension and sliceIndex.
The difference is (pixel value in the new slice minus pixel value in the old slice).
\param sliceDimension Number of the dimension which is constant for all pixels of the meant slice.
\param sliceIndex Which slice to take, in the direction specified by sliceDimension. Count starts from 0.
\param timeStep Which time step is changed
*/
void SetChangedSlice(const Image *sliceDiff,
unsigned int sliceDimension,
unsigned int sliceIndex,
unsigned int timeStep);
void SetChangedVolume(const Image *sliceDiff, unsigned int timeStep);
/**
\brief Generates an interpolated image for the given slice.
\param sliceDimension Number of the dimension which is constant for all pixels of the meant slice.
\param sliceIndex Which slice to take, in the direction specified by sliceDimension. Count starts from 0.
\param timeStep Which time step to use
*/
Image::Pointer Interpolate(unsigned int sliceDimension,
unsigned int sliceIndex,
const mitk::PlaneGeometry *currentPlane,
unsigned int timeStep);
void OnImageModified(const itk::EventObject &);
/**
* Activate/Deactivate the 2D interpolation.
*/
void Activate2DInterpolation(bool);
/**
\brief Get existing instance or create a new one
*/
static SegmentationInterpolationController *GetInstance();
protected:
/**
\brief Protected class of mitk::SegmentationInterpolationController. Don't use (you shouldn't be able to do so)!
*/
class MITKSEGMENTATION_EXPORT SetChangedSliceOptions
{
public:
SetChangedSliceOptions(
unsigned int sd, unsigned int si, unsigned int d0, unsigned int d1, unsigned int t, const void *pixels)
: sliceDimension(sd), sliceIndex(si), dim0(d0), dim1(d1), timeStep(t), pixelData(pixels)
{
}
unsigned int sliceDimension;
unsigned int sliceIndex;
unsigned int dim0;
unsigned int dim1;
unsigned int timeStep;
const void *pixelData;
};
typedef std::vector<unsigned int> DirtyVectorType;
// typedef std::vector< DirtyVectorType[3] > TimeResolvedDirtyVectorType; // cannot work with C++, so next line is
// used for implementation
typedef std::vector<std::vector<DirtyVectorType>> TimeResolvedDirtyVectorType;
typedef std::map<const Image *, SegmentationInterpolationController *> InterpolatorMapType;
SegmentationInterpolationController(); // purposely hidden
~SegmentationInterpolationController() override;
/// internal scan of a single slice
template <typename DATATYPE>
void ScanChangedSlice(const itk::Image<DATATYPE, 2> *, const SetChangedSliceOptions &options);
template <typename TPixel, unsigned int VImageDimension>
void ScanChangedVolume(const itk::Image<TPixel, VImageDimension> *, unsigned int timeStep);
template <typename DATATYPE>
void ScanWholeVolume(const itk::Image<DATATYPE, 3> *, const Image *volume, unsigned int timeStep);
void PrintStatus();
/**
An array of flags. One for each dimension of the image. A flag is set, when a slice in a certain dimension
has at least one pixel that is not 0 (which would mean that it has to be considered by the interpolation
algorithm).
E.g. flags for axial slices are stored in m_SegmentationCountInSlice[0][index].
Enhanced with time steps it is now m_SegmentationCountInSlice[timeStep][0][index]
*/
TimeResolvedDirtyVectorType m_SegmentationCountInSlice;
static InterpolatorMapType s_InterpolatorForImage;
Image::ConstPointer m_Segmentation;
Image::ConstPointer m_ReferenceImage;
bool m_BlockModified;
bool m_2DInterpolationActivated;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Controllers/mitkSliceBasedInterpolationController.h b/Modules/Segmentation/Controllers/mitkSliceBasedInterpolationController.h
index f170200134..ba89047e97 100644
--- a/Modules/Segmentation/Controllers/mitkSliceBasedInterpolationController.h
+++ b/Modules/Segmentation/Controllers/mitkSliceBasedInterpolationController.h
@@ -1,202 +1,203 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkSliceBasedInterpolationController_h_Included
#define mitkSliceBasedInterpolationController_h_Included
#include "mitkLabelSetImage.h"
#include <MitkSegmentationExports.h>
#include <itkImage.h>
#include <itkObjectFactory.h>
#include <map>
#include <vector>
namespace mitk
{
class Image;
/**
\brief Generates interpolations of 2D slices.
\sa QmitkSlicesInterpolator
\sa QmitkInteractiveSegmentation
\ingroup ToolManagerEtAl
There is a separate page describing the general design of QmitkInteractiveSegmentation: \ref
QmitkInteractiveSegmentationTechnicalPage
This class keeps track of the contents of a 3D segmentation image.
\attention mitk::SliceBasedInterpolationController assumes that the image contains pixel values of 0 and 1.
After you set the segmentation image using SetSegmentationVolume(), the whole image is scanned for pixels other than
0.
SliceBasedInterpolationController registers as an observer to the segmentation image, and repeats the scan whenvever
the
image is modified.
You can prevent this (time consuming) scan if you do the changes slice-wise and send difference images to
SliceBasedInterpolationController.
For this purpose SetChangedSlice() should be used. mitk::OverwriteImageFilter already does this every time it
changes a
slice of an image. There is a static method InterpolatorForImage(), which can be used to find out if there already
is an interpolator
instance for a specified image. OverwriteImageFilter uses this to get to know its interpolator.
SliceBasedInterpolationController needs to maintain some information about the image slices (in every dimension).
This information is stored internally in m_SegmentationCountInSlice, which is basically three std::vectors (one for
each dimension).
Each item describes one image dimension, each vector item holds the count of pixels in "its" slice. This is perhaps
better to understand
from the following picture (where red items just mean to symbolize "there is some segmentation" - in reality there
is an integer count).
\image html slice_based_segmentation_interpolator.png
$Author$
*/
class MITKSEGMENTATION_EXPORT SliceBasedInterpolationController : public itk::Object
{
public:
- mitkClassMacroItkParent(SliceBasedInterpolationController, itk::Object) itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacroItkParent(SliceBasedInterpolationController, itk::Object);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
\brief Find interpolator for a given image.
\return nullptr if there is no interpolator yet.
This method is useful if several "clients" modify the same image and want to access the interpolations.
Then they can share the same object.
*/
static SliceBasedInterpolationController *InterpolatorForImage(const Image *);
/**
\brief Initialize with a whole volume.
Will scan the volume for segmentation pixels (values other than 0) and fill some internal data structures.
You don't have to call this method every time something changes, but only
when several slices at once change.
When you change a single slice, call SetChangedSlice() instead.
*/
void SetWorkingImage(LabelSetImage *image);
/**
\brief Set a reference image (original patient image) - optional.
If this image is set (must exactly match the dimensions of the segmentation),
the interpolation algorithm may consider image content to improve the interpolated
(estimated) segmentation.
*/
void SetReferenceImage(Image *image);
/**
\brief Update after changing a single slice in the working image.
\param image is a 2D image with the difference image of the slice determined by sliceDimension and sliceIndex.
The difference is (pixel value in the new slice minus pixel value in the old slice).
\param sliceDimension Number of the dimension which is constant for all pixels of the meant slice.
\param sliceIndex Which slice to take, in the direction specified by sliceDimension. Count starts from 0.
\param timeStep Which time step is changed
*/
void SetChangedSlice(const Image *image,
unsigned int sliceDimension,
unsigned int sliceIndex,
unsigned int timeStep);
/**
\brief Update after changing the whole working image.
\param image is a 3D image with the difference image of the slice determined by sliceDimension and sliceIndex.
The difference is (pixel value in the new slice minus pixel value in the old slice).
\param timeStep Which time step is changed
*/
// void SetChangedImage( const Image* image, unsigned int timeStep );
/**
\brief Generates an interpolated image for the given slice.
\param sliceDimension Number of the dimension which is constant for all pixels of the meant slice.
\param sliceIndex Which slice to take, in the direction specified by sliceDimension. Count starts from 0.
\param timeStep Which time step to use
*/
Image::Pointer Interpolate(unsigned int sliceDimension,
unsigned int sliceIndex,
const mitk::PlaneGeometry *currentPlane,
unsigned int timeStep);
/**
\brief Initializes the internal container with the number of voxels per label.
*/
void ResetLabelCount();
protected:
/**
\brief Protected class of mitk::SliceBasedInterpolationController. Don't use (you shouldn't be able to do so)!
*/
class MITKSEGMENTATION_EXPORT SetChangedSliceOptions
{
public:
SetChangedSliceOptions(unsigned int sd, unsigned int si, unsigned int d0, unsigned int d1, unsigned int t)
: sliceDimension(sd), sliceIndex(si), dim0(d0), dim1(d1), timeStep(t)
{
}
unsigned int sliceDimension;
unsigned int sliceIndex;
unsigned int dim0;
unsigned int dim1;
unsigned int timeStep;
// void* pixelData;
};
typedef std::vector<unsigned int> LabelCounterVectorType;
typedef std::vector<LabelCounterVectorType> LabelCounterSliceVectorType;
typedef std::vector<std::vector<LabelCounterSliceVectorType>> LabelCounterSliceTimeVectorType;
typedef std::map<const Image *, SliceBasedInterpolationController *> InterpolatorMapType;
SliceBasedInterpolationController(); // purposely hidden
~SliceBasedInterpolationController() override;
/// internal scan of a single slice
template <typename PixelType>
void ScanSliceITKProcessing(const itk::Image<PixelType, 2> *, const SetChangedSliceOptions &options);
/// internal scan of the whole image
template <typename TPixel, unsigned int VImageDimension>
void ScanImageITKProcessing(itk::Image<TPixel, VImageDimension> *, unsigned int timeStep);
/**
An array that of flags. One for each dimension of the image. A flag is set, when a slice in a certain dimension
has at least one pixel that is not 0 (which would mean that it has to be considered by the interpolation
algorithm).
E.g. flags for axial slices are stored in m_SegmentationCountInSlice[0][index].
Enhanced with time steps it is now m_SegmentationCountInSlice[timeStep][0][index]
*/
LabelCounterSliceTimeVectorType m_LabelCountInSlice;
static InterpolatorMapType s_InterpolatorForImage;
LabelSetImage::Pointer m_WorkingImage;
Image::Pointer m_ReferenceImage;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Controllers/mitkToolManagerProvider.h b/Modules/Segmentation/Controllers/mitkToolManagerProvider.h
index 3459559e5a..783e270765 100644
--- a/Modules/Segmentation/Controllers/mitkToolManagerProvider.h
+++ b/Modules/Segmentation/Controllers/mitkToolManagerProvider.h
@@ -1,74 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_TOOLMANAGERPROVIDER_H
#define MITK_TOOLMANAGERPROVIDER_H
#include <MitkSegmentationExports.h>
#include <mitkServiceInterface.h>
#include <usModuleContext.h>
#include "mitkToolManager.h"
#include <itkObjectFactory.h>
#include <mitkCommon.h>
namespace mitk
{
class SegmentationModuleActivator;
/**
\brief Micro Service Singleton to get an instance of mitk::ToolManager
\sa ToolManager
Implemented as a singleton to have implicitly only one instance of ToolManager.
Use this service to make sure your Tools are managed by the object.
\note Can only be instantiated by SegmentationModuleActivator. The common way to get the ToolManager is by
<code> mitk::ToolManager* toolManager = mitk::ToolManagerProvider::GetInstance()->GetToolManager(); </code>
*/
class MITKSEGMENTATION_EXPORT ToolManagerProvider : public itk::LightObject
{
public:
mitkClassMacroItkParent(ToolManagerProvider, itk::LightObject);
/**
\brief Returns ToolManager object.
\note As this service is implemented as a singleton there is always the same ToolManager instance returned.
*/
virtual mitk::ToolManager *GetToolManager();
/**
\brief Returns an instance of ToolManagerProvider service.
*/
static mitk::ToolManagerProvider *GetInstance();
// ONLY SegmentationModuleActivator is able to create instances of the service.
friend class mitk::SegmentationModuleActivator;
protected:
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
// hide everything
ToolManagerProvider();
~ToolManagerProvider() override;
ToolManagerProvider(const ToolManagerProvider &);
ToolManagerProvider &operator=(const ToolManagerProvider &);
mitk::ToolManager::Pointer m_ToolManager;
};
}
MITK_DECLARE_SERVICE_INTERFACE(mitk::ToolManagerProvider, "org.mitk.services.ToolManagerProvider")
#endif
diff --git a/Modules/Segmentation/DataManagement/mitkContour.h b/Modules/Segmentation/DataManagement/mitkContour.h
index 0d5cc95377..ed484ff586 100644
--- a/Modules/Segmentation/DataManagement/mitkContour.h
+++ b/Modules/Segmentation/DataManagement/mitkContour.h
@@ -1,178 +1,180 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_CONTOUR_H_
#define _MITK_CONTOUR_H_
#include "mitkBaseData.h"
#include "mitkCommon.h"
#include <MitkSegmentationExports.h>
#include <vtkRenderWindow.h>
#include <itkPolyLineParametricPath.h>
namespace mitk
{
/**
\brief Stores vertices for drawing a contour.
\deprecated Use class mitk::ContourModel instead.
\sa ContourModel
*/
class MITKSEGMENTATION_EXPORT Contour : public BaseData
{
public:
mitkClassMacro(Contour, BaseData);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
typedef itk::PolyLineParametricPath<3> PathType;
typedef PathType::Pointer PathPointer;
typedef PathType::ContinuousIndexType ContinuousIndexType;
typedef PathType::InputType InputType;
typedef PathType::OutputType OutputType;
typedef PathType::OffsetType OffsetType;
typedef itk::
BoundingBox<unsigned long, 3, ScalarType, itk::VectorContainer<unsigned long, mitk::Point<ScalarType, 3>>>
BoundingBoxType;
typedef BoundingBoxType::PointsContainer PointsContainer;
typedef BoundingBoxType::PointsContainer::Pointer PointsContainerPointer;
typedef BoundingBoxType::PointsContainerIterator PointsContainerIterator;
/**
* sets whether the contour should be closed or open.
* by default the contour is closed
*/
itkSetMacro(Closed, bool);
/**
* returns if the contour is closed or opened
*/
itkGetMacro(Closed, bool);
itkSetMacro(Selected, bool);
itkGetMacro(Selected, bool);
itkSetMacro(Width, float);
itkGetMacro(Width, float);
/**
* clean up the contour data
*/
void Initialize() override;
/**
* add a new vertex to the contour
*/
void AddVertex(mitk::Point3D newPoint);
/**
* return an itk parametric path of the contour
*/
PathPointer GetContourPath() const;
/**
* set the current render window. This is helpful if one
* wants to draw the contour in one special window only.
*/
void SetCurrentWindow(vtkRenderWindow *rw);
/**
* returns the points to the current render window
*/
vtkRenderWindow *GetCurrentWindow() const;
/**
* returns the number of points stored in the contour
*/
unsigned int GetNumberOfPoints() const;
/**
* returns the container of the contour points
*/
PointsContainerPointer GetPoints() const;
/**
* set the contour points container.
*/
void SetPoints(PointsContainerPointer points);
/**
* intherited from parent
*/
void UpdateOutputInformation() override;
/**
* intherited from parent
*/
void SetRequestedRegionToLargestPossibleRegion() override;
/**
* intherited from parent
*/
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
/**
* intherited from parent
*/
bool VerifyRequestedRegion() override;
/**
* intherited from parent
*/
void SetRequestedRegion(const itk::DataObject *data) override;
protected:
mitkCloneMacro(Self);
Contour();
Contour(const Contour &other);
~Contour() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
private:
/**
* parametric path of a contour;
*/
PathType::Pointer m_ContourPath;
/**
* the current render window
*/
vtkRenderWindow *m_CurrentWindow;
/**
* the bounding box of the contour
*/
BoundingBoxType::Pointer m_BoundingBox;
/**
* container for all contour points
*/
BoundingBoxType::PointsContainer::Pointer m_Vertices;
/**
* decide whether th contour is open or closed
*/
bool m_Closed;
bool m_Selected;
float m_Width;
};
} // namespace mitk
#endif //_MITK_CONTOUR_H_
diff --git a/Modules/Segmentation/DataManagement/mitkContourSet.h b/Modules/Segmentation/DataManagement/mitkContourSet.h
index 851303c472..d807990bc2 100644
--- a/Modules/Segmentation/DataManagement/mitkContourSet.h
+++ b/Modules/Segmentation/DataManagement/mitkContourSet.h
@@ -1,105 +1,107 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_CONTOUR_SET_H_
#define _MITK_CONTOUR_SET_H_
#include "mitkBaseData.h"
#include "mitkCommon.h"
#include "mitkContour.h"
#include <MitkSegmentationExports.h>
#include <map>
namespace mitk
{
/**
* This class holds stores vertices for drawing a contour
*
*/
class MITKSEGMENTATION_EXPORT ContourSet : public BaseData
{
public:
mitkClassMacro(ContourSet, BaseData);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
typedef std::map<unsigned long, Contour::Pointer> ContourVectorType;
typedef ContourVectorType::iterator ContourIterator;
typedef itk::BoundingBox<unsigned long, 3, ScalarType> BoundingBoxType;
/**
* clean up the contour data
*/
void Initialize() override;
/**
* add a contour
*/
void AddContour(unsigned int index, mitk::Contour::Pointer contour);
/**
* add a contour
*/
void RemoveContour(unsigned long index);
/**
* returns the number of points stored in the contour
*/
unsigned int GetNumberOfContours();
/**
* returns the container of the contour points
*/
ContourVectorType GetContours();
/**
* intherited from parent
*/
void UpdateOutputInformation() override;
/**
* intherited from parent
*/
void SetRequestedRegionToLargestPossibleRegion() override;
/**
* intherited from parent
*/
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
/**
* intherited from parent
*/
bool VerifyRequestedRegion() override;
/**
* intherited from parent
*/
void SetRequestedRegion(const itk::DataObject *data) override;
protected:
ContourSet();
~ContourSet() override;
private:
/**
* the bounding box of the contour
*/
BoundingBoxType::Pointer m_BoundingBox;
ContourVectorType m_ContourVector;
};
} // namespace mitk
#endif //_MITK_CONTOUR_SET_H_
diff --git a/Modules/Segmentation/DataManagement/mitkExtrudedContour.h b/Modules/Segmentation/DataManagement/mitkExtrudedContour.h
index 1f401a45d9..0d50912071 100644
--- a/Modules/Segmentation/DataManagement/mitkExtrudedContour.h
+++ b/Modules/Segmentation/DataManagement/mitkExtrudedContour.h
@@ -1,126 +1,127 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKEXTRUDEDCONTOUR_H_HEADER_INCLUDED
#define MITKEXTRUDEDCONTOUR_H_HEADER_INCLUDED
#include "mitkBoundingObject.h"
#include <MitkSegmentationExports.h>
#include <mitkContour.h>
#include <mitkPlaneGeometry.h>
#include <vtkConfigure.h>
#include <vtkVersionMacros.h>
class vtkLinearExtrusionFilter;
class vtkPlanes;
class vtkClipPolyData;
class vtkLinearSubdivisionFilter;
class vtkTriangleFilter;
class vtkDecimatePro;
class vtkPolygon;
namespace mitk
{
//##Documentation
//## @brief Data class containing a bounding-object created by
//## extruding a Contour along a vector
//##
//## The m_Contour is extruded in the direction m_Vector until
//## reaching m_ClippingGeometry.
//## @ingroup Data
/**
* \deprecatedSince{2015_05} ExtrudedContour is deprecated. It will be removed in the next release.
* Becomes obsolete. Refer to http://docs.mitk.org/nightly/InteractionMigration.html .
*/
class MITKSEGMENTATION_EXPORT ExtrudedContour : public BoundingObject
{
public:
mitkClassMacro(ExtrudedContour, BoundingObject);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
mitk::ScalarType GetVolume() override;
bool IsInside(const Point3D &p) const override;
void UpdateOutputInformation() override;
//##Documentation
//## @brief Contour to extrude
itkGetConstObjectMacro(Contour, mitk::Contour);
itkSetObjectMacro(Contour, mitk::Contour);
//##Documentation
//## @brief Vector to specify the direction of the extrusion
mitkGetVectorMacro(Vector, mitk::Vector3D);
mitkSetVectorMacro(Vector, mitk::Vector3D);
itkGetConstMacro(AutomaticVectorGeneration, bool);
itkSetMacro(AutomaticVectorGeneration, bool);
itkBooleanMacro(AutomaticVectorGeneration);
//##Documentation
//## @brief Optional vector to specify the orientation of the bounding-box
mitkGetVectorMacro(RightVector, mitk::Vector3D);
mitkSetVectorMacro(RightVector, mitk::Vector3D);
//##Documentation
//## @brief Optional geometry for clipping the extruded contour
itkGetConstObjectMacro(ClippingGeometry, mitk::BaseGeometry);
itkSetObjectMacro(ClippingGeometry, mitk::BaseGeometry);
unsigned long GetMTime() const override;
protected:
ExtrudedContour();
~ExtrudedContour() override;
void BuildSurface();
void BuildGeometry();
mitk::Contour::Pointer m_Contour;
mitk::Vector3D m_Vector;
mitk::Vector3D m_RightVector;
mitk::BaseGeometry::Pointer m_ClippingGeometry;
bool m_AutomaticVectorGeneration;
vtkPolygon *m_Polygon;
#if ((VTK_MAJOR_VERSION > 4) || ((VTK_MAJOR_VERSION == 4) && (VTK_MINOR_VERSION >= 4)))
double m_ProjectedContourBounds[6];
#else
float m_ProjectedContourBounds[6];
#endif
mitk::PlaneGeometry::Pointer m_ProjectionPlane;
//##Documentation
//## @brief For fast projection on plane
float m_Right[3];
float m_Down[3];
#if ((VTK_MAJOR_VERSION > 4) || ((VTK_MAJOR_VERSION == 4) && (VTK_MINOR_VERSION >= 4)))
double m_Normal[3];
#else
float m_Normal[3];
#endif
float m_Origin[3];
vtkLinearExtrusionFilter *m_ExtrusionFilter;
vtkTriangleFilter *m_TriangleFilter;
vtkDecimatePro *m_Decimate;
vtkLinearSubdivisionFilter *m_SubdivisionFilter;
vtkPlanes *m_ClippingBox;
vtkClipPolyData *m_ClipPolyDataFilter;
itk::TimeStamp m_LastCalculateExtrusionTime;
};
}
#endif /* MITKEXTRUDEDCONTOUR_H_HEADER_INCLUDED */
diff --git a/Modules/Segmentation/Interactions/mitkAdaptiveRegionGrowingTool.h b/Modules/Segmentation/Interactions/mitkAdaptiveRegionGrowingTool.h
index 236a33f152..31797bffbc 100644
--- a/Modules/Segmentation/Interactions/mitkAdaptiveRegionGrowingTool.h
+++ b/Modules/Segmentation/Interactions/mitkAdaptiveRegionGrowingTool.h
@@ -1,127 +1,128 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkAdaptiveRegionGrowingTool_h_Included
#define mitkAdaptiveRegionGrowingTool_h_Included
#include "mitkAutoSegmentationTool.h"
#include "mitkCommon.h"
#include "mitkDataStorage.h"
#include "mitkPointSet.h"
#include "mitkSinglePointDataInteractor.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Dummy Tool for AdaptiveRegionGrowingToolGUI to get Tool functionality for AdaptiveRegionGrowing.
The actual logic is implemented in QmitkAdaptiveRegionGrowingToolGUI.
\ingroup ToolManagerEtAl
\sa mitk::Tool
\sa QmitkInteractiveSegmentation
*/
class MITKSEGMENTATION_EXPORT AdaptiveRegionGrowingTool : public AutoSegmentationTool
{
public:
/**
* @brief mitkClassMacro
*/
mitkClassMacro(AdaptiveRegionGrowingTool, AutoSegmentationTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
bool CanHandle(BaseData *referenceData) const override;
/**
* @brief Get XPM
* @return nullptr
*/
const char **GetXPM() const override;
/**
* @brief Get name
* @return name of the Tool
*/
const char *GetName() const override;
/**
* @brief Get icon resource
* @return the resource Object of the Icon
*/
us::ModuleResource GetIconResource() const override;
/**
* @brief Adds interactor for the seedpoint and creates a seedpoint if neccessary.
*
*
*/
void Activated() override;
/**
* @brief Removes all set points and interactors.
*
*
*/
void Deactivated() override;
/**
* @brief get pointset node
* @return the point set node
*/
virtual DataNode::Pointer GetPointSetNode();
/**
* @brief get reference data
* @return the current reference data.
*/
mitk::DataNode *GetReferenceData();
/**
* @brief Get working data
* @return a list of all working data.
*/
mitk::DataNode *GetWorkingData();
/**
* @brief Get datastorage
* @return the current data storage.
*/
mitk::DataStorage *GetDataStorage();
void ConfirmSegmentation();
protected:
/**
* @brief constructor
*/
AdaptiveRegionGrowingTool(); // purposely hidden
/**
* @brief destructor
*/
~AdaptiveRegionGrowingTool() override;
private:
PointSet::Pointer m_PointSet;
SinglePointDataInteractor::Pointer m_SeedPointInteractor;
DataNode::Pointer m_PointSetNode;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkAddContourTool.h b/Modules/Segmentation/Interactions/mitkAddContourTool.h
index 9838b9cf33..908b8a2f2a 100644
--- a/Modules/Segmentation/Interactions/mitkAddContourTool.h
+++ b/Modules/Segmentation/Interactions/mitkAddContourTool.h
@@ -1,64 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkAddContourTool_h_Included
#define mitkAddContourTool_h_Included
#include "mitkContourTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Fill the inside of a contour with 1
\sa ContourTool
\ingroup Interaction
\ingroup ToolManagerEtAl
Fills a visible contour (from FeedbackContourTool) during mouse dragging. When the mouse button
is released, AddContourTool tries to extract a slice from the working image and fill in
the (filled) contour as a binary image. All inside pixels are set to 1.
While holding the CTRL key, the contour changes color and the pixels on the inside would be
filled with 0.
\warning Only to be instantiated by mitk::ToolManager.
$Author$
*/
class MITKSEGMENTATION_EXPORT AddContourTool : public ContourTool
{
public:
mitkClassMacro(AddContourTool, ContourTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetCursorIconResource() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
protected:
AddContourTool(); // purposely hidden
~AddContourTool() override;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkAutoCropTool.h b/Modules/Segmentation/Interactions/mitkAutoCropTool.h
index 6faad252da..99fbc13306 100644
--- a/Modules/Segmentation/Interactions/mitkAutoCropTool.h
+++ b/Modules/Segmentation/Interactions/mitkAutoCropTool.h
@@ -1,50 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkAutoCropTool_h_Included
#define mitkAutoCropTool_h_Included
#include "mitkCommon.h"
#include "mitkSegmentationsProcessingTool.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
/**
\brief Crops selected segmentations.
\ingroup ToolManagerEtAl
\sa mitk::Tool
\sa QmitkInteractiveSegmentation
Last contributor: $Author$
*/
class MITKSEGMENTATION_EXPORT AutoCropTool : public SegmentationsProcessingTool
{
public:
mitkClassMacro(AutoCropTool, SegmentationsProcessingTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const char **GetXPM() const override;
const char *GetName() const override;
protected:
bool ProcessOneWorkingData(DataNode *node) override;
std::string GetErrorMessage() override;
AutoCropTool(); // purposely hidden
~AutoCropTool() override;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkBinaryThresholdTool.h b/Modules/Segmentation/Interactions/mitkBinaryThresholdTool.h
index 7093e77e7c..e2a8d712e8 100644
--- a/Modules/Segmentation/Interactions/mitkBinaryThresholdTool.h
+++ b/Modules/Segmentation/Interactions/mitkBinaryThresholdTool.h
@@ -1,95 +1,96 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkBinaryThresholdTool_h_Included
#define mitkBinaryThresholdTool_h_Included
#include "mitkAutoSegmentationTool.h"
#include "mitkCommon.h"
#include "mitkDataNode.h"
#include <MitkSegmentationExports.h>
#include <itkImage.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Calculates the segmented volumes for binary images.
\ingroup ToolManagerEtAl
\sa mitk::Tool
\sa QmitkInteractiveSegmentation
Last contributor: $Author$
*/
class MITKSEGMENTATION_EXPORT BinaryThresholdTool : public AutoSegmentationTool
{
public:
Message3<double, double, bool> IntervalBordersChanged;
Message1<double> ThresholdingValueChanged;
mitkClassMacro(BinaryThresholdTool, AutoSegmentationTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
void Activated() override;
void Deactivated() override;
virtual void SetThresholdValue(double value);
virtual void AcceptCurrentThresholdValue();
virtual void CancelThresholding();
protected:
BinaryThresholdTool(); // purposely hidden
~BinaryThresholdTool() override;
void SetupPreviewNode();
void CreateNewSegmentationFromThreshold(DataNode *node);
void OnRoiDataChanged();
void UpdatePreview();
template <typename TPixel, unsigned int VImageDimension>
void ITKThresholding(itk::Image<TPixel, VImageDimension> *originalImage,
mitk::Image *segmentation,
double thresholdValue,
unsigned int timeStep);
template <typename TPixel, unsigned int VImageDimension>
void ITKThresholdingOldBinary(itk::Image<TPixel, VImageDimension> *originalImage,
mitk::Image *segmentation,
double thresholdValue,
unsigned int timeStep);
DataNode::Pointer m_ThresholdFeedbackNode;
DataNode::Pointer m_OriginalImageNode;
DataNode::Pointer m_NodeForThresholding;
double m_SensibleMinimumThresholdValue;
double m_SensibleMaximumThresholdValue;
double m_CurrentThresholdValue;
bool m_IsFloatImage;
bool m_IsOldBinary = false;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkBinaryThresholdULTool.h b/Modules/Segmentation/Interactions/mitkBinaryThresholdULTool.h
index 987601d6f9..a29b5f3f7d 100644
--- a/Modules/Segmentation/Interactions/mitkBinaryThresholdULTool.h
+++ b/Modules/Segmentation/Interactions/mitkBinaryThresholdULTool.h
@@ -1,90 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkBinaryThresholdULTool_h_Included
#define mitkBinaryThresholdULTool_h_Included
#include "mitkAutoSegmentationTool.h"
#include "mitkCommon.h"
#include "mitkDataNode.h"
#include <MitkSegmentationExports.h>
#include <itkBinaryThresholdImageFilter.h>
#include <itkImage.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Calculates the segmented volumes for binary images.
\ingroup ToolManagerEtAl
\sa mitk::Tool
\sa QmitkInteractiveSegmentation
Last contributor: $Author$
*/
class MITKSEGMENTATION_EXPORT BinaryThresholdULTool : public AutoSegmentationTool
{
public:
Message3<double, double, bool> IntervalBordersChanged;
Message2<mitk::ScalarType, mitk::ScalarType> ThresholdingValuesChanged;
mitkClassMacro(BinaryThresholdULTool, AutoSegmentationTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
void Activated() override;
void Deactivated() override;
virtual void SetThresholdValues(double lower, double upper);
virtual void AcceptCurrentThresholdValue();
virtual void CancelThresholding();
protected:
BinaryThresholdULTool(); // purposely hidden
~BinaryThresholdULTool() override;
void SetupPreviewNode();
void CreateNewSegmentationFromThreshold(DataNode *node);
void OnRoiDataChanged();
void UpdatePreview();
DataNode::Pointer m_ThresholdFeedbackNode;
DataNode::Pointer m_OriginalImageNode;
DataNode::Pointer m_NodeForThresholding;
mitk::ScalarType m_SensibleMinimumThresholdValue;
mitk::ScalarType m_SensibleMaximumThresholdValue;
mitk::ScalarType m_CurrentLowerThresholdValue;
mitk::ScalarType m_CurrentUpperThresholdValue;
bool m_IsOldBinary = false;
typedef itk::Image<int, 3> ImageType;
typedef itk::Image<Tool::DefaultSegmentationDataType, 3> SegmentationType; // this is sure for new segmentations
typedef itk::BinaryThresholdImageFilter<ImageType, SegmentationType> ThresholdFilterType;
ThresholdFilterType::Pointer m_ThresholdFilter;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkCalculateGrayValueStatisticsTool.h b/Modules/Segmentation/Interactions/mitkCalculateGrayValueStatisticsTool.h
index a69bc5384d..69bd8c4204 100644
--- a/Modules/Segmentation/Interactions/mitkCalculateGrayValueStatisticsTool.h
+++ b/Modules/Segmentation/Interactions/mitkCalculateGrayValueStatisticsTool.h
@@ -1,95 +1,96 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkCalculateGrayValueStatisticsTool_h_Included
#define mitkCalculateGrayValueStatisticsTool_h_Included
#include "mitkCommon.h"
#include "mitkSegmentationsProcessingTool.h"
#include <MitkSegmentationExports.h>
#ifndef __itkHistogram_h
#include <itkHistogram.h>
#endif
#include <itkImage.h>
#include <sstream>
namespace mitk
{
/**
\brief Calculates some gray value statistics for segmentations.
\ingroup ToolManagerEtAl
\sa mitk::Tool
\sa QmitkInteractiveSegmentation
Last contributor: $Author$
*/
class MITKSEGMENTATION_EXPORT CalculateGrayValueStatisticsTool : public SegmentationsProcessingTool
{
public:
Message<> StatisticsCompleted;
mitkClassMacro(CalculateGrayValueStatisticsTool, SegmentationsProcessingTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const char **GetXPM() const override;
const char *GetName() const override;
virtual std::string GetReport() const;
//
// Insight/Code/Review/Algorithms version of Histogram takes
// only one template parameter, and the 'release' version
// takes 2, but the default value for the second, 1, is what
// was specified here.
typedef itk::Statistics::Histogram<double> HistogramType;
HistogramType::Pointer m_ITKHistogram;
HistogramType::ConstPointer GetHistogram();
typedef HistogramType::MeasurementType HistogramMeasurementType;
protected:
CalculateGrayValueStatisticsTool(); // purposely hidden
~CalculateGrayValueStatisticsTool() override;
void StartProcessingAllData() override;
bool ProcessOneWorkingData(DataNode *node) override;
void FinishProcessingAllData() override;
std::string GetErrorMessage() override;
/**
Calculates the minimum and maximum of the pixelvalues. They have to be known to initialize the histogram.
*/
template <typename TPixel, unsigned int VImageDimension>
void CalculateMinMax(itk::Image<TPixel, VImageDimension> *referenceImage,
Image *segmentation,
TPixel &minimum,
TPixel &maximum);
/**
- initializes and fills the histogram
- calculates mean, sd and quantiles
*/
template <typename TPixel, unsigned int VImageDimension>
void ITKHistogramming(itk::Image<TPixel, VImageDimension> *referenceImage,
Image *segmentation,
std::stringstream &report);
std::stringstream m_CompleteReport;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkCalculateVolumetryTool.h b/Modules/Segmentation/Interactions/mitkCalculateVolumetryTool.h
index bf8b2d019c..51d9253d2a 100644
--- a/Modules/Segmentation/Interactions/mitkCalculateVolumetryTool.h
+++ b/Modules/Segmentation/Interactions/mitkCalculateVolumetryTool.h
@@ -1,52 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkCalculateVolumetryTool_h_Included
#define mitkCalculateVolumetryTool_h_Included
#include "mitkCommon.h"
#include "mitkSegmentationsProcessingTool.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
/**
\brief Calculates the segmented volumes for binary images.
\ingroup ToolManagerEtAl
\sa mitk::Tool
\sa QmitkInteractiveSegmentation
Last contributor: $Author$
*/
class MITKSEGMENTATION_EXPORT CalculateVolumetryTool : public SegmentationsProcessingTool
{
public:
mitkClassMacro(CalculateVolumetryTool, SegmentationsProcessingTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const char **GetXPM() const override;
const char *GetName() const override;
protected:
bool ProcessOneWorkingData(DataNode *node) override;
std::string GetErrorMessage() override;
void FinishProcessingAllData() override;
CalculateVolumetryTool(); // purposely hidden
~CalculateVolumetryTool() override;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkContourModelInteractor.h b/Modules/Segmentation/Interactions/mitkContourModelInteractor.h
index 217aeaf117..0ea308590f 100644
--- a/Modules/Segmentation/Interactions/mitkContourModelInteractor.h
+++ b/Modules/Segmentation/Interactions/mitkContourModelInteractor.h
@@ -1,61 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkContourModelInteractor_h_Included
#define mitkContourModelInteractor_h_Included
#include "mitkCommon.h"
#include "mitkDataInteractor.h"
#include <MitkSegmentationExports.h>
#include <mitkContourModel.h>
#include <mitkDataNode.h>
namespace mitk
{
/**
\brief
\sa Interactor
\ingroup Interaction
\ingroup ToolManagerEtAl
*/
class MITKSEGMENTATION_EXPORT ContourModelInteractor : public DataInteractor
{
public:
- mitkClassMacro(ContourModelInteractor, DataInteractor) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(ContourModelInteractor, DataInteractor);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* Here actions strings from the loaded state machine pattern are mapped to functions of
* the DataInteractor. These functions are called when an action from the state machine pattern is executed.
*/
void ConnectActionsAndFunctions() override;
protected:
ContourModelInteractor();
~ContourModelInteractor() override;
virtual bool OnCheckPointClick(const InteractionEvent *interactionEvent);
virtual bool IsHovering(const InteractionEvent *interactionEvent);
virtual void OnDeletePoint(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void OnMovePoint(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void OnMoveContour(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void OnFinishEditing(StateMachineAction *, InteractionEvent *interactionEvent);
mitk::Point3D m_lastMousePosition;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkContourModelLiveWireInteractor.h b/Modules/Segmentation/Interactions/mitkContourModelLiveWireInteractor.h
index 91a645b3e8..5d437fa213 100644
--- a/Modules/Segmentation/Interactions/mitkContourModelLiveWireInteractor.h
+++ b/Modules/Segmentation/Interactions/mitkContourModelLiveWireInteractor.h
@@ -1,83 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkContourModelLiveWireInteractor_h_Included
#define mitkContourModelLiveWireInteractor_h_Included
#include "mitkCommon.h"
#include "mitkContourModelInteractor.h"
#include <MitkSegmentationExports.h>
#include <mitkImageLiveWireContourModelFilter.h>
namespace mitk
{
/**
\brief
\sa Interactor
\sa ContourModelInteractor
\ingroup Interaction
\warning Make sure the working image is properly set, otherwise the algorithm for computing livewire contour segments
will not work!
*/
class MITKSEGMENTATION_EXPORT ContourModelLiveWireInteractor : public ContourModelInteractor
{
public:
- mitkClassMacro(ContourModelLiveWireInteractor, ContourModelInteractor) itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacro(ContourModelLiveWireInteractor, ContourModelInteractor);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
virtual void SetEditingContourModelNode(mitk::DataNode *_arg);
virtual void SetWorkingImage(mitk::Image *_arg);
void ConnectActionsAndFunctions() override;
protected:
ContourModelLiveWireInteractor();
~ContourModelLiveWireInteractor() override;
bool OnCheckPointClick(const InteractionEvent *interactionEvent) override;
bool IsHovering(const InteractionEvent *interactionEvent) override;
void OnMovePoint(StateMachineAction *, InteractionEvent *interactionEvent) override;
void OnDeletePoint(StateMachineAction *, InteractionEvent *interactionEvent) override;
void OnFinishEditing(StateMachineAction *, InteractionEvent *interactionEvent) override;
int SplitContourFromSelectedVertex(mitk::ContourModel *srcContour,
mitk::ContourModel *destContour,
bool fromSelectedUpwards,
int timestep);
mitk::ImageLiveWireContourModelFilter::Pointer m_LiveWireFilter;
mitk::Image::Pointer m_WorkingSlice;
mitk::Point3D m_NextActiveVertexDown;
mitk::Point3D m_NextActiveVertexUp;
mitk::ContourModel::VertexIterator m_NextActiveVertexDownIter;
mitk::ContourModel::VertexIterator m_NextActiveVertexUpIter;
std::vector<itk::Index<2>> m_ContourBeingModified;
mitk::DataNode::Pointer m_EditingContourNode;
mitk::ContourModel::Pointer m_ContourLeft;
mitk::ContourModel::Pointer m_ContourRight;
};
} // namespace mitk
#endif // mitkContourModelLiveWireInteractor_h_Included
diff --git a/Modules/Segmentation/Interactions/mitkCorrectorTool2D.h b/Modules/Segmentation/Interactions/mitkCorrectorTool2D.h
index 364bd1d08c..da1147cd25 100644
--- a/Modules/Segmentation/Interactions/mitkCorrectorTool2D.h
+++ b/Modules/Segmentation/Interactions/mitkCorrectorTool2D.h
@@ -1,83 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkCorrectorTool2D_h_Included
#define mitkCorrectorTool2D_h_Included
#include "mitkCommon.h"
#include "mitkFeedbackContourTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
class Image;
class StateMachineAction;
class InteractionEvent;
/**
\brief Corrector tool for 2D binary segmentations
\sa FeedbackContourTool
\sa ExtractImageFilter
\sa OverwriteSliceImageFilter
\ingroup Interaction
\ingroup ToolManagerEtAl
Lets the user draw a (multi-point) line and intelligently decides what to do. The underlying algorithm
tests if the line begins and ends inside or outside a segmentation and either adds or subtracts a piece of
segmentation.
Algorithm is implemented in CorrectorAlgorithm (so that it could be reimplemented in a more modern fashion some
time).
\warning Only to be instantiated by mitk::ToolManager.
$Author$
*/
class MITKSEGMENTATION_EXPORT CorrectorTool2D : public FeedbackContourTool
{
public:
mitkClassMacro(CorrectorTool2D, FeedbackContourTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetCursorIconResource() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
protected:
CorrectorTool2D(int paintingPixelValue = 1); // purposely hidden
~CorrectorTool2D() override;
void ConnectActionsAndFunctions() override;
void Activated() override;
void Deactivated() override;
virtual void OnMousePressed(StateMachineAction *, InteractionEvent *);
virtual void OnMouseMoved(StateMachineAction *, InteractionEvent *);
virtual void OnMouseReleased(StateMachineAction *, InteractionEvent *);
int m_PaintingPixelValue;
Image::Pointer m_WorkingSlice;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkCreateSurfaceTool.h b/Modules/Segmentation/Interactions/mitkCreateSurfaceTool.h
index bae9ac632d..ad6f1518af 100644
--- a/Modules/Segmentation/Interactions/mitkCreateSurfaceTool.h
+++ b/Modules/Segmentation/Interactions/mitkCreateSurfaceTool.h
@@ -1,51 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkCreateSurfaceTool_h_Included
#define mitkCreateSurfaceTool_h_Included
#include "mitkCommon.h"
#include "mitkSegmentationsProcessingTool.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
/**
\brief Creates surface models from segmentations.
\ingroup ToolManagerEtAl
\sa mitk::Tool
\sa QmitkInteractiveSegmentation
Last contributor: $Author$
*/
class MITKSEGMENTATION_EXPORT CreateSurfaceTool : public SegmentationsProcessingTool
{
public:
mitkClassMacro(CreateSurfaceTool, SegmentationsProcessingTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const char **GetXPM() const override;
const char *GetName() const override;
void OnSurfaceCalculationDone();
protected:
bool ProcessOneWorkingData(DataNode *node) override;
std::string GetErrorMessage() override;
CreateSurfaceTool(); // purposely hidden
~CreateSurfaceTool() override;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkDrawPaintbrushTool.h b/Modules/Segmentation/Interactions/mitkDrawPaintbrushTool.h
index 053e4ad070..b86a9a3613 100644
--- a/Modules/Segmentation/Interactions/mitkDrawPaintbrushTool.h
+++ b/Modules/Segmentation/Interactions/mitkDrawPaintbrushTool.h
@@ -1,62 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPaintContourTool_h_Included
#define mitkPaintContourTool_h_Included
#include "mitkPaintbrushTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Paintbrush tool for InteractiveSegmentation
\sa FeedbackContourTool
\sa ExtractImageFilter
\sa OverwriteSliceImageFilter
\ingroup Interaction
\ingroup ToolManagerEtAl
Simple paintbrush drawing tool. Right now there are only circular pens of varying size.
This class specified only the drawing "color" for the super class PaintbrushTool.
\warning Only to be instantiated by mitk::ToolManager.
$Author: maleike $
*/
class MITKSEGMENTATION_EXPORT DrawPaintbrushTool : public PaintbrushTool
{
public:
mitkClassMacro(DrawPaintbrushTool, PaintbrushTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetCursorIconResource() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
protected:
DrawPaintbrushTool(); // purposely hidden
~DrawPaintbrushTool() override;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkErasePaintbrushTool.h b/Modules/Segmentation/Interactions/mitkErasePaintbrushTool.h
index 7d7221ace5..0111688c0b 100644
--- a/Modules/Segmentation/Interactions/mitkErasePaintbrushTool.h
+++ b/Modules/Segmentation/Interactions/mitkErasePaintbrushTool.h
@@ -1,62 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkErasePaintbrushTool_h_Included
#define mitkErasePaintbrushTool_h_Included
#include "mitkPaintbrushTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Paintbrush tool for InteractiveSegmentation
\sa FeedbackContourTool
\sa ExtractImageFilter
\sa OverwriteSliceImageFilter
\ingroup Interaction
\ingroup ToolManagerEtAl
Simple paintbrush drawing tool. Right now there are only circular pens of varying size.
This class specified only the drawing "color" for the super class PaintbrushTool.
\warning Only to be instantiated by mitk::ToolManager.
$Author: maleike $
*/
class MITKSEGMENTATION_EXPORT ErasePaintbrushTool : public PaintbrushTool
{
public:
mitkClassMacro(ErasePaintbrushTool, PaintbrushTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetCursorIconResource() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
protected:
ErasePaintbrushTool(); // purposely hidden
~ErasePaintbrushTool() override;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkEraseRegionTool.h b/Modules/Segmentation/Interactions/mitkEraseRegionTool.h
index 09608f2a94..c5008654b5 100644
--- a/Modules/Segmentation/Interactions/mitkEraseRegionTool.h
+++ b/Modules/Segmentation/Interactions/mitkEraseRegionTool.h
@@ -1,60 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkEraseRegionTool_h_Included
#define mitkEraseRegionTool_h_Included
#include "mitkSetRegionTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Fill the inside of a contour with 1
\sa SetRegionTool
\ingroup Interaction
\ingroup ToolManagerEtAl
Finds the outer contour of a shape in 2D (possibly including holes) and sets all
the inside pixels to 0 (erasing a segmentation).
\warning Only to be instantiated by mitk::ToolManager.
$Author$
*/
class MITKSEGMENTATION_EXPORT EraseRegionTool : public SetRegionTool
{
public:
mitkClassMacro(EraseRegionTool, SetRegionTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetCursorIconResource() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
protected:
EraseRegionTool(); // purposely hidden
~EraseRegionTool() override;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkFastMarchingTool.h b/Modules/Segmentation/Interactions/mitkFastMarchingTool.h
index 8e0435315a..e98b2fba71 100644
--- a/Modules/Segmentation/Interactions/mitkFastMarchingTool.h
+++ b/Modules/Segmentation/Interactions/mitkFastMarchingTool.h
@@ -1,174 +1,175 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkFastMarchingTool_h_Included
#define mitkFastMarchingTool_h_Included
#include "mitkDataNode.h"
#include "mitkFeedbackContourTool.h"
#include "mitkPointSet.h"
#include "mitkToolCommand.h"
#include <MitkSegmentationExports.h>
#include "mitkMessage.h"
#include "itkImage.h"
// itk filter
#include "itkBinaryThresholdImageFilter.h"
#include "itkCurvatureAnisotropicDiffusionImageFilter.h"
#include "itkFastMarchingImageFilter.h"
#include "itkGradientMagnitudeRecursiveGaussianImageFilter.h"
#include "itkSigmoidImageFilter.h"
namespace us
{
class ModuleResource;
}
namespace mitk
{
class StateMachineAction;
class InteractionEvent;
/**
\brief FastMarching semgentation tool.
The segmentation is done by setting one or more seed points on the image
and adapting the time range and threshold. The pipeline is:
Smoothing->GradientMagnitude->SigmoidFunction->FastMarching->Threshold
The resulting binary image is seen as a segmentation of an object.
For detailed documentation see ITK Software Guide section 9.3.1 Fast Marching Segmentation.
*/
class MITKSEGMENTATION_EXPORT FastMarchingTool : public FeedbackContourTool
{
mitkNewMessageMacro(Ready);
public:
mitkClassMacro(FastMarchingTool, FeedbackContourTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/* typedefs for itk pipeline */
typedef float InternalPixelType;
typedef itk::Image<InternalPixelType, 2> InternalImageType;
typedef mitk::Tool::DefaultSegmentationDataType OutputPixelType;
typedef itk::Image<OutputPixelType, 2> OutputImageType;
typedef itk::BinaryThresholdImageFilter<InternalImageType, OutputImageType> ThresholdingFilterType;
typedef itk::CurvatureAnisotropicDiffusionImageFilter<InternalImageType, InternalImageType> SmoothingFilterType;
typedef itk::GradientMagnitudeRecursiveGaussianImageFilter<InternalImageType, InternalImageType> GradientFilterType;
typedef itk::SigmoidImageFilter<InternalImageType, InternalImageType> SigmoidFilterType;
typedef itk::FastMarchingImageFilter<InternalImageType, InternalImageType> FastMarchingFilterType;
typedef FastMarchingFilterType::NodeContainer NodeContainer;
typedef FastMarchingFilterType::NodeType NodeType;
/* icon stuff */
const char **GetXPM() const override;
const char *GetName() const override;
us::ModuleResource GetCursorIconResource() const override;
us::ModuleResource GetIconResource() const override;
/// \brief Set parameter used in Threshold filter.
void SetUpperThreshold(double);
/// \brief Set parameter used in Threshold filter.
void SetLowerThreshold(double);
/// \brief Set parameter used in Fast Marching filter.
void SetStoppingValue(double);
/// \brief Set parameter used in Gradient Magnitude filter.
void SetSigma(double);
/// \brief Set parameter used in Fast Marching filter.
void SetAlpha(double);
/// \brief Set parameter used in Fast Marching filter.
void SetBeta(double);
/// \brief Adds the feedback image to the current working image.
virtual void ConfirmSegmentation();
/// \brief Set the working time step.
virtual void SetCurrentTimeStep(int t);
/// \brief Clear all seed points.
void ClearSeeds();
/// \brief Updates the itk pipeline and shows the result of FastMarching.
void Update();
protected:
FastMarchingTool();
~FastMarchingTool() override;
void ConnectActionsAndFunctions() override;
// virtual float CanHandleEvent( StateEvent const *stateEvent) const;
void Activated() override;
void Deactivated() override;
virtual void Initialize();
virtual void BuildITKPipeline();
/// \brief Add point action of StateMachine pattern
virtual void OnAddPoint(StateMachineAction *, InteractionEvent *interactionEvent);
/// \brief Delete action of StateMachine pattern
virtual void OnDelete(StateMachineAction *, InteractionEvent *interactionEvent);
/// \brief Reset all relevant inputs of the itk pipeline.
void Reset();
mitk::ToolCommand::Pointer m_ProgressCommand;
Image::Pointer m_ReferenceImage;
Image::Pointer m_ReferenceImageSlice;
bool m_NeedUpdate;
int m_CurrentTimeStep;
mitk::InteractionPositionEvent::Pointer m_PositionEvent;
float m_LowerThreshold; // used in Threshold filter
float m_UpperThreshold; // used in Threshold filter
float m_StoppingValue; // used in Fast Marching filter
float m_Sigma; // used in GradientMagnitude filter
float m_Alpha; // used in Sigmoid filter
float m_Beta; // used in Sigmoid filter
NodeContainer::Pointer m_SeedContainer; // seed points for FastMarching
InternalImageType::Pointer m_ReferenceImageSliceAsITK; // the reference image as itk::Image
mitk::DataNode::Pointer m_ResultImageNode; // holds the result as a preview image
mitk::DataNode::Pointer m_SeedsAsPointSetNode; // used to visualize the seed points
mitk::PointSet::Pointer m_SeedsAsPointSet;
ThresholdingFilterType::Pointer m_ThresholdFilter;
SmoothingFilterType::Pointer m_SmoothFilter;
GradientFilterType::Pointer m_GradientMagnitudeFilter;
SigmoidFilterType::Pointer m_SigmoidFilter;
FastMarchingFilterType::Pointer m_FastMarchingFilter;
private:
PlaneGeometry::Pointer m_WorkingPlane;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkFastMarchingTool3D.h b/Modules/Segmentation/Interactions/mitkFastMarchingTool3D.h
index 196ff26712..eeefc20b4f 100644
--- a/Modules/Segmentation/Interactions/mitkFastMarchingTool3D.h
+++ b/Modules/Segmentation/Interactions/mitkFastMarchingTool3D.h
@@ -1,162 +1,164 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkFastMarchingTool3D_h_Included
#define mitkFastMarchingTool3D_h_Included
#include "mitkAutoSegmentationTool.h"
#include "mitkDataNode.h"
#include "mitkPointSet.h"
#include "mitkPointSetDataInteractor.h"
#include "mitkToolCommand.h"
#include <MitkSegmentationExports.h>
#include "mitkMessage.h"
#include "itkImage.h"
// itk filter
#include "itkBinaryThresholdImageFilter.h"
#include "itkCurvatureAnisotropicDiffusionImageFilter.h"
#include "itkFastMarchingImageFilter.h"
#include "itkGradientMagnitudeRecursiveGaussianImageFilter.h"
#include "itkSigmoidImageFilter.h"
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief FastMarching semgentation tool.
The segmentation is done by setting one or more seed points on the image
and adapting the time range and threshold. The pipeline is:
Smoothing->GradientMagnitude->SigmoidFunction->FastMarching->Threshold
The resulting binary image is seen as a segmentation of an object.
For detailed documentation see ITK Software Guide section 9.3.1 Fast Marching Segmentation.
*/
class MITKSEGMENTATION_EXPORT FastMarchingTool3D : public AutoSegmentationTool
{
mitkNewMessageMacro(Ready);
public:
- mitkClassMacro(FastMarchingTool3D, AutoSegmentationTool) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ mitkClassMacro(FastMarchingTool3D, AutoSegmentationTool);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/* typedefs for itk pipeline */
typedef float InternalPixelType;
typedef itk::Image<InternalPixelType, 3> InternalImageType;
typedef mitk::Tool::DefaultSegmentationDataType OutputPixelType;
typedef itk::Image<OutputPixelType, 3> OutputImageType;
typedef itk::BinaryThresholdImageFilter<InternalImageType, OutputImageType> ThresholdingFilterType;
typedef itk::CurvatureAnisotropicDiffusionImageFilter<InternalImageType, InternalImageType> SmoothingFilterType;
typedef itk::GradientMagnitudeRecursiveGaussianImageFilter<InternalImageType, InternalImageType> GradientFilterType;
typedef itk::SigmoidImageFilter<InternalImageType, InternalImageType> SigmoidFilterType;
typedef itk::FastMarchingImageFilter<InternalImageType, InternalImageType> FastMarchingFilterType;
typedef FastMarchingFilterType::NodeContainer NodeContainer;
typedef FastMarchingFilterType::NodeType NodeType;
bool CanHandle(BaseData *referenceData) const override;
/* icon stuff */
const char **GetXPM() const override;
const char *GetName() const override;
us::ModuleResource GetIconResource() const override;
/// \brief Set parameter used in Threshold filter.
void SetUpperThreshold(double);
/// \brief Set parameter used in Threshold filter.
void SetLowerThreshold(double);
/// \brief Set parameter used in Fast Marching filter.
void SetStoppingValue(double);
/// \brief Set parameter used in Gradient Magnitude filter.
void SetSigma(double);
/// \brief Set parameter used in Fast Marching filter.
void SetAlpha(double);
/// \brief Set parameter used in Fast Marching filter.
void SetBeta(double);
/// \brief Adds the feedback image to the current working image.
virtual void ConfirmSegmentation();
/// \brief Set the working time step.
virtual void SetCurrentTimeStep(int t);
/// \brief Clear all seed points.
void ClearSeeds();
/// \brief Updates the itk pipeline and shows the result of FastMarching.
void Update();
protected:
FastMarchingTool3D();
~FastMarchingTool3D() override;
void Activated() override;
void Deactivated() override;
virtual void Initialize();
/// \brief Add point action of StateMachine pattern
virtual void OnAddPoint();
/// \brief Delete action of StateMachine pattern
virtual void OnDelete();
/// \brief Reset all relevant inputs of the itk pipeline.
void Reset();
mitk::ToolCommand::Pointer m_ProgressCommand;
Image::Pointer m_ReferenceImage;
bool m_NeedUpdate;
int m_CurrentTimeStep;
float m_LowerThreshold; // used in Threshold filter
float m_UpperThreshold; // used in Threshold filter
float m_StoppingValue; // used in Fast Marching filter
float m_Sigma; // used in GradientMagnitude filter
float m_Alpha; // used in Sigmoid filter
float m_Beta; // used in Sigmoid filter
NodeContainer::Pointer m_SeedContainer; // seed points for FastMarching
InternalImageType::Pointer m_ReferenceImageAsITK; // the reference image as itk::Image
mitk::DataNode::Pointer m_ResultImageNode; // holds the result as a preview image
mitk::DataNode::Pointer m_SeedsAsPointSetNode; // used to visualize the seed points
mitk::PointSet::Pointer m_SeedsAsPointSet;
mitk::PointSetDataInteractor::Pointer m_SeedPointInteractor;
unsigned int m_PointSetAddObserverTag;
unsigned int m_PointSetRemoveObserverTag;
ThresholdingFilterType::Pointer m_ThresholdFilter;
SmoothingFilterType::Pointer m_SmoothFilter;
GradientFilterType::Pointer m_GradientMagnitudeFilter;
SigmoidFilterType::Pointer m_SigmoidFilter;
FastMarchingFilterType::Pointer m_FastMarchingFilter;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkFillRegionTool.h b/Modules/Segmentation/Interactions/mitkFillRegionTool.h
index d05d869c46..c704623335 100644
--- a/Modules/Segmentation/Interactions/mitkFillRegionTool.h
+++ b/Modules/Segmentation/Interactions/mitkFillRegionTool.h
@@ -1,59 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkFillRegionTool_h_Included
#define mitkFillRegionTool_h_Included
#include "mitkSetRegionTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Fill the inside of a contour with 1
\sa SetRegionTool
\ingroup Interaction
\ingroup ToolManagerEtAl
Finds the outer contour of a shape in 2D (possibly including holes) and sets all
the inside pixels to 1, filling holes in a segmentation.
\warning Only to be instantiated by mitk::ToolManager.
$Author$
*/
class MITKSEGMENTATION_EXPORT FillRegionTool : public SetRegionTool
{
public:
mitkClassMacro(FillRegionTool, SetRegionTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetCursorIconResource() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
protected:
FillRegionTool(); // purposely hidden
~FillRegionTool() override;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkLiveWireTool2D.h b/Modules/Segmentation/Interactions/mitkLiveWireTool2D.h
index 8ff6b861d0..45ebf5f865 100644
--- a/Modules/Segmentation/Interactions/mitkLiveWireTool2D.h
+++ b/Modules/Segmentation/Interactions/mitkLiveWireTool2D.h
@@ -1,125 +1,125 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkLiveWireTool2D_h
#define mitkLiveWireTool2D_h
#include <mitkSegTool2D.h>
#include <mitkContourModelLiveWireInteractor.h>
namespace mitk
{
/**
\brief A 2D segmentation tool based on a LiveWire approach.
The contour between the last point and the current mouse position is
computed by searching the shortest path according to specific features of
the image. The contour thus tends to snap to the boundary of objects.
\sa SegTool2D
\sa ImageLiveWireContourModelFilter
\ingroup Interaction
\ingroup ToolManagerEtAl
\warning Only to be instantiated by mitk::ToolManager.
*/
class MITKSEGMENTATION_EXPORT LiveWireTool2D : public SegTool2D
{
public:
- mitkClassMacro(LiveWireTool2D, SegTool2D)
- itkFactorylessNewMacro(Self)
+ mitkClassMacro(LiveWireTool2D, SegTool2D);
+ itkFactorylessNewMacro(Self);
us::ModuleResource GetCursorIconResource() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
const char **GetXPM() const override;
/// \brief Convert all current contours to binary segmentations.
void ConfirmSegmentation();
/// \brief Delete all current contours.
void ClearSegmentation();
protected:
LiveWireTool2D();
~LiveWireTool2D() override;
void ConnectActionsAndFunctions() override;
void Activated() override;
void Deactivated() override;
private:
/// \brief Initialize tool.
void OnInitLiveWire(StateMachineAction *, InteractionEvent *interactionEvent);
/// \brief Add a control point and finish current segment.
void OnAddPoint(StateMachineAction *, InteractionEvent *interactionEvent);
/// \brief Actual LiveWire computation.
void OnMouseMoved(StateMachineAction *, InteractionEvent *interactionEvent);
/// \brief Check double click on first control point to finish the LiveWire tool.
bool OnCheckPoint(const InteractionEvent *interactionEvent);
/// \brief Finish LiveWire tool.
void OnFinish(StateMachineAction *, InteractionEvent *interactionEvent);
/// \brief Close the contour.
void OnLastSegmentDelete(StateMachineAction *, InteractionEvent *interactionEvent);
/// \brief Don't use dynamic cost map for LiveWire calculation.
void OnMouseMoveNoDynamicCosts(StateMachineAction *, InteractionEvent *interactionEvent);
/// \brief Finish contour interaction.
void FinishTool();
void EnableContourLiveWireInteraction(bool on);
bool IsPositionEventInsideImageRegion(InteractionPositionEvent *positionEvent, BaseData *data);
void ReleaseInteractors();
void ReleaseHelperObjects();
void RemoveHelperObjects();
template <typename TPixel, unsigned int VImageDimension>
void FindHighestGradientMagnitudeByITK(itk::Image<TPixel, VImageDimension> *inputImage,
itk::Index<3> &index,
itk::Index<3> &returnIndex);
mitk::ContourModel::Pointer m_Contour;
mitk::DataNode::Pointer m_ContourNode;
mitk::ContourModel::Pointer m_LiveWireContour;
mitk::DataNode::Pointer m_LiveWireContourNode;
mitk::ContourModel::Pointer m_EditingContour;
mitk::DataNode::Pointer m_EditingContourNode;
mitk::ContourModelLiveWireInteractor::Pointer m_ContourInteractor;
mitk::Image::Pointer m_WorkingSlice;
mitk::ImageLiveWireContourModelFilter::Pointer m_LiveWireFilter;
bool m_CreateAndUseDynamicCosts;
std::vector<std::pair<mitk::DataNode::Pointer, mitk::PlaneGeometry::Pointer>> m_WorkingContours;
std::vector<std::pair<mitk::DataNode::Pointer, mitk::PlaneGeometry::Pointer>> m_EditingContours;
std::vector<mitk::ContourModelLiveWireInteractor::Pointer> m_LiveWireInteractors;
PlaneGeometry::ConstPointer m_PlaneGeometry;
};
}
#endif
diff --git a/Modules/Segmentation/Interactions/mitkOtsuTool3D.h b/Modules/Segmentation/Interactions/mitkOtsuTool3D.h
index 6b019dea1d..f4e22cab62 100644
--- a/Modules/Segmentation/Interactions/mitkOtsuTool3D.h
+++ b/Modules/Segmentation/Interactions/mitkOtsuTool3D.h
@@ -1,67 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKOTSUTOOL3D_H
#define MITKOTSUTOOL3D_H
#include "itkImage.h"
#include "mitkAutoSegmentationTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
class Image;
class MITKSEGMENTATION_EXPORT OtsuTool3D : public AutoSegmentationTool
{
public:
mitkClassMacro(OtsuTool3D, AutoSegmentationTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const char *GetName() const override;
const char **GetXPM() const override;
us::ModuleResource GetIconResource() const override;
void Activated() override;
void Deactivated() override;
void RunSegmentation(int regions, bool useValley, int numberOfBins);
void ConfirmSegmentation();
// void UpdateBinaryPreview(int regionID);
void UpdateBinaryPreview(std::vector<int> regionIDs);
void UpdateVolumePreview(bool volumeRendering);
void ShowMultiLabelResultNode(bool);
int GetNumberOfBins();
protected:
OtsuTool3D();
~OtsuTool3D() override;
template <typename TPixel, unsigned int VImageDimension>
void CalculatePreview(itk::Image<TPixel, VImageDimension> *itkImage, std::vector<int> regionIDs);
itk::SmartPointer<Image> m_OriginalImage;
// holds the user selected binary segmentation
mitk::DataNode::Pointer m_BinaryPreviewNode;
// holds the multilabel result as a preview image
mitk::DataNode::Pointer m_MultiLabelResultNode;
// holds the user selected binary segmentation masked original image
mitk::DataNode::Pointer m_MaskedImagePreviewNode;
}; // class
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkPickingTool.h b/Modules/Segmentation/Interactions/mitkPickingTool.h
index d511d64bd0..a5172832c0 100644
--- a/Modules/Segmentation/Interactions/mitkPickingTool.h
+++ b/Modules/Segmentation/Interactions/mitkPickingTool.h
@@ -1,92 +1,93 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPickingTool_h_Included
#define mitkPickingTool_h_Included
#include "itkImage.h"
#include "mitkAutoSegmentationTool.h"
#include "mitkCommon.h"
#include "mitkDataStorage.h"
#include "mitkPointSet.h"
#include "mitkSinglePointDataInteractor.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Extracts a single region from a segmentation image and creates a new image with same geometry of the input
image.
The region is extracted in 3D space. This is done by performing region growing within the desired region.
Use shift click to add the seed point.
\ingroup ToolManagerEtAl
\sa mitk::Tool
\sa QmitkInteractiveSegmentation
*/
class MITKSEGMENTATION_EXPORT PickingTool : public AutoSegmentationTool
{
public:
mitkClassMacro(PickingTool, AutoSegmentationTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const char **GetXPM() const override;
const char *GetName() const override;
us::ModuleResource GetIconResource() const override;
void Activated() override;
void Deactivated() override;
virtual DataNode::Pointer GetPointSetNode();
mitk::DataNode *GetReferenceData();
mitk::DataNode *GetWorkingData();
mitk::DataStorage *GetDataStorage();
void ConfirmSegmentation();
protected:
PickingTool(); // purposely hidden
~PickingTool() override;
// Callback for point add event of PointSet
void OnPointAdded();
// Observer id
long m_PointSetAddObserverTag;
mitk::DataNode::Pointer m_ResultNode;
// itk regrowing
template <typename TPixel, unsigned int VImageDimension>
void StartRegionGrowing(itk::Image<TPixel, VImageDimension> *itkImage,
mitk::BaseGeometry *imageGeometry,
mitk::PointSet::PointType seedPoint);
// seed point
PointSet::Pointer m_PointSet;
SinglePointDataInteractor::Pointer m_SeedPointInteractor;
DataNode::Pointer m_PointSetNode;
DataNode *m_WorkingData;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkPixelManipulationTool.h b/Modules/Segmentation/Interactions/mitkPixelManipulationTool.h
index 9ac92f6a86..9e55cea83b 100644
--- a/Modules/Segmentation/Interactions/mitkPixelManipulationTool.h
+++ b/Modules/Segmentation/Interactions/mitkPixelManipulationTool.h
@@ -1,62 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKPIXELMANIPULATIONTOOL_H
#define MITKPIXELMANIPULATIONTOOL_H
#include "mitkTool.h"
#include <MitkSegmentationExports.h>
#include "itkImage.h"
namespace mitk
{
class Image;
class MITKSEGMENTATION_EXPORT PixelManipulationTool : public Tool
{
public:
mitkClassMacro(PixelManipulationTool, Tool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void SetValue(int value);
int GetValue();
void SetFixedValue(int value);
int GetFixedValue();
const char *GetName() const override;
const char **GetXPM() const override;
void Activated() override;
void Deactivated() override;
virtual void CalculateImage();
protected:
PixelManipulationTool();
~PixelManipulationTool() override;
virtual void OnRoiDataChanged();
void AddImageToDataStorage(itk::SmartPointer<mitk::Image> image);
template <typename TPixel, unsigned int VImageDimension>
void ITKPixelManipulation(itk::Image<TPixel, VImageDimension> *originalImage,
Image *maskImage,
Image *newImage,
int newValue);
mitk::DataNode::Pointer m_OriginalImageNode;
int m_Value;
bool m_FixedValue;
}; // clas
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkRegionGrowingTool.h b/Modules/Segmentation/Interactions/mitkRegionGrowingTool.h
index fceab54a87..86f8f074f6 100644
--- a/Modules/Segmentation/Interactions/mitkRegionGrowingTool.h
+++ b/Modules/Segmentation/Interactions/mitkRegionGrowingTool.h
@@ -1,152 +1,153 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkRegionGrowingTool_h_Included
#define mitkRegionGrowingTool_h_Included
#include "mitkFeedbackContourTool.h"
#include <MitkSegmentationExports.h>
#include <array>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief A slice based region growing tool.
\sa FeedbackContourTool
\ingroup Interaction
\ingroup ToolManagerEtAl
When the user presses the mouse button, RegionGrowingTool will use the gray values at that position
to initialize a region growing algorithm (in the affected 2D slice).
By moving the mouse up and down while the button is still pressed, the user can widen or narrow the threshold
window, i.e. select more or less within the desired region.
The current result of region growing will always be shown as a contour to the user.
After releasing the button, the current result of the region growing algorithm will be written to the
working image of this tool's ToolManager.
If the first click is <i>inside</i> a segmentation, nothing will happen (other behaviour, for example removal of a
region, can be implemented via OnMousePressedInside()).
\warning Only to be instantiated by mitk::ToolManager.
$Author$
*/
class MITKSEGMENTATION_EXPORT RegionGrowingTool : public FeedbackContourTool
{
public:
mitkClassMacro(RegionGrowingTool, FeedbackContourTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetCursorIconResource() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
protected:
RegionGrowingTool(); // purposely hidden
~RegionGrowingTool() override;
void ConnectActionsAndFunctions() override;
void Activated() override;
void Deactivated() override;
/**
* @brief OnMousePressed is called when the user clicks.
* Calls either OnMousePressedInside() or OnMousePressedOutside().
*/
virtual void OnMousePressed(StateMachineAction *, InteractionEvent *interactionEvent);
/**
* @brief OnMousePressedInside can be used to implement behaviour when the user clicks inside a segmentation.
*/
virtual void OnMousePressedInside();
/**
* @brief OnMousePressedOutside is called when the user clicks outside of the segmented area.
* Grows a region.
*/
virtual void OnMousePressedOutside(StateMachineAction *, InteractionEvent *interactionEvent);
/**
* @brief OnMouseMoved is called when the user moves the mouse with the left mouse button pressed.
* Adjusts the thresholds.
* Up: Increase upper threshold, decrease lower threshold.
* Down: Decrease upper threshold, increase lower threshold.
* Right: Increase both thresholds.
* Left: Decrease both thresholds.
*/
virtual void OnMouseMoved(StateMachineAction *, InteractionEvent *interactionEvent);
/**
* @brief OnMouseReleased converts the feedback contour to a segmentation.
*/
virtual void OnMouseReleased(StateMachineAction *, InteractionEvent *interactionEvent);
/**
* @brief Template to calculate average pixel value around index using a square/cube with radius neighborhood.
* Example: 1 = 3x3 pixels, 2 = 5x5 pixels, etc.
*/
template <typename TPixel, unsigned int imageDimension>
void GetNeighborhoodAverage(itk::Image<TPixel, imageDimension> *itkImage,
itk::Index<imageDimension> index,
ScalarType *result,
unsigned int neighborhood = 1);
/**
* @brief Template to check whether index is inside already segmented area.
*/
template <typename TPixel, unsigned int imageDimension>
void IsInsideSegmentation(itk::Image<TPixel, imageDimension> *itkImage,
itk::Index<imageDimension> index,
bool *result);
/**
* @brief Template that calls an ITK filter to do the region growing.
*/
template <typename TPixel, unsigned int imageDimension>
void StartRegionGrowing(itk::Image<TPixel, imageDimension> *itkImage,
itk::Index<imageDimension> seedPoint,
std::array<ScalarType, 2> thresholds,
mitk::Image::Pointer &outputImage);
Image::Pointer m_ReferenceSlice;
Image::Pointer m_WorkingSlice;
ScalarType m_SeedValue;
itk::Index<3> m_SeedPoint;
std::array<ScalarType, 2> m_Thresholds;
std::array<ScalarType, 2> m_InitialThresholds;
Point2I m_LastScreenPosition;
int m_ScreenYDifference;
int m_ScreenXDifference;
private:
ScalarType m_MouseDistanceScaleFactor;
int m_PaintingPixelValue;
bool m_FillFeedbackContour;
int m_ConnectedComponentValue;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkSegmentationInteractor.h b/Modules/Segmentation/Interactions/mitkSegmentationInteractor.h
index 4aaab75ec0..700f51751a 100644
--- a/Modules/Segmentation/Interactions/mitkSegmentationInteractor.h
+++ b/Modules/Segmentation/Interactions/mitkSegmentationInteractor.h
@@ -1,50 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkSegmentationInteractor_h
#define mitkSegmentationInteractor_h
#include "MitkSegmentationExports.h"
#include "mitkDisplayInteractor.h"
namespace mitk
{
/**
*\class SegmentationInteractor
*@brief Observer that adds interaction with a segmentation session to the default display interaction.
*
* At the moment, this includes changing the active label.
*
* @ingroup Interaction
**/
class MITKSEGMENTATION_EXPORT SegmentationInteractor : public DisplayInteractor
{
public:
- mitkClassMacro(SegmentationInteractor, DisplayInteractor) itkNewMacro(Self)
+ mitkClassMacro(SegmentationInteractor, DisplayInteractor);
+ itkNewMacro(Self);
protected : SegmentationInteractor(){};
~SegmentationInteractor() override{};
/**
* Derived function.
* Connects the action names used in the state machine pattern with functions implemented within
* this InteractionEventObserver. This is only necessary here because the events are processed by the state machine.
*/
void ConnectActionsAndFunctions() override;
/**
* Changes the active label.
*/
bool ChangeActiveLabel(StateMachineAction *, InteractionEvent *);
};
}
#endif
diff --git a/Modules/Segmentation/Interactions/mitkSubtractContourTool.h b/Modules/Segmentation/Interactions/mitkSubtractContourTool.h
index 7f65737eca..366a7d69d9 100644
--- a/Modules/Segmentation/Interactions/mitkSubtractContourTool.h
+++ b/Modules/Segmentation/Interactions/mitkSubtractContourTool.h
@@ -1,65 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkSubtractContourTool_h_Included
#define mitkSubtractContourTool_h_Included
#include "mitkContourTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Fill the inside of a contour with 1
\sa ContourTool
\ingroup Interaction
\ingroup ToolManagerEtAl
Fills a visible contour (from FeedbackContourTool) during mouse dragging. When the mouse button
is released, SubtractContourTool tries to extract a slice from the working image and fill in
the (filled) contour as a binary image. All inside pixels are set to 0.
While holding the CTRL key, the contour changes color and the pixels on the inside would be
filled with 1.
\warning Only to be instantiated by mitk::ToolManager.
$Author$
*/
class MITKSEGMENTATION_EXPORT SubtractContourTool : public ContourTool
{
public:
mitkClassMacro(SubtractContourTool, ContourTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetCursorIconResource() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
protected:
SubtractContourTool(); // purposely hidden
~SubtractContourTool() override;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkToolCommand.h b/Modules/Segmentation/Interactions/mitkToolCommand.h
index 78627fb247..3f686e6717 100644
--- a/Modules/Segmentation/Interactions/mitkToolCommand.h
+++ b/Modules/Segmentation/Interactions/mitkToolCommand.h
@@ -1,82 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _mitkToolCommand_H
#define _mitkToolCommand_H
#include "itkCommand.h"
#include "mitkCommon.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
/**
* \brief A command to get tool process feedback.
*
* \sa ProgressBar
*
*/
class MITKSEGMENTATION_EXPORT ToolCommand : public itk::Command
{
public:
typedef ToolCommand Self;
typedef itk::Command Superclass;
typedef itk::SmartPointer<Self> Pointer;
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* \brief Reacts on events from ITK filters.
*
*/
void Execute(itk::Object *caller, const itk::EventObject &event) override;
/**
* \brief Not implemented...
*
*/
void Execute(const itk::Object *object, const itk::EventObject &event) override;
/**
* \brief Add new steps to the progress bar.
*
*/
void AddStepsToDo(int steps);
/**
* \brief Sets the remaining progress to the progress bar when the optimization process is done.
*
*/
void SetProgress(int steps);
/**
* \brief Returns the current progress value.
*
*/
double GetCurrentProgressValue();
/**
* \brief Sets the stop processing flag, which is used to call ...
*
*/
void SetStopProcessing(bool value);
protected:
ToolCommand();
private:
double m_ProgressValue;
bool m_StopProcessing;
};
} // namespace mitk
#endif // _mitkToolCommand_H
diff --git a/Modules/Segmentation/Interactions/mitkToolFactoryMacro.h b/Modules/Segmentation/Interactions/mitkToolFactoryMacro.h
index deb7abcb5e..e39601e962 100644
--- a/Modules/Segmentation/Interactions/mitkToolFactoryMacro.h
+++ b/Modules/Segmentation/Interactions/mitkToolFactoryMacro.h
@@ -1,183 +1,184 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#define MITK_TOOL_MACRO(EXPORT_SPEC, CLASS_NAME, DESCRIPTION) \
class EXPORT_SPEC CLASS_NAME##Factory : public ::itk::ObjectFactoryBase \
{ \
public: \
/* ITK typedefs */ \
typedef CLASS_NAME##Factory Self; \
typedef itk::ObjectFactoryBase Superclass; \
typedef itk::SmartPointer<Self> Pointer; \
typedef itk::SmartPointer<const Self> ConstPointer; \
\
/* Methods from ObjectFactoryBase */ \
virtual const char *GetITKSourceVersion() const override { return ITK_SOURCE_VERSION; } \
virtual const char *GetDescription() const override { return DESCRIPTION; } \
/* Method for class instantiation. */ \
itkFactorylessNewMacro(Self); \
\
/* Run-time type information (and related methods). */ \
itkTypeMacro(CLASS_NAME##Factory, itkObjectFactoryBase); \
\
protected: \
CLASS_NAME##Factory() \
{ \
itk::ObjectFactoryBase::RegisterOverride( \
"mitkTool", #CLASS_NAME, DESCRIPTION, 1, itk::CreateObjectFunction<CLASS_NAME>::New()); \
} \
\
~CLASS_NAME##Factory() \
{ \
itk::ObjectFactoryBase::UnRegisterFactory(this); \
} \
private: \
CLASS_NAME##Factory(const Self &); /* purposely not implemented */ \
void operator=(const Self &); /* purposely not implemented */ \
}; \
\
class CLASS_NAME##RegistrationMethod \
{ \
public: \
CLASS_NAME##RegistrationMethod() \
{ \
/*MITK_INFO("tools") << "Registered " #CLASS_NAME; */ \
m_Factory = CLASS_NAME##Factory::New(); \
itk::ObjectFactoryBase::RegisterFactory(m_Factory); \
} \
\
~CLASS_NAME##RegistrationMethod() \
{ \
/*MITK_INFO("tools") << "UnRegistered " #CLASS_NAME; */ \
itk::ObjectFactoryBase::UnRegisterFactory(m_Factory); \
} \
\
private: \
CLASS_NAME##Factory::Pointer m_Factory; \
}; \
\
static CLASS_NAME##RegistrationMethod somestaticinitializer_##CLASS_NAME;
#define MITK_DERIVED_SM_TOOL_MACRO(EXPORT_SPEC, BASE_CLASS, CLASS_NAME, DESCRIPTION) \
class EXPORT_SPEC CLASS_NAME##Tool : public BASE_CLASS \
{ \
public: \
typedef CLASS_NAME##Tool Self; \
typedef BASE_CLASS Superclass; \
typedef itk::SmartPointer<Self> Pointer; \
typedef itk::SmartPointer<const Self> ConstPointer; \
\
- itkFactorylessNewMacro(Self) itkCloneMacro(Self) \
+ itkFactorylessNewMacro(Self); \
+ itkCloneMacro(Self); \
\
- protected : \
+ protected: \
\
- CLASS_NAME##Tool() \
+ CLASS_NAME##Tool() \
{ \
m_SegmentationGenerator = CLASS_NAME::New(); \
} \
\
void RegisterProgressObserver() \
{ \
itk::ReceptorMemberCommand<CLASS_NAME##Tool>::Pointer command = \
itk::ReceptorMemberCommand<CLASS_NAME##Tool>::New(); \
command->SetCallbackFunction(this, &CLASS_NAME##Tool::OnProgressEvent); \
m_SegmentationGenerator->AddSegmentationProgressObserver<CLASS_NAME##Tool>(command); \
} \
\
void RegisterFinishedSegmentationObserver() \
{ \
itk::ReceptorMemberCommand<CLASS_NAME##Tool>::Pointer command = \
itk::ReceptorMemberCommand<CLASS_NAME##Tool>::New(); \
command->SetCallbackFunction(this, &CLASS_NAME##Tool::OnSegmentationFinished); \
m_SegmentationGenerator->AddSegmentationFinishedObserver<CLASS_NAME##Tool>(command); \
} \
\
~CLASS_NAME##Tool() {} \
}; \
\
MITK_TOOL_MACRO(EXPORT_SPEC, CLASS_NAME##Tool, DESCRIPTION);
/* GUI classes are _not_ exported! */
#define MITK_TOOL_GUI_MACRO(EXPORT_SPEC, CLASS_NAME, DESCRIPTION) \
class EXPORT_SPEC CLASS_NAME##Factory : public ::itk::ObjectFactoryBase \
{ \
public: \
/* ITK typedefs */ \
typedef CLASS_NAME##Factory Self; \
typedef itk::ObjectFactoryBase Superclass; \
typedef itk::SmartPointer<Self> Pointer; \
typedef itk::SmartPointer<const Self> ConstPointer; \
\
/* Methods from ObjectFactoryBase */ \
virtual const char *GetITKSourceVersion() const override { return ITK_SOURCE_VERSION; } \
virtual const char *GetDescription() const override { return DESCRIPTION; } \
/* Method for class instantiation. */ \
itkFactorylessNewMacro(Self); \
\
/* Run-time type information (and related methods). */ \
itkTypeMacro(CLASS_NAME##Factory, itkObjectFactoryBase); \
\
protected: \
CLASS_NAME##Factory() \
{ \
itk::ObjectFactoryBase::RegisterOverride( \
#CLASS_NAME, #CLASS_NAME, DESCRIPTION, 1, itk::CreateObjectFunction<CLASS_NAME>::New()); \
} \
\
~CLASS_NAME##Factory() \
{ \
itk::ObjectFactoryBase::UnRegisterFactory(this); \
} \
private: \
CLASS_NAME##Factory(const Self &); /* purposely not implemented */ \
void operator=(const Self &); /* purposely not implemented */ \
}; \
\
class CLASS_NAME##RegistrationMethod \
{ \
public: \
CLASS_NAME##RegistrationMethod() \
{ \
/*MITK_INFO("tools") << "Registered " #CLASS_NAME; */ \
m_Factory = CLASS_NAME##Factory::New(); \
itk::ObjectFactoryBase::RegisterFactory(m_Factory); \
} \
\
~CLASS_NAME##RegistrationMethod() \
{ \
/*MITK_INFO("tools") << "UnRegistered " #CLASS_NAME; */ \
itk::ObjectFactoryBase::UnRegisterFactory(m_Factory); \
} \
\
private: \
CLASS_NAME##Factory::Pointer m_Factory; \
}; \
\
static CLASS_NAME##RegistrationMethod somestaticinitializer_##CLASS_NAME;
#define MITK_EXTERNAL_TOOL_GUI_HEADER_MACRO(EXPORT_SPEC, CLASS_NAME, DESCRIPTION) \
extern "C" \
{ \
EXPORT_SPEC itk::ObjectFactoryBase* itkLoad(); \
}
#define MITK_EXTERNAL_TOOL_GUI_CPP_MACRO(EXPORT_SPEC, CLASS_NAME, DESCRIPTION) \
MITK_TOOL_GUI_MACRO(EXPORT_SPEC, CLASS_NAME, DESCRIPTION) \
extern "C" \
{ \
EXPORT_SPEC itk::ObjectFactoryBase* itkLoad() \
{ \
static CLASS_NAME##Factory::Pointer p = CLASS_NAME##Factory::New(); \
return p; \
} \
}
diff --git a/Modules/Segmentation/Interactions/mitkWatershedTool.h b/Modules/Segmentation/Interactions/mitkWatershedTool.h
index 81e3dcd969..21e8a3e905 100644
--- a/Modules/Segmentation/Interactions/mitkWatershedTool.h
+++ b/Modules/Segmentation/Interactions/mitkWatershedTool.h
@@ -1,87 +1,88 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkWatershedTool_h_Included
#define mitkWatershedTool_h_Included
#include "mitkAutoSegmentationTool.h"
#include "mitkCommon.h"
#include <MitkSegmentationExports.h>
#include <itkImage.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
class Image;
/**
\brief Simple watershed segmentation tool.
\ingroup Interaction
\ingroup ToolManagerEtAl
Wraps ITK Watershed Filter into tool concept of MITK. For more information look into ITK documentation.
\warning Only to be instantiated by mitk::ToolManager.
$Darth Vader$
*/
class MITKSEGMENTATION_EXPORT WatershedTool : public AutoSegmentationTool
{
public:
mitkClassMacro(WatershedTool, AutoSegmentationTool);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void SetThreshold(double t)
{
m_Threshold = t;
}
void SetLevel(double l) { m_Level = l; }
/** \brief Grabs the tool reference data and creates an ITK pipeline consisting of a GradientMagnitude
* image filter followed by a Watershed image filter. The output of the filter pipeline is then added
* to the data storage. */
void DoIt();
/** \brief Creates and runs an ITK filter pipeline consisting of the filters: GradientMagnitude-, Watershed- and
* CastImageFilter.
*
* \param originalImage The input image, which is delivered by the AccessByItk macro.
* \param segmentation A pointer to the output image, which will point to the pipeline output after execution.
*/
template <typename TPixel, unsigned int VImageDimension>
void ITKWatershed(itk::Image<TPixel, VImageDimension> *originalImage, itk::SmartPointer<mitk::Image> &segmentation);
const char **GetXPM() const override;
const char *GetName() const override;
us::ModuleResource GetIconResource() const override;
protected:
WatershedTool(); // purposely hidden
~WatershedTool() override;
void Activated() override;
void Deactivated() override;
/** \brief Threshold parameter of the ITK Watershed Image Filter. See ITK Documentation for more information. */
double m_Threshold;
/** \brief Threshold parameter of the ITK Watershed Image Filter. See ITK Documentation for more information. */
double m_Level;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Rendering/mitkContourMapper2D.h b/Modules/Segmentation/Rendering/mitkContourMapper2D.h
index 28787e4a29..45a729b42b 100644
--- a/Modules/Segmentation/Rendering/mitkContourMapper2D.h
+++ b/Modules/Segmentation/Rendering/mitkContourMapper2D.h
@@ -1,58 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_CONTOUR_MAPPER_2D_H_
#define MITK_CONTOUR_MAPPER_2D_H_
#include "mitkCommon.h"
#include "mitkMapper.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
class BaseRenderer;
class Contour;
/**
* @brief OpenGL-based mapper to display a mitk::Contour object in a 2D render window
*
*
* @ingroup Mapper
*/
class MITKSEGMENTATION_EXPORT ContourMapper2D : public Mapper
{
public:
mitkClassMacro(ContourMapper2D, Mapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/**
* reimplemented from Baseclass
*/
void MitkRender(mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) override;
void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor * actor=nullptr) override;
/**
* return a refernce of the rendered data object
*/
const Contour *GetInput(void);
protected:
ContourMapper2D();
~ContourMapper2D() override;
};
} // namespace mitk
#endif /* MITKContourMapper2D_H_HEADER_INCLUDED */
diff --git a/Modules/Segmentation/Rendering/mitkContourSetMapper2D.h b/Modules/Segmentation/Rendering/mitkContourSetMapper2D.h
index 9683a716ea..a190ee9afc 100644
--- a/Modules/Segmentation/Rendering/mitkContourSetMapper2D.h
+++ b/Modules/Segmentation/Rendering/mitkContourSetMapper2D.h
@@ -1,58 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_CONTOUR_SET_MAPPER_2D_H_
#define MITK_CONTOUR_SET_MAPPER_2D_H_
#include "mitkCommon.h"
#include "mitkGLMapper.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
class BaseRenderer;
class ContourSet;
/**
* @brief OpenGL-based mapper to display a mitk::Contour object in a 2D render window
*
*
* @ingroup Mapper
*/
class MITKSEGMENTATION_EXPORT ContourSetMapper2D : public Mapper
{
public:
mitkClassMacro(ContourSetMapper2D, Mapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/**
* reimplemented from Baseclass
*/
void MitkRender(mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) override;
void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor * actor = nullptr) override;
/**
* return a refernce of the rendered data object
*/
const mitk::ContourSet *GetInput(void);
protected:
ContourSetMapper2D();
~ContourSetMapper2D() override;
};
} // namespace mitk
#endif /* MITK_CONTOUR_SET_MAPPER_2D_H_ */
diff --git a/Modules/Segmentation/Rendering/mitkContourSetVtkMapper3D.h b/Modules/Segmentation/Rendering/mitkContourSetVtkMapper3D.h
index 2c75fde5d2..02a938320b 100644
--- a/Modules/Segmentation/Rendering/mitkContourSetVtkMapper3D.h
+++ b/Modules/Segmentation/Rendering/mitkContourSetVtkMapper3D.h
@@ -1,61 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_CONTOUR_SET_VTK_MAPPER_3D_H
#define MITK_CONTOUR_SET_VTK_MAPPER_3D_H
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkContourSet.h"
#include "mitkVtkMapper.h"
#include <MitkSegmentationExports.h>
#include <vtkPolyData.h>
class vtkPolyDataMapper;
class vtkAppendPolyData;
class vtkActor;
class vtkTubeFilter;
namespace mitk
{
//##Documentation
//## @brief Vtk-based mapper for mitk::Contour
//## @ingroup Mapper
class MITKSEGMENTATION_EXPORT ContourSetVtkMapper3D : public VtkMapper
{
public:
mitkClassMacro(ContourSetVtkMapper3D, VtkMapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
virtual const mitk::ContourSet *GetInput();
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
protected:
ContourSetVtkMapper3D();
~ContourSetVtkMapper3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
vtkPolyDataMapper *m_VtkPolyDataMapper;
vtkTubeFilter *m_TubeFilter;
vtkPolyData *m_ContourSet;
vtkActor *m_Actor;
};
} // namespace mitk
#endif // MITK_CONTOUR_VTK_MAPPER_3D_H
diff --git a/Modules/Segmentation/Rendering/mitkContourVtkMapper3D.h b/Modules/Segmentation/Rendering/mitkContourVtkMapper3D.h
index 9d69dc987b..9f54a37db9 100644
--- a/Modules/Segmentation/Rendering/mitkContourVtkMapper3D.h
+++ b/Modules/Segmentation/Rendering/mitkContourVtkMapper3D.h
@@ -1,63 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITK_CONTOUR_VTK_MAPPER_3D_H
#define MITK_CONTOUR_VTK_MAPPER_3D_H
#include "mitkVtkMapper.h"
#include <MitkSegmentationExports.h>
#include <vtkPolyData.h>
#include <vtkSmartPointer.h>
class vtkPolyDataMapper;
class vtkAppendPolyData;
class vtkActor;
class vtkTubeFilter;
namespace mitk
{
class BaseRenderer;
class Contour;
/**
@brief Vtk-based mapper for mitk::Contour
@ingroup Mapper
*/
class MITKSEGMENTATION_EXPORT ContourVtkMapper3D : public VtkMapper
{
public:
mitkClassMacro(ContourVtkMapper3D, VtkMapper);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
virtual const mitk::Contour *GetInput();
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
protected:
ContourVtkMapper3D();
~ContourVtkMapper3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
vtkSmartPointer<vtkPolyDataMapper> m_VtkPolyDataMapper;
vtkSmartPointer<vtkTubeFilter> m_TubeFilter;
vtkSmartPointer<vtkAppendPolyData> m_VtkPointList;
vtkSmartPointer<vtkPolyData> m_Contour;
vtkSmartPointer<vtkActor> m_Actor;
};
} // namespace mitk
#endif // MITK_CONTOUR_VTK_MAPPER_3D_H
diff --git a/Modules/Segmentation/Testing/files.cmake b/Modules/Segmentation/Testing/files.cmake
index 998fe8337d..9330f21eb2 100644
--- a/Modules/Segmentation/Testing/files.cmake
+++ b/Modules/Segmentation/Testing/files.cmake
@@ -1,35 +1,29 @@
set(MODULE_TESTS
mitkContourMapper2DTest.cpp
mitkContourTest.cpp
mitkContourModelSetToImageFilterTest.cpp
mitkDataNodeSegmentationTest.cpp
mitkFeatureBasedEdgeDetectionFilterTest.cpp
mitkImageToContourFilterTest.cpp
mitkSegmentationInterpolationTest.cpp
mitkOverwriteSliceFilterTest.cpp
mitkOverwriteSliceFilterObliquePlaneTest.cpp
# mitkToolManagerTest.cpp
mitkToolManagerProviderTest.cpp
mitkManualSegmentationToSurfaceFilterTest.cpp #new cpp unit style
-)
-
-if(MITK_ENABLE_RENDERING_TESTING) #since mitkInteractionTestHelper is currently creating a vtkRenderWindow
-set(MODULE_TESTS
- ${MODULE_TESTS}
mitkToolInteractionTest.cpp
)
-endif()
set(MODULE_IMAGE_TESTS
mitkOverwriteSliceImageFilterTest.cpp #only runs on images
)
set(MODULE_CUSTOM_TESTS
)
set(MODULE_TESTIMAGE
US4DCyl.nrrd
Pic3D.nrrd
Pic2DplusT.nrrd
BallBinary30x30x30.nrrd
Png2D-bw.png
)
diff --git a/Modules/SegmentationUI/Qmitk/QmitkAdaptiveRegionGrowingToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkAdaptiveRegionGrowingToolGUI.h
index e61cf29538..f59f8659be 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkAdaptiveRegionGrowingToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkAdaptiveRegionGrowingToolGUI.h
@@ -1,218 +1,220 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QMITK_QmitkAdaptiveRegionGrowingToolGUI_H
#define QMITK_QmitkAdaptiveRegionGrowingToolGUI_H
#include "itkImage.h"
#include "mitkDataStorage.h"
#include "mitkGeometry3D.h"
#include "mitkPointSet.h"
#include "qwidget.h"
#include "ui_QmitkAdaptiveRegionGrowingToolGUIControls.h"
#include <MitkSegmentationUIExports.h>
#include "QmitkToolGUI.h"
#include "mitkAdaptiveRegionGrowingTool.h"
class DataNode;
class QmitkAdaptiveRegionGrowingToolGUIControls;
/*!
*
* \brief QmitkAdaptiveRegionGrowingToolGUI
*
* Adaptive Region Growing View class of the segmentation.
*
*/
class MITKSEGMENTATIONUI_EXPORT QmitkAdaptiveRegionGrowingToolGUI : public QmitkToolGUI
{
Q_OBJECT
public:
/**
* @brief mitkClassMacro
*/
mitkClassMacro(QmitkAdaptiveRegionGrowingToolGUI, QmitkToolGUI);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
QmitkAdaptiveRegionGrowingToolGUI(QWidget *parent = nullptr);
/** \brief Method to create the connections for the component. This Method is obligatory even if no connections is
* needed*/
virtual void CreateConnections();
///** \brief Method to set the default data storage.*/
virtual void SetDataStorage(mitk::DataStorage *dataStorage);
/**
* @brief Method to set the name of a data node.
* @param labledSegmentation Name of the labeled segmentation
* @param binaryImage Name of the binary image
* @param surface Name of the surface
*/
void SetDataNodeNames(std::string labledSegmentation,
std::string binaryImage,
/*std::string vesselTree,*/ std::string surface,
std::string maskedSegmentation);
/**
* @brief Method to enable/disable controls for region growing
*
* This method checks if a seed point is set and a segmentation exists.
* @param enable/disable controls
*/
void EnableControls(bool enable);
/**
* @brief Method to set the input image node
* @param data node
*/
void SetInputImageNode(mitk::DataNode *node);
void Deactivated();
void Activated();
/**
* @brief The created GUI from the .ui-File. This Attribute is obligatory
*/
Ui::QmitkAdaptiveRegionGrowingToolGUIControls m_Controls;
protected slots:
/**
* @brief Method to start the segmentation
*
* This method is called, when the "Start Segmentation" button is clicked.
*/
void RunSegmentation();
/**
* @brief Method to change the level window
*
* This method is called, when the level window slider is changed via the slider in the control widget
* @param new value
*/
void ChangeLevelWindow(double newValue);
/**
* @brief Method to increase the preview slider
*
* This method is called, when the + button is clicked and increases the value by 1
*/
void IncreaseSlider();
/**
* @brief Method to decrease the preview slider
*
* This method is called, when the - button is clicked and decreases the value by 1
*/
void DecreaseSlider();
/**
* @brief Method to confirm the preview segmentation
*
* This method is called, when the "Confirm Segmentation" button is clicked.
*/
void ConfirmSegmentation();
/**
* @brief Method to switch the volume rendering on/off
* @param on/off
*/
void UseVolumeRendering(bool on);
/**
* @brief Method to set the lower threshold
*
* This method is called, when the minimum threshold slider has changed
* @param lower threshold
*/
void SetLowerThresholdValue(double lowerThreshold);
/**
* @brief Method to set upper threshold
*
* This Method is called, when the maximum threshold slider has changed
* @param upper threshold
*/
void SetUpperThresholdValue(double upperThreshold);
/**
* @brief Method to determine which tool to activate
*
* This method listens to the tool manager and activates this tool if requested otherwise disables this view
*/
void OnNewToolAssociated(mitk::Tool *);
protected:
mitk::AdaptiveRegionGrowingTool::Pointer m_RegionGrow3DTool;
/** \brief Destructor. */
~QmitkAdaptiveRegionGrowingToolGUI() override;
mitk::DataStorage *m_DataStorage;
mitk::DataNode::Pointer m_InputImageNode;
/**
* @brief Method to calculate parameter settings, when a seed point is set
*/
void OnPointAdded();
private:
std::string m_NAMEFORORGIMAGE;
std::string m_NAMEFORLABLEDSEGMENTATIONIMAGE;
std::string m_NAMEFORBINARYIMAGE;
std::string m_NAMEFORSURFACE;
std::string m_NAMEFORMASKEDSEGMENTATION;
mitk::ScalarType m_LOWERTHRESHOLD; // Hounsfield value
mitk::ScalarType m_UPPERTHRESHOLD; // Hounsfield value
mitk::ScalarType m_SeedPointValueMean;
void RemoveHelperNodes();
int m_DetectedLeakagePoint;
bool m_CurrentRGDirectionIsUpwards; // defines fixed threshold (true = LOWERTHRESHOLD fixed, false = UPPERTHRESHOLD
// fixed)
int m_SeedpointValue;
bool m_SliderInitialized;
bool m_UseVolumeRendering;
bool m_UpdateSuggestedThreshold;
float m_SuggestedThValue;
long m_PointSetAddObserverTag;
long m_PointSetMoveObserverTag;
template <typename TPixel, unsigned int VImageDimension>
void StartRegionGrowing(itk::Image<TPixel, VImageDimension> *itkImage,
mitk::BaseGeometry *imageGeometry,
mitk::PointSet::PointType seedPoint);
template <typename TPixel, unsigned int VImageDimension>
void ITKThresholding(itk::Image<TPixel, VImageDimension> *inputImage);
void InitializeLevelWindow();
void EnableVolumeRendering(bool enable);
void UpdateVolumeRenderingThreshold(int thValue);
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdToolGUI.h
index ef6cffb021..bab07a7824 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdToolGUI.h
@@ -1,94 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkBinaryThresholdToolGUI_h_Included
#define QmitkBinaryThresholdToolGUI_h_Included
#include "QmitkToolGUI.h"
#include "mitkBinaryThresholdTool.h"
#include <MitkSegmentationUIExports.h>
#include <QDoubleSpinBox>
class QSlider;
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::BinaryThresholdTool.
This GUI shows a slider to change the tool's threshold and an OK button to accept a preview for actual thresholding.
There is only a slider for INT values in QT. So, if the working image has a float/double pixeltype, we need to convert
the original float intensity into a respective int value for the slider. The slider range is then between 0 and 99.
If the pixeltype is INT, then we do not need any conversion.
Last contributor: $Author$
*/
class MITKSEGMENTATIONUI_EXPORT QmitkBinaryThresholdToolGUI : public QmitkToolGUI
{
Q_OBJECT
public:
mitkClassMacro(QmitkBinaryThresholdToolGUI, QmitkToolGUI);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void OnThresholdingIntervalBordersChanged(double lower, double upper, bool isFloat);
void OnThresholdingValueChanged(double current);
signals:
/// \brief Emitted when threshold Accepted
void thresholdAccepted();
/// \brief Emitted when threshold Canceled
void thresholdCanceled();
public slots:
protected slots:
void OnNewToolAssociated(mitk::Tool *);
void OnAcceptThresholdPreview();
/// \brief Called when Spinner value has changed. Consider: Spinner contains DOUBLE values
void OnSpinnerValueChanged();
/// \brief Called when Slider value has changed. Consider: Slider contains INT values
void OnSliderValueChanged(int value);
protected:
QmitkBinaryThresholdToolGUI();
~QmitkBinaryThresholdToolGUI() override;
/// \brief When Slider (int value) has changed, we need to convert it to a respective double value for the spinner
double SliderIntToDouble(int val);
/// \brief When Spinner (double value) has changed, we need to convert it to a respective int value for the slider
int DoubleToSliderInt(double val);
QSlider *m_Slider;
QDoubleSpinBox *m_Spinner;
/// \brief is image float or int?
bool m_isFloat;
double m_RangeMin;
double m_RangeMax;
double m_Range;
/// \brief helper bool values to find out, which of the GUI elements has been touched by the user.
bool m_ChangingSlider, m_ChangingSpinner;
mitk::BinaryThresholdTool::Pointer m_BinaryThresholdTool;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdULToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdULToolGUI.h
index 3630f85d5e..67965c9ef2 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdULToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdULToolGUI.h
@@ -1,61 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkBinaryThresholdULToolGUI_h_Included
#define QmitkBinaryThresholdULToolGUI_h_Included
#include "QmitkToolGUI.h"
#include "ctkRangeWidget.h"
#include "mitkBinaryThresholdULTool.h"
#include <MitkSegmentationUIExports.h>
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::BinaryThresholdTool.
This GUI shows a slider to change the tool's threshold and an OK button to accept a preview for actual thresholding.
Last contributor: $Author$
*/
class MITKSEGMENTATIONUI_EXPORT QmitkBinaryThresholdULToolGUI : public QmitkToolGUI
{
Q_OBJECT
public:
mitkClassMacro(QmitkBinaryThresholdULToolGUI, QmitkToolGUI);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void OnThresholdingIntervalBordersChanged(double lower, double upper, bool isFloat);
void OnThresholdingValuesChanged(mitk::ScalarType lower, mitk::ScalarType upper);
signals:
public slots:
protected slots:
void OnNewToolAssociated(mitk::Tool *);
void OnAcceptThresholdPreview();
void OnThresholdsChanged(double min, double max);
protected:
QmitkBinaryThresholdULToolGUI();
~QmitkBinaryThresholdULToolGUI() override;
ctkRangeWidget *m_DoubleThresholdSlider;
mitk::BinaryThresholdULTool::Pointer m_BinaryThresholdULTool;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkCalculateGrayValueStatisticsToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkCalculateGrayValueStatisticsToolGUI.h
index f5b77a6d40..f038f7a275 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkCalculateGrayValueStatisticsToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkCalculateGrayValueStatisticsToolGUI.h
@@ -1,57 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkCalculateGrayValueStatisticsToolGUI_h_Included
#define QmitkCalculateGrayValueStatisticsToolGUI_h_Included
#include "QmitkToolGUI.h"
#include <MitkSegmentationUIExports.h>
#include "mitkCalculateGrayValueStatisticsTool.h"
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::CalculateGrayValueStatisticsTool.
Shows nothing. Only when the corresponding tool send a message that statistics are ready, this class pops up a window
showing the results.
Last contributor: $Author$
*/
class MITKSEGMENTATIONUI_EXPORT QmitkCalculateGrayValueStatisticsToolGUI : public QmitkToolGUI
{
Q_OBJECT
public:
mitkClassMacro(QmitkCalculateGrayValueStatisticsToolGUI, QmitkToolGUI);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/// Reacts to signals from mitk::CalculateGrayValueStatisticsTool
void OnCalculationsDone();
signals:
public slots:
protected slots:
/// Connected to signal from QmitkToolGUI. We remember the current tool here
void OnNewToolAssociated(mitk::Tool *);
protected:
QmitkCalculateGrayValueStatisticsToolGUI();
~QmitkCalculateGrayValueStatisticsToolGUI() override;
mitk::CalculateGrayValueStatisticsTool::Pointer m_CalculateGrayValueStatisticsTool;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkDrawPaintbrushToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkDrawPaintbrushToolGUI.h
index 76a8ce7e0b..6470b451bd 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkDrawPaintbrushToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkDrawPaintbrushToolGUI.h
@@ -1,48 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkDrawPaintbrushToolGUI_h_Included
#define QmitkDrawPaintbrushToolGUI_h_Included
#include "QmitkPaintbrushToolGUI.h"
#include <MitkSegmentationUIExports.h>
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::PaintbrushTool.
This GUI shows a slider to change the tool's threshold and an OK button to accept a preview for actual thresholding.
Last contributor: $Author$
*/
class MITKSEGMENTATIONUI_EXPORT QmitkDrawPaintbrushToolGUI : public QmitkPaintbrushToolGUI
{
Q_OBJECT
public:
mitkClassMacro(QmitkDrawPaintbrushToolGUI, QmitkPaintbrushToolGUI);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
~QmitkDrawPaintbrushToolGUI() override;
signals:
public slots:
protected slots:
protected:
QmitkDrawPaintbrushToolGUI();
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkErasePaintbrushToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkErasePaintbrushToolGUI.h
index 1a8362d19f..93473bad5e 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkErasePaintbrushToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkErasePaintbrushToolGUI.h
@@ -1,48 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkErasePaintbrushToolGUI_h_Included
#define QmitkErasePaintbrushToolGUI_h_Included
#include "QmitkPaintbrushToolGUI.h"
#include <MitkSegmentationUIExports.h>
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::PaintbrushTool.
This GUI shows a slider to change the tool's threshold and an OK button to accept a preview for actual thresholding.
Last contributor: $Author$
*/
class MITKSEGMENTATIONUI_EXPORT QmitkErasePaintbrushToolGUI : public QmitkPaintbrushToolGUI
{
Q_OBJECT
public:
mitkClassMacro(QmitkErasePaintbrushToolGUI, QmitkPaintbrushToolGUI);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
signals :
public slots :
protected slots :
protected :
QmitkErasePaintbrushToolGUI();
~QmitkErasePaintbrushToolGUI() override;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkFastMarchingTool3DGUI.h b/Modules/SegmentationUI/Qmitk/QmitkFastMarchingTool3DGUI.h
index e14f669959..67c8204881 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkFastMarchingTool3DGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkFastMarchingTool3DGUI.h
@@ -1,83 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkFastMarchingTool3DGUI_h_Included
#define QmitkFastMarchingTool3DGUI_h_Included
#include "QmitkToolGUI.h"
#include "mitkFastMarchingTool3D.h"
#include <MitkSegmentationUIExports.h>
class ctkSliderWidget;
class ctkRangeWidget;
class QPushButton;
#include "QmitkStepperAdapter.h"
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::FastMarchingTool.
\sa mitk::FastMarchingTool
*/
class MITKSEGMENTATIONUI_EXPORT QmitkFastMarchingTool3DGUI : public QmitkToolGUI
{
Q_OBJECT
public:
mitkClassMacro(QmitkFastMarchingTool3DGUI, QmitkToolGUI);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void OnThresholdChanged(int current);
protected slots:
void OnNewToolAssociated(mitk::Tool *);
void OnThresholdChanged(double, double);
void OnAlphaChanged(double);
void OnBetaChanged(double);
void OnSigmaChanged(double);
void OnStoppingValueChanged(double);
void OnConfirmSegmentation();
void Refetch();
void SetStepper(mitk::Stepper *);
void OnClearSeeds();
protected:
QmitkFastMarchingTool3DGUI();
~QmitkFastMarchingTool3DGUI() override;
void BusyStateChanged(bool) override;
void Update();
ctkRangeWidget *m_slwThreshold;
ctkSliderWidget *m_slStoppingValue;
ctkSliderWidget *m_slSigma;
ctkSliderWidget *m_slAlpha;
ctkSliderWidget *m_slBeta;
QPushButton *m_btConfirm;
QPushButton *m_btClearSeeds;
mitk::FastMarchingTool3D::Pointer m_FastMarchingTool;
bool m_TimeIsConnected;
mitk::Stepper::Pointer m_TimeStepper;
void OnFastMarchingToolReady();
private:
void EnableWidgets(bool);
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkFastMarchingToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkFastMarchingToolGUI.h
index c7998e7cf3..6d1ede7b3d 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkFastMarchingToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkFastMarchingToolGUI.h
@@ -1,83 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkFastMarchingToolGUI_h_Included
#define QmitkFastMarchingToolGUI_h_Included
#include "QmitkToolGUI.h"
#include "mitkFastMarchingTool.h"
#include <MitkSegmentationUIExports.h>
class ctkSliderWidget;
class ctkRangeWidget;
class QPushButton;
#include "QmitkStepperAdapter.h"
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::FastMarchingTool.
\sa mitk::FastMarchingTool
*/
class MITKSEGMENTATIONUI_EXPORT QmitkFastMarchingToolGUI : public QmitkToolGUI
{
Q_OBJECT
public:
mitkClassMacro(QmitkFastMarchingToolGUI, QmitkToolGUI);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void OnThresholdChanged(int current);
protected slots:
void OnNewToolAssociated(mitk::Tool *);
void OnThresholdChanged(double, double);
void OnAlphaChanged(double);
void OnBetaChanged(double);
void OnSigmaChanged(double);
void OnStoppingValueChanged(double);
void OnConfirmSegmentation();
void Refetch();
void SetStepper(mitk::Stepper *);
void OnClearSeeds();
protected:
QmitkFastMarchingToolGUI();
~QmitkFastMarchingToolGUI() override;
void Update();
void BusyStateChanged(bool) override;
ctkRangeWidget *m_slwThreshold;
ctkSliderWidget *m_slStoppingValue;
ctkSliderWidget *m_slSigma;
ctkSliderWidget *m_slAlpha;
ctkSliderWidget *m_slBeta;
QPushButton *m_btConfirm;
QPushButton *m_btClearSeeds;
mitk::FastMarchingTool::Pointer m_FastMarchingTool;
bool m_TimeIsConnected;
mitk::Stepper::Pointer m_TimeStepper;
void OnFastMarchingToolReady();
private:
void EnableWidgets(bool);
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkLiveWireTool2DGUI.h b/Modules/SegmentationUI/Qmitk/QmitkLiveWireTool2DGUI.h
index c9342b4485..f0c2a6b102 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkLiveWireTool2DGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkLiveWireTool2DGUI.h
@@ -1,63 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkLiveWireTool2DGUI_h_Included
#define QmitkLiveWireTool2DGUI_h_Included
#include "QmitkToolGUI.h"
#include "mitkLiveWireTool2D.h"
#include "ui_QmitkLiveWireTool2DGUIControls.h"
#include <MitkSegmentationUIExports.h>
class QSlider;
class QLabel;
class QFrame;
class QPushButton;
#include <QCheckBox>
#include "QmitkStepperAdapter.h"
class QmitkLiveWireTool2DGUIControls;
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::LiveWireTool.
\sa mitk::LiveWireTool2D
*/
class MITKSEGMENTATIONUI_EXPORT QmitkLiveWireTool2DGUI : public QmitkToolGUI
{
Q_OBJECT
public:
mitkClassMacro(QmitkLiveWireTool2DGUI, QmitkToolGUI);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
protected slots :
void OnNewToolAssociated(mitk::Tool *);
void OnConfirmSegmentation();
void OnClearSegmentation();
void OnShowInformation(bool on);
protected:
QmitkLiveWireTool2DGUI();
~QmitkLiveWireTool2DGUI() override;
Ui::QmitkLiveWireTool2DGUIControls m_Controls;
mitk::LiveWireTool2D::Pointer m_LiveWireTool;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkOtsuTool3DGUI.h b/Modules/SegmentationUI/Qmitk/QmitkOtsuTool3DGUI.h
index 7967a2aa9c..f562f73560 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkOtsuTool3DGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkOtsuTool3DGUI.h
@@ -1,82 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkOtsuTool3DGUI_h_Included
#define QmitkOtsuTool3DGUI_h_Included
#include "QmitkToolGUI.h"
#include "mitkOtsuTool3D.h"
#include "ui_QmitkOtsuToolWidgetControls.h"
#include <MitkSegmentationUIExports.h>
#include <QListWidget>
#include <QPushButton>
class QSpinBox;
class QLabel;
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::.
\sa mitk::
This GUI shows ...
Last contributor: $Author$
*/
class MITKSEGMENTATIONUI_EXPORT QmitkOtsuTool3DGUI : public QmitkToolGUI
{
Q_OBJECT
public:
mitkClassMacro(QmitkOtsuTool3DGUI, QmitkToolGUI);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
signals :
public slots :
protected slots :
void OnNewToolAssociated(mitk::Tool *);
void OnSpinboxValueAccept();
void OnSegmentationRegionAccept();
void OnRegionSelectionChanged();
void OnRegionSpinboxChanged(int);
void OnVolumePreviewChecked(int);
private slots:
void OnAdvancedSettingsButtonToggled(bool toggled);
protected:
QmitkOtsuTool3DGUI();
~QmitkOtsuTool3DGUI() override;
mitk::OtsuTool3D::Pointer m_OtsuTool3DTool;
Ui_QmitkOtsuToolWidgetControls m_Controls;
int m_NumberOfRegions;
bool m_UseValleyEmphasis;
int m_NumberOfBins;
QList<QListWidgetItem *> m_SelectedItems;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkPickingToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkPickingToolGUI.h
index 499fec0e53..bf8a3b78b5 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkPickingToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkPickingToolGUI.h
@@ -1,59 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkPickingToolGUI_h_Included
#define QmitkPickingToolGUI_h_Included
#include "QmitkToolGUI.h"
#include "mitkPickingTool.h"
#include "ui_QmitkPickingToolGUIControls.h"
#include <MitkSegmentationUIExports.h>
class QSlider;
class QLabel;
class QFrame;
class QPushButton;
#include <QCheckBox>
#include "QmitkStepperAdapter.h"
class QmitkPickingToolGUIControls;
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::LiveWireTool.
\sa mitk::PickingTool
*/
class MITKSEGMENTATIONUI_EXPORT QmitkPickingToolGUI : public QmitkToolGUI
{
Q_OBJECT
public:
mitkClassMacro(QmitkPickingToolGUI, QmitkToolGUI);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
protected slots :
void OnNewToolAssociated(mitk::Tool *);
void OnConfirmSegmentation();
protected:
QmitkPickingToolGUI();
~QmitkPickingToolGUI() override;
Ui::QmitkPickingToolGUIControls m_Controls;
mitk::PickingTool::Pointer m_PickingTool;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkPixelManipulationToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkPixelManipulationToolGUI.h
index fc3fba7236..e19705892a 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkPixelManipulationToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkPixelManipulationToolGUI.h
@@ -1,46 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QMITKPIXELMANIPULATIONTOOLGUI_H
#define QMITKPIXELMANIPULATIONTOOLGUI_H
#include "QmitkDataStorageComboBox.h"
#include "QmitkToolGUI.h"
#include "mitkPixelManipulationTool.h"
#include <QSlider>
#include <QSpinBox>
class QmitkPixelManipulationToolGUI : public QmitkToolGUI
{
Q_OBJECT
public:
mitkClassMacro(QmitkPixelManipulationToolGUI, QmitkToolGUI);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
protected slots :
void OnNewToolAssociated(mitk::Tool *);
void OnSliderValueChanged(int);
void OnSpinBoxChanged();
void OnOkButtonClicked();
void SetFixedValueOn(bool);
void SetFixedValueOff(bool);
protected:
QmitkPixelManipulationToolGUI();
~QmitkPixelManipulationToolGUI() override;
mitk::PixelManipulationTool::Pointer m_PixelManipulationTool;
QSlider *m_Slider;
QSpinBox *m_Spinner;
}; // class
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkWatershedToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkWatershedToolGUI.h
index ebeee72bf9..23c40cab24 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkWatershedToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkWatershedToolGUI.h
@@ -1,71 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkWatershedToolGUI_h_Included
#define QmitkWatershedToolGUI_h_Included
#include "QmitkToolGUI.h"
#include "mitkWatershedTool.h"
#include <MitkSegmentationUIExports.h>
class QSlider;
class QLabel;
class QFrame;
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::WatershedTool.
\sa mitk::WatershedTool
This GUI shows two sliders to change the watershed parameters. It executes the watershed algorithm by clicking on the
button.
*/
class MITKSEGMENTATIONUI_EXPORT QmitkWatershedToolGUI : public QmitkToolGUI
{
Q_OBJECT
public:
mitkClassMacro(QmitkWatershedToolGUI, QmitkToolGUI);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
protected slots :
void OnNewToolAssociated(mitk::Tool *);
/** \brief Passes the chosen threshold value directly to the watershed tool */
void OnSliderValueThresholdChanged(int value);
/** \brief Passes the chosen level value directly to the watershed tool */
void OnSliderValueLevelChanged(int value);
/** \brief Starts segmentation algorithm in the watershed tool */
void OnCreateSegmentation();
protected:
QmitkWatershedToolGUI();
~QmitkWatershedToolGUI() override;
QSlider *m_SliderThreshold;
QSlider *m_SliderLevel;
/** \brief Label showing the current threshold value. */
QLabel *m_ThresholdLabel;
/** \brief Label showing the current level value. */
QLabel *m_LevelLabel;
/** \brief Label showing additional informations. */
QLabel *m_InformationLabel;
QFrame *m_Frame;
mitk::WatershedTool::Pointer m_WatershedTool;
};
#endif
diff --git a/Modules/SurfaceInterpolation/mitkComputeContourSetNormalsFilter.h b/Modules/SurfaceInterpolation/mitkComputeContourSetNormalsFilter.h
index d738806bb4..cef1265ead 100644
--- a/Modules/SurfaceInterpolation/mitkComputeContourSetNormalsFilter.h
+++ b/Modules/SurfaceInterpolation/mitkComputeContourSetNormalsFilter.h
@@ -1,101 +1,102 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkComputeContourSetNormalsFilter_h_Included
#define mitkComputeContourSetNormalsFilter_h_Included
#include "mitkProgressBar.h"
#include "mitkSurface.h"
#include "mitkSurfaceToSurfaceFilter.h"
#include <MitkSurfaceInterpolationExports.h>
#include "vtkCellArray.h"
#include "vtkCellData.h"
#include "vtkDoubleArray.h"
#include "vtkLine.h"
#include "vtkMath.h"
#include "vtkPolyData.h"
#include "vtkSmartPointer.h"
#include "mitkImage.h"
namespace mitk
{
/**
\brief Filter to compute the normales for contours based on vtkPolygons
This filter takes a number of extracted contours and computes the normals for each
contour edge point. The normals can be accessed by calling:
filter->GetOutput(i)->GetVtkPolyData()->GetCellData()->GetNormals();
See also the method GetNormalsAsSurface()
Note: If a segmentation binary image is provided this filter assures that the computed normals
do not point into the segmentation image
$Author: fetzer$
*/
class MITKSURFACEINTERPOLATION_EXPORT ComputeContourSetNormalsFilter : public SurfaceToSurfaceFilter
{
public:
mitkClassMacro(ComputeContourSetNormalsFilter, SurfaceToSurfaceFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/*
\brief Returns the computed normals as a surface
*/
mitk::Surface::Pointer GetNormalsAsSurface();
// Resets the filter, i.e. removes all inputs and outputs
void Reset();
void SetMaxSpacing(double);
/**
\brief Set whether the mitkProgressBar should be used
\a Parameter true for using the progress bar, false otherwise
*/
void SetUseProgressBar(bool);
/**
\brief Set the stepsize which the progress bar should proceed
\a Parameter The stepsize for progressing
*/
void SetProgressStepSize(unsigned int stepSize);
void SetSegmentationBinaryImage(mitk::Image *segmentationImage) { m_SegmentationBinaryImage = segmentationImage; }
protected:
ComputeContourSetNormalsFilter();
~ComputeContourSetNormalsFilter() override;
void GenerateData() override;
void GenerateOutputInformation() override;
private:
// The segmentation out of which the contours were extracted. Can be used to determine the direction of the normals
mitk::Image::Pointer m_SegmentationBinaryImage;
double m_MaxSpacing;
unsigned int m_NegativeNormalCounter;
unsigned int m_PositiveNormalCounter;
bool m_UseProgressBar;
unsigned int m_ProgressStepSize;
}; // class
} // namespace
#endif
diff --git a/Modules/SurfaceInterpolation/mitkCreateDistanceImageFromSurfaceFilter.h b/Modules/SurfaceInterpolation/mitkCreateDistanceImageFromSurfaceFilter.h
index 559f742de2..5a8417f7da 100644
--- a/Modules/SurfaceInterpolation/mitkCreateDistanceImageFromSurfaceFilter.h
+++ b/Modules/SurfaceInterpolation/mitkCreateDistanceImageFromSurfaceFilter.h
@@ -1,178 +1,178 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkCreateDistanceImageFromSurfaceFilter_h_Included
#define mitkCreateDistanceImageFromSurfaceFilter_h_Included
#include <MitkSurfaceInterpolationExports.h>
#include "mitkImageSource.h"
#include "mitkProgressBar.h"
#include "mitkSurface.h"
#include "vnl/vnl_vector_fixed.h"
#include "itkImageBase.h"
#include <Eigen/Dense>
namespace mitk
{
/**
\brief This filter interpolates the 3D surface for a segmented area. The basis for the interpolation
are the edge-points of contours that are drawn into an image.
The interpolation itself is performed via Radial Basis Function Interpolation.
ATTENTION:
This filter needs beside the edge points of the delineated contours additionally the normals for each
edge point.
\sa mitkSurfaceInterpolationController
Based on the contour edge points and their normal this filter calculates a distance function with the following
properties:
- Putting a point into the distance function that lies inside the considered surface gives a negativ scalar
value
- Putting a point into the distance function that lies outside the considered surface gives a positive scalar
value
- Putting a point into the distance function that lies exactly on the considered surface gives the value zero
With this interpolated distance function a distance image will be created. The desired surface can then be
extract e.g.
with the marching cubes algorithm. (Within the distance image the surface goes exactly where the pixelvalues
are zero)
Note that the obtained distance image has always an isotropig spacing. The size (in this case volume) of the
image can be
adjusted by calling SetDistanceImageVolume(unsigned int volume) which specifies the number ob pixels enclosed
by the image.
\ingroup Process
$Author: fetzer$
*/
class MITKSURFACEINTERPOLATION_EXPORT CreateDistanceImageFromSurfaceFilter : public ImageSource
{
public:
typedef vnl_vector_fixed<double, 3> PointType;
typedef itk::Image<double, 3> DistanceImageType;
typedef DistanceImageType::IndexType IndexType;
typedef std::vector<PointType> NormalList;
typedef std::vector<PointType> CenterList;
typedef std::vector<Surface::Pointer> SurfaceList;
mitkClassMacro(CreateDistanceImageFromSurfaceFilter, ImageSource);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkGetMacro(DistanceImageSpacing, double)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkGetMacro(DistanceImageSpacing, double);
using Superclass::SetInput;
// Methods copied from mitkSurfaceToSurfaceFilter
virtual void SetInput(const mitk::Surface *surface);
virtual void SetInput(unsigned int idx, const mitk::Surface *surface);
virtual const mitk::Surface *GetInput();
virtual const mitk::Surface *GetInput(unsigned int idx);
virtual void RemoveInputs(mitk::Surface *input);
/**
\brief Set the size of the output distance image. The size is specified by the image's volume
(i.e. in this case how many pixels are enclosed by the image)
If non is set, the volume will be 500000 pixels.
*/
itkSetMacro(DistanceImageVolume, unsigned int);
void PrintEquationSystem();
// Resets the filter, i.e. removes all inputs and outputs
void Reset();
/**
\brief Set whether the mitkProgressBar should be used
\a Parameter true for using the progress bar, false otherwise
*/
void SetUseProgressBar(bool);
/**
\brief Set the stepsize which the progress bar should proceed
\a Parameter The stepsize for progressing
*/
void SetProgressStepSize(unsigned int stepSize);
void SetReferenceImage(itk::ImageBase<3>::Pointer referenceImage);
protected:
CreateDistanceImageFromSurfaceFilter();
~CreateDistanceImageFromSurfaceFilter() override;
void GenerateData() override;
void GenerateOutputInformation() override;
private:
void CreateSolutionMatrixAndFunctionValues();
double CalculateDistanceValue(PointType p);
void FillDistanceImage();
/**
* \brief This method fills the given variables with the minimum and
* maximum coordinates that contain all input-points in index- and
* world-coordinates.
*
* This method iterates over all input-points and transforms them from
* world-coordinates to index-coordinates using the transform of the
* reference-Image.
* Next, the minimal and maximal index-coordinates are determined that
* span an area that contains all given input-points.
* These index-coordinates are then transformed back to world-coordinates.
*
* These minimal and maximal points are then set to the given variables.
*/
void DetermineBounds(DistanceImageType::PointType &minPointInWorldCoordinates,
DistanceImageType::PointType &maxPointInWorldCoordinates,
DistanceImageType::IndexType &minPointInIndexCoordinates,
DistanceImageType::IndexType &maxPointInIndexCoordinates);
void PreprocessContourPoints();
void CreateEmptyDistanceImage();
// Datastructures for the interpolation
CenterList m_Centers;
NormalList m_Normals;
Eigen::MatrixXd m_SolutionMatrix;
Eigen::VectorXd m_FunctionValues;
Eigen::VectorXd m_Weights;
DistanceImageType::Pointer m_DistanceImageITK;
itk::ImageBase<3>::Pointer m_ReferenceImage;
double m_DistanceImageSpacing;
double m_DistanceImageDefaultBufferValue;
unsigned int m_DistanceImageVolume;
bool m_UseProgressBar;
unsigned int m_ProgressStepSize;
};
} // namespace
#endif
diff --git a/Modules/SurfaceInterpolation/mitkImageToPointCloudFilter.h b/Modules/SurfaceInterpolation/mitkImageToPointCloudFilter.h
index 767d705097..a86151cb51 100644
--- a/Modules/SurfaceInterpolation/mitkImageToPointCloudFilter.h
+++ b/Modules/SurfaceInterpolation/mitkImageToPointCloudFilter.h
@@ -1,84 +1,86 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkImageToPointCloudFilter_h_Included
#define mitkImageToPointCloudFilter_h_Included
#include <MitkSurfaceInterpolationExports.h>
#include <mitkImageToUnstructuredGridFilter.h>
#include <itkCastImageFilter.h>
namespace mitk
{
/**
* @brief The filter extracts the edge pixels of an image as points and stores
* them in an UnstructuredGrid. Every pixel which grey value is between the
* mean +- standard deviation * (2 or 3), will be extracted as point. The
* DetectionMethod can be set to choose if the doubled or tripled standard
* deviation is used.
*/
class MITKSURFACEINTERPOLATION_EXPORT ImageToPointCloudFilter : public ImageToUnstructuredGridFilter
{
public:
/**
* @brief The method which calculates and extracts the edge pixels/points.
* For the edge detection the laplacian filter is used and for extraction
* the standard deviation multiplied with 2, 3 or 4 (depending on selected
* method) is used.
*/
enum DetectionMethod
{
LAPLACIAN_STD_DEV2 = 0,
LAPLACIAN_STD_DEV3 = 1,
LAPLACIAN_STD_DEV4 = 2
};
- mitkClassMacro(ImageToPointCloudFilter, ImageToUnstructuredGridFilter) itkFactorylessNewMacro(Self)
+ mitkClassMacro(ImageToPointCloudFilter, ImageToUnstructuredGridFilter);
+
+ itkFactorylessNewMacro(Self);
typedef itk::Image<double, 3> FloatImageType;
/** Returns the selected DetectionMethod */
- itkGetMacro(Method, DetectionMethod)
+ itkGetMacro(Method, DetectionMethod);
/** Sets the DetectionMethod for edge detection and extraction */
- itkSetMacro(Method, DetectionMethod)
+ itkSetMacro(Method, DetectionMethod);
protected :
/** This method is called by Update(). */
void GenerateData() override;
/** Initializes the output information */
void GenerateOutputInformation() override;
/** Constructor */
ImageToPointCloudFilter();
/** Destructor */
~ImageToPointCloudFilter() override;
private:
/** Uses the laplace filter to create an image and extracts a pixel as point
* if the grey value is between the mean +- standard deviation * (2 or 3) */
template <typename TPixel, unsigned int VImageDimension>
void StdDeviations(itk::Image<TPixel, VImageDimension> *image, int amount);
/** The geometry of the input image for transforming the pixel coordinates to
* world coordinates */
mitk::BaseGeometry *m_Geometry;
/** The selected detection method */
DetectionMethod m_Method;
};
}
#endif
diff --git a/Modules/SurfaceInterpolation/mitkPointCloudScoringFilter.h b/Modules/SurfaceInterpolation/mitkPointCloudScoringFilter.h
index 428c56d5c2..93c3b947fd 100644
--- a/Modules/SurfaceInterpolation/mitkPointCloudScoringFilter.h
+++ b/Modules/SurfaceInterpolation/mitkPointCloudScoringFilter.h
@@ -1,72 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPointCloudScoringFilter_h_Included
#define mitkPointCloudScoringFilter_h_Included
#include <MitkSurfaceInterpolationExports.h>
#include <mitkUnstructuredGridToUnstructuredGridFilter.h>
namespace mitk
{
class UnstructuredGrid;
/**
* @brief Scores an UnstructuredGrid as good as one matches to the other.
*
* The result UnstructureGrid of the filter are the points where the distance to
* the closest point of the other UnstructuredGrid is higher than the average
* distance from all points to their closest neighbours of the other
* UnstructuredGrid.
* The second input is the UnstructuredGrid, which you want to score. All Points
* of the output UnstructuredGrid are from the second input.
*/
class MITKSURFACEINTERPOLATION_EXPORT PointCloudScoringFilter : public UnstructuredGridToUnstructuredGridFilter
{
public:
typedef std::pair<int, double> ScorePair;
- mitkClassMacro(PointCloudScoringFilter, UnstructuredGridToUnstructuredGridFilter)
+ mitkClassMacro(PointCloudScoringFilter, UnstructuredGridToUnstructuredGridFilter);
- itkFactorylessNewMacro(Self)
+ itkFactorylessNewMacro(Self);
/** Number of Points of the scored UnstructuredGrid. These points are far away
* from their neighbours */
- itkGetMacro(NumberOfOutpPoints, int)
+ itkGetMacro(NumberOfOutpPoints, int);
/** A vector in which the point IDs and their distance to their neighbours
* is stored */
- itkGetMacro(FilteredScores, std::vector<ScorePair>)
+ itkGetMacro(FilteredScores, std::vector<ScorePair>);
protected :
/** is called by the Update() method */
void GenerateData() override;
/** Defines the output */
void GenerateOutputInformation() override;
/** Constructor */
PointCloudScoringFilter();
/** Destructor */
~PointCloudScoringFilter() override;
private:
/** The Point IDs and their distance to their neighbours */
std::vector<ScorePair> m_FilteredScores;
/** The number of points which are far aways from their neighbours */
int m_NumberOfOutpPoints;
};
}
#endif
diff --git a/Modules/SurfaceInterpolation/mitkReduceContourSetFilter.h b/Modules/SurfaceInterpolation/mitkReduceContourSetFilter.h
index 07d5633153..1f18b80580 100644
--- a/Modules/SurfaceInterpolation/mitkReduceContourSetFilter.h
+++ b/Modules/SurfaceInterpolation/mitkReduceContourSetFilter.h
@@ -1,134 +1,134 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkReduceContourSetFilter_h_Included
#define mitkReduceContourSetFilter_h_Included
#include "mitkProgressBar.h"
#include "mitkSurface.h"
#include "mitkSurfaceToSurfaceFilter.h"
#include <MitkSurfaceInterpolationExports.h>
#include "vtkCellArray.h"
#include "vtkMath.h"
#include "vtkPoints.h"
#include "vtkPolyData.h"
#include "vtkPolygon.h"
#include "vtkSmartPointer.h"
#include <stack>
namespace mitk
{
/**
\brief A filter that reduces the number of points of contours represented by a mitk::Surface
The type of the reduction can be set via SetReductionType. The two ways provided by this filter is the
\li NTH_POINT Algorithm which reduces the contours according to a certain stepsize
\li DOUGLAS_PEUCKER Algorithm which incorpates an error tolerance into the reduction.
Stepsize and error tolerance can be set via SetStepSize and SetTolerance.
Additional if more than one input contour is provided this filter tries detect contours which occur just because
of an intersection. These intersection contours are eliminated. In oder to ensure a correct elimination the min and
max
spacing of the original image must be provided.
The output is a mitk::Surface.
$Author: fetzer$
*/
class MITKSURFACEINTERPOLATION_EXPORT ReduceContourSetFilter : public SurfaceToSurfaceFilter
{
public:
enum Reduction_Type
{
NTH_POINT,
DOUGLAS_PEUCKER
};
struct LineSegment
{
unsigned int StartIndex;
unsigned int EndIndex;
};
mitkClassMacro(ReduceContourSetFilter, SurfaceToSurfaceFilter);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
-
- itkSetMacro(MinSpacing, double);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkSetMacro(MinSpacing, double);
itkSetMacro(MaxSpacing, double);
itkSetMacro(ReductionType, Reduction_Type);
itkSetMacro(StepSize, unsigned int);
itkSetMacro(Tolerance, double);
itkGetMacro(NumberOfPointsAfterReduction, unsigned int);
// Resets the filter, i.e. removes all inputs and outputs
void Reset();
/**
\brief Set whether the mitkProgressBar should be used
\a Parameter true for using the progress bar, false otherwise
*/
void SetUseProgressBar(bool);
using itk::ProcessObject::SetInput;
void SetInput(const mitk::Surface *surface) override;
void SetInput(unsigned int idx, const mitk::Surface *surface) override;
/**
\brief Set the stepsize which the progress bar should proceed
\a Parameter The stepsize for progressing
*/
void SetProgressStepSize(unsigned int stepSize);
protected:
ReduceContourSetFilter();
~ReduceContourSetFilter() override;
void GenerateData() override;
void GenerateOutputInformation() override;
private:
void ReduceNumberOfPointsByNthPoint(
vtkIdType cellSize, vtkIdType *cell, vtkPoints *points, vtkPolygon *reducedPolygon, vtkPoints *reducedPoints);
void ReduceNumberOfPointsByDouglasPeucker(
vtkIdType cellSize, vtkIdType *cell, vtkPoints *points, vtkPolygon *reducedPolygon, vtkPoints *reducedPoints);
bool CheckForIntersection(
vtkIdType *currentCell,
vtkIdType currentCellSize,
vtkPoints *currentPoints,
/*vtkIdType numberOfIntersections, vtkIdType* intersectionPoints,*/ unsigned int currentInputIndex);
double m_MinSpacing;
double m_MaxSpacing;
Reduction_Type m_ReductionType;
unsigned int m_StepSize;
double m_Tolerance;
unsigned int m_MaxSegmentLenght;
bool m_UseProgressBar;
unsigned int m_ProgressStepSize;
unsigned int m_NumberOfPointsAfterReduction;
}; // class
} // namespace
#endif
diff --git a/Modules/SurfaceInterpolation/mitkSurfaceBasedInterpolationController.h b/Modules/SurfaceInterpolation/mitkSurfaceBasedInterpolationController.h
index 8fe9dc9e60..f1012acea2 100644
--- a/Modules/SurfaceInterpolation/mitkSurfaceBasedInterpolationController.h
+++ b/Modules/SurfaceInterpolation/mitkSurfaceBasedInterpolationController.h
@@ -1,143 +1,144 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkSurfaceBasedInterpolationController_h_Included
#define mitkSurfaceBasedInterpolationController_h_Included
//#include "mitkCommon.h"
#include "mitkContourModel.h"
#include "mitkRestorePlanePositionOperation.h"
#include "mitkSurface.h"
#include <MitkSurfaceInterpolationExports.h>
#include "mitkCreateDistanceImageFromSurfaceFilter.h"
#include "mitkReduceContourSetFilter.h"
#include "mitkProgressBar.h"
namespace mitk
{
class RestorePlanePositionOperation;
class MITKSURFACEINTERPOLATION_EXPORT SurfaceBasedInterpolationController : public itk::Object
{
public:
- mitkClassMacroItkParent(SurfaceBasedInterpolationController, itk::Object) itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacroItkParent(SurfaceBasedInterpolationController, itk::Object);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
- static SurfaceBasedInterpolationController *GetInstance();
+ static SurfaceBasedInterpolationController *GetInstance();
/**
* Adds a new extracted contour to the list
*/
void AddNewContour(ContourModel::Pointer newContour, RestorePlanePositionOperation *op);
/**
* Launches the interpolation method. A surface mesh is generated out of the given extracted contours.
*/
void Interpolate();
/**
* Retrieves a surface mesh resulting from the interpolation of the given extracted contours.
*/
mitk::Surface::Pointer GetInterpolationResult();
/**
* Sets the minimum spacing of the current selected segmentation
* This is needed since the contour points we reduced before, are used to interpolate the surface
*/
void SetMinSpacing(double minSpacing);
/**
* Sets the minimum spacing of the current selected segmentation
* This is needed since the contour points we reduced before, are used to interpolate the surface
*/
void SetMaxSpacing(double maxSpacing);
/**
* Sets the volume i.e. the number of pixels that the distance image should have
* By evaluation we found out that 50.000 pixel delivers a good result
*/
void SetDistanceImageVolume(unsigned int value);
/**
* Sets the working image used by the interpolation method.
* This is needed because the calculation of the normals needs to now wheather a normal points toward the inside of
* a segmentation or not
*/
void SetWorkingImage(Image *workingImage);
/**
* Retrieves the input contours as a mitk::Surface
*/
Surface *GetContoursAsSurface();
/**
* Sets the current list of contour points which is used for the surface interpolation
* @param activeLabel The active label in the current working image
*/
void SetActiveLabel(int activeLabel);
mitk::Image *GetImage();
/**
* Estimates the memory that is needed to build up the equation system for the interpolation.
* \returns The percentage of the real memory which will be used by the interpolation calculation
*/
double EstimatePortionOfNeededMemory();
protected:
SurfaceBasedInterpolationController();
~SurfaceBasedInterpolationController() override;
void Initialize();
private:
// void OnSegmentationDeleted(const itk::Object *caller, const itk::EventObject &event);
/*
struct ContourPositionPair {
ContourModel::Pointer contour;
RestorePlanePositionOperation* position;
};
*/
typedef std::pair<ContourModel::Pointer, RestorePlanePositionOperation *> ContourPositionPair;
typedef std::vector<ContourPositionPair> ContourPositionPairList;
typedef std::map<unsigned int, ContourPositionPairList> ContourListMap;
// ReduceContourSetFilter::Pointer m_ReduceFilter;
// ComputeContourSetNormalsFilter::Pointer m_NormalsFilter;
CreateDistanceImageFromSurfaceFilter::Pointer m_InterpolateSurfaceFilter;
double m_MinSpacing;
double m_MaxSpacing;
unsigned int m_DistanceImageVolume;
Image *m_WorkingImage;
Surface::Pointer m_Contours;
// vtkSmartPointer<vtkPolyData> m_PolyData;
ContourListMap m_MapOfContourLists;
mitk::Surface::Pointer m_InterpolationResult;
// unsigned int m_CurrentNumberOfReducedContours;
int m_ActiveLabel;
// std::map<mitk::Image*, unsigned long> m_SegmentationObserverTags;
};
}
#endif
diff --git a/Modules/SurfaceInterpolation/mitkSurfaceInterpolationController.h b/Modules/SurfaceInterpolation/mitkSurfaceInterpolationController.h
index 7467baf865..69ed695ea5 100644
--- a/Modules/SurfaceInterpolation/mitkSurfaceInterpolationController.h
+++ b/Modules/SurfaceInterpolation/mitkSurfaceInterpolationController.h
@@ -1,250 +1,250 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkSurfaceInterpolationController_h_Included
#define mitkSurfaceInterpolationController_h_Included
#include "mitkColorProperty.h"
#include "mitkCommon.h"
#include "mitkInteractionConst.h"
#include "mitkProperties.h"
#include "mitkRestorePlanePositionOperation.h"
#include "mitkSurface.h"
#include <MitkSurfaceInterpolationExports.h>
#include "mitkComputeContourSetNormalsFilter.h"
#include "mitkCreateDistanceImageFromSurfaceFilter.h"
#include "mitkReduceContourSetFilter.h"
#include "mitkDataNode.h"
#include "mitkDataStorage.h"
#include "vtkAppendPolyData.h"
#include "vtkCellArray.h"
#include "vtkPoints.h"
#include "vtkPolyData.h"
#include "vtkPolygon.h"
#include "vtkSmartPointer.h"
#include "mitkImageTimeSelector.h"
#include "mitkVtkRepresentationProperty.h"
#include "vtkImageData.h"
#include "vtkMarchingCubes.h"
#include "vtkProperty.h"
#include "mitkProgressBar.h"
namespace mitk
{
class MITKSURFACEINTERPOLATION_EXPORT SurfaceInterpolationController : public itk::Object
{
public:
- mitkClassMacroItkParent(SurfaceInterpolationController, itk::Object) itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacroItkParent(SurfaceInterpolationController, itk::Object);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
+ itkGetMacro(DistanceImageSpacing, double);
- itkGetMacro(DistanceImageSpacing, double)
-
- struct ContourPositionInformation
+ struct ContourPositionInformation
{
Surface::Pointer contour;
Vector3D contourNormal;
Point3D contourPoint;
};
typedef std::vector<ContourPositionInformation> ContourPositionInformationList;
typedef std::vector<ContourPositionInformationList> ContourPositionInformationVec2D;
// typedef std::map<mitk::Image*, ContourPositionInformationList> ContourListMap;
typedef std::map<mitk::Image *, ContourPositionInformationVec2D> ContourListMap;
static SurfaceInterpolationController *GetInstance();
void SetCurrentTimeStep(unsigned int ts)
{
if (m_CurrentTimeStep != ts)
{
m_CurrentTimeStep = ts;
if (m_SelectedSegmentation)
{
this->ReinitializeInterpolation();
}
}
};
unsigned int GetCurrentTimeStep() { return m_CurrentTimeStep; };
/**
* @brief Adds a new extracted contour to the list
* @param newContour the contour to be added. If a contour at that position
* already exists the related contour will be updated
*/
void AddNewContour(Surface::Pointer newContour);
/**
* @brief Removes the contour for a given plane for the current selected segmenation
* @param contourInfo the contour which should be removed
* @return true if a contour was found and removed, false if no contour was found
*/
bool RemoveContour(ContourPositionInformation contourInfo);
/**
* @brief Adds new extracted contours to the list. If one or more contours at a given position
* already exist they will be updated respectively
* @param newContours the list of the contours
*/
void AddNewContours(std::vector<Surface::Pointer> newContours);
/**
* @brief Returns the contour for a given plane for the current selected segmenation
* @param ontourInfo the contour which should be returned
* @return the contour as an mitk::Surface. If no contour is available at the give position nullptr is returned
*/
const mitk::Surface *GetContour(ContourPositionInformation contourInfo);
/**
* @brief Returns the number of available contours for the current selected segmentation
* @return the number of contours
*/
unsigned int GetNumberOfContours();
/**
* Interpolates the 3D surface from the given extracted contours
*/
void Interpolate();
mitk::Surface::Pointer GetInterpolationResult();
/**
* Sets the minimum spacing of the current selected segmentation
* This is needed since the contour points we reduced before they are used to interpolate the surface
*/
void SetMinSpacing(double minSpacing);
/**
* Sets the minimum spacing of the current selected segmentation
* This is needed since the contour points we reduced before they are used to interpolate the surface
*/
void SetMaxSpacing(double maxSpacing);
/**
* Sets the volume i.e. the number of pixels that the distance image should have
* By evaluation we found out that 50.000 pixel delivers a good result
*/
void SetDistanceImageVolume(unsigned int distImageVolume);
/**
* @brief Get the current selected segmentation for which the interpolation is performed
* @return the current segmentation image
*/
mitk::Image::Pointer GetCurrentSegmentation();
Surface *GetContoursAsSurface();
void SetDataStorage(DataStorage::Pointer ds);
/**
* Sets the current list of contourpoints which is used for the surface interpolation
* @param segmentation The current selected segmentation
* \deprecatedSince{2014_03}
*/
DEPRECATED(void SetCurrentSegmentationInterpolationList(mitk::Image::Pointer segmentation));
/**
* Sets the current list of contourpoints which is used for the surface interpolation
* @param segmentation The current selected segmentation
*/
void SetCurrentInterpolationSession(mitk::Image::Pointer currentSegmentationImage);
/**
* Removes the segmentation and all its contours from the list
* @param segmentation The segmentation to be removed
* \deprecatedSince{2014_03}
*/
DEPRECATED(void RemoveSegmentationFromContourList(mitk::Image *segmentation));
/**
* @brief Remove interpolation session
* @param segmentationImage the session to be removed
*/
void RemoveInterpolationSession(mitk::Image::Pointer segmentationImage);
/**
* Replaces the current interpolation session with a new one. All contours form the old
* session will be applied to the new session. This only works if the two images have the
* geometry
* @param oldSession the session which should be replaced
* @param newSession the new session which replaces the old one
* @return true it the the replacement was successful, false if not (e.g. the image's geometry differs)
*/
bool ReplaceInterpolationSession(mitk::Image::Pointer oldSession, mitk::Image::Pointer newSession);
/**
* @brief Removes all sessions
*/
void RemoveAllInterpolationSessions();
/**
* @brief Reinitializes the interpolation using the provided contour data
* @param contours a mitk::Surface which contains the contours as polys in the vtkPolyData
*/
void ReinitializeInterpolation(mitk::Surface::Pointer contours);
mitk::Image *GetImage();
/**
* Estimates the memory which is needed to build up the equationsystem for the interpolation.
* \returns The percentage of the real memory which will be used by the interpolation
*/
double EstimatePortionOfNeededMemory();
unsigned int GetNumberOfInterpolationSessions();
protected:
SurfaceInterpolationController();
~SurfaceInterpolationController() override;
template <typename TPixel, unsigned int VImageDimension>
void GetImageBase(itk::Image<TPixel, VImageDimension> *input, itk::ImageBase<3>::Pointer &result);
private:
void ReinitializeInterpolation();
void OnSegmentationDeleted(const itk::Object *caller, const itk::EventObject &event);
void AddToInterpolationPipeline(ContourPositionInformation contourInfo);
ReduceContourSetFilter::Pointer m_ReduceFilter;
ComputeContourSetNormalsFilter::Pointer m_NormalsFilter;
CreateDistanceImageFromSurfaceFilter::Pointer m_InterpolateSurfaceFilter;
Surface::Pointer m_Contours;
double m_DistanceImageSpacing;
vtkSmartPointer<vtkPolyData> m_PolyData;
mitk::DataStorage::Pointer m_DataStorage;
ContourListMap m_ListOfInterpolationSessions;
mitk::Surface::Pointer m_InterpolationResult;
unsigned int m_CurrentNumberOfReducedContours;
mitk::Image *m_SelectedSegmentation;
std::map<mitk::Image *, unsigned long> m_SegmentationObserverTags;
unsigned int m_CurrentTimeStep;
};
}
#endif
diff --git a/Modules/ToFHardware/Kinect/mitkKinectController.h b/Modules/ToFHardware/Kinect/mitkKinectController.h
index d20320eaa5..81b1db888c 100644
--- a/Modules/ToFHardware/Kinect/mitkKinectController.h
+++ b/Modules/ToFHardware/Kinect/mitkKinectController.h
@@ -1,90 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkKinectController_h
#define __mitkKinectController_h
#include <MitkKinectExports.h>
#include "mitkCommon.h"
#include "mitkToFConfig.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Interface to the Kinect camera
*
*
* @ingroup ToFHardware
*/
class MITKKINECT_EXPORT KinectController : public itk::Object
{
public:
mitkClassMacroItkParent( KinectController , itk::Object );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
unsigned int GetCaptureWidth() const;
unsigned int GetCaptureHeight() const;
bool GetUseIR() const;
void SetUseIR(bool useIR);
/*!
\brief opens a connection to the Kinect camera.
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual bool OpenCameraConnection();
/*!
\brief closes the connection to the camera
*/
virtual bool CloseCameraConnection();
/*!
\brief updates the camera. The update function of the hardware interface is called only when new data is available
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual bool UpdateCamera();
/*!
\brief acquire new distance data from the Kinect camera
\param distances pointer to memory location where distances should be stored
*/
void GetDistances(float* distances);
void GetAmplitudes(float* amplitudes);
void GetIntensities(float* intensities);
/*!
\brief acquire new rgb data from the Kinect camera
\param rgb pointer to memory location where rgb information should be stored
*/
void GetRgb(unsigned char* rgb);
/*!
\brief convenience method for faster access to distance and rgb data
\param distances pointer to memory location where distances should be stored
\param rgb pointer to memory location where rgb information should be stored
*/
void GetAllData(float* distances, float* amplitudes, unsigned char* rgb);
protected:
KinectController();
~KinectController();
private:
class KinectControllerPrivate;
KinectControllerPrivate *d;
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/Kinect/mitkKinectDevice.h b/Modules/ToFHardware/Kinect/mitkKinectDevice.h
index 5e223eed8a..1bf4c113ff 100644
--- a/Modules/ToFHardware/Kinect/mitkKinectDevice.h
+++ b/Modules/ToFHardware/Kinect/mitkKinectDevice.h
@@ -1,144 +1,145 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkKinectDevice_h
#define __mitkKinectDevice_h
#include <MitkKinectExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkKinectController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkMultiThreader.h"
#include "itkFastMutexLock.h"
namespace mitk
{
/**
* @brief Interface for all representations of Kinect devices.
* KinectDevice internally holds an instance of KinectController and starts a thread
* that continuously grabs images from the controller. A buffer structure buffers the last acquired images
* to provide the image data loss-less.
*
* \throws mitkException In case of no connection, an exception is thrown!
*
* @ingroup ToFHardware
*/
class MITKKINECT_EXPORT KinectDevice : public ToFCameraDevice
{
public:
mitkClassMacro( KinectDevice , ToFCameraDevice );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/*!
\brief opens a connection to the ToF camera
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual bool OnConnectCamera();
/*!
\brief closes the connection to the camera
*/
virtual bool DisconnectCamera();
/*!
\brief starts the continuous updating of the camera.
A separate thread updates the source data, the main thread processes the source data and creates images and coordinates
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual void StartCamera();
/*!
\brief stops the continuous updating of the camera
*/
virtual void StopCamera();
/*!
\brief updates the camera for image acquisition
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual void UpdateCamera();
/*!
\brief returns whether the camera is currently active or not
*/
virtual bool IsCameraActive();
/*!
\brief gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel. Caution! The user is responsible for allocating and deleting the images.
These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value
\param imageSequence the actually captured image sequence number
\param amplitudeArray contains the returned amplitude data as an array.
*/
virtual void GetAmplitudes(float* amplitudeArray, int& imageSequence);
/*!
\brief gets the intensity data from the ToF camera as a greyscale image. Caution! The user is responsible for allocating and deleting the images.
\param intensityArray contains the returned intensities data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetIntensities(float* intensityArray, int& imageSequence);
/*!
\brief gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distances data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetDistances(float* distanceArray, int& imageSequence);
/*!
\brief gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distance data as an array.
\param amplitudeArray contains the returned amplitude data as an array.
\param capturedImageSequence the actually captured image sequence number.
*/
virtual void GetAllImages(float* distanceArray, float* amplitudeArray, float* intensityArray, char* sourceDataArray,
int requiredImageSequence, int& capturedImageSequence, unsigned char* rgbDataArray=nullptr);
/*!
\brief returns the corresponding camera controller
*/
KinectController::Pointer GetController();
/*!
\brief set a BaseProperty
*/
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
/*!
\brief returns the width of the RGB image
*/
int GetRGBCaptureWidth();
/*!
\brief returns the height of the RGB image
*/
int GetRGBCaptureHeight();
protected:
KinectDevice();
~KinectDevice();
/*!
\brief Thread method continuously acquiring images from the ToF hardware
*/
static ITK_THREAD_RETURN_TYPE Acquire(void* pInfoStruct);
/*!
\brief moves the position pointer m_CurrentPos to the next position in the buffer if that's not the next free position to prevent reading from an empty buffer
*/
void GetNextPos();
KinectController::Pointer m_Controller; ///< corresponding CameraController
float** m_DistanceDataBuffer; ///< buffer holding the last distance images
float** m_AmplitudeDataBuffer; ///< buffer holding the last infra-red (IR) images
unsigned char** m_RGBDataBuffer; ///< buffer holding the last RGB image
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/KinectV2/mitkKinectV2Controller.h b/Modules/ToFHardware/KinectV2/mitkKinectV2Controller.h
index a6288573ad..c958676176 100644
--- a/Modules/ToFHardware/KinectV2/mitkKinectV2Controller.h
+++ b/Modules/ToFHardware/KinectV2/mitkKinectV2Controller.h
@@ -1,103 +1,104 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkKinectV2Controller_h
#define __mitkKinectV2Controller_h
#include <MitkKinectV2Exports.h>
#include <mitkCommon.h>
#include "mitkToFConfig.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <vtkSmartPointer.h>
#include <vtkPolyData.h>
namespace mitk
{
/**
* @brief Interface to the Kinect 2 camera. Currently, the Microsoft SDK is used.
*
* @ingroup ToFHardware
*/
class MITKKINECTV2_EXPORT KinectV2Controller : public itk::Object
{
public:
mitkClassMacroItkParent( KinectV2Controller , itk::Object );
- itkFactorylessNewMacro(Self)
+ itkFactorylessNewMacro(Self);
+
itkCloneMacro(Self)
int GetRGBCaptureWidth() const;
int GetRGBCaptureHeight() const;
int GetDepthCaptureWidth() const;
int GetDepthCaptureHeight() const;
/**
\brief Setup MultiFrameReader of Kinect V2.
* This reader can acquire different types of data. Here it is used
* to acquire depth, RGB and infrared images.
*/
bool InitializeMultiFrameReader();
/*!
\brief opens a connection to the Kinect V2 camera.
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual bool OpenCameraConnection();
/*!
\brief closes the connection to the camera
*/
virtual bool CloseCameraConnection();
/*!
\brief updates the camera. The update function of the hardware interface is called only when new data is available
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual bool UpdateCamera();
/*!
\brief acquire new distance data from the Kinect camera
\param distances pointer to memory location where distances should be stored
*/
void GetDistances(float* distances);
void GetAmplitudes(float* amplitudes);
void GetIntensities(float* intensities);
vtkSmartPointer<vtkPolyData> GetVtkPolyData();
void SetGenerateTriangularMesh(bool flag);
void SetTriangulationThreshold(double triangulationThreshold);
/*!
\brief acquire new rgb data from the Kinect camera
\param rgb pointer to memory location where rgb information should be stored
*/
void GetRgb(unsigned char* rgb);
/*!
\brief convenience method for faster access to distance and rgb data
\param distances pointer to memory location where distances should be stored
\param rgb pointer to memory location where rgb information should be stored
*/
void GetAllData(float* distances, float* amplitudes, unsigned char* rgb);
protected:
KinectV2Controller();
~KinectV2Controller();
private:
class KinectV2ControllerPrivate;
KinectV2ControllerPrivate *d;
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/KinectV2/mitkKinectV2Device.h b/Modules/ToFHardware/KinectV2/mitkKinectV2Device.h
index 893edbfd3b..5e32555080 100644
--- a/Modules/ToFHardware/KinectV2/mitkKinectV2Device.h
+++ b/Modules/ToFHardware/KinectV2/mitkKinectV2Device.h
@@ -1,153 +1,153 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkKinectV2Device_h
#define __mitkKinectV2Device_h
#include <mitkCommon.h>
#include <MitkKinectV2Exports.h>
#include "mitkToFCameraDevice.h"
#include "mitkKinectV2Controller.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <itkMultiThreader.h>
#include <itkFastMutexLock.h>
#include <vtkSmartPointer.h>
#include <vtkPolyData.h>
namespace mitk
{
/**
* @brief Interface for all representations of Microsoft Kinect V2 devices.
* Kinect2Device internally holds an instance of Kinect2Controller and starts a thread
* that continuously grabs images from the controller. A buffer structure buffers the last acquired images
* to provide the image data loss-less.
*
* \throws mitkException In case of no connection, an exception is thrown!
*
* @ingroup ToFHardware
*/
class MITKKINECTV2_EXPORT KinectV2Device : public ToFCameraDevice
{
public:
mitkClassMacro( KinectV2Device , ToFCameraDevice );
- itkFactorylessNewMacro(Self)
+ itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
/** Prints the framerate to the console every 100 frames.
* Mainly for debugging, deactivated by default.
* Refers to a static variable, means it is acivated/deactivated
* for all instances.
*/
itkSetMacro(PrintFrameRate, bool);
/*!
\brief opens a connection to the ToF camera
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual bool OnConnectCamera();
/*!
\brief closes the connection to the camera
*/
virtual bool DisconnectCamera();
/*!
\brief starts the continuous updating of the camera.
A separate thread updates the source data, the main thread processes the source data and creates images and coordinates
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual void StartCamera();
/*!
\brief stops the continuous updating of the camera
*/
virtual void StopCamera();
/*!
\brief updates the camera for image acquisition
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual void UpdateCamera();
/*!
\brief returns whether the camera is currently active or not
*/
virtual bool IsCameraActive();
/*!
\brief gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel. Caution! The user is responsible for allocating and deleting the images.
These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value
\param imageSequence the actually captured image sequence number
\param amplitudeArray contains the returned amplitude data as an array.
*/
virtual void GetAmplitudes(float* amplitudeArray, int& imageSequence);
/*!
\brief Does nothing for Kinect V2 as there is no intensity data provided by the device.
*
* The method is an empty implementation, because the interface (ToFCameraDevice) requires it.
*/
virtual void GetIntensities(float* intensityArray, int& imageSequence);
/*!
\brief gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distances data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetDistances(float* distanceArray, int& imageSequence);
/*!
\brief gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray Contains the distance data as an array.
\param amplitudeArray Contains the infrared image.
\param intensityArray Does nothing for Kinect V2.
\param sourceDataArray Does nothing for Kinect V2.
\param requiredImageSequence The required image sequence number.
\param capturedImageSequence Does nothing for Kinect V2.
*/
virtual void GetAllImages(float* distanceArray, float* amplitudeArray, float* intensityArray, char* sourceDataArray,
int requiredImageSequence, int& capturedImageSequence, unsigned char* rgbDataArray=nullptr);
/*!
\brief returns the corresponding camera controller
*/
KinectV2Controller::Pointer GetController();
/*!
\brief returns the width of the RGB image
*/
int GetRGBCaptureWidth();
/*!
\brief returns the height of the RGB image
*/
int GetRGBCaptureHeight();
protected:
KinectV2Device();
~KinectV2Device();
/*!
\brief Thread method continuously acquiring images from the ToF hardware
*/
static ITK_THREAD_RETURN_TYPE Acquire(void* pInfoStruct);
static bool m_PrintFrameRate; ///< prints the framerate to the console every 100 frames, deactivated by default
KinectV2Controller::Pointer m_Controller; ///< corresponding CameraController
float** m_DistanceDataBuffer; ///< buffer holding the last distance images
float** m_AmplitudeDataBuffer; ///< buffer holding the last amplitude images
unsigned char** m_RGBDataBuffer; ///< buffer holding the last RGB image
size_t m_DepthBufferSize; ///< Size of depth buffer (i.e. memory size of depth and infrared image)
size_t m_RGBBufferSize; ///< Size of RGB buffer (i.e. memory size of RGB image)
vtkSmartPointer<vtkPolyData> m_PolyData; ///< Surface generated via the Kinect V2 SDK with default/unknown calibration.
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESADevice.h b/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESADevice.h
index 0bcff48050..4aacb79086 100644
--- a/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESADevice.h
+++ b/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESADevice.h
@@ -1,136 +1,137 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFCameraMESADevice_h
#define __mitkToFCameraMESADevice_h
#include <MitkMESASR4000ModuleExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraMESAController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkMultiThreader.h"
#include "itkFastMutexLock.h"
namespace mitk
{
/**
* @brief Interface for all representations of MESA ToF devices.
* ToFCameraMESADevice internally holds an instance of ToFCameraMESAController and starts a thread
* that continuously grabs images from the controller. A buffer structure buffers the last acquired images
* to provide the image data loss-less.
*
* @ingroup ToFHardware
*/
class MITKMESASR4000_EXPORT ToFCameraMESADevice : public ToFCameraDevice
{
public:
mitkClassMacro( ToFCameraMESADevice , ToFCameraDevice );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/*!
\brief opens a connection to the ToF camera
*/
virtual bool OnConnectCamera();
/*!
\brief closes the connection to the camera
*/
virtual bool DisconnectCamera();
/*!
\brief starts the continuous updating of the camera.
A separate thread updates the source data, the main thread processes the source data and creates images and coordinates
*/
virtual void StartCamera();
/*!
\brief stops the continuous updating of the camera
*/
virtual void StopCamera();
/*!
\brief updates the camera for image acquisition
*/
virtual void UpdateCamera();
/*!
\brief returns whether the camera is currently active or not
*/
virtual bool IsCameraActive();
/*!
\brief gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel. Caution! The user is responsible for allocating and deleting the images.
These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value
\param imageSequence the actually captured image sequence number
\param amplitudeArray contains the returned amplitude data as an array.
*/
virtual void GetAmplitudes(float* amplitudeArray, int& imageSequence);
/*!
\brief gets the intensity data from the ToF camera as a greyscale image. Caution! The user is responsible for allocating and deleting the images.
\param intensityArray contains the returned intensities data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetIntensities(float* intensityArray, int& imageSequence);
/*!
\brief gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distances data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetDistances(float* distanceArray, int& imageSequence);
/*!
\brief gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distance data as an array.
\param amplitudeArray contains the returned amplitude data as an array.
\param intensityArray contains the returned intensity data as an array.
\param sourceDataArray contains the complete source data from the camera device.
\param requiredImageSequence the required image sequence number
\param capturedImageSequence the actually captured image sequence number
*/
virtual void GetAllImages(float* distanceArray, float* amplitudeArray, float* intensityArray, char* sourceDataArray,
int requiredImageSequence, int& capturedImageSequence, unsigned char* rgbDataArray=nullptr);
/*!
\brief returns the corresponding camera controller
*/
ToFCameraMESAController::Pointer GetController();
/*!
\brief set a BaseProperty
*/
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
protected:
ToFCameraMESADevice();
~ToFCameraMESADevice();
/*!
\brief Thread method continuously acquiring images from the ToF hardware
*/
static ITK_THREAD_RETURN_TYPE Acquire(void* pInfoStruct);
/*!
\brief moves the position pointer m_CurrentPos to the next position in the buffer if that's not the next free position to prevent reading from an empty buffer
*/
void GetNextPos();
ToFCameraMESAController::Pointer m_Controller; ///< corresponding CameraController
float** m_DistanceDataBuffer; ///< buffer holding the last distance images
float** m_AmplitudeDataBuffer; ///< buffer holding the last amplitude images
float** m_IntensityDataBuffer; ///< buffer holding the last intensity images
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000Controller.h b/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000Controller.h
index 84cf8836cf..4567e1db93 100644
--- a/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000Controller.h
+++ b/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000Controller.h
@@ -1,109 +1,110 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFCameraMESASR4000Controller_h
#define __mitkToFCameraMESASR4000Controller_h
#include <MitkMESASR4000ModuleExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraMESAController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Interface to the Time-of-Flight (ToF) camera MESA Swissranger 4000
*
*
* @ingroup ToFHardware
*/
class MITKMESASR4000_EXPORT ToFCameraMESASR4000Controller : public mitk::ToFCameraMESAController
{
public:
mitkClassMacro( ToFCameraMESASR4000Controller , mitk::ToFCameraMESAController );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/*!
\brief opens a connection to the ToF camera and initializes the hardware specific members
\return returns whether the connection was successful (true) or not (false)
*/
virtual bool OpenCameraConnection();
/*!
\brief Returns the currently set modulation frequency.
\return modulation frequency
*/
virtual int GetModulationFrequency();
/*!
\brief Sets the modulation frequency of the ToF device.
The method automatically calculates a valid value from the given frequency to
make sure that only valid frequencies are used.
\param modulationFrequency modulation frequency
\return frequency set after validation step
*/
virtual int SetModulationFrequency(unsigned int modulationFrequency);
/*!
\brief Returns the currently set integration time.
\return integration time
*/
virtual int GetIntegrationTime();
/*!
\brief Sets the integration time of the ToF device.
The method automatically calculates a valid value from the given integration time to
make sure that only valid times are used.
\param integrationTime integration time
\return integration time set after validation step
*/
virtual int SetIntegrationTime(unsigned int integrationTime);
/*!
\brief Sets the acquire mode of the MESA SR4000 camera.
The method sets some parameter supported by the MESA SR4000, see MESA API for more details.
\param fpn turns on fix pattern noise correction this should always be enabled for good distance measurement
*/
virtual void SetFPN( bool fpn );
/*!
\brief Sets the acquire mode of the MESA SR4000 camera.
The method sets some parameter supported by the MESA SR4000, see MESA API for more details.
\param convGray Converts the amplitude image by multiplying by the square of the distance, resulting in image more like a conventional camera
*/
virtual void SetConvGray( bool convGray );
/*!
\brief Sets the acquire mode of the MESA SR4000 camera.
The method sets some parameter supported by the MESA SR4000, see MESA API for more details.
\param median turns on a 3x3 median filter
*/
virtual void SetMedian( bool median );
/*!
\brief Sets the acquire mode of the MESA SR4000 camera.
The method sets some parameter supported by the MESA SR4000, see MESA API for more details.
\param anf Turns on the 5x5 hardware adaptive neighborhood filter
*/
virtual void SetANF( bool anf );
protected:
ToFCameraMESASR4000Controller();
~ToFCameraMESASR4000Controller();
private:
float *m_Lambda;
float *m_Frequency;
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000Device.h b/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000Device.h
index 4eb57a90fc..d3ccbbe152 100644
--- a/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000Device.h
+++ b/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000Device.h
@@ -1,67 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFCameraMESASR4000Device_h
#define __mitkToFCameraMESASR4000Device_h
#include <MitkMESASR4000ModuleExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraMESADevice.h"
#include "mitkToFCameraMESASR4000Controller.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkMultiThreader.h"
#include "itkFastMutexLock.h"
namespace mitk
{
/**
* @brief Device class representing a MESA CamBoard camera
*
* @ingroup ToFHardware
*/
class MITKMESASR4000_EXPORT ToFCameraMESASR4000Device : public ToFCameraMESADevice
{
public:
mitkClassMacro( ToFCameraMESASR4000Device , ToFCameraMESADevice );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/*!
\brief set a BaseProperty
*/
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
/*!
\brief Setting the region of interest, the camera is configured to only output a certain area of the image.
\param leftUpperCornerX x value of left upper corner of region
\param leftUpperCornerX y value of left upper corner of region
\param width width of region
\param height height of region
*/
void SetRegionOfInterest( unsigned int leftUpperCornerX, unsigned int leftUpperCornerY, unsigned int width, unsigned int height );
protected:
ToFCameraMESASR4000Device();
~ToFCameraMESASR4000Device();
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkThreadedToFRawDataReconstruction.h b/Modules/ToFHardware/PMD/mitkThreadedToFRawDataReconstruction.h
index a0aa1d6cf6..5c51a16711 100644
--- a/Modules/ToFHardware/PMD/mitkThreadedToFRawDataReconstruction.h
+++ b/Modules/ToFHardware/PMD/mitkThreadedToFRawDataReconstruction.h
@@ -1,116 +1,115 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkThreadedToFRawDataReconstruction_h
#define __mitkThreadedToFRawDataReconstruction_h
// mitk includes
#include "mitkImageSource.h"
#include <MitkPMDExports.h>
// itk includes
#include <itkBarrier.h>
#include <itkFastMutexLock.h>
// vtk includes
#include "vtkShortArray.h"
namespace mitk
{
struct ThreadDataStruct
{
std::vector<std::vector<short> > m_InputData;
std::vector<float*> m_OutputData;
unsigned int m_DataSize;
unsigned int m_LineWidth;
unsigned int m_FrameHeight;
unsigned int m_ModulationFrequency;
itk::Barrier::Pointer m_Barrier; ///< barrier to synchronize ends of threads
itk::FastMutexLock::Pointer m_ImageDataMutex; ///< mutex for coordinated access to image data
itk::FastMutexLock::Pointer m_ThreadDataMutex; ///< mutex to control access to images
};
class MITKPMD_EXPORT ThreadedToFRawDataReconstruction : public itk::ProcessObject
{
public:
mitkClassMacroItkParent( ThreadedToFRawDataReconstruction , itk::ProcessObject );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
-
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
itkGetMacro(Init, bool);
void SetChannelData(vtkShortArray* sourceData);
void Initialize(int width, int height, int modulationFrequency, int sourceDataSize );
void GetDistances(float* dist);
void GetAmplitudes(float* ampl);
void GetIntensities(float* inten);
void GetAllData(float* dist, float* ampl, float* inten);
void Update();
protected:
/*!
\brief standard constructor
*/
ThreadedToFRawDataReconstruction();
/*!
\brief standard destructor
*/
~ThreadedToFRawDataReconstruction();
/*!
\brief method generating the outputs of this filter. Called in the updated process of the pipeline.
This method generates the two outputs of the ToFImageSource: The distance and the intensity image
*/
virtual void GenerateData();
/*!
\brief method configures the camera output and prepares the thread data struct for threaded data
generation
*/
virtual void BeforeThreadedGenerateData();
/*!
\brief threader callback function for multi threaded data generation
*/
static ITK_THREAD_RETURN_TYPE ThreadedGenerateDataCallbackFunction(void* data);
/*!
\brief Method to reduce image size from original controller size to output size (200x200px)
and rotate the image. This is needed due to defect pixel rows at the rim of the chip
*/
void ResizeOutputImage(float* in, float* out);
// member variables
int m_StackSize; ///<
int m_Width;
int m_Height;
int m_ImageSize;
int m_SourceDataSize;
vtkShortArray* m_SourceData;
bool m_Init;
float* m_CISDist; ///< holds the distance information from for one distance image slice
float* m_CISAmpl; ///< holds the amplitude information from for one amplitude image slice
float* m_CISInten; ///< holds the intensity information from for one intensity image slice
float* m_ThreadedCISDist;
float* m_ThreadedCISAmpl;
float* m_ThreadedCISInten;
itk::MultiThreader::Pointer m_Threader;
ThreadDataStruct* m_ThreadData;
};
} //end mitk namespace
#endif // __mitkThreadedToFRawDataReconstruction_h
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardController.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardController.h
index 69d5eb2d77..ae7a77f0c1 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardController.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardController.h
@@ -1,94 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFCameraPMDCamBoardController_h
#define __mitkToFCameraPMDCamBoardController_h
#include "MitkPMDExports.h"
#include "mitkCommon.h"
#include "mitkToFCameraPMDController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Interface to the Time-of-Flight (ToF) camera PMD CamBoard
*
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDCamBoardController : public ToFCameraPMDController
{
public:
mitkClassMacro( ToFCameraPMDCamBoardController , ToFCameraPMDController );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/*!
\brief opens a connection to the ToF camera and initializes the hardware specific members
\return returns whether the connection was successful (true) or not (false)
*/
virtual bool OpenCameraConnection();
/*!
\brief sets an additional distance offset which will be added to all distance values.
\param offset offset in m
*/
bool SetDistanceOffset( float offset );
/*!
\brief returns the currently applied distance offset in m
\param offset offset in m
*/
float GetDistanceOffset();
/*!
\brief Setting the region of interest, the camera is configured to only output a certain area of the image.
\param leftUpperCornerX x value of left upper corner of region
\param leftUpperCornerX y value of left upper corner of region
\param width width of region
\param height height of region
*/
bool SetRegionOfInterest( unsigned int leftUpperCornerX, unsigned int leftUpperCornerY, unsigned int width, unsigned int height );
/*!
\brief Setting the region of interest, the camera is configured to only output a certain area of the image.
\param roi region of interest. roi[0]: x value of left upper corner, roi[1]: y value of left upper corner, roi[2]: width, roi[3]: height
*/
bool SetRegionOfInterest( unsigned int roi[4] );
/*!
\brief returns the region of interest currently set
\return currently set region of interest.
*/
unsigned int* GetRegionOfInterest();
/*!
\brief Sets the field of view of the camera lens.
\param fov field of view in degrees. The default value is 40 degrees.
*/
bool SetFieldOfView( float fov );
protected:
ToFCameraPMDCamBoardController();
~ToFCameraPMDCamBoardController();
/*
\brief Transform the output of the camera, i.e. cut invalid pixels, and rotate 90 degrees
counterclockwise
\param input data array of original size (207x204)
\param rotated output data array of reduced size (200x200)
*/
virtual void TransformCameraOutput(float* in, float* out, bool isDist);
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardDevice.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardDevice.h
index f162feed41..1b2f787d5d 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardDevice.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardDevice.h
@@ -1,68 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFCameraPMDCamBoardDevice_h
#define __mitkToFCameraPMDCamBoardDevice_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraPMDDevice.h"
#include "mitkToFCameraPMDCamBoardController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkMultiThreader.h"
#include "itkFastMutexLock.h"
namespace mitk
{
/**
* @brief Device class representing a PMD CamBoard camera
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDCamBoardDevice : public ToFCameraPMDDevice
{
public:
mitkClassMacro( ToFCameraPMDCamBoardDevice , ToFCameraPMDDevice );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/*!
\brief set a BaseProperty
*/
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
/*!
\brief Setting the region of interest, the camera is configured to only output a certain area of the image.
\param leftUpperCornerX x value of left upper corner of region
\param leftUpperCornerX y value of left upper corner of region
\param width width of region
\param height height of region
*/
void SetRegionOfInterest( unsigned int leftUpperCornerX, unsigned int leftUpperCornerY, unsigned int width, unsigned int height );
//void GetAllImages(float* distanceArray, float* amplitudeArray, float* intensityArray, char* sourceDataArray, int requiredImageSequence, int& capturedImageSequence, unsigned char* rgbDataArray);
protected:
ToFCameraPMDCamBoardDevice();
~ToFCameraPMDCamBoardDevice();
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeController.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeController.h
index 1167a8930b..18e73a8fb7 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeController.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeController.h
@@ -1,125 +1,126 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFCameraPMDCamCubeController_h
#define __mitkToFCameraPMDCamCubeController_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraPMDController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Interface to the Time-of-Flight (ToF) camera PMD CamCube
*
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDCamCubeController : public ToFCameraPMDController
{
public:
mitkClassMacro( ToFCameraPMDCamCubeController , ToFCameraPMDController );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/*!
\brief opens a connection to the ToF camera and initializes the hardware specific members
\return returns whether the connection was successful (true) or not (false)
*/
virtual bool OpenCameraConnection();
/*!
\brief sets an additional distance offset which will be added to all distance values.
\param offset offset in m
\return returns whether set operation was successful (true) or not (false)
*/
bool SetDistanceOffset( float offset );
/*!
\brief returns the currently applied distance offset in m
\param offset offset in m
*/
float GetDistanceOffset();
/*!
\brief Setting the region of interest, the camera is configured to only output a certain area of the image.
\param leftUpperCornerX x value of left upper corner of region
\param leftUpperCornerX y value of left upper corner of region
\param width width of region
\param height height of region
\return returns whether set operation was successful (true) or not (false)
*/
bool SetRegionOfInterest( unsigned int leftUpperCornerX, unsigned int leftUpperCornerY, unsigned int width, unsigned int height );
/*!
\brief Setting the region of interest, the camera is configured to only output a certain area of the image.
\param roi region of interest. roi[0]: x value of left upper corner, roi[1]: y value of left upper corner, roi[2]: width, roi[3]: height
\return returns whether set operation was successful (true) or not (false)
*/
bool SetRegionOfInterest( unsigned int roi[4] );
/*!
\brief returns the region of interest currently set
\return currently set region of interest.
*/
unsigned int* GetRegionOfInterest();
/*!
\brief sets the exposure mode of the CamCube
\param mode exposure mode. 0: normal mode (one exposure), 1: Suppression of motion blur (SMB), minimizes the time needed to capture
a distance image from the camera which results in a reduced amount of motion artifact but may lead to increased noise.
\return returns whether set operation was successful (true) or not (false)
*/
bool SetExposureMode( int mode );
/*!
\brief Sets the field of view of the camera lens.
\param fov field of view in degrees. The default value is 40 degrees.
\return returns whether set operation was successful (true) or not (false)
*/
bool SetFieldOfView( float fov );
/*!
\brief Enable/Disable PMD fixed pattern noise (FPN) calibration
\param on enabled (true), disabled (false)
\return returns whether set operation was successful (true) or not (false)
*/
bool SetFPNCalibration( bool on );
/*!
\brief Enable/Disable PMD fixed pattern phase noise (FPPN) calibration
\param on enabled (true), disabled (false)
\return returns whether set operation was successful (true) or not (false)
*/
bool SetFPPNCalibration( bool on );
/*!
\brief Enable/Disable PMD linearity calibration
\param on enabled (true), disabled (false)
\return returns whether set operation was successful (true) or not (false)
*/
bool SetLinearityCalibration( bool on );
/*!
\brief Enable/Disable PMD lens calibration
\param on enabled (true), disabled (false)
\return returns whether set operation was successful (true) or not (false)
*/
bool SetLensCalibration( bool on );
protected:
virtual void TransformCameraOutput(float* in, float* out, bool isDist);
ToFCameraPMDCamCubeController();
~ToFCameraPMDCamCubeController();
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeDevice.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeDevice.h
index 674431b86a..83139f69d8 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeDevice.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeDevice.h
@@ -1,56 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFCameraPMDCamCubeDevice_h
#define __mitkToFCameraPMDCamCubeDevice_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraPMDDevice.h"
#include "mitkToFCameraPMDCamCubeController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkMultiThreader.h"
#include "itkFastMutexLock.h"
namespace mitk
{
/**
* @brief Device class representing a PMD CamCube camera
*
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDCamCubeDevice : public ToFCameraPMDDevice
{
public:
mitkClassMacro( ToFCameraPMDCamCubeDevice , ToFCameraPMDDevice );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
protected:
ToFCameraPMDCamCubeDevice();
~ToFCameraPMDCamCubeDevice();
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDDevice.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDDevice.h
index a91a7326e5..c13238e061 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDDevice.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDDevice.h
@@ -1,139 +1,140 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFCameraPMDDevice_h
#define __mitkToFCameraPMDDevice_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraPMDController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkMultiThreader.h"
#include "itkFastMutexLock.h"
namespace mitk
{
/**
* @brief Interface for all representations of PMD ToF devices.
* ToFCameraPMDDevice internally holds an instance of ToFCameraPMDController and starts a thread
* that continuously grabs images from the controller. A buffer structure buffers the last acquired images
* to provide the image data loss-less.
*
*\throws mitkException In case of no connection, an exception is thrown!
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDDevice : public ToFCameraDevice
{
public:
mitkClassMacro( ToFCameraPMDDevice , ToFCameraDevice );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/*!
\brief opens a connection to the ToF camera
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual bool OnConnectCamera();
/*!
\brief closes the connection to the camera
*/
virtual bool DisconnectCamera();
/*!
\brief starts the continuous updating of the camera.
A separate thread updates the source data, the main thread processes the source data and creates images and coordinates
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual void StartCamera();
/*!
\brief updated the controller hold by this device
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual void UpdateCamera();
/*!
\brief gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel. Caution! The user is responsible for allocating and deleting the images.
These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value
\param imageSequence the actually captured image sequence number
\param amplitudeArray contains the returned amplitude data as an array.
*/
virtual void GetAmplitudes(float* amplitudeArray, int& imageSequence);
/*!
\brief gets the intensity data from the ToF camera as a greyscale image. Caution! The user is responsible for allocating and deleting the images.
\param intensityArray contains the returned intensities data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetIntensities(float* intensityArray, int& imageSequence);
/*!
\brief gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distances data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetDistances(float* distanceArray, int& imageSequence);
/*!
\brief gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distance data as an array.
\param amplitudeArray contains the returned amplitude data as an array.
\param intensityArray contains the returned intensity data as an array.
\param sourceDataArray contains the complete source data from the camera device.
\param requiredImageSequence the required image sequence number
\param capturedImageSequence the actually captured image sequence number
*/
virtual void GetAllImages(float* distanceArray, float* amplitudeArray, float* intensityArray, char* sourceDataArray,
int requiredImageSequence, int& capturedImageSequence, unsigned char* rgbDataArray=nullptr);
/*!
\brief returns the corresponding camera controller
*/
ToFCameraPMDController::Pointer GetController();
/*!
\brief set a BaseProperty
*/
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
protected:
ToFCameraPMDDevice();
~ToFCameraPMDDevice();
/*!
\brief method for allocating m_SourceDataArray and m_SourceDataBuffer
*/
virtual void AllocateSourceData();
/*!
\brief method for cleaning up memory allocated for m_SourceDataArray and m_SourceDataBuffer
*/
virtual void CleanUpSourceData();
/*!
\brief Thread method continuously acquiring images from the ToF hardware
*/
static ITK_THREAD_RETURN_TYPE Acquire(void* pInfoStruct);
/*!
\brief moves the position pointer m_CurrentPos to the next position in the buffer if that's not the next free position to prevent reading from an empty buffer
*/
void GetNextPos();
ToFCameraPMDController::Pointer m_Controller; ///< corresponding CameraController
char** m_SourceDataBuffer; ///< buffer holding the last acquired images
char* m_SourceDataArray; ///< array holding the current PMD source data
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDO3Controller.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDO3Controller.h
index aa66e5a3d5..dc90eccff7 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDO3Controller.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDO3Controller.h
@@ -1,60 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFCameraPMDO3Controller_h
#define __mitkToFCameraPMDO3Controller_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraPMDController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Interface to the Time-of-Flight (ToF) camera PMD O3
* Connection is established over Ethernet connection. IP address must be specified.
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDO3Controller : public mitk::ToFCameraPMDController
{
public:
mitkClassMacro( ToFCameraPMDO3Controller , mitk::ToFCameraPMDController );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/*!
\brief opens a connection to the PMD O3 ToF camera
*/
virtual bool OpenCameraConnection();
protected:
ToFCameraPMDO3Controller();
~ToFCameraPMDO3Controller();
/*
\brief method that transforms camera input such that it is ordered correctly.
*/
void TransformCameraOutput(float* in, float* out, bool isDist);
private:
char *m_IPAddress; ///< holds the ip adress the O3 camera is connected to
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDO3Device.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDO3Device.h
index f456ff5038..ab6da894d9 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDO3Device.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDO3Device.h
@@ -1,53 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFCameraPMDO3Device_h
#define __mitkToFCameraPMDO3Device_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraPMDDevice.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkMultiThreader.h"
#include "itkFastMutexLock.h"
namespace mitk
{
/**
* @brief Device class representing a PMD O3 camera
*
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDO3Device : public ToFCameraPMDDevice
{
public:
mitkClassMacro( ToFCameraPMDO3Device , ToFCameraPMDDevice );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
protected:
ToFCameraPMDO3Device();
~ToFCameraPMDO3Device();
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerController.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerController.h
index 69d1e79da9..afb3f57c02 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerController.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerController.h
@@ -1,77 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFCameraPMDPlayerController_h
#define __mitkToFCameraPMDPlayerController_h
#include <MitkPMDExports.h>
#include "mitkToFCameraPMDController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Interface to read ToF data from a PMD file
*
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDPlayerController : public ToFCameraPMDController
{
public:
mitkClassMacro( ToFCameraPMDPlayerController , ToFCameraPMDController );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
itkSetMacro(PMDFileName, std::string);
itkGetMacro(PMDFileName, std::string);
/*!
\brief opens a connection to the ToF camera
*/
bool OpenCameraConnection();
/*!
\brief convenience method setting the modulation frequency in the PMDDataDescription
\param modulationFrequency modulation frequency
\return currently set modulation frequency in PMDDataDescription
*/
int SetModulationFrequency(unsigned int modulationFrequency);
/*!
\brief convenience method setting the integration time in the PMDDataDescription
\param integrationTime integration time
\return currently set integration time in PMDDataDescription
*/
int SetIntegrationTime(unsigned int integrationTime);
protected:
/*
\brief Transform method used for phyical camera devices. For the player no transform is needed.
*/
virtual void TransformCameraOutput(float* in, float* out, bool isDist){};
ToFCameraPMDPlayerController();
~ToFCameraPMDPlayerController();
std::string m_PMDFileName; ///< File name of the pmd data stream
private:
unsigned int m_NumOfFrames; ///< Number of frames
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerDevice.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerDevice.h
index 6a0583fef9..8273683d2b 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerDevice.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerDevice.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFCameraPMDPlayerDevice_h
#define __mitkToFCameraPMDPlayerDevice_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraPMDDevice.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkMultiThreader.h"
#include "itkFastMutexLock.h"
namespace mitk
{
/**
* @brief Device class representing a player for PMD data
*
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDPlayerDevice : public ToFCameraPMDDevice
{
public:
mitkClassMacro( ToFCameraPMDPlayerDevice , ToFCameraPMDDevice );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/*!
\brief set a BaseProperty
*/
virtual void SetProperty(const char* propertyKey, BaseProperty* propertyValue);
protected:
ToFCameraPMDPlayerDevice();
~ToFCameraPMDPlayerDevice();
std::string m_InputFileName; ///< input file name for data stored in an .pmd file
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamBoardDevice.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamBoardDevice.h
index abbb73f682..5cbd98e90a 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamBoardDevice.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamBoardDevice.h
@@ -1,78 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFCameraPMDRawDataCamBoardDevice_h
#define __mitkToFCameraPMDRawDataCamBoardDevice_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraPMDRawDataDevice.h"
namespace mitk
{
/**
* @brief Device class representing a PMD CamBoard camera
*
*
* @ingroup ToFHardwareMBI
*/
class MITKPMD_EXPORT ToFCameraPMDRawDataCamBoardDevice : public ToFCameraPMDRawDataDevice
{
public:
mitkClassMacro( ToFCameraPMDRawDataCamBoardDevice , ToFCameraPMDRawDataDevice );
- itkFactorylessNewMacro(Self)
+ itkFactorylessNewMacro(Self);
+
itkCloneMacro(Self)
/*!
\brief set a BaseProperty
*/
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
/*!
\brief Transforms the sourceData into an array with four tuples holding the channels for
raw data reconstruction.
*/
virtual void GetChannelSourceData(short* sourceData, vtkShortArray* vtkChannelArray );
/*!
\brief Establishes camera connection and sets the class variables
*/
bool ConnectCamera();
/*!
\brief Returns intensity data
*/
void GetIntensities(float* intensityArray, int& imageSequence);
/*!
\brief Returns amplitude data
*/
void GetAmplitudes(float* amplitudeArray, int& imageSequence);
/*!
\brief Returns distance data
*/
void GetDistances(float* distanceArray, int& imageSequence);
/*!
\brief Returns all image data at once.
*/
void GetAllImages(float* distanceArray, float* amplitudeArray, float* intensityArray, char* sourceDataArray, int requiredImageSequence, int& capturedImageSequence, unsigned char* rgbDataArray=nullptr);
protected:
ToFCameraPMDRawDataCamBoardDevice();
~ToFCameraPMDRawDataCamBoardDevice();
private:
/*!
\brief Method performs resizing of the image data and flips it upside down
*/
void ResizeOutputImage(float* in, float* out);
};
} //END mitk namespace
#endif // __mitkToFCameraPMDRawDataCamBoardDevice_h
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamCubeDevice.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamCubeDevice.h
index 30378ef46e..2d54c9a378 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamCubeDevice.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamCubeDevice.h
@@ -1,51 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFCameraPMDRawDataCamCubeDevice_h
#define __mitkToFCameraPMDRawDataCamCubeDevice_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraPMDRawDataDevice.h"
namespace mitk
{
/**
* @brief Device class representing a PMD CamCube camera
*
*
* @ingroup ToFHardwareMBI
*/
class MITKPMD_EXPORT ToFCameraPMDRawDataCamCubeDevice : public ToFCameraPMDRawDataDevice
{
public:
mitkClassMacro( ToFCameraPMDRawDataCamCubeDevice , ToFCameraPMDRawDataDevice );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
virtual void GetChannelSourceData(short* sourceData, vtkShortArray* vtkChannelArray );
protected:
ToFCameraPMDRawDataCamCubeDevice();
~ToFCameraPMDRawDataCamCubeDevice();
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataDevice.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataDevice.h
index b5f2c7dc56..23119703e1 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataDevice.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataDevice.h
@@ -1,166 +1,167 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFCameraPMDRawDataDevice_h
#define __mitkToFCameraPMDRawDataDevice_h
#include <MitkPMDExports.h>
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraPMDController.h"
#include "mitkThreadedToFRawDataReconstruction.h"
namespace mitk
{
/**
* @brief Interface for all representations of PMD ToF devices.
* ToFCameraPMDDevice internally holds an instance of ToFCameraPMDController and starts a thread
* that continuously grabs images from the controller. A buffer structure buffers the last acquired images
* to provide the image data loss-less.
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDRawDataDevice : public ToFCameraDevice
{
public:
mitkClassMacro( ToFCameraPMDRawDataDevice , ToFCameraDevice );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
itkSetMacro(ChannelSize, int);
itkGetMacro(ChannelSize, int);
/*!
\brief opens a connection to the ToF camera
*/
virtual bool OnConnectCamera();
/*!
\brief closes the connection to the camera
*/
virtual bool DisconnectCamera();
/*!
\brief starts the continuous updating of the camera.
A separate thread updates the source data, the main thread processes the source data and creates images and coordinates
*/
virtual void StartCamera();
/*!
\brief stops the continuous updating of the camera
*/
virtual void StopCamera();
/*!
\brief updates the camera for image acquisition
*/
virtual void UpdateCamera();
/*!
\brief returns whether the camera is currently active or not
*/
virtual bool IsCameraActive();
/*!
\brief gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel. Caution! The user is responsible for allocating and deleting the images.
These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value
\param imageSequence the actually captured image sequence number
\param amplitudeArray contains the returned amplitude data as an array.
*/
virtual void GetAmplitudes(float* amplitudeArray, int& imageSequence);
/*!
\brief gets the intensity data from the ToF camera as a greyscale image. Caution! The user is responsible for allocating and deleting the images.
\param intensityArray contains the returned intensities data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetIntensities(float* intensityArray, int& imageSequence);
/*!
\brief gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distances data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetDistances(float* distanceArray, int& imageSequence);
/*!
\brief gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distance data as an array.
\param amplitudeArray contains the returned amplitude data as an array.
\param intensityArray contains the returned intensity data as an array.
\param sourceDataArray contains the complete source data from the camera device.
\param requiredImageSequence the required image sequence number
\param capturedImageSequence the actually captured image sequence number
*/
virtual void GetAllImages(float* distanceArray, float* amplitudeArray, float* intensityArray, char* sourceDataArray,
int requiredImageSequence, int& capturedImageSequence, unsigned char* rgbDataArray=nullptr);
/*!
\brief returns the corresponding camera controller
*/
ToFCameraPMDController::Pointer GetController();
virtual void GetChannelSourceData(short* /*sourceData*/, vtkShortArray* /*vtkChannelArray*/ ){};
/*!
\brief set a BaseProperty
*/
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
protected:
ToFCameraPMDRawDataDevice();
~ToFCameraPMDRawDataDevice();
/*!
\brief method for allocating m_SourceDataArray and m_SourceDataBuffer
*/
virtual void AllocateSourceData();
/*!
\brief method for cleaning up memory allocated for m_SourceDataArray and m_SourceDataBuffer
*/
virtual void CleanUpSourceData();
/*!
\brief method for allocating memory for pixel arrays m_IntensityArray, m_DistanceArray and m_AmplitudeArray
*/
virtual void AllocatePixelArrays();
/*!
\brief method for cleanup memory allocated for pixel arrays m_IntensityArray, m_DistanceArray and m_AmplitudeArray
*/
virtual void CleanupPixelArrays();
/*!
\brief Thread method continuously acquiring images from the ToF hardware
*/
static ITK_THREAD_RETURN_TYPE Acquire(void* pInfoStruct);
/*!
\brief moves the position pointer m_CurrentPos to the next position in the buffer if that's not the next free position to prevent reading from an empty buffer
*/
void GetNextPos();
/*!
\brief gets the image data and flips it according to user needs Caution! The user is responsible for allocating and deleting the data.
\param imageData contains array to the input data.
\param flippedData contains flipped output array - Caution! The user is responsible for allocating and deleting the data. Size should be equal to imageData!
\param xAxis flag is set to flip around x axis (1 - set, 0 - not set).
\param yAxis flag is set to flip around y axis (1 - set, 0 - not set).
\param dimension contains the extend of the z dimension (preset is 1)
*/
void XYAxisFlipImage( float* imageData, float* &flippedData, int xAxis, int yAxis, int dimension = 1 );
//member variables
ToFCameraPMDController::Pointer m_Controller; ///< corresponding CameraController
ThreadedToFRawDataReconstruction::Pointer m_RawDataSource;
char** m_SourceDataBuffer; ///< buffer holding the last acquired images
char* m_SourceDataArray; ///< array holding the current PMD source data
short* m_ShortSourceData; ///< array holding the current PMD raw data
unsigned int m_OriginControllerWidth; ///< holds the original controller width
unsigned int m_OriginControllerHeight; ///< holds the original controller height
private:
int m_ChannelSize; ///< member holds the size of a single raw data channel
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/Testing/CMakeLists.txt b/Modules/ToFHardware/Testing/CMakeLists.txt
index 26dd603442..99276c61d6 100644
--- a/Modules/ToFHardware/Testing/CMakeLists.txt
+++ b/Modules/ToFHardware/Testing/CMakeLists.txt
@@ -1,22 +1,15 @@
MITK_CREATE_MODULE_TESTS()
if(TARGET ${TESTDRIVER})
mitk_use_modules(TARGET ${TESTDRIVER} PACKAGES VTK|vtkTestingRendering)
- #Only enabled for Windows and Mac nightlies.
- #If you want to run this on linux, just enable the flag in the superbuild.
- if(MITK_ENABLE_RENDERING_TESTING)
-
mitkAddCustomModuleTest(mitkPlayerLoadAndRenderDepthDataTest_KinectDepthImage #testname
mitkPlayerLoadAndRenderDepthDataTest #testclassname
Kinect_LiverPhantom_DistanceImage.nrrd #input image
-V ${MITK_DATA_DIR}/ToF-Data/ReferenceScreenshots/Kinect_LiverPhantom_DistanceImage640x480REF.png #reference image
)
mitkAddCustomModuleTest(mitkPlayerLoadAndRenderRGBDataTest_KinectRGBImage mitkPlayerLoadAndRenderRGBDataTest Kinect_LiverPhantom_RGBImage.nrrd -V ${MITK_DATA_DIR}/ToF-Data/ReferenceScreenshots/Kinect_LiverPhantom_RGBImage640x480REF.png)
#rendering tests cannot run in parallel
SET_PROPERTY(TEST mitkPlayerLoadAndRenderDepthDataTest_KinectDepthImage mitkPlayerLoadAndRenderRGBDataTest_KinectRGBImage PROPERTY RUN_SERIAL TRUE)
-
- endif()
endif()
-
diff --git a/Modules/ToFHardware/mitkToFCameraMITKPlayerController.h b/Modules/ToFHardware/mitkToFCameraMITKPlayerController.h
index 7936bbb7ea..49dbb49184 100644
--- a/Modules/ToFHardware/mitkToFCameraMITKPlayerController.h
+++ b/Modules/ToFHardware/mitkToFCameraMITKPlayerController.h
@@ -1,141 +1,142 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFCameraMITKPlayerController_h
#define __mitkToFCameraMITKPlayerController_h
#include <MitkToFHardwareExports.h>
#include "mitkCommon.h"
#include "mitkFileReader.h"
#include "mitkImage.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Controller for playing ToF images saved in MITK (.pic) format
*
* @ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFCameraMITKPlayerController : public itk::Object
{
public:
mitkClassMacroItkParent( ToFCameraMITKPlayerController , itk::Object );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/*!
\brief opens a connection to the ToF camera
\return Returns 'true' if connection could be established and 'false' otherwise
*/
virtual bool OpenCameraConnection();
/*!
\brief closes the connection to the camera
\return Returns 'true' if connection could be closed (i.e. only if a connection was established before) and 'false' otherwise
*/
virtual bool CloseCameraConnection();
/*!
\brief gets the current amplitude frame from the input
These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value
*/
virtual void GetAmplitudes(float* amplitudeArray);
/*!
\brief gets the current intensity frame from the input as a greyscale image
*/
virtual void GetIntensities(float* intensityArray);
/*!
\brief gets the current distance frame from the inpug measuring the distance between the camera and the different object points in millimeters
*/
virtual void GetDistances(float* distanceArray);
/*!
\brief gets the current RGB frame from the input if available
*/
virtual void GetRgb(unsigned char* rgbArray);
/*!
\brief updates the current image frames from input
*/
virtual void UpdateCamera();
virtual void SetInputFileName(std::string inputFileName);
itkGetMacro(PixelNumber, int);
itkGetMacro(RGBPixelNumber, int);
itkGetMacro(CaptureWidth, int);
itkGetMacro(CaptureHeight, int);
itkGetMacro(RGBCaptureWidth, int);
itkGetMacro(RGBCaptureHeight, int);
itkGetMacro( DistanceImageFileName, std::string );
itkGetMacro( AmplitudeImageFileName, std::string );
itkGetMacro( IntensityImageFileName, std::string );
itkGetMacro( RGBImageFileName, std::string );
itkSetMacro( DistanceImageFileName, std::string );
itkSetMacro( AmplitudeImageFileName, std::string );
itkSetMacro( IntensityImageFileName, std::string );
itkSetMacro( RGBImageFileName, std::string );
enum ToFImageType{ ToFImageType3D, ToFImageType2DPlusT };
protected:
ToFCameraMITKPlayerController();
~ToFCameraMITKPlayerController() override;
int m_PixelNumber; ///< holds the number of pixels contained in the image
int m_RGBPixelNumber; ///< same for RGB image
int m_NumberOfBytes; ///< holds the number of bytes contained in the image
int m_NumberOfRGBBytes; ///< same for RGB image
int m_CaptureWidth; ///< holds the width of the image
int m_CaptureHeight; ///< holds the height of the image
int m_RGBCaptureWidth; ///< same for RGB image which can be different then depth etc.
int m_RGBCaptureHeight; ///< same for RGB image which can be different then depth etc.
bool m_ConnectionCheck; ///< flag showing whether the camera is connected (true) or not (false)
std::string m_InputFileName;
ToFImageType m_ToFImageType; ///< type of the ToF image to be played: 3D Volume (ToFImageType3D), temporal 2D image stack (ToFImageType2DPlusT)
Image::Pointer m_DistanceImage;
Image::Pointer m_AmplitudeImage;
Image::Pointer m_IntensityImage;
Image::Pointer m_RGBImage;
std::vector<bool> m_ImageStatus;
FILE* m_DistanceInfile; ///< file holding the distance data
FILE* m_AmplitudeInfile; ///< file holding the amplitude data
FILE* m_IntensityInfile; ///< file holding the intensity data
FILE* m_RGBInfile; ///< file holding the rgb data
float* m_IntensityArray; ///< member holding the current intensity frame
float* m_DistanceArray; ///< member holding the current distance frame
float* m_AmplitudeArray; ///< member holding the current amplitude frame
unsigned char* m_RGBArray; ///< member holding the current rgb frame
std::string m_DistanceImageFileName; ///< file name of the distance image to be played
std::string m_AmplitudeImageFileName; ///< file name of the amplitude image to be played
std::string m_IntensityImageFileName; ///< file name of the intensity image to be played
std::string m_RGBImageFileName; ///< file name of the rgb image to be played
long m_PixelStartInFile;
int m_CurrentFrame;
int m_NumOfFrames;
private:
void AccessData(int frame, Image::Pointer image, float* &data);
void CleanUp();
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/mitkToFCameraMITKPlayerDevice.h b/Modules/ToFHardware/mitkToFCameraMITKPlayerDevice.h
index cb44e58986..003442b818 100644
--- a/Modules/ToFHardware/mitkToFCameraMITKPlayerDevice.h
+++ b/Modules/ToFHardware/mitkToFCameraMITKPlayerDevice.h
@@ -1,136 +1,137 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFCameraMITKPlayerDevice_h
#define __mitkToFCameraMITKPlayerDevice_h
#include <MitkToFHardwareExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraMITKPlayerController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkMultiThreader.h"
#include "itkFastMutexLock.h"
namespace mitk
{
/**
* @brief Device class representing a player for MITK-ToF images.
*
* @ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFCameraMITKPlayerDevice : public ToFCameraDevice
{
public:
mitkClassMacro( ToFCameraMITKPlayerDevice , ToFCameraDevice );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/*!
\brief opens a connection to the ToF camera
*/
bool OnConnectCamera() override;
/*!
\brief closes the connection to the camera
*/
bool DisconnectCamera() override;
/*!
\brief starts the continuous updating of the camera.
A separate thread updates the source data, the main thread processes the source data and creates images and coordinates
*/
void StartCamera() override;
/*!
\brief gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel. Caution! The user is responsible for allocating and deleting the images.
These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value
\param imageSequence the actually captured image sequence number
\param amplitudeArray contains the returned amplitude data as an array.
*/
void GetAmplitudes(float* amplitudeArray, int& imageSequence) override;
/*!
\brief gets the intensity data from the ToF camera as a greyscale image. Caution! The user is responsible for allocating and deleting the images.
\param intensityArray contains the returned intensities data as an array.
\param imageSequence the actually captured image sequence number
*/
void GetIntensities(float* intensityArray, int& imageSequence) override;
/*!
\brief gets the rgb data from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
\param rgbArray contains the returned rgb data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetRgb(unsigned char* rgbArray, int& imageSequence);
/*!
\brief gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distances data as an array.
\param imageSequence the actually captured image sequence number
*/
void GetDistances(float* distanceArray, int& imageSequence) override;
/*!
\brief gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distance data as an array.
\param amplitudeArray contains the returned amplitude data as an array.
\param intensityArray contains the returned intensity data as an array.
\param sourceDataArray contains the complete source data from the camera device.
\param requiredImageSequence the required image sequence number
\param capturedImageSequence the actually captured image sequence number
*/
void GetAllImages(float* distanceArray, float* amplitudeArray, float* intensityArray, char* sourceDataArray,
int requiredImageSequence, int& capturedImageSequence, unsigned char* rgbDataArray=nullptr) override;
/*!
\brief Set file name where the data is recorded
\param inputFileName name of input file which should be played
*/
virtual void SetInputFileName(std::string inputFileName);
/*!
\brief set a BaseProperty
*/
void SetProperty( const char *propertyKey, BaseProperty* propertyValue ) override;
protected:
ToFCameraMITKPlayerDevice();
~ToFCameraMITKPlayerDevice() override;
/*!
\brief updates the camera for image acquisition
*/
void UpdateCamera() override;
/*!
\brief Thread method continuously acquiring images from the specified input file
*/
static ITK_THREAD_RETURN_TYPE Acquire(void* pInfoStruct);
/*!
\brief Clean up memory (pixel buffers)
*/
void CleanUpDataBuffers();
/*!
\brief Allocate pixel buffers
*/
void AllocateDataBuffers();
ToFCameraMITKPlayerController::Pointer m_Controller; ///< member holding the corresponding controller
std::string m_InputFileName; ///< member holding the file name of the current input file
private:
float** m_DistanceDataBuffer; ///< buffer holding the last distance images
float** m_AmplitudeDataBuffer; ///< buffer holding the last amplitude images
float** m_IntensityDataBuffer; ///< buffer holding the last intensity images
unsigned char** m_RGBDataBuffer; ///< buffer holding the last rgb images
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/mitkToFDeviceFactoryManager.h b/Modules/ToFHardware/mitkToFDeviceFactoryManager.h
index f331e34e50..41e12ae565 100644
--- a/Modules/ToFHardware/mitkToFDeviceFactoryManager.h
+++ b/Modules/ToFHardware/mitkToFDeviceFactoryManager.h
@@ -1,61 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFDeviceListener_h
#define __mitkToFDeviceListener_h
#include <MitkToFHardwareExports.h>
#include "mitkToFCameraDevice.h"
//Microservices
#include <usServiceReference.h>
namespace mitk
{
struct IToFDeviceFactory;
/**
* @brief ToFDeviceListener
*
* @ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFDeviceFactoryManager: public itk::Object
{
public:
mitkClassMacroItkParent( ToFDeviceFactoryManager, itk::Object );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
std::vector<std::string> GetRegisteredDeviceFactories();
std::vector<std::string> GetConnectedDevices();
ToFCameraDevice* GetInstanceOfDevice(int index);
protected:
ToFDeviceFactoryManager();
~ToFDeviceFactoryManager() override;
std::vector<std::string> m_RegisteredFactoryNames;
std::vector<us::ServiceReference<IToFDeviceFactory> > m_RegisteredFactoryRefs;
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/mitkToFImageCsvWriter.h b/Modules/ToFHardware/mitkToFImageCsvWriter.h
index 19d97b9df7..5b9e4e9be8 100644
--- a/Modules/ToFHardware/mitkToFImageCsvWriter.h
+++ b/Modules/ToFHardware/mitkToFImageCsvWriter.h
@@ -1,86 +1,87 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFImageCsvWriter_h
#define __mitkToFImageCsvWriter_h
#include "mitkToFImageWriter.h"
#include <MitkToFHardwareExports.h>
namespace mitk
{
/**
* @brief CSV writer class for ToF image data
*
* This writer class allows streaming of ToF data into a CSV file.
* Writer can simultaneously save "distance", "intensity" and "amplitude" image data.
* Output files are written as 1D CSV data stream.
*
* @ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFImageCsvWriter : public ToFImageWriter
{
public:
/*!
\brief standard ctor
*/
ToFImageCsvWriter();
/*!
\brief standard ~ctor
*/
~ToFImageCsvWriter() override;
mitkClassMacro( ToFImageCsvWriter , ToFImageWriter );
- itkFactorylessNewMacro(Self)
+ itkFactorylessNewMacro(Self);
+
itkCloneMacro(Self)
/*!
\brief Checks for file extensions and opens the output files
*/
void Open() override;
/*!
\brief Closes the output files
*/
void Close() override;
/*!
\brief Pushes the image data to the output files
\param distanceFloatData from distance image as float value
\param amplitudeFloatData from amplitude image as float value
\param intensityFloatData from intensity image as float value
*/
void Add(float* distanceFloatData, float* amplitudeFloatData, float* intensityFloatData, unsigned char* rgbData=nullptr) override;
protected:
Image::Pointer m_MitkImage; ///< mitk image used for pic header creation
FILE* m_DistanceOutfile; ///< file for distance image
FILE* m_AmplitudeOutfile; ///< file for amplitude image
FILE* m_IntensityOutfile; ///< file for intensity image
private:
/*!
\brief opens CSV output file
\param output file, name of the output file
*/
void OpenCsvFile(FILE** outfile, std::string outfileName);
/*!
\brief closes CSV output file
\param output file
*/
void CloseCsvFile(FILE* outfile);
/*!
\brief writes the data to the CSV output file
\param output file, data array of float values
*/
void WriteCsvFile(FILE* outfile, float* floatData);
};
} //END mitk namespace
#endif // __mitkToFImageCsvWriter_h
diff --git a/Modules/ToFHardware/mitkToFImageGrabber.h b/Modules/ToFHardware/mitkToFImageGrabber.h
index c14d79f6b7..ccd2c21acb 100644
--- a/Modules/ToFHardware/mitkToFImageGrabber.h
+++ b/Modules/ToFHardware/mitkToFImageGrabber.h
@@ -1,207 +1,208 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFImageGrabber_h
#define __mitkToFImageGrabber_h
#include <MitkToFHardwareExports.h>
#include <mitkCommon.h>
#include <mitkToFImageSource.h>
#include <mitkToFCameraDevice.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
namespace mitk
{
/**Documentation
* \brief Image source providing ToF images. Interface for filters provided in ToFProcessing module
*
* This class internally holds a ToFCameraDevice to access the images acquired by a ToF camera.
*
* Provided images include: distance image (output 0), amplitude image (output 1), intensity image (output 2)
*
* \ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFImageGrabber : public mitk::ToFImageSource
{
public:
mitkClassMacro( ToFImageGrabber , ImageSource );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
void ShowDebugImage(float* distances);
/*!
\brief Establish a connection to the ToF camera
*/
virtual bool ConnectCamera();
/*!
\brief Disconnects the ToF camera
*/
virtual bool DisconnectCamera();
/*!
\brief Starts the continuous updating of the camera.
A separate thread updates the source data, the main thread processes the source data and creates images and coordinates
*/
virtual void StartCamera();
/*!
\brief Stops the continuous updating of the camera
*/
virtual void StopCamera();
/*!
\brief Returns true if the camera is connected and started
*/
virtual bool IsCameraActive();
/*!
\brief Returns true if the camera is connected
*/
virtual bool IsCameraConnected();
/*!
\brief Sets the ToF device, the image grabber is grabbing the images from
\param aToFCameraDevice device internally used for grabbing the images from the camera
*/
void SetCameraDevice(ToFCameraDevice* aToFCameraDevice);
/*!
\brief Get the currently set ToF camera device
\return device currently used for grabbing images from the camera
*/
ToFCameraDevice* GetCameraDevice();
/*!
\brief Set the modulation frequency used by the ToF camera.
For default values see the corresponding device classes
\param modulationFrequency modulation frequency in Hz
*/
int SetModulationFrequency(int modulationFrequency);
/*!
\brief Get the modulation frequency used by the ToF camera.
\return modulation frequency in MHz
*/
int GetModulationFrequency();
/*!
\brief Set the integration time used by the ToF camera.
For default values see the corresponding device classes
\param integrationTime integration time in ms
*/
int SetIntegrationTime(int integrationTime);
/*!
\brief Get the integration time in used by the ToF camera.
\return integration time in ms
*/
int GetIntegrationTime();
/*!
\brief Get the dimension in x direction of the ToF image
\return width of the image
*/
int GetCaptureWidth();
/*!
\brief Get the dimension in y direction of the ToF image
\return height of the image
*/
int GetCaptureHeight();
/*!
\brief Get the number of pixel in the ToF image
\return number of pixel
*/
int GetPixelNumber();
/*!
\brief Get the dimension in x direction of the ToF image
\return width of the image
*/
int GetRGBImageWidth();
/*!
\brief Get the dimension in y direction of the ToF image
\return height of the image
*/
int GetRGBImageHeight();
/*!
\brief Get the number of pixel in the ToF image
\return number of pixel
*/
int GetRGBPixelNumber();
// properties
void SetBoolProperty( const char* propertyKey, bool boolValue );
void SetIntProperty( const char* propertyKey, int intValue );
void SetFloatProperty( const char* propertyKey, float floatValue );
void SetStringProperty( const char* propertyKey, const char* stringValue );
void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
bool GetBoolProperty( const char* propertyKey);
int GetIntProperty( const char* propertyKey);
float GetFloatProperty( const char* propertyKey);
const char* GetStringProperty( const char* propertyKey);
BaseProperty* GetProperty( const char *propertyKey);
protected:
///
/// called when the ToFCameraDevice was modified
///
void OnToFCameraDeviceModified();
/*!
\brief clean up memory allocated for the image arrays m_IntensityArray, m_DistanceArray, m_AmplitudeArray and m_SourceDataArray
*/
virtual void CleanUpImageArrays();
/*!
\brief Allocate memory for the image arrays m_IntensityArray, m_DistanceArray, m_AmplitudeArray and m_SourceDataArray
*/
virtual void AllocateImageArrays();
/**
* @brief InitializeImages Initialze the geometries of the images according to the device properties.
*/
void InitializeImages();
ToFCameraDevice::Pointer m_ToFCameraDevice; ///< Device allowing access to ToF image data
int m_CaptureWidth; ///< Width of the captured ToF image
int m_CaptureHeight; ///< Height of the captured ToF image
int m_PixelNumber; ///< Number of pixels in the image
int m_RGBImageWidth; ///< Width of the captured RGB image
int m_RGBImageHeight; ///< Height of the captured RGB image
int m_RGBPixelNumber; ///< Number of pixels in the RGB image
int m_ImageSequence; ///< counter for currently acquired images
int m_SourceDataSize; ///< size of the source data in bytes
float* m_IntensityArray; ///< member holding the current intensity array
float* m_DistanceArray; ///< member holding the current distance array
float* m_AmplitudeArray; ///< member holding the current amplitude array
char* m_SourceDataArray;///< member holding the current source data array
unsigned char* m_RgbDataArray; ///< member holding the current rgb data array
unsigned long m_DeviceObserverTag; ///< tag of the observer for the ToFCameraDevice
ToFImageGrabber();
~ToFImageGrabber() override;
/*!
\brief Method generating the outputs of this filter. Called in the updated process of the pipeline.
0: distance image
1: amplitude image
2: intensity image
3: RGB image
*/
void GenerateData() override;
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/mitkToFImageRecorder.h b/Modules/ToFHardware/mitkToFImageRecorder.h
index cb86cb46de..16e022f396 100644
--- a/Modules/ToFHardware/mitkToFImageRecorder.h
+++ b/Modules/ToFHardware/mitkToFImageRecorder.h
@@ -1,176 +1,177 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkToFImageRecorder_h
#define mitkToFImageRecorder_h
#include "MitkToFHardwareExports.h"
#include <mitkCommon.h>
#include "mitkToFCameraDevice.h"
#include "mitkToFImageCsvWriter.h"
#include "mitkToFNrrdImageWriter.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <itkFastMutexLock.h>
#include <itkCommand.h>
namespace mitk
{
/**
* @brief Recorder class for ToF images
*
* This class represents a recorder for ToF data. A ToFCameraDevice is used to acquire the data. The acquired images
* are then added to a ToFImageWriter that performs the actual writing.
*
* Recording can be performed either frame-based or continuously.
*
* @warning It is currently not guaranteed that all acquired images are recorded, since the recording
* is done in a newly spawned thread. However, in practise only very few images are lost. See bug #12997
* for more details.
*
* @ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFImageRecorder : public itk::Object
{
public:
ToFImageRecorder();
~ToFImageRecorder() override;
mitkClassMacroItkParent( ToFImageRecorder , itk::Object );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
itkGetMacro( DistanceImageFileName, std::string );
itkGetMacro( AmplitudeImageFileName, std::string );
itkGetMacro( IntensityImageFileName, std::string );
itkGetMacro( RGBImageFileName, std::string );
itkGetMacro( ToFCaptureWidth, int );
itkGetMacro( ToFCaptureHeight, int );
itkGetMacro( RGBCaptureWidth, int );
itkGetMacro( RGBCaptureHeight, int );
itkGetMacro( DistanceImageSelected, bool );
itkGetMacro( AmplitudeImageSelected, bool );
itkGetMacro( IntensityImageSelected, bool );
itkGetMacro( RGBImageSelected, bool );
itkGetMacro( NumOfFrames, int );
itkGetMacro( FileFormat, std::string );
itkSetMacro( DistanceImageFileName, std::string );
itkSetMacro( AmplitudeImageFileName, std::string );
itkSetMacro( IntensityImageFileName, std::string );
itkSetMacro(RGBImageFileName, std::string );
itkSetMacro( DistanceImageSelected, bool );
itkSetMacro( AmplitudeImageSelected, bool );
itkSetMacro( IntensityImageSelected, bool );
itkSetMacro( RGBImageSelected, bool );
itkSetMacro( NumOfFrames, int );
itkSetMacro( FileFormat, std::string );
enum RecordMode{ PerFrames, Infinite };
/*!
\brief Returns the currently set RecordMode
\return record mode: PerFrames ("Record specified number of frames"), Infinite ("Record until abort is required")
*/
ToFImageRecorder::RecordMode GetRecordMode();
/*!
\brief Set the RecordMode
\param recordMode: PerFrames ("Record specified number of frames"), Infinite ("Record until abort is required")
*/
void SetRecordMode(ToFImageRecorder::RecordMode recordMode);
/*!
\brief Set the device used for acquiring ToF images
\param aToFCameraDevice ToF camera device used.
*/
void SetCameraDevice(ToFCameraDevice* aToFCameraDevice);
/*!
\brief Get the device used for acquiring ToF images
\return ToF camera device used.
*/
ToFCameraDevice* GetCameraDevice();
/*!
\brief Get the type of image to be recorded
\return ToF image type: ToFImageType3D (0) or ToFImageType2DPlusT (1)
*/
ToFImageWriter::ToFImageType GetToFImageType();
/*!
\brief Set the type of image to be recorded
\param toFImageType type of the ToF image: ToFImageType3D (0) or ToFImageType2DPlusT (1)
*/
void SetToFImageType(ToFImageWriter::ToFImageType toFImageType);
/*!
\brief Starts the recording by spawning a Thread which streams the data to a file. Aborting of the record process is controlled by the m_Abort flag
*/
void StartRecording();
/*!
\brief Stops the recording by setting the m_Abort flag to false
*/
void StopRecording();
/*!
\brief Wait until thread is terinated
*/
void WaitForThreadBeingTerminated();
protected:
/*!
\brief Thread method acquiring data via the ToFCameraDevice and recording it to file via the ToFImageWriter
*/
static ITK_THREAD_RETURN_TYPE RecordData(void* pInfoStruct);
// data acquisition
ToFCameraDevice::Pointer m_ToFCameraDevice; ///< ToFCameraDevice used for acquiring the images
int m_ToFCaptureWidth; ///< width (x-dimension) of the images to record.
int m_ToFCaptureHeight; ///< height (y-dimension) of the images to record.
int m_ToFPixelNumber; ///< number of pixels (widht*height) of the images to record
int m_RGBCaptureWidth; ///< width (x-dimension) of the images to record.
int m_RGBCaptureHeight; ///< height (y-dimension) of the images to record.
int m_RGBPixelNumber; ///< number of pixels (widht*height) of the images to record
int m_SourceDataSize; ///< size of the source data provided by the device
int m_ImageSequence; ///< number of images currently acquired
float* m_IntensityArray; ///< array holding the intensity data
float* m_DistanceArray; ///< array holding the distance data
float* m_AmplitudeArray; ///< array holding the amplitude data
unsigned char* m_RGBArray; ///< array holding the RGB data if available (e.g. for Kinect)
char* m_SourceDataArray; ///< array holding the source data
// data writing
ToFImageWriter::Pointer m_ToFImageWriter; ///< image writer writing the acquired images to a file
std::string m_DistanceImageFileName; ///< file name for saving the distance image
std::string m_AmplitudeImageFileName; ///< file name for saving the amplitude image
std::string m_IntensityImageFileName; ///< file name for saving the intensity image
std::string m_RGBImageFileName; ///< file name for saving the rgb image
int m_NumOfFrames; ///< number of frames to be recorded by this recorder
ToFImageWriter::ToFImageType m_ToFImageType; ///< type of image to be recorded: ToFImageType3D (0) or ToFImageType2DPlusT (1)
ToFImageRecorder::RecordMode m_RecordMode; ///< mode of recording the images: specified number of frames (PerFrames) or infinite (Infinite)
std::string m_FileFormat; ///< file format for saving images. If .csv is chosen, ToFImageCsvWriter is used
bool m_DistanceImageSelected; ///< flag indicating if distance image should be recorded
bool m_AmplitudeImageSelected; ///< flag indicating if amplitude image should be recorded
bool m_IntensityImageSelected; ///< flag indicating if intensity image should be recorded
bool m_RGBImageSelected; ///< flag indicating if rgb image should be recorded
// threading
itk::MultiThreader::Pointer m_MultiThreader; ///< member for thread-handling (ITK-based)
int m_ThreadID; ///< ID of the thread recording the data
itk::FastMutexLock::Pointer m_AbortMutex; ///< mutex for thread-safe data access of abort flag
bool m_Abort; ///< flag controlling the abort mechanism of the recording procedure. For thread-safety only use in combination with m_AbortMutex
private:
};
} //END mitk namespace
#endif //mitkToFImageRecorder_h
diff --git a/Modules/ToFHardware/mitkToFImageRecorderFilter.h b/Modules/ToFHardware/mitkToFImageRecorderFilter.h
index df266a240b..b52d6e2feb 100644
--- a/Modules/ToFHardware/mitkToFImageRecorderFilter.h
+++ b/Modules/ToFHardware/mitkToFImageRecorderFilter.h
@@ -1,115 +1,115 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFImageRecorderFilter_h
#define __mitkToFImageRecorderFilter_h
#include <mitkImageToImageFilter.h>
#include <MitkToFHardwareExports.h>
#include <mitkToFImageWriter.h>
namespace mitk
{
/**
* @brief Filter that allows recording of processed ToF images
* Internally the ToFImageWriter is used for writing.
*
* @ingroup ToFProcessing
*/
class MITKTOFHARDWARE_EXPORT ToFImageRecorderFilter : public ImageToImageFilter
{
public:
mitkClassMacro(ToFImageRecorderFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/*!
\brief Set file name for writing image files
This filename will be appended by "_DistanceImage", "_AmplitudeImage", or "_IntensityImage" for the single images
\param fileName base file name to save image filtes
*/
void SetFileName(std::string fileName);
/*!
\brief Set image type for recording
\param tofImageType either 3D Volume (ToFImageType3D) or temporal image stack (ToFImageType2DPlusT)
*/
void SetImageType(ToFImageWriter::ToFImageType tofImageType);
/*!
\brief Returns a pointer to the ToFImageWriter internally used
\return ToFImageWriter
*/
ToFImageWriter::Pointer GetToFImageWriter();
/*!
\brief Sets a pointer to the ToFImageWriter internally used
\param tofImageWriter ToFImageWriter
*/
void SetToFImageWriter(ToFImageWriter::Pointer tofImageWriter);
/*!
\brief start recording of data
*/
void StartRecording();
/*!
\brief stop recording of data
*/
void StopRecording();
using itk::ProcessObject::SetInput;
/*!
\brief sets the input of this filter
\param input is the distance image of e.g. a ToF camera
*/
void SetInput( const InputImageType* input) override;
/*!
\brief sets the input of this filter at idx
\param idx number of the current input
\param input is the distance image of e.g. a ToF camera
*/
void SetInput(unsigned int idx, const InputImageType* input) override;
/*!
\brief returns the input of this filter
*/
Image* GetInput();
/*!
\brief returns the input with id idx of this filter
*/
Image* GetInput(unsigned int idx);
protected:
/*!
\brief standard constructor
*/
ToFImageRecorderFilter();
/*!
\brief standard destructor
*/
~ToFImageRecorderFilter() override;
/*!
\brief method generating the output of this filter. Called in the updated process of the pipeline.
This method generates the output of the ToFSurfaceSource: The generated surface of the 3d points
*/
void GenerateData() override;
/**
* \brief Create an output for each input
*
* This Method sets the number of outputs to the number of inputs
* and creates missing outputs objects.
* \warning any additional outputs that exist before the method is called are deleted
*/
void CreateOutputsForAllInputs();
bool m_RecordingStarted; ///< flag indicating if filter is currently recording
ToFImageWriter::Pointer m_ToFImageWriter; ///< image writer used for streaming input data to file
std::string m_FileExtension;
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/mitkToFImageSource.h b/Modules/ToFHardware/mitkToFImageSource.h
index cafb38ea43..ebc17b522d 100644
--- a/Modules/ToFHardware/mitkToFImageSource.h
+++ b/Modules/ToFHardware/mitkToFImageSource.h
@@ -1,61 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFImageSource_h
#define __mitkToFImageSource_h
#include <MitkToFHardwareExports.h>
#include <mitkImageSource.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
//MicroServices
#include <usServiceInterface.h>
#include <usServiceRegistration.h>
namespace mitk
{
/**Documentation
* \brief Image source providing ToF images. Interface for filters provided in ToFProcessing module
*
* This class internally holds a ToFCameraDevice to access the images acquired by a ToF camera.
*
* Provided images include: distance image (output 0), amplitude image (output 1), intensity image (output 2) and color image (output 3)
*
* \ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFImageSource : public mitk::ImageSource
{
public:
mitkClassMacro( ToFImageSource, ImageSource );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
protected:
ToFImageSource();
~ToFImageSource() override;
us::ServiceRegistration<Self> m_ServiceRegistration;
private:
};
} //END mitk namespace
/**
ToFCameraDevice is declared a MicroService interface. See
MicroService documenation for more details.
*/
US_DECLARE_SERVICE_INTERFACE(mitk::ToFImageSource, "org.mitk.services.ToFImageSource")
#endif
diff --git a/Modules/ToFHardware/mitkToFImageWriter.h b/Modules/ToFHardware/mitkToFImageWriter.h
index 2cc1bda4f9..3d499612d5 100644
--- a/Modules/ToFHardware/mitkToFImageWriter.h
+++ b/Modules/ToFHardware/mitkToFImageWriter.h
@@ -1,129 +1,130 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFImageWriter_h
#define __mitkToFImageWriter_h
#include <MitkToFHardwareExports.h>
#include "mitkCommon.h"
#include "mitkToFImageGrabber.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Writer class for ToF images
*
* This writer class allows streaming of ToF data into a file. The .pic file format is used for writing the data.
* Image information is included in the header of the pic file.
* Writer can simultaneously save "distance", "intensity" and "amplitude" image.
* Images can be written as 3D volume (ToFImageType::ToFImageType3D) or temporal image stack (ToFImageType::ToFImageType2DPlusT)
*
* @ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFImageWriter : public itk::Object
{
public:
ToFImageWriter();
~ToFImageWriter() override;
mitkClassMacroItkParent( ToFImageWriter , itk::Object );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
itkGetMacro( DistanceImageFileName, std::string );
itkGetMacro( AmplitudeImageFileName, std::string );
itkGetMacro( IntensityImageFileName, std::string );
itkGetMacro( RGBImageFileName, std::string );
itkGetMacro( Extension, std::string );
itkGetMacro( ToFCaptureWidth, int );
itkGetMacro( ToFCaptureHeight, int );
itkGetMacro( RGBCaptureWidth, int );
itkGetMacro( RGBCaptureHeight, int );
itkGetMacro( DistanceImageSelected, bool );
itkGetMacro( AmplitudeImageSelected, bool );
itkGetMacro( IntensityImageSelected, bool );
itkGetMacro( RGBImageSelected, bool );
itkSetMacro( DistanceImageFileName, std::string );
itkSetMacro( AmplitudeImageFileName, std::string );
itkSetMacro( IntensityImageFileName, std::string );
itkSetMacro( RGBImageFileName, std::string );
itkSetMacro( Extension, std::string );
itkSetMacro( ToFCaptureWidth, int );
itkSetMacro( ToFCaptureHeight, int );
itkSetMacro( RGBCaptureWidth, int );
itkSetMacro( RGBCaptureHeight, int );
itkSetMacro( DistanceImageSelected, bool );
itkSetMacro( AmplitudeImageSelected, bool );
itkSetMacro( IntensityImageSelected, bool );
itkSetMacro( RGBImageSelected, bool );
enum ToFImageType{ ToFImageType3D, ToFImageType2DPlusT };
/*!
\brief Get the type of image to be written
\return ToF image type: ToFImageType3D (0) or ToFImageType2DPlusT (1)
*/
ToFImageWriter::ToFImageType GetToFImageType();
/*!
\brief Set the type of image to be written
\param toFImageType type of the ToF image: ToFImageType3D (0) or ToFImageType2DPlusT (1)
*/
void SetToFImageType(ToFImageWriter::ToFImageType toFImageType);
/*!
\brief Open file(s) for writing
*/
virtual void Open(){};
/*!
\brief Close file(s) add .pic header and write
*/
virtual void Close(){};
/*!
\brief Add new data to file.
*/
virtual void Add(float* /*distanceFloatData*/, float* /*amplitudeFloatData*/, float* /*intensityFloatData*/, unsigned char* /*rgbData*/=nullptr){};
protected:
/*!
\brief Checks file name if file extension exists. If not an error message is returned
*/
void CheckForFileExtension(std::string& fileName);
// member variables
std::string m_Extension; ///< file extension used for saving images
std::string m_DistanceImageFileName; ///< file name for saving the distance image
std::string m_AmplitudeImageFileName; ///< file name for saving the amplitude image
std::string m_IntensityImageFileName; ///< file name for saving the intensity image
std::string m_RGBImageFileName; ///< file name for saving the RGB image
int m_NumOfFrames; ///< number of frames written to the image. Used for pic header.
bool m_DistanceImageSelected; ///< flag indicating if distance image should be recorded
bool m_AmplitudeImageSelected; ///< flag indicating if amplitude image should be recorded
bool m_IntensityImageSelected; ///< flag indicating if intensity image should be recorded
bool m_RGBImageSelected; ///< flag indicating if RGB image should be recorded
int m_ToFCaptureWidth; ///< width (x-dimension) of the images to record.
int m_ToFCaptureHeight; ///< height (y-dimension) of the images to record.
int m_RGBCaptureWidth; ///< width (x-dimension) of the images to record.
int m_RGBCaptureHeight; ///< height (y-dimension) of the images to record.
int m_ToFPixelNumber; ///< number of pixels (widht*height) of the images to record
int m_ToFImageSizeInBytes; ///< size of the image to save in bytes
int m_RGBPixelNumber; ///< number of pixels (widht*height) of the images to record
int m_RGBImageSizeInBytes; ///< size of the image to save in bytes
ToFImageWriter::ToFImageType m_ToFImageType; ///< type of image to be recorded: ToFImageType3D (0) or ToFImageType2DPlusT (1)
};
} //END mitk namespace
#endif // __mitkToFImageWriter_h
diff --git a/Modules/ToFHardware/mitkToFNrrdImageWriter.h b/Modules/ToFHardware/mitkToFNrrdImageWriter.h
index d033f814d0..c6872000c8 100644
--- a/Modules/ToFHardware/mitkToFNrrdImageWriter.h
+++ b/Modules/ToFHardware/mitkToFNrrdImageWriter.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFNrrdImageWriter_h
#define __mitkToFNrrdImageWriter_h
#include <MitkToFHardwareExports.h>
#include "mitkToFImageWriter.h"
#include <fstream>
namespace mitk
{
/**
* @brief Writer class for ToF nrrd images
*
* This writer class allows streaming of ToF data into a nrrd file. This class uses the itkNrrdImageIO class
* Writer can simultaneously save "distance", "intensity" and "amplitude" image.
* Images can be written as 3D volume (ToFImageType::ToFImageType3D) or temporal image stack (ToFImageType::ToFImageType2DPlusT)
*
* @ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFNrrdImageWriter : public ToFImageWriter
{
public:
mitkClassMacro( ToFNrrdImageWriter , ToFImageWriter );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/*!
\brief Open file(s) for writing
*/
void Open() override;
/*!
\brief Close file(s) add .pic header and write
*/
void Close() override;
/*!
\brief Add new data to file.
*/
void Add(float* distanceFloatData, float* amplitudeFloatData, float* intensityFloatData, unsigned char* rgbData=nullptr) override;
protected:
std::ofstream m_DistanceOutfile; ///< file for distance image
std::ofstream m_AmplitudeOutfile; ///< file for amplitude image
std::ofstream m_IntensityOutfile; ///< file for intensity image
std::ofstream m_RGBOutfile; ///< file for intensity image
private:
ToFNrrdImageWriter();
~ToFNrrdImageWriter() override;
/*!
\brief Open file by filename to gain write access to it.
*/
void OpenStreamFile(std::ofstream &outfile, std::string outfileName);
/*!
\brief Close file after work on it is finished.
*/
void CloseStreamFile(std::ofstream &outfile, std::string fileName);
/*!
\brief Write image information to the NrrdFile.
*/
void ConvertStreamToNrrdFormat( std::string fileName );
};
} //END mitk namespace
#endif // __mitkToFNrrdImageWriter_h
diff --git a/Modules/ToFHardware/mitkToFOpenCVImageGrabber.h b/Modules/ToFHardware/mitkToFOpenCVImageGrabber.h
index 2f7a2a0086..390de1eab5 100644
--- a/Modules/ToFHardware/mitkToFOpenCVImageGrabber.h
+++ b/Modules/ToFHardware/mitkToFOpenCVImageGrabber.h
@@ -1,100 +1,101 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFOpenCVImageGrabber_h
#define __mitkToFOpenCVImageGrabber_h
#include <MitkToFHardwareExports.h>
#include "mitkCommon.h"
#include "mitkOpenCVImageSource.h"
#include "mitkToFImageGrabber.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief TofImageGrabber class providing OpenCV images
*
*
* @ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFOpenCVImageGrabber : public mitk::OpenCVImageSource
{
public:
ToFOpenCVImageGrabber();
~ToFOpenCVImageGrabber() override;
mitkClassMacro( ToFOpenCVImageGrabber , OpenCVImageSource );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+
+ itkCloneMacro(Self);
/*!
\brief Get current ToF image. Specify image you want to grab with SetImageType()
*/
cv::Mat GetImage() override;
/*!
\brief set type of image you want to grab.
0: Distance image (Default)
1: Amplitude image
2: Intensity image
*/
void SetImageType(unsigned int imageType);
/*!
\brief set the depth of the image. Some functions of OpenCV do not support IPL_DEPTH_32F.
Warning: changing from default results in a mapping of the pixel value through a lookup table
IPL_DEPTH_1U 1
IPL_DEPTH_8U 8
IPL_DEPTH_16U 16
IPL_DEPTH_32F 32 (Default)
*/
void SetImageDepth(unsigned int imageDepth);
/*!
\brief set the ImageGrabber used for fetching image data from the camera
*/
void SetToFImageGrabber(mitk::ToFImageGrabber::Pointer imageGrabber);
/*!
\brief get the ImageGrabber used for fetching image data from the camera
*/
mitk::ToFImageGrabber::Pointer GetToFImageGrabber();
void StartCapturing();
void StopCapturing();
protected:
/*!
\brief map scalars through lookup table
\param image current MITK image
*/
void MapScalars(mitk::Image::Pointer mitkImage, IplImage* openCVImage);
mitk::ToFImageGrabber::Pointer m_ImageGrabber; ///< ImageGrabber used for fetching ToF image data from the camera
unsigned int m_ImageType; ///< type of image currently supplied by this image source
/*!
\brief image depth currently used by this image source.
Warning: Changing from default (IPL_DEPTH_32F) results in a mapping of the pixel value through a lookup table
*/
unsigned int m_ImageDepth;
IplImage* m_CurrentOpenCVIntensityImage; ///< OpenCV image holding the current intensity data
IplImage* m_CurrentOpenCVAmplitudeImage; ///< OpenCV image holding the current amplitude data
IplImage* m_CurrentOpenCVDistanceImage; ///< OpenCV image holding the current distance data
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFProcessing/mitkToFCompositeFilter.h b/Modules/ToFProcessing/mitkToFCompositeFilter.h
index f97af7b4bf..3b7fa54bbb 100644
--- a/Modules/ToFProcessing/mitkToFCompositeFilter.h
+++ b/Modules/ToFProcessing/mitkToFCompositeFilter.h
@@ -1,197 +1,196 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFCompositeFilter_h
#define __mitkToFCompositeFilter_h
#include <mitkImage.h>
#include "mitkImageToImageFilter.h"
#include <MitkToFProcessingExports.h>
#include <itkBilateralImageFilter.h>
#include "opencv2/core.hpp"
typedef itk::Image<float, 2> ItkImageType2D;
typedef itk::Image<float, 3> ItkImageType3D;
typedef itk::BilateralImageFilter<ItkImageType2D,ItkImageType2D> BilateralFilterType;
namespace mitk
{
/**
* @brief Applies a common filter-pipeline to the first input of this filter
*
* This class intends to allow quick preprocessing of (ToF) range data. Input 0 of this filter, holding the range image,
* is processed using the following image processing filters:
* - threshold filter
* - mask segmentation
* - temporal median filter
* - spatial median filter
* - bilateral filter
*
* @ingroup ToFProcessing
*/
class MITKTOFPROCESSING_EXPORT ToFCompositeFilter : public ImageToImageFilter
{
public:
mitkClassMacro( ToFCompositeFilter , ImageToImageFilter );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
-
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
itkSetMacro(SegmentationMask,mitk::Image::Pointer);
itkSetMacro(ApplyTemporalMedianFilter,bool);
itkGetConstMacro(ApplyTemporalMedianFilter,bool);
itkSetMacro(ApplyAverageFilter,bool);
itkGetConstMacro(ApplyAverageFilter,bool);
itkSetMacro(ApplyMedianFilter,bool);
itkGetConstMacro(ApplyMedianFilter,bool);
itkSetMacro(ApplyThresholdFilter,bool);
itkGetConstMacro(ApplyThresholdFilter,bool);
itkSetMacro(ApplyMaskSegmentation,bool);
itkGetConstMacro(ApplyMaskSegmentation,bool);
itkSetMacro(ApplyBilateralFilter,bool);
itkGetConstMacro(ApplyBilateralFilter,bool);
using itk::ProcessObject::SetInput;
/*!
\brief sets the input of this filter
\param distanceImage input is the distance image of e.g. a ToF camera
*/
void SetInput( const InputImageType* distanceImage) override;
/*!
\brief sets the input of this filter at idx
\param idx number of the current input
\param distanceImage input is the distance image of e.g. a ToF camera
*/
void SetInput(unsigned int idx, const InputImageType* distanceImage) override;
/*!
\brief returns the input of this filter
*/
Image* GetInput();
/*!
\brief returns the input with id idx of this filter
*/
Image* GetInput(unsigned int idx);
/*!
\brief Sets the parameter of the temporal median filter
\param tmporalMedianFilterNumOfFrames number of frames to be considered for calulating the temporal median
*/
void SetTemporalMedianFilterParameter(int tmporalMedianFilterNumOfFrames);
/*!
\brief Sets the parameters (lower, upper threshold) of the threshold filter
\param min lower threshold of the threshold filter
\param max upper threshold of the threshold filter
*/
void SetThresholdFilterParameter(int min, int max);
/*!
\brief Sets the parameters (domain sigma, range sigma, kernel radius) of the bilateral filter
\param domainSigma Parameter controlling the smoothing effect of the bilateral filter. Default value: 2
\param rangeSigma Parameter controlling the edge preserving effect of the bilateral filter. Default value: 60
\param kernelRadius radius of the filter mask of the bilateral filter
*/
void SetBilateralFilterParameter(double domainSigma, double rangeSigma, int kernelRadius);
protected:
/*!
\brief standard constructor
*/
ToFCompositeFilter();
/*!
\brief standard destructor
*/
~ToFCompositeFilter() override;
void GenerateOutputInformation() override;
/*!
\brief method generating the output of this filter. Called in the updated process of the pipeline.
This method generates the output of the ToFSurfaceSource: The generated surface of the 3d points
*/
void GenerateData() override;
/**
* \brief Create an output for each input
*
* This Method sets the number of outputs to the number of inputs
* and creates missing outputs objects.
* \warning any additional outputs that exist before the method is called are deleted
*/
void CreateOutputsForAllInputs();
/*!
\brief Applies a mask and/or threshold segmentation to the input image.
All pixels with values outside the mask, below the lower threshold (min) and above the upper threshold (max)
are assigned the pixel value 0
*/
void ProcessSegmentation(IplImage* inputIplImage);
/*!
\brief Applies the ITK bilateral filter to the input image
See http://www.itk.org/Doxygen320/html/classitk_1_1BilateralImageFilter.html for more details.
*/
ItkImageType2D::Pointer ProcessItkBilateralFilter(ItkImageType2D::Pointer inputItkImage);
/*!
\brief Applies the OpenCV bilateral filter to the input image.
See http://opencv.willowgarage.com/documentation/c/image_filtering.html#smooth for more details
*/
void ProcessCVBilateralFilter(IplImage* inputIplImage, IplImage* outputIplImage);
/*!
\brief Applies the OpenCV median filter to the input image.
See http://opencv.willowgarage.com/documentation/c/image_filtering.html#smooth for more details
*/
void ProcessCVMedianFilter(IplImage* inputIplImage, IplImage* outputIplImage, int radius = 3);
/*!
\brief Performs temporal median filter on an image given the number of frames to be considered
*/
void ProcessStreamedQuickSelectMedianImageFilter(IplImage* inputIplImage);
/*!
\brief Quickselect algorithm
* This Quickselect routine is based on the algorithm described in
* "Numerical recipes in C", Second Edition,
* Cambridge University Press, 1992, Section 8.5, ISBN 0-521-43108-5
* This code by Nicolas Devillard - 1998. Public domain.
*/
float quick_select(float arr[], int n);
/*!
\brief Initialize and allocate a 2D ITK image of dimension m_ImageWidth*m_ImageHeight
*/
void CreateItkImage(ItkImageType2D::Pointer &itkInputImage);
mitk::Image::Pointer m_SegmentationMask; ///< mask image used for segmenting the image
int m_ImageWidth; ///< x-dimension of the image
int m_ImageHeight; ///< y-dimension of the image
int m_ImageSize; ///< size of the image in bytes
IplImage* m_IplDistanceImage; ///< OpenCV-representation of the distance image
IplImage* m_IplOutputImage; ///< OpenCV-representation of the output image
ItkImageType2D::Pointer m_ItkInputImage; ///< ITK representation of the distance image
bool m_ApplyTemporalMedianFilter; ///< Flag indicating if the temporal median filter is currently active for processing the distance image
bool m_ApplyAverageFilter; ///< Flag indicating if the average filter is currently active for processing the distance image
bool m_ApplyMedianFilter; ///< Flag indicating if the spatial median filter is currently active for processing the distance image
bool m_ApplyThresholdFilter; ///< Flag indicating if the threshold filter is currently active for processing the distance image
bool m_ApplyMaskSegmentation; ///< Flag indicating if a mask segmentation is performed
bool m_ApplyBilateralFilter; ///< Flag indicating if the bilateral filter is currently active for processing the distance image
float** m_DataBuffer; ///< Buffer used for calculating the pixel-wise median over the last n (m_TemporalMedianFilterNumOfFrames) number of frames
int m_DataBufferCurrentIndex; ///< Current index in the buffer of the temporal median filter
int m_DataBufferMaxSize; ///< Maximal size for the buffer of the temporal median filter (m_DataBuffer)
int m_TemporalMedianFilterNumOfFrames; ///< Number of frames to be used in the calculation of the temporal median
int m_ThresholdFilterMin; ///< Lower threshold of the threshold filter. Pixels with values below will be assigned value 0 when applying the threshold filter
int m_ThresholdFilterMax; ///< Lower threshold of the threshold filter. Pixels with values above will be assigned value 0 when applying the threshold filter
double m_BilateralFilterDomainSigma; ///< Parameter of the bilateral filter controlling the smoothing effect of the filter. Default value: 2
double m_BilateralFilterRangeSigma; ///< Parameter of the bilateral filter controlling the edge preserving effect of the filter. Default value: 60
int m_BilateralFilterKernelRadius; ///< Kernel radius of the bilateral filter mask
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFProcessing/mitkToFDistanceImageToPointSetFilter.h b/Modules/ToFProcessing/mitkToFDistanceImageToPointSetFilter.h
index d085344092..eef515cdd0 100644
--- a/Modules/ToFProcessing/mitkToFDistanceImageToPointSetFilter.h
+++ b/Modules/ToFProcessing/mitkToFDistanceImageToPointSetFilter.h
@@ -1,136 +1,135 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFDistanceImageToPointSetFilter_h
#define __mitkToFDistanceImageToPointSetFilter_h
#include <mitkCameraIntrinsics.h>
#include "mitkImage.h"
#include "mitkPointSet.h"
#include <mitkPointSetSource.h>
#include "mitkImageSource.h"
#include <mitkToFProcessingCommon.h>
#include <MitkToFProcessingExports.h>
namespace mitk
{
/**
* @brief Converts a Time-of-Flight (ToF) distance image to a PointSet using the pinhole camera model for coordinate computation.
* The intrinsic parameters of the camera (FocalLength, PrincipalPoint, InterPixelDistance) are set via SetIntrinsicParameters(). The
* measured distance for each pixel corresponds to the distance between the object point and the corresponding image point on the
* image plane.
* If a subset of indizes of the image is defined via SetSubset(), the output PointSet will only contain the cartesian coordinates
* of the corresponding 3D points.
*
* The coordinate conversion follows the model of a common pinhole camera where the origin of the camera
* coordinate system (world coordinates) is at the pinhole
* \image html ../Modules/ToFProcessing/Documentation/PinholeCameraModel.png
* The definition of the image plane and its coordinate systems (pixel and mm) is depicted in the following image
* \image html ../Modules/ToFProcessing/Documentation/ImagePlane.png
*
* @ingroup SurfaceFilters
* @ingroup ToFProcessing
*/
class MITKTOFPROCESSING_EXPORT ToFDistanceImageToPointSetFilter : public PointSetSource
{
public:
mitkClassMacro( ToFDistanceImageToPointSetFilter , PointSetSource );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
-
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
itkSetMacro(CameraIntrinsics,mitk::CameraIntrinsics::Pointer);
itkGetMacro(CameraIntrinsics,mitk::CameraIntrinsics::Pointer);
itkSetMacro(InterPixelDistance,mitk::ToFProcessingCommon::ToFPoint2D);
itkGetMacro(InterPixelDistance,mitk::ToFProcessingCommon::ToFPoint2D);
using itk::ProcessObject::SetInput;
/*!
\brief Sets the input of this filter
\param distanceImage input is the distance image of e.g. a ToF camera
*/
virtual void SetInput(const Image* distanceImage);
/*!
\brief Sets the input of this filter at idx
\param idx number of the current input
\param distanceImage input is the distance image of e.g. a ToF camera
*/
virtual void SetInput(unsigned int idx, const Image *distanceImage);
/*!
\brief Returns the input of this filter
*/
Image* GetInput();
/*!
\brief Returns the input with id idx of this filter
*/
Image* GetInput(unsigned int idx);
/*!
\brief If this subset is defined, the cartesian coordinates are only computed for the contained indizes. Make sure the indizes are contained in the input image
\param subset index subset specified in index coordinates.
*/
void SetSubset( std::vector<itk::Index<3> > subset);
/*!
\brief Sets the subset of indizes used for caluclation of output PointSet as a PointSet.
Warning: make sure the points in your PointSet are index coordinates.
\param PointSet specified in index coordinates.
*/
void SetSubset( mitk::PointSet::Pointer pointSet);
/*!
\brief Sets the reconstruction mode, if using no interpixeldistances and focal lenghts in pixel units (=true) or interpixeldistances and focal length in mm (=false)
*/
void SetReconstructionMode(bool withoutInterpixdist = true);
/*!
\brief Returns the reconstruction mode
*/
bool GetReconstructionMode();
protected:
/*!
\brief Standard constructor
*/
ToFDistanceImageToPointSetFilter();
/*!
\brief Standard destructor
*/
~ToFDistanceImageToPointSetFilter() override;
void GenerateOutputInformation() override;
/*!
\brief Method generating the output of this filter. Called in the updated process of the pipeline.
This method generates the output of the ToFSurfaceSource: The generated surface of the 3d points
*/
void GenerateData() override;
/**
* \brief Create an output for each input
*
* This Method sets the number of outputs to the number of inputs
* and creates missing outputs objects.
* \warning any additional outputs that exist before the method is called are deleted
*/
void CreateOutputsForAllInputs();
std::vector<itk::Index<3> > m_Subset; ///< If this subset is specified only the contained indizes are converted to cartesian coordinates
mitk::CameraIntrinsics::Pointer m_CameraIntrinsics; ///< Member holding the intrinsic parameters needed for PointSet calculation
ToFProcessingCommon::ToFPoint2D m_InterPixelDistance; ///< distance in mm between two adjacent pixels on the ToF camera chip
bool m_ReconstructionMode; ///< true = Reconstruction without interpixeldistance and with focal lengths in pixel units. false = Reconstruction with interpixeldistance and with focal length in mm.
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFProcessing/mitkToFDistanceImageToSurfaceFilter.h b/Modules/ToFProcessing/mitkToFDistanceImageToSurfaceFilter.h
index 2c8784fad7..f1cb4f8bb1 100644
--- a/Modules/ToFProcessing/mitkToFDistanceImageToSurfaceFilter.h
+++ b/Modules/ToFProcessing/mitkToFDistanceImageToSurfaceFilter.h
@@ -1,191 +1,189 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFDistanceImageToSurfaceFilter_h
#define __mitkToFDistanceImageToSurfaceFilter_h
#include <mitkImage.h>
#include <mitkSurfaceSource.h>
#include <MitkToFProcessingExports.h>
#include <mitkToFProcessingCommon.h>
#include <mitkCameraIntrinsics.h>
#include "mitkCameraIntrinsics.h"
#include <mitkPointSet.h>
#include <vtkSmartPointer.h>
#include <vtkIdList.h>
namespace mitk
{
/**
* @brief Converts a Time-of-Flight (ToF) distance image to a 3D surface using the pinhole camera model for coordinate computation.
* The intrinsic parameters of the camera (FocalLength, PrincipalPoint, InterPixelDistance) are set via SetCameraIntrinsics(). The
* measured distance for each pixel corresponds to the distance between the object point and the corresponding image point on the
* image plane.
*
* The coordinate conversion follows the model of a common pinhole camera where the origin of the camera
* coordinate system (world coordinates) is at the pinhole
* \image html ../Modules/ToFProcessing/Documentation/PinholeCameraModel.png
* The definition of the image plane and its coordinate systems (pixel and mm) is depicted in the following image
* \image html ../Modules/ToFProcessing/Documentation/ImagePlane.png
*
* @ingroup SurfaceFilters
* @ingroup ToFProcessing
*/
class MITKTOFPROCESSING_EXPORT ToFDistanceImageToSurfaceFilter : public SurfaceSource
{
public:
mitkClassMacro( ToFDistanceImageToSurfaceFilter , SurfaceSource );
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
-
-
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
itkSetMacro(CameraIntrinsics, mitk::CameraIntrinsics::Pointer);
itkGetMacro(CameraIntrinsics, mitk::CameraIntrinsics::Pointer);
itkSetMacro(InterPixelDistance,ToFProcessingCommon::ToFPoint2D);
itkGetMacro(InterPixelDistance,ToFProcessingCommon::ToFPoint2D);
itkSetMacro(TextureIndex,int);
/**
* @brief SetTriangulationThreshold Sets a triangulation threshold in order
* to remove unusually huge faces from the surface. If this value is set,
* the filter will check whether the distance between two neighboring vertices
* exceeds the triangulation threshold. If yes, there vertices will not be
* triangulated (connected with lines). The vertices will still be added to
* the surface, but only as single point (if they have no other neighbors).
* @param triangulationThreshold The triangulationThreshold in mm. (not mm*mm!)
* @note vtkMath::Distance2BetweenPoints returns the squared distance
* between two points and hence we square m_TriangulationThreshold in
* order to save run-time.
*/
void SetTriangulationThreshold( double triangulationThreshold );
itkGetMacro(TriangulationThreshold, double);
itkSetMacro(VertexIdList, vtkSmartPointer<vtkIdList>);
itkGetMacro(VertexIdList, vtkSmartPointer<vtkIdList>);
itkSetMacro(GenerateTriangularMesh,bool);
itkGetMacro(GenerateTriangularMesh,bool);
/**
* @brief The ReconstructionModeType enum: Defines the reconstruction mode, if using no interpixeldistances and focal lenghts in pixel units or interpixeldistances and focal length in mm. The Kinect option defines a special reconstruction mode for the kinect.
*/
enum ReconstructionModeType{ WithOutInterPixelDistance = 1, WithInterPixelDistance = 2, Kinect = 3};
itkSetEnumMacro(ReconstructionMode,ReconstructionModeType);
itkGetEnumMacro(ReconstructionMode,ReconstructionModeType);
/*!
\brief Set scalar image used as texture of the surface.
\param iplScalarImage OpenCV image for texturing
*/
void SetScalarImage(IplImage* iplScalarImage);
/*!
\brief Set scalar image used as texture of the surface.
\return OpenCV image for texturing
*/
IplImage* GetScalarImage();
/*!
\brief Set width of the scalar image used for texturing the surface
\param width width (x-dimension) of the texture image
*/
void SetTextureImageWidth(int width);
/*!
\brief Set height of the scalar image used for texturing the surface
\param height height (y-dimension) of the texture image
*/
void SetTextureImageHeight(int height);
using itk::ProcessObject::SetInput;
/*!
\brief Sets the input of this filter
\param distanceImage input is the distance image of e.g. a ToF camera
*/
virtual void SetInput( Image* distanceImage);
/*!
\brief Sets the input of this filter and the intrinsic parameters
\param distanceImage input is the distance image of e.g. a ToF camera
*/
virtual void SetInput( Image* distanceImage, mitk::CameraIntrinsics::Pointer cameraIntrinsics );
/*!
\brief Sets the input of this filter at idx
\param idx number of the current input
\param distanceImage input is the distance image of e.g. a ToF camera
*/
virtual void SetInput(unsigned int idx, Image* distanceImage);
/*!
\brief Sets the input of this filter at idx and the intrinsic parameters
\param idx number of the current input
\param distanceImage input is the distance image of e.g. a ToF camera
\param cameraIntrinsics This is the camera model which holds parameters like focal length, pixel size, etc. which are needed for the reconstruction of the surface.
*/
virtual void SetInput( unsigned int idx, Image* distanceImage, mitk::CameraIntrinsics::Pointer cameraIntrinsics );
/*!
\brief Returns the input of this filter
*/
Image* GetInput();
/*!
\brief Returns the input with id idx of this filter
*/
Image* GetInput(unsigned int idx);
protected:
/*!
\brief Standard constructor
*/
ToFDistanceImageToSurfaceFilter();
/*!
\brief Standard destructor
*/
~ToFDistanceImageToSurfaceFilter() override;
void GenerateOutputInformation() override;
/*!
\brief Method generating the output of this filter. Called in the updated process of the pipeline.
This method generates the output of the ToFSurfaceSource: The generated surface of the 3d points
*/
void GenerateData() override;
/**
* \brief Create an output for each input
*
* This Method sets the number of outputs to the number of inputs
* and creates missing outputs objects.
* \warning any additional outputs that exist before the method is called are deleted
*/
void CreateOutputsForAllInputs();
IplImage* m_IplScalarImage; ///< Scalar image used for surface texturing
mitk::CameraIntrinsics::Pointer m_CameraIntrinsics; ///< Specifies the intrinsic parameters
int m_TextureImageWidth; ///< Width (x-dimension) of the texture image
int m_TextureImageHeight; ///< Height (y-dimension) of the texture image
ToFProcessingCommon::ToFPoint2D m_InterPixelDistance; ///< distance in mm between two adjacent pixels on the ToF camera chip
int m_TextureIndex; ///< Index of the input used as texture image when no scalar image was set via SetIplScalarImage(). 0 = Distance, 1 = Amplitude, 2 = Intensity
bool m_GenerateTriangularMesh;
ReconstructionModeType m_ReconstructionMode; ///< The ReconstructionModeType enum: Defines the reconstruction mode, if using no interpixeldistances and focal lenghts in pixel units or interpixeldistances and focal length in mm. The Kinect option defines a special reconstruction mode for the kinect.
vtkSmartPointer<vtkIdList> m_VertexIdList; ///< Make a vtkIdList to save the ID's of the polyData corresponding to the image pixel ID's. This can be accessed after generate data to obtain the mapping.
double m_TriangulationThreshold;
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFProcessing/mitkToFImageDownsamplingFilter.h b/Modules/ToFProcessing/mitkToFImageDownsamplingFilter.h
index f10ee73649..48010ea256 100644
--- a/Modules/ToFProcessing/mitkToFImageDownsamplingFilter.h
+++ b/Modules/ToFProcessing/mitkToFImageDownsamplingFilter.h
@@ -1,82 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __mitkToFImageDownsamplingFilter_h
#define __mitkToFImageDownsamplingFilter_h
//MITK includes
#include <mitkImage.h>
#include "mitkImageToImageFilter.h"
#include <MitkToFProcessingExports.h>
// ITK includes
#include "itkImage.h"
namespace mitk
{
/**
* @brief Reduces the resolution of a ToF distance image. Although it is meant to be used for ToF distance images, it should work
* for any 2D or 3D images. The dimensions (in pixels) of the desired image are taken as input parameters, and an image with these
* specified dimensions is created.
*
* @ingroup SurfaceFilters
* @ingroup ToFProcessing
*/
class MITKTOFPROCESSING_EXPORT ToFImageDownsamplingFilter : public ImageToImageFilter
{
public:
mitkClassMacro(ToFImageDownsamplingFilter, ImageToImageFilter);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
-
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
itkSetMacro(ResampledX,double);
itkGetMacro(ResampledX,double);
itkSetMacro(ResampledY,double);
itkGetMacro(ResampledY,double);
itkSetMacro(ResampledZ,double);
itkGetMacro(ResampledZ,double);
protected:
/*!
\brief Standard constructor
*/
ToFImageDownsamplingFilter();
/*!
\brief Standard destructor
*/
~ToFImageDownsamplingFilter() override;
/*!
\brief Method generating the output of this filter. Called in the updated process of the pipeline.
This method calls the AccessFixedDimensionByItk class with the ItkImageResampling function below
*/
void GenerateData() override;
/*!
\brief Templated method for ITK image type which performs the resampling with an itk filter.
\param itkImage is the input to the filter converted to ITK format
\param TPixel is a pixel type such as float or char or double
\param VImageDimension is the image dimension (2D or 3D)
*/
template<typename TPixel, unsigned int VImageDimension>
void ItkImageResampling( const itk::Image<TPixel,VImageDimension>* itkImage );
double m_ResampledX;///< length of x dimension of output image in pixels
double m_ResampledY;///< length of y dimension of output image in pixels
double m_ResampledZ;///< length of z dimension of output image in pixels (if 2D, default is set to 1)
};
}// end namespace mitk
#endif
diff --git a/Modules/TubeGraph/include/mitkTubeGraphObjectFactory.h b/Modules/TubeGraph/include/mitkTubeGraphObjectFactory.h
index 1dec9d47c7..5bca4067c6 100644
--- a/Modules/TubeGraph/include/mitkTubeGraphObjectFactory.h
+++ b/Modules/TubeGraph/include/mitkTubeGraphObjectFactory.h
@@ -1,50 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef TubeGraphObjectFactory_H_INCLUDED
#define TubeGraphObjectFactory_H_INCLUDED
#include <MitkTubeGraphExports.h>
#include <mitkCoreObjectFactory.h>
namespace mitk
{
class MITKTUBEGRAPH_EXPORT TubeGraphObjectFactory : public CoreObjectFactoryBase
{
public:
mitkClassMacro(TubeGraphObjectFactory, CoreObjectFactoryBase);
- itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
void SetDefaultProperties(mitk::DataNode *node) override;
const char *GetFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap() override;
const char *GetSaveFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap() override;
void RegisterIOFactories();
protected:
TubeGraphObjectFactory();
private:
void CreateFileExtensionsMap();
std::string m_ExternalFileExtensions;
std::string m_InternalFileExtensions;
std::string m_SaveFileExtensions;
MultimapType m_FileExtensionsMap;
MultimapType m_SaveFileExtensionsMap;
};
}
#endif
diff --git a/Modules/TumorInvasionAnalysis/include/itkConnectednessFilter.h b/Modules/TumorInvasionAnalysis/include/itkConnectednessFilter.h
index 95c247e0c2..5858a70459 100644
--- a/Modules/TumorInvasionAnalysis/include/itkConnectednessFilter.h
+++ b/Modules/TumorInvasionAnalysis/include/itkConnectednessFilter.h
@@ -1,155 +1,153 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __itkConnectednessFilter_h
#define __itkConnectednessFilter_h
#include "itkImageRegionIterator.h"
#include "itkImageToImageFilter.h"
#include <itkDiffusionTensor3D.h>
namespace itk
{
/** ConnectednessFilter - Propagate the border voxels of seed region, also calculates distance maps
*
* Propagates the values of the boder-region of the seed mask. This is done by looking for the shortes path
* w.r.t. some distance metric that can be chosen.
*
* Options are
* FeatureSimilarity - shortest path is determined by looking at feature differences only
* VectorAgreement - cost is determined by path agreement with supplied vector field
* FeatureVectorAgreement - cost is a combination of vector agreement and feature similarity
*
*/
template <class TFeatureImage, class TSeedImage, typename TTensorImagePixelType = double>
class ConnectednessFilter : public ImageToImageFilter<TFeatureImage, TFeatureImage>
{
public:
/** Standard class typedefs. */
typedef ConnectednessFilter Self;
typedef ImageToImageFilter<TFeatureImage, TFeatureImage> Superclass;
typedef SmartPointer<Self> Pointer;
typedef typename itk::Image<itk::DiffusionTensor3D<TTensorImagePixelType>, 3> TTensorImage;
typedef typename TSeedImage::PixelType SeedPixelType;
typedef typename TFeatureImage::PixelType FeaturePixelType;
typedef typename TTensorImage::PixelType TensorPixelType;
typedef typename TFeatureImage::IndexType IndexType;
typedef typename TSeedImage::IndexType IndexSeedType;
typedef typename TTensorImage::IndexType IndexTensorType;
typedef typename itk::ImageRegionIterator<TSeedImage> SeedIteratorType;
typedef typename itk::ImageRegionIterator<TFeatureImage> FeatureIteratorType;
/** Method for creation through the object factory. */
- itkNewMacro(Self)
-
- /** Run-time type information (and related methods). */
- itkTypeMacro(PropagateLocalFeaturesFilter, ImageToImageFilter)
+ itkNewMacro(Self); /** Run-time type information (and related methods). */
+ itkTypeMacro(PropagateLocalFeaturesFilter, ImageToImageFilter);
/**
* @brief The DistanceMode enum Available distance metrics
*/
enum DistanceMode {
FeatureSimilarity,
VectorAgreement,
FeatureVectorAgreement
};
void SetInputImage(const TFeatureImage *image);
/**
* @brief SetInputSeed - seed area from which features are to be propagated
* @param mask
*/
void SetInputSeed(const TSeedImage *mask);
/**
* @brief SetInputMask - Filter only operates in masked area
* @param mask
*/
void SetInputMask(const TSeedImage *mask);
/**
* @brief SetInputVectorField
* @param vecs
*/
void SetInputVectorField(const TTensorImage *vecs);
/**
* @brief SetInputVectorFieldConfidenceMap - Map that assigned a weight/confidence to each vector
* @param conf
*/
void SetInputVectorFieldConfidenceMap(const TFeatureImage *conf);
/**
* @brief SetPropagationImage - OPTIONAL. Set image which values are propagated, it this is not supplied the
* InputImage is chosen as default.
* @param prop
*/
void SetPropagationImage(const TFeatureImage *prop);
/**
* @brief GetDistanceImage - Return the distance image using the specified metric
* @return
*/
typename TFeatureImage::Pointer GetDistanceImage();
/**
* @brief GetEuclideanDistanceImage - Return distance image that provides distance of shortest path for each voxel
* w.r.t to euclidean space
* @return
*/
typename TFeatureImage::Pointer GetEuclideanDistanceImage();
void SetMode(DistanceMode mode = FeatureSimilarity) { m_Mode = mode; }
/**
* @brief SetApplyRankFilter - if true the values propagated are determined by calculating the median within the
* mask within a 3x3x3 neighborhood
* @param applyFilter
*/
void SetApplyRankFilter(bool applyFilter) { m_ApplyRankFilter = applyFilter; }
protected:
ConnectednessFilter() { m_ApplyRankFilter = false; }
~ConnectednessFilter() {}
/** Does the real work. */
virtual void GenerateData();
virtual double GetDistanceValue(IndexType idxStart, IndexType idxEnd);
private:
ConnectednessFilter(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
typename TFeatureImage::Pointer m_InputImage;
typename TTensorImage::Pointer m_TensorImage;
typename TFeatureImage::Pointer m_ConfidenceImage;
// Distance image w.r.t. to metric
typename TFeatureImage::Pointer m_DistanceImage;
// Euclidean distance, that keeps track of distance of shortest path
typename TFeatureImage::Pointer m_EuclideanDistance;
DistanceMode m_Mode;
bool m_ApplyRankFilter;
};
} // namespace ITK
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkConnectednessFilter.cxx"
#endif
#endif // itkConnectednessFilter_h
diff --git a/Modules/US/USFilters/mitkUSImageVideoSource.h b/Modules/US/USFilters/mitkUSImageVideoSource.h
index 77e0fd2578..7dd330c0d4 100644
--- a/Modules/US/USFilters/mitkUSImageVideoSource.h
+++ b/Modules/US/USFilters/mitkUSImageVideoSource.h
@@ -1,217 +1,217 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKUSImageVideoSource_H_HEADER_INCLUDED_
#define MITKUSImageVideoSource_H_HEADER_INCLUDED_
// ITK
#include <itkProcessObject.h>
// MITK
#include "mitkUSImageSource.h"
#include "mitkConvertGrayscaleOpenCVImageFilter.h"
#include "mitkCropOpenCVImageFilter.h"
#include "mitkBasicCombinationOpenCVImageFilter.h"
// OpenCV
#include <opencv2/videoio.hpp>
namespace mitk {
/**
* \brief This class can be pointed to a video file or a videodevice and delivers USImages.
*
* Images are in color by default, but can be set to greyscale via SetColorOutput(false),
* which significantly improves performance.
*
* Images can also be cropped to a region of interest, further increasing performance.
*
* \ingroup US
*/
class MITKUS_EXPORT USImageVideoSource : public mitk::USImageSource
{
public:
mitkClassMacroItkParent(USImageVideoSource, itk::ProcessObject);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* \brief Defines a region of interest by top left and bottom right corner.
*/
struct USImageRoi
{
int topLeftX;
int topLeftY;
int bottomRightX;
int bottomRightY;
USImageRoi()
: topLeftX(0), topLeftY(0), bottomRightX(0), bottomRightY(0) { };
USImageRoi(unsigned int topLeftX, unsigned int topLeftY, unsigned int bottomRightX, unsigned int bottomRightY)
: topLeftX(topLeftX), topLeftY(topLeftY), bottomRightX(bottomRightX), bottomRightY(bottomRightY) { };
};
/**
* \brief Defines a region of interest by distances to the four image borders.
*/
struct USImageCropping
{
unsigned int top;
unsigned int bottom;
unsigned int left;
unsigned int right;
USImageCropping()
: top(0), bottom(0), left(0), right(0) { };
USImageCropping(unsigned int top, unsigned int bottom, unsigned int left, unsigned int right)
: top(top), bottom(bottom), left(left), right(right) { };
};
/**
* \brief Opens a video file for streaming. If nothing goes wrong, the
* VideoSource is ready to deliver images after calling this function.
*/
void SetVideoFileInput(std::string path);
/**
* \brief Opens a video device for streaming. Takes the Device id. Try -1 for "grab the first you can get"
* which works quite well if only one device is available. If nothing goes wrong, the
* VideoSource is ready to deliver images after calling this function.
*/
void SetCameraInput(int deviceID);
void ReleaseInput();
/**
* \brief Sets the output image to rgb or grayscale.
* Output is color by default
* and can be set to color by passing true, or to grayscale again by passing false.
*/
void SetColorOutput(bool isColor);
/**
* \brief Defines the cropping area.
* The rectangle will be justified to the image borders if the given
* rectangle is larger than the video source. If a correct rectangle is
* given, the dimensions of the output image will be equal to those of the
* rectangle.
*/
void SetRegionOfInterest(int topLeftX, int topLeftY, int bottomRightX, int bottomRightY);
/**
* \brief Defines the cropping area.
* The rectangle will be justified to the image borders if the given
* rectangle is larger than the video source. If a correct rectangle is
* given, the dimensions of the output image will be equal to those of the
* rectangle.
*
* \param regionOfInterest struct defining x and y coordinates of top left and bottom right corner
*/
void SetRegionOfInterest(USImageRoi regionOfInterest);
/**
* \brief Defines the cropping area.
* The rectangle will be justified to the image borders if the given
* rectangle is larger than the video source. If a correct rectangle is
* given, the dimensions of the output image will be equal to those of the
* rectangle.
*
* \param cropping struct defining distances to the four image borders
*/
void SetCropping(USImageCropping cropping);
/**
* /brief Removes the region of interest.
* Produced images will be uncropped after call of this method.
*/
void RemoveRegionOfInterest();
/**
* \brief This is a workaround for a problem that happens with some video device drivers.
*
* If you encounter OpenCV Warnings that buffer sizes do not match while calling getNextFrame,
* then do the following: Using the drivers control panel to force a certain resolution, then call
* this method with the same Dimensions after opening the device.
* Before retrieving images one should call mitk::USImageVideoSource::isReady().
*/
void OverrideResolution(int width, int height);
// Getter & Setter
itkGetMacro(IsVideoReady, bool);
itkGetMacro(ResolutionOverride, bool);
itkSetMacro(ResolutionOverride, bool);
itkGetMacro(IsGreyscale,bool);
itkGetMacro(ResolutionOverrideWidth,int);
itkGetMacro(ResolutionOverrideHeight,int);
int GetImageHeight();
int GetImageWidth();
USImageCropping GetCropping();
USImageRoi GetRegionOfInterest();
/**
* \brief Returns true if images can be delivered.
*
* Only if true is returned one can retrieve images via
* mitk::USImageVideoSource::GetNextImage().
* If false is returned, behaviour is undefined.
*/
bool GetIsReady();
protected:
USImageVideoSource();
~USImageVideoSource() override;
/**
* \brief Next image is gathered from the image source.
*
* \param[out] image an OpenCV-Matrix containing this image
*/
void GetNextRawImage( std::vector<cv::Mat>& image ) override;
/**
* \brief Next image is gathered from the image source.
*
* \param[out] image an mitk::Image containing this image
*/
void GetNextRawImage( std::vector<mitk::Image::Pointer>& image ) override;
/**
* \brief The source of the video, managed internally
*/
cv::VideoCapture* m_VideoCapture;
/**
* \brief If true, a frame can be grabbed anytime.
*/
bool m_IsVideoReady;
/**
* \brief If true, image output will be greyscale.
*/
bool m_IsGreyscale;
/**
* \brief If true, image will be cropped according to settings of crop filter.
*/
bool m_IsCropped;
/**
* These Variables determined whether Resolution Override is on, what dimensions to use.
*/
int m_ResolutionOverrideWidth;
int m_ResolutionOverrideHeight;
bool m_ResolutionOverride;
ConvertGrayscaleOpenCVImageFilter::Pointer m_GrayscaleFilter;
CropOpenCVImageFilter::Pointer m_CropFilter;
};
} // namespace mitk
#endif /* MITKUSImageVideoSource_H_HEADER_INCLUDED_ */
diff --git a/Modules/US/USHardwareTelemed/mitkUSTelemedImageSource.h b/Modules/US/USHardwareTelemed/mitkUSTelemedImageSource.h
index c911af2a69..c66ad171d5 100644
--- a/Modules/US/USHardwareTelemed/mitkUSTelemedImageSource.h
+++ b/Modules/US/USHardwareTelemed/mitkUSTelemedImageSource.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKUSTelemedImageSource_H_HEADER_INCLUDED_
#define MITKUSTelemedImageSource_H_HEADER_INCLUDED_
#include "mitkUSImageSource.h"
#include "mitkUSTelemedSDKHeader.h"
#include "mitkUSTelemedScanConverterPlugin.h"
#include "itkFastMutexLock.h"
namespace mitk {
/**
* \brief Implementation of mitk::USImageSource for Telemed API devices.
* The method mitk::USImageSource::GetNextRawImage() is implemented for
* getting images from the Telemed API.
*
* A method for connecting this ImageSource to the Telemed API is
* implemented (mitk::USTelemedImageSource::CreateAndConnectConverterPlugin()).
* This method is available for being used by mitk::USTelemedDevice.
*/
class USTelemedImageSource : public USImageSource
{
public:
mitkClassMacro(USTelemedImageSource, USImageSource);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* Implementation of the superclass method. Returns the pointer
* to the mitk::Image filled by Telemed API callback.
*/
virtual void GetNextRawImage( std::vector<mitk::Image::Pointer>& );
/**
* Updates the geometry of the current image from the API.
* Is used internally when a new image is initialized, but
* also needs to be called if, e.g., the zoom factor is changed.
*/
void UpdateImageGeometry();
/**
* \brief Connect this object to the Telemed API.
* This method is for being used by mitk::USTelemedDevice.
*/
bool CreateAndConnectConverterPlugin( Usgfw2Lib::IUsgDataView*, Usgfw2Lib::tagScanMode );
protected:
USTelemedImageSource( );
virtual ~USTelemedImageSource( );
Usgfw2Lib::IUsgScanConverterPlugin* m_Plugin;
USTelemedScanConverterPlugin* m_PluginCallback;
Usgfw2Lib::IUsgDataView* m_UsgDataView; // main SDK object for comminucating with the Telemed API
//API objects for communication, used to get the right geometry
Usgfw2Lib::IUsgImageProperties* m_ImageProperties;
Usgfw2Lib::IUsgDepth* m_DepthProperties;
long m_OldnXPelsPerUnit;
long m_OldnYPelsPerUnit;
mitk::Image::Pointer m_Image;
itk::FastMutexLock::Pointer m_ImageMutex;
};
} // namespace mitk
#endif // MITKUSTelemedImageSource_H
diff --git a/Modules/US/USModel/mitkUSDevice.h b/Modules/US/USModel/mitkUSDevice.h
index d653577336..720016b004 100644
--- a/Modules/US/USModel/mitkUSDevice.h
+++ b/Modules/US/USModel/mitkUSDevice.h
@@ -1,530 +1,531 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKUSDevice_H_HEADER_INCLUDED_
#define MITKUSDevice_H_HEADER_INCLUDED_
// STL
#include <vector>
// MitkUS
#include "mitkUSProbe.h"
#include <MitkUSExports.h>
#include "mitkUSImageSource.h"
// MitkIGTL
#include "mitkIGTLMessageProvider.h"
#include "mitkIGTLServer.h"
#include "mitkIGTLDeviceSource.h"
#include "mitkImageToIGTLMessageFilter.h"
// MITK
#include <mitkCommon.h>
#include <mitkMessage.h>
#include <mitkImageSource.h>
// ITK
#include <itkObjectFactory.h>
#include <itkConditionVariable.h>
// Microservices
#include <mitkServiceInterface.h>
#include <usServiceRegistration.h>
#include <usServiceProperties.h>
// DEPRECATED
#include "mitkUSImageMetadata.h"
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk {
class USAbstractControlInterface;
class USControlInterfaceBMode;
class USControlInterfaceProbes;
class USControlInterfaceDoppler;
/**
* \brief A device holds information about it's model, make and the connected probes. It is the
* common super class for all devices and acts as an image source for mitkUSImages. It is the base class
* for all US Devices, and every new device should extend it.
*
* US Devices support output of calibrated images, i.e. images that include a specific geometry.
* To achieve this, call SetCalibration, and make sure that the subclass also calls apply
* transformation at some point (The USDevice does not automatically apply the transformation to the image)
*
* Note that USDevices will be removed from micro servive when their
* destructor is called. Registering into micro service is done when
* mitk::USDevice::Initialize() is called.
*
* \ingroup US
*/
class MITKUS_EXPORT USDevice : public mitk::ImageSource
{
public:
enum DeviceStates { State_NoState, State_Initialized, State_Connected, State_Activated };
mitkClassMacro(USDevice, mitk::ImageSource);
itkSetMacro(SpawnAcquireThread, bool);
itkGetMacro(SpawnAcquireThread, bool);
struct USImageCropArea
{
int cropLeft;
int cropRight;
int cropBottom;
int cropTop;
};
/**
* \brief These constants are used in conjunction with Microservices.
* The constants aren't defined as static member attributes to avoid the
* "static initialization order fiasco", which would occur when objects of
* this class are used in module activators (for restoring stored device,
* for example).
*/
struct PropertyKeys
{
const std::string US_INTERFACE_NAME; // Common Interface name of all US Devices. Used to refer to this device via Microservices
const std::string US_PROPKEY_MANUFACTURER;
const std::string US_PROPKEY_NAME;
const std::string US_PROPKEY_COMMENT;
const std::string US_PROPKEY_LABEL; // Human readable text represntation of this device
const std::string US_PROPKEY_ISCONNECTED; // Whether this device is connected or not.
const std::string US_PROPKEY_ISACTIVE; // Whether this device is active or not.
const std::string US_PROPKEY_CLASS; // Class Name of this Object
const std::string US_PROPKEY_PROBES_SELECTED;
const std::string US_PROPKEY_BMODE_FREQUENCY;
const std::string US_PROPKEY_BMODE_POWER;
const std::string US_PROPKEY_BMODE_DEPTH;
const std::string US_PROPKEY_BMODE_GAIN;
const std::string US_PROPKEY_BMODE_REJECTION;
const std::string US_PROPKEY_BMODE_DYNAMIC_RANGE;
PropertyKeys()
: US_INTERFACE_NAME("org.mitk.services.UltrasoundDevice"),
US_PROPKEY_MANUFACTURER(US_INTERFACE_NAME + ".manufacturer"),
US_PROPKEY_NAME(US_INTERFACE_NAME + ".name"),
US_PROPKEY_COMMENT(US_INTERFACE_NAME + ".comment"),
US_PROPKEY_LABEL(US_INTERFACE_NAME + ".label"),
US_PROPKEY_ISCONNECTED(US_INTERFACE_NAME + ".isConnected"),
US_PROPKEY_ISACTIVE(US_INTERFACE_NAME + ".isActive"),
US_PROPKEY_CLASS(US_INTERFACE_NAME + ".class"),
US_PROPKEY_PROBES_SELECTED(US_INTERFACE_NAME + ".probes.selected"),
US_PROPKEY_BMODE_FREQUENCY(US_INTERFACE_NAME + ".bmode.frequency"),
US_PROPKEY_BMODE_POWER(US_INTERFACE_NAME + ".bmode.power"),
US_PROPKEY_BMODE_DEPTH(US_INTERFACE_NAME + ".bmode.depth"),
US_PROPKEY_BMODE_GAIN(US_INTERFACE_NAME + ".bmode.gain"),
US_PROPKEY_BMODE_REJECTION(US_INTERFACE_NAME + ".bmode.rejection"),
US_PROPKEY_BMODE_DYNAMIC_RANGE(US_INTERFACE_NAME + ".bmode.dynamicRange")
{}
};
/**
* \brief Event for being notified about changes of the micro service properties.
* This event can be used if no micro service context is available.
*/
- mitkNewMessage2Macro(PropertyChanged, const std::string&, const std::string&)
+ mitkNewMessage2Macro(PropertyChanged, const std::string&, const std::string&);
/**
* \return keys for the microservice properties of ultrasound devices
*/
static mitk::USDevice::PropertyKeys GetPropertyKeys();
/**
* \brief Default getter for the custom control interface.
* Has to be implemented in a subclass if a custom control interface is
* available. Default implementation returns null.
*
* \return null pointer
*/
virtual itk::SmartPointer<USAbstractControlInterface> GetControlInterfaceCustom();
/**
* \brief Default getter for the b mode control interface.
* Has to be implemented in a subclass if a b mode control interface is
* available. Default implementation returns null.
*
* \return null pointer
*/
virtual itk::SmartPointer<USControlInterfaceBMode> GetControlInterfaceBMode();
/**
* \brief Default getter for the probes control interface.
* Has to be implemented in a subclass if a probes control interface is
* available. Default implementation returns null.
*
* \return null pointer
*/
virtual itk::SmartPointer<USControlInterfaceProbes> GetControlInterfaceProbes();
/**
* \brief Default getter for the doppler control interface.
* Has to be implemented in a subclass if a doppler control interface is
* available. Default implementation returns null.
*
* \return null pointer
*/
virtual itk::SmartPointer<USControlInterfaceDoppler> GetControlInterfaceDoppler();
/**
* \brief Changes device state to mitk::USDevice::State_Initialized.
* During initialization the virtual method
* mitk::USDevice::OnInitialization will be called. If this method
* returns false the initialization process will be canceled. Otherwise
* the mitk::USDevice is registered in a micro service.
*/
bool Initialize();
/**
* \brief Connects this device. A connected device is ready to deliver images (i.e. be Activated). A Connected Device can be active. A disconnected Device cannot be active.
* Internally calls onConnect and then registers the device with the service. A device usually should
* override the OnConnection() method, but never the Connect() method, since this will possibly exclude the device
* from normal service management. The exact flow of events is:
* 0. Check if the device is already connected. If yes, return true anyway, but don't do anything.
* 1. Call OnConnection() Here, a device should establish it's connection with the hardware Afterwards, it should be ready to start transmitting images at any time.
* 2. If OnConnection() returns true ("successful"), then the device is registered with the service.
* 3. if not, it the method itself returns false or may throw an expection, depeneding on the device implementation.
*
*/
bool Connect();
void ConnectAsynchron();
/**
* \brief Works analogously to mitk::USDevice::Connect(). Don't override this Method, but onDisconnection instead.
*/
bool Disconnect();
/**
* \brief Activates this device.
* After the activation process, the device will start to produce images.
* This Method will fail, if the device is not connected.
*/
bool Activate();
/**
* \brief Deactivates this device.
* After the deactivation process, the device will no longer produce
* images, but still be connected.
*/
void Deactivate();
/**
* \brief Can toggle if ultrasound image is currently updated or freezed.
*
* \param freeze true to stop updating the ultrasound image, false to start updating again
*/
virtual void SetIsFreezed(bool freeze);
/**
* \return true if device is currently freezed (no image update is done), false otherwise
*/
virtual bool GetIsFreezed();
void PushFilter(AbstractOpenCVImageFilter::Pointer filter);
void PushFilterIfNotPushedBefore(AbstractOpenCVImageFilter::Pointer filter);
bool RemoveFilter(AbstractOpenCVImageFilter::Pointer filter);
/**
* @brief To be called when the used probe changed. Will update the service properties
* @param probename of the now used probe
*/
void ProbeChanged(std::string probename);
/**
* @brief To be called when the scanning depth of the probe changed. Will update the service properties
* @param depth that is now used
*/
void DepthChanged(double depth);
/**
* \brief Given property is updated in the device micro service.
* This method is mainly for being used by the control interface
* superclasses. You do not need to call it by yoursefs in your
* concrete control interface classes.
*/
void UpdateServiceProperty(std::string key, std::string value);
void UpdateServiceProperty(std::string key, double value);
void UpdateServiceProperty(std::string key, bool value);
//########### GETTER & SETTER ##################//
/**
* \brief Returns the Class of the Device. This Method must be reimplemented by every Inheriting Class.
*/
virtual std::string GetDeviceClass() = 0;
/**
* \brief True, if the device object is created and initialized, false otherwise.
*/
bool GetIsInitialized();
/**
* \brief True, if the device is currently generating image data, false otherwise.
*/
bool GetIsActive();
/**
* \brief True, if the device is currently ready to start transmitting image data or is already
* transmitting image data. A disconnected device cannot be activated.
*/
bool GetIsConnected();
/* @return Returns the area that will be cropped from the US image. Is disabled / [0,0,0,0] by default. */
mitk::USDevice::USImageCropArea GetCropArea();
/* @return Returns the size of the m_ImageVector of the ultrasound device.*/
unsigned int GetSizeOfImageVector();
/** @return Returns the current image source of this device. */
virtual USImageSource::Pointer GetUSImageSource() = 0;
/** \brief Deprecated -> use GetManufacturer() instead */
DEPRECATED(std::string GetDeviceManufacturer());
/** \brief Deprecated -> use GetName() instead */
DEPRECATED(std::string GetDeviceModel());
/** \brief Deprecated -> use GetCommend() instead */
DEPRECATED(std::string GetDeviceComment());
itkGetMacro(Manufacturer, std::string);
itkGetMacro(Name, std::string);
itkGetMacro(Comment, std::string);
void SetManufacturer(std::string manufacturer);
void SetName(std::string name);
void SetComment(std::string comment);
- itkGetMacro(DeviceState, DeviceStates)
- itkGetMacro(ServiceProperties, us::ServiceProperties)
+ itkGetMacro(DeviceState, DeviceStates);
+
+ itkGetMacro(ServiceProperties, us::ServiceProperties);
void GrabImage();
/**
* \brief Returns all probes for this device or an empty vector it no probes were set
* Returns a std::vector of all probes that exist for this device if there were probes set while creating or modifying this USVideoDevice.
* Otherwise it returns an empty vector. Therefore always check if vector is filled, before using it!
*/
virtual std::vector<mitk::USProbe::Pointer> GetAllProbes() = 0;
/**
* \brief Cleans the std::vector containing all configured probes.
*/
virtual void DeleteAllProbes() {};
/**
* \brief Return current active probe for this USDevice
* Returns a pointer to the probe that is currently in use. If there were probes set while creating or modifying this USDevice.
* Returns null otherwise
*/
virtual mitk::USProbe::Pointer GetCurrentProbe() = 0;
/**
\brief adds a new probe to the device
*/
virtual void AddNewProbe(mitk::USProbe::Pointer /*probe*/) {};
/**
* \brief get the probe by its name
* Returns a pointer to the probe identified by the given name. If no probe of given name exists for this Device 0 is returned.
*/
virtual mitk::USProbe::Pointer GetProbeByName(std::string name) = 0;
/**
* \brief Removes the Probe with the given name
*/
virtual void RemoveProbeByName(std::string /*name*/) {};
/**
* \brief Sets the first existing probe or the default probe of the ultrasound device
* as the current probe of it.
*/
virtual void SetDefaultProbeAsCurrentProbe() {};
/**
* \brief Sets the probe with the given name as current probe if the named probe exists.
*/
virtual void SetCurrentProbe(std::string /*probename*/) {};
virtual void SetSpacing(double xSpacing, double ySpacing);
protected:
// Threading-Related
itk::ConditionVariable::Pointer m_FreezeBarrier;
itk::SimpleMutexLock m_FreezeMutex;
itk::MultiThreader::Pointer m_MultiThreader; ///< itk::MultiThreader used for thread handling
itk::FastMutexLock::Pointer m_ImageMutex; ///< mutex for images provided by the image source
int m_ThreadID; ///< ID of the started thread
virtual void SetImageVector(std::vector<mitk::Image::Pointer> vec)
{
if (this->m_ImageVector != vec)
{
this->m_ImageVector = vec;
this->Modified();
}
}
static ITK_THREAD_RETURN_TYPE Acquire(void* pInfoStruct);
static ITK_THREAD_RETURN_TYPE ConnectThread(void* pInfoStruct);
std::vector<mitk::Image::Pointer> m_ImageVector;
// Variables to determine if spacing was calibrated and needs to be applied to the incoming images
mitk::Vector3D m_Spacing;
/**
* \brief Registers an OpenIGTLink device as a microservice so that we can send the images of
* this device via the network.
*/
void ProvideViaOIGTL();
/**
* \brief Deregisters the microservices for OpenIGTLink.
*/
void DisableOIGTL();
mitk::IGTLServer::Pointer m_IGTLServer;
mitk::IGTLMessageProvider::Pointer m_IGTLMessageProvider;
mitk::ImageToIGTLMessageFilter::Pointer m_ImageToIGTLMsgFilter;
bool m_IsFreezed;
DeviceStates m_DeviceState;
/* @brief defines the area that should be cropped from the US image */
USImageCropArea m_CropArea;
/**
* \brief This Method constructs the service properties which can later be used to
* register the object with the Microservices
* Return service properties
*/
us::ServiceProperties ConstructServiceProperties();
/**
* \brief Remove this device from the micro service.
*/
void UnregisterOnService();
/**
* \brief Is called during the initialization process.
* Override this method in a subclass to handle the actual initialization.
* If it returns false, the initialization process will be canceled.
*
* \return true if successful and false if unsuccessful
* \throw mitk::Exception implementation may throw an exception to clarify what went wrong
*/
virtual bool OnInitialization() = 0;
/**
* \brief Is called during the connection process.
* Override this method in a subclass to handle the actual connection.
* If it returns false, the connection process will be canceled.
*
* \return true if successful and false if unsuccessful
* \throw mitk::Exception implementation may throw an exception to clarify what went wrong
*/
virtual bool OnConnection() = 0;
/**
* \brief Is called during the disconnection process.
* Override this method in a subclass to handle the actual disconnection.
* If it returns false, the disconnection process will be canceled.
*
* \return true if successful and false if unsuccessful
* \throw mitk::Exception implementation may throw an exception to clarify what went wrong
*/
virtual bool OnDisconnection() = 0;
/**
* \brief Is called during the activation process.
* After this method is finished, the device should be generating images.
* If it returns false, the activation process will be canceled.
*
* \return true if successful and false if unsuccessful
* \throw mitk::Exception implementation may throw an exception to clarify what went wrong
*/
virtual bool OnActivation() = 0;
/**
* \brief Is called during the deactivation process.
* After a call to this method the device should still be connected,
* but not producing images anymore.
*
* \return true if successful and false if unsuccessful
* \throw mitk::Exception implementation may throw an exception to clarify what went wrong
*/
virtual bool OnDeactivation() = 0;
/**
* \brief Called when mitk::USDevice::SetIsFreezed() is called.
* Subclasses can overwrite this method to do additional actions. Default
* implementation does noting.
*/
virtual void OnFreeze(bool) { }
/**
* \brief Enforces minimal Metadata to be set.
*/
USDevice(std::string manufacturer, std::string model);
/**
* \brief Constructs a device with the given Metadata. Make sure the Metadata contains meaningful content!
* \deprecated Use USDevice(std::string manufacturer, std::string model) instead.
*/
USDevice(mitk::USImageMetadata::Pointer metadata);
~USDevice() override;
/**
* \brief Grabs the next frame from the Video input.
* This method is called internally, whenever Update() is invoked by an Output.
*/
void GenerateData() override;
std::string GetServicePropertyLabel();
unsigned int m_NumberOfOutputs;
/**
* \brief Properties of the device's Microservice.
*/
us::ServiceProperties m_ServiceProperties;
/**
* \brief The device's ServiceRegistration object that allows to modify it's Microservice registraton details.
*/
us::ServiceRegistration<Self> m_ServiceRegistration;
private:
std::string m_Manufacturer;
std::string m_Name;
std::string m_Comment;
bool m_SpawnAcquireThread;
bool m_UnregisteringStarted;
};
} // namespace mitk
// This is the microservice declaration. Do not meddle!
MITK_DECLARE_SERVICE_INTERFACE(mitk::USDevice, "org.mitk.services.UltrasoundDevice")
#endif // MITKUSDevice_H_HEADER_INCLUDED_
diff --git a/Modules/US/USModel/mitkUSDevicePersistence.h b/Modules/US/USModel/mitkUSDevicePersistence.h
index ebfedc14b2..9e55608583 100644
--- a/Modules/US/USModel/mitkUSDevicePersistence.h
+++ b/Modules/US/USModel/mitkUSDevicePersistence.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKUSDevicePersistence_H_HEADER_INCLUDED_
#define MITKUSDevicePersistence_H_HEADER_INCLUDED_
// MITK
#include <mitkCommon.h>
#include <mitkUSVideoDevice.h>
#include <mitkUSProbe.h>
// ITK
#include <itkObjectFactory.h>
// QT
#include <QSettings>
namespace mitk {
/**Documentation
* TODO
*/
class USDevicePersistence : public itk::Object
{
public:
mitkClassMacroItkParent(USDevicePersistence, itk::Object);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void StoreCurrentDevices();
std::vector<mitk::USDevice::Pointer> RestoreLastDevices();
protected:
USDevicePersistence();
~USDevicePersistence() override{}
QString USVideoDeviceToString(mitk::USVideoDevice::Pointer d);
mitk::USVideoDevice::Pointer StringToUSVideoDevice(QString s);
QString USProbeToString(mitk::USProbe::Pointer p);
mitk::USProbe::Pointer StringToUSProbe(std::string s);
QSettings m_devices;
void split(std::string& text, std::string& separators, std::vector<std::string>& words);
double spacingToDouble(std::string s);
int depthToInt(std::string s);
};
} // namespace mitk
#endif
diff --git a/Modules/US/USModel/mitkUSImage.h b/Modules/US/USModel/mitkUSImage.h
index 89b40dae1d..16a783f19c 100644
--- a/Modules/US/USModel/mitkUSImage.h
+++ b/Modules/US/USModel/mitkUSImage.h
@@ -1,70 +1,70 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKUSIMAGE_H_HEADER_INCLUDED_
#define MITKUSIMAGE_H_HEADER_INCLUDED_
#include <MitkUSExports.h>
#include <mitkCommon.h>
#include <mitkImage.h>
#include "mitkUSImageMetadata.h"
namespace mitk {
/**DocumentationZ
* \brief This specialization of mitk::Image only appends necessary Metadata to an MITK image. Otherwise it can safely be treated like it's mother class.
* To generate an USImage from a standard mitkImage, call the appropriate constructor USImage(image::Pointer)
* \ingroup US
*
* \deprecated Deprecated since 2014-06 -> use mitk::Image instead
*/
class MITKUS_EXPORT USImage : public mitk::Image
{
public:
mitkClassMacro(USImage, mitk::Image);
- itkFactorylessNewMacro(Self)
+ itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
/**
* \brief this constructor creates an US Image identical to the recieved mitkImage. The Metadata are set to default.
* The image data is shared, so don't continue to manipulate the original image.
* @throw mitk::Exception Throws an exception if there is a problem with access to the data while constructing the image.
*/
mitkNewMacro1Param(Self, mitk::Image::Pointer);
/**
* \brief Reads out this image's Metadata set from the properties and returns a corresponding USImageMetadata object.
*/
mitk::USImageMetadata::Pointer GetMetadata() const;
/**
* \brief Writes the information of the metadata object into the image's properties.
*/
void SetMetadata(mitk::USImageMetadata::Pointer metadata);
protected:
/**
* \brief This constructor creates an empty USImage. The Metadata are set to default.
*/
USImage();
/**
* \brief this constructor creates an US Image identical to the recieved mitkImage. The Metadata are set to default.
* The image data is shared, so don't continue to manipulate the original image.
*/
USImage(mitk::Image::Pointer image);
~USImage() override;
};
} // namespace mitk
#endif
diff --git a/Modules/US/USModel/mitkUSImageMetadata.h b/Modules/US/USModel/mitkUSImageMetadata.h
index e2bf2800f1..d92d35bf90 100644
--- a/Modules/US/USModel/mitkUSImageMetadata.h
+++ b/Modules/US/USModel/mitkUSImageMetadata.h
@@ -1,86 +1,86 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKUSIMAGEMETADATA_H_HEADER_INCLUDED_
#define MITKUSIMAGEMETADATA_H_HEADER_INCLUDED_
#include <MitkUSExports.h>
#include <mitkCommon.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
namespace mitk {
/**Documentation
* \brief This class encapsulates all necessary metadata to describe a US Image.
* \ingroup US
*
* \deprecated Deprecated since 2014-06
*/
class MITKUS_EXPORT USImageMetadata : public itk::Object
{
public:
mitkClassMacroItkParent(USImageMetadata, itk::Object);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
//## getter and setter ##
itkGetMacro(DeviceManufacturer, std::string);
itkSetMacro(DeviceManufacturer, std::string);
itkGetMacro(DeviceModel, std::string);
itkSetMacro(DeviceModel, std::string);
itkGetMacro(DeviceComment, std::string);
itkSetMacro(DeviceComment, std::string);
itkGetMacro(ProbeName, std::string);
itkSetMacro(ProbeName, std::string);
itkGetMacro(ProbeFrequency, std::string);
itkSetMacro(ProbeFrequency, std::string);
itkGetMacro(Zoom, std::string);
itkSetMacro(Zoom, std::string);
itkGetMacro(DeviceIsVideoOnly, bool);
itkSetMacro(DeviceIsVideoOnly, bool);
itkGetMacro(DeviceIsCalibrated, bool);
itkSetMacro(DeviceIsCalibrated, bool);
itkGetMacro(DeviceClass, std::string);
itkSetMacro(DeviceClass, std::string);
// The following constants define how metadata is written to and read from an mitk image
// when defining new properties, add them here, define them in the cpp, and add them to
// USImage's getMetadata and setMetadata methods as well
static const char* PROP_DEV_MANUFACTURER;
static const char* PROP_DEV_MODEL;
static const char* PROP_DEV_COMMENT;
static const char* PROP_DEV_ISVIDEOONLY;
static const char* PROP_DEV_ISCALIBRATED;
static const char* PROP_PROBE_NAME;
static const char* PROP_PROBE_FREQUENCY;
static const char* PROP_ZOOM;
static const char* PROP_DEVICE_CLASS;
protected:
/**
* \brief Creates a new metadata object with all fields set to default values.
*/
USImageMetadata();
~USImageMetadata() override;
std::string m_DeviceManufacturer;
std::string m_DeviceModel;
std::string m_DeviceComment;
std::string m_ProbeName;
std::string m_ProbeFrequency;
std::string m_Zoom;
std::string m_DeviceClass;
bool m_DeviceIsVideoOnly;
bool m_DeviceIsCalibrated;
};
} // namespace mitk
#endif
diff --git a/Modules/US/USModel/mitkUSProbe.h b/Modules/US/USModel/mitkUSProbe.h
index abf75bc756..9b482d0831 100644
--- a/Modules/US/USModel/mitkUSProbe.h
+++ b/Modules/US/USModel/mitkUSProbe.h
@@ -1,126 +1,126 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKUSProbe_H_HEADER_INCLUDED_
#define MITKUSProbe_H_HEADER_INCLUDED_
#include <MitkUSExports.h>
#include <mitkCommon.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <mitkVector.h>
namespace mitk {
/**Documentation
* \brief Right now, the US Probe is only a fancy name for a string. Later, it could handle probe specific parameters
* like the current frequency etc. It is able to compare itself to other probes for device managment though.
*
* \ingroup US
*/
//Be sure to check the isEqualTo() method if you expand this class to see if it needs work!
class MITKUS_EXPORT USProbe : public itk::Object
{
public:
mitkClassMacroItkParent(USProbe, itk::Object);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self)
mitkNewMacro1Param(Self, std::string);
/**
* \brief Struct to define a probe specific ultrasound image cropping.
*/
typedef struct USProbeCropping_
{
unsigned int top;
unsigned int bottom;
unsigned int left;
unsigned int right;
USProbeCropping_()
: top(0), bottom(0), left(0), right(0) { };
USProbeCropping_(unsigned int top, unsigned int bottom, unsigned int left, unsigned int right)
: top(top), bottom(bottom), left(left), right(right) { };
}USProbeCropping;
/**
* \brief Sets the probe cropping.
*/
void SetProbeCropping(unsigned int top, unsigned int bottom, unsigned int left, unsigned int right);
USProbeCropping GetProbeCropping();
/**
* \brief Compares this probe to another probe and returns true if they are equal in terms of name AND NAME ONLY
* be sure to sufficiently extend this method along with further capabilities probes.
*/
bool IsEqualToProbe(mitk::USProbe::Pointer probe);
/**
* \brief Sets a scanning depth of the probe and the associated spacing
*/
void SetDepthAndSpacing(int depth, Vector3D spacing);
/**
* \brief Gets all scanning depths and the associates spacings of the probe as an std::map with depth as key (represented by an int) and
*spacing as value (represented by a Vector3D)
*/
std::map<int, Vector3D> GetDepthsAndSpacing();
/**
* \brief Sets a scanning depth of the probe with the default spacing (1,1,1). Exact spacing needs to be calibrated.
*/
void SetDepth(int depth);
/**
* \brief Removes the given depth of the probe, if it exists
*/
void RemoveDepth(int depthToRemove);
/**
* \ brief Sets the spacing associated to the given depth of the probe. Spacing needs to be calibrated.
*/
void SetSpacingForGivenDepth(int givenDepth, Vector3D spacing);
/**
* \brief Returns the spacing that is associated to the given depth of the probe.
*If spacing was not calibrated or if depth does not exist for this probe the default spacing (1,1,1) is returned.
*/
Vector3D GetSpacingForGivenDepth(int givenDepth);
/**
* \brief Checks, whether the std::map m_DepthAndSpacings contains at least one depth element or not.
* \return True, if the the std::map m_DepthAndSpacings does not contain at least one depth element, else false.
*/
bool IsDepthAndSpacingEmpty();
//## getter and setter ##
itkGetMacro(Name, std::string);
itkSetMacro(Name, std::string);
itkGetMacro(CurrentDepth, double);
itkSetMacro(CurrentDepth, double);
protected:
USProbe();
USProbe(std::string identifier);
~USProbe() override;
std::string m_Name;
double m_CurrentDepth;
// Map containing the depths and the associated spacings as an std::vector with depth as key and spacing as value
std::map<int, Vector3D> m_DepthsAndSpacings;
USProbeCropping m_Cropping;
};
} // namespace mitk
#endif
diff --git a/Modules/XNAT/files.cmake b/Modules/XNAT/files.cmake
index c7bac427c8..99014ede7f 100644
--- a/Modules/XNAT/files.cmake
+++ b/Modules/XNAT/files.cmake
@@ -1,38 +1,37 @@
file(GLOB_RECURSE H_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/include/*")
set(CPP_FILES
mitkXnatSessionTracker.cpp
QmitkXnatTreeModel.cpp
QmitkXnatProjectWidget.cpp
QmitkXnatSubjectWidget.cpp
QmitkXnatExperimentWidget.cpp
QmitkXnatCreateObjectDialog.cpp
QmitkSelectXnatUploadDestinationDialog.cpp
QmitkXnatUploadFromDataStorageDialog.cpp
QmitkHttpStatusCodeHandler.cpp
)
set(MOC_H_FILES
include/mitkXnatSessionTracker.h
include/QmitkXnatTreeModel.h
include/QmitkXnatProjectWidget.h
include/QmitkXnatSubjectWidget.h
include/QmitkXnatExperimentWidget.h
include/QmitkXnatCreateObjectDialog.h
include/QmitkSelectXnatUploadDestinationDialog.h
include/QmitkXnatUploadFromDataStorageDialog.h
- include/QmitkHttpStatusCodeHandler.h
)
set(QRC_FILES
resources/xnat.qrc
)
set(UI_FILES
src/QmitkXnatExperimentWidgetControls.ui
src/QmitkXnatProjectWidgetControls.ui
src/QmitkSelectXnatUploadDestinationDialog.ui
src/QmitkXnatSubjectWidgetControls.ui
src/QmitkXnatUploadFromDataStorageDialog.ui
)
diff --git a/Plugins/org.blueberry.core.commands/src/berryAbstractHandler.h b/Plugins/org.blueberry.core.commands/src/berryAbstractHandler.h
index 789d7df471..daab470ee7 100644
--- a/Plugins/org.blueberry.core.commands/src/berryAbstractHandler.h
+++ b/Plugins/org.blueberry.core.commands/src/berryAbstractHandler.h
@@ -1,159 +1,159 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYABSTRACTHANDLER_H_
#define BERRYABSTRACTHANDLER_H_
#include "berryIHandler.h"
#include "berryIHandlerListener.h"
#include <org_blueberry_core_commands_Export.h>
namespace berry {
/**
* <p>
* This class is a partial implementation of <code>IHandler</code>. This
* abstract implementation provides support for handler listeners. You should
* subclass from this class unless you want to implement your own listener
* support. Subclasses should call
* {@link AbstractHandler#fireHandlerChanged(HandlerEvent)}when the handler
* changes. Subclasses can also override {@link AbstractHandler#isEnabled()} and
* {@link AbstractHandler#isHandled()}.
* </p>
*/
class BERRY_COMMANDS AbstractHandler : public QObject, public IHandler { // ,public EventManager {
Q_OBJECT
Q_INTERFACES(berry::IHandler)
public:
- berryObjectMacro(AbstractHandler)
+ berryObjectMacro(AbstractHandler);
private:
/**
* Track this base class enabled state.
*/
bool baseEnabled;
IHandlerListener::Events handlerListeners;
public:
AbstractHandler();
/**
* @see IHandler#addHandlerListener(IHandlerListener)
*/
void AddHandlerListener(IHandlerListener* handlerListener) override;
/**
* The default implementation does nothing. Subclasses who attach listeners
* to other objects are encouraged to detach them in this method.
*
* @see IHandler#Dispose()
*/
void Dispose() override;
/**
* Whether this handler is capable of executing at this time. Subclasses may
* override this method. If clients override this method they should also
* consider overriding {@link #setEnabled(Object)} so they can be notified
* about framework execution contexts.
*
* @return <code>true</code>
* @see #setEnabled(Object)
* @see #setBaseEnabled(boolean)
*/
bool IsEnabled() const override;
/**
* Called by the framework to allow the handler to update its enabled state
* by extracting the same information available at execution time. Clients
* may override if they need to extract information from the application
* context.
*
* @param evaluationContext
* the application context. May be <code>null</code>
* @see #SetBaseEnabled(bool)
*/
void SetEnabled(const Object::Pointer& evaluationContext) override;
/**
* Whether this handler is capable of handling delegated responsibilities at
* this time. Subclasses may override this method.
*
* @return <code>true</code>
*/
bool IsHandled() const override;
/**
* @see IHandler#removeHandlerListener(IHandlerListener)
*/
void RemoveHandlerListener(IHandlerListener* handlerListener) override;
protected:
/**
* Fires an event to all registered listeners describing changes to this
* instance.
* <p>
* Subclasses may extend the definition of this method (i.e., if a different
* type of listener can be attached to a subclass). This is used primarily
* for support of <code>AbstractHandler</code> in
* <code>org.blueberry.ui.workbench</code>, and clients should be wary of
* overriding this behaviour. If this method is overridden, then the first
* line of the method should be "<code>super.fireHandlerChanged(handlerEvent);</code>".
* </p>
*
* @param handlerEvent
* the event describing changes to this instance. Must not be
* <code>null</code>.
*/
void FireHandlerChanged(const SmartPointer<HandlerEvent>& handlerEvent);
/**
* Allow the default {@link #isEnabled()} to answer our enabled state. It
* will fire a HandlerEvent if necessary. If clients use this method they
* should also consider overriding {@link #setEnabled(Object)} so they can
* be notified about framework execution contexts.
*
* @param state
* the enabled state
*/
void SetBaseEnabled(bool state);
/**
* <p>
* Returns true iff there is one or more IHandlerListeners attached to this
* AbstractHandler.
* </p>
* <p>
* Subclasses may extend the definition of this method (i.e., if a different
* type of listener can be attached to a subclass). This is used primarily
* for support of <code>AbstractHandler</code> in
* <code>org.blueberry.ui.qt</code>, and clients should be wary of
* overriding this behaviour. If this method is overridden, then the return
* value should include "<code>super.hasListeners() ||</code>".
* </p>
*
* @return true iff there is one or more IHandlerListeners attached to this
* AbstractHandler
*/
virtual bool HasListeners() const;
};
}
#endif /*BERRYABSTRACTHANDLER_H_*/
diff --git a/Plugins/org.blueberry.core.commands/src/berryAbstractHandlerWithState.h b/Plugins/org.blueberry.core.commands/src/berryAbstractHandlerWithState.h
index 50528e600e..3373290c8b 100644
--- a/Plugins/org.blueberry.core.commands/src/berryAbstractHandlerWithState.h
+++ b/Plugins/org.blueberry.core.commands/src/berryAbstractHandlerWithState.h
@@ -1,97 +1,97 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYABSTRACTHANDLERWITHSTATE_H
#define BERRYABSTRACTHANDLERWITHSTATE_H
#include "berryAbstractHandler.h"
#include "berryIObjectWithState.h"
#include "berryIStateListener.h"
#include <org_blueberry_core_commands_Export.h>
namespace berry {
class State;
/**
* <p>
* An abstract implementation of {@link IObjectWithState}. This provides basic
* handling for adding and remove state. When state is added, the handler
* attaches itself as a listener and fire a handleStateChange event to notify
* this handler. When state is removed, the handler removes itself as a
* listener.
* </p>
* <p>
* Clients may extend this class.
* </p>
*/
class BERRY_COMMANDS AbstractHandlerWithState : public AbstractHandler, public IObjectWithState,
protected IStateListener
{
private:
/**
* The map of states currently held by this handler. If this handler has no
* state (generally, when inactive), then this will be <code>null</code>.
*/
QHash<QString,SmartPointer<State> > states;
public:
- berryObjectMacro(berry::AbstractHandlerWithState)
+ berryObjectMacro(berry::AbstractHandlerWithState);
/**
* <p>
* Adds a state to this handler. This will add this handler as a listener to
* the state, and then fire a handleStateChange so that the handler can
* respond to the incoming state.
* </p>
* <p>
* Clients may extend this method, but they should call this super method
* first before doing anything else.
* </p>
*
* @param stateId
* The identifier indicating the type of state being added; must
* not be <code>null</code>.
* @param state
* The state to add; must not be <code>null</code>.
*/
void AddState(const QString& stateId, const SmartPointer<State>& state) override;
SmartPointer<State> GetState(const QString& stateId) const override;
QList<QString> GetStateIds() const override;
/**
* <p>
* Removes a state from this handler. This will remove this handler as a
* listener to the state. No event is fired to notify the handler of this
* change.
* </p>
* <p>
* Clients may extend this method, but they should call this super method
* first before doing anything else.
* </p>
*
* @param stateId
* The identifier of the state to remove; must not be
* <code>null</code>.
*/
void RemoveState(const QString& stateId) override;
};
}
#endif // BERRYABSTRACTHANDLERWITHSTATE_H
diff --git a/Plugins/org.blueberry.core.commands/src/berryIHandler.h b/Plugins/org.blueberry.core.commands/src/berryIHandler.h
index 3ca64f1dc4..921ad75ffa 100644
--- a/Plugins/org.blueberry.core.commands/src/berryIHandler.h
+++ b/Plugins/org.blueberry.core.commands/src/berryIHandler.h
@@ -1,122 +1,122 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIHANDLER_H_
#define BERRYIHANDLER_H_
#include <berryMacros.h>
#include <berryObject.h>
#include <org_blueberry_core_commands_Export.h>
namespace berry {
struct IHandlerListener;
class ExecutionEvent;
/**
* A handler is the pluggable piece of a command that handles execution. Each
* command can have zero or more handlers associated with it (in general), of
* which only one will be active at any given moment in time. When the command
* is asked to execute, it will simply pass that request on to its active
* handler, if any.
*
* @see AbstractHandler
*/
struct BERRY_COMMANDS IHandler : public virtual Object
{
- berryObjectMacro(berry::IHandler)
+ berryObjectMacro(berry::IHandler);
/**
* Registers an instance of <code>IHandlerListener</code> to listen for
* changes to properties of this instance.
*
* @param handlerListener
* the instance to register. Must not be <code>null</code>. If
* an attempt is made to register an instance which is already
* registered with this instance, no operation is performed.
*/
virtual void AddHandlerListener(IHandlerListener* handlerListener) = 0;
/**
* Disposes of this handler. This method is run once when the object is no
* longer referenced. This can be used as an opportunity to unhook listeners
* from other objects.
*/
virtual void Dispose() = 0;
/**
* Executes with the map of parameter values by name.
*
* @param event
* An event containing all the information about the current
* state of the application; must not be <code>null</code>.
* @return the result of the execution. Reserved for future use, must be
* <code>null</code>.
* @throws ExecutionException
* if an exception occurred during execution.
*/
virtual Object::Pointer Execute(const SmartPointer<const ExecutionEvent>& event) = 0;
/**
* Called by the framework to allow the handler to update its enabled state.
*
* @param evaluationContext
* the state to evaluate against. May be <code>null</code>
* which indicates that the handler can query whatever model that
* is necessary. This context must not be cached.
*/
virtual void SetEnabled(const Object::Pointer& evaluationContext) = 0;
/**
* Returns whether this handler is capable of executing at this moment in
* time. If the enabled state is other than true clients should also
* consider implementing IHandler2 so they can be notified about framework
* execution contexts.
*
* @return <code>true</code> if the command is enabled; <code>false</code>
* otherwise.
* @see IHandler2#setEnabled(Object)
*/
virtual bool IsEnabled() const = 0;
/**
* Returns whether this handler is really capable of handling delegation. In
* the case of a handler that is a composition of other handlers, this reply
* is intended to indicate whether the handler is truly capable of receiving
* delegated responsibilities at this time.
*
* @return <code>true</code> if the handler is handled; <code>false</code>
* otherwise.
*/
virtual bool IsHandled() const = 0;
/**
* Unregisters an instance of <code>IHandlerListener</code> listening for
* changes to properties of this instance.
*
* @param handlerListener
* the instance to unregister. Must not be <code>null</code>.
* If an attempt is made to unregister an instance which is not
* already registered with this instance, no operation is
* performed.
*/
virtual void RemoveHandlerListener(IHandlerListener* handlerListener) = 0;
};
}
Q_DECLARE_INTERFACE(berry::IHandler, "org.blueberry.core.commands.IHandler")
#endif /*BERRYIHANDLER_H_*/
diff --git a/Plugins/org.blueberry.core.commands/src/berryIObjectWithState.h b/Plugins/org.blueberry.core.commands/src/berryIObjectWithState.h
index 0c242f62f7..fd0c7b9853 100644
--- a/Plugins/org.blueberry.core.commands/src/berryIObjectWithState.h
+++ b/Plugins/org.blueberry.core.commands/src/berryIObjectWithState.h
@@ -1,83 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIOBJECTWITHSTATE_H_
#define BERRYIOBJECTWITHSTATE_H_
#include "berryObject.h"
#include <org_blueberry_core_commands_Export.h>
namespace berry {
class State;
/**
* <p>
* An object that holds zero or more state objects. This state information can
* be shared between different instances of <code>IObjectWithState</code>.
* </p>
* <p>
* Clients may implement, but must not extend this interface.
* </p>
*
* @see AbstractHandlerWithState
*/
struct BERRY_COMMANDS IObjectWithState : public virtual Object
{
- berryObjectMacro(berry::IObjectWithState)
+ berryObjectMacro(berry::IObjectWithState);
/**
* Adds state to this object.
*
* @param id
* The identifier indicating the type of state being added; must
* not be <code>null</code>.
* @param state
* The new state to add to this object; must not be
* <code>null</code>.
*/
virtual void AddState(const QString& id, const SmartPointer<State>& state) = 0;
/**
* Gets the state with the given id.
*
* @param stateId
* The identifier of the state to retrieve; must not be
* <code>null</code>.
* @return The state; may be <code>null</code> if there is no state with
* the given id.
*/
virtual SmartPointer<State> GetState(const QString& stateId) const = 0;
/**
* Gets the identifiers for all of the state associated with this object.
*
* @return All of the state identifiers; may be empty, but never
* <code>null</code>.
*/
virtual QList<QString> GetStateIds() const = 0;
/**
* Removes state from this object.
*
* @param stateId
* The id of the state to remove from this object; must not be
* <code>null</code>.
*/
virtual void RemoveState(const QString& stateId) = 0;
};
}
#endif /*BERRYIOBJECTWITHSTATE_H_*/
diff --git a/Plugins/org.blueberry.core.commands/src/berryIParameter.h b/Plugins/org.blueberry.core.commands/src/berryIParameter.h
index bbf3f757bc..d51861f15c 100644
--- a/Plugins/org.blueberry.core.commands/src/berryIParameter.h
+++ b/Plugins/org.blueberry.core.commands/src/berryIParameter.h
@@ -1,75 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIPARAMETER_H_
#define BERRYIPARAMETER_H_
#include <berryObject.h>
#include <berryMacros.h>
#include <org_blueberry_core_commands_Export.h>
namespace berry {
struct IParameterValues;
/**
* <p>
* A parameter for a command. A parameter identifies a type of information that
* the command might accept. For example, a "Show View" command might accept the
* id of a view for display. This parameter also identifies possible values, for
* display in the user interface.
* </p>
*/
struct BERRY_COMMANDS IParameter : public virtual Object
{
- berryObjectMacro(berry::IParameter)
+ berryObjectMacro(berry::IParameter);
typedef QHash<QString, QString> ParameterValues;
/**
* Returns the identifier for this parameter.
*
* @return The identifier; never <code>null</code>.
*/
virtual QString GetId() const = 0;
/**
* Returns the human-readable name for this parameter.
*
* @return The parameter name; never <code>null</code>.
*/
virtual QString GetName() const = 0;
/**
* Returns the values associated with this parameter.
*
* @return The values associated with this parameter. This must not be
* <code>null</code>.
* @throws ParameterValuesException
* If the values can't be retrieved for some reason.
*/
virtual IParameterValues* GetValues() const = 0;
/**
* Returns whether parameter is optional. Otherwise, it is required.
*
* @return <code>true</code> if the parameter is optional;
* <code>false</code> if it is required.
*/
virtual bool IsOptional() const = 0;
};
}
#endif /*BERRYIPARAMETER_H_*/
diff --git a/Plugins/org.blueberry.core.commands/src/berryITypedParameter.h b/Plugins/org.blueberry.core.commands/src/berryITypedParameter.h
index fc0a18d90d..d7d67fb442 100755
--- a/Plugins/org.blueberry.core.commands/src/berryITypedParameter.h
+++ b/Plugins/org.blueberry.core.commands/src/berryITypedParameter.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYITYPEDPARAMETER_H_
#define BERRYITYPEDPARAMETER_H_
#include <berryObject.h>
#include <berryMacros.h>
#include <org_blueberry_core_commands_Export.h>
namespace berry {
class ParameterType;
/**
* A command parameter that has a declared type. This interface is intended to
* be implemented by implementors of {@link IParameter} that will support
* parameter types.
*
*/
struct BERRY_COMMANDS ITypedParameter : public virtual Object {
- berryObjectMacro(berry::ITypedParameter)
+ berryObjectMacro(berry::ITypedParameter);
/**
* Returns the {@link ParameterType} associated with a command parameter or
* <code>null</code> if the parameter does not declare a type.
* <p>
* Note that the parameter type returned may be undefined.
* </p>
*
* @return the parameter type associated with a command parameter or
* <code>null</code> if the parameter does not declare a type
*/
virtual SmartPointer<ParameterType> GetParameterType() const = 0;
};
}
#endif /* BERRYITYPEDPARAMETER_H_ */
diff --git a/Plugins/org.blueberry.core.commands/src/berryNamedHandleObjectWithState.h b/Plugins/org.blueberry.core.commands/src/berryNamedHandleObjectWithState.h
index 34d3505f8f..431a5428bb 100644
--- a/Plugins/org.blueberry.core.commands/src/berryNamedHandleObjectWithState.h
+++ b/Plugins/org.blueberry.core.commands/src/berryNamedHandleObjectWithState.h
@@ -1,72 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYNAMEDHANDLEOBJECTWITHSTATE_H_
#define BERRYNAMEDHANDLEOBJECTWITHSTATE_H_
#include "common/berryNamedHandleObject.h"
#include "berryIObjectWithState.h"
#include <QHash>
namespace berry {
/**
* <p>
* A named handle object that can carry state with it. This state can be used to
* override the name or description.
* </p>
* <p>
* Clients may neither instantiate nor extend this class.
* </p>
*/
class BERRY_COMMANDS NamedHandleObjectWithState : public NamedHandleObject, public IObjectWithState {
public:
- berryObjectMacro(berry::NamedHandleObjectWithState)
+ berryObjectMacro(berry::NamedHandleObjectWithState);
void AddState(const QString& stateId, const SmartPointer<State>& state) override;
QString GetDescription() const override;
QString GetName() const override;
SmartPointer<State> GetState(const QString& stateId) const override;
QList<QString> GetStateIds() const override;
void RemoveState(const QString& id) override;
private:
/**
* The map of states currently held by this command. If this command has no
* state, then this will be empty.
*/
QHash<QString, SmartPointer<State> > states;
protected:
/**
* Constructs a new instance of <code>NamedHandleObject<WithState/code>.
*
* @param id
* The identifier for this handle; must not be empty.
*/
NamedHandleObjectWithState(const QString& id);
};
}
#endif /*BERRYNAMEDHANDLEOBJECTWITHSTATE_H_*/
diff --git a/Plugins/org.blueberry.core.commands/src/berryParameterizedCommand.h b/Plugins/org.blueberry.core.commands/src/berryParameterizedCommand.h
index 5cd25a2a54..cface1be45 100755
--- a/Plugins/org.blueberry.core.commands/src/berryParameterizedCommand.h
+++ b/Plugins/org.blueberry.core.commands/src/berryParameterizedCommand.h
@@ -1,334 +1,334 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYPARAMETERIZEDCOMMAND_H_
#define BERRYPARAMETERIZEDCOMMAND_H_
#include <berryObject.h>
#include <berryMacros.h>
#include "common/berryCommandExceptions.h"
#include <org_blueberry_core_commands_Export.h>
#include <list>
#include <map>
namespace berry
{
struct IParameter;
class Command;
class Parameterization;
/**
* <p>
* A command that has had one or more of its parameters specified. This class
* serves as a utility class for developers that need to manipulate commands
* with parameters. It handles the behaviour of generating a parameter map and a
* human-readable name.
* </p>
*/
class BERRY_COMMANDS ParameterizedCommand: public Object
{ //implements Comparable {
public:
- berryObjectMacro(ParameterizedCommand)
+ berryObjectMacro(ParameterizedCommand);
/**
* The index of the parameter id in the parameter values.
*
* @deprecated no longer used
*/
static const int INDEX_PARAMETER_ID; // = 0;
/**
* The index of the human-readable name of the parameter itself, in the
* parameter values.
*
* @deprecated no longer used
*/
static const int INDEX_PARAMETER_NAME; // = 1;
/**
* The index of the human-readable name of the value of the parameter for
* this command.
*
* @deprecated no longer used
*/
static const int INDEX_PARAMETER_VALUE_NAME; // = 2;
/**
* The index of the value of the parameter that the command can understand.
*
* @deprecated no longer used
*/
static const int INDEX_PARAMETER_VALUE_VALUE; // = 3;
/**
* Constructs a new instance of <code>ParameterizedCommand</code> with
* specific values for zero or more of its parameters.
*
* @param command
* The command that is parameterized; must not be
* <code>null</code>.
* @param parameterizations
* An array of parameterizations binding parameters to values for
* the command. This value may be <code>null</code>.
*/
ParameterizedCommand(const SmartPointer<Command>& command,
const QList<Parameterization>& parameterizations);
bool operator<(const Object* object) const override;
bool operator==(const Object* object) const override;
/**
* Executes this command with its parameters. This does extra checking to
* see if the command is enabled and defined. If it is not both enabled and
* defined, then the execution listeners will be notified and an exception
* thrown.
*
* @param trigger
* The object that triggered the execution; may be
* <code>null</code>.
* @param applicationContext
* The state of the application at the time the execution was
* triggered; may be <code>null</code>.
* @return The result of the execution; may be <code>null</code>.
* @throws ExecutionException
* If the handler has problems executing this command.
* @throws NotDefinedException
* If the command you are trying to execute is not defined.
* @throws NotEnabledException
* If the command you are trying to execute is not enabled.
* @throws NotHandledException
* If there is no handler.
*/
Object::Pointer ExecuteWithChecks(const Object::ConstPointer& trigger,
const Object::Pointer& applicationContext);
/**
* Returns the base command. It is possible for more than one parameterized
* command to have the same identifier.
*
* @return The command; never <code>null</code>, but may be undefined.
*/
SmartPointer<Command> GetCommand() const;
/**
* Returns the command's base identifier. It is possible for more than one
* parameterized command to have the same identifier.
*
* @return The command id; never <code>null</code>.
*/
QString GetId() const;
/**
* Returns a human-readable representation of this command with all of its
* parameterizations.
*
* @return The human-readable representation of this parameterized command;
* never <code>null</code>.
* @throws NotDefinedException
* If the underlying command is not defined.
*/
QString GetName() const;
/**
* Returns the parameter map, as can be used to construct an
* <code>ExecutionEvent</code>.
*
* @return The map of parameter ids (<code>String</code>) to parameter
* values (<code>String</code>). This map is never
* <code>null</code>, but may be empty.
*/
QHash<QString, QString> GetParameterMap() const;
uint HashCode() const override;
/**
* Returns a {@link String} containing the command id, parameter ids and
* parameter values for this {@link ParameterizedCommand}. The returned
* {@link String} can be stored by a client and later used to reconstruct an
* equivalent {@link ParameterizedCommand} using the
* {@link CommandManager#deserialize(String)} method.
* <p>
* The syntax of the returned {@link String} is as follows:
* </p>
*
* <blockquote>
* <code>serialization = <u>commandId</u> [ '(' parameters ')' ]</code><br>
* <code>parameters = parameter [ ',' parameters ]</code><br>
* <code>parameter = <u>parameterId</u> [ '=' <u>parameterValue</u> ]</code>
* </blockquote>
*
* <p>
* In the syntax above, sections inside square-brackets are optional. The
* characters in single quotes (<code>(</code>, <code>)</code>,
* <code>,</code> and <code>=</code>) indicate literal characters.
* </p>
* <p>
* <code><u>commandId</u></code> represents the command id encoded with
* separator characters escaped. <code><u>parameterId</u></code> and
* <code><u>parameterValue</u></code> represent the parameter ids and
* values encoded with separator characters escaped. The separator
* characters <code>(</code>, <code>)</code>, <code>,</code> and
* <code>=</code> are escaped by prepending a <code>%</code>. This
* requires <code>%</code> to be escaped, which is also done by prepending
* a <code>%</code>.
* </p>
* <p>
* The order of the parameters is not defined (and not important). A missing
* <code><u>parameterValue</u></code> indicates that the value of the
* parameter is <code>null</code>.
* </p>
* <p>
* For example, the string shown below represents a serialized parameterized
* command that can be used to show the Resource perspective:
* </p>
* <p>
* <code>org.eclipse.ui.perspectives.showPerspective(org.eclipse.ui.perspectives.showPerspective.perspectiveId=org.eclipse.ui.resourcePerspective)</code>
* </p>
* <p>
* This example shows the more general form with multiple parameters,
* <code>null</code> value parameters, and escaped <code>=</code> in the
* third parameter value.
* </p>
* <p>
* <code>command.id(param1.id=value1,param2.id,param3.id=esc%=val3)</code>
* </p>
*
* @return A string containing the escaped command id, parameter ids and
* parameter values; never <code>null</code>.
* @see CommandManager#deserialize(String)
*/
QString Serialize();
QString ToString() const override;
/**
* <p>
* Generates all the possible combinations of command parameterizations for
* the given command. If the command has no parameters, then this is simply
* a parameterized version of that command. If a parameter is optional, both
* the included and not included cases are considered.
* </p>
* <p>
* If one of the parameters cannot be loaded due to a
* <code>ParameterValuesException</code>, then it is simply ignored.
* </p>
*
* @param command
* The command for which the parameter combinations should be
* generated; must not be <code>null</code>.
* @return A collection of <code>ParameterizedCommand</code> instances
* representing all of the possible combinations. This value is
* never empty and it is never <code>null</code>.
* @throws NotDefinedException
* If the command is not defined.
*/
static QList<ParameterizedCommand::Pointer>
GenerateCombinations(const SmartPointer<Command> command);
/**
* Take a command and a map of parameter IDs to values, and generate the
* appropriate parameterized command.
*
* @param command
* The command object. Must not be <code>null</code>.
* @param parameters
* A map of String parameter ids to objects. May be
* <code>null</code>.
* @return the parameterized command, or <code>null</code> if it could not
* be generated
*/
static ParameterizedCommand::Pointer GenerateCommand(const SmartPointer<Command> command,
const QHash<QString, Object::Pointer>& parameters);
private:
/**
* The constant integer hash code value meaning the hash code has not yet
* been computed.
*/
static const uint HASH_CODE_NOT_COMPUTED; // = 0;
/**
* A factor for computing the hash code for all parameterized commands.
*/
static const uint HASH_FACTOR; // = 89;
/**
* The seed for the hash code for all parameterized commands.
*/
static const uint HASH_INITIAL;
/**
* Escapes special characters in the command id, parameter ids and parameter
* values for {@link #serialize()}. The special characters
* {@link CommandManager#PARAMETER_START_CHAR},
* {@link CommandManager#PARAMETER_END_CHAR},
* {@link CommandManager#ID_VALUE_CHAR},
* {@link CommandManager#PARAMETER_SEPARATOR_CHAR} and
* {@link CommandManager#ESCAPE_CHAR} are escaped by prepending a
* {@link CommandManager#ESCAPE_CHAR} character.
*
* @param rawText
* a <code>String</code> to escape special characters in for
* serialization.
* @return a <code>String</code> representing <code>rawText</code> with
* special serialization characters escaped
*/
static QString Escape(const QString& rawText);
/**
* Generates every possible combination of parameter values for the given
* parameters. Parameters values that cannot be initialized are just
* ignored. Optional parameters are considered.
*
* @param startIndex
* The index in the <code>parameters</code> that we should
* process. This must be a valid index.
* @param parameters
* The parameters in to process; must not be <code>null</code>.
* @return A collection (<code>Collection</code>) of combinations (<code>List</code>
* of <code>Parameterization</code>).
*/
static QList<QList<Parameterization> > ExpandParameters(unsigned int startIndex,
const QList<SmartPointer<IParameter> >& parameters);
/**
* The base command which is being parameterized. This value is never
* <code>null</code>.
*/
const SmartPointer<Command> command;
/**
* The hash code for this object. This value is computed lazily, and marked
* as invalid when one of the values on which it is based changes.
*/
mutable uint hashCode;
/**
* This is an array of parameterization defined for this command. This value
* may be <code>null</code> if the command has no parameters.
*/
QList<Parameterization> parameterizations;
mutable QString name;
};
}
#endif /* BERRYPARAMETERIZEDCOMMAND_H_ */
diff --git a/Plugins/org.blueberry.core.expressions/src/berryEvaluationResult.h b/Plugins/org.blueberry.core.expressions/src/berryEvaluationResult.h
index 7fb758a97b..1ca4427706 100644
--- a/Plugins/org.blueberry.core.expressions/src/berryEvaluationResult.h
+++ b/Plugins/org.blueberry.core.expressions/src/berryEvaluationResult.h
@@ -1,231 +1,231 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYEVALUATIONRESULT_
#define BERRYEVALUATIONRESULT_
#include <string>
#include <org_blueberry_core_expressions_Export.h>
#include <berryObject.h>
namespace berry {
/**
* An evaluation result represents the result of an expression
* evaluation. There are exact three instances of evaluation
* result. They are: <code>FALSE_EVAL</code>, <code>TRUE_EVAL</code> and
* <code>NOT_LOADED</code>. <code>NOT_LOADED</code> represents
* the fact that an expression couldn't be evaluated since a
* plug-in providing certain test expressions isn't loaded yet.
* <p>
* In addition the class implements the three operation <code>and
* </code>, <code>or</code> and <code>not</code>. The operation are
* defined as follows:
* </p>
* <p>
* The and operation:
* </p>
* <table border="1" cellpadding="5">
* <colgroup>
* <col width="120">
* <col width="120">
* <col width="120">
* <col width="120">
* </colgroup>
* <tbody>
* <tr>
* <td><em>AND</em></td>
* <td>FALSE_EVAL</td>
* <td>TRUE_EVAL</td>
* <td>NOT_LOADED</td>
* </tr>
* <tr>
* <td>FALSE_EVAL</td>
* <td>FALSE_EVAL</td>
* <td>FALSE_EVAL</td>
* <td>FALSE_EVAL</td>
* </tr>
* <tr>
* <td>TRUE_EVAL</td>
* <td>FALSE_EVAL</td>
* <td>TRUE_EVAL</td>
* <td>NOT_LOADED</td>
* </tr>
* <tr>
* <td>NOT_LOADED</td>
* <td>FALSE_EVAL</td>
* <td>NOT_LOADED</td>
* <td>NOT_LOADED</td>
* </tr>
* </tbody>
* </table>
* <p>
* The or operation:
* </p>
* <table border="1" cellpadding="5">
* <colgroup>
* <col width="120">
* <col width="120">
* <col width="120">
* <col width="120">
* </colgroup>
* <tbody>
* <tr>
* <td><em>OR</em></td>
* <td>FALSE_EVAL</td>
* <td>TRUE_EVAL</td>
* <td>NOT_LOADED</td>
* </tr>
* <tr>
* <td>FALSE_EVAL</td>
* <td>FALSE_EVAL</td>
* <td>TRUE_EVAL</td>
* <td>NOT_LOADED</td>
* </tr>
* <tr>
* <td>TRUE_EVAL</td>
* <td>TRUE_EVAL</td>
* <td>TRUE_EVAL</td>
* <td>TRUE_EVAL</td>
* </tr>
* <tr>
* <td>NOT_LOADED</td>
* <td>NOT_LOADED</td>
* <td>TRUE_EVAL</td>
* <td>NOT_LOADED</td>
* </tr>
* </tbody>
* </table>
* <p>
* The not operation:
* </p>
* <table border="1" cellpadding="5">
* <colgroup>
* <col width="120">
* <col width="120">
* <col width="120">
* <col width="120">
* </colgroup>
* <tbody>
* <tr>
* <td><em>NOT<em></td>
* <td>FALSE_EVAL</td>
* <td>TRUE_EVAL</td>
* <td>NOT_LOADED</td>
* </tr>
* <tr>
* <td></td>
* <td>TRUE_EVAL</td>
* <td>FALSE_EVAL</td>
* <td>NOT_LOADED</td>
* </tr>
* </tbody>
* </table>
*
* <p>
* The class is not intended to be subclassed by clients.
* </p>
* @since 3.0
*/
class BERRY_EXPRESSIONS EvaluationResult : public Object
{
private:
int fValue;
static const int FALSE_VALUE;
static const int TRUE_VALUE;
static const int NOT_LOADED_VALUE;
public:
/** The evaluation result representing the value FALSE */
static const SmartPointer<const EvaluationResult> FALSE_EVAL;
/** The evaluation result representing the value TRUE */
static const SmartPointer<const EvaluationResult> TRUE_EVAL;
/** The evaluation result representing the value NOT_LOADED */
static const SmartPointer<const EvaluationResult> NOT_LOADED;
private:
static const SmartPointer<const EvaluationResult> AND[3][3];
static const SmartPointer<const EvaluationResult> OR[3][3];
static const SmartPointer<const EvaluationResult> NOT[3];
/*
* No instances outside of <code>EvaluationResult</code>
*/
EvaluationResult(int value);
EvaluationResult(const EvaluationResult& o);
public:
- berryObjectMacro(berry::EvaluationResult)
+ berryObjectMacro(berry::EvaluationResult);
bool operator==(const Object*) const override;
bool operator!=(const Object*) const;
/**
* Returns an <code>EvaluationResult</code> whose value is <code>this &amp;&amp; other)</code>.
*
* @param other the right hand side of the and operation.
*
* @return <code>this &amp;&amp; other</code> as defined by the evaluation result
*/
EvaluationResult::ConstPointer And(const EvaluationResult::ConstPointer& other) const;
/**
* Returns an <code>EvaluationResult</code> whose value is <code>this || other)</code>.
*
* @param other the right hand side of the or operation.
*
* @return <code>this || other</code> as defined by the evaluation result
*/
EvaluationResult::ConstPointer Or(const EvaluationResult::ConstPointer& other) const;
/**
* Returns the inverted value of this evaluation result
*
* @return the inverted value of this evaluation result
*/
EvaluationResult::ConstPointer Not() const;
/**
* Returns an evaluation result instance representing the
* given boolean value. If the given boolean value is
* <code>TRUE_EVAL</code> then <code>ExpressionResult.TRUE_EVAL</code>
* is returned. If the value is <code>FALSE_EVAL</code> then <code>
* ExpressionResult.FALSE_EVAL</code> is returned.
*
* @param b a boolean value
*
* @return the expression result representing the boolean
* value
*/
static EvaluationResult::ConstPointer ValueOf(bool b);
/**
* For debugging purpose only
*
* @return a string representing this object. The result is not
* human readable
*/
QString ToString() const override;
};
} // namespace berry
#endif /*BERRYEVALUATIONRESULT_*/
diff --git a/Plugins/org.blueberry.core.expressions/src/berryIEvaluationContext.h b/Plugins/org.blueberry.core.expressions/src/berryIEvaluationContext.h
index 1dc41c0b1e..f592178f94 100644
--- a/Plugins/org.blueberry.core.expressions/src/berryIEvaluationContext.h
+++ b/Plugins/org.blueberry.core.expressions/src/berryIEvaluationContext.h
@@ -1,145 +1,145 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEVALUATIONCONTEXT_H_
#define BERRYIEVALUATIONCONTEXT_H_
#include <berryMacros.h>
#include <berryObject.h>
#include <org_blueberry_core_expressions_Export.h>
namespace berry {
/**
* An evaluation context is used to manage a set of objects needed during
* XML expression evaluation. A context has a parent context, can manage
* a set of named variables and has a default variable. The default variable
* is used during XML expression evaluation if no explicit variable is
* referenced.
* <p>
* This interface is not intended to be implemented by clients. Clients
* are allowed to instantiate <code>EvaluationContext</code>.
* </p>
*
* @since 3.0
*/
struct BERRY_EXPRESSIONS IEvaluationContext : public Object
{
- berryObjectMacro(berry::IEvaluationContext)
+ berryObjectMacro(berry::IEvaluationContext);
/**
* Represents the value used by variables that exist but are not defined
* in a evaluation context. When tested by the 'with' expression, <code>false</code>
* will be returned.
*/
static Object::ConstPointer UNDEFINED_VARIABLE;
~IEvaluationContext() override;
/**
* Returns the parent context or <code>null</code> if
* this is the root of the evaluation context hierarchy.
*
* @return the parent evaluation context or <code>null</code>
*/
virtual IEvaluationContext* GetParent() const = 0;
/**
* Returns the root evaluation context.
*
* @return the root evaluation context
*/
virtual IEvaluationContext* GetRoot() const = 0;
/**
* Specifies whether this evaluation context allows activation
* of plug-ins for testers used in the expression tree. To actual
* trigger the plug-in loading this flag has to be set to <code>
* true</code> and the actual test expression must have the
* attribute <code>forcePluginActivation</code> set to <code>
* true</code> as well.
*
* @param value whether this evaluation context allows plug-in activation
* @since 3.2
*/
virtual void SetAllowPluginActivation(bool value) = 0;
/**
* Returns whether this evaluation context supports plug-in
* activation. If not set via {@link #setAllowPluginActivation(boolean)}
* the parent value is returned. If no parent is set <code>false</code>
* is returned.
*
* @return whether plug-in activation is supported or not
* @since 3.2
*/
virtual bool GetAllowPluginActivation() const = 0;
/**
* Returns the default variable.
*
* @return the default variable or <code>null</code> if
* no default variable is managed.
*/
virtual Object::ConstPointer GetDefaultVariable() const = 0;
/**
* Adds a new named variable to this context. If a variable
* with the name already exists the new one overrides the
* existing one.
*
* @param name the variable's name
* @param value the variable's value
*/
virtual void AddVariable(const QString& name, const Object::ConstPointer& value) = 0;
/**
* Removes the variable managed under the given name
* from this evaluation context.
*
* @param name the variable's name
* @return the currently stored value or <code>null</code> if
* the variable doesn't exist
*/
virtual Object::ConstPointer RemoveVariable(const QString& name) = 0;
/**
* Returns the variable managed under the given name.
*
* @param name the variable's name
* @return the variable's value or <code>null</code> if the content
* doesn't manage a variable with the given name
*/
virtual Object::ConstPointer GetVariable(const QString& name) const = 0;
/**
* Resolves a variable for the given name and arguments. This
* method can be used to dynamically resolve variable such as
* plug-in descriptors, resources, etc. The method is used
* by the <code>resolve</code> expression.
*
* @param name the variable to resolve
* @param args an object array of arguments used to resolve the
* variable
* @return the variable's value or <code>null</code> if no variable
* can be resolved for the given name and arguments
* @exception CoreException if an errors occurs while resolving
* the variable
*/
virtual Object::ConstPointer ResolveVariable(const QString& name, const QList<Object::Pointer>& args) const = 0;
};
} // namespace berry
#endif /*BERRYIEVALUATIONCONTEXT_H_*/
diff --git a/Plugins/org.blueberry.core.expressions/src/berryIIterable.h b/Plugins/org.blueberry.core.expressions/src/berryIIterable.h
index 4b2208f291..aef1674af1 100644
--- a/Plugins/org.blueberry.core.expressions/src/berryIIterable.h
+++ b/Plugins/org.blueberry.core.expressions/src/berryIIterable.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIITERABLE_H_
#define BERRYIITERABLE_H_
#include <berryObject.h>
#include <berryMacros.h>
#include <org_blueberry_core_expressions_Export.h>
namespace berry {
/**
* Objects that are adaptable to <code>IIterable</code> can be used
* as the default variable in an iterate expression.
*
* @see IAdaptable
* @see IAdapterManager
*/
struct BERRY_EXPRESSIONS IIterable : public Object
{
- berryObjectMacro(berry::IIterable)
+ berryObjectMacro(berry::IIterable);
typedef QList<Object::Pointer>::iterator iterator;
typedef QList<Object::Pointer>::const_iterator const_iterator;
~IIterable() override;
/**
* Returns an iterator to iterate over the elements.
*
* @return an iterator
*/
virtual iterator begin() = 0;
virtual iterator end() = 0;
virtual const_iterator begin() const = 0;
virtual const_iterator end() const = 0;
};
} // namespace berry
Q_DECLARE_INTERFACE(berry::IIterable, "org.blueberry.core.IIterable")
#endif /*BERRYIITERABLE_H_*/
diff --git a/Plugins/org.blueberry.core.expressions/src/berryIPropertyTester.h b/Plugins/org.blueberry.core.expressions/src/berryIPropertyTester.h
index cc9107a4ea..43565e7ef7 100644
--- a/Plugins/org.blueberry.core.expressions/src/berryIPropertyTester.h
+++ b/Plugins/org.blueberry.core.expressions/src/berryIPropertyTester.h
@@ -1,108 +1,108 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIPROPERTYTESTER_H_
#define BERRYIPROPERTYTESTER_H_
#include <berryMacros.h>
#include <berryObject.h>
#include <org_blueberry_core_expressions_Export.h>
#include <Poco/Any.h>
#include <string>
#include <vector>
#include <QObject>
namespace berry {
/**
* A property tester can be used to add additional properties to test to an
* existing type.
* <p>
* This interface is not intended to be implemented by clients. Clients
* should subclass type <code>PropertyTester</code>.
* </p>
*/
struct BERRY_EXPRESSIONS IPropertyTester : public Object
{
- berryObjectMacro(berry::IPropertyTester)
+ berryObjectMacro(berry::IPropertyTester);
~IPropertyTester() override;
/**
* Returns whether the property tester can handle the given
* property or not.
*
* @param namespace the name space to be considered
* @param property the property to test
* @return <code>true</code> if the tester provides an implementation
* for the given property; otherwise <code>false</code> is returned
*/
virtual bool Handles(const QString& namespaze, const QString& property) = 0;
/**
* Returns whether the implementation class for this property tester is
* loaded or not.
*
* @return <code>true</code>if the implementation class is loaded;
* <code>false</code> otherwise
*/
virtual bool IsInstantiated() = 0;
/**
* Returns <code>true</code> if the implementation class of this property
* tester can be loaded. This is the case if the plug-in providing
* the implementation class is active. Returns <code>false</code> otherwise.
*
* @return whether the implementation class can be loaded or not
*/
virtual bool IsDeclaringPluginActive() = 0;
/**
* Loads the implementation class for this property tester and returns an
* instance of this class.
*
* @return an instance of the implementation class for this property tester
*
* @throws CoreException if the implementation class cannot be loaded
*/
virtual IPropertyTester* Instantiate() = 0;
/**
* Executes the property test determined by the parameter <code>property</code>.
*
* @param receiver the receiver of the property test
* @param property the property to test
* @param args additional arguments to evaluate the property. If no arguments
* are specified in the <code>test</code> expression an array of length 0
* is passed
* @param expectedValue the expected value of the property. The value is either
* of type <code>java.lang.String</code> or a boxed base type. If no value was
* specified in the <code>test</code> expressions then <code>null</code> is passed
*
* @return returns <code>true<code> if the property is equal to the expected value;
* otherwise <code>false</code> is returned
*/
virtual bool Test(Object::ConstPointer receiver, const QString& property,
const QList<Object::Pointer>& args, Object::Pointer expectedValue) = 0;
};
} // namespace berry
Q_DECLARE_INTERFACE(berry::IPropertyTester, "org.blueberry.IPropertyTester")
#endif /*BERRYIPROPERTYTESTER_H_*/
diff --git a/Plugins/org.blueberry.core.expressions/src/internal/berryProperty.h b/Plugins/org.blueberry.core.expressions/src/internal/berryProperty.h
index d5756b15c7..7f87ec217a 100644
--- a/Plugins/org.blueberry.core.expressions/src/internal/berryProperty.h
+++ b/Plugins/org.blueberry.core.expressions/src/internal/berryProperty.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYPROPERTY_H_
#define BERRYPROPERTY_H_
#include "berryIPropertyTester.h"
#include "berryObject.h"
#include "Poco/SharedPtr.h"
#include "Poco/Any.h"
#include <vector>
#include <typeinfo>
namespace berry {
class Property : public Object {
public:
- berryObjectMacro(Property)
+ berryObjectMacro(Property);
private:
Reflection::TypeInfo fType;
QString fNamespace;
QString fName;
IPropertyTester::Pointer fTester;
friend class TypeExtensionManager;
/* package */ Property(const Reflection::TypeInfo& typeInfo,
const QString& namespaze, const QString& name);
/* package */ void SetPropertyTester(IPropertyTester::Pointer tester);
public:
bool IsInstantiated() const;
bool IsDeclaringPluginActive() const;
bool IsValidCacheEntry(bool forcePluginActivation) const;
bool Test(Object::ConstPointer receiver, const QList<Object::Pointer>& args,
Object::Pointer expectedValue);
bool operator==(const Object* obj) const override;
bool operator<(const Object* obj) const override;
uint HashCode() const override;
};
} // namespace berry
#endif /*BERRYPROPERTY_H_*/
diff --git a/Plugins/org.blueberry.core.expressions/src/internal/berryTypeExtension.h b/Plugins/org.blueberry.core.expressions/src/internal/berryTypeExtension.h
index 955f4ce781..65929cc103 100644
--- a/Plugins/org.blueberry.core.expressions/src/internal/berryTypeExtension.h
+++ b/Plugins/org.blueberry.core.expressions/src/internal/berryTypeExtension.h
@@ -1,87 +1,87 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYTYPEEXTENSION_H_
#define BERRYTYPEEXTENSION_H_
#include <berryMacros.h>
#include <berryObject.h>
#include "berryIPropertyTester.h"
namespace berry {
class TypeExtensionManager;
class END_POINT_;
class TypeExtension : public Object {
public:
- berryObjectMacro(TypeExtension)
+ berryObjectMacro(TypeExtension);
private:
/* the type this extension is extending */
Reflection::TypeInfo fTypeInfo;
/* the list of associated extenders */
QList<IPropertyTester::Pointer> fExtenders;
bool fExtendersLoaded;
/* the extensions associated with <code>fType</code>'s super classes */
QList<TypeExtension::Pointer> fInherits;
bool fInheritsLoaded;
TypeExtension();
protected:
friend class TypeExtensionManager;
/* a special property tester instance that is used to signal that method searching has to continue */
class CONTINUE_ : public IPropertyTester {
public:
- berryObjectMacro(CONTINUE_)
+ berryObjectMacro(CONTINUE_);
bool Handles(const QString& /*namespaze*/, const QString& /*method*/) override;
bool IsInstantiated() override;
bool IsDeclaringPluginActive() override;
IPropertyTester* Instantiate() override;
bool Test(Object::ConstPointer /*receiver*/, const QString& /*method*/,
const QList<Object::Pointer>& /*args*/, Object::Pointer /*expectedValue*/) override;
};
static const CONTINUE_ CONTINUE;
static const END_POINT_ END_POINT;
TypeExtension(const Reflection::TypeInfo& typeInfo);
IPropertyTester::Pointer FindTypeExtender(TypeExtensionManager& manager,
const QString &namespaze, const QString &method,
bool staticMethod, bool forcePluginActivation);
};
/* a special type extension instance that marks the end of an evaluation chain */
class END_POINT_ : public TypeExtension
{
protected:
IPropertyTester::Pointer FindTypeExtender(TypeExtensionManager& /*manager*/,
const QString& /*namespaze*/, const QString& /*name*/,
bool /*staticMethod*/, bool /*forcePluginActivation*/);
};
} // namespace berry
#endif /*BERRYTYPEEXTENSION_H_*/
diff --git a/Plugins/org.blueberry.core.jobs/src/berryIJobChangeEvent.h b/Plugins/org.blueberry.core.jobs/src/berryIJobChangeEvent.h
index e66a7d0245..3ce868c321 100644
--- a/Plugins/org.blueberry.core.jobs/src/berryIJobChangeEvent.h
+++ b/Plugins/org.blueberry.core.jobs/src/berryIJobChangeEvent.h
@@ -1,70 +1,70 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIJOBCHANGEEVENT_H_
#define BERRYIJOBCHANGEEVENT_H_
#include <berryObject.h>
#include <berryMacros.h>
#include <berryIStatus.h>
#include <Poco/Timestamp.h>
#include <org_blueberry_core_jobs_Export.h>
namespace berry
{
class Job;
/**
* An event describing a change to the state of a job.
*
* @see IJobChangeListener
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_JOBS IJobChangeEvent : public Object
{
- berryObjectMacro(berry::IJobChangeEvent)
+ berryObjectMacro(berry::IJobChangeEvent);
/**
* The amount of time in milliseconds to wait after scheduling the job before it
* should be run, or <code>-1</code> if not applicable for this type of event.
* This value is only applicable for the <code>scheduled</code> event.
*
* @return the delay time for this event
*/
virtual Poco::Timestamp::TimeDiff GetDelay() const = 0;
/**
* The job on which this event occurred.
*
* @return the job for this event
*/
virtual SmartPointer<Job> GetJob() const = 0;
/**
* The result returned by the job's run method, or <code>null</code> if
* not applicable. This value is only applicable for the <code>done</code> event.
*
* @return the status for this event
*/
virtual IStatus::Pointer GetResult() const = 0;
};
}
#endif /* BERRYIJOBCHANGEEVENT_H_ */
diff --git a/Plugins/org.blueberry.core.jobs/src/berryIJobManager.h b/Plugins/org.blueberry.core.jobs/src/berryIJobManager.h
index 67bb91b53d..e7c98c6d8d 100644
--- a/Plugins/org.blueberry.core.jobs/src/berryIJobManager.h
+++ b/Plugins/org.blueberry.core.jobs/src/berryIJobManager.h
@@ -1,436 +1,436 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _BERRY_IJOBMANAGER_H
#define _BERRY_IJOBMANAGER_H
#include<string>
#include <org_blueberry_core_jobs_Export.h>
#include "berryJob.h"
#include "berryProgressProvider.h"
#include "berryIProgressMonitor.h"
#include "berryIJobChangeListener.h"
#include<Poco/Thread.h>
namespace berry
{
/**
* The job manager provides facilities for scheduling, querying, and maintaining jobs
* and locks. In particular, the job manager provides the following services:
* <ul>
* <li>Maintains a queue of jobs that are waiting to be run. Items can be added to
* the queue using the <code>schedule</code> method.</li>
* <li> @todo Allows manipulation of groups of jobs called job families. } Job families can
* be canceled, put to sleep, or woken up atomically. There is also a mechanism
* for querying the set of known jobs in a given family.> </li>
*
* <li>Allows listeners to find out about progress on running jobs, and to find out
* when jobs have changed states.</li>
* <li> @todo Provides a factory for creating lock objects. Lock objects are smart monitors
* that have strategies for avoiding deadlock. ></li>
*
* <li>Provide feedback to a client that is waiting for a given job or family of jobs
* to complete.</li>
* </ul>
*
* @see Job
* @see ILock
*
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_JOBS IJobManager: public Object
{
- berryObjectMacro(berry::IJobManager)
+ berryObjectMacro(berry::IJobManager);
/**
* A system property key indicating whether the job manager should create
* job threads as daemon threads. Set to <code>true</code> to force all worker
* threads to be created as daemon threads. Set to <code>false</code> to force
* all worker threads to be created as non-daemon threads.
*
* not used yet
*/
static const std::string PROP_USE_DAEMON_THREADS ;
/**
* Registers a job listener with the job manager.
* Has no effect if an identical listener is already registered.
*
* @param listener the listener to be added
* @see #removeJobChangeListener(IJobChangeListener)
* @see IJobChangeListener
*/
virtual void AddJobChangeListener(IJobChangeListener* listener) = 0;
///**
// * Begins applying this rule in the calling thread. If the rule conflicts with another
// * rule currently running in another thread, this method blocks until there are
// * no conflicting rules. Calls to <tt>beginRule</tt> must eventually be followed
// * by a matching call to <tt>endRule</tt> in the same thread and with the identical
// * rule instance.
// * <p>
// * Rules can be nested only if the rule for the inner <tt>beginRule</tt>
// * is contained within the rule for the outer <tt>beginRule</tt>. Rule containment
// * is tested with the API method <tt>ISchedulingRule.contains</tt>. Also, begin/end
// * pairs must be strictly nested. Only the rule that has most recently begun
// * can be ended at any given time.
// * <p>
// * A rule of <code>null</code> can be used, but will be ignored for scheduling
// * purposes. The outermost non-null rule in the thread will be used for scheduling. A
// * <code>null</code> rule that is begun must still be ended.
// * <p>
// * If this method is called from within a job that has a scheduling rule, the
// * given rule must also be contained within the rule for the running job.
// * <p>
// * Note that <tt>endRule</tt> must be called even if <tt>beginRule</tt> fails.
// * The recommended usage is:
// * <pre>
// * final ISchedulingRule rule = ...;
// * try {
// * manager.beginRule(rule, monitor);
// * } finally {
// * manager.endRule(rule);
// * }
// * </pre>
// *
// * @param rule the rule to begin applying in this thread, or <code>null</code>
// * @param monitor a progress monitor, or <code>null</code> if progress
// * reporting and cancellation are not desired
// * @throws IllegalArgumentException if the rule is not strictly nested within
// * all other rules currently active for this thread
// * @throws OperationCanceledException if the supplied monitor reports cancelation
// * before the rule becomes available
// * @see ISchedulingRule#contains(ISchedulingRule)
// */
/// virtual void BeginRule(const ISchedulingRule& rule, const IProgressMonitor& monitor) = 0;
///**
// * Cancels all jobs in the given job family. Jobs in the family that are currently waiting
// * will be removed from the queue. Sleeping jobs will be discarded without having
// * a chance to wake up. Currently executing jobs will be asked to cancel but there
// * is no guarantee that they will do so.
// *
// * @param family the job family to cancel, or <code>null</code> to cancel all jobs
// * @see Job#belongsTo(Object)
// */
/// virtual void Cancel(const Object& family);
/**
* Returns a progress monitor that can be used to provide
* aggregated progress feedback on a set of running jobs. A user
* interface will typically group all jobs in a progress group together,
* providing progress feedback for individual jobs as well as aggregated
* progress for the entire group. Jobs in the group may be run sequentially,
* in parallel, or some combination of the two.
* <p>
* Recommended usage (this snippet runs two jobs in sequence in a
* single progress group):
* <pre>
* Job parseJob, compileJob;
* IProgressMonitor pm = Platform.getJobManager().createProgressGroup();
* try {
* pm.beginTask("Building", 10);
* parseJob.setProgressGroup(pm, 5);
* parseJob.schedule();
* compileJob.setProgressGroup(pm, 5);
* compileJob.schedule();
* parseJob.join();
* compileJob.join();
* } finally {
* pm.done();
* }
* </pre>
*
* @see Job#setProgressGroup(IProgressMonitor, int)
* @see IProgressMonitor
* @return a progress monitor
*/
virtual IProgressMonitor::Pointer CreateProgressGroup() = 0;
///**
// * Returns the job that is currently running in this thread, or <code>null</code> if there
// * is no currently running job.
// *
// * @return the job or <code>null</code>
// */
//// virtual Job CurrentJob() = 0;
///**
// * Ends the application of a rule to the calling thread. Calls to <tt>endRule</tt>
// * must be preceded by a matching call to <tt>beginRule</tt> in the same thread
// * with an identical rule instance.
// * <p>
// * Rules can be nested only if the rule for the inner <tt>beginRule</tt>
// * is contained within the rule for the outer <tt>beginRule</tt>. Also, begin/end
// * pairs must be strictly nested. Only the rule that has most recently begun
// * can be ended at any given time.
// *
// * @param rule the rule to end applying in this thread
// * @throws IllegalArgumentException if this method is called on a rule for which
// * there is no matching begin, or that does not match the most recent begin.
// * @see ISchedulingRule#contains(ISchedulingRule)
// */
/// virtual void EndRule(const ISchedulingRule& rule) = 0;
///**
// * Returns all waiting, executing and sleeping jobs belonging
// * to the given family. If no jobs are found, an empty array is returned.
// *
// * @param family the job family to find, or <code>null</code> to find all jobs
// * @return the job array
// * @see Job#belongsTo(Object)
// */
/// virtual Job[] Find(const Object& family) = 0;
/**
* Returns whether the job manager is currently idle. The job manager is
* idle if no jobs are currently running or waiting to run.
*
* @return <code>true</code> if the job manager is idle, and
* <code>false</code> otherwise
* @since 3.1
*/
virtual bool IsIdle()= 0;
/**
* Returns whether the job manager is currently suspended.
*
* @return <code>true</code> if the job manager is suspended, and
* <code>false</code> otherwise
* @since 3.4
* @see #suspend()
* @see #resume()
*/
virtual bool IsSuspended() = 0;
///**
// * Waits until all jobs of the given family are finished. This method will block the
// * calling thread until all such jobs have finished executing, or until this thread is
// * interrupted. If there are no jobs in
// * the family that are currently waiting, running, or sleeping, this method returns
// * immediately. Feedback on how the join is progressing is provided to a progress
// * monitor.
// * <p>
// * If this method is called while the job manager is suspended, only jobs
// * that are currently running will be joined; Once there are no jobs
// * in the family in the {@link Job#RUNNING} state, this method returns.
// * </p>
// * <p>
// * Note that there is a deadlock risk when using join. If the calling thread owns
// * a lock or object monitor that the joined thread is waiting for, deadlock
// * will occur. This method can also result in starvation of the current thread if
// * another thread continues to add jobs of the given family, or if a
// * job in the given family reschedules itself in an infinite loop.
// * </p>
// *
// * @param family the job family to join, or <code>null</code> to join all jobs.
// * @param monitor Progress monitor for reporting progress on how the
// * wait is progressing, or <code>null</code> if no progress monitoring is required.
// * @exception InterruptedException if this thread is interrupted while waiting
// * @exception OperationCanceledException if the progress monitor is canceled while waiting
// * @see Job#belongsTo(Object)
// * @see #suspend()
// */
/// virtual void Join(const Object& family, const IProgressMonitor& monitor)
/// throw(InterruptedException, OperationCanceledException) = 0;
///**
// * Creates a new lock object. All lock objects supplied by the job manager
// * know about each other and will always avoid circular deadlock amongst
// * themselves.
// *
// * @return the new lock object
// */
/// virtual ILock newLock() = 0;
/**
* Removes a job listener from the job manager.
* Has no effect if an identical listener is not already registered.
*
* @param listener the listener to be removed
* @see #addJobChangeListener(IJobChangeListener)
* @see IJobChangeListener
*/
virtual void RemoveJobChangeListener(IJobChangeListener* listener) = 0;
///**
// * Resumes execution of jobs after a previous <code>suspend</code>. All
// * jobs that were sleeping or waiting prior to the suspension, or that were
// * scheduled while the job manager was suspended, will now be eligible
// * for execution.
// * <p>
// * Calling this method on a rule that is not suspended has no effect. If another
// * thread also owns the rule at the time this method is called, then the rule will
// * not be resumed until all threads have released the rule.
// *
// * @deprecated This method is not safe and should not be used.
// * Suspending a scheduling rule violates the thread safety
// * of clients that use scheduling rules as a mutual exclusion mechanism,
// * and can result in concurrency problems in all clients that use the suspended rule.
// * @see #suspend(ISchedulingRule, IProgressMonitor)
// */
/// virtual void Resume(const ISchedulingRule& rule) = 0;
///**
// * Resumes execution of jobs after a previous <code>suspend</code>. All
// * jobs that were sleeping or waiting prior to the suspension, or that were
// * scheduled while the job manager was suspended, will now be eligible
// * for execution.
// * <p>
// * Calling <code>resume</code> when the job manager is not suspended
// * has no effect.
// *
// * @see #suspend()
// * @see #isSuspended()
// */
////virtual void Resume() = 0;
///**
// * Provides a hook that is notified whenever a thread is about to wait on a lock,
// * or when a thread is about to release a lock. This hook must only be set once.
// * <p>
// * This method is for internal use by the platform-related plug-ins.
// * Clients should not call this method.
// * </p>
// * @see LockListener
// */
// TODO LockListener .. SetLockListener
/// virtual void SetLockListener(const LockListener& listener) = 0;
/**
* Registers a progress provider with the job manager. If there was a
* provider already registered, it is replaced.
* <p>
* This method is intended for use by the currently executing Eclipse application.
* Plug-ins outside the currently running application should not call this method.
* </p>
*
* @param provider the new provider, or <code>null</code> if no progress
* is needed
*/
virtual void SetProgressProvider(ProgressProvider::Pointer) = 0;
/**
* Suspends execution of all jobs. Jobs that are already running
* when this method is invoked will complete as usual, but all sleeping and
* waiting jobs will not be executed until the job manager is resumed.
* <p>
* The job manager will remain suspended until a subsequent call to
* <code>resume</code>. Further calls to <code>suspend</code>
* when the job manager is already suspended are ignored.
* <p>
* All attempts to join sleeping and waiting jobs while the job manager is
* suspended will return immediately.
* <p>
* Note that this very powerful function should be used with extreme caution.
* Suspending the job manager will prevent all jobs in the system from executing,
* which may have adverse affects on components that are relying on
* execution of jobs. The job manager should never be suspended without intent
* to resume execution soon afterwards.
*
* @see #resume()
* @see #join(Object, IProgressMonitor)
* @see #isSuspended()
*/
// virtual void Suspend() = 0;
///**
// * Defers execution of all jobs with scheduling rules that conflict with the
// * given rule. The caller will be blocked until all currently executing jobs with
// * conflicting rules are completed. Conflicting jobs that are sleeping or waiting at
// * the time this method is called will not be executed until the rule is resumed.
// * <p>
// * While a rule is suspended, all calls to <code>beginRule</code> and
// * <code>endRule</code> on a suspended rule will not block the caller.
// * The rule remains suspended until a subsequent call to
// * <code>resume(ISchedulingRule)</code> with the identical rule instance.
// * Further calls to <code>suspend</code> with an identical rule prior to calling
// * <code>resume</code> are ignored.
// * </p>
// * <p>
// * This method is long-running; progress and cancelation are provided by
// * the given progress monitor. In the case of cancelation, the rule will
// * not be suspended.
// * </p>
// * Note: this very powerful function should be used with extreme caution.
// * Suspending rules will prevent jobs in the system from executing, which may
// * have adverse effects on components that are relying on execution of jobs.
// * The job manager should never be suspended without intent to resume
// * execution soon afterwards. Deadlock will result if the thread responsible
// * for resuming the rule attempts to join a suspended job.
// *
// * @deprecated This method is not safe and should not be used.
// * Suspending a scheduling rule violates the thread safety
// * of clients that use scheduling rules as a mutual exclusion mechanism,
// * and can result in concurrency problems in all clients that use the suspended rule.
// * @param rule The scheduling rule to suspend. Must not be <code>null</code>.
// * @param monitor a progress monitor, or <code>null</code> if progress
// * reporting is not desired
// * @exception OperationCanceledException if the operation is canceled.
// * Cancelation can occur even if no progress monitor is provided.
// * @see #resume(ISchedulingRule)
// */
/// virtual void Suspend(const ISchedulingRule& rule, const IProgressMonitor& monitor) = 0;
///**
// * Requests that all jobs in the given job family be suspended. Jobs currently
// * waiting to be run will be removed from the queue and moved into the
// * <code>SLEEPING</code> state. Jobs that have been put to sleep
// * will remain in that state until either resumed or canceled. This method has
// * no effect on jobs that are not currently waiting to be run.
// * <p>
// * Sleeping jobs can be resumed using <code>wakeUp</code>.
// *
// * @param family the job family to sleep, or <code>null</code> to sleep all jobs.
// * @see Job#belongsTo(Object)
// */
/// virtual void Sleep(const Object& family) = 0;
///**
// * Transfers ownership of a scheduling rule to another thread. The identical
// * scheduling rule must currently be owned by the calling thread as a result of
// * a previous call to <code>beginRule</code>. The destination thread must
// * not already own a scheduling rule.
// * <p>
// * Calling this method is equivalent to atomically calling <code>endRule</code>
// * in the calling thread followed by an immediate <code>beginRule</code> in
// * the destination thread. The destination thread is responsible for subsequently
// * calling <code>endRule</code> when it is finished using the rule.
// * <p>
// * This method has no effect when the destination thread is the same as the
// * calling thread.
// *
// * @param rule The scheduling rule to transfer
// * @param destinationThread The new owner for the transferred rule.
// * @since 3.1
// */
/// virtual void TransferRule(const ISchedulingRule& rule, Poco::Thread* destinationThread) = 0;
///**
// * Resumes scheduling of all sleeping jobs in the given family. This method
// * has no effect on jobs in the family that are not currently sleeping.
// *
// * @param family the job family to wake up, or <code>null</code> to wake up all jobs
// * @see Job#belongsTo(Object)
// */
/// virtual void WakeUp(const Object& family) = 0;
};
}
#endif /* IJOBMANAGER */
diff --git a/Plugins/org.blueberry.core.jobs/src/berryIJobStatus.h b/Plugins/org.blueberry.core.jobs/src/berryIJobStatus.h
index 779bce7a48..a065d074eb 100644
--- a/Plugins/org.blueberry.core.jobs/src/berryIJobStatus.h
+++ b/Plugins/org.blueberry.core.jobs/src/berryIJobStatus.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _BERRYIJOBSTATUS_H
#define _BERRYIJOBSTATUS_H
#include "berryIStatus.h"
#include "berryObject.h"
#include "berryJob.h"
namespace berry {
/**
* Represents status relating to the execution of jobs.
* @see IStatus
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
struct IJobStatus : public virtual IStatus
{
- berryObjectMacro(IJobStatus)
+ berryObjectMacro(IJobStatus);
/**
* Returns the job associated with this status.
* @return the job associated with this status
*/
virtual Job::Pointer GetJob() = 0;
};
}
#endif /*_BERRYIJOBSTATUS_H */
diff --git a/Plugins/org.blueberry.core.jobs/src/berryILock.h b/Plugins/org.blueberry.core.jobs/src/berryILock.h
index 6e4e2f1895..64e3613029 100644
--- a/Plugins/org.blueberry.core.jobs/src/berryILock.h
+++ b/Plugins/org.blueberry.core.jobs/src/berryILock.h
@@ -1,121 +1,121 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _BERRY_ILOCK_H_
#define _BERRY_ILOCK_H_
#include <berryObject.h>
#include <berryMacros.h>
#include "berryJobExceptions.h"
namespace berry
{
/**
* A lock is used to control access to an exclusive resource.
* <p>
* Locks are reentrant. That is, they can be acquired multiple times by the same thread
* without releasing. Locks are only released when the number of successful acquires
* equals the number of successful releases.
* </p><p>
* Locks are capable of detecting and recovering from programming errors that cause
* circular waiting deadlocks. When a deadlock between two or more <tt>ILock</tt>
* instances is detected, detailed debugging information is printed to the log file. The
* locks will then automatically recover from the deadlock by employing a release
* and wait strategy. One thread will lose control of the locks it owns, thus breaking
* the deadlock and allowing other threads to proceed. Once that thread's locks are
* all available, it will be given exclusive access to all its locks and allowed to proceed.
* A thread can only lose locks while it is waiting on an <tt>acquire()</tt> call.
*
* </p><p>
* Successive acquire attempts by different threads are queued and serviced on
* a first come, first served basis.
* </p><p>
* It is very important that acquired locks eventually get released. Calls to release
* should be done in a finally block to ensure they execute. For example:
* <pre>
* try {
* lock.acquire();
* // ... do work here ...
* } finally {
* lock.release();
* }
* </pre>
* Note: although <tt>lock.acquire</tt> should never fail, it is good practice to place
* it inside the try block anyway. Releasing without acquiring is far less catastrophic
* than acquiring without releasing.
* </p>
*
* @see IJobManager#NewLock()
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_JOBS ILock: public Object
{
- berryObjectMacro(berry::ILock)
+ berryObjectMacro(berry::ILock);
/**
* Attempts to acquire this lock. If the lock is in use and the specified delay is
* greater than zero, the calling thread will block until one of the following happens:
* <ul>
* <li>This lock is available</li>
* <li>The thread is interrupted</li>
* <li>The specified delay has elapsed</li>
* </ul>
* <p>
* While a thread is waiting, locks it already owns may be granted to other threads
* if necessary to break a deadlock. In this situation, the calling thread may be blocked
* for longer than the specified delay. On returning from this call, the calling thread
* will once again have exclusive access to any other locks it owned upon entering
* the acquire method.
*
* @param delay the number of milliseconds to delay
* @return <code>true</code> if the lock was successfully acquired, and
* <code>false</code> otherwise.
* @exception InterruptedException if the thread was interrupted
*/
virtual bool Acquire(long delay) throw (InterruptedException) = 0;
/**
* Acquires this lock. If the lock is in use, the calling thread will block until the lock
* becomes available. If the calling thread owns several locks, it will be blocked
* until all threads it requires become available, or until the thread is interrupted.
* While a thread is waiting, its locks may be granted to other threads if necessary
* to break a deadlock. On returning from this call, the calling thread will
* have exclusive access to this lock, and any other locks it owned upon
* entering the acquire method.
* <p>
* This implementation ignores attempts to interrupt the thread. If response to
* interruption is needed, use the method <code>acquire(long)</code>
*/
virtual void Acquire();
/**
* Returns the number of nested acquires on this lock that have not been released.
* This is the number of times that release() must be called before the lock is
* freed.
*
* @return the number of nested acquires that have not been released
*/
virtual int GetDepth() = 0;
/**
* Releases this lock. Locks must only be released by the thread that currently
* owns the lock.
*/
virtual void Release() = 0;
};
}
#endif // BERRY_ILOCK_H
diff --git a/Plugins/org.blueberry.core.jobs/src/berryIProgressMonitor.h b/Plugins/org.blueberry.core.jobs/src/berryIProgressMonitor.h
index f4559098f6..33761768c4 100644
--- a/Plugins/org.blueberry.core.jobs/src/berryIProgressMonitor.h
+++ b/Plugins/org.blueberry.core.jobs/src/berryIProgressMonitor.h
@@ -1,113 +1,113 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRY_IPROGRESS_MONITOR_H
#define BERRY_IPROGRESS_MONITOR_H
#include <org_blueberry_core_jobs_Export.h>
#include "berryObject.h"
#include <string>
namespace berry
{
struct IProgressMonitor: public Object
{
- berryObjectMacro(berry::IProgressMonitor)
+ berryObjectMacro(berry::IProgressMonitor);
/** Constant indicating an unknown amount of work. */
static const int UNKNOWN = -1;
/**
* Notifies that the main task is beginning. This must only be called once
* on a given progress monitor instance.
*
* @param name the name (or description) of the main task
* @param totalWork the total number of work units into which
* the main task is been subdivided. If the value is <code>UNKNOWN</code>
* the implementation is free to indicate progress in a way which
* doesn't require the total number of work units in advance.
*/
virtual void BeginTask(const std::string& name, int totalWork) = 0;
/**
* Notifies that the work is done; that is, either the main task is completed
* or the user canceled it. This method may be called more than once
* (implementations should be prepared to handle this case).
*/
virtual void Done() = 0;
/**
* Internal method to handle scaling correctly. This method
* must not be called by a client. Clients should
* always use the method <code>worked(int)</code>.
*
* @param work the amount of work done
*/
virtual void InternalWorked(double work) = 0;
/**
* Returns whether cancellation of current operation has been requested.
* Long-running operations should poll to see if cancellation
* has been requested.
*
* @return <code>true</code> if cancellation has been requested,
* and <code>false</code> otherwise
* @see #setCanceled(bool)
*/
virtual bool IsCanceled() = 0;
/**
* Sets the cancel state to the given value.
*
* @param value <code>true</code> indicates that cancellation has
* been requested (but not necessarily acknowledged);
* <code>false</code> clears this flag
* @see #isCanceled()
*/
virtual void SetCanceled(bool value) = 0;
/**
* Sets the task name to the given value. This method is used to
* restore the task label after a nested operation was executed.
* Normally there is no need for clients to call this method.
*
* @param name the name (or description) of the main task
* @see #beginTask
*/
virtual void SetTaskName(const std::string& name) = 0;
/**
* Notifies that a subtask of the main task is beginning.
* Subtasks are optional; the main task might not have subtasks.
*
* @param name the name (or description) of the subtask
*/
virtual void SubTask(const std::string& name) = 0;
/**
* Notifies that a given number of work unit of the main task
* has been completed. Note that this amount represents an
* installment, as opposed to a cumulative amount of work done
* to date.
*
* @param work a non-negative number of work units just completed
*/
virtual void Worked(int work) = 0;
};
}
#endif /* _BERRY_IPROGRESS_MONITOR_H */
diff --git a/Plugins/org.blueberry.core.jobs/src/berryIProgressMonitorWithBlocking.h b/Plugins/org.blueberry.core.jobs/src/berryIProgressMonitorWithBlocking.h
index 094fd7ea35..44d4a4174c 100644
--- a/Plugins/org.blueberry.core.jobs/src/berryIProgressMonitorWithBlocking.h
+++ b/Plugins/org.blueberry.core.jobs/src/berryIProgressMonitorWithBlocking.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _BERRY_IPROGRESSMONITORWITHBLOCKING_H
#define _BERRY_IPROGRESSMONITORWITHBLOCKING_H
#include "berryObject.h"
#include <org_blueberry_core_jobs_Export.h>
#include "berryIStatus.h"
#include "berryIProgressMonitor.h"
namespace berry
{
/**
* An extension to the IProgressMonitor interface for monitors that want to
* support feedback when an activity is blocked due to concurrent activity in
* another thread.
* <p>
* When a monitor that supports this extension is passed to an operation, the
* operation should call <code>setBlocked</code> whenever it knows that it
* must wait for a lock that is currently held by another thread. The operation
* should continue to check for and respond to cancellation requests while
* blocked. When the operation is no longer blocked, it must call <code>clearBlocked</code>
* to clear the blocked state.
* <p>
* This interface can be used without OSGi running.
* </p><p>
* Clients may implement this interface.
* </p>
* @see IProgressMonitor
*/
struct BERRY_JOBS IProgressMonitorWithBlocking: public IProgressMonitor
{
- berryObjectMacro(berry::IProgressMonitorWithBlocking)
+ berryObjectMacro(berry::IProgressMonitorWithBlocking);
/**
* Indicates that this operation is blocked by some background activity. If
* a running operation ever calls <code>setBlocked</code>, it must
* eventually call <code>clearBlocked</code> before the operation
* completes.
* <p>
* If the caller is blocked by a currently executing job, this method will return
* an <code>IJobStatus</code> indicating the job that is currently blocking
* the caller. If this blocking job is not known, this method will return a plain
* informational <code>IStatus</code> object.
* </p>
*
* @param reason an optional status object whose message describes the
* reason why this operation is blocked, or <code>null</code> if this
* information is not available.
* @see #clearBlocked()
*/
virtual void SetBlocked(IStatus::Pointer reason)= 0;
/**
* Clears the blocked state of the running operation. If a running
* operation ever calls <code>setBlocked</code>, it must eventually call
* <code>clearBlocked</code> before the operation completes.
*
* @see #setBlocked(IStatus)
*/
virtual void ClearBlocked() = 0;
};
}
#endif /* _BERRY_IPROGRESSMONITORWITHBLOCKING_H */
diff --git a/Plugins/org.blueberry.core.jobs/src/berryISchedulingRule.h b/Plugins/org.blueberry.core.jobs/src/berryISchedulingRule.h
index 5430765eb3..97cd93d78e 100644
--- a/Plugins/org.blueberry.core.jobs/src/berryISchedulingRule.h
+++ b/Plugins/org.blueberry.core.jobs/src/berryISchedulingRule.h
@@ -1,89 +1,89 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _BERRY_ISCHEDULING_RULE_H_
#define _BERRY_ISCHEDULING_RULE_H_
#include <org_blueberry_core_jobs_Export.h>
#include <berryObject.h>
namespace berry
{
/**
* Scheduling rules are used by jobs to indicate when they need exclusive access
* to a resource.
* @todo
* Scheduling rules can also be applied synchronously to a thread
* using <tt>IJobManager.beginRule(ISchedulingRule)</tt> and
* <tt>IJobManager.endRule(ISchedulingRule)</tt>.
*
* The job manager guarantees that
* no two jobs with conflicting scheduling rules will run concurrently.
* @todo
* Multiple rules can be applied to a given thread only if the outer rule explicitly
* allows the nesting as specified by the <code>contains</code> method.
*
* <p>
* Clients may implement this interface.
*
* @see Job#GetRule()
* @see Job#SetRule(ISchedulingRule)
* @see Job#Schedule(long)
* @see IJobManager#BeginRule(ISchedulingRule, org.eclipse.core.runtime.IProgressMonitor)
* @see IJobManager#EndRule(ISchedulingRule)
*/
struct BERRY_JOBS ISchedulingRule: public Object
{
- berryObjectMacro(berry::ISchedulingRule)
+ berryObjectMacro(berry::ISchedulingRule);
/**
* Returns whether this scheduling rule completely contains another scheduling
* rule. Rules can only be nested within a thread if the inner rule is completely
* contained within the outer rule.
* <p>
* Implementations of this method must obey the rules of a partial order relation
* on the set of all scheduling rules. In particular, implementations must be reflexive
* (a.contains(a) is always true), antisymmetric (a.contains(b) and b.contains(a) iff
* equals(b),
* and transitive (if a.contains(b) and b.contains(c), then a.contains(c)). Implementations
* of this method must return <code>false</code> when compared to a rule they
* know nothing about.
*
* @param rule the rule to check for containment
* @return <code>true</code> if this rule contains the given rule, and
* <code>false</code> otherwise.
*/
virtual bool Contains(ISchedulingRule::Pointer rule) const = 0;
/**
* Returns whether this scheduling rule is compatible with another scheduling rule.
* If <code>true</code> is returned, then no job with this rule will be run at the
* same time as a job with the conflicting rule. If <code>false</code> is returned,
* then the job manager is free to run jobs with these rules at the same time.
* <p>
* Implementations of this method must be reflexive, symmetric, and consistent,
* and must return <code>false</code> when compared to a rule they know
* nothing about.
*
* @param rule the rule to check for conflicts
* @return <code>true</code> if the rule is conflicting, and <code>false</code>
* otherwise.
*/
virtual bool IsConflicting(ISchedulingRule::Pointer myRule) const = 0;
};
}
#endif // _BERRY_ISCHEDULING_RULE_H_
diff --git a/Plugins/org.blueberry.core.runtime/src/berryIAdapterManager.h b/Plugins/org.blueberry.core.runtime/src/berryIAdapterManager.h
index 1cf2b67751..eb4b638a76 100644
--- a/Plugins/org.blueberry.core.runtime/src/berryIAdapterManager.h
+++ b/Plugins/org.blueberry.core.runtime/src/berryIAdapterManager.h
@@ -1,283 +1,283 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIADAPTERMANAGER_H_
#define BERRYIADAPTERMANAGER_H_
#include <berryMacros.h>
#include <org_blueberry_core_runtime_Export.h>
#include "berryPlatformObject.h"
#include "berryIAdapterFactory.h"
#include <QtPlugin>
#include <typeinfo>
namespace berry
{
/**
* An adapter manager maintains a registry of adapter factories. Clients
* directly invoke methods on an adapter manager to register and unregister
* adapters. All adaptable objects (that is, objects that implement the <code>IAdaptable</code>
* interface) tunnel <code>IAdaptable.getAdapter</code> invocations to their
* adapter manager's <code>IAdapterManger.getAdapter</code> method. The
* adapter manager then forwards this request unmodified to the <code>IAdapterFactory.getAdapter</code>
* method on one of the registered adapter factories.
* <p>
* Adapter factories can be registered programmatically using the <code>registerAdapters</code>
* method. Alternatively, they can be registered declaratively using the
* <code>org.blueberry.core.runtime.adapters</code> extension point. Factories registered
* with this extension point will not be able to provide adapters until their
* corresponding plugin has been activated.
* <p>
* The following code snippet shows how one might register an adapter of type
* <code>com.example.acme.Sticky</code> on resources in the workspace.
* <p>
*
* <pre>
* IAdapterFactory pr = new IAdapterFactory() {
* public Class[] getAdapterList() {
* return new Class[] { com.example.acme.Sticky.class };
* }
* public Object getAdapter(Object adaptableObject, Class adapterType) {
* IResource res = (IResource) adaptableObject;
* QualifiedName key = new QualifiedName(&quot;com.example.acme&quot;, &quot;sticky-note&quot;);
* try {
* com.example.acme.Sticky v = (com.example.acme.Sticky) res.getSessionProperty(key);
* if (v == null) {
* v = new com.example.acme.Sticky();
* res.setSessionProperty(key, v);
* }
* } catch (CoreException e) {
* // unable to access session property - ignore
* }
* return v;
* }
* }
* Platform.getAdapterManager().registerAdapters(pr, IResource.class);
* </pre>
*
* </p><p>
* This interface can be used without OSGi running.
* </p><p>
* This interface is not intended to be implemented by clients.
* </p>
* @see IAdaptable
* @see IAdapterFactory
*/
struct org_blueberry_core_runtime_EXPORT IAdapterManager: public Object
{
- berryObjectMacro(berry::IAdapterManager)
+ berryObjectMacro(berry::IAdapterManager);
/**
* This value can be returned to indicate that no applicable adapter factory
* was found.
* @since org.blueberry.equinox.common 3.3
*/
static const int NONE;
/**
* This value can be returned to indicate that an adapter factory was found,
* but has not been loaded.
* @since org.blueberry.equinox.common 3.3
*/
static const int NOT_LOADED;
/**
* This value can be returned to indicate that an adapter factory is loaded.
* @since org.blueberry.equinox.common 3.3
*/
static const int LOADED;
/**
* Returns a Poco::Any object which contains an instance of the given name associated
* with the given adaptable. Returns an empty Poco::Any if no such object can
* be found.
* <p>
* Note that this method will never cause plug-ins to be loaded. If the
* only suitable factory is not yet loaded, this method will return an empty Poco::Any.
* If activation of the plug-in providing the factory is required, use the
* <code>LoadAdapter</code> method instead.
*
* @param adaptable the adaptable object being queried (usually an instance
* of <code>IAdaptable</code>)
* @param adapterTypeName the fully qualified name of the type of adapter to look up
* @return a Poco::Any castable to the given adapter type, or empty
* if the given adaptable object does not have an available adapter of the
* given type
*/
template<typename A>
A* GetAdapter(const Object* adaptable)
{
const char* typeName = qobject_interface_iid<A*>();
if (typeName == nullptr)
{
BERRY_WARN << "Error getting adapter for '" << Reflection::GetClassName(adaptable) << "': "
<< "Cannot get the interface id for type '" << Reflection::GetClassName<A>()
<< "'. It is probably missing a Q_DECLARE_INTERFACE macro in its header.";
return nullptr;
}
return dynamic_cast<A*>(this->GetAdapter(adaptable, typeName, false));
}
/**
* Returns an object which is an instance of the given class name associated
* with the given object. Returns <code>null</code> if no such object can
* be found.
* <p>
* Note that this method will never cause plug-ins to be loaded. If the
* only suitable factory is not yet loaded, this method will return <code>null</code>.
* If activation of the plug-in providing the factory is required, use the
* <code>loadAdapter</code> method instead.
*
* @param adaptable the adaptable object being queried (usually an instance
* of <code>IAdaptable</code>)
* @param adapterTypeName the fully qualified name of the type of adapter to look up
* @return an object castable to the given adapter type, or <code>null</code>
* if the given adaptable object does not have an available adapter of the
* given type
*/
virtual Object* GetAdapter(const Object* adaptable, const QString& adapterTypeName) = 0;
/**
* Returns whether there is an adapter factory registered that may be able
* to convert <code>adaptable</code> to an object of type <code>adapterTypeName</code>.
* <p>
* Note that a return value of <code>true</code> does not guarantee that
* a subsequent call to <code>GetAdapter</code> with the same arguments
* will return a non-empty result. If the factory's plug-in has not yet been
* loaded, or if the factory itself returns nothing, then
* <code>GetAdapter</code> will still return an empty Poco::Any.
*
* @param adaptable the adaptable object being queried (usually an instance
* of <code>IAdaptable</code>)
* @param adapterTypeName the fully qualified class name of an adapter to
* look up
* @return <code>true</code> if there is an adapter factory that claims
* it can convert <code>adaptable</code> to an object of type <code>adapterType</code>,
* and <code>false</code> otherwise.
*/
virtual bool HasAdapter(const Object* adaptableType, const QString& adapterType) = 0;
template<typename A>
int QueryAdapter(const Object* adaptable)
{
const char* typeName = qobject_interface_iid<A*>();
if (typeName == nullptr)
{
BERRY_WARN << "Error querying adapter manager for '" << Reflection::GetClassName(adaptable) << "': "
<< "Cannot get the interface id for type '" << Reflection::GetClassName<A>()
<< "'. It is probably missing a Q_DECLARE_INTERFACE macro in its header.";
return NONE;
}
return this->QueryAdapter(adaptable, typeName);
}
/**
* Returns a status of an adapter factory registered that may be able
* to convert <code>adaptable</code> to an object of type <code>adapterTypeName</code>.
* <p>
* One of the following values can be returned:<ul>
* <li>{@link berry::IAdapterManager::NONE} if no applicable adapter factory was found;</li>
* <li>{@link berry::IAdapterManager::NOT_LOADED} if an adapter factory was found, but has not been loaded;</li>
* <li>{@link berry::IAdapterManager::LOADED} if an adapter factory was found, and it is loaded.</li>
* </ul></p>
* @param adaptable the adaptable object being queried (usually an instance
* of <code>IAdaptable</code>)
* @param adapterTypeName the fully qualified class name of an adapter to
* look up
* @return a status of the adapter
*/
virtual int QueryAdapter(const Object* adaptableType, const QString& adapterType) = 0;
/**
* Returns an object that is an instance of the given class name associated
* with the given object. Returns an empty Poco::Any if no such object can
* be found.
* <p>
* Note that unlike the <code>GetAdapter</code> methods, this method
* will cause the plug-in that contributes the adapter factory to be loaded
* if necessary. As such, this method should be used judiciously, in order
* to avoid unnecessary plug-in activations. Most clients should avoid
* activation by using <code>GetAdapter</code> instead.
*
* @param adaptable the adaptable object being queried (usually an instance
* of <code>IAdaptable</code>)
* @param adapterTypeName the fully qualified name of the type of adapter to look up
* @return a Poco::Any castable to the given adapter type, or empty
* if the given adaptable object does not have an available adapter of the
* given type
*/
template<typename A>
A* LoadAdapter(const Object* adaptable)
{
const char* typeName = qobject_interface_iid<A*>();
if (typeName == nullptr)
{
BERRY_WARN << "Error getting adapter for '" << Reflection::GetClassName(adaptable) << "': "
<< "Cannot get the interface id for type '" << Reflection::GetClassName<A>()
<< "'. It is probably missing a Q_DECLARE_INTERFACE macro in its header.";
return nullptr;
}
return dynamic_cast<A*>(this->GetAdapter(adaptable, typeName, true));
}
/**
* Registers the given adapter factory as extending objects of the given
* type.
*
* @param factory the adapter factory
* @param adaptableTypeName the fully qualified typename being extended
* @see #UnregisterAdapters(IAdapterFactory*)
* @see #UnregisterAdapters(IAdapterFactory*, const std::adaptableTypeName&)
*/
virtual void RegisterAdapters(IAdapterFactory* factory,
const QString& adaptableTypeName) = 0;
/**
* Removes the given adapter factory completely from the list of registered
* factories. Equivalent to calling <code>UnregisterAdapters(IAdapterFactory*, const std::string&)</code>
* on all classes against which it had been explicitly registered. Does
* nothing if the given factory is not currently registered.
*
* @param factory the adapter factory to remove
* @see #RegisterAdapters(IAdapterFactory*, const std::string&)
*/
virtual void UnregisterAdapters(IAdapterFactory* factory) = 0;
/**
* Removes the given adapter factory from the list of factories registered
* as extending the given class. Does nothing if the given factory and type
* combination is not registered.
*
* @param factory the adapter factory to remove
* @param adaptableTypeName one of the type names against which the given factory is
* registered
* @see #RegisterAdapters(IAdapterFactory*, const std::string&)
*/
virtual void UnregisterAdapters(IAdapterFactory* factory,
const QString& adaptableTypeName) = 0;
private:
virtual Object* GetAdapter(const Object* adaptable, const QString& adapterType, bool force) = 0;
};
} // namespace berry
Q_DECLARE_INTERFACE(berry::IAdapterManager, "org.blueberry.service.IAdapterManager")
#endif /*BERRYIADAPTERMANAGER_H_*/
diff --git a/Plugins/org.blueberry.core.runtime/src/berryIBerryPreferences.h b/Plugins/org.blueberry.core.runtime/src/berryIBerryPreferences.h
index 71be207656..f5da10242f 100644
--- a/Plugins/org.blueberry.core.runtime/src/berryIBerryPreferences.h
+++ b/Plugins/org.blueberry.core.runtime/src/berryIBerryPreferences.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIBERRYPREFERENCES_H_
#define BERRYIBERRYPREFERENCES_H_
#include <org_blueberry_core_runtime_Export.h>
#include "berryIPreferences.h"
#include "berryMessage.h"
namespace berry
{
/**
* Like IEclipsePreferences an extension to the osgi-IPreferences
* to send out events when nodes or values changed in a node.
*/
struct org_blueberry_core_runtime_EXPORT IBerryPreferences : virtual public IPreferences
{
- berryObjectMacro(berry::IBerryPreferences)
+ berryObjectMacro(berry::IBerryPreferences);
class org_blueberry_core_runtime_EXPORT ChangeEvent {
IBerryPreferences* const m_Source;
const QString m_Property;
const QString m_OldValue;
const QString m_NewValue;
public:
ChangeEvent(IBerryPreferences* source, const QString& property,
const QString& oldValue, const QString& newValue);
IBerryPreferences* GetSource() const;
QString GetProperty() const;
QString GetOldValue() const;
QString GetNewValue() const;
};
~IBerryPreferences() override;
/**
* Invoked when this node was changed, that is when a property
* was changed or when a new child node was inserted.
*/
berry::Message1<const IBerryPreferences*> OnChanged;
/**
* Adds a property change listener to this preferences node.
* The listener will be informed about property changes of
* this preference node, but not about changes to child nodes.
*/
berry::Message1<const ChangeEvent&> OnPropertyChanged;
};
} // namespace berry
#endif /*BERRYIBERRYPREFERENCES_H_*/
diff --git a/Plugins/org.blueberry.core.runtime/src/berryIPreferences.h b/Plugins/org.blueberry.core.runtime/src/berryIPreferences.h
index 23fa8cade5..c0d4d91086 100644
--- a/Plugins/org.blueberry.core.runtime/src/berryIPreferences.h
+++ b/Plugins/org.blueberry.core.runtime/src/berryIPreferences.h
@@ -1,709 +1,709 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIPREFERENCES_H_
#define BERRYIPREFERENCES_H_
#include <org_blueberry_core_runtime_Export.h>
#include "berryObject.h"
#include "berryBackingStoreException.h"
namespace berry
{
/**
* A node in a hierarchical collection of preference data.
*
* <p>
* This interface allows applications to store and retrieve user and system
* preference data. This data is stored persistently in an
* implementation-dependent backing store. Typical implementations include flat
* files, OS-specific registries, directory servers and SQL databases.
*
* <p>
* For each bundle, there is a separate tree of nodes for each user, and one for
* system preferences. The precise description of "user" and "system" will vary
* from one bundle to another. Typical information stored in the user preference
* tree might include font choice, and color choice for a bundle which interacts
* with the user via a servlet. Typical information stored in the system
* preference tree might include installation data, or things like high score
* information for a game program.
*
* <p>
* Nodes in a preference tree are named in a similar fashion to directories in a
* hierarchical file system. Every node in a preference tree has a <i>node name
* </i> (which is not necessarily unique), a unique <i>absolute path name </i>,
* and a path name <i>relative </i> to each ancestor including itself.
*
* <p>
* The root node has a node name of the empty <code>QString</code> object ("").
* Every other node has an arbitrary node name, specified at the time it is
* created. The only restrictions on this name are that it cannot be the empty
* string, and it cannot contain the slash character ('/').
*
* <p>
* The root node has an absolute path name of <code>"/"</code>. Children of the
* root node have absolute path names of <code>"/" + </code> <i>&lt;node name&gt;
* </i>. All other nodes have absolute path names of <i>&lt;parent's absolute
* path name&gt; </i> <code> + "/" + </code> <i>&lt;node name&gt; </i>. Note that
* all absolute path names begin with the slash character.
*
* <p>
* A node <i>n </i>'s path name relative to its ancestor <i>a </i> is simply the
* string that must be appended to <i>a </i>'s absolute path name in order to
* form <i>n </i>'s absolute path name, with the initial slash character (if
* present) removed. Note that:
* <ul>
* <li>No relative path names begin with the slash character.
* <li>Every node's path name relative to itself is the empty string.
* <li>Every node's path name relative to its parent is its node name (except
* for the root node, which does not have a parent).
* <li>Every node's path name relative to the root is its absolute path name
* with the initial slash character removed.
* </ul>
*
* <p>
* Note finally that:
* <ul>
* <li>No path name contains multiple consecutive slash characters.
* <li>No path name with the exception of the root's absolute path name end in
* the slash character.
* <li>Any string that conforms to these two rules is a valid path name.
* </ul>
*
* <p>
* Each <code>Preference</code> node has zero or more properties associated with
* it, where a property consists of a name and a value. The bundle writer is
* free to choose any appropriate names for properties. Their values can be of
* type <code>QString</code>,<code>long</code>,<code>int</code>,<code>bool</code>,
* <code>std::vector<char></code>,<code>float</code>, or <code>double</code> but they can
* always be accessed as if they were <code>QString</code> objects.
*
* <p>
* All node name and property name comparisons are case-sensitive.
*
* <p>
* All of the methods that modify preference data are permitted to operate
* asynchronously; they may return immediately, and changes will eventually
* propagate to the persistent backing store, with an implementation-dependent
* delay. The <code>flush</code> method may be used to synchronously force updates
* to the backing store.
*
* <p>
* Implementations must automatically attempt to flush to the backing store any
* pending updates for a bundle's preferences when the bundle is stopped or
* otherwise ungets the IPreferences Service.
*
* <p>
* The methods in this class may be invoked concurrently by multiple threads in
* a single Java Virtual Machine (JVM) without the need for external
* synchronization, and the results will be equivalent to some serial execution.
* If this class is used concurrently <i>by multiple JVMs </i> that store their
* preference data in the same backing store, the data store will not be
* corrupted, but no other guarantees are made concerning the consistency of the
* preference data.
*
*
* @version $Revision$
*/
struct org_blueberry_core_runtime_EXPORT IPreferences : virtual public Object
{
- berryObjectMacro(berry::IPreferences)
+ berryObjectMacro(berry::IPreferences);
~IPreferences() override;
/**
* Associates the specified value with the specified key in this node.
*
* @param key key with which the specified value is to be associated.
* @param value value to be associated with the specified key.
* @throws NullPointerException if <code>key</code> or <code>value</code> is
* <code>null</code>.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
*/
virtual void Put(const QString& key, const QString& value) = 0;
/**
* Returns the value associated with the specified <code>key</code> in this
* node. Returns the specified default if there is no value associated with
* the <code>key</code>, or the backing store is inaccessible.
*
* @param key key whose associated value is to be returned.
* @param def the value to be returned in the event that this node has no
* value associated with <code>key</code> or the backing store is
* inaccessible.
* @return the value associated with <code>key</code>, or <code>def</code> if
* no value is associated with <code>key</code>.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
* @throws NullPointerException if <code>key</code> is <code>null</code>. (A
* <code>null</code> default <i>is </i> permitted.)
*/
virtual QString Get(const QString& key, const QString& def) const = 0;
/**
* Removes the value associated with the specified <code>key</code> in this
* node, if any.
*
* @param key key whose mapping is to be removed from this node.
* @see #get(const QString&,const QString&)
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
*/
virtual void Remove(const QString& key) = 0;
/**
* Removes all of the properties (key-value associations) in this node. This
* call has no effect on any descendants of this node.
*
* @throws BackingStoreException if this operation cannot be completed due
* to a failure in the backing store, or inability to communicate
* with it.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
* @see #remove(const QString&)
*/
virtual void Clear() = 0;
/**
* Associates a <code>QString</code> object representing the specified
* <code>int</code> value with the specified <code>key</code> in this node. The
* associated string is the one that would be returned if the <code>int</code>
* value were passed to <code>Integer.toString(int)</code>. This method is
* intended for use in conjunction with {@link #getInt}method.
*
* <p>
* Implementor's note: it is <i>not </i> necessary that the property value
* be represented by a <code>QString</code> object in the backing store. If the
* backing store supports integer values, it is not unreasonable to use
* them. This implementation detail is not visible through the
* <code>IPreferences</code> API, which allows the value to be read as an
* <code>int</code> (with <code>getInt</code> or a <code>QString</code> (with
* <code>get</code>) type.
*
* @param key key with which the string form of value is to be associated.
* @param value <code>value</code> whose string form is to be associated with
* <code>key</code>.
* @throws NullPointerException if <code>key</code> is <code>null</code>.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
* @see #getInt(const QString&,int)
*/
virtual void PutInt(const QString& key, int value) = 0;
/**
* Returns the <code>int</code> value represented by the <code>QString</code>
* object associated with the specified <code>key</code> in this node. The
* <code>QString</code> object is converted to an <code>int</code> as by
* <code>Integer.parseInt(QString)</code>. Returns the specified default if
* there is no value associated with the <code>key</code>, the backing store
* is inaccessible, or if <code>Integer.parseInt(QString)</code> would throw a
* <code>NumberFormatException</code> if the associated <code>value</code> were
* passed. This method is intended for use in conjunction with the
* {@link #putInt}method.
*
* @param key key whose associated value is to be returned as an
* <code>int</code>.
* @param def the value to be returned in the event that this node has no
* value associated with <code>key</code> or the associated value
* cannot be interpreted as an <code>int</code> or the backing store is
* inaccessible.
* @return the <code>int</code> value represented by the <code>QString</code>
* object associated with <code>key</code> in this node, or
* <code>def</code> if the associated value does not exist or cannot
* be interpreted as an <code>int</code> type.
* @throws NullPointerException if <code>key</code> is <code>null</code>.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
* @see #putInt(const QString&,int)
* @see #get(const QString&,const QString&)
*/
virtual int GetInt(const QString& key, int def) const = 0;
/**
* Associates a <code>QString</code> object representing the specified
* <code>long</code> value with the specified <code>key</code> in this node. The
* associated <code>QString</code> object is the one that would be returned if
* the <code>long</code> value were passed to <code>Long.toString(long)</code>.
* This method is intended for use in conjunction with the {@link #getLong}
* method.
*
* <p>
* Implementor's note: it is <i>not </i> necessary that the <code>value</code>
* be represented by a <code>QString</code> type in the backing store. If the
* backing store supports <code>long</code> values, it is not unreasonable to
* use them. This implementation detail is not visible through the <code>
* IPreferences</code> API, which allows the value to be read as a
* <code>long</code> (with <code>getLong</code> or a <code>QString</code> (with
* <code>get</code>) type.
*
* @param key <code>key</code> with which the string form of <code>value</code>
* is to be associated.
* @param value <code>value</code> whose string form is to be associated with
* <code>key</code>.
* @throws NullPointerException if <code>key</code> is <code>null</code>.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
* @see #getLong(const QString&,long)
*/
virtual void PutLong(const QString& key, long value) = 0;
/**
* Returns the <code>long</code> value represented by the <code>QString</code>
* object associated with the specified <code>key</code> in this node. The
* <code>QString</code> object is converted to a <code>long</code> as by
* <code>Long.parseLong(QString)</code>. Returns the specified default if
* there is no value associated with the <code>key</code>, the backing store
* is inaccessible, or if <code>Long.parseLong(QString)</code> would throw a
* <code>NumberFormatException</code> if the associated <code>value</code> were
* passed. This method is intended for use in conjunction with the
* {@link #putLong}method.
*
* @param key <code>key</code> whose associated value is to be returned as a
* <code>long</code> value.
* @param def the value to be returned in the event that this node has no
* value associated with <code>key</code> or the associated value
* cannot be interpreted as a <code>long</code> type or the backing
* store is inaccessible.
* @return the <code>long</code> value represented by the <code>QString</code>
* object associated with <code>key</code> in this node, or
* <code>def</code> if the associated value does not exist or cannot
* be interpreted as a <code>long</code> type.
* @throws NullPointerException if <code>key</code> is <code>null</code>.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
* @see #putLong(const QString&,long)
* @see #get(const QString&,const QString&)
*/
virtual long GetLong(const QString& key, long def) const = 0;
/**
* Associates a <code>QString</code> object representing the specified
* <code>bool</code> value with the specified key in this node. The
* associated string is "true" if the value is <code>true</code>, and "false"
* if it is <code>false</code>. This method is intended for use in
* conjunction with the {@link #getBool}method.
*
* <p>
* Implementor's note: it is <i>not </i> necessary that the value be
* represented by a string in the backing store. If the backing store
* supports <code>bool</code> values, it is not unreasonable to use them.
* This implementation detail is not visible through the <code>IPreferences
* </code> API, which allows the value to be read as a <code>bool</code>
* (with <code>getBool</code>) or a <code>QString</code> (with <code>get</code>)
* type.
*
* @param key <code>key</code> with which the string form of value is to be
* associated.
* @param value value whose string form is to be associated with
* <code>key</code>.
* @throws NullPointerException if <code>key</code> is <code>null</code>.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
* @see #getBool(const QString&,bool)
* @see #get(const QString&,const QString&)
*/
virtual void PutBool(const QString& key, bool value) = 0;
/**
* Returns the <code>bool</code> value represented by the <code>QString</code>
* object associated with the specified <code>key</code> in this node. Valid
* strings are "true", which represents <code>true</code>, and "false", which
* represents <code>false</code>. Case is ignored, so, for example, "TRUE"
* and "False" are also valid. This method is intended for use in
* conjunction with the {@link #putBool}method.
*
* <p>
* Returns the specified default if there is no value associated with the
* <code>key</code>, the backing store is inaccessible, or if the associated
* value is something other than "true" or "false", ignoring case.
*
* @param key <code>key</code> whose associated value is to be returned as a
* <code>bool</code>.
* @param def the value to be returned in the event that this node has no
* value associated with <code>key</code> or the associated value
* cannot be interpreted as a <code>bool</code> or the backing store
* is inaccessible.
* @return the <code>bool</code> value represented by the <code>std::string</code>
* object associated with <code>key</code> in this node, or
* <code>null</code> if the associated value does not exist or cannot
* be interpreted as a <code>bool</code>.
* @throws NullPointerException if <code>key</code> is <code>null</code>.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
* @see #get(const QString&,const QString&)
* @see #putBool(const QString&,bool)
*/
virtual bool GetBool(const QString& key, bool def) const = 0;
/**
* Associates a <code>QString</code> object representing the specified
* <code>float</code> value with the specified <code>key</code> in this node.
* The associated <code>QString</code> object is the one that would be returned
* if the <code>float</code> value were passed to
* <code>Float.toString(float)</code>. This method is intended for use in
* conjunction with the {@link #getFloat}method.
*
* <p>
* Implementor's note: it is <i>not </i> necessary that the value be
* represented by a string in the backing store. If the backing store
* supports <code>float</code> values, it is not unreasonable to use them.
* This implementation detail is not visible through the <code>IPreferences
* </code> API, which allows the value to be read as a <code>float</code> (with
* <code>getFloat</code>) or a <code>QString</code> (with <code>get</code>) type.
*
* @param key <code>key</code> with which the string form of value is to be
* associated.
* @param value value whose string form is to be associated with
* <code>key</code>.
* @throws NullPointerException if <code>key</code> is <code>null</code>.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
* @see #getFloat(const QString&,float)
*/
virtual void PutFloat(const QString& key, float value) = 0;
/**
* Returns the float <code>value</code> represented by the <code>QString</code>
* object associated with the specified <code>key</code> in this node. The
* <code>QString</code> object is converted to a <code>float</code> value as by
* <code>Float.parseFloat(QString)</code>. Returns the specified default if
* there is no value associated with the <code>key</code>, the backing store
* is inaccessible, or if <code>Float.parseFloat(QString)</code> would throw a
* <code>NumberFormatException</code> if the associated value were passed.
* This method is intended for use in conjunction with the {@link #putFloat}
* method.
*
* @param key <code>key</code> whose associated value is to be returned as a
* <code>float</code> value.
* @param def the value to be returned in the event that this node has no
* value associated with <code>key</code> or the associated value
* cannot be interpreted as a <code>float</code> type or the backing
* store is inaccessible.
* @return the <code>float</code> value represented by the string associated
* with <code>key</code> in this node, or <code>def</code> if the
* associated value does not exist or cannot be interpreted as a
* <code>float</code> type.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
* @throws NullPointerException if <code>key</code> is <code>null</code>.
* @see #putFloat(const QString&,float)
* @see #get(const QString&,const QString&)
*/
virtual float GetFloat(const QString& key, float def) const = 0;
/**
* Associates a <code>QString</code> object representing the specified
* <code>double</code> value with the specified <code>key</code> in this node.
* The associated <code>QString</code> object is the one that would be returned
* if the <code>double</code> value were passed to
* <code>Double.toString(double)</code>. This method is intended for use in
* conjunction with the {@link #getDouble}method
*
* <p>
* Implementor's note: it is <i>not </i> necessary that the value be
* represented by a string in the backing store. If the backing store
* supports <code>double</code> values, it is not unreasonable to use them.
* This implementation detail is not visible through the <code>IPreferences
* </code> API, which allows the value to be read as a <code>double</code> (with
* <code>getDouble</code>) or a <code>QString</code> (with <code>get</code>)
* type.
*
* @param key <code>key</code> with which the string form of value is to be
* associated.
* @param value value whose string form is to be associated with
* <code>key</code>.
* @throws NullPointerException if <code>key</code> is <code>null</code>.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
* @see #getDouble(const QString&,double)
*/
virtual void PutDouble(const QString& key, double value) = 0;
/**
* Returns the <code>double</code> value represented by the <code>QString</code>
* object associated with the specified <code>key</code> in this node. The
* <code>QString</code> object is converted to a <code>double</code> value as by
* <code>Double.parseDouble(QString)</code>. Returns the specified default if
* there is no value associated with the <code>key</code>, the backing store
* is inaccessible, or if <code>Double.parseDouble(QString)</code> would throw
* a <code>NumberFormatException</code> if the associated value were passed.
* This method is intended for use in conjunction with the
* {@link #putDouble}method.
*
* @param key <code>key</code> whose associated value is to be returned as a
* <code>double</code> value.
* @param def the value to be returned in the event that this node has no
* value associated with <code>key</code> or the associated value
* cannot be interpreted as a <code>double</code> type or the backing
* store is inaccessible.
* @return the <code>double</code> value represented by the <code>QString</code>
* object associated with <code>key</code> in this node, or
* <code>def</code> if the associated value does not exist or cannot
* be interpreted as a <code>double</code> type.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the the {@link #removeNode()}method.
* @throws NullPointerException if <code>key</code> is <code>null</code>.
* @see #putDouble(const QString&,double)
* @see #get(const QString&,const QString&)
*/
virtual double GetDouble(const QString& key, double def) const = 0;
/**
* Associates a <code>QByteArray</code> object representing the specified
* <code>QByteArray</code> with the specified <code>key</code> in this node. The
* associated <code>QByteArray</code> object is stored in <i>Base64</i> encoding.
* This method is intended for use in conjunction with the
* {@link #getByteArray}method.
*
* @param key <code>key</code> with which the string form of <code>value</code>
* is to be associated.
* @param value <code>value</code> whose string form is to be associated with
* <code>key</code>.
* @throws NullPointerException if <code>key</code> or <code>value</code> is
* <code>null</code>.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
* @see #GetByteArray(const QString&,const QByteArray&)
* @see #Get(const QString&,const QString&)
*/
virtual void PutByteArray(const QString& key, const QByteArray& value) = 0;
/**
* Returns the <code>QByteArray</code> value represented by the <code>QString</code>
* object associated with the specified <code>key</code> in this node. Valid
* <code>QString</code> objects are <i>Base64 </i> encoded binary data, as
* defined in <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045 </a>,
* Section 6.8, with one minor change: the string must consist solely of
* characters from the <i>Base64 Alphabet </i>; no newline characters or
* extraneous characters are permitted. This method is intended for use in
* conjunction with the {@link #putByteArray}method.
*
* <p>
* Returns the specified default if there is no value associated with the
* <code>key</code>, the backing store is inaccessible, or if the associated
* value is not a valid Base64 encoded byte array (as defined above).
*
* @param key <code>key</code> whose associated value is to be returned as a
* <code>std::vector<char></code> object.
* @param def the value to be returned in the event that this node has no
* value associated with <code>key</code> or the associated value
* cannot be interpreted as a <code>std::vector<char></code> type, or the backing
* store is inaccessible.
* @return the <code>std::vector<char></code> value represented by the <code>QString</code>
* object associated with <code>key</code> in this node, or
* <code>def</code> if the associated value does not exist or cannot
* be interpreted as a <code>std::vector<char></code>.
* @throws NullPointerException if <code>key</code> is <code>null</code>. (A
* <code>null</code> value for <code>def</code> <i>is </i> permitted.)
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
* @see #get(const QString&,const QString&)
* @see #putByteArray(const QString&,std::vector<char>)
*/
virtual QByteArray GetByteArray(const QString& key, const QByteArray& def) const = 0;
/**
* Returns all of the keys that have an associated value in this node. (The
* returned array will be of size zero if this node has no preferences and
* not <code>null</code>!)
*
* @return an array of the keys that have an associated value in this node.
* @throws BackingStoreException if this operation cannot be completed due
* to a failure in the backing store, or inability to communicate
* with it.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
*/
virtual QStringList Keys() const = 0;
/**
* Returns the names of the children of this node. (The returned array will
* be of size zero if this node has no children and not <code>null</code>!)
*
* @return the names of the children of this node.
* @throws BackingStoreException if this operation cannot be completed due
* to a failure in the backing store, or inability to communicate
* with it.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
*/
virtual QStringList ChildrenNames() const = 0;
/**
* Returns the parent of this node, or <code>null</code> if this is the root.
*
* @return the parent of this node.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
*/
virtual IPreferences::Pointer Parent() const = 0;
/**
* Returns a named <code>IPreferences</code> object (node), creating it and any
* of its ancestors if they do not already exist. Accepts a relative or
* absolute pathname. Absolute pathnames (which begin with <code>'/'</code>)
* are interpreted relative to the root of this node. Relative pathnames
* (which begin with any character other than <code>'/'</code>) are
* interpreted relative to this node itself. The empty string (<code>""</code>)
* is a valid relative pathname, referring to this node itself.
*
* <p>
* If the returned node did not exist prior to this call, this node and any
* ancestors that were created by this call are not guaranteed to become
* persistent until the <code>flush</code> method is called on the returned
* node (or one of its descendants).
*
* @param pathName the path name of the <code>IPreferences</code> object to
* return.
* @return the specified <code>IPreferences</code> object.
* @throws IllegalArgumentException if the path name is invalid.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
* @throws NullPointerException if path name is <code>null</code>.
* @see #flush()
*/
virtual IPreferences::Pointer Node(const QString& pathName) = 0;
/**
* Returns true if the named node exists. Accepts a relative or absolute
* pathname. Absolute pathnames (which begin with <code>'/'</code>) are
* interpreted relative to the root of this node. Relative pathnames (which
* begin with any character other than <code>'/'</code>) are interpreted
* relative to this node itself. The pathname <code>""</code> is valid, and
* refers to this node itself.
*
* <p>
* If this node (or an ancestor) has already been removed with the
* {@link #removeNode()}method, it <i>is </i> legal to invoke this method,
* but only with the pathname <code>""</code>; the invocation will return
* <code>false</code>. Thus, the idiom <code>p.nodeExists("")</code> may be
* used to test whether <code>p</code> has been removed.
*
* @param pathName the path name of the node whose existence is to be
* checked.
* @return true if the specified node exists.
* @throws BackingStoreException if this operation cannot be completed due
* to a failure in the backing store, or inability to communicate
* with it.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method and
* <code>pathname</code> is not the empty string (<code>""</code>).
* @throws IllegalArgumentException if the path name is invalid (i.e., it
* contains multiple consecutive slash characters, or ends with a
* slash character and is more than one character long).
*/
virtual bool NodeExists(const QString& pathName) const = 0;
/**
* Removes this node and all of its descendants, invalidating any properties
* contained in the removed nodes. Once a node has been removed, attempting
* any method other than <code>name()</code>,<code>absolutePath()</code> or
* <code>nodeExists("")</code> on the corresponding <code>IPreferences</code>
* instance will fail with an <code>IllegalStateException</code>. (The
* methods defined on <code>Object</code> can still be invoked on a node after
* it has been removed; they will not throw <code>IllegalStateException</code>.)
*
* <p>
* The removal is not guaranteed to be persistent until the <code>flush</code>
* method is called on the parent of this node.
*
* @throws IllegalStateException if this node (or an ancestor) has already
* been removed with the {@link #removeNode()}method.
* @throws BackingStoreException if this operation cannot be completed due
* to a failure in the backing store, or inability to communicate
* with it.
* @see #flush()
*/
virtual void RemoveNode() = 0;
/**
* Returns this node's name, relative to its parent.
*
* @return this node's name, relative to its parent.
*/
virtual QString Name() const = 0;
/**
* Returns this node's absolute path name. Note that:
* <ul>
* <li>Root node - The path name of the root node is <code>"/"</code>.
* <li>Slash at end - Path names other than that of the root node may not
* end in slash (<code>'/'</code>).
* <li>Unusual names -<code>"."</code> and <code>".."</code> have <i>no </i>
* special significance in path names.
* <li>Illegal names - The only illegal path names are those that contain
* multiple consecutive slashes, or that end in slash and are not the root.
* </ul>
*
* @return this node's absolute path name.
*/
virtual QString AbsolutePath() const = 0;
/**
* Forces any changes in the contents of this node and its descendants to
* the persistent store.
*
* <p>
* Once this method returns successfully, it is safe to assume that all
* changes made in the subtree rooted at this node prior to the method
* invocation have become permanent.
*
* <p>
* Implementations are free to flush changes into the persistent store at
* any time. They do not need to wait for this method to be called.
*
* <p>
* When a flush occurs on a newly created node, it is made persistent, as
* are any ancestors (and descendants) that have yet to be made persistent.
* Note however that any properties value changes in ancestors are <i>not
* </i> guaranteed to be made persistent.
*
* @throws BackingStoreException if this operation cannot be completed due
* to a failure in the backing store, or inability to communicate
* with it.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
* @see #sync()
*/
virtual void Flush() = 0;
/**
* Ensures that future reads from this node and its descendants reflect any
* changes that were committed to the persistent store (from any VM) prior
* to the <code>sync</code> invocation. As a side-effect, forces any changes
* in the contents of this node and its descendants to the persistent store,
* as if the <code>flush</code> method had been invoked on this node.
*
* @throws BackingStoreException if this operation cannot be completed due
* to a failure in the backing store, or inability to communicate
* with it.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()}method.
* @see #flush()
*/
virtual void Sync() = 0;
/**
* Sets a flag to the parameter <code>block</code> which can be used to
* block berry messages in order to prevent callback functions to be called.
*
* @param block boolean to set the flag
*/
virtual void BlockSignals(bool block) = 0;
};
} // namespace berry
#endif /*BERRYIPREFERENCES_H_*/
diff --git a/Plugins/org.blueberry.core.runtime/src/berryISafeRunnable.h b/Plugins/org.blueberry.core.runtime/src/berryISafeRunnable.h
index f427db6aa9..5240cebb60 100644
--- a/Plugins/org.blueberry.core.runtime/src/berryISafeRunnable.h
+++ b/Plugins/org.blueberry.core.runtime/src/berryISafeRunnable.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISAFERUNNABLE_H_
#define BERRYISAFERUNNABLE_H_
#include <berryObject.h>
#include <berryMacros.h>
#include <org_blueberry_core_runtime_Export.h>
namespace berry
{
/**
* Safe runnables represent blocks of code and associated exception
* handlers. They are typically used when a plug-in needs to call some
* untrusted code (e.g., code contributed by another plug-in via an
* extension).
* <p>
* This interface can be used without OSGi running.
* </p><p>
* Clients may implement this interface.
* </p>
* @see SafeRunner#run(ISafeRunnable)
*/
struct org_blueberry_core_runtime_EXPORT ISafeRunnable: public Object
{
- berryObjectMacro(berry::ISafeRunnable)
+ berryObjectMacro(berry::ISafeRunnable);
/**
* Handles an exception thrown by this runnable's <code>run</code>
* method. The processing done here should be specific to the
* particular usecase for this runnable. Generalized exception
* processing (e.g., logging in the platform's log) is done by the
* Platform's run mechanism.
*
* @param exception an exception which occurred during processing
* the body of this runnable (i.e., in <code>run()</code>)
* @see SafeRunner#run(ISafeRunnable)
*/
virtual void HandleException(const ctkException& exception) = 0;
/**
* Runs this runnable. Any exceptions thrown from this method will
* be passed to this runnable's <code>handleException</code>
* method.
*
* @exception Exception if a problem occurred while running this method.
* The exception will be processed by <code>handleException</code>
* @see SafeRunner#run(ISafeRunnable)
*/
virtual void Run() = 0;
};
template<typename R>
struct SafeRunnableDelegate: public ISafeRunnable
{
typedef void(R::*RunCallback)();
typedef void(R::*HandleExcCallback)(const std::exception&);
SafeRunnableDelegate(R* runnable, RunCallback func, HandleExcCallback handleFunc = 0) :
m_Runnable(runnable), m_RunFunc(func), m_HandleExcFunc(handleFunc)
{
}
void Run() override
{
m_Runnable->*m_RunFunc();
}
void HandleException(const ctkException& exception) override
{
if (m_HandleExcFunc)
m_Runnable->*m_HandleExcFunc(exception);
}
private:
R* m_Runnable;
RunCallback m_RunFunc;
HandleExcCallback m_HandleExcFunc;
};
}
#endif /* BERRYISAFERUNNABLE_H_ */
diff --git a/Plugins/org.blueberry.core.runtime/src/berryIStatus.h b/Plugins/org.blueberry.core.runtime/src/berryIStatus.h
index 4a674cc9df..60adb0b0d3 100644
--- a/Plugins/org.blueberry.core.runtime/src/berryIStatus.h
+++ b/Plugins/org.blueberry.core.runtime/src/berryIStatus.h
@@ -1,200 +1,200 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISTATUS_H_
#define BERRYISTATUS_H_
#include <berryObject.h>
#include <berryMacros.h>
#include <org_blueberry_core_runtime_Export.h>
namespace berry
{
/**
* A status object represents the outcome of an operation.
* All <code>CoreException</code>s carry a status object to indicate
* what went wrong. Status objects are also returned by methods needing
* to provide details of failures (e.g., validation methods).
* <p>
* A status carries the following information:
* <ul>
* <li> plug-in identifier (required)</li>
* <li> severity (required)</li>
* <li> status code (required)</li>
* <li> message (required) - localized to current locale</li>
* <li> exception (optional) - for problems stemming from a failure at
* a lower level</li>
* </ul>
* Some status objects, known as multi-statuses, have other status objects
* as children.
* </p>
* <p>
* The class <code>Status</code> is the standard public implementation
* of status objects; the subclass <code>MultiStatus</code> is the
* implements multi-status objects.
* </p><p>
* This interface can be used without OSGi running.
* </p>
* @see MultiStatus
* @see Status
*/
struct org_blueberry_core_runtime_EXPORT IStatus: public Object
{
- berryObjectMacro(berry::IStatus)
+ berryObjectMacro(berry::IStatus);
enum Severity
{
/** Status severity constant (value 0) indicating this status represents the nominal case.
* This constant is also used as the status code representing the nominal case.
*/
OK_TYPE = 0x00,
/** Status type severity (bit mask, value 1) indicating this status is informational only. */
INFO_TYPE = 0x01,
/** Status type severity (bit mask, value 2) indicating this status represents a warning. */
WARNING_TYPE = 0x02,
/** Status type severity (bit mask, value 4) indicating this status represents an error. */
ERROR_TYPE = 0x04,
/** Status type severity (bit mask, value 8) indicating this status represents a cancelation. */
CANCEL_TYPE = 0x08
};
Q_DECLARE_FLAGS(Severities, Severity)
/**
* Returns a list of status object immediately contained in this
* multi-status, or an empty list if this is not a multi-status.
*
* @return an array of status objects
* @see #isMultiStatus()
*/
virtual QList<IStatus::Pointer> GetChildren() const = 0;
/**
* Returns the plug-in-specific status code describing the outcome.
*
* @return plug-in-specific status code
*/
virtual int GetCode() const = 0;
/**
* Returns the relevant low-level exception, or <code>null</code> if none.
* For example, when an operation fails because of a network communications
* failure, this might return the <code>java.io.IOException</code>
* describing the exact nature of that failure.
*
* @return the relevant low-level exception, or <code>null</code> if none
*/
virtual const ctkException* GetException() const = 0;
/**
* Returns the message describing the outcome.
* The message is localized to the current locale.
*
* @return a localized message
*/
virtual QString GetMessage() const = 0;
/**
* Returns the unique identifier of the plug-in associated with this status
* (this is the plug-in that defines the meaning of the status code).
*
* @return the unique identifier of the relevant plug-in
*/
virtual QString GetPlugin() const = 0;
/**
* Returns the severity. The severities are as follows (in
* descending order):
* <ul>
* <li><code>CANCEL_TYPE</code> - cancelation occurred</li>
* <li><code>ERROR_TYPE</code> - a serious error (most severe)</li>
* <li><code>WARNING_TYPE</code> - a warning (less severe)</li>
* <li><code>INFO_TYPE</code> - an informational ("fyi") message (least severe)</li>
* <li><code>OK_TYPE</code> - everything is just fine</li>
* </ul>
* <p>
* The severity of a multi-status is defined to be the maximum
* severity of any of its children, or <code>OK</code> if it has
* no children.
* </p>
*
* @return the severity: one of <code>OK_TYPE</code>, <code>ERROR_TYPE</code>,
* <code>INFO_TYPE</code>, <code>WARNING_TYPE</code>, or <code>CANCEL_TYPE</code>
* @see #matches(int)
*/
virtual Severity GetSeverity() const = 0;
/**
* Returns whether this status is a multi-status.
* A multi-status describes the outcome of an operation
* involving multiple operands.
* <p>
* The severity of a multi-status is derived from the severities
* of its children; a multi-status with no children is
* <code>OK_TYPE</code> by definition.
* A multi-status carries a plug-in identifier, a status code,
* a message, and an optional exception. Clients may treat
* multi-status objects in a multi-status unaware way.
* </p>
*
* @return <code>true</code> for a multi-status,
* <code>false</code> otherwise
* @see #getChildren()
*/
virtual bool IsMultiStatus() const = 0;
/**
* Returns whether this status indicates everything is okay
* (neither info, warning, nor error).
*
* @return <code>true</code> if this status has severity
* <code>OK</code>, and <code>false</code> otherwise
*/
virtual bool IsOK() const = 0;
/**
* Returns whether the severity of this status matches the given
* severity mask. Note that a status with severity <code>OK_TYPE</code>
* will never match; use <code>isOK</code> instead to detect
* a status with a severity of <code>OK</code>.
*
* @param severityMask a mask formed by bitwise or'ing severity mask
* constants (<code>ERROR_TYPE</code>, <code>WARNING_TYPE</code>,
* <code>INFO_TYPE</code>, <code>CANCEL_TYPE</code>)
* @return <code>true</code> if there is at least one match,
* <code>false</code> if there are no matches
* @see #getSeverity()
* @see #CANCEL_TYPE
* @see #ERROR_TYPE
* @see #WARNING_TYPE
* @see #INFO_TYPE
*/
virtual bool Matches(const Severities& severityMask) const = 0;
virtual QString GetFileName() const = 0;
virtual QString GetMethodName() const = 0;
virtual int GetLineNumber() const = 0;
};
}
Q_DECLARE_OPERATORS_FOR_FLAGS(berry::IStatus::Severities)
#endif /* BERRYISTATUS_H_ */
diff --git a/Plugins/org.blueberry.core.runtime/src/berryMultiStatus.h b/Plugins/org.blueberry.core.runtime/src/berryMultiStatus.h
index b6c9d9ce65..317d1c09be 100644
--- a/Plugins/org.blueberry.core.runtime/src/berryMultiStatus.h
+++ b/Plugins/org.blueberry.core.runtime/src/berryMultiStatus.h
@@ -1,143 +1,143 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYMULTISTATUS_H_
#define BERRYMULTISTATUS_H_
#include "berryStatus.h"
#include <org_blueberry_core_runtime_Export.h>
namespace berry {
/**
* A concrete multi-status implementation,
* suitable either for instantiating or subclassing.
* <p>
* This class can be used without OSGi running.
* </p>
*/
class org_blueberry_core_runtime_EXPORT MultiStatus : public Status {
private:
/** List of child statuses.
*/
QList<IStatus::Pointer> children;
Severity GetMaxSeverity(const QList<Pointer> &children) const;
public:
- berryObjectMacro(berry::MultiStatus)
+ berryObjectMacro(berry::MultiStatus);
/**
* Creates and returns a new multi-status object with the given children.
*
* @param pluginId the unique identifier of the relevant plug-in
* @param code the plug-in-specific status code
* @param newChildren the list of children status objects
* @param message a human-readable message, localized to the
* current locale
*/
MultiStatus(const QString& pluginId, int code, const QList<IStatus::Pointer>& newChildren,
const QString& message, const SourceLocation& sl);
/**
* Creates and returns a new multi-status object with the given children.
*
* @param pluginId the unique identifier of the relevant plug-in
* @param code the plug-in-specific status code
* @param newChildren the list of children status objects
* @param message a human-readable message, localized to the
* current locale
* @param exception a low-level exception.
*/
MultiStatus(const QString& pluginId, int code, const QList<IStatus::Pointer>& newChildren,
const QString& message, const ctkException& exception, const SourceLocation& sl);
/**
* Creates and returns a new multi-status object with no children.
*
* @param pluginId the unique identifier of the relevant plug-in
* @param code the plug-in-specific status code
* @param message a human-readable message, localized to the
* current locale
*/
MultiStatus(const QString& pluginId, int code, const QString& message,
const SourceLocation& sl);
/**
* Creates and returns a new multi-status object with no children.
*
* @param pluginId the unique identifier of the relevant plug-in
* @param code the plug-in-specific status code
* @param message a human-readable message, localized to the
* current locale
* @param exception a low-level exception, or <code>null</code> if not
* applicable
*/
MultiStatus(const QString& pluginId, int code, const QString& message,
const ctkException& exception, const SourceLocation& sl);
/**
* Adds the given status to this multi-status.
*
* @param status the new child status
*/
void Add(IStatus::Pointer status);
/**
* Adds all of the children of the given status to this multi-status.
* Does nothing if the given status has no children (which includes
* the case where it is not a multi-status).
*
* @param status the status whose children are to be added to this one
*/
void AddAll(IStatus::Pointer status);
/* (Intentionally not javadoc'd)
* Implements the corresponding method on <code>IStatus</code>.
*/
QList<IStatus::Pointer> GetChildren() const override;
/* (Intentionally not javadoc'd)
* Implements the corresponding method on <code>IStatus</code>.
*/
bool IsMultiStatus() const override;
/**
* Merges the given status into this multi-status.
* Equivalent to <code>add(status)</code> if the
* given status is not a multi-status.
* Equivalent to <code>addAll(status)</code> if the
* given status is a multi-status.
*
* @param status the status to merge into this one
* @see #add(IStatus)
* @see #addAll(IStatus)
*/
void Merge(const IStatus::Pointer& status);
/**
* Returns a string representation of the status, suitable
* for debugging purposes only.
*/
QString ToString() const override;
};
}
#endif /* BERRYMULTISTATUS_H_ */
diff --git a/Plugins/org.blueberry.core.runtime/src/berryObjectList.h b/Plugins/org.blueberry.core.runtime/src/berryObjectList.h
index b552978fcb..189be36638 100755
--- a/Plugins/org.blueberry.core.runtime/src/berryObjectList.h
+++ b/Plugins/org.blueberry.core.runtime/src/berryObjectList.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYOSGIOBJECTLIST_H_
#define BERRYOSGIOBJECTLIST_H_
#include "berryMacros.h"
#include <berryObject.h>
#include <QList>
namespace berry {
template<typename T>
class ObjectList : public Object, public QList<T>
{
public:
- berryObjectMacro(berry::ObjectList<T>)
+ berryObjectMacro(berry::ObjectList<T>);
ObjectList() : QList<T>() {}
ObjectList(const QList<T>& l) : QList<T>(l) {}
bool operator==(const Object* o) const override
{
if (const QList<T>* l = dynamic_cast<const QList<T>*>(o))
{
return QList<T>::operator ==(*l);
}
return false;
}
};
}
#endif /*BERRYOSGIOBJECTLIST_H_*/
diff --git a/Plugins/org.blueberry.core.runtime/src/berryObjectString.h b/Plugins/org.blueberry.core.runtime/src/berryObjectString.h
index 548fe4229c..3235d604a5 100644
--- a/Plugins/org.blueberry.core.runtime/src/berryObjectString.h
+++ b/Plugins/org.blueberry.core.runtime/src/berryObjectString.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYOBJECTSTRING_H_
#define BERRYOBJECTSTRING_H_
#include "berryMacros.h"
#include "berryObject.h"
#include <QString>
#include <org_blueberry_core_runtime_Export.h>
namespace berry {
class org_blueberry_core_runtime_EXPORT ObjectString : public QString, public Object
{
public:
- berryObjectMacro(berry::ObjectString)
+ berryObjectMacro(berry::ObjectString);
ObjectString();
ObjectString(const QString& s);
~ObjectString() override;
bool operator==(const Object* other) const override;
bool operator==(const QString& other) const;
ObjectString& operator=(const QString& other);
QString ToString() const override;
};
}
#endif /*BERRYOBJECTSTRING_H_*/
diff --git a/Plugins/org.blueberry.core.runtime/src/berryObjectStringMap.h b/Plugins/org.blueberry.core.runtime/src/berryObjectStringMap.h
index 3d85967da6..8b91d57d27 100644
--- a/Plugins/org.blueberry.core.runtime/src/berryObjectStringMap.h
+++ b/Plugins/org.blueberry.core.runtime/src/berryObjectStringMap.h
@@ -1,35 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYOBJECTSTRINGMAP_H
#define BERRYOBJECTSTRINGMAP_H
#include <berryObject.h>
#include <QHash>
namespace berry {
class ObjectStringMap : public QHash<QString,QString>, public Object
{
public:
- berryObjectMacro(berry::ObjectStringMap)
+ berryObjectMacro(berry::ObjectStringMap);
ObjectStringMap();
ObjectStringMap(const QHash<QString,QString>& other);
};
}
#endif // BERRYOBJECTSTRINGMAP_H
diff --git a/Plugins/org.blueberry.core.runtime/src/berryObjectTypeInfo.h b/Plugins/org.blueberry.core.runtime/src/berryObjectTypeInfo.h
index 56d74d588c..4eb15e5e50 100644
--- a/Plugins/org.blueberry.core.runtime/src/berryObjectTypeInfo.h
+++ b/Plugins/org.blueberry.core.runtime/src/berryObjectTypeInfo.h
@@ -1,38 +1,38 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYOBJECTTYPEINFO_H
#define BERRYOBJECTTYPEINFO_H
#include <berryObject.h>
#include <org_blueberry_core_runtime_Export.h>
namespace berry {
class org_blueberry_core_runtime_EXPORT ObjectTypeInfo : public Reflection::TypeInfo, public Object
{
public:
- berryObjectMacro(ObjectTypeInfo, Reflection::TypeInfo, Object)
+ berryObjectMacro(ObjectTypeInfo, Reflection::TypeInfo, Object);
ObjectTypeInfo();
ObjectTypeInfo(const Reflection::TypeInfo& typeInfo);
bool operator==(const Object* other) const override;
bool operator==(const Reflection::TypeInfo& other) const;
};
}
#endif // BERRYOBJECTTYPEINFO_H
diff --git a/Plugins/org.blueberry.core.runtime/src/berryPlatformObject.h b/Plugins/org.blueberry.core.runtime/src/berryPlatformObject.h
index 6e3a57dd8d..c36c7381eb 100755
--- a/Plugins/org.blueberry.core.runtime/src/berryPlatformObject.h
+++ b/Plugins/org.blueberry.core.runtime/src/berryPlatformObject.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYPLATFORMOBJECT_H_
#define BERRYPLATFORMOBJECT_H_
#include <org_blueberry_core_runtime_Export.h>
#include <berryObject.h>
#include "berryIAdaptable.h"
namespace berry {
/**
* An abstract superclass implementing the <code>IAdaptable</code>
* interface. <code>getAdapter</code> invocations are directed
* to the platform's adapter manager.
* <p>
* Note: In situations where it would be awkward to subclass this
* class, the same affect can be achieved simply by implementing
* the <code>IAdaptable</code> interface and explicitly forwarding
* the <code>getAdapter</code> request to the platform's
* adapater manager. The method would look like:
* <pre>
* public Object getAdapter(Class adapter) {
* return Platform.getAdapterManager().getAdapter(this, adapter);
* }
* </pre>
* </p>
* <p>
* Clients may subclass.
* </p>
*
* @see Platform#getAdapterManager
*/
class org_blueberry_core_runtime_EXPORT PlatformObject : public virtual Object, public virtual IAdaptable
{
public:
- berryObjectMacro(berry::PlatformObject)
+ berryObjectMacro(berry::PlatformObject);
/**
* Constructs a new platform object.
*/
PlatformObject();
/**
* Returns an object which is an instance of the given class
* associated with this object. Returns <code>null</code> if
* no such object can be found.
* <p>
* This implementation of the method declared by <code>IAdaptable</code>
* passes the request along to the platform's adapter manager; roughly
* <code>Platform.getAdapterManager().getAdapter(this, adapter)</code>.
* Subclasses may override this method (however, if they do so, they
* should invoke the method on their superclass to ensure that the
* Platform's adapter manager is consulted).
* </p>
*
* @see IAdaptable#getAdapter
* @see Platform#getAdapterManager
*/
Object* GetAdapter(const QString& adapter) const override;
};
}
#endif /* BERRYPLATFORMOBJECT_H_ */
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryAbstractPreferencesStorage.h b/Plugins/org.blueberry.core.runtime/src/internal/berryAbstractPreferencesStorage.h
index 20a3f0b303..345e97e89b 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryAbstractPreferencesStorage.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryAbstractPreferencesStorage.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYABSTRACTPREFERENCESSTORAGE_H_
#define BERRYABSTRACTPREFERENCESSTORAGE_H_
#include <org_blueberry_core_runtime_Export.h>
#include <berryObject.h>
namespace berry
{
struct IPreferences;
///
/// Interface to flush Preferences.
///
class org_blueberry_core_runtime_EXPORT AbstractPreferencesStorage : public Object
{
public:
- berryObjectMacro(berry::AbstractPreferencesStorage)
+ berryObjectMacro(berry::AbstractPreferencesStorage);
///
/// Saves the path, sets the root initially to 0.
/// In subclasses try to read data from file here.
///
AbstractPreferencesStorage(const QString& _File);
///
/// Pure virtual (abstract class)
///
~AbstractPreferencesStorage() override;
///
/// Flushes the given (or all) prefs persistently
///
virtual void Flush(IPreferences* prefs) = 0;
///
/// Returns the root prefs
///
virtual SmartPointer<IPreferences> GetRoot() const;
///
/// Returns the path of the file
///
virtual QString GetFile() const;
///
/// Sets the file
///
virtual void SetFile(const QString& f);
protected:
///
/// Path to the file where the data is stored
///
QString m_File;
///
/// Pointer to the root Preferences
///
SmartPointer<IPreferences> m_Root;
};
}
#endif /* BERRYABSTRACTPREFERENCESSTORAGE_H_ */
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryConfigurationElement.h b/Plugins/org.blueberry.core.runtime/src/internal/berryConfigurationElement.h
index 3f55d58bf5..a5824f756b 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryConfigurationElement.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryConfigurationElement.h
@@ -1,114 +1,114 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYEXTENSIONELEMENT_H_
#define BERRYEXTENSIONELEMENT_H_
#include "berryRegistryObject.h"
namespace berry {
struct IContributor;
/**
* An object which represents the user-defined contents of an extension
* in a plug-in manifest.
*/
class ConfigurationElement : public RegistryObject
{
private:
//The id of the parent element. It can be a configuration element or an extension
int parentId;
short parentType; //This value is only interesting when running from cache.
//Store the properties and the value of the configuration element.
//The format is the following:
// [p1, v1, p2, v2, configurationElementValue]
//If the array size is even, there is no "configurationElementValue (ie getValue returns null)".
//The properties and their values are alternated (v1 is the value of p1).
QList<QString> propertiesAndValue;
//The name of the configuration element
QString name;
//ID of the actual contributor of this element
//This value can be null when the element is loaded from disk and the owner has been uninstalled.
//This happens when the configuration is obtained from a delta containing removed extension.
QString contributorId;
protected:
friend class ConfigurationElementHandle;
friend class ExtensionRegistry;
friend class ExtensionsParser;
void ThrowException(const QString& message, const ctkException& exc);
void ThrowException(const QString& message);
QString GetValue() const;
QString GetValueAsIs() const;
QString GetAttributeAsIs(const QString& attrName) const;
QList<QString> GetAttributeNames() const;
void SetProperties(const QList<QString>& value);
QList<QString> GetPropertiesAndValue() const;
void SetValue(const QString& value);
void SetContributorId(const QString& id);
QString GetContributorId() const;
void SetParentId(int objectId);
QString GetName() const;
void SetName(const QString& name);
void SetParentType(short type);
QObject* CreateExecutableExtension(const QString& attributeName);
QString GetAttribute(const QString& attrName, const QLocale& locale) const;
QString GetValue(const QLocale& locale) const;
public:
- berryObjectMacro(berry::ConfigurationElement)
+ berryObjectMacro(berry::ConfigurationElement);
ConfigurationElement(ExtensionRegistry* registry, bool persist);
ConfigurationElement(int self, const QString& contributorId,
const QString& name, const QList<QString>& propertiesAndValue,
const QList<int>& children, int extraDataOffset, int parent,
short parentType, ExtensionRegistry* registry, bool persist);
QString GetAttribute(const QString& attrName) const;
QList<ConfigurationElement::Pointer> GetChildren(const QString& childrenName) const;
SmartPointer<IContributor> GetContributor() const;
};
} // namespace berry
#endif /*BERRYEXTENSIONELEMENT_H_*/
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryConfigurationElementHandle.h b/Plugins/org.blueberry.core.runtime/src/internal/berryConfigurationElementHandle.h
index f6c6216a06..a298b98d95 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryConfigurationElementHandle.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryConfigurationElementHandle.h
@@ -1,76 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYCONFIGURATIONELEMENTHANDLE_H
#define BERRYCONFIGURATIONELEMENTHANDLE_H
#include "berryHandle.h"
#include "berryIConfigurationElement.h"
namespace berry {
class ConfigurationElement;
class ConfigurationElementHandle : public Handle, public IConfigurationElement
{
public:
- berryObjectMacro(berry::ConfigurationElementHandle)
+ berryObjectMacro(berry::ConfigurationElementHandle);
explicit ConfigurationElementHandle(const SmartPointer<const IObjectManager> &objectManager, int id);
explicit ConfigurationElementHandle(const IObjectManager* objectManager, int id);
QString GetAttribute(const QString& propertyName) const override;
QString GetAttribute(const QString& attrName, const QLocale& locale) const;
QList<QString> GetAttributeNames() const override;
QList<IConfigurationElement::Pointer> GetChildren() const override;
QObject* CreateExecutableExtension(const QString& propertyName) const override;
QString GetAttributeAsIs(const QString& name) const;
QList<IConfigurationElement::Pointer> GetChildren(const QString& name) const override;
SmartPointer<IExtension> GetDeclaringExtension() const override;
QString GetName() const override;
SmartPointer<Object> GetParent() const override;
QString GetValue() const override;
QString GetValue(const QLocale& locale) const override;
QString GetValueAsIs() const;
SmartPointer<RegistryObject> GetObject() const override;
QString GetNamespaceIdentifier() const override;
SmartPointer<IContributor> GetContributor() const override;
bool IsValid() const override;
protected:
virtual SmartPointer<ConfigurationElement> GetConfigurationElement() const;
bool ShouldPersist() const;
};
}
#endif // BERRYCONFIGURATIONELEMENTHANDLE_H
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryExtension.h b/Plugins/org.blueberry.core.runtime/src/internal/berryExtension.h
index 5e03e363a8..3977bdd6d4 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryExtension.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryExtension.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYEXTENSION_H_
#define BERRYEXTENSION_H_
#include "berryRegistryObject.h"
namespace berry {
struct IContributor;
/**
* An object which represents the user-defined extension in a plug-in manifest.
*/
class Extension : public RegistryObject
{
private:
friend class ExtensionHandle;
friend class ExtensionsParser;
friend class ExtensionPointHandle;
friend class ExtensionRegistry;
friend class RegistryObjectManager;
//Extension simple identifier
QString simpleId;
//The namespace for the extension.
QString namespaceIdentifier;
// Place holder for the label and the extension point. It contains either a String[] or a SoftReference to a String[].
//The array layout is [label, extension point name]
QList<QString> extraInformation;
static const int LABEL; // = 0; //The human readable name of the extension
static const int XPT_NAME; // = 1; // The fully qualified name of the extension point to which this extension is attached to
static const int CONTRIBUTOR_ID; // = 2; // ID of the actual contributor of this extension
static const int EXTRA_SIZE; // = 3;
QList<QString> GetExtraData() const;
protected:
QString GetExtensionPointIdentifier() const;
QString GetSimpleIdentifier() const;
QString GetUniqueIdentifier() const;
void SetExtensionPointIdentifier(const QString& value);
void SetSimpleIdentifier(const QString& value);
QString GetLabel() const;
void SetLabel(const QString& value);
QString GetContributorId() const;
void SetContributorId(const QString& value);
void SetNamespaceIdentifier(const QString& value);
QString GetLabelAsIs() const;
QString GetLabel(const QLocale& locale) const;
public:
- berryObjectMacro(berry::Extension)
+ berryObjectMacro(berry::Extension);
Extension(ExtensionRegistry* registry, bool persist);
Extension(int self, const QString& simpleId, const QString& namespaze,
const QList<int>& children, int extraData,
ExtensionRegistry* registry, bool persist);
SmartPointer<IContributor> GetContributor() const;
QString GetNamespaceIdentifier() const;
QString ToString() const override;
};
}
#endif /*BERRYEXTENSION_H_*/
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryExtensionHandle.h b/Plugins/org.blueberry.core.runtime/src/internal/berryExtensionHandle.h
index 197493235e..47243a24cc 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryExtensionHandle.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryExtensionHandle.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYEXTENSIONHANDLE_H
#define BERRYEXTENSIONHANDLE_H
#include "berryHandle.h"
#include "berryIExtension.h"
namespace berry {
struct IObjectManager;
class Extension;
class ExtensionHandle : public Handle, public IExtension
{
public:
- berryObjectMacro(berry::ExtensionHandle)
+ berryObjectMacro(berry::ExtensionHandle);
ExtensionHandle(const SmartPointer<const IObjectManager>& objectManager, int id);
ExtensionHandle(const IObjectManager* objectManager, int id);
QString GetNamespaceIdentifier() const override;
SmartPointer<IContributor> GetContributor() const override;
QString GetExtensionPointUniqueIdentifier() const override;
QString GetLabel() const override;
QString GetLabelAsIs() const;
QString GetLabel(const QLocale& locale) const;
QString GetSimpleIdentifier() const override;
QString GetUniqueIdentifier() const override;
QList<SmartPointer<IConfigurationElement> > GetConfigurationElements() const override;
bool IsValid() const override;
SmartPointer<RegistryObject> GetObject() const override;
protected:
SmartPointer<Extension> GetExtension() const;
bool ShouldPersist() const;
QString GetContributorId() const;
};
}
#endif // BERRYEXTENSIONHANDLE_H
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryExtensionPoint.h b/Plugins/org.blueberry.core.runtime/src/internal/berryExtensionPoint.h
index 0e0187a27b..32794cc36b 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryExtensionPoint.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryExtensionPoint.h
@@ -1,94 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYEXTENSIONPOINT_H_
#define BERRYEXTENSIONPOINT_H_
#include "berryRegistryObject.h"
namespace berry {
struct IContributor;
/**
* An object which represents the user-defined extension point in a
* plug-in manifest.
*/
class ExtensionPoint : public RegistryObject
{
private:
friend class ExtensionPointHandle;
friend class ExtensionRegistry;
friend class ExtensionsParser;
//Place holder for the label and the schema. It contains either a String[] or a SoftReference to a String[].
//The array layout is [label, schemaReference, fullyQualifiedName, namespace, contributorId]
QList<QString> extraInformation;
//Indexes of the various fields
static const int LABEL; // = 0; //The human readable name for the extension point
static const int SCHEMA; // = 1; //The schema of the extension point
static const int QUALIFIED_NAME; // = 2; //The fully qualified name of the extension point
static const int NAMESPACE; // = 3; //The name of the namespace of the extension point
static const int CONTRIBUTOR_ID; // = 4; //The ID of the actual contributor of the extension point
static const int EXTRA_SIZE; // = 5;
QList<QString> GetExtraData() const;
protected:
QString GetSimpleIdentifier() const;
QString GetSchemaReference() const;
QString GetLabel() const;
QString GetContributorId() const;
void SetSchema(const QString& value);
void SetLabel(const QString& value);
void SetUniqueIdentifier(const QString& value);
void SetNamespace(const QString& value);
void SetContributorId(const QString id);
QString GetLabelAsIs() const;
QString GetLabel(const QLocale& locale);
public:
- berryObjectMacro(berry::ExtensionPoint)
+ berryObjectMacro(berry::ExtensionPoint);
ExtensionPoint(ExtensionRegistry* registry, bool persist);
ExtensionPoint(int self, const QList<int>& children, int dataOffset,
ExtensionRegistry* registry, bool persist);
QString GetUniqueIdentifier() const;
SmartPointer<IContributor> GetContributor() const;
QString GetNamespace() const;
QString ToString() const override;
};
}
#endif /*BERRYEXTENSIONPOINT_H_*/
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryExtensionPointHandle.h b/Plugins/org.blueberry.core.runtime/src/internal/berryExtensionPointHandle.h
index 0cbc204b91..8394094e14 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryExtensionPointHandle.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryExtensionPointHandle.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYEXTENSIONPOINTHANDLE_H
#define BERRYEXTENSIONPOINTHANDLE_H
#include "berryHandle.h"
#include "berryIExtensionPoint.h"
namespace berry {
struct IObjectManager;
class ExtensionPoint;
class ExtensionPointHandle : public Handle, public IExtensionPoint
{
public:
- berryObjectMacro(berry::ExtensionPointHandle)
+ berryObjectMacro(berry::ExtensionPointHandle);
ExtensionPointHandle(const SmartPointer<const IObjectManager>& objectManager, int id);
ExtensionPointHandle(const IObjectManager* objectManager, int id);
QList<SmartPointer<IExtension> > GetExtensions() const override;
QString GetNamespaceIdentifier() const override;
SmartPointer<IContributor> GetContributor() const override;
SmartPointer<IExtension> GetExtension(const QString& extensionId) const override;
QList<SmartPointer<IConfigurationElement> > GetConfigurationElements() const override;
QString GetLabelAsIs() const;
QString GetLabel() const override;
QString GetLabel(const QLocale& locale) const;
QString GetSchemaReference() const;
QString GetSimpleIdentifier() const override;
QString GetUniqueIdentifier() const override;
SmartPointer<RegistryObject> GetObject() const override;
bool IsValid() const override;
protected:
bool ShouldPersist() const;
SmartPointer<ExtensionPoint> GetExtensionPoint() const;
};
}
#endif // BERRYEXTENSIONPOINTHANDLE_H
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryHandle.h b/Plugins/org.blueberry.core.runtime/src/internal/berryHandle.h
index 148cf17cf3..0d6dbc5644 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryHandle.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryHandle.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYHANDLE_H
#define BERRYHANDLE_H
#include <berryObject.h>
namespace berry {
struct IObjectManager;
class RegistryObject;
/**
* A handle is the super class to all registry objects that are now served to users.
* The handles never hold on to any "real" content of the object being represented.
* A handle can become stale if its referenced object has been removed from the registry.
*/
class Handle : public virtual Object
{
public:
- berryObjectMacro(berry::Handle)
+ berryObjectMacro(berry::Handle);
explicit Handle(const SmartPointer<const IObjectManager>& objectManager, int value);
explicit Handle(const IObjectManager* objectManager, int value);
~Handle() override;
/**
* Return the actual object corresponding to this handle.
* @throws InvalidRegistryObjectException when the handle is stale.
*/
virtual SmartPointer<RegistryObject> GetObject() const = 0;
int GetId() const;
bool operator==(const Object* object) const override;
uint HashCode() const override;
protected:
const IObjectManager* const objectManager;
private:
int objectId;
bool isStrongRef;
};
}
#endif // BERRYHANDLE_H
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryIObjectManager.h b/Plugins/org.blueberry.core.runtime/src/internal/berryIObjectManager.h
index 394f54d3f5..f44e3b0a62 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryIObjectManager.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryIObjectManager.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIOBJECTMANAGER_H
#define BERRYIOBJECTMANAGER_H
#include <berryObject.h>
namespace berry {
class Handle;
class RegistryObject;
struct IObjectManager : public Object
{
- berryObjectMacro(berry::IObjectManager)
+ berryObjectMacro(berry::IObjectManager);
~IObjectManager() override;
virtual SmartPointer<Handle> GetHandle(int id, short type) const = 0;
virtual QList<SmartPointer<Handle> > GetHandles(const QList<int>& ids, short type) const = 0;
virtual SmartPointer<RegistryObject> GetObject(int id, short type) const = 0;
virtual QList<SmartPointer<RegistryObject> > GetObjects(const QList<int>& values, short type) const = 0;
virtual void Close() = 0;
};
}
#endif // BERRYIOBJECTMANAGER_H
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryKeyedElement.h b/Plugins/org.blueberry.core.runtime/src/internal/berryKeyedElement.h
index 3fcd19a179..8a32aecf5b 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryKeyedElement.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryKeyedElement.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYKEYEDELEMENT_H
#define BERRYKEYEDELEMENT_H
#include <berryObject.h>
namespace berry {
class KeyedElement : public Object
{
public:
- berryObjectMacro(berry::KeyedElement)
+ berryObjectMacro(berry::KeyedElement);
~KeyedElement() override;
bool operator==(const KeyedElement& other) const;
bool operator==(const Object* other) const override;
virtual QString GetKey() const = 0;
uint HashCode() const override;
private:
virtual bool IsEqual(const KeyedElement& other) const = 0;
};
}
#endif // BERRYKEYEDELEMENT_H
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryPreferences.h b/Plugins/org.blueberry.core.runtime/src/internal/berryPreferences.h
index cb299c20c4..d5336cec58 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryPreferences.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryPreferences.h
@@ -1,348 +1,348 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYPREFERENCES_H_
#define BERRYPREFERENCES_H_
#include <org_blueberry_core_runtime_Export.h>
#include "berryIBerryPreferences.h"
#include <QHash>
#include <QList>
namespace berry
{
class AbstractPreferencesStorage;
/**
* Implementation of the OSGI Preferences Interface.
* Wraps a DOMNode.
*/
class org_blueberry_core_runtime_EXPORT Preferences: public IBerryPreferences
{
public:
- berryObjectMacro(berry::Preferences)
+ berryObjectMacro(berry::Preferences);
/**
* Maps a string key to a string value
*/
typedef QHash<QString, QString> PropertyMap;
/**
* The list of Child nodes
*/
typedef QList<Preferences::Pointer> ChildrenList;
/**
* Constructs a new preference node.
* \param _Properties the key->value pairs of this preference node
* \param _Path the absolute path to this node, e.g. "/general/editors/font"
* \param _Name the name of this node, e.g. "font"
* \param _FileName the absolute path to the file in which this preferences tree will be saved to
* \param _Parent the parent node or 0 if this is the root
* \param _Root the root of this preference tree
*/
Preferences(const PropertyMap& _Properties,
const QString& _Name,
Preferences* _Parent,
AbstractPreferencesStorage* _Storage);
~Preferences() override;
/**
* Prints out the absolute path of the preference node.
*/
QString ToString() const override;
/**
* Returns if this node and his silblings have to be rewritten persistently
*/
bool IsDirty() const;
/**
* Returns if this node is removed
*/
bool IsRemoved() const;
/**
* Returns if this node has property with a specific key
*/
bool Has(const QString& key) const;
/**
* Returns true if the absolute paths are the same
*/
bool Equals(const Preferences* rhs) const;
/**
* Returns all Properties as map.
*/
PropertyMap GetProperties() const;
/**
* Returns a reference to the children list in order to add or remove nodes.
* *ATTENTION*: Should only be used
* when constructing the preferences tree from a persistent location. Normally, one would
* only use the IPreferences methods
*/
ChildrenList GetChildren() const;
//# Begin of IPreferences methods
/**
* \see IPreferences::AbsolutePath()
*/
QString AbsolutePath() const override;
/**
* \see IPreferences::ChildrenNames()
*/
QStringList ChildrenNames() const override;
/**
* \see IPreferences::ChildrenNames()
*/
virtual AbstractPreferencesStorage* GetStorage() const;
/**
* \see IPreferences::Clear()
*/
void Clear() override;
/**
* \see IPreferences::Flush()
*/
void Flush() override;
/**
* \see IPreferences::Get()
*/
QString Get(const QString& key, const QString& def) const override;
/**
* \see IPreferences::GetBool()
*/
bool GetBool(const QString& key, bool def) const override;
/**
* \see IPreferences::GetByteArray()
*/
QByteArray GetByteArray(const QString& key, const QByteArray& def) const override;
/**
* \see IPreferences::GetDouble()
*/
double GetDouble(const QString& key, double def) const override;
/**
* \see IPreferences::GetFloat()
*/
float GetFloat(const QString& key, float def) const override;
/**
* \see IPreferences::GetInt()
*/
int GetInt(const QString& key, int def) const override;
/**
* \see IPreferences::GetLong()
*/
long GetLong(const QString& key, long def) const override;
/**
* \see IPreferences::Keys()
*/
QStringList Keys() const override;
/**
* \see IPreferences::Name()
*/
QString Name() const override;
/**
* \see IPreferences::Node()
*/
IPreferences::Pointer Node(const QString& pathName) override;
/**
* \see IPreferences::NodeExists()
*/
bool NodeExists(const QString& pathName) const override;
/**
* \see IPreferences::Parent()
*/
IPreferences::Pointer Parent() const override;
/**
* \see IPreferences::Put()
*/
void Put(const QString& key, const QString& value) override;
/**
* \see IPreferences::PutByteArray()
*/
void PutByteArray(const QString& key, const QByteArray& value) override;
/**
* \see IPreferences::PutBool()
*/
void PutBool(const QString& key, bool value) override;
/**
* \see IPreferences::PutDouble()
*/
void PutDouble(const QString& key, double value) override;
/**
* \see IPreferences::Sync()
*/
void PutFloat(const QString& key, float value) override;
/**
* \see IPreferences::PutInt()
*/
void PutInt(const QString& key, int value) override;
/**
* \see IPreferences::PutLong()
*/
void PutLong(const QString& key, long value) override;
/**
* \see IPreferences::Remove()
*/
void Remove(const QString& key) override;
/**
* \see IPreferences::RemoveNode()
*/
void RemoveNode() override;
/**
* \see IPreferences::Sync()
*/
void Sync() override;
/**
* \see IPreferences::BlockSignals()
*/
void BlockSignals(bool block) override;
//# End of IPreferences methods
protected:
/**
* Checks if this node is about to be removed.
* \throws IllegalStateException
*/
void AssertValid_unlocked() const;
/**
* Checks a path value for validity.
* \throws invalid_argument
*/
static void AssertPath_unlocked(const QString& pathName);
// /**
// * Converts any value to a string (using stream operator "<<")
// */
// template <class T>
// static QString ToString(const T& obj, int precision = 12 )
// {
// std::ostringstream s;
// std::locale C("C");
// s.imbue(C);
// s.precision(precision); s << obj; return s.str();
// }
bool Has_unlocked(const QString& key) const;
Preferences::Pointer Node_unlocked(const QString& pathName);
/**
* Sets the dirty flag recursively on all child nodes.
*/
void SetDirty(bool _Dirty);
void SetDirty_unlocked(bool _Dirty);
/**
* Sets the removed flag recursively on all child nodes.
*/
void SetRemoved(bool _Removed);
void SetRemoved_unlocked(bool _Removed);
protected:
/**
* Holds all Key/Value Pairs.
*/
QHash<QString, QString> m_Properties;
/**
* Holds all child nodes (explicit ownership).
*/
QList<Preferences::Pointer> m_Children;
/**
* Saves the absolute path of this node (calculated in the constructor)
*/
const QString m_Path;
/**
* Saves the name of this node (set when read from backend)
*/
const QString m_Name;
/**
* Saves the parent of this node
*/
Preferences* const m_Parent;
/**
* Saves the root of this tree
*/
Preferences* const m_Root;
/**
* Saves if something changed on this branch.
* Meaning that you would have to rewrite it.
*/
bool m_Dirty;
/**
* Saves if this Node is removed (will not be saved to the backend).
*/
bool m_Removed;
/**
* A storage to call the flush method.
*/
AbstractPreferencesStorage* const m_Storage;
/**
* A mutex to avoid concurrency crashes. Mutable because we need to use Mutex::lock() in const functions
*/
mutable QMutex m_Mutex;
/**
* A flag to block berry messages in order to prevent callback functions to be called.
*/
bool m_BlockSignal;
};
}
#endif /* BERRYPREFERENCES_H_ */
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryProduct.h b/Plugins/org.blueberry.core.runtime/src/internal/berryProduct.h
index ed6973e288..53869e252d 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryProduct.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryProduct.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYPRODUCT_H
#define BERRYPRODUCT_H
#include <berryIProduct.h>
namespace berry {
struct IBranding;
class Product : public IProduct
{
public:
- berryObjectMacro(Product, IProduct)
+ berryObjectMacro(Product, IProduct);
Product(IBranding* branding);
QString GetApplication() const override;
QSharedPointer<ctkPlugin> GetDefiningPlugin() const override;
QString GetDescription() const override;
QString GetId() const override;
QString GetName() const override;
QString GetProperty(const QString& key) const override;
private:
IBranding* branding;
};
}
#endif // BERRYPRODUCT_H
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryContribution.h b/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryContribution.h
index 954028f222..5e6bbf4279 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryContribution.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryContribution.h
@@ -1,103 +1,103 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYREGISTRYCONTRIBUTION_H
#define BERRYREGISTRYCONTRIBUTION_H
#include "berryKeyedElement.h"
namespace berry {
class ExtensionRegistry;
// This object is used to keep track on a contributor basis of the extension and extension points being contributed.
// It is mainly used on removal so we can quickly find objects to remove.
// Each contribution is made in the context of a namespace.
class RegistryContribution : public KeyedElement
{
public:
static const int EXTENSION_POINT; // = 0;
static const int EXTENSION; // = 1;
- berryObjectMacro(berry::RegistryContribution)
+ berryObjectMacro(berry::RegistryContribution);
RegistryContribution(const QString& contributorId, ExtensionRegistry* registry, bool persist);
QString GetDefaultNamespace() const;
QString ToString() const override;
//Implements the KeyedElement interface
QString GetKey() const override;
bool ShouldPersist() const;
void UnlinkChild(int id);
/**
* Contribution is empty if it has no children.
*/
bool IsEmpty() const;
/**
* Find if this contribution has a children with ID = id.
* @param id possible ID of the child
* @return true: contribution has this child
*/
bool HasChild(int id) const;
private:
friend class RegistryObjectManager;
friend class ExtensionRegistry;
friend class ExtensionsParser;
//The registry that owns this object
ExtensionRegistry* registry;
// The actual contributor of the contribution
QString contributorId;
// Value is derived from the contributorId and cached for performance
mutable QString defaultNamespace;
// indicates if this contribution needs to be saved in the registry cache
bool persist;
// This array stores the identifiers of both the extension points and the extensions.
// The array has always a minimum size of 2.
// The first element of the array is the number of extension points and the second the number of extensions.
// [numberOfExtensionPoints, numberOfExtensions, extensionPoint#1, extensionPoint#2, extensionPoint..., ext#1, ext#2, ext#3, ... ].
// The size of the array is 2 + (numberOfExtensionPoints + numberOfExtensions).
QList<int> children;
void MergeContribution(const RegistryContribution::Pointer& addContribution);
void SetRawChildren(const QList<int>& children);
QString GetContributorId() const;
QList<int> GetRawChildren() const;
QList<int> GetExtensions() const;
QList<int> GetExtensionPoints() const;
bool IsEqual(const KeyedElement& other) const override;
};
}
#endif // BERRYREGISTRYCONTRIBUTION_H
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryContributor.h b/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryContributor.h
index c85d12d952..2e27c93a20 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryContributor.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryContributor.h
@@ -1,139 +1,139 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYREGISTRYCONTRIBUTOR_H
#define BERRYREGISTRYCONTRIBUTOR_H
#include "berryIContributor.h"
namespace berry {
/**
* This class describes a registry contributor which is an entity that supplies information
* to the extension registry. Depending on the registry strategy, contributor might delegate
* some of its functionality to a "host" contributor. For instance, OSGi registry strategy
* uses "host" contributor to delegate some functionality from fragments to plug-ins.
* <p>
* This class can be instantiated by the registry Service Providers.
* </p><p>
* This class is not intended to be extended.
* </p><p>
* <b>Note:</b> This class/interface is part of an interim API that is still under
* development and expected to change significantly before reaching stability.
* It is being made available at this early stage to solicit feedback from pioneering
* adopters on the understanding that any code that uses this API will almost certainly
* be broken (repeatedly) as the API evolves.
* </p>
* @noextend This class is not intended to be subclassed by clients.
*/
class RegistryContributor : public IContributor
{
private:
/**
* Actual ID of the contributor (e.g., "12"). IDs are expected to be unique in the workspace.
*/
QString actualContributorId;
/**
* Actual name of the contributor (e.g., "org.eclipse.core.runtime.fragment").
*/
QString actualContributorName;
/**
* ID associated with the entity "in charge" of the contributor (e.g., "1"). IDs are expected
* to be unique in the workspace. If contributor does not rely on a host, this value should be
* the same as the actual contributor ID.
*/
QString hostId;
/**
* Name of the entity "in charge" of the contributor (e.g. "org.eclipse.core.runtime").
* If contributor does not rely on a host, this value should be the same as the actual
* contributor name.
*/
QString hostName;
public:
- berryObjectMacro(berry::RegistryContributor)
+ berryObjectMacro(berry::RegistryContributor);
/**
* Constructor for the registry contributor.
* <p>
* The actual ID is a string identifier for the contributor (e.g., "12") and is expected
* to be unique within the workspace. The actual ID of the contributor must not
* be <code>null</code>.
* </p><p>
* The actual name is the name associated with the contributor
* (e.g., "org.eclipse.core.runtime.fragment"). The actual name of the contributor must
* not be <code>null</code>.
* </p><p>
* The host ID is the identifier associated with the entity "in charge" of the contributor
* (e.g., "1"). IDs are expected to be unique in the workspace. If contributor does not
* rely on a host, then <code>null</code> should be used as the host ID.
* </p><p>
* The host name is the name of the entity "in charge" of the contributor
* (e.g., "org.eclipse.core.runtime"). If contributor does not rely on a host, then
* <code>null</code> should be used as the host name.
* </p><p>
* There should be 1-to-1 mapping between the contributor and the contibutor ID.
* The IDs (either actual or host) can not be re-used in the same registry.
* For example, if ID of 12 was used to identify contributorA, the ID of 12 can not
* be used to identify contributorB or a host for the contributorC.
* </p>
* @param actualId contributor identifier
* @param actualName name of the contributor
* @param hostId id associated with the host, or <code>null</code>
* @param hostName name of the host, or <code>null</code>
*/
RegistryContributor(const QString& actualId, const QString& actualName,
const QString& hostId, const QString& hostName);
/**
* Provides actual ID associated with the registry contributor (e.g., "12"). IDs are expected
* to be unique in the workspace.
*
* @return actual ID of the registry contributor
*/
QString GetActualId() const;
/**
* Provides actual name of the registry contributor (e.g., "org.eclipe.core.runtime.fragment").
*
* @return actual name of the registry contributor
*/
QString GetActualName() const;
/**
* Provides ID associated with the entity "in charge" of the contributor (e.g., "1"). IDs are expected
* to be unique in the workspace. If contributor does not rely on a host, this value should be
* the same as the actual contributor ID.
*
* @return id of the registry contributor
*/
QString GetId() const;
/**
* Provides name of the entity "in charge" of the contributor (e.g., "org.eclipse.core.runtime").
* If contributor does not rely on a host, this value should be the same as the actual contributor name.
*
* @return name of the registry contributor
*/
QString GetName() const override;
};
}
#endif // BERRYREGISTRYCONTRIBUTOR_H
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryIndexElement.h b/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryIndexElement.h
index fa4b1665e8..e3acb8d931 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryIndexElement.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryIndexElement.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYREGISTRYINDEXELEMENT_H
#define BERRYREGISTRYINDEXELEMENT_H
#include "berryKeyedElement.h"
#include "berryRegistryIndexChildren.h"
namespace berry {
class RegistryIndexChildren;
class RegistryIndexElement : public KeyedElement
{
private:
// The key on which indexing is done
const QString key;
// Extension points matching the key
RegistryIndexChildren extensionPoints;
// Extensions matching the key
RegistryIndexChildren extensions;
public:
- berryObjectMacro(berry::RegistryIndexElement)
+ berryObjectMacro(berry::RegistryIndexElement);
RegistryIndexElement(const QString& key);
RegistryIndexElement(const QString& key, const QList<int>& extensionPoints,
const QList<int>& extensions);
QList<int> GetExtensions() const;
QList<int> GetExtensionPoints() const;
bool UpdateExtension(int id, bool add);
bool UpdateExtensions(const QList<int>& IDs, bool add);
bool UpdateExtensionPoint(int id, bool add);
bool UpdateExtensionPoints(const QList<int>& IDs, bool add);
//Implements the KeyedElement interface
QString GetKey() const override;
private:
bool IsEqual(const KeyedElement& other) const override;
};
}
#endif // BERRYREGISTRYINDEXELEMENT_H
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryObject.h b/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryObject.h
index 6f376977c3..2158df3d03 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryObject.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryObject.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYREGISTRYOBJECT_H
#define BERRYREGISTRYOBJECT_H
#include "berryKeyedElement.h"
namespace berry {
class ExtensionRegistry;
/**
* An object which has the general characteristics of all the nestable elements
* in a plug-in manifest.
*/
class RegistryObject : public KeyedElement
{
public:
- berryObjectMacro(berry::RegistryObject)
+ berryObjectMacro(berry::RegistryObject);
RegistryObject();
//Implementation of the KeyedElement interface
QString GetKey() const override;
int GetObjectId() const;
//This can not return null. It returns the singleton empty array or an array
QList<int> GetRawChildren() const;
bool NoExtraData() const;
protected:
friend class RegistryObjectManager;
friend class ExtensionRegistry;
friend class ExtensionsParser;
QList<int> children;
// it is assumed that int has 32 bits (bits #0 to #31);
// bits #0 - #29 are the offset (limited to about 1Gb)
// bit #30 - persistance flag
// bit #31 - registry object has no extra data offset
// the bit#31 is a sign bit; bit#30 is the highest mantissa bit
static const int EMPTY_MASK; // = 0x80000000; // only taking bit #31
static const int PERSIST_MASK; // = 0x40000000; // only taking bit #30
static const int OFFSET_MASK; // = 0x3FFFFFFF; // all bits but #30, #31
//The registry that owns this object
ExtensionRegistry* registry;
RegistryObject(ExtensionRegistry* registry, bool persist);
void SetRawChildren(const QList<int>& values);
void SetObjectId(int value);
bool ShouldPersist() const;
// Convert no extra data to -1 on output
int GetExtraDataOffset() const;
// Accept -1 as "no extra data" on input
void SetExtraDataOffset(int offset);
QLocale GetLocale() const;
private:
//Object identifier
uint objectId; // = RegistryObjectManager::UNKNOWN;
// The key
QString objectKey;
// The field combines offset, persistence flag, and no offset flag
int extraDataOffset; // = EMPTY_MASK;
void SetPersist(bool persist);
bool IsEqual(const KeyedElement& other) const override;
};
}
#endif // BERRYREGISTRYOBJECT_H
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryObjectManager.h b/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryObjectManager.h
index b98b444356..f962c2496f 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryObjectManager.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryObjectManager.h
@@ -1,281 +1,281 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYREGISTRYOBJECTMANAGER_H
#define BERRYREGISTRYOBJECTMANAGER_H
#include "berryIObjectManager.h"
#include "berryHashtableOfStringAndInt.h"
#include "berryKeyedHashSet.h"
#include <QMutex>
namespace berry {
class ExtensionHandle;
class ExtensionPoint;
class ExtensionPointHandle;
class ExtensionRegistry;
class RegistryContribution;
class RegistryContributor;
class RegistryIndexElement;
class RegistryObject;
class RegistryObjectReferenceMap;
/**
* This class manage all the object from the registry but does not deal with their dependencies.
* It serves the objects which are either directly obtained from memory or read from a cache.
* It also returns handles for objects.
*/
class RegistryObjectManager : public IObjectManager
{
public:
- berryObjectMacro(berry::RegistryObjectManager)
+ berryObjectMacro(berry::RegistryObjectManager);
//Constants used to get the objects and their handles
enum Type {
CONFIGURATION_ELEMENT = 1,
EXTENSION,
EXTENSION_POINT,
THIRDLEVEL_CONFIGURATION_ELEMENT
};
RegistryObjectManager(ExtensionRegistry* registry);
~RegistryObjectManager() override;
void Add(const SmartPointer<RegistryObject>& registryObject, bool hold);
SmartPointer<RegistryObject> GetObject(int id, short type) const override;
// The current impementation of this method assumes that we don't cache dynamic
// extension. In this case all extensions not yet loaded (i.e. not in the memory cache)
// are "not dynamic" and we actually check memory objects to see if they are dynamic.
//
// If we decide to allow caching of dynamic objects, the implementation
// of this method would have to retrieved the object from disk and check
// its "dynamic" status. The problem is that id alone is not enough to get the object
// from the disk; object type is needed as well.
bool ShouldPersist(int id) const;
QList<SmartPointer<RegistryObject> > GetObjects(const QList<int>& values, short type) const override;
SmartPointer<Handle> GetHandle(int id, short type) const override;
QList<SmartPointer<Handle> > GetHandles(const QList<int>& ids, short type) const override;
bool IsDirty() const;
void MarkDirty();
void Close() override;
ExtensionRegistry* GetRegistry() const;
QList<SmartPointer<ExtensionHandle> > GetExtensionsFromContributor(const QString& contributorId) const;
QList<SmartPointer<ExtensionPointHandle> > GetExtensionPointsFromContributor(const QString& contributorId) const;
QList<SmartPointer<ExtensionPointHandle> > GetExtensionPointsFromNamespace(const QString& namespaceName) const;
// This method filters out extensions with no extension point
QList<SmartPointer<ExtensionHandle> > GetExtensionsFromNamespace(const QString& namespaceName) const;
SmartPointer<RegistryContributor> GetContributor(const QString& id) const;
protected:
friend class Extension;
friend class ExtensionPoint;
friend class ExtensionRegistry;
friend class ExtensionsParser;
friend class RegistryContribution;
friend class RegistryObject;
mutable QMutex mutex;
static const int CACHE_INITIAL_SIZE; // = 512;
static int UNKNOWN;
typedef QHash<QString, QList<int> > OrphansMapType;
typedef QHash<QString, SmartPointer<RegistryContributor> > ContributorsMapType;
/**
* Initialize the object manager. Return true if the initialization succeeded, false otherwise
*/
bool Init(long timeStamp);
void AddContribution(const SmartPointer<RegistryContribution>& contribution);
QList<int> GetExtensionPointsFrom(const QString& id) const;
QList<int> GetExtensionPointsFrom_unlocked(const QString& id) const;
bool HasContribution(const QString& id) const;
void Remove(int id, bool release);
void Remove_unlocked(int id, bool release);
QList<SmartPointer<RegistryObject> > GetObjects_unlocked(const QList<int>& values, short type) const;
SmartPointer<ExtensionPoint> GetExtensionPointObject(const QString& xptUniqueId) const;
SmartPointer<ExtensionPoint> GetExtensionPointObject_unlocked(const QString& xptUniqueId) const;
QList<SmartPointer<ExtensionPointHandle> > GetExtensionPointsHandles() const;
SmartPointer<ExtensionPointHandle> GetExtensionPointHandle(const QString& xptUniqueId);
QList<int> GetExtensionsFrom(const QString& contributorId) const;
QList<int> GetExtensionsFrom_unlocked(const QString& contributorId) const;
bool AddExtensionPoint(const SmartPointer<ExtensionPoint>& currentExtPoint, bool hold);
void RemoveExtensionPoint(const QString& extensionPointId);
void RemoveContribution(const QString &contributorId);
void AddOrphans(const QString& extensionPoint, const QList<int>& extensions);
void AddOrphan(const QString& extensionPoint, int extension);
QList<int> RemoveOrphans(const QString& extensionPoint);
void RemoveOrphan(const QString& extensionPoint, int extension);
//This method is only used by the writer to reach in
QHash<QString, QList<int> > GetOrphanExtensions() const;
// This method is only used by the writer to reach in
int GetNextId() const;
// This method is only used by the writer to reach in
HashtableOfStringAndInt GetExtensionPoints() const;
// This method is only used by the writer to reach in
QList<KeyedHashSet> GetContributions() const;
// This method is used internally and by the writer to reach in. Notice that it doesn't
// return contributors marked as removed.
ContributorsMapType& GetContributors() const;
// only adds a contributor if it is not already present in the table
void AddContributor(const SmartPointer<RegistryContributor>& newContributor);
void RemoveContributor(const QString& id);
KeyedHashSet& GetNamespacesIndex() const;
/**
* Collect all the objects that are removed by this operation and store
* them in a IObjectManager so that they can be accessed from the appropriate
* deltas but not from the registry.
*/
QHash<int, SmartPointer<RegistryObject> > GetAssociatedObjects(const QString& contributionId) const;
/**
* Adds elements to be removed along with the registry object.
*/
void AddAssociatedObjects(QHash<int, SmartPointer<RegistryObject> >& map,
const SmartPointer<RegistryObject>& registryObject);
/**
* Add to the set of the objects all extensions and extension points that
* could be navigated to from the objects in the set.
*/
void AddNavigableObjects(QHash<int, SmartPointer<RegistryObject> >& associatedObjects);
void RemoveObjects(const QHash<int, SmartPointer<RegistryObject> >& associatedObjects);
SmartPointer<IObjectManager> CreateDelegatingObjectManager(const QHash<int, SmartPointer<RegistryObject> >& object);
bool UnlinkChildFromContributions(int id);
private:
// key: extensionPointName, value: object id
HashtableOfStringAndInt extensionPoints; //This is loaded on startup. Then entries can be added when loading a new plugin from the xml.
// key: object id, value: an object
RegistryObjectReferenceMap* cache; //Entries are added by getter. The structure is not thread safe.
//key: int, value: int
//OffsetTable fileOffsets = null; //This is read once on startup when loading from the cache. Entries are never added here. They are only removed to prevent "removed" objects to be reloaded.
int nextId; //This is only used to get the next number available.
mutable bool orphanExtensionsLoaded;
//Those two data structures are only used when the addition or the removal of a plugin occurs.
//They are used to keep track on a contributor basis of the extension being added or removed
KeyedHashSet newContributions; //represents the contributers added during this session.
mutable KeyedHashSet formerContributions; //represents the contributers encountered in previous sessions. This is loaded lazily.
mutable bool formerContributionsLoaded;
mutable QHash<QString, SmartPointer<RegistryContributor> > contributors; // key: contributor ID; value: contributor name
mutable bool contributorsLoaded;
QHash<QString, SmartPointer<RegistryContributor> > removedContributors; // key: contributor ID; value: contributor name
mutable KeyedHashSet namespacesIndex; // registry elements (extension & extensionpoints) indexed by namespaces
mutable bool namespacesIndexLoaded;
// Map key: extensionPointFullyQualifiedName, value int[] of orphan extensions.
// The orphan access does not need to be synchronized because the it is protected by the lock in extension registry.
mutable QHash<QString, QList<int> > orphanExtensions;
KeyedHashSet heldObjects; //strong reference to the objects that must be hold on to
//Indicate if objects have been removed or added from the table. This only needs to be set in a couple of places (addNamespace and removeNamespace)
bool isDirty;
bool fromCache;
ExtensionRegistry* registry;
// TODO make ExtensionPoint, Extension provide namespace in a same way (move it to the RegistryObject?)
// See if all the registryObjects have the same namespace. If not, return null.
// Also can return null if empty array is passed in or objects are of an unexpected type
QString FindCommonNamespaceIdentifier(const QList<SmartPointer<RegistryObject> >& registryObjects) const;
void RemoveExtensionPointFromNamespaceIndex(int extensionPoint, const QString& namespaceName);
void RemoveExtensionFromNamespaceIndex(int extensions, const QString& namespaceName);
// Called from a synchronized method
void UpdateNamespaceIndex(const SmartPointer<RegistryContribution>& contribution, bool added);
KeyedHashSet& GetFormerContributions() const;
void Remove(const SmartPointer<RegistryObject>& registryObject, bool release);
void Hold(const SmartPointer<RegistryObject>& toHold);
void Release(const SmartPointer<RegistryObject>& toRelease);
SmartPointer<RegistryObject> BasicGetObject(int id, short type) const;
SmartPointer<RegistryObject> Load(int id, short type) const;
OrphansMapType& GetOrphans() const;
// Find or create required index element
SmartPointer<RegistryIndexElement> GetNamespaceIndex(const QString& namespaceName) const;
void CollectChildren(const SmartPointer<RegistryObject>& ce, int level,
QHash<int, SmartPointer<RegistryObject> >& collector) const;
// Called from a synchronized method only
bool UnlinkChildFromContributions(const QList<SmartPointer<KeyedElement> >& contributions, int id);
};
}
#endif // BERRYREGISTRYOBJECTMANAGER_H
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryThirdLevelConfigurationElementHandle.h b/Plugins/org.blueberry.core.runtime/src/internal/berryThirdLevelConfigurationElementHandle.h
index c2efd12e1a..5273b45ce4 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryThirdLevelConfigurationElementHandle.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryThirdLevelConfigurationElementHandle.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYTHIRDLEVELCONFIGURATIONELEMENTHANDLE_H
#define BERRYTHIRDLEVELCONFIGURATIONELEMENTHANDLE_H
#include "berryConfigurationElementHandle.h"
namespace berry {
class ThirdLevelConfigurationElementHandle : public ConfigurationElementHandle
{
public:
- berryObjectMacro(berry::ThirdLevelConfigurationElementHandle)
+ berryObjectMacro(berry::ThirdLevelConfigurationElementHandle);
ThirdLevelConfigurationElementHandle(const SmartPointer<const IObjectManager>& objectManager, int id);
ThirdLevelConfigurationElementHandle(const IObjectManager* objectManager, int id);
using ConfigurationElementHandle::GetChildren;
QList<SmartPointer<IConfigurationElement> > GetChildren() const override;
protected:
SmartPointer<ConfigurationElement> GetConfigurationElement() const override;
};
}
#endif // BERRYTHIRDLEVELCONFIGURATIONELEMENTHANDLE_H
diff --git a/Plugins/org.blueberry.core.runtime/src/registry/berryIConfigurationElement.h b/Plugins/org.blueberry.core.runtime/src/registry/berryIConfigurationElement.h
index d64eb10bb2..5170bb8bdc 100644
--- a/Plugins/org.blueberry.core.runtime/src/registry/berryIConfigurationElement.h
+++ b/Plugins/org.blueberry.core.runtime/src/registry/berryIConfigurationElement.h
@@ -1,300 +1,300 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEXTENSIONELEMENT_H_
#define BERRYIEXTENSIONELEMENT_H_
#include <berryObject.h>
#include <berryLog.h>
namespace berry {
struct IContributor;
struct IExtension;
class Handle;
/**
* A configuration element, with its attributes and children,
* directly reflects the content and structure of the extension section
* within the declaring plug-in's manifest (<code>plugin.xml</code>) file.
* <p>
* This interface also provides a way to create executable extension
* objects.
* </p>
* <p>
* These registry objects are intended for relatively short-term use. Clients that
* deal with these objects must be aware that they may become invalid if the
* declaring plug-in is updated or uninstalled. If this happens, all methods except
* {@link #IsValid()} will throw {@link InvalidRegistryObjectException}.
* For configuration element objects, the most common case is code in a plug-in dealing
* with extensions contributed to one of the extension points it declares.
* Code in a plug-in that has declared that it is not dynamic aware (or not
* declared anything) can safely ignore this issue, since the registry
* would not be modified while it is active. However, code in a plug-in that
* declares that it is dynamic aware must be careful when accessing the extension
* and configuration element objects because they become invalid if the contributing
* plug-in is removed. Similarly, tools that analyze or display the extension registry
* are vulnerable. Client code can pre-test for invalid objects by calling {@link #IsValid()},
* which never throws this exception. However, pre-tests are usually not sufficient
* because of the possibility of the extension or configuration element object becoming
* invalid as a result of a concurrent activity. At-risk clients must treat
* <code>InvalidRegistryObjectException</code> as if it were a checked exception.
* Also, such clients should probably register a listener with the extension registry
* so that they receive notification of any changes to the registry.
* </p><p>
* This interface is not intended to be implemented by clients.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
*/
struct org_blueberry_core_runtime_EXPORT IConfigurationElement : public virtual Object
{
- berryObjectMacro(berry::IConfigurationElement)
+ berryObjectMacro(berry::IConfigurationElement);
~IConfigurationElement() override;
/**
* Creates and returns a new instance of the executable extension
* identified by the named attribute of this configuration element.
* The named attribute value must contain a fully qualified name
* of a class. The class can either refer to a class implementing
* the executable extension or to a factory capable of returning the
* executable extension.
* <p>
* The specified class is instantiated using its 0-argument public constructor.
* <p>
* Then the following checks are done:<br>
* If the specified class implements the {@link IExecutableExtension}
* interface, the method {@link IExecutableExtension#SetInitializationData(IConfigurationElement, QString, Object*)}
* is called, passing to the object the configuration information that was used to create it.
* <p>
* If the specified class implements {@link IExecutableExtensionFactory}
* interface, the method {@link IExecutableExtensionFactory#Create()}
* is invoked.
* </p>
* <p>
* Unlike other methods on this object, invoking this method may activate
* the plug-in.
* </p>
*
* @param propertyName the name of the property
* @return the executable instance
* @exception CoreException if an instance of the executable extension
* could not be created for any reason
* @see IExecutableExtension#SetInitializationData(IConfigurationElement, QString, Object*)
* @see IExecutableExtensionFactory
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
*/
virtual QObject* CreateExecutableExtension(const QString& propertyName) const = 0;
template<class C>
C* CreateExecutableExtension(const QString &propertyName) const
{
C* interface = qobject_cast<C*>(this->CreateExecutableExtension(propertyName));
if (interface == nullptr)
{
BERRY_WARN << "The QObject subclass " << this->GetAttribute(propertyName).toStdString()
<< " does not seem to implement the required interface \""
<< qobject_interface_iid<C*>() << "\", or you forgot the Q_INTERFACES macro.";
}
return interface;
}
/**
* Returns the named attribute of this configuration element, or
* <code>null</code> if none.
* <p>
* The names of configuration element attributes
* are the same as the attribute names of the corresponding XML element.
* For example, the configuration markup
* <pre>
* &lt;bg pattern="stripes"/&gt;
* </pre>
* corresponds to a configuration element named <code>"bg"</code>
* with an attribute named <code>"pattern"</code>
* with attribute value <code>"stripes"</code>.
* </p>
* <p> Note that any translation specified in the plug-in manifest
* file is automatically applied.
* </p>
*
* @param name the name of the attribute
* @return attribute value, or <code>null</code> if none
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
*/
virtual QString GetAttribute(const QString& name) const = 0;
/**
* Returns the names of the attributes of this configuration element.
* Returns an empty list if this configuration element has no attributes.
* <p>
* The names of configuration element attributes
* are the same as the attribute names of the corresponding XML element.
* For example, the configuration markup
* <pre>
* &lt;bg color="blue" pattern="stripes"/&gt;
* </pre>
* corresponds to a configuration element named <code>"bg"</code>
* with attributes named <code>"color"</code>
* and <code>"pattern"</code>.
* </p>
*
* @return the names of the attributes
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
*/
virtual QList<QString> GetAttributeNames() const = 0;
/**
* Returns all configuration elements that are children of this
* configuration element.
* Returns an empty list if this configuration element has no children.
* <p>
* Each child corresponds to a nested
* XML element in the configuration markup.
* For example, the configuration markup
* <pre>
* &lt;view&gt;
* &nbsp&nbsp&nbsp&nbsp&lt;verticalHint&gt;top&lt;/verticalHint&gt;
* &nbsp&nbsp&nbsp&nbsp&lt;horizontalHint&gt;left&lt;/horizontalHint&gt;
* &lt;/view&gt;
* </pre>
* corresponds to a configuration element, named <code>"view"</code>,
* with two children.
* </p>
*
* @return the child configuration elements
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
* @see #getChildren(String)
*/
virtual QList<IConfigurationElement::Pointer> GetChildren() const = 0;
/**
* Returns all child configuration elements with the given name.
* Returns an empty list if this configuration element has no children
* with the given name.
*
* @param name the name of the child configuration element
* @return the child configuration elements with that name
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
* @see #getChildren()
*/
virtual QList<IConfigurationElement::Pointer> GetChildren(const QString& name) const = 0;
/**
* Returns the extension that declares this configuration element.
*
* @return the extension
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
*/
virtual SmartPointer<IExtension> GetDeclaringExtension() const = 0;
/**
* Returns the name of this configuration element.
* The name of a configuration element is the same as
* the XML tag of the corresponding XML element.
* For example, the configuration markup
* <pre>
* &lt;wizard name="Create Project"/&gt;
* </pre>
* corresponds to a configuration element named <code>"wizard"</code>.
*
* @return the name of this configuration element
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
*/
virtual QString GetName() const = 0;
/**
* Returns the element which contains this element. If this element
* is an immediate child of an extension, the
* returned value can be downcast to <code>IExtension</code>.
* Otherwise the returned value can be downcast to
* <code>IConfigurationElement</code>.
*
* @return the parent of this configuration element
* or <code>null</code>
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
*/
virtual SmartPointer<Object> GetParent() const = 0;
/**
* Returns the text value of this configuration element.
* For example, the configuration markup
* <pre>
* &lt;script lang="javascript"&gt;.\scripts\cp.js&lt;/script&gt;
* </pre>
* corresponds to a configuration element <code>"script"</code>
* with value <code>".\scripts\cp.js"</code>.
* <p> Values may span multiple lines (i.e., contain carriage returns
* and/or line feeds).
* <p> Note that any translation specified in the plug-in manifest
* file is automatically applied.
* </p>
*
* @return the text value of this configuration element or <code>null</code>
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
*/
virtual QString GetValue() const = 0;
/**
* When multi-language support is enabled, this method returns the text value of this
* configuration element in the specified locale, or <code>null</code> if none.
* <p>
* The locale matching tries to find the best match between available translations and
* the requested locale, falling back to a more generic locale ("en") when the specific
* locale ("en_US") is not available.
* </p><p>
* If multi-language support is not enabled, this method is equivalent to the method
* {@link #getValue()}.
* </p>
* @param locale the requested locale
* @return the text value of this configuration element in the specified locale,
* or <code>null</code>
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
* @see #GetValue(String)
* @see IExtensionRegistry#IsMultiLanguage()
*/
virtual QString GetValue(const QLocale& locale) const = 0;
/**
* Returns the namespace name for this configuration element.
*
* @return the namespace name for this configuration element
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
*/
virtual QString GetNamespaceIdentifier() const = 0;
/**
* Returns the contributor of this configuration element.
*
* @return the contributor for this configuration element
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
*/
virtual SmartPointer<IContributor> GetContributor() const = 0;
/**
* Returns whether this configuration element object is valid.
*
* @return <code>true</code> if the object is valid, and <code>false</code>
* if it is no longer valid
*/
virtual bool IsValid() const = 0;
};
} // namespace berry
Q_DECLARE_INTERFACE(berry::IConfigurationElement, "org.blueberry.core.IConfigurationElement")
#endif /*BERRYIEXTENSIONELEMENT_H_*/
diff --git a/Plugins/org.blueberry.core.runtime/src/registry/berryIContributor.h b/Plugins/org.blueberry.core.runtime/src/registry/berryIContributor.h
index 6377a14d17..2b353ffc4f 100644
--- a/Plugins/org.blueberry.core.runtime/src/registry/berryIContributor.h
+++ b/Plugins/org.blueberry.core.runtime/src/registry/berryIContributor.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYICONTRIBUTOR_H
#define BERRYICONTRIBUTOR_H
#include "berryObject.h"
#include <org_blueberry_core_runtime_Export.h>
namespace berry {
/**
* This interface describes a registry contributor - an entity that supplies information
* to the extension registry.
* <p>
* Registry contributor objects can be obtained by calling {@link IExtensionPoint#GetContributor()},
* {@link IExtension#GetContributor()}, and {@link IConfigurationElement#GetContributor()}.
* Alternatively, a contributor factory appropriate for the registry in use can be called to directly
* obtain an IContributor object.
* </p><p>
* This interface is not intended to be implemented or extended by clients.
* </p>
* @see ContributorFactoryOSGi
* @see ContributorFactorySimple
*
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
struct org_blueberry_core_runtime_EXPORT IContributor : public Object
{
- berryObjectMacro(berry::IContributor)
+ berryObjectMacro(berry::IContributor);
~IContributor() override;
/**
* Provides name of the contributor (e.g., "org.eclipse.core.runtime").
*
* @return name of the registry contributor
*/
virtual QString GetName() const = 0;
};
}
#endif // BERRYICONTRIBUTOR_H
diff --git a/Plugins/org.blueberry.core.runtime/src/registry/berryIExtension.h b/Plugins/org.blueberry.core.runtime/src/registry/berryIExtension.h
index 358c5af5db..f43c389cf6 100644
--- a/Plugins/org.blueberry.core.runtime/src/registry/berryIExtension.h
+++ b/Plugins/org.blueberry.core.runtime/src/registry/berryIExtension.h
@@ -1,151 +1,151 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEXTENSION_H_
#define BERRYIEXTENSION_H_
#include <berryObject.h>
#include <QList>
namespace berry {
struct IConfigurationElement;
struct IContributor;
/**
* An extension declared in a plug-in.
* All information is obtained from the declaring plug-in's
* manifest (<code>plugin.xml</code>) file.
* <p>
* These registry objects are intended for relatively short-term use. Clients that
* deal with these objects must be aware that they may become invalid if the
* declaring plug-in is updated or uninstalled. If this happens, all methods except
* {@link #IsValid()} will throw {@link InvalidRegistryObjectException}.
* For extension objects, the most common case is code in a plug-in dealing
* with extensions contributed to one of the extension points it declares.
* Code in a plug-in that has declared that it is not dynamic aware (or not
* declared anything) can safely ignore this issue, since the registry
* would not be modified while it is active. However, code in a plug-in that
* declares that it is dynamic aware must be careful when accessing the extension
* objects because they become invalid if the contributing plug-in is removed.
* Similarly, tools that analyze or display the extension registry are vulnerable.
* Client code can pre-test for invalid objects by calling {@link #IsValid()},
* which never throws this exception. However, pre-tests are usually not sufficient
* because of the possibility of the extension object becoming invalid as a
* result of a concurrent activity. At-risk clients must treat
* <code>InvalidRegistryObjectException</code> as if it were a checked exception.
* Also, such clients should probably register a listener with the extension registry
* so that they receive notification of any changes to the registry.
* </p><p>
* This interface is not intended to be implemented by clients.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
*/
struct org_blueberry_core_runtime_EXPORT IExtension : public virtual Object
{
- berryObjectMacro(berry::IExtension)
+ berryObjectMacro(berry::IExtension);
~IExtension() override;
/**
* Returns all configuration elements declared by this extension.
* These elements are a direct reflection of the configuration
* markup supplied in the manifest (<code>plugin.xml</code>)
* file for the plug-in that declares this extension.
* Returns an empty array if this extension does not declare any
* configuration elements.
*
* @return the configuration elements declared by this extension
* @throws InvalidRegistryObjectException if this extension is no longer valid
*/
virtual QList<SmartPointer<IConfigurationElement> > GetConfigurationElements() const = 0;
/**
* Returns the namespace name for this extension.
*
* @return the namespace name for this extension
* @throws InvalidRegistryObjectException if this extension is no longer valid
*/
virtual QString GetNamespaceIdentifier() const = 0;
/**
* Returns the contributor of this extension.
*
* @return the contributor for this extension
* @throws InvalidRegistryObjectException if this extension is no longer valid
*/
virtual SmartPointer<IContributor> GetContributor() const = 0;
/**
* Returns the unique identifier of the extension point
* to which this extension should be contributed.
*
* @return the unique identifier of the relevant extension point
* @throws InvalidRegistryObjectException if this extension is no longer valid
*/
virtual QString GetExtensionPointUniqueIdentifier() const = 0;
/**
* Returns a displayable label for this extension.
* Returns the empty string if no label for this extension
* is specified in the extension manifest file.
* <p> Note that any translation specified in the extension manifest
* file is automatically applied.
* <p>
*
* @return a displayable string label for this extension,
* possibly the empty string
* @throws InvalidRegistryObjectException if this extension is no longer valid
*/
virtual QString GetLabel() const = 0;
/**
* Returns the simple identifier of this extension, or <code>null</code>
* if this extension does not have an identifier.
* This identifier is specified in the extensions manifest
* file as a non-empty string containing no period characters
* (<code>'.'</code>) and must be unique within the defining host.
*
* @return the simple identifier of the extension (e.g. <code>"main"</code>)
* or <code>null</code>
* @throws InvalidRegistryObjectException if this extension is no longer valid
*/
virtual QString GetSimpleIdentifier() const = 0;
/**
* Returns the unique identifier of this extension, or <code>null</code>
* if this extension does not have an identifier.
* If available, this identifier is unique within the extension registry, and
* is composed of the identifier of the host that declared
* this extension and this extension's simple identifier.
*
* @return the unique identifier of the extension
* (e.g. <code>"com.example.acme.main"</code>), or <code>null</code>
* @throws InvalidRegistryObjectException if this extension is no longer valid
*/
virtual QString GetUniqueIdentifier() const = 0;
/**
* Returns whether this extension object is valid.
*
* @return <code>true</code> if the object is valid, and <code>false</code>
* if it is no longer valid
*/
virtual bool IsValid() const = 0;
};
}
#endif /*BERRYIEXTENSION_H_*/
diff --git a/Plugins/org.blueberry.core.runtime/src/registry/berryIExtensionPoint.h b/Plugins/org.blueberry.core.runtime/src/registry/berryIExtensionPoint.h
index ab699a342b..faa799e5df 100644
--- a/Plugins/org.blueberry.core.runtime/src/registry/berryIExtensionPoint.h
+++ b/Plugins/org.blueberry.core.runtime/src/registry/berryIExtensionPoint.h
@@ -1,163 +1,163 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEXTENSIONPOINT_H_
#define BERRYIEXTENSIONPOINT_H_
#include <berryObject.h>
namespace berry {
struct IConfigurationElement;
struct IContributor;
struct IExtension;
/**
* An extension point declared in a plug-in.
* Except for the list of extensions plugged in to it, the information
* available for an extension point is obtained from the declaring plug-in's
* manifest (<code>plugin.xml</code>) file.
* <p>
* These registry objects are intended for relatively short-term use. Clients that
* deal with these objects must be aware that they may become invalid if the
* declaring plug-in is updated or uninstalled. If this happens, all methods except
* {@link #isValid()} will throw {@link InvalidRegistryObjectException}.
* For extension point objects, the most common case is code in a plug-in dealing
* with one of the extension points it declares. These extension point objects are
* guaranteed to be valid while the plug-in is active. Code in a plug-in that has
* declared that it is not dynamic aware (or not declared anything) can also safely
* ignore this issue, since the registry would not be modified while it is
* active. However, code in a plug-in that declares that it is dynamic aware
* must be careful if it access the extension point object of a different plug-in,
* because it's at risk if that other plug-in is removed. Similarly,
* tools that analyze or display the extension registry are vulnerable.
* Client code can pre-test for invalid objects by calling {@link #isValid()},
* which never throws this exception. However, pre-tests are usually not sufficient
* because of the possibility of the extension point object becoming invalid as a
* result of a concurrent activity. At-risk clients must treat
* <code>InvalidRegistryObjectException</code> as if it were a checked exception.
* Also, such clients should probably register a listener with the extension registry
* so that they receive notification of any changes to the registry.
* </p>
* <p>
* This interface is not intended to be implemented by clients.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
*/
struct IExtensionPoint : public virtual Object
{
- berryObjectMacro(berry::IExtensionPoint)
+ berryObjectMacro(berry::IExtensionPoint);
~IExtensionPoint() override;
/**
* Returns all configuration elements from all extensions configured
* into this extension point. Returns an empty array if this extension
* point has no extensions configured, or none of the extensions
* contain configuration elements.
*
* @return the configuration elements for all extension configured
* into this extension point
* @throws InvalidRegistryObjectException if this extension point is no longer valid
*/
virtual QList<SmartPointer<IConfigurationElement> > GetConfigurationElements() const = 0;
/**
* Returns the namespace name for this extension point.
*
* @return the namespace name for this extension point
* @throws InvalidRegistryObjectException if this extension point is no longer valid
*/
virtual QString GetNamespaceIdentifier() const = 0;
/**
* Returns the contributor of this extension point.
*
* @return the contributor for this extension point
* @throws InvalidRegistryObjectException if this extension point is no longer valid
*/
virtual SmartPointer<IContributor> GetContributor() const = 0;
/**
* Returns the extension with the given unique identifier configured into
* this extension point, or <code>null</code> if there is no such extension.
* Since an extension might not have an identifier, some extensions
* can only be found via the <code>getExtensions</code> method.
*
* @param extensionId the unique identifier of an extension
* (e.g. <code>"com.example.acme.main"</code>).
* @return an extension, or <code>null</code>
* @throws InvalidRegistryObjectException if this extension point is no longer valid
*/
virtual SmartPointer<IExtension> GetExtension(const QString& extensionId) const = 0;
/**
* Returns all extensions configured into this extension point.
* Returns an empty array if this extension point has no extensions.
*
* @return the extensions configured into this extension point
* @throws InvalidRegistryObjectException if this extension point is no longer valid
*/
virtual QList<SmartPointer<IExtension> > GetExtensions() const = 0;
/**
* Returns a displayable label for this extension point.
* Returns the empty string if no label for this extension point
* is specified in the plug-in manifest file.
* <p> Note that any translation specified in the plug-in manifest
* file is automatically applied.
* </p>
*
* @return a displayable string label for this extension point,
* possibly the empty string
* @throws InvalidRegistryObjectException if this extension point is no longer valid
*/
virtual QString GetLabel() const = 0;
/**
* Returns the simple identifier of this extension point.
* This identifier is a non-empty string containing no
* period characters (<code>'.'</code>) and is guaranteed
* to be unique within the defining plug-in.
*
* @return the simple identifier of the extension point (e.g. <code>"builders"</code>)
* @throws InvalidRegistryObjectException if this extension point is no longer valid
*/
virtual QString GetSimpleIdentifier() const = 0;
/**
* Returns the unique identifier of this extension point.
* This identifier is unique within the plug-in registry, and
* is composed of the namespace for this extension point
* and this extension point's simple identifier.
*
*
* @return the unique identifier of the extension point
* (e.g. <code>"org.blueberry.core.resources.builders"</code>)
* @throws InvalidRegistryObjectException if this extension point is no longer valid
*/
virtual QString GetUniqueIdentifier() const = 0;
/**
* Returns whether this extension point object is valid.
*
* @return <code>true</code> if the object is valid, and <code>false</code>
* if it is no longer valid
*/
virtual bool IsValid() const = 0;
};
}
#endif /*BERRYIEXTENSIONPOINT_H_*/
diff --git a/Plugins/org.blueberry.test/src/berryITestDescriptor.h b/Plugins/org.blueberry.test/src/berryITestDescriptor.h
index 9cf2bfa989..f012c9185b 100644
--- a/Plugins/org.blueberry.test/src/berryITestDescriptor.h
+++ b/Plugins/org.blueberry.test/src/berryITestDescriptor.h
@@ -1,38 +1,38 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYITESTDESCRIPTOR_H_
#define BERRYITESTDESCRIPTOR_H_
#include <berryObject.h>
#include <berryMacros.h>
#include <cppunit/Test.h>
namespace berry {
struct ITestDescriptor : public Object
{
- berryObjectMacro(berry::ITestDescriptor)
+ berryObjectMacro(berry::ITestDescriptor);
virtual CppUnit::Test* CreateTest() = 0;
virtual QString GetId() const = 0;
virtual QString GetContributor() const = 0;
virtual QString GetDescription() const = 0;
virtual bool IsUITest() const = 0;
};
}
#endif /* BERRYITESTDESCRIPTOR_H_ */
diff --git a/Plugins/org.blueberry.test/src/internal/berryTestDescriptor.h b/Plugins/org.blueberry.test/src/internal/berryTestDescriptor.h
index 02fed4f1c6..32fa3ca44f 100644
--- a/Plugins/org.blueberry.test/src/internal/berryTestDescriptor.h
+++ b/Plugins/org.blueberry.test/src/internal/berryTestDescriptor.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYTESTDESCRIPTOR_H_
#define BERRYTESTDESCRIPTOR_H_
#include "berryITestDescriptor.h"
#include <berryIConfigurationElement.h>
namespace berry {
class TestDescriptor : public ITestDescriptor
{
public:
- berryObjectMacro(TestDescriptor)
+ berryObjectMacro(TestDescriptor);
TestDescriptor(IConfigurationElement::Pointer elem);
CppUnit::Test* CreateTest();
QString GetId() const;
QString GetContributor() const;
QString GetDescription() const;
bool IsUITest() const;
private:
IConfigurationElement::Pointer configElem;
};
}
#endif /* BERRYTESTDESCRIPTOR_H_ */
diff --git a/Plugins/org.blueberry.ui.qt.help/src/internal/berryHelpEditorInput.h b/Plugins/org.blueberry.ui.qt.help/src/internal/berryHelpEditorInput.h
index a35c7a65bf..9c6a46a47a 100644
--- a/Plugins/org.blueberry.ui.qt.help/src/internal/berryHelpEditorInput.h
+++ b/Plugins/org.blueberry.ui.qt.help/src/internal/berryHelpEditorInput.h
@@ -1,56 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYHELPEDITORINPUT_H_
#define BERRYHELPEDITORINPUT_H_
#include <berryIEditorInput.h>
#include <berryIPersistableElement.h>
#include <berryPlatformObject.h>
#include <QUrl>
namespace berry
{
class HelpEditorInput : public PlatformObject, public IEditorInput, public IPersistableElement
{
public:
- berryObjectMacro(HelpEditorInput)
+ berryObjectMacro(HelpEditorInput);
HelpEditorInput(const QUrl& url = QUrl());
bool Exists() const override;
QString GetName() const override;
QString GetToolTipText() const override;
QIcon GetIcon() const override;
const IPersistableElement* GetPersistable() const override;
Object* GetAdapter(const QString &adapterType) const override;
QString GetFactoryId() const override;
void SaveState(const SmartPointer<IMemento>& memento) const override;
bool operator==(const berry::Object*) const override;
QUrl GetUrl() const;
private:
QUrl url;
};
}
#endif /*BERRYHELPEDITORINPUT_H_*/
diff --git a/Plugins/org.blueberry.ui.qt.objectinspector/CMakeLists.txt b/Plugins/org.blueberry.ui.qt.objectinspector/CMakeLists.txt
index b178f8ceed..d8f2bee4ab 100644
--- a/Plugins/org.blueberry.ui.qt.objectinspector/CMakeLists.txt
+++ b/Plugins/org.blueberry.ui.qt.objectinspector/CMakeLists.txt
@@ -1,10 +1,10 @@
project(org_blueberry_ui_qt_objectinspector)
mitk_create_plugin(
EXPORT_DIRECTIVE BERRY_OBJECTINSPECTOR_EXPORT
EXPORTED_INCLUDE_SUFFIXES src
)
-if(NOT BLUEBERRY_DEBUG_SMARTPOINTER)
+if(NOT BLUEBERRY_DEBUG_SMARTPOINTER AND NOT MITK_BUILD_CONFIGURATION STREQUAL "All")
message("You should set BLUEBERRY_DEBUG_SMARTPOINTER to ON if you want the plug-in ${Plugin-SymbolicName} to be useful")
endif()
diff --git a/Plugins/org.blueberry.ui.qt/src/actions/berryAbstractContributionFactory.h b/Plugins/org.blueberry.ui.qt/src/actions/berryAbstractContributionFactory.h
index d58a9f1c8a..cdff48a34d 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryAbstractContributionFactory.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryAbstractContributionFactory.h
@@ -1,135 +1,135 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYABSTRACTCONTRIBUTIONFACTORY_H_
#define BERRYABSTRACTCONTRIBUTIONFACTORY_H_
#include <berryObject.h>
#include <org_blueberry_ui_qt_Export.h>
namespace berry {
struct IServiceLocator;
struct IContributionRoot;
/**
* ContributionFactories are used by the IMenuService to populate
* ContributionManagers. In {@link #createContributionItems(IServiceLocator, IContributionRoot)}
* you fill in the additions List with {@link IContributionItem} to be inserted at this
* factory's location. For example:
* <p>
*
* <pre>
* AbstractContributionFactory contributions = new AbstractContributionFactory(
* &quot;menu:org.eclipse.ui.tests.api.MenuTestHarness?after=additions&quot;) {
* public void createContributionItems(IMenuService menuService, List additions) {
* CommandContributionItem item = new CommandContributionItem(
* &quot;org.eclipse.ui.tests.menus.helloWorld&quot;,
* &quot;org.eclipse.ui.tests.commands.enabledHelloWorld&quot;, null, null,
* &quot;Say Hello&quot;, null);
* additions.add(item);
* item = new CommandContributionItem(
* &quot;org.eclipse.ui.tests.menus.refresh&quot;,
* &quot;org.eclipse.ui.tests.commands.refreshView&quot;, null, null,
* &quot;Refresh&quot;, null);
* menuService.registerVisibleWhen(item, new MyActiveContextExpression(
* &quot;org.eclipse.ui.tests.myview.context&quot;));
* additions.add(item);
* }
*
* public void releaseContributionItems(IMenuService menuService, List items) {
* // we have nothing to do
* }
* };
* IMenuService service = (IMenuService) PlatformUI.getWorkbench().getService(
* IMenuService.class);
* service.addContributionFactory(contributions);
* </pre>
*
* </p>
* <p>
* Only the abstract methods may be implemented.
* </p>
*
* @see IMenuService
* @see MenuManager
* @see ToolBarManager
*/
class BERRY_UI_QT AbstractContributionFactory: public Object
{
private:
QString location;
QString namespaze;
public:
- berryObjectMacro(berry::AbstractContributionFactory)
+ berryObjectMacro(berry::AbstractContributionFactory);
/**
* The contribution factories must be instantiated with their location,
* which which specifies the contributions insertion location.
*
* @param location
* the addition location in Menu API URI format. It must not be
* <code>null</code>.
* @param namespace
* the namespace for this contribution. May be <code>null</code>.
* @see #getNamespace()
*/
AbstractContributionFactory(const QString& location,
const QString& namespaze);
/**
* Return the location as a String.
*
* @return the location - never <code>null</code>.
*/
QString GetLocation() const;
/**
* This factory should create the IContributionItems that it wants to
* contribute, and add them to the additions list. The menu service will
* call this method at the appropriate time. It should always return new
* instances of its contributions in the additions list.
* <p>
* This method is not meant to be called by clients. It will be called by
* the menu service at the appropriate time.
* </p>
*
* @param serviceLocator
* a service locator that may be used in the construction of
* items created by this factory
* @param additions
* A {@link IContributionRoot} supplied by the framework. It will
* never be <code>null</code>.
* @see org.eclipse.ui.menus.CommandContributionItem
* @see org.eclipse.jface.action.MenuManager
*/
virtual void CreateContributionItems(IServiceLocator* serviceLocator,
const SmartPointer<IContributionRoot>& additions) = 0;
/**
* Return the namespace for this cache. This corresponds to the plug-in that
* is contributing this factory.
*
* @return the namespace the namespace of this factory
*/
QString GetNamespace() const;
};
}
#endif /* BERRYABSTRACTCONTRIBUTIONFACTORY_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/actions/berryCommandContributionItemParameter.h b/Plugins/org.blueberry.ui.qt/src/actions/berryCommandContributionItemParameter.h
index 0a8c67d7d5..5001a63f8a 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryCommandContributionItemParameter.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryCommandContributionItemParameter.h
@@ -1,197 +1,197 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYCOMMANDCONTRIBUTIONITEMPARAMETER_H
#define BERRYCOMMANDCONTRIBUTIONITEMPARAMETER_H
#include <QHash>
#include <QIcon>
#include <QKeySequence>
#include "berryCommandContributionItem.h"
namespace berry {
struct IServiceLocator;
/**
* A help class for the various parameters that can be used with command
* contributions. Mandatory parameters are in the constructor, and public fields
* can be set to fill in other parameters.
*/
class BERRY_UI_QT CommandContributionItemParameter : public virtual Object
{
public:
- berryObjectMacro(CommandContributionItemParameter)
+ berryObjectMacro(CommandContributionItemParameter);
/**
* a service locator that is most appropriate for this contribution.
* Typically the local {@link IWorkbenchWindow} or
* {@link IWorkbenchPartSite} will be sufficient. Must not be
* <code>null</code>.
*/
IServiceLocator* serviceLocator;
/**
* The id for this item. May be <code>null</code>. Items without an id
* cannot be referenced later.
*/
QString id;
/**
* A command id for a defined command. Must not be <code>null</code>.
*/
QString commandId;
/**
* A map of strings to strings which represent parameter names to values.
* The parameter names must match those in the command definition. May be
* <code>null</code>
*/
QHash<QString, Object::Pointer> parameters;
/**
* An icon for this item. May be <code>null</code>.
*/
QIcon icon;
/**
* A label for this item. May be <code>null</code>.
*/
QString label;
/**
* A mnemonic for this item to be applied to the label. May be
* <code>null</code>.
*/
QChar mnemonic;
/**
* A shortcut key sequence. This is a workaround and will be
* removed when key binding support is fully implemented
*/
QKeySequence shortcut;
/**
* A tooltip for this item. May be <code>null</code>. Tooltips are
* currently only valid for toolbar contributions.
*/
QString tooltip;
/**
* The style of this menu contribution. See the CommandContributionItem
* STYLE_* contants.
*/
CommandContributionItem::Style style;
/**
* The help context id to be applied to this contribution. May be
* <code>null</code>
*/
QString helpContextId;
/**
* The icon style to use.
*/
QString iconStyle;
/**
* The visibility tracking for a menu contribution.
*/
bool visibleEnabled;
/**
* Any number of mode bits, like
* {@link CommandContributionItem#MODE_FORCE_TEXT}.
*/
CommandContributionItem::Modes mode;
/**
* Create the parameter object. Nullable attributes can be set directly.
*
* @param serviceLocator
* a service locator that is most appropriate for this
* contribution. Typically the local {@link IWorkbenchWindow} or
* {@link IWorkbenchPartSite} will be sufficient. Must not be
* <code>null</code>.
* @param id
* The id for this item. May be <code>null</code>. Items
* without an id cannot be referenced later.
* @param commandId
* A command id for a defined command. Must not be
* <code>null</code>.
* @param style
* The style of this menu contribution. See the STYLE_* contants.
*/
CommandContributionItemParameter(IServiceLocator* serviceLocator,
const QString& id, const QString& commandId,
CommandContributionItem::Style style);
/**
* Build the parameter object.
* <p>
* <b>Note:</b> This constructor should not be called outside the framework.
* </p>
*
* @param serviceLocator
* a service locator that is most appropriate for this
* contribution. Typically the local {@link IWorkbenchWindow} or
* {@link IWorkbenchPartSite} will be sufficient. Must not be
* <code>null</code>.
* @param id
* The id for this item. May be <code>null</code>. Items
* without an id cannot be referenced later.
* @param commandId
* A command id for a defined command. Must not be
* <code>null</code>.
* @param parameters
* A map of strings to strings which represent parameter names to
* values. The parameter names must match those in the command
* definition. May be <code>null</code>
* @param icon
* An icon for this item. May be <code>null</code>.
* @param disabledIcon
* A disabled icon for this item. May be <code>null</code>.
* @param hoverIcon
* A hover icon for this item. May be <code>null</code>.
* @param label
* A label for this item. May be <code>null</code>.
* @param mnemonic
* A mnemonic for this item to be applied to the label. May be
* <code>null</code>.
* @param tooltip
* A tooltip for this item. May be <code>null</code>. Tooltips
* are currently only valid for toolbar contributions.
* @param style
* The style of this menu contribution. See the STYLE_* contants.
* @param helpContextId
* the help context id to be applied to this contribution. May be
* <code>null</code>
* @param visibleEnabled
* Visibility tracking for the menu contribution.
* @noreference This constructor is not intended to be referenced by clients.
*/
CommandContributionItemParameter(IServiceLocator* serviceLocator,
const QString& id, const QString& commandId,
const QHash<QString, Object::Pointer> &parameters,
const QIcon& icon, const QString label,
const QChar &mnemonic, const QString& tooltip,
CommandContributionItem::Style style, const QString& helpContextId,
bool visibleEnabled);
};
}
#endif // BERRYCOMMANDCONTRIBUTIONITEM_H
diff --git a/Plugins/org.blueberry.ui.qt/src/actions/berryContributionItem.h b/Plugins/org.blueberry.ui.qt/src/actions/berryContributionItem.h
index 421f4896b2..c2d28f944b 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryContributionItem.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryContributionItem.h
@@ -1,227 +1,227 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYCONTRIBUTIONITEM_H
#define BERRYCONTRIBUTIONITEM_H
#include "berryIContributionItem.h"
#include <org_blueberry_ui_qt_Export.h>
namespace berry {
/**
* An abstract base implementation for contribution items.
*/
class BERRY_UI_QT ContributionItem : public IContributionItem
{
public:
- berryObjectMacro(ContributionItem)
+ berryObjectMacro(ContributionItem);
enum Mode {
DEFAULT = 0x00,
/**
* Mode bit: Show text on tool items or buttons, even if an image is
* present. If this mode bit is not set, text is only shown on tool items if
* there is no image present.
*/
MODE_FORCE_TEXT = 0x01
};
Q_DECLARE_FLAGS(Modes, Mode)
enum Style {
/**
* A push button tool item or menu item.
*/
STYLE_PUSH = 0x01,
/**
* A checked tool item or menu item.
*/
STYLE_CHECK = 0x02,
/**
* A radio-button style menu item.
*/
STYLE_RADIO = 0x04,
/**
* A ToolBar pulldown item.
*/
STYLE_PULLDOWN = 0x08
};
/**
* The default implementation of this <code>IContributionItem</code>
* method does nothing. Subclasses may override.
*/
void Fill(QStatusBar* parent) override;
/**
* The default implementation of this <code>IContributionItem</code>
* method does nothing. Subclasses may override.
*/
void Fill(QMenu* menu, QAction* before) override;
/**
* The default implementation of this <code>IContributionItem</code>
* method does nothing. Subclasses may override.
*/
void Fill(QMenuBar* menu, QAction* before) override;
/**
* The default implementation of this <code>IContributionItem</code>
* method does nothing. Subclasses may override.
*/
void Fill(QToolBar* parent, QAction* before) override;
/**
* The default implementation of this <code>IContributionItem</code>
* method does nothing. Subclasses may override.
*/
void SaveWidgetState() override;
/*
* Method declared on IContributionItem.
*/
QString GetId() const override;
/**
* Returns the parent contribution manager, or <code>null</code> if this
* contribution item is not currently added to a contribution manager.
*
* @return the parent contribution manager, or <code>null</code>
*/
IContributionManager *GetParent() const;
/**
* The default implementation of this <code>IContributionItem</code>
* method returns <code>false</code>. Subclasses may override.
*/
bool IsDirty() const override;
/**
* The default implementation of this <code>IContributionItem</code>
* method returns <code>true</code>. Subclasses may override.
*/
bool IsEnabled() const override;
/**
* The default implementation of this <code>IContributionItem</code>
* method returns <code>false</code>. Subclasses may override.
*/
bool IsDynamic() const override;
/**
* The default implementation of this <code>IContributionItem</code>
* method returns <code>false</code>. Subclasses may override.
*/
bool IsGroupMarker() const override;
/**
* The default implementation of this <code>IContributionItem</code>
* method returns <code>false</code>. Subclasses may override.
*/
bool IsSeparator() const override;
/**
* The default implementation of this <code>IContributionItem</code>
* method returns the value recorded in an internal state variable,
* which is <code>true</code> by default. <code>setVisible</code>
* should be used to change this setting.
*/
bool IsVisible() const override;
/**
* The default implementation of this <code>IContributionItem</code>
* method stores the value in an internal state variable,
* which is <code>true</code> by default.
*/
void SetVisible(bool visible) override;
/**
* Returns a string representation of this contribution item
* suitable only for debugging.
*/
QString ToString() const override;
/**
* The default implementation of this <code>IContributionItem</code>
* method does nothing. Subclasses may override.
*/
void Update() override;
/*
* Method declared on IContributionItem.
*/
void SetParent(IContributionManager* parent) override;
/**
* The <code>ContributionItem</code> implementation of this
* method declared on <code>IContributionItem</code> does nothing.
* Subclasses should override to update their state.
*/
void Update(const QString& id) override;
/**
* The ID for this contribution item. It should be set once either in the
* constructor or using this method.
*
* @param itemId
* @see #getId()
*/
void SetId(const QString& itemId);
protected:
/**
* Creates a contribution item with a <code>null</code> id.
* Calls <code>this(String)</code> with <code>null</code>.
*/
ContributionItem();
/**
* Creates a contribution item with the given (optional) id.
* The given id is used to find items in a contribution manager,
* and for positioning items relative to other items.
*
* @param id the contribution item identifier, or <code>null</code>
*/
ContributionItem(const QString& id);
private:
/**
* The identifier for this contribution item, of <code>null</code> if none.
*/
QString id;
/**
* Indicates this item is visible in its manager; <code>true</code>
* by default.
*/
bool visible;
/**
* The parent contribution manager for this item
*/
IContributionManager* parent;
};
}
#endif // BERRYCONTRIBUTIONITEM_H
diff --git a/Plugins/org.blueberry.ui.qt/src/actions/berryContributionManager.h b/Plugins/org.blueberry.ui.qt/src/actions/berryContributionManager.h
index c495bba385..d62e7af4ce 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryContributionManager.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryContributionManager.h
@@ -1,339 +1,339 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYCONTRIBUTIONMANAGER_H
#define BERRYCONTRIBUTIONMANAGER_H
#include "berryIContributionManager.h"
namespace berry {
struct IContributionManagerOverrides;
/**
* Abstract base class for all contribution managers, and standard
* implementation of <code>IContributionManager</code>. This class provides
* functionality common across the specific managers defined by this framework.
* <p>
* This class maintains a list of contribution items and a dirty flag, both as
* internal state. In addition to providing implementations of most
* <code>IContributionManager</code> methods, this class automatically
* coalesces adjacent separators, hides beginning and ending separators, and
* deals with dynamically changing sets of contributions. When the set of
* contributions does change dynamically, the changes are propagated to the
* control via the <code>update</code> method, which subclasses must
* implement.
* </p>
* <p>
* Note: A <code>ContributionItem</code> cannot be shared between different
* <code>ContributionManager</code>s.
* </p>
*/
class ContributionManager : public virtual IContributionManager
{
protected:
// Internal debug flag.
// static final boolean DEBUG = false;
public:
- berryObjectMacro(berry::ContributionManager)
+ berryObjectMacro(berry::ContributionManager);
~ContributionManager() override;
/*
* Method declared on IContributionManager.
*/
void Add(QAction* action, const QString& id) override;
/*
* Method declared on IContributionManager.
*/
void Add(const SmartPointer<IContributionItem>& item) override;
/*
* Method declared on IContributionManager.
*/
void AppendToGroup(const QString& groupName, QAction* action, const QString& id) override;
/*
* Method declared on IContributionManager.
*/
void AppendToGroup(const QString& groupName, const SmartPointer<IContributionItem>& item) override;
/*
* Method declared on IContributionManager.
*/
SmartPointer<IContributionItem> Find(const QString& id) const override;
/*
* Method declared on IContributionManager.
*/
QList<SmartPointer<IContributionItem> > GetItems() const override;
/**
* Return the number of contributions in this manager.
*
* @return the number of contributions in this manager
*/
int GetSize();
/**
* The <code>ContributionManager</code> implementation of this method
* declared on <code>IContributionManager</code> returns the current
* overrides. If there is no overrides it lazily creates one which overrides
* no item state.
*/
SmartPointer<IContributionManagerOverrides> GetOverrides() override;
/**
* Returns the index of the item with the given id.
*
* @param id
* The id of the item whose index is requested.
*
* @return <code>int</code> the index or -1 if the item is not found
*/
int IndexOf(const QString& id);
/**
* Insert the item at the given index.
*
* @param index
* The index to be used for insertion
* @param item
* The item to be inserted
*/
void Insert(int index, const SmartPointer<IContributionItem>& item);
/*
* (non-Javadoc) Method declared on IContributionManager.
*/
//void InsertAfter(const QString& ID, Action* action);
/*
* (non-Javadoc) Method declared on IContributionManager.
*/
void InsertAfter(const QString& ID, const SmartPointer<IContributionItem>& item) override;
/*
* (non-Javadoc) Method declared on IContributionManager.
*/
//void InsertBefore(const QString& ID, Action* action);
/*
* Method declared on IContributionManager.
*/
void InsertBefore(const QString& ID, const SmartPointer<IContributionItem>& item) override;
/*
* Method declared on IContributionManager.
*/
bool IsDirty() const override;
/*
* Method declared on IContributionManager.
*/
bool IsEmpty() const override;
/*
* Method declared on IContributionManager.
*/
void MarkDirty() override;
/*
* Method declared on IContributionManager.
*/
//void PrependToGroup(const QString& groupName, Action* action);
/*
* Method declared on IContributionManager.
*/
void PrependToGroup(const QString& groupName, const SmartPointer<IContributionItem>& item) override;
/*
* Method declared on IContributionManager.
*/
SmartPointer<IContributionItem> Remove(const QString& ID) override;
/*
* Method declared on IContributionManager.
*/
SmartPointer<IContributionItem> Remove(const SmartPointer<IContributionItem> &item) override;
/*
* (non-Javadoc) Method declared on IContributionManager.
*/
void RemoveAll() override;
/**
* Replaces the item of the given identifier with another contribution item.
* This can be used, for example, to replace large contribution items with
* placeholders to avoid memory leaks. If the identifier cannot be found in
* the current list of items, then this does nothing. If multiple
* occurrences are found, then the replacement items is put in the first
* position and the other positions are removed.
*
* @param identifier
* The identifier to look for in the list of contributions;
* should not be <code>null</code>.
* @param replacementItem
* The contribution item to replace the old item; must not be
* <code>null</code>. Use
* {@link org.eclipse.jface.action.ContributionManager#remove(java.lang.String) remove}
* if that is what you want to do.
* @return <code>true</code> if the given identifier can be; <code>
*/
bool ReplaceItem(const QString &identifier,
const SmartPointer<IContributionItem>& replacementItem);
/**
* Sets the overrides for this contribution manager
*
* @param newOverrides
* the overrides for the items of this manager
*/
void SetOverrides(const SmartPointer<IContributionManagerOverrides>& newOverrides);
protected:
/**
* Creates a new contribution manager.
*/
ContributionManager();
/**
* This method allows subclasses of <code>ContributionManager</code> to
* prevent certain items in the contributions list.
* <code>ContributionManager</code> will either block or allow an addition
* based on the result of this method call. This can be used to prevent
* duplication, for example.
*
* @param itemToAdd
* The contribution item to be added; may be <code>null</code>.
* @return <code>true</code> if the addition should be allowed;
* <code>false</code> otherwise. The default implementation allows
* all items.
*/
virtual bool AllowItem(IContributionItem* itemToAdd);
/**
* Internal debug method for printing statistics about this manager to
* <code>cout</code>.
*/
void DumpStatistics();
/**
* Returns whether this contribution manager contains dynamic items. A
* dynamic contribution item contributes items conditionally, dependent on
* some internal state.
*
* @return <code>true</code> if this manager contains dynamic items, and
* <code>false</code> otherwise
*/
bool HasDynamicItems() const;
/**
* Returns the index of the object in the internal structure. This is
* different from <code>indexOf(String id)</code> since some contribution
* items may not have an id.
*
* @param item
* The contribution item
* @return the index, or -1 if the item is not found
*/
int IndexOf(const SmartPointer<IContributionItem>& item) const;
/**
* The given item was added to the list of contributions. Marks the manager
* as dirty and updates the number of dynamic items, and the memento.
*
* @param item
* the item to be added
*
*/
void ItemAdded(const SmartPointer<IContributionItem>& item);
/**
* The given item was removed from the list of contributions. Marks the
* manager as dirty and updates the number of dynamic items.
*
* @param item
* remove given parent from list of contributions
*/
void ItemRemoved(const SmartPointer<IContributionItem>& item);
/**
* Sets whether this manager is dirty. When dirty, the list of contributions
* is not accurately reflected in the corresponding widgets.
*
* @param dirty
* <code>true</code> if this manager is dirty, and
* <code>false</code> if it is up-to-date
*/
void SetDirty(bool dirty);
/**
* An internal method for setting the order of the contribution items.
*
* @param items
* the contribution items in the specified order
*/
void InternalSetItems(const QList<SmartPointer<IContributionItem> >& items);
private:
/**
* The list of contribution items.
*/
QList<SmartPointer<IContributionItem> > contributions;
/**
* Indicates whether the widgets are in sync with the contributions.
*/
bool isDirty;
/**
* Number of dynamic contribution items.
*/
int dynamicItems;
/**
* The overrides for items of this manager
*/
SmartPointer<IContributionManagerOverrides> overrides;
/**
* Adds a contribution item to the start or end of the group with the given
* name.
*
* @param groupName
* the name of the group
* @param item
* the contribution item
* @param append
* <code>true</code> to add to the end of the group, and
* <code>false</code> to add the beginning of the group
* @exception IllegalArgumentException
* if there is no group with the given name
*/
void AddToGroup(const QString& groupName, const SmartPointer<IContributionItem>& item,
bool append);
};
}
#endif // BERRYCONTRIBUTIONMANAGER_H
diff --git a/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionItem.h b/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionItem.h
index f7f7e02a5c..652b5f96c4 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionItem.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionItem.h
@@ -1,198 +1,198 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYICONTRIBUTIONITEM_H
#define BERRYICONTRIBUTIONITEM_H
#include <berryMacros.h>
#include <berryObject.h>
class QStatusBar;
class QMenu;
class QMenuBar;
class QToolBar;
class QAction;
namespace berry {
struct IContributionManager;
/**
* A contribution item represents a contribution to a shared UI resource such as a
* menu or tool bar. More generally, contribution items are managed by a contribution
* manager.
* For instance, in a tool bar a contribution item is a tool bar button or a separator.
* In a menu bar a contribution item is a menu, and in a menu a contribution item
* is a menu item or separator.
* <p>
* A contribution item can realize itself in different Qt widgets, using the different
* <code>fill</code> methods. The same type of contribution item can be used with a
* <code>MenuBarManager</code>, <code>ToolBarManager</code>,
* </code>or a <code>StatusLineManager</code>.
* </p>
* <p>
* This interface is internal to the framework; it should not be implemented outside
* the framework.
* </p>
*
* @see IContributionManager
* @noimplement This interface is not intended to be implemented by clients.
*/
struct IContributionItem : public virtual Object
{
- berryObjectMacro(berry::IContributionItem)
+ berryObjectMacro(berry::IContributionItem);
/**
* Fills the given status bar control with controls representing this
* contribution item. Used by <code>StatusLineManager</code>.
*
* @param parent the parent control
*/
virtual void Fill(QStatusBar* parent) = 0;
/**
* Fills the given menu bar with controls representing this contribution item.
* Used by <code>MenuBarManager</code>.
*
* @param parent the parent menu
* @param index the index where the controls are inserted,
* or <code>-1</code> to insert at the end
*/
virtual void Fill(QMenuBar* parent, QAction* before) = 0;
/**
* Fills the given menu with controls representing this contribution item.
* Used by <code>MenuManager</code>.
*
* @param parent the parent menu
* @param index the index where the controls are inserted,
* or <code>-1</code> to insert at the end
*/
virtual void Fill(QMenu* parent, QAction* before) = 0;
/**
* Fills the given tool bar with controls representing this contribution item.
* Used by <code>ToolBarManager</code>.
*
* @param parent the parent tool bar
* @param index the index where the controls are inserted,
* or <code>-1</code> to insert at the end
*/
virtual void Fill(QToolBar* parent, QAction* before) = 0;
/**
* Returns the identifier of this contribution item.
* The id is used for retrieving an item from its manager.
*
* @return the contribution item identifier, or <code>null</code>
* if none
*/
virtual QString GetId() const = 0;
/**
* Returns whether this contribution item is enabled.
*
* @return <code>true</code> if this item is enabled
*/
virtual bool IsEnabled() const = 0;
/**
* Returns whether this contribution item is dirty. A dirty item will be
* recreated when the action bar is updated.
*
* @return <code>true</code> if this item is dirty
*/
virtual bool IsDirty() const = 0;
/**
* Returns whether this contribution item is dynamic. A dynamic contribution
* item contributes items conditionally, dependent on some internal state.
*
* @return <code>true</code> if this item is dynamic, and
* <code>false</code> for normal items
*/
virtual bool IsDynamic() const = 0;
/**
* Returns whether this contribution item is a group marker.
* This information is used when adding items to a group.
*
* @return <code>true</code> if this item is a group marker, and
* <code>false</code> for normal items
*
* @see GroupMarker
* @see IContributionManager#appendToGroup(String, IContributionItem)
* @see IContributionManager#prependToGroup(String, IContributionItem)
*/
virtual bool IsGroupMarker() const = 0;
/**
* Returns whether this contribution item is a separator.
* This information is used to enable hiding of unnecessary separators.
*
* @return <code>true</code> if this item is a separator, and
* <code>false</code> for normal items
* @see Separator
*/
virtual bool IsSeparator() const = 0;
/**
* Returns whether this contribution item is visibile within its manager.
*
* @return <code>true</code> if this item is visible, and
* <code>false</code> otherwise
*/
virtual bool IsVisible() const = 0;
/**
* Saves any state information of the control(s) owned by this contribution item.
* The contribution manager calls this method before disposing of the controls.
*/
virtual void SaveWidgetState() = 0;
/**
* Sets the parent manager of this item
*
* @param parent the parent contribution manager
*/
virtual void SetParent(IContributionManager* parent) = 0;
/**
* Sets whether this contribution item is visibile within its manager.
*
* @param visible <code>true</code> if this item should be visible, and
* <code>false</code> otherwise
*/
virtual void SetVisible(bool visible) = 0;
/**
* Updates any controls cached by this contribution item with any
* changes which have been made to this contribution item since the last update.
* Called by contribution manager update methods.
*/
virtual void Update() = 0;
/**
* Updates any controls cached by this contribution item with changes
* for the the given property.
*
* @param id the id of the changed property
*/
virtual void Update(const QString& id) = 0;
};
}
#endif // BERRYICONTRIBUTIONITEM_H
diff --git a/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManager.h b/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManager.h
index fbea94006c..03ba9702a3 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManager.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManager.h
@@ -1,212 +1,212 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYICONTRIBUTIONMANAGER_H
#define BERRYICONTRIBUTIONMANAGER_H
#include <berryMacros.h>
#include <berryObject.h>
class QAction;
namespace berry {
struct IContributionItem;
struct IContributionManagerOverrides;
/**
* A contribution manager organizes contributions to such UI components
* as menus, toolbars and status lines.
* <p>
* A contribution manager keeps track of a list of contribution
* items. Each contribution item may has an optional identifier, which can be used
* to retrieve items from a manager, and for positioning items relative to
* each other. The list of contribution items can be subdivided into named groups
* using special contribution items that serve as group markers.
* </p>
* <p>
* The <code>IContributionManager</code> interface provides general
* protocol for adding, removing, and retrieving contribution items.
* It also provides convenience methods that make it convenient
* to contribute actions. This interface should be implemented
* by all objects that wish to manage contributions.
* </p>
* <p>
* There are several implementions of this interface in this package,
* including ones for menus ({@link MenuManager <code>MenuManager</code>}),
* tool bars ({@link ToolBarManager <code>ToolBarManager</code>}),
* and status lines ({@link StatusLineManager <code>StatusLineManager</code>}).
* </p>
*/
struct IContributionManager : public virtual Object
{
- berryObjectMacro(berry::IContributionManager)
+ berryObjectMacro(berry::IContributionManager);
/**
* Adds an action as a contribution item to this manager.
* Equivalent to <code>Add(IContributionItem::Pointer(new QActionContributionItem(action, id)))</code>.
*
* @param action the action, this cannot be <code>null</code>
* @param id the unique action id
*/
virtual void Add(QAction* action, const QString& id) = 0;
/**
* Adds a contribution item to this manager.
*
* @param item the contribution item, this cannot be <code>null</code>
*/
virtual void Add(const SmartPointer<IContributionItem>& item) = 0;
/**
* Adds a contribution item for the given action at the end of the group
* with the given name.
* Equivalent to
* <code>AppendToGroup(groupName,IContributionItem::Pointer(new QActionContributionItem(action, id)))</code>.
*
* @param groupName the name of the group
* @param action the action
* @param id the unique action id
* @exception ctkInvalidArgumentException if there is no group with
* the given name
*/
virtual void AppendToGroup(const QString& groupName, QAction* action, const QString& id) = 0;
/**
* Adds a contribution item to this manager at the end of the group
* with the given name.
*
* @param groupName the name of the group
* @param item the contribution item
* @exception ctkInvalidArgumentException if there is no group with
* the given name
*/
virtual void AppendToGroup(const QString& groupName, const SmartPointer<IContributionItem>& item) = 0;
/**
* Finds the contribution item with the given id.
*
* @param id the contribution item id
* @return the contribution item, or <code>null</code> if
* no item with the given id can be found
*/
virtual SmartPointer<IContributionItem> Find(const QString& id) const = 0;
/**
* Returns all contribution items known to this manager.
*
* @return a list of contribution items
*/
virtual QList<SmartPointer<IContributionItem> > GetItems() const = 0;
/**
* Returns the overrides for the items of this manager.
*
* @return the overrides for the items of this manager
*/
virtual SmartPointer<IContributionManagerOverrides> GetOverrides() = 0;
/**
* Inserts a contribution item after the item with the given id.
*
* @param id the contribution item id
* @param item the contribution item to insert
* @exception IllegalArgumentException if there is no item with
* the given id
*/
virtual void InsertAfter(const QString& id, const SmartPointer<IContributionItem>& item) = 0;
/**
* Inserts a contribution item before the item with the given id.
*
* @param id the contribution item id
* @param item the contribution item to insert
* @exception IllegalArgumentException if there is no item with
* the given id
*/
virtual void InsertBefore(const QString& id, const SmartPointer<IContributionItem>& item) = 0;
/**
* Returns whether the list of contributions has recently changed and
* has yet to be reflected in the corresponding widgets.
*
* @return <code>true</code> if this manager is dirty, and <code>false</code>
* if it is up-to-date
*/
virtual bool IsDirty() const = 0;
/**
* Returns whether this manager has any contribution items.
*
* @return <code>true</code> if there are no items, and
* <code>false</code> otherwise
*/
virtual bool IsEmpty() const = 0;
/**
* Marks this contribution manager as dirty.
*/
virtual void MarkDirty() = 0;
/**
* Adds a contribution item to this manager at the beginning of the
* group with the given name.
*
* @param groupName the name of the group
* @param item the contribution item
* @exception IllegalArgumentException if there is no group with
* the given name
*/
virtual void PrependToGroup(const QString& groupName, const SmartPointer<IContributionItem>& item) = 0;
/**
* Removes and returns the contribution item with the given id from this manager.
* Returns <code>null</code> if this manager has no contribution items
* with the given id.
*
* @param id the contribution item id
* @return the item that was found and removed, or <code>null</code> if none
*/
virtual SmartPointer<IContributionItem> Remove(const QString& id) = 0;
/**
* Removes the given contribution item from the contribution items
* known to this manager.
*
* @param item the contribution item
* @return the <code>item</code> parameter if the item was removed,
* and <code>null</code> if it was not found
*/
virtual SmartPointer<IContributionItem> Remove(const SmartPointer<IContributionItem>& item) = 0;
/**
* Removes all contribution items from this manager.
*/
virtual void RemoveAll() = 0;
/**
* Updates this manager's underlying widget(s) with any changes which
* have been made to it or its items. Normally changes to a contribution
* manager merely mark it as dirty, without updating the underlying widgets.
* This brings the underlying widgets up to date with any changes.
*
* @param force <code>true</code> means update even if not dirty,
* and <code>false</code> for normal incremental updating
*/
virtual void Update(bool force) = 0;
};
}
#endif // BERRYICONTRIBUTIONMANAGER_H
diff --git a/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManagerOverrides.h b/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManagerOverrides.h
index 5466a5197d..d0d32c8408 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManagerOverrides.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManagerOverrides.h
@@ -1,75 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYICONTRIBUTIONMANAGEROVERRIDES_H
#define BERRYICONTRIBUTIONMANAGEROVERRIDES_H
#include <berryMacros.h>
#include <berryObject.h>
#include <org_blueberry_ui_qt_Export.h>
namespace berry {
struct IContributionItem;
/**
* This interface is used by instances of <code>IContributionItem</code>
* to determine if the values for certain properties have been overriden
* by their manager.
* <p>
* This interface is internal to the framework; it should not be implemented outside
* the framework.
* </p>
*
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IContributionManagerOverrides : virtual Object
{
- berryObjectMacro(berry::IContributionManagerOverrides)
+ berryObjectMacro(berry::IContributionManagerOverrides);
/**
* Id for the enabled property. Value is <code>"enabled"</code>.
*/
static const QString P_ENABLED;
/**
* Find out the enablement of the item
* @param item the contribution item for which the enable override value is
* determined
* @param defaultValue the default value
* @return <ul>
* <li><code>1</code> if the given contribution item should be enabled</li>
* <li><code>0</code> if the item should not be enabled</li>
* <li><code>-1</code> if the item may determine its own enablement</li>
* </ul>
*/
virtual int GetEnabled(const IContributionItem* item) const = 0;
/**
* Visiblity override.
*
* @param item the contribution item in question
* @return <ul>
* <li><code>1</code> if the given contribution item should be visible</li>
* <li><code>0</code> if the item should not be visible</li>
* <li><code>-1</code> if the item may determine its own visibility</li>
* </ul>
*/
virtual int GetVisible(const IContributionItem* item) const = 0;
};
}
#endif // BERRYICONTRIBUTIONMANAGEROVERRIDES_H
diff --git a/Plugins/org.blueberry.ui.qt/src/actions/berryIMenuManager.h b/Plugins/org.blueberry.ui.qt/src/actions/berryIMenuManager.h
index daa43bf5d7..5cd2e47d04 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryIMenuManager.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryIMenuManager.h
@@ -1,126 +1,126 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIMENUMANAGER_H
#define BERRYIMENUMANAGER_H
#include <berryIContributionManager.h>
#include <berryIContributionItem.h>
namespace berry {
/**
* The <code>IMenuManager</code> interface provides protocol for managing
* contributions to a menu bar and its sub menus.
* An <code>IMenuManager</code> is also an <code>IContributionItem</code>,
* allowing sub-menus to be nested in parent menus.
* <p>
* This interface is internal to the framework; it should not be implemented outside
* the framework.
* </p>
* <p>
* This package provides a concrete menu manager implementation,
* {@link MenuManager <code>MenuManager</code>}.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
*/
struct IMenuManager : public virtual IContributionManager, public IContributionItem
{
- berryObjectMacro(berry::IMenuManager)
+ berryObjectMacro(berry::IMenuManager);
/**
* Adds a menu listener to this menu.
* Has no effect if an identical listener is already registered.
*
* @param listener a menu listener
*/
virtual void AddMenuListener(QObject* listener) = 0;
/**
* Finds the manager for the menu at the given path. A path
* consists of contribution item ids separated by the separator
* character. The path separator character is <code>'/'</code>.
* <p>
* Convenience for <code>findUsingPath(path)</code> which
* extracts an <code>IMenuManager</code> if possible.
* </p>
*
* @param path the path string
* @return the menu contribution item, or <code>null</code>
* if there is no such contribution item or if the item does
* not have an associated menu manager
*/
virtual IMenuManager::Pointer FindMenuUsingPath(const QString& path) const = 0;
/**
* Finds the contribution item at the given path. A path
* consists of contribution item ids separated by the separator
* character. The path separator character is <code>'/'</code>.
*
* @param path the path string
* @return the contribution item, or <code>null</code> if there is no
* such contribution item
*/
virtual IContributionItem::Pointer FindUsingPath(const QString& path) const = 0;
/**
* Returns whether all items should be removed when the menu is about to
* show, but before notifying menu listeners. The default is
* <code>false</code>.
*
* @return <code>true</code> if all items should be removed when shown,
* <code>false</code> if not
*/
virtual bool GetRemoveAllWhenShown() const = 0;
/**
* Returns whether this menu should be enabled or not.
*
* @return <code>true</code> if enabled, and
* <code>false</code> if disabled
*/
bool IsEnabled() const override = 0;
/**
* Removes the given menu listener from this menu.
* Has no effect if an identical listener is not registered.
*
* @param listener the menu listener
*/
virtual void RemoveMenuListener(QObject* listener) = 0;
/**
* Sets whether all items should be removed when the menu is about to show,
* but before notifying menu listeners.
*
* @param removeAll
* <code>true</code> if all items should be removed when shown,
* <code>false</code> if not
*/
virtual void SetRemoveAllWhenShown(bool removeAll) = 0;
/**
* Incrementally builds the menu from the contribution items, and
* does so recursively for all submenus.
*
* @param force <code>true</code> means update even if not dirty,
* and <code>false</code> for normal incremental updating
*/
virtual void UpdateAll(bool force) = 0;
};
}
#endif // BERRYIMENUMANAGER_H
diff --git a/Plugins/org.blueberry.ui.qt/src/actions/berryMenuManager.h b/Plugins/org.blueberry.ui.qt/src/actions/berryMenuManager.h
index 78f9c75a0f..40dd184909 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryMenuManager.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryMenuManager.h
@@ -1,403 +1,403 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYMENUMANAGER_H_
#define BERRYMENUMANAGER_H_
#include "berryIMenuManager.h"
#include "berryContributionManager.h"
#include <org_blueberry_ui_qt_Export.h>
#include <QIcon>
class QMenu;
class QMenuProxy;
class QAction;
namespace berry
{
/**
* A menu manager is a contribution manager which realizes itself and its items
* in a menu control; either as a menu bar, a sub-menu, or a context menu.
* <p>
* This class may be instantiated; it may also be subclassed.
* </p>
*/
class BERRY_UI_QT MenuManager: public QObject, public ContributionManager, public IMenuManager
{
Q_OBJECT
public:
- berryObjectMacro(MenuManager)
+ berryObjectMacro(MenuManager);
private:
/**
* The menu id.
*/
QString id;
/**
* The menu control; <code>null</code> before
* creation and after disposal.
*/
QMenuProxy* menu;
QAction* menuItem;
/**
* The menu item widget; <code>null</code> before
* creation and after disposal. This field is used
* when this menu manager is a sub-menu.
*/
//SmartPointer<IMenuItem> menuItem;
/**
* The text for a sub-menu.
*/
QString menuText;
/**
* The image for a sub-menu.
*/
QIcon image;
/**
* The overrides for items of this manager
*/
SmartPointer<IContributionManagerOverrides> overrides;
/**
* The parent contribution manager.
*/
IContributionManager* parent;
/**
* Indicates whether <code>removeAll</code> should be
* called just before the menu is displayed.
*/
bool removeAllWhenShown;
/**
* allows a submenu to display a shortcut key. This is often used with the
* QuickMenu command or action which can pop up a menu using the shortcut.
*/
QString definitionId;
private:
Q_SLOT void HandleAboutToShow();
Q_SLOT void HandleAboutToHide();
protected:
/**
* Indicates this item is visible in its manager; <code>true</code>
* by default.
*/
bool visible;
public:
Q_SIGNAL void AboutToShow(IMenuManager* mm);
Q_SIGNAL void AboutToHide(IMenuManager* mm);
/**
* Creates a menu manager with the given text and id.
* Typically no text is given when creating a context menu.
* Supply a text and id for creating a sub-menu, where it needs to be referred to by the id.
*
* @param text the text for the menu, or <code>""</code> if none
* @param id the menu id, or <code>""</code> if it is to have no id
*/
MenuManager(const QString& text = QString(), const QString& id = QString());
~MenuManager() override;
/**
* Creates a menu manager with the given text, image, and id.
* Typically used for creating a sub-menu, where it needs to be referred to by id.
*
* @param text the text for the menu, or <code>""</code> if none
* @param image the image for the menu, or <code>ImageDescriptor::Pointer(0)</code> if none
* @param id the menu id, or <code>""</code> if it is to have no id
*/
MenuManager(const QString& text, const QIcon& image,
const QString& id);
bool IsDirty() const override;
/**
* Creates and returns a Qt menu control for this menu,
* and installs all registered contributions.
* Does not create a new control if one already exists.
* <p>
* Note that the menu is not expected to be dynamic.
* </p>
*
* @param parent the parent control
* @return the menu control
*/
QMenu* CreateContextMenu(QWidget* parent);
/**
* Creates and returns a Qt menu bar control for this menu,
* for use in the given <code>QWidget</code>, and installs all registered
* contributions. Does not create a new control if one already exists.
*
* @param parent the parent decorations
* @return the menu control
* @since 2.1
*/
QMenuBar* CreateMenuBar(QWidget* parent);
void AddMenuListener(QObject* listener) override;
void RemoveMenuListener(QObject *listener) override;
/*
* @see IContributionItem#Fill(QStatusBar*)
*/
void Fill(QStatusBar* parent) override;
/*
* @see IContributionItem#Fill(QToolBar*, int)
*/
void Fill(QToolBar* parent, QAction *index) override;
/*
* @see IContributionItem#Fill(QMenu*, int)
*/
void Fill(QMenu* parent, QAction *before) override;
/*
* @see IContributionItem#Fill(QMenuBar*, int)
*/
void Fill(QMenuBar* parent, QAction *before) override;
/*
* @see IMenuManager#FindMenuUsingPath(const QString&)
*/
IMenuManager::Pointer FindMenuUsingPath(const QString& path) const override;
/*
* @see IMenuManager#FindUsingPath(const QString&)
*/
IContributionItem::Pointer FindUsingPath(const QString& path) const override;
/**
* Returns the menu id. The menu id is used when creating a contribution
* item for adding this menu as a sub menu of another.
*
* @return the menu id
*/
QString GetId() const override;
/**
* Returns the SWT menu control for this menu manager.
*
* @return the menu control
*/
QMenu* GetMenu() const;
/**
* Returns the text shown in the menu, potentially with a shortcut
* appended.
*
* @return the menu text
*/
QString GetMenuText() const;
/**
* Returns the image for this menu as an image descriptor.
*
* @return the image, or <code>null</code> if this menu has no image
*/
QIcon GetImage() const;
/*
* @see IContributionManager#GetOverrides()
*/
SmartPointer<IContributionManagerOverrides> GetOverrides() override;
/**
* Returns the parent contribution manager of this manger.
*
* @return the parent contribution manager
*/
IContributionManager* GetParent() const;
/*
* @see IMenuManager#GetRemoveAllWhenShown()
*/
bool GetRemoveAllWhenShown() const override;
/*
* @see IContributionItem#IsDynamic()
*/
bool IsDynamic() const override;
/**
* Returns whether this menu should be enabled or not.
* Used to enable the menu item containing this menu when it is realized as a sub-menu.
* <p>
* The default implementation of this framework method
* returns <code>true</code>. Subclasses may reimplement.
* </p>
*
* @return <code>true</code> if enabled, and
* <code>false</code> if disabled
*/
bool IsEnabled() const override;
/*
* @see IContributionItem#IsGroupMarker()
*/
bool IsGroupMarker() const override;
/*
* @see IContributionItem#IsSeparator()
*/
bool IsSeparator() const override;
/*
* @see IContributionItem#IsVisible()
*/
bool IsVisible() const override;
/**
* The <code>MenuManager</code> implementation of this <code>ContributionManager</code> method
* also propagates the dirty flag up the parent chain.
*/
void MarkDirty() override;
/*
* @see IMenuManager#removeMenuListener(IMenuListener)
*/
//void RemoveMenuListener(SmartPointer<IMenuListener> listener);
/*
* @IContributionItem#SaveWidgetState()
*/
void SaveWidgetState() override;
/**
* Sets the overrides for this contribution manager
*
* @param newOverrides the overrides for the items of this manager
*/
void SetOverrides(SmartPointer<IContributionManagerOverrides> newOverrides);
/*
* @see IContributionItem#SetParent(IContributionManager)
*/
void SetParent(IContributionManager* manager) override;
/*
* @see IMenuManager#SetRemoveAllWhenShown(boolean)
*/
void SetRemoveAllWhenShown(bool removeAll) override;
/*
* @see IContributionItem#SetVisible(bool)
*/
void SetVisible(bool visible) override;
/**
* Sets the command id of this action. This simply allows the menu
* item text to include a short cut if available. It can be used to
* notify a user of a key combination that will open a quick menu.
*
* @param definitionId
* the command definition id
*/
void SetCommandId(const QString& definitionId);
/*
* @see IContributionItem#Update()
*/
void Update() override;
void Update(const QString& property) override;
/**
* The <code>MenuManager</code> implementation of this <code>IContributionManager</code>
* updates this menu, but not any of its submenus.
*
* @see #updateAll
*/
void Update(bool force) override;
/*
* @see IMenuManager#UpdateAll(bool)
*/
void UpdateAll(bool force) override;
private:
/**
* Initializes the menu control.
*/
void InitializeMenu();
/**
* Dispose any images allocated for this menu
*/
// void DisposeOldImages();
/**
* Updates the menu item for this sub menu.
* The menu item is disabled if this sub menu is empty.
* Does nothing if this menu is not a submenu.
*/
void UpdateMenuItem();
void FillMenu(QWidget* parent, QAction* before);
void DumpActionInfo(QMenuProxy* menu);
void DumpActionInfo(QWidget* widget, int level);
protected:
/**
* Call an <code>IContributionItem</code>'s fill method with the
* implementation's widget. The default is to use the <code>Menu</code>
* widget.<br>
* <code>fill(Menu menu, int index)</code>
*
* @param ci
* An <code>IContributionItem</code> whose <code>fill()</code>
* method should be called.
* @param index
* The position the <code>fill()</code> method should start
* inserting at.
*/
void DoItemFill(IContributionItem::Pointer ci, QAction *before);
/**
* Incrementally builds the menu from the contribution items.
* This method leaves out double separators and separators in the first
* or last position.
*
* @param force <code>true</code> means update even if not dirty,
* and <code>false</code> for normal incremental updating
* @param recursive <code>true</code> means recursively update
* all submenus, and <code>false</code> means just this menu
*/
void Update(bool force, bool recursive);
};
}
#endif /* BERRYMENUMANAGER_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/actions/berrySubContributionItem.h b/Plugins/org.blueberry.ui.qt/src/actions/berrySubContributionItem.h
index 8c5ea57628..d3b4293b21 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berrySubContributionItem.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berrySubContributionItem.h
@@ -1,147 +1,147 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYSUBCONTRIBUTIONITEM_H_
#define BERRYSUBCONTRIBUTIONITEM_H_
#include "berryIContributionItem.h"
#include <org_blueberry_ui_qt_Export.h>
namespace berry {
/**
* A <code>SubContributionItem</code> is a wrapper for an <code>IContributionItem</code>.
* It is used within a <code>SubContributionManager</code> to control the visibility
* of items.
* <p>
* This class is not intended to be subclassed.
* </p>
* @noextend This class is not intended to be subclassed by clients.
*/
class BERRY_UI_QT SubContributionItem : public IContributionItem
{
public:
- berryObjectMacro(SubContributionItem)
+ berryObjectMacro(SubContributionItem);
private:
/**
* The visibility of the item.
*/
bool visible;
/**
* The inner item for this contribution.
*/
IContributionItem::Pointer innerItem;
public:
/**
* Creates a new <code>SubContributionItem</code>.
* @param item the contribution item to be wrapped
*/
SubContributionItem(IContributionItem::Pointer item);
using IContributionItem::Fill;
/*
* Method declared on IContributionItem.
*/
void Fill(QStatusBar* parent) override;
/*
* Method declared on IContributionItem.
*/
void Fill(QMenu* parent, QAction* before) override;
/*
* Method declared on IContributionItem.
*/
void Fill(QToolBar* parent, QAction* before) override;
/*
* Method declared on IContributionItem.
*/
QString GetId() const override;
/**
* Returns the inner contribution item.
*
* @return the inner contribution item
*/
IContributionItem::Pointer GetInnerItem() const;
/*
* Method declared on IContributionItem.
*/
bool IsEnabled() const override;
/*
* Method declared on IContributionItem.
*/
bool IsDirty() const override;
/*
* Method declared on IContributionItem.
*/
bool IsDynamic() const override;
/*
* Method declared on IContributionItem.
*/
bool IsGroupMarker() const override;
/*
* Method declared on IContributionItem.
*/
bool IsSeparator() const override;
/*
* Method declared on IContributionItem.
*/
bool IsVisible() const override;
/*
* Method declared on IContributionItem.
*/
void SetParent(IContributionManager* parent) override;
/*
* Method declared on IContributionItem.
*/
void SetVisible(bool visible) override;
/*
* Method declared on IContributionItem.
*/
void Update() override;
/*
* Method declared on IContributionItem.
*/
void Update(const QString& id) override;
/*
* @see IContributionItem#SaveWidgetState()
*/
void SaveWidgetState() override;
};
}
#endif /* BERRYSUBCONTRIBUTIONITEM_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/application/berryActionBarAdvisor.h b/Plugins/org.blueberry.ui.qt/src/application/berryActionBarAdvisor.h
index a880e4ad3b..d71f7b8f7c 100644
--- a/Plugins/org.blueberry.ui.qt/src/application/berryActionBarAdvisor.h
+++ b/Plugins/org.blueberry.ui.qt/src/application/berryActionBarAdvisor.h
@@ -1,248 +1,248 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYACTIONBARADVISOR_H_
#define BERRYACTIONBARADVISOR_H_
#include <berryObject.h>
#include <org_blueberry_ui_qt_Export.h>
class QAction;
namespace berry
{
struct IMenuManager;
struct IToolBarManager;
struct IStatusLineManager;
struct IActionBarConfigurer;
struct IMemento;
struct IWorkbenchWindow;
/**
* Public base class for configuring the action bars of a workbench window.
* <p>
* An application should declare a subclass of <code>ActionBarAdvisor</code>
* and override methods to configure a window's action bars to suit the needs of the
* particular application.
* </p>
* <p>
* The following advisor methods are called at strategic points in the
* workbench's lifecycle (all occur within the dynamic scope of the call
* to {@link PlatformUI#createAndRunWorkbench PlatformUI.createAndRunWorkbench}):
* <ul>
* <li><code>fillActionBars</code> - called after <code>WorkbenchWindowAdvisor.preWindowOpen</code>
* to configure a window's action bars</li>
* </ul>
* </p>
*
* @see WorkbenchWindowAdvisor#createActionBarAdvisor(IActionBarConfigurer)
*/
class BERRY_UI_QT ActionBarAdvisor : public Object
{
public:
- berryObjectMacro(berry::ActionBarAdvisor)
+ berryObjectMacro(berry::ActionBarAdvisor);
enum FillType {
/**
* Bit flag for {@link #fillActionBars fillActionBars} indicating that the
* operation is not filling the action bars of an actual workbench window,
* but rather a proxy (used for perspective customization).
*/
FILL_PROXY = 0x01,
/**
* Bit flag for {@link #fillActionBars fillActionBars} indicating that the
* operation is supposed to fill (or describe) the workbench window's menu
* bar.
*/
FILL_MENU_BAR = 0x02,
/**
* Bit flag for {@link #fillActionBars fillActionBars} indicating that the
* operation is supposed to fill (or describe) the workbench window's cool
* bar.
*/
FILL_TOOL_BAR = 0x04,
/**
* Bit flag for {@link #fillActionBars fillActionBars} indicating that the
* operation is supposed to fill (or describe) the workbench window's status
* line.
*/
FILL_STATUS_LINE = 0x08
};
Q_DECLARE_FLAGS(FillFlags, FillType)
public:
~ActionBarAdvisor() override;
/**
* Creates a new action bar advisor to configure a workbench
* window's action bars via the given action bar configurer.
*
* @param configurer the action bar configurer
*/
ActionBarAdvisor(const SmartPointer<IActionBarConfigurer>& configurer);
/**
* Configures the action bars using the given action bar configurer.
* Under normal circumstances, <code>flags</code> does not include
* <code>FILL_PROXY</code>, meaning this is a request to fill the action
* bars of the corresponding workbench window; the
* remaining flags indicate which combination of
* the menu bar (<code>FILL_MENU_BAR</code>),
* the tool bar (<code>FILL_TOOL_BAR</code>),
* and the status line (<code>FILL_STATUS_LINE</code>) are to be filled.
* <p>
* If <code>flags</code> does include <code>FILL_PROXY</code>, then this
* is a request to describe the actions bars of the given workbench window
* (which will already have been filled);
* again, the remaining flags indicate which combination of the menu bar,
* the tool bar, and the status line are to be described.
* The actions included in the proxy action bars can be the same instances
* as in the actual window's action bars.
* </p>
* <p>
* This method is called just after {@link WorkbenchWindowAdvisor#PreWindowOpen()}.
* Clients must not call this method directly (although super calls are okay).
* The default implementation calls <code>MakeActions</code> if
* <code>FILL_PROXY</code> is specified, then calls <code>FillMenuBar</code>,
* <code>FillToolBar</code>, and <code>FillStatusLine</code>
* if the corresponding flags are specified.
* </p>
* <p>
* Subclasses may override, but it is recommended that they override the
* methods mentioned above instead.
* </p>
*
* @param flags bit mask composed from the constants
* {@link #FILL_MENU_BAR FILL_MENU_BAR},
* {@link #FILL_TOOL_BAR FILL_TOOL_BAR},
* {@link #FILL_STATUS_LINE FILL_STATUS_LINE},
* and {@link #FILL_PROXY FILL_PROXY}
*/
virtual void FillActionBars(FillFlags flags);
/**
* Saves arbitrary application-specific state information
* for this action bar advisor.
* <p>
* The default implementation simply returns an OK status.
* Subclasses may extend or override.
* </p>
*
* @param memento the memento in which to save the advisor's state
* @return a status object indicating whether the save was successful
*/
virtual bool SaveState(SmartPointer<IMemento> memento);
/**
* Restores arbitrary application-specific state information
* for this action bar advisor.
* <p>
* The default implementation simply returns an OK status.
* Subclasses may extend or override.
* </p>
*
* @param memento the memento from which to restore the advisor's state
* @return a status object indicating whether the restore was successful
*/
public: virtual bool RestoreState(SmartPointer<IMemento> memento);
using Object::Register;
protected:
/**
* Returns the action bar configurer.
*
* @return the action bar configurer
*/
virtual SmartPointer<IActionBarConfigurer> GetActionBarConfigurer() const;
/**
* Instantiates the actions used in the fill methods.
* Use {@link #Register(QAction*)} to add it to the list of actions to
* be disposed when the window is closed.
*
* @param window the window containing the action bars
*/
virtual void MakeActions(IWorkbenchWindow* window);
/**
* Adds the given action to the list of actions to be disposed when the window is closed.
*
* @param action the action to register, this cannot be <code>null</code>
* @param id the unique action id
*/
virtual void Register(QAction* action, const QString& id);
/**
* Returns the action with the given id, or <code>null</code> if not found.
*
* @param id the action id
* @return the action with the given id, or <code>null</code> if not found
*/
virtual QAction* GetAction(const QString& id) const;
/**
* Fills the menu bar with the main menus for the window.
* <p>
* The default implementation does nothing.
* Subclasses may override.
* </p>
*
* @param menuBar the menu manager for the menu bar
*/
virtual void FillMenuBar(IMenuManager* menuBar);
/**
* Fills the tool bar with the main toolbars for the window.
* <p>
* The default implementation does nothing.
* Subclasses may override.
* </p>
*
* @param toolBar the bar manager
*/
virtual void FillToolBar(IToolBarManager* toolBar);
/**
* Fills the status line with the main status line contributions
* for the window.
* <p>
* The default implementation does nothing.
* Subclasses may override.
* </p>
*
* @param statusLine the status line manager
*/
virtual void FillStatusLine(IStatusLineManager* statusLine);
private:
SmartPointer<IActionBarConfigurer> actionBarConfigurer;
QHash<QString, QAction*> actions;
};
}
Q_DECLARE_OPERATORS_FOR_FLAGS(berry::ActionBarAdvisor::FillFlags)
#endif /*BERRYACTIONBARADVISOR_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/application/berryIActionBarConfigurer.h b/Plugins/org.blueberry.ui.qt/src/application/berryIActionBarConfigurer.h
index 24361f11a1..0a234640ce 100644
--- a/Plugins/org.blueberry.ui.qt/src/application/berryIActionBarConfigurer.h
+++ b/Plugins/org.blueberry.ui.qt/src/application/berryIActionBarConfigurer.h
@@ -1,102 +1,102 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIACTIONBARCONFIGURER_H_
#define BERRYIACTIONBARCONFIGURER_H_
#include <berryObject.h>
#include <org_blueberry_ui_qt_Export.h>
namespace berry
{
struct IWorkbenchWindowConfigurer;
struct IMenuManager;
struct IToolBarManager;
/**
* Interface providing special access for configuring the action bars
* of a workbench window.
* <p>
* Note that these objects are only available to the main application
* (the plug-in that creates and owns the workbench).
* </p>
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*
* @see org.blueberry.ui.application.WorkbenchAdvisor#fillActionBars
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IActionBarConfigurer : public Object
{
- berryObjectMacro(berry::IActionBarConfigurer)
+ berryObjectMacro(berry::IActionBarConfigurer);
~IActionBarConfigurer() override;
/**
* Returns the workbench window configurer for the window
* containing this configurer's action bars.
*
* @return the workbench window configurer
*/
virtual SmartPointer<IWorkbenchWindowConfigurer> GetWindowConfigurer() = 0;
/**
* Creates a menu manager for the main menu bar of a workbench window. The
* action bar advisor should use this factory method rather than creating a
* <code>MenuManager</code> directly.
*
* @return the menu manager
*/
virtual IMenuManager* GetMenuManager() = 0;
/**
* Creates a tool bar manager for the workbench window's tool bar. The
* action bar advisor should use this factory method rather than creating a
* <code>ToolBarManager</code> directly.
*
* @return the tool bar manager
*/
virtual IToolBarManager* GetToolBarManager() = 0;
/*
* Returns the status line manager of a workbench window.
*
* @return the status line manager
*/
//virtual IStatusLineManager GetStatusLineManager() = 0;
/*
* Register the action as a global action with a workbench
* window.
* <p>
* For a workbench retarget action
* ({@link org.blueberry.ui.actions.RetargetAction RetargetAction})
* to work, it must be registered.
* You should also register actions that will participate
* in custom key bindings.
* </p>
*
* @param action the global action
* @see org.blueberry.ui.actions.RetargetAction
*/
//virtual void RegisterGlobalAction(IAction action) = 0;
};
}
#endif /*BERRYIACTIONBARCONFIGURER_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/application/berryIWorkbenchConfigurer.h b/Plugins/org.blueberry.ui.qt/src/application/berryIWorkbenchConfigurer.h
index 8cbf29827d..6c93ca5415 100644
--- a/Plugins/org.blueberry.ui.qt/src/application/berryIWorkbenchConfigurer.h
+++ b/Plugins/org.blueberry.ui.qt/src/application/berryIWorkbenchConfigurer.h
@@ -1,257 +1,257 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIWORKBENCHCONFIGURER_H_
#define BERRYIWORKBENCHCONFIGURER_H_
#include <berryMacros.h>
#include <org_blueberry_ui_qt_Export.h>
#include "berryIWorkbench.h"
#include "berryIWorkbenchWindowConfigurer.h"
namespace berry {
/**
* Interface providing special access for configuring the workbench.
* <p>
* Note that these objects are only available to the main application
* (the plug-in that creates and owns the workbench).
* </p>
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*
* @see WorkbenchAdvisor#Initialize()
* @note This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IWorkbenchConfigurer : public Object
{
- berryObjectMacro(berry::IWorkbenchConfigurer)
+ berryObjectMacro(berry::IWorkbenchConfigurer);
~IWorkbenchConfigurer() override;
/**
* Restore status code indicating that the saved state
* could not be restored, but that startup should continue
* with a reset state.
*
* @see #RestoreState()
*/
static const int RESTORE_CODE_RESET = 1;
/**
* Restore status code indicating that the saved state
* could not be restored, and that the application
* must exit immediately without modifying any previously
* saved workbench state.
*/
static const int RESTORE_CODE_EXIT = 2;
/**
* Returns the underlying workbench.
*
* @return the workbench
*/
virtual IWorkbench* GetWorkbench() = 0;
/**
* Returns whether the workbench state should be saved on close and
* restored on subsequent open.
* <p>
* The initial value is <code>false</code>.
* </p>
*
* @return <code>true</code> to save and restore workbench state, or
* <code>false</code> to forget current workbench state on close.
*/
virtual bool GetSaveAndRestore() = 0;
/**
* Sets whether the workbench state should be saved on close and
* restored on subsequent open.
*
* @param enabled <code>true</code> to save and restore workbench state, or
* <code>false</code> to forget current workbench state on close.
*/
virtual void SetSaveAndRestore(bool enabled) = 0;
/**
* Restores a workbench window from the given memento.
*
* @param memento the memento from which to restore the window's state
* @return the configurer for the restored window
* @throws WorkbenchException if an error occurred during the restore
* @see IWorkbenchWindowConfigurer#SaveState(IMemento::Pointer)
*/
virtual IWorkbenchWindowConfigurer::Pointer RestoreWorkbenchWindow(IMemento::Pointer memento) = 0;
/*
* Declares a workbench image.
* <p>
* The workbench remembers the given image descriptor under the given name,
* and makes the image available to plug-ins via
* {@link IWorkbench#GetSharedImages() IWorkbench.getSharedImages()}.
* For "shared" images, the workbench remembers the image descriptor and
* will manages the image object create from it; clients retrieve "shared"
* images via
* {@link org.blueberry.ui.ISharedImages#getImage ISharedImages.getImage()}.
* For the other, "non-shared" images, the workbench remembers only the
* image descriptor; clients retrieve the image descriptor via
* {@link org.blueberry.ui.ISharedImages#getImageDescriptor
* ISharedImages.getImageDescriptor()} and are entirely
* responsible for managing the image objects they create from it.
* (This is made confusing by the historical fact that the API interface
* is called "ISharedImages".)
* </p>
*
* @param symbolicName the symbolic name of the image
* @param descriptor the image descriptor
* @param shared <code>true</code> if this is a shared image, and
* <code>false</code> if this is not a shared image
* @see org.blueberry.ui.ISharedImages#getImage
* @see org.blueberry.ui.ISharedImages#getImageDescriptor
*/
// virtual void declareImage(String symbolicName, ImageDescriptor descriptor,
// boolean shared);
/**
* Forces the workbench to close due to an emergency. This method should
* only be called when the workbench is in dire straights and cannot
* continue, and cannot even risk a normal workbench close (think "out of
* memory" or "unable to create shell"). When this method is called, an
* abbreviated workbench shutdown sequence is performed (less critical
* steps may be skipped). The workbench advisor is still called; however,
* it must not attempt to communicate with the user. While an emergency
* close is in progress, <code>EmergencyClosing()</code> returns
* <code>true</code>. %Workbench advisor methods should always check this
* flag before communicating with the user.
*
* @see #EmergencyClosing()
*/
virtual void EmergencyClose() = 0;
/**
* Returns whether the workbench is being closed due to an emergency.
* When this method returns <code>true</code>, the workbench is in dire
* straights and cannot continue. Indeed, things are so bad that we cannot
* even risk a normal workbench close. %Workbench advisor methods should
* always check this flag before attempting to communicate with the user.
*
* @return <code>true</code> if the workbench is in the process of being
* closed under emergency conditions, and <code>false</code> otherwise
*/
virtual bool EmergencyClosing() = 0;
/**
* Returns an object that can be used to configure the given window.
*
* @param window a workbench window
* @return a workbench window configurer
*/
virtual IWorkbenchWindowConfigurer::Pointer GetWindowConfigurer(
IWorkbenchWindow::Pointer window) = 0;
/**
* Returns the data associated with the workbench at the given key.
*
* @param key the key
* @return the data, or <code>null</code> if there is no data at the given
* key
*/
virtual Object::Pointer GetData(const QString& key) const = 0;
/**
* Sets the data associated with the workbench at the given key.
*
* @param key the key
* @param data the data, or <code>null</code> to delete existing data
*/
virtual void SetData(const QString& key, Object::Pointer data) = 0;
/**
* Restores the workbench state saved from the previous session, if any.
* This includes any open windows and their open perspectives, open views
* and editors, layout information, and any customizations to the open
* perspectives.
* <p>
* This is typically called from the advisor's <code>WorkbenchAdvisor#OpenWindows()</code>
* method.
* </p>
*
* @return a status object indicating whether the restore was successful
* @see #RESTORE_CODE_RESET
* @see #RESTORE_CODE_EXIT
* @see WorkbenchAdvisor#OpenWindows()
*/
virtual bool RestoreState() = 0;
/**
* Opens the first time window, using the default perspective and
* default page input.
* <p>
* This is typically called from the advisor's <code>WorkbenchAdvisor#OpenWindows()</code>
* method.
* </p>
*
* @see WorkbenchAdvisor#OpenWindows()
*/
virtual void OpenFirstTimeWindow() = 0;
/**
* Returns <code>true</code> if the workbench should exit when the last
* window is closed, <code>false</code> if the window should just be
* closed, leaving the workbench (and its event loop) running.
* <p>
* If <code>true</code>, the last window's state is saved before closing,
* so that it will be restored in the next session. This applies only if
* <code>#GetSaveAndRestore()</code> returns <code>true</code>).
* </p>
* <p>
* If <code>false</code>, the window is simply closed, losing its state.
* </p>
* <p>
* If the workbench is left running, it can be closed using
* <code>IWorkbench#Close()</code>, or a new window can be opened using
* <code>IWorkbench#OpenWorkbenchWindow(const QString&, IAdaptable*)</code>.
* </p>
* <p>
* The initial value is <code>true</code>.
* </p>
*
* @return <code>true</code> if the workbench will exit when the last
* window is closed, <code>false</code> if the window should just
* be closed
*/
virtual bool GetExitOnLastWindowClose() = 0;
/**
* Sets whether the workbench should exit when the last window is closed, or
* whether the window should just be closed, leaving the workbench (and its
* event loop) running.
* <p>
* For more details, see <code>#GetExitOnLastWindowClose()</code>.
* </p>
*
* @param enabled
* <code>true</code> if the workbench should exit when the last
* window is closed, <code>false</code> if the window should
* just be closed
*/
virtual void SetExitOnLastWindowClose(bool enabled) = 0;
};
}
#endif /*BERRYIWORKBENCHCONFIGURER_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/application/berryIWorkbenchWindowConfigurer.h b/Plugins/org.blueberry.ui.qt/src/application/berryIWorkbenchWindowConfigurer.h
index 0c57b330f1..6a0b8c6cc8 100644
--- a/Plugins/org.blueberry.ui.qt/src/application/berryIWorkbenchWindowConfigurer.h
+++ b/Plugins/org.blueberry.ui.qt/src/application/berryIWorkbenchWindowConfigurer.h
@@ -1,372 +1,372 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIWORKBENCHWINDOWCONFIGURER_H_
#define BERRYIWORKBENCHWINDOWCONFIGURER_H_
#include <berryObject.h>
#include <org_blueberry_ui_qt_Export.h>
class QMenuBar;
namespace berry
{
struct IActionBarConfigurer;
struct IDropTargetListener;
struct IMemento;
struct IWorkbenchConfigurer;
struct IWorkbenchWindow;
/**
* Interface providing special access for configuring workbench windows.
* <p>
* %Window configurer objects are in 1-1 correspondence with the workbench
* windows they configure. Clients may use <code>Get/SetData</code> to
* associate arbitrary state with the window configurer object.
* </p>
* <p>
* Note that these objects are only available to the main application
* (the plug-in that creates and owns the workbench).
* </p>
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*
* @see IWorkbenchConfigurer#GetWindowConfigurer()
* @see WorkbenchAdvisor#PreWindowOpen()
* @note This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IWorkbenchWindowConfigurer : public Object
{
- berryObjectMacro(berry::IWorkbenchWindowConfigurer)
+ berryObjectMacro(berry::IWorkbenchWindowConfigurer);
~IWorkbenchWindowConfigurer() override;
/**
* Returns the underlying workbench window.
*
* @return the workbench window
*/
virtual SmartPointer<IWorkbenchWindow> GetWindow() = 0;
/**
* Returns the workbench configurer.
*
* @return the workbench configurer
*/
virtual SmartPointer<IWorkbenchConfigurer> GetWorkbenchConfigurer() = 0;
/**
* Returns the action bar configurer for this workbench
* window.
*
* @return the action bar configurer
*/
virtual SmartPointer<IActionBarConfigurer> GetActionBarConfigurer() = 0;
/**
* Returns the title of the underlying workbench window.
*
* @return the window title
*/
virtual QString GetTitle() = 0;
/**
* Sets the title of the underlying workbench window.
*
* @param title the window title
*/
virtual void SetTitle(const QString& title) = 0;
/**
* Returns whether the underlying workbench window has a menu bar.
* <p>
* The initial value is <code>true</code>.
* </p>
*
* @return <code>true</code> for a menu bar, and <code>false</code>
* for no menu bar
*/
virtual bool GetShowMenuBar() const = 0;
/**
* Sets whether the underlying workbench window has a menu bar.
*
* @param show <code>true</code> for a menu bar, and <code>false</code>
* for no menu bar
*/
virtual void SetShowMenuBar(bool show) = 0;
/**
* Returns whether the underlying workbench window has a tool bar.
* <p>
* The initial value is <code>true</code>.
* </p>
*
* @return <code>true</code> for a tool bar, and <code>false</code>
* for no tool bar
*/
virtual bool GetShowToolBar() const = 0;
/**
* Sets whether the underlying workbench window has a tool bar.
*
* @param show <code>true</code> for a tool bar, and <code>false</code>
* for no tool bar
*/
virtual void SetShowToolBar(bool show) = 0;
/**
* Returns whether the underlying workbench window has a status line.
* <p>
* The initial value is <code>true</code>.
* </p>
*
* @return <code>true</code> for a status line, and <code>false</code>
* for no status line
*/
virtual bool GetShowStatusLine() const = 0;
/**
* Sets whether the underlying workbench window has a status line.
*
* @param show <code>true</code> for a status line, and <code>false</code>
* for no status line
*/
virtual void SetShowStatusLine(bool show) = 0;
/**
* Returns whether the underlying workbench window has a perspective bar (the
* perspective bar provides buttons to quickly switch between perspectives).
* <p>
* The initial value is <code>false</code>.
* </p>
*
* @return <code>true</code> for a perspective bar, and <code>false</code>
* for no perspective bar
*/
virtual bool GetShowPerspectiveBar() const = 0;
/**
* Sets whether the underlying workbench window has a perspective bar (the
* perspective bar provides buttons to quickly switch between perspectives).
*
* @param show <code>true</code> for a perspective bar, and
* <code>false</code> for no perspective bar
*/
virtual void SetShowPerspectiveBar(bool show) = 0;
/**
* Returns whether the underlying workbench window has a progress indicator.
* <p>
* The initial value is <code>false</code>.
* </p>
*
* @return <code>true</code> for a progress indicator, and <code>false</code>
* for no progress indicator
*/
virtual bool GetShowProgressIndicator() const = 0;
/**
* Sets whether the underlying workbench window has a progress indicator.
*
* @param show <code>true</code> for a progress indicator, and <code>false</code>
* for no progress indicator
*/
virtual void SetShowProgressIndicator(bool show) = 0;
/**
* Returns the style bits to use for the window's main widget when it is created.
* The default is <code>0</code>.
*
* @return the style bits
*/
virtual Qt::WindowFlags GetWindowFlags() const = 0;
/**
* Sets the style bits to use for the window's main widget when it is created.
* This method has no effect after the widget is created.
* That is, it must be called within the <code>WorkbenchAdvisor#PreWindowOpen()</code>
* callback.
* <p>
* For more details on the applicable style bits, see the
* documentation for Qt::WindowFlags.
* </p>
*
* @param windowFlags the style bits
*/
virtual void SetWindowFlags(Qt::WindowFlags windowFlags) = 0;
/**
* Returns the size to use for the window's shell when it is created.
*
* @return the initial size to use for the shell
*/
virtual QPoint GetInitialSize() const = 0;
/**
* Sets the size to use for the window's shell when it is created.
* This method has no effect after the shell is created.
* That is, it must be called within the <code>WorkbenchAdvisor#PreWindowOpen()</code>
* callback.
*
* @param initialSize the initial size to use for the shell
*/
virtual void SetInitialSize(QPoint initialSize) = 0;
/*
* Returns the data associated with this workbench window at the given key.
*
* @param key the key
* @return the data, or <code>null</code> if there is no data at the given
* key
*/
//virtual Object getData(String key);
/*
* Sets the data associated with this workbench window at the given key.
*
* @param key the key
* @param data the data, or <code>null</code> to delete existing data
*/
//virtual void setData(String key, Object data);
/**
* Adds the given drag and drop Mime types to the ones
* supported for drag and drop on the editor area of this workbench window.
* <p>
* The workbench advisor would ordinarily call this method from the
* <code>PreWindowOpen</code> callback.
* A newly-created workbench window supports no drag and drop transfer
* types.
* </p>
* <p>
* Note that drag and drop to the editor area requires adding one or more
* transfer types (using <code>AddEditorAreaTransfer</code>) and
* configuring a drop target listener
* (with <code>ConfigureEditorAreaDropListener</code>)
* capable of handling any of those transfer types.
* </p>
*
* @param transfer a drag and drop transfer object
* @see #configureEditorAreaDropListener
* @see org.blueberry.ui.part.EditorInputTransfer
*/
virtual void AddEditorAreaTransfer(const QStringList& transferTypes) = 0;
/**
* Configures the drop target listener for the editor area of this workbench window.
* <p>
* The workbench advisor ordinarily calls this method from the
* <code>PreWindowOpen</code> callback.
* A newly-created workbench window has no configured drop target listener for its
* editor area.
* </p>
* <p>
* Note that drag and drop to the editor area requires adding one or more
* transfer types (using <code>AddEditorAreaTransfer</code>) and
* configuring a drop target listener
* (with <code>ConfigureEditorAreaDropListener</code>)
* capable of handling any of those transfer types.
* </p>
*
* @param dropTargetListener the drop target listener that will handle
* requests to drop an object on to the editor area of this window
*
* @see #AddEditorAreaTransfer
*/
virtual void ConfigureEditorAreaDropListener(IDropTargetListener* dropTargetListener) = 0;
/**
* Creates the menu bar for the window's shell.
* <p>
* This should only be called if the advisor is defining custom window contents
* in <code>CreateWindowContents</code>, and may only be called once.
* The caller must set it in the shell using <code>Shell.setMenuBar(Menu)</code>
* but must not make add, remove or change items in the result.
* The menu bar is populated by the window's menu manager.
* The application can add to the menu manager in the advisor's
* <code>FillActionBars</code> method instead.
* </p>
*
* @return the menu bar, suitable for setting in the shell
*/
virtual QMenuBar* CreateMenuBar() = 0;
/**
* Creates the tool bar control.
* <p>
* This should only be called if the advisor is defining custom window contents
* in <code>CreateWindowContents</code>, and may only be called once.
* The caller must lay out the tool bar appropriately within the parent,
* but must not add, remove or change items in the result (hence the
* return type of <code>QWidget</code>).
* The tool bar is populated by the window's tool bar manager.
* The application can add to the tool bar manager in the advisor's
* <code>FillActionBars</code> method instead.
* </p>
*
* @param parent the parent widget
* @return the tool bar control, suitable for laying out in the parent
*/
virtual QWidget* CreateToolBar(QWidget* parent) = 0;
/*
* Creates the status line control.
* <p>
* This should only be called if the advisor is defining custom window contents
* in <code>createWindowContents</code>, and may only be called once.
* The caller must lay out the status line appropriately within the parent,
* but must not add, remove or change items in the result (hence the
* return type of <code>Control</code>).
* The status line is populated by the window's status line manager.
* The application can add to the status line manager in the advisor's
* <code>fillActionBars</code> method instead.
* </p>
*
* @param parent the parent composite
* @return the status line control, suitable for laying out in the parent
*/
//virtual Control createStatusLineControl(Composite parent);
/**
* Creates the page composite, in which the window's pages, and their
* views and editors, appear.
* <p>
* This should only be called if the advisor is defining custom window contents
* in <code>WorkbenchWindowAdvisor#CreateWindowContents()</code>, and may only be called once.
* The caller must lay out the page composite appropriately within the parent,
* but must not add, remove or change items in the result.
* The page composite is populated by the workbench.
* </p>
*
* @param parent the parent composite
* @return the page composite, suitable for laying out in the parent
*/
virtual QWidget* CreatePageComposite(QWidget* parent) = 0;
/**
* Saves the current state of the window using the specified memento.
*
* @param memento the memento in which to save the window's state
* @return a status object indicating whether the save was successful
* @see IWorkbenchConfigurer#RestoreWorkbenchWindow(IMemento::Pointer)
*/
virtual bool SaveState(SmartPointer<IMemento> memento) = 0;
};
}
#endif /*BERRYIWORKBENCHWINDOWCONFIGURER_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryAbstractSourceProvider.h b/Plugins/org.blueberry.ui.qt/src/berryAbstractSourceProvider.h
index f9fc232575..c3069b9e9d 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryAbstractSourceProvider.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryAbstractSourceProvider.h
@@ -1,110 +1,110 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYABSTRACTSOURCEPROVIDER_H_
#define BERRYABSTRACTSOURCEPROVIDER_H_
#include "berryISourceProvider.h"
#include <berryISourceProviderListener.h>
namespace berry {
struct IServiceLocator;
/**
* <p>
* An implementation of <code>ISourceProvider</code> that provides listener
* support. Subclasses need only call <code>fireSourceChanged</code> whenever
* appropriate.
* </p>
*/
class AbstractSourceProvider : public ISourceProvider {
protected:
/**
* Notifies all listeners that a single source has changed.
*
* @param sourcePriority
* The source priority that has changed.
* @param sourceName
* The name of the source that has changed; must not be
* <code>null</code>.
* @param sourceValue
* The new value for the source; may be <code>null</code>.
*/
void FireSourceChanged(int sourcePriority,
const QString& sourceName, Object::ConstPointer sourceValue);
/**
* Notifies all listeners that multiple sources have changed.
*
* @param sourcePriority
* The source priority that has changed.
* @param sourceValuesByName
* The map of source names (<code>String</code>) to source
* values (<code>Object</code>) that have changed; must not
* be <code>null</code>. The names must not be
* <code>null</code>, but the values may be <code>null</code>.
*/
void FireSourceChanged(int sourcePriority,
const QHash<QString, Object::ConstPointer>& sourceValuesByName);
/**
* Logs a debugging message in an appropriate manner. If the message is
* <code>null</code> or the <code>DEBUG</code> is <code>false</code>,
* then this method does nothing.
*
* @param message
* The debugging message to log; if <code>null</code>, then
* nothing is logged.
*/
void LogDebuggingInfo(const QString& message);
private:
ISourceProviderListener::Events sourceEvents;
public:
/**
* Whether source providers should print out debugging information to the
* console when events arrive.
*/
static bool DEBUG; // = Policy.DEBUG_SOURCES;
- berryObjectMacro(berry::AbstractSourceProvider)
+ berryObjectMacro(berry::AbstractSourceProvider);
void AddSourceProviderListener(ISourceProviderListener* listener) override;
void RemoveSourceProviderListener(ISourceProviderListener *listener) override;
/**
* This method is called when the source provider is instantiated by
* <code>org.blueberry.ui.services</code>. Clients may override this method
* to perform initialization.
*
* @param locator
* The global service locator. It can be used to retrieve
* services like the IContextService
*/
virtual void Initialize(IServiceLocator* locator);
};
}
#endif /* BERRYABSTRACTSOURCEPROVIDER_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/berryEditorPart.h b/Plugins/org.blueberry.ui.qt/src/berryEditorPart.h
index 282b03c264..b2a72fb275 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryEditorPart.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryEditorPart.h
@@ -1,246 +1,246 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYEDITORPART_H_
#define BERRYEDITORPART_H_
#include <org_blueberry_ui_qt_Export.h>
#include "berryIEditorPart.h"
#include "berryIEditorInput.h"
#include "berryIEditorSite.h"
#include "berryWorkbenchPart.h"
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* Abstract base implementation of all workbench editors.
* <p>
* This class should be subclassed by clients wishing to define new editors.
* The name of the subclass should be given as the <code>"class"</code>
* attribute in a <code>editor</code> extension contributed to the workbench's
* editor extension point (named <code>"org.mitk.ui.editors"</code>).
* For example, the plug-in's XML markup might contain:
* <pre>
* &LT;extension point="org.blueberry.ui.editors"&GT;
* &LT;editor id="com.example.myplugin.ed"
* name="My Editor"
* icon="./images/cedit.gif"
* extensions="foo"
* class="com.example.myplugin.MyFooEditor"
* contributorClass="com.example.myplugin.MyFooEditorContributor"
* /&GT;
* &LT;/extension&GT;
* </pre>
* where <code>com.example.myplugin.MyEditor</code> is the name of the
* <code>EditorPart</code> subclass.
* </p>
* <p>
* Subclasses must implement the following methods:
* <ul>
* <li><code>IEditorPart.init</code> - to initialize editor when assigned its site</li>
* <li><code>IWorkbenchPart.createPartControl</code> - to create the editor's controls </li>
* <li><code>IWorkbenchPart.setFocus</code> - to accept focus</li>
* <li><code>IEditorPart.isDirty</code> - to decide whether a significant change has
* occurred</li>
* <li><code>IEditorPart.doSave</code> - to save contents of editor</li>
* <li><code>IEditorPart.doSaveAs</code> - to save contents of editor</li>
* <li><code>IEditorPart.isSaveAsAllowed</code> - to control Save As</li>
* </ul>
* </p>
* <p>
* Subclasses may extend or reimplement the following methods as required:
* <ul>
* <li><code>IExecutableExtension.setInitializationData</code> - extend to provide additional
* initialization when editor extension is instantiated</li>
* <li><code>IWorkbenchPart.dispose</code> - extend to provide additional cleanup</li>
* <li><code>IAdaptable.getAdapter</code> - reimplement to make the editor
* adaptable</li>
* </ul>
* </p>
*/
class BERRY_UI_QT EditorPart : public WorkbenchPart , public virtual IEditorPart {
Q_OBJECT
Q_INTERFACES(berry::IEditorPart)
public:
- berryObjectMacro(EditorPart, WorkbenchPart, IEditorPart)
+ berryObjectMacro(EditorPart, WorkbenchPart, IEditorPart);
private:
/**
* Editor input, or <code>null</code> if none.
*/
IEditorInput::Pointer editorInput;
protected:
/**
* Creates a new workbench editor.
*/
EditorPart();
/**
* Sets the input to this editor. This method simply updates the internal
* member variable.
*
* <p>Unlike most of the other set methods on this class, this method does
* not fire a property change. Clients that call this method from a subclass
* must ensure that they fire an IWorkbenchPartConstants.PROP_INPUT property
* change after calling this method but before leaving whatever public method
* they are in. Clients that expose this method as public API must fire
* the property change within their implementation of setInput.</p>
*
* <p>Note that firing a property change may cause listeners to immediately
* reach back and call methods on this editor. Care should be taken not to
* fire the property change until the editor has fully updated its internal
* state to reflect the new input.</p>
*
* @param input the editor input
*
* @see #setInputWithNotify(IEditorInput)
*/
virtual void SetInput(IEditorInput::Pointer input) ;
/**
* Sets the input to this editor and fires a PROP_INPUT property change if
* the input has changed. This is the convenience method implementation.
*
* <p>Note that firing a property change may cause other objects to reach back
* and invoke methods on the editor. Care should be taken not to call this method
* until the editor has fully updated its internal state to reflect the
* new input.</p>
*
* @since 3.2
*
* @param input the editor input
*/
virtual void SetInputWithNotify(IEditorInput::Pointer input);
/* (non-Javadoc)
* @see org.blueberry.ui.part.WorkbenchPart#setContentDescription(java.lang.String)
*/
void SetContentDescription(const QString& description) override;
/* (non-Javadoc)
* @see org.blueberry.ui.part.WorkbenchPart#setPartName(java.lang.String)
*/
void SetPartName(const QString& partName) override;
/**
* Checks that the given site is valid for this type of part.
* The site for an editor must be an <code>IEditorSite</code>.
*
* @param site the site to check
* @since 3.1
*/
void CheckSite(IWorkbenchPartSite::Pointer site) override;
public:
/* (non-Javadoc)
* Saves the contents of this editor.
* <p>
* Subclasses must override this method to implement the open-save-close lifecycle
* for an editor. For greater details, see <code>IEditorPart</code>
* </p>
*
* @see IEditorPart
*/
void DoSave(/*IProgressMonitor monitor*/) override = 0;
/* (non-Javadoc)
* Saves the contents of this editor to another object.
* <p>
* Subclasses must override this method to implement the open-save-close lifecycle
* for an editor. For greater details, see <code>IEditorPart</code>
* </p>
*
* @see IEditorPart
*/
void DoSaveAs() override = 0;
/* (non-Javadoc)
* Method declared on IEditorPart.
*/
IEditorInput::Pointer GetEditorInput() const override;
/* (non-Javadoc)
* Method declared on IEditorPart.
*/
IEditorSite::Pointer GetEditorSite() const override;
/* (non-Javadoc)
* Gets the title tool tip text of this part.
*
* @return the tool tip text
*/
QString GetTitleToolTip() const override;
/* (non-Javadoc)
* Initializes the editor part with a site and input.
* <p>
* Subclasses of <code>EditorPart</code> must implement this method. Within
* the implementation subclasses should verify that the input type is acceptable
* and then save the site and input. Here is sample code:
* </p>
* <pre>
* if (!(input instanceof IFileEditorInput))
* throw new PartInitException("Invalid Input: Must be IFileEditorInput");
* setSite(site);
* setInput(input);
* </pre>
*/
void Init(IEditorSite::Pointer site, IEditorInput::Pointer input) override = 0;
/* (non-Javadoc)
* Returns whether the contents of this editor have changed since the last save
* operation.
* <p>
* Subclasses must override this method to implement the open-save-close lifecycle
* for an editor. For greater details, see <code>IEditorPart</code>
* </p>
*
* @see IEditorPart
*/
bool IsDirty() const override = 0;
/* (non-Javadoc)
* Returns whether the "save as" operation is supported by this editor.
* <p>
* Subclasses must override this method to implement the open-save-close lifecycle
* for an editor. For greater details, see <code>IEditorPart</code>
* </p>
*
* @see IEditorPart
*/
bool IsSaveAsAllowed() const override = 0;
/* (non-Javadoc)
* Returns whether the contents of this editor should be saved when the editor
* is closed.
* <p>
* This method returns <code>true</code> if and only if the editor is dirty
* (<code>isDirty</code>).
* </p>
*/
bool IsSaveOnCloseNeeded() const override;
};
}
#endif /*BERRYEDITORPART_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIActionBars.h b/Plugins/org.blueberry.ui.qt/src/berryIActionBars.h
index e359ad9f30..0e1dc6c8e4 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIActionBars.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIActionBars.h
@@ -1,108 +1,108 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIACTIONBARS_H
#define BERRYIACTIONBARS_H
#include <berryObject.h>
namespace berry {
struct IServiceLocator;
struct IMenuManager;
struct IStatusLineManager;
struct IToolBarManager;
class Action;
/**
* Used by a part to access its menu, toolbar, and status line managers.
* <p>
* Within the workbench each part, editor or view, has a private set of action
* bars. This set, which contains a menu, toolbar, and status line, appears
* in the local toolbar for a view and in the window for an editor. The view
* may provide an implementation for pre-existing actions or add new actions to
* the action bars.
* </p><p>
* A part may also contribute new actions to the action bars as required. To do
* this, call <code>GetMenuManager</code>, <code>GetToolBarManager</code>, or
* <code>GetStatusLineManager</code> as appropriate to get the action target.
* Add the action(s) to the target and call <code>update</code> to commit
* any changes to the underlying widgets.
* </p><p>
* This interface is not intended to be implemented by clients.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
*/
struct IActionBars : public Object
{
- berryObjectMacro(berry::IActionBars)
+ berryObjectMacro(berry::IActionBars);
/**
* Returns the menu manager.
* <p>
* Note: Clients who add or remove items from the returned menu manager are
* responsible for calling <code>updateActionBars</code> so that the changes
* can be propagated throughout the workbench.
* </p>
*
* @return the menu manager
*/
virtual IMenuManager* GetMenuManager() = 0;
/**
* Returns the service locator for these action bars. The locator is found
* by looking locally, and then ascending the action bar hierarchy.
*
* @return The service locator; never <code>null</code>.
*/
virtual IServiceLocator* GetServiceLocator() = 0;
/**
* Returns the status line manager.
* <p>
* Note: Clients who add or remove items from the returned status line
* manager are responsible for calling <code>updateActionBars</code> so
* that the changes can be propagated throughout the workbench.
* </p>
*
* @return the status line manager
*/
virtual IStatusLineManager* GetStatusLineManager() = 0;
/**
* Returns the tool bar manager.
* <p>
* Note: Clients who add or remove items from the returned tool bar manager are
* responsible for calling <code>updateActionBars</code> so that the changes
* can be propagated throughout the workbench.
* </p>
*
* @return the tool bar manager
*/
virtual IToolBarManager* GetToolBarManager() = 0;
/**
* Updates the action bars.
* <p>
* Clients who add or remove items from the menu, tool bar, or status line
* managers, or that update global action handlers, should call this method
* to propagated the changes throughout the workbench.
* </p>
*/
virtual void UpdateActionBars() = 0;
};
}
#endif // BERRYIACTIONBARS_H
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIContributionRoot.h b/Plugins/org.blueberry.ui.qt/src/berryIContributionRoot.h
index 917c335258..c0834293a7 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIContributionRoot.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIContributionRoot.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYICONTRIBUTIONROOT_H
#define BERRYICONTRIBUTIONROOT_H
#include <berryObject.h>
namespace berry {
struct IContributionItem;
class Expression;
/**
* Instances of this interface represent a position in the contribution
* hierarchy into which {@link AbstractContributionFactory} instances may insert
* elements. Instances of this interface are provided by the platform and this
* interface should <b>NOT</b> be implemented by clients.
*/
struct IContributionRoot : public Object
{
- berryObjectMacro(berry::IContributionRoot)
+ berryObjectMacro(berry::IContributionRoot);
/**
* Adds a given contribution item with provided visibility expression and
* kill-switch filtering as a direct child of this container. This should be
* called for all top-level elements created in
* {@link AbstractContributionFactory#createContributionItems(org.eclipse.ui.services.IServiceLocator, IContributionRoot)}
*
* @param item
* the item to add
* @param visibleWhen
* the visibility expression. May be <code>null</code>.
*/
virtual void AddContributionItem(const SmartPointer<IContributionItem>& item,
const SmartPointer<Expression>& visibleWhen) = 0;
/**
* Registers visibilty for arbitrary {@link IContributionItem} instances
* that are <b>NOT</b> direct children of this container. Ie: children of a
* {@link IContributionManager} that has been previously registered with a
* call to {{@link #AddContributionItem(IContributionItem, Expression)}.
*
* @param item
* the item for which to register a visibility clause
* @param visibleWhen
* the visibility expression. May be <code>null</code> in which
* case this method is a no-op.
*/
virtual void RegisterVisibilityForChild(const SmartPointer<IContributionItem>& item,
const SmartPointer<Expression>& visibleWhen) = 0;
};
}
#endif // BERRYICONTRIBUTIONROOT_H
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIEditorDescriptor.h b/Plugins/org.blueberry.ui.qt/src/berryIEditorDescriptor.h
index f67e7ea0e3..30636db656 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIEditorDescriptor.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIEditorDescriptor.h
@@ -1,119 +1,119 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEDITORDESCRIPTOR_H_
#define BERRYIEDITORDESCRIPTOR_H_
#include <org_blueberry_ui_qt_Export.h>
#include "berryIWorkbenchPartDescriptor.h"
#include "berryIEditorMatchingStrategy.h"
namespace berry
{
/**
* \ingroup org_blueberry_ui_qt
*
* Description of an editor in the workbench editor registry. The
* editor descriptor contains the information needed to create editor instances.
* <p>
* An editor descriptor typically represents one of three types of editors:
* <ul>
* <li>a file editor extension for a specific file extension.</li>
* <li>a file editor added by the user (via the workbench preference page)</li>
* <li>a general editor extension which works on objects other than files.</li>
* </ul>
* </p>
* <p>
* This interface is not intended to be implemented or extended by clients.
* </p>
*
* @see IEditorRegistry
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IEditorDescriptor : public IWorkbenchPartDescriptor
{
- berryObjectMacro(berry::IEditorDescriptor)
+ berryObjectMacro(berry::IEditorDescriptor);
~IEditorDescriptor() override;
/**
* Returns the editor id.
* <p>
* For internal editors, this is the extension id as defined in the workbench
* registry; for external editors, it is path and file name of the external
* program.
* </p>
*
* @return the id of the editor
*/
QString GetId() const override = 0;
/**
* Returns the descriptor of the image for this editor.
*
* @return the descriptor of the image to display next to this editor
*/
//ImageDescriptor getImageDescriptor() = 0;
/**
* Returns the label to show for this editor.
*
* @return the editor label
*/
QString GetLabel() const override = 0;
/**
* Returns whether this editor descriptor will open a regular editor
* part inside the editor area.
*
* @return <code>true</code> if editor is inside editor area, and
* <code>false</code> otherwise
* @since 3.0
*/
virtual bool IsInternal() const = 0;
/**
* Returns whether this editor descriptor will open an external
* editor in-place inside the editor area.
*
* @return <code>true</code> if editor is in-place, and <code>false</code>
* otherwise
* @since 3.0
*/
virtual bool IsOpenInPlace() const = 0;
/**
* Returns whether this editor descriptor will open an external editor
* in a new window outside the workbench.
*
* @return <code>true</code> if editor is external, and <code>false</code>
* otherwise
* @since 3.0
*/
virtual bool IsOpenExternal() const = 0;
/**
* Returns the editor matching strategy object for editors
* represented by this editor descriptor, or <code>null</code>
* if there is no explicit matching strategy specified.
*
* @return the editor matching strategy, or <code>null</code> if none
* @since 3.1
*/
virtual IEditorMatchingStrategy::Pointer GetEditorMatchingStrategy() = 0;
};
}
#endif /*BERRYIEDITORDESCRIPTOR_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIEditorInput.h b/Plugins/org.blueberry.ui.qt/src/berryIEditorInput.h
index 605dd4e82a..0b8009e5c8 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIEditorInput.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIEditorInput.h
@@ -1,132 +1,132 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEDITORINPUT_H_
#define BERRYIEDITORINPUT_H_
#include <berryMacros.h>
#include <berryObject.h>
#include <berryIAdaptable.h>
#include <org_blueberry_ui_qt_Export.h>
namespace berry
{
struct IPersistableElement;
/**
* \ingroup org_blueberry_ui_qt
*
* <code>IEditorInput</code> is a light weight descriptor of editor input,
* like a file name but more abstract. It is not a model. It is a description of
* the model source for an <code>IEditorPart</code>.
* <p>
* Clients implementing this editor input interface must override
* <code>Object#operator==(const Object*)</code> to answer true
* for two inputs that are
* the same. The <code>IWorbenchPage.openEditor</code> APIs are dependent on
* this to find an editor with the same input.
* </p>
* <p>
* Clients should extend this interface to declare new types of editor inputs.
* </p>
* <p>
* An editor input is passed to an editor via the <code>IEditorPart.init</code>
* method. Due to the wide range of valid editor inputs, it is not possible to
* define generic methods for getting and setting bytes.
* </p>
* <p>
* Editor input must implement the <code>IAdaptable</code> interface;
* extensions are managed by the platform's adapter manager.
* </p>
* <p>
* Please note that it is important that the editor input be light weight.
* Within the workbench, the navigation history tends to hold on to editor
* inputs as a means of reconstructing the editor at a later time. The
* navigation history can hold on to quite a few inputs (i.e., the default is
* fifty). The actual data model should probably not be held in the input.
* </p>
*
*
* @see org.blueberry.ui.IEditorPart
* @see org.blueberry.ui.IWorkbenchPage#openEditor(IEditorInput, String)
* @see org.blueberry.ui.IWorkbenchPage#openEditor(IEditorInput, String, boolean)
*/
struct BERRY_UI_QT IEditorInput : public virtual Object, public virtual IAdaptable
{
- berryObjectMacro(berry::IEditorInput)
+ berryObjectMacro(berry::IEditorInput);
~IEditorInput() override;
/**
* Returns whether the editor input exists.
* <p>
* This method is primarily used to determine if an editor input should
* appear in the "File Most Recently Used" menu. An editor input will appear
* in the list until the return value of <code>exists</code> becomes
* <code>false</code> or it drops off the bottom of the list.
*
* @return <code>true</code> if the editor input exists;
* <code>false</code> otherwise
*/
virtual bool Exists() const = 0;
/**
* Returns the icon for this input.
*
* @return the icon for this input; may be null icon if
* there is no image.
*/
virtual QIcon GetIcon() const = 0;
/**
* Returns the name of this editor input for display purposes.
* <p>
* For instance, when the input is from a file, the return value would
* ordinarily be just the file name.
*
* @return the name string; never <code>null</code>;
*/
virtual QString GetName() const = 0;
/**
* Returns an object that can be used to save the state of this editor
* input.
*
* @return the persistable element, or <code>null</code> if this editor
* input cannot be persisted
*/
virtual const IPersistableElement* GetPersistable() const = 0;
/**
* Returns the tool tip text for this editor input. This text is used to
* differentiate between two input with the same name. For instance,
* MyClass.java in folder X and MyClass.java in folder Y. The format of the
* text varies between input types.
* </p>
*
* @return the tool tip text; never <code>null</code>.
*/
virtual QString GetToolTipText() const = 0;
/**
* Returns true if two editor inputs are the same
*
*/
bool operator==(const Object* o) const override = 0;
};
}
#endif /*BERRYIEDITORINPUT_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIEditorMatchingStrategy.h b/Plugins/org.blueberry.ui.qt/src/berryIEditorMatchingStrategy.h
index c65b89b699..3e763cf436 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIEditorMatchingStrategy.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIEditorMatchingStrategy.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEDITORMATCHINGSTRATEGY_H_
#define BERRYIEDITORMATCHINGSTRATEGY_H_
#include <berryMacros.h>
#include "berryIEditorReference.h"
#include "berryIEditorInput.h"
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* An editor matching strategy allows editor extensions to provide their own
* algorithm for matching the input of an open editor of that type to a
* given editor input. This is used to find a matching editor during
* {@link org.blueberry.ui.IWorkbenchPage#openEditor(IEditorInput, String, boolean)} and
* {@link org.blueberry.ui.IWorkbenchPage#findEditor(IEditorInput)}.
*/
struct BERRY_UI_QT IEditorMatchingStrategy : public Object
{
- berryObjectMacro(berry::IEditorMatchingStrategy)
+ berryObjectMacro(berry::IEditorMatchingStrategy);
~IEditorMatchingStrategy() override;
/**
* Returns whether the editor represented by the given editor reference
* matches the given editor input.
* <p>
* Implementations should inspect the given editor input first,
* and try to reject it early before calling <code>IEditorReference.getEditorInput()</code>,
* since that method may be expensive.
* </p>
*
* @param editorRef the editor reference to match against
* @param input the editor input to match
* @return <code>true</code> if the editor matches the given editor input,
* <code>false</code> if it does not match
*/
virtual bool Matches(IEditorReference::Pointer editorRef, IEditorInput::Pointer input) = 0;
};
}
Q_DECLARE_INTERFACE(berry::IEditorMatchingStrategy, "org.blueberry.ui.IEditorMatchingStrategy")
#endif /*BERRYIEDITORMATCHINGSTRATEGY_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIEditorPart.h b/Plugins/org.blueberry.ui.qt/src/berryIEditorPart.h
index 27646bf560..1a99febfc8 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIEditorPart.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIEditorPart.h
@@ -1,127 +1,127 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEDITORPART_H_
#define BERRYIEDITORPART_H_
#include "berryIWorkbenchPart.h"
#include "berryISaveablePart.h"
#include <QObject>
namespace berry
{
struct IEditorInput;
struct IEditorSite;
/**
* \ingroup org_blueberry_ui_qt
*
* An editor is a visual component within a workbench page. It is
* typically used to edit or browse a document or input object. The input
* is identified using an <code>IEditorInput</code>. Modifications made
* in an editor part follow an open-save-close lifecycle model (in contrast
* to a view part, where modifications are saved to the workbench
* immediately).
* <p>
* An editor is document or input-centric. Each editor has an input, and only
* one editor can exist for each editor input within a page. This policy has
* been designed to simplify part management.
* </p><p>
* An editor should be used in place of a view whenever more than one instance
* of a document type can exist.
* </p><p>
* This interface may be implemented directly. For convenience, a base
* implementation is defined in <code>EditorPart</code>.
* </p>
* <p>
* An editor part is added to the workbench in two stages:
* <ol>
* <li>An editor extension is contributed to the workbench registry. This
* extension defines the extension id, extension class, and the file
* extensions which are supported by the editor.</li>
* <li>An editor part based upon the extension is created and added to the
* workbench when the user opens a file with one of the supported file
* extensions (or some other suitable form of editor input).</li>
* </ol>
* </p>
* <p>
* All editor parts implement the <code>IAdaptable</code> interface; extensions
* are managed by the platform's adapter manager.
* </p>
*
* @see org.blueberry.ui.IWorkbenchPage#openEditor(IEditorInput, String)
* @see org.blueberry.ui.part.EditorPart
*/
struct BERRY_UI_QT IEditorPart : public virtual IWorkbenchPart,
public ISaveablePart
{
- berryObjectMacro(berry::IEditorPart, IWorkbenchPart, ISaveablePart)
+ berryObjectMacro(berry::IEditorPart, IWorkbenchPart, ISaveablePart);
~IEditorPart() override;
/**
* The property id for <code>getEditorInput</code>.
*/
//static const int PROP_INPUT = IWorkbenchPartConstants.PROP_INPUT;
/**
* Returns the input for this editor. If this value changes the part must
* fire a property listener event with <code>PROP_INPUT</code>.
*
* @return the editor input
*/
virtual SmartPointer<IEditorInput> GetEditorInput() const = 0;
/**
* Returns the site for this editor.
* This method is equivalent to <code>(IEditorSite) getSite()</code>.
* <p>
* The site can be <code>null</code> while the editor is being initialized.
* After the initialization is complete, this value must be non-<code>null</code>
* for the remainder of the editor's life cycle.
* </p>
*
* @return the editor site; this value may be <code>null</code> if the editor
* has not yet been initialized
*/
virtual SmartPointer<IEditorSite> GetEditorSite() const = 0;
/**
* Initializes this editor with the given editor site and input.
* <p>
* This method is automatically called shortly after the part is instantiated.
* It marks the start of the part's lifecycle. The
* {@link IWorkbenchPart#dispose IWorkbenchPart.dispose} method will be called
* automically at the end of the lifecycle. Clients must not call this method.
* </p><p>
* Implementors of this method must examine the editor input object type to
* determine if it is understood. If not, the implementor must throw
* a <code>PartInitException</code>
* </p>
* @param site the editor site
* @param input the editor input
* @exception PartInitException if this editor was not initialized successfully
*/
virtual void Init(SmartPointer<IEditorSite> site,
SmartPointer<IEditorInput> input) = 0;
};
}
Q_DECLARE_INTERFACE(berry::IEditorPart, "org.blueberry.ui.IEditorPart")
#endif /*BERRYIEDITORPART_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIEditorReference.h b/Plugins/org.blueberry.ui.qt/src/berryIEditorReference.h
index 4b9481f7de..aa6908b2c8 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIEditorReference.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIEditorReference.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEDITORREFERENCE_H_
#define BERRYIEDITORREFERENCE_H_
#include "berryIWorkbenchPartReference.h"
#include "berryIEditorPart.h"
#include "berryIEditorInput.h"
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* Implements a reference to a editor.
* The IEditorPart will not be instanciated until
* the editor becomes visible or the API getEditor
* is sent with true;
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*/
struct BERRY_UI_QT IEditorReference : public virtual IWorkbenchPartReference
{
- berryObjectMacro(berry::IEditorReference)
+ berryObjectMacro(berry::IEditorReference);
~IEditorReference() override;
/**
* Returns the factory id of the factory used to
* restore this editor. Returns null if the editor
* is not persistable.
*/
virtual QString GetFactoryId() = 0;
/**
* Returns the editor input name. May return null is the
* name is not available or if the editor failed to be
* restored.
*/
virtual QString GetName() = 0;
/**
* Returns the editor referenced by this object.
* Returns <code>null</code> if the editor was not instantiated or
* it failed to be restored. Tries to restore the editor
* if <code>restore</code> is true.
*/
virtual IEditorPart::Pointer GetEditor(bool restore) = 0;
/**
* Returns the editor input for the editor referenced by this object.
* <p>
* Unlike most of the other methods on this type, this method
* can trigger plug-in activation.
* </p>
*
* @return the editor input for the editor referenced by this object
* @throws PartInitException if there was an error restoring the editor input
* @since 3.1
*/
virtual IEditorInput::Pointer GetEditorInput() = 0;
};
} // namespace berry
#endif /*BERRYIEDITORREFERENCE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIEditorSite.h b/Plugins/org.blueberry.ui.qt/src/berryIEditorSite.h
index b91b3b2f2e..e9a8d79052 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIEditorSite.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIEditorSite.h
@@ -1,129 +1,129 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEDITORSITE_H_
#define BERRYIEDITORSITE_H_
#include "berryIWorkbenchPartSite.h"
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* The primary interface between an editor part and the workbench.
* <p>
* The workbench exposes its implemention of editor part sites via this
* interface, which is not intended to be implemented or extended by clients.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IEditorSite : public virtual IWorkbenchPartSite {
- berryObjectMacro(berry::IEditorSite)
+ berryObjectMacro(berry::IEditorSite);
~IEditorSite() override;
/**
* Returns the action bar contributor for this editor.
* <p>
* An action contributor is responsable for the creation of actions.
* By design, this contributor is used for one or more editors of the same type.
* Thus, the contributor returned by this method is not owned completely
* by the editor - it is shared.
* </p>
*
* @return the editor action bar contributor, or <code>null</code> if none exists
*/
//virtual IEditorActionBarContributor getActionBarContributor();
/**
* Returns the action bars for this part site. Editors of the same type (and
* in the same window) share the same action bars. Contributions to the
* action bars are done by the <code>IEditorActionBarContributor</code>.
*
* @return the action bars
* @since 2.1
*/
//virtual IActionBars getActionBars();
/**
* <p>
* Registers a pop-up menu with the default id for extension. The default id
* is defined as the part id.
* </p>
* <p>
* By default, context menus include object contributions based on the
* editor input for the current editor. It is possible to override this
* behaviour by calling this method with <code>includeEditorInput</code>
* as <code>false</code>. This might be desirable for editors that
* present a localized view of an editor input (e.g., a node in a model
* editor).
* </p>
* <p>
* For a detailed description of context menu registration see
* {@link IWorkbenchPartSite#registerContextMenu(MenuManager, ISelectionProvider)}
* </p>
*
* @param menuManager
* the menu manager; must not be <code>null</code>.
* @param selectionProvider
* the selection provider; must not be <code>null</code>.
* @param includeEditorInput
* Whether the editor input should be included when adding object
* contributions to this context menu.
* @see IWorkbenchPartSite#registerContextMenu(MenuManager,
* ISelectionProvider)
* @since 3.1
*/
// virtual void registerContextMenu(MenuManager menuManager,
// ISelectionProvider selectionProvider, boolean includeEditorInput);
/**
* <p>
* Registers a pop-up menu with a particular id for extension. This method
* should only be called if the target part has more than one context menu
* to register.
* </p>
* <p>
* By default, context menus include object contributions based on the
* editor input for the current editor. It is possible to override this
* behaviour by calling this method with <code>includeEditorInput</code>
* as <code>false</code>. This might be desirable for editors that
* present a localized view of an editor input (e.g., a node in a model
* editor).
* </p>
* <p>
* For a detailed description of context menu registration see
* {@link IWorkbenchPartSite#registerContextMenu(MenuManager, ISelectionProvider)}
* </p>
*
* @param menuId
* the menu id; must not be <code>null</code>.
* @param menuManager
* the menu manager; must not be <code>null</code>.
* @param selectionProvider
* the selection provider; must not be <code>null</code>.
* @param includeEditorInput
* Whether the editor input should be included when adding object
* contributions to this context menu.
* @see IWorkbenchPartSite#registerContextMenu(MenuManager,
* ISelectionProvider)
* @since 3.1
*/
// virtual void registerContextMenu(String menuId, MenuManager menuManager,
// ISelectionProvider selectionProvider, boolean includeEditorInput);
};
}
#endif /*BERRYIEDITORSITE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIFileEditorMapping.h b/Plugins/org.blueberry.ui.qt/src/berryIFileEditorMapping.h
index aa19f56187..f82ac8814d 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIFileEditorMapping.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIFileEditorMapping.h
@@ -1,107 +1,107 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIFILEEDITORMAPPING_H_
#define BERRYIFILEEDITORMAPPING_H_
#include <berryMacros.h>
#include "berryIEditorDescriptor.h"
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* An association between a file name/extension and a list of known editors for
* files of that type.
* <p>
* The name and extension can never empty or null. The name may contain
* the single wild card character (*) to indicate the editor applies to
* all files with the same extension (e.g. *.doc). The name can never
* embed the wild card character within itself (i.e. rep*)
* </p>
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*
* @see IEditorRegistry#getFileEditorMappings
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IFileEditorMapping : public Object
{
- berryObjectMacro(berry::IFileEditorMapping)
+ berryObjectMacro(berry::IFileEditorMapping);
~IFileEditorMapping() override;
/**
* Returns the default editor registered for this type mapping.
*
* @return the descriptor of the default editor, or <code>null</code> if there
* is no default editor registered. Will also return <code>null</code> if
* the default editor exists but fails the Expressions check.
*/
virtual IEditorDescriptor::Pointer GetDefaultEditor() = 0;
/**
* Returns the list of editors registered for this type mapping.
*
* @return a possibly empty list of editors.
*/
virtual QList<IEditorDescriptor::Pointer> GetEditors() const = 0;
/**
* Returns the list of editors formerly registered for this type mapping
* which have since been deleted.
*
* @return a possibly empty list of editors
*/
virtual QList<IEditorDescriptor::Pointer> GetDeletedEditors() const = 0;
/**
* Returns the file's extension for this type mapping.
*
* @return the extension for this mapping
*/
virtual QString GetExtension() const = 0;
/**
* Returns the descriptor of the image to use for a file of this type.
* <p>
* The image is obtained from the default editor. A default file image is
* returned if no default editor is available.
* </p>
*
* @return the descriptor of the image to use for a resource of this type
*/
//virtual ImageDescriptor GetImageDescriptor() = 0;
/**
* Returns the label to use for this mapping.
* Labels have the form "<it>name</it>.<it>extension</it>".
*
* @return the label to use for this mapping
*/
virtual QString GetLabel() const = 0;
/**
* Returns the file's name for this type mapping.
*
* @return the name for this mapping
*/
virtual QString GetName() const = 0;
};
}
#endif /*BERRYIFILEEDITORMAPPING_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIFolderLayout.h b/Plugins/org.blueberry.ui.qt/src/berryIFolderLayout.h
index 0814d44c49..a121c0b551 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIFolderLayout.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIFolderLayout.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIFOLDERLAYOUT_H_
#define BERRYIFOLDERLAYOUT_H_
#include "berryIPlaceholderFolderLayout.h"
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* An <code>IFolderLayout</code> is used to define the initial views within a folder.
* The folder itself is contained within an <code>IPageLayout</code>.
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*
* @see IPageLayout#createFolder
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IFolderLayout : public IPlaceholderFolderLayout
{
- berryObjectMacro(berry::IFolderLayout)
+ berryObjectMacro(berry::IFolderLayout);
~IFolderLayout() override;
/**
* Adds a view with the given compound id to this folder.
* See the {@link IPageLayout} type documentation for more details about compound ids.
* The primary id must name a view contributed to the workbench's view extension point
* (named <code>"org.blueberry.ui.views"</code>).
*
* @param viewId the view id
*/
virtual void AddView(const QString& viewId) = 0;
};
}
#endif /*BERRYIFOLDERLAYOUT_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIMemento.h b/Plugins/org.blueberry.ui.qt/src/berryIMemento.h
index 67eb6e6f0b..7300bdc992 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIMemento.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIMemento.h
@@ -1,246 +1,246 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIMEMENTO_H_
#define BERRYIMEMENTO_H_
#include <berryMacros.h>
#include <berryObject.h>
#include <org_blueberry_ui_qt_Export.h>
#include <QString>
namespace berry
{
/**
* \ingroup org_blueberry_ui_qt
*
* Interface to a memento used for saving the important state of an object
* in a form that can be persisted in the file system.
* <p>
* Mementos were designed with the following requirements in mind:
* <ol>
* <li>Certain objects need to be saved and restored across platform sessions.
* </li>
* <li>When an object is restored, an appropriate class for an object might not
* be available. It must be possible to skip an object in this case.</li>
* <li>When an object is restored, the appropriate class for the object may be
* different from the one when the object was originally saved. If so, the
* new class should still be able to read the old form of the data.</li>
* </ol>
* </p>
* <p>
* Mementos meet these requirements by providing support for storing a
* mapping of arbitrary string keys to primitive values, and by allowing
* mementos to have other mementos as children (arranged into a tree).
* A robust external storage format based on XML is used.
* </p><p>
* The key for an attribute may be any alpha numeric value. However, the
* value of <code>TAG_ID</code> is reserved for internal use.
* </p><p>
* This interface is not intended to be implemented or extended by clients.
* </p>
*
* @see IPersistableElement
* @see IElementFactory
* @noimplement This interface is not intended to be implemented by clients.
*
**/
struct BERRY_UI_QT IMemento: public Object
{
- berryObjectMacro(berry::IMemento)
+ berryObjectMacro(berry::IMemento);
/**
* Special reserved key used to store the memento id
* (value <code>"IMemento.internal.id"</code>).
*
* @see #getID()
*/
static const QString TAG_ID; // = "IMemento.internal.id";
/**
* Creates a new child of this memento with the given type.
* <p>
* The <code>GetChild</code> and <code>GetChildren</code> methods
* are used to retrieve children of a given type.
* </p>
*
* @param type the type
* @return a new child memento
* @see #GetChild
* @see #GetChildren
*/
virtual IMemento::Pointer CreateChild(const QString& type) = 0;
/**
* Creates a new child of this memento with the given type and id.
* The id is stored in the child memento (using a special reserved
* key, <code>TAG_ID</code>) and can be retrieved using <code>GetID</code>.
* <p>
* The <code>GetChild</code> and <code>GetChildren</code> methods
* are used to retrieve children of a given type.
* </p>
*
* @param type the type
* @param id the child id
* @return a new child memento with the given type and id
* @see #GetID
*/
virtual IMemento::Pointer CreateChild(const QString& type,
const QString& id) = 0;
/**
* Returns the first child with the given type id.
*
* @param type the type id
* @return the first child with the given type
*/
virtual IMemento::Pointer GetChild(const QString& type) const = 0;
/**
* Returns all children with the given type id.
*
* @param type the type id
* @return an array of children with the given type
*/
virtual QList<IMemento::Pointer>
GetChildren(const QString& type) const = 0;
/**
* Gets the floating point value of the given key.
*
* @param key the key
* @param value the value of the given key
* @return false if the key was not found or was found
* but was not a floating point number, else true
*/
virtual bool GetFloat(const QString& key, double& value) const = 0;
/**
* Gets the integer value of the given key.
*
* @param key the key
* @param value the value of the given key
* @return false if the key was not found or was found
* but was not an integer, else true
*/
virtual bool GetInteger(const QString& key, int& value) const = 0;
/**
* Gets the string value of the given key.
*
* @param key the key
* @param value the value of the given key
* @return false if the key was not found, else true
*/
virtual bool GetString(const QString& key, QString& value) const = 0;
/**
* Gets the boolean value of the given key.
*
* @param key the key
* @param value the value of the given key
* @return false if the key was not found, else true
*/
virtual bool GetBoolean(const QString& key, bool& value) const = 0;
/**
* Returns the data of the Text node of the memento. Each memento is allowed
* only one Text node.
*
* @return the data of the Text node of the memento, or <code>null</code>
* if the memento has no Text node.
*/
virtual QString GetTextData() const = 0;
/**
* Returns an array of all the attribute keys of the memento. This will not
* be <code>null</code>. If there are no keys, an array of length zero will
* be returned.
* @return an array with all the attribute keys of the memento
*/
virtual QList<QString> GetAttributeKeys() const = 0;
/**
* Returns the type for this memento.
*
* @return the memento type
* @see #CreateChild(const QString&)
* @see #CreateChild(const QString&, const QString&)
*/
virtual QString GetType() const = 0;
/**
* Returns the id for this memento.
*
* @return the memento id, or <code>""</code> if none
* @see #CreateChild(const QString&, const QString&)
*/
virtual QString GetID() const = 0;
/**
* Sets the value of the given key to the given floating point number.
*
* @param key the key
* @param value the value
*/
virtual void PutFloat(const QString& key, double value) = 0;
/**
* Sets the value of the given key to the given integer.
*
* @param key the key
* @param value the value
*/
virtual void PutInteger(const QString& key, int value) = 0;
/**
* Copy the attributes and children from <code>memento</code>
* to the receiver.
*
* @param memento the IMemento to be copied.
*/
virtual void PutMemento(IMemento::Pointer memento) = 0;
/**
* Sets the value of the given key to the given const QString&.
*
* @param key the key
* @param value the value
*/
virtual void PutString(const QString& key, const QString& value) = 0;
/**
* Sets the value of the given key to the given boolean value.
*
* @param key the key
* @param value the value
*/
virtual void PutBoolean(const QString& key, bool value) = 0;
/**
* Sets the memento's Text node to contain the given data. Creates the Text node if
* none exists. If a Text node does exist, it's current contents are replaced.
* Each memento is allowed only one text node.
*
* @param data the data to be placed on the Text node
*/
virtual void PutTextData(const QString& data) = 0;
~IMemento() override;
};
} // namespace berry
#endif /*BERRYIMEMENTO_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIPageLayout.h b/Plugins/org.blueberry.ui.qt/src/berryIPageLayout.h
index 2802ca9936..8f9fdb1fc6 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIPageLayout.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIPageLayout.h
@@ -1,498 +1,498 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIPAGELAYOUT_H_
#define BERRYIPAGELAYOUT_H_
#include "berryIFolderLayout.h"
#include "berryIPlaceholderFolderLayout.h"
#include "berryIViewLayout.h"
#include "berryIPerspectiveDescriptor.h"
#include <string>
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* A page layout defines the initial layout for a perspective within a page
* in a workbench window.
* <p>
* This interface is not intended to be implemented by clients.
* </p>
* <p>
* When a perspective is opened, it creates a new page layout with a single editor area.
* This layout is then passed to the perspective factory (implementation of
* {@link org.blueberry.ui.IPerspectiveFactory#createInitialLayout(IPageLayout)}) where
* additional views and other content can be added, using the existing editor area as
* the initial point of reference.
* </p>
* <p>
* In some cases, multiple instances of a particular view may need to be added
* to the same layout. These are disambiguated using a secondary id.
* In layout methods taking a view id, the id can have the compound form:
* <strong>primaryId [':' secondaryId]</strong>.
* If a secondary id is given, the view must allow multiple instances by
* having specified <code>allowMultiple="true"</code> in its extension.
* View placeholders may also have a secondary id.
* </p>
* <p>
* Wildcards are permitted in placeholder ids (but not regular view ids).
* '*' matches any substring, '?' matches any single character.
* Wildcards can be specified for the primary id, the secondary id, or both.
* For example, the placeholder "someView:*" will match any occurrence of the view
* that has primary id "someView" and that also has some non-null secondary id.
* Note that this placeholder will not match the view if it has no secondary id,
* since the compound id in this case is simply "someView".
* </p>
* <p>
* Example of populating a layout with standard workbench views:
* <pre>
* IPageLayout layout = ...
* // Get the editor area.
* String editorArea = layout.getEditorArea();
*
* // Top left: Resource Navigator view and Bookmarks view placeholder
* IFolderLayout topLeft = layout.createFolder("topLeft", IPageLayout.LEFT, 0.25f,
* editorArea);
* topLeft.addView(IPageLayout.ID_RES_NAV);
* topLeft.addPlaceholder(IPageLayout.ID_BOOKMARKS);
*
* // Bottom left: Outline view and Property Sheet view
* IFolderLayout bottomLeft = layout.createFolder("bottomLeft", IPageLayout.BOTTOM, 0.50f,
* "topLeft");
* bottomLeft.addView(IPageLayout.ID_OUTLINE);
* bottomLeft.addView(IPageLayout.ID_PROP_SHEET);
*
* // Bottom right: Task List view
* layout.addView(IPageLayout.ID_TASK_LIST, IPageLayout.BOTTOM, 0.66f, editorArea);
* </pre>
* </p>
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IPageLayout : public Object
{
- berryObjectMacro(berry::IPageLayout)
+ berryObjectMacro(berry::IPageLayout);
/**
* The part id for the workbench's editor area. This may only be used
* as a reference part for view addition.
*/
static const QString ID_EDITOR_AREA; // = "org.blueberry.ui.editors";
/**
* The view id for the workbench's Resource Navigator standard component.
*/
static const QString ID_RES_NAV; // = "org.blueberry.ui.views.ResourceNavigator";
/**
* The view id for the workbench's Property Sheet standard component.
*/
static const QString ID_PROP_SHEET; // = "org.blueberry.ui.views.PropertySheet";
/**
* The view id for the workbench's Content Outline standard component.
*/
static const QString ID_OUTLINE; // = "org.blueberry.ui.views.ContentOutline";
/**
* The view id for the workbench's Bookmark Navigator standard component.
*/
static const QString ID_BOOKMARKS; // = "org.blueberry.ui.views.BookmarkView";
/**
* The view id for the workbench's Problems View standard component.
* @since 3.0
*/
static const QString ID_PROBLEM_VIEW; // = "org.blueberry.ui.views.ProblemView";
/**
* The view id for the workbench's Progress View standard component.
* @since 3.2
*/
static const QString ID_PROGRESS_VIEW; // = "org.blueberry.ui.views.ProgressView";
/**
* The view id for the workbench's Task List standard component.
*/
static const QString ID_TASK_LIST; // = "org.blueberry.ui.views.TaskList";
/**
* Id of the navigate action set.
* (value <code>"org.blueberry.ui.NavigateActionSet"</code>)
* @since 2.1
*/
static const QString ID_NAVIGATE_ACTION_SET; // = "org.blueberry.ui.NavigateActionSet";
/**
* Relationship constant indicating a part should be placed to the left of
* its relative.
*/
static const int LEFT; // = 1;
/**
* Relationship constant indicating a part should be placed to the right of
* its relative.
*/
static const int RIGHT; // = 2;
/**
* Relationship constant indicating a part should be placed above its
* relative.
*/
static const int TOP; // = 3;
/**
* Relationship constant indicating a part should be placed below its
* relative.
*/
static const int BOTTOM; // = 4;
/**
* Minimum acceptable ratio value when adding a view
* @since 2.0
*/
static const float RATIO_MIN; // = 0.05f;
/**
* Maximum acceptable ratio value when adding a view
* @since 2.0
*/
static const float RATIO_MAX; // = 0.95f;
/**
* The default view ratio width for regular (non-fast) views.
* @since 2.0
*/
static const float DEFAULT_VIEW_RATIO; // = 0.5f;
/**
* A variable used to represent invalid ratios.
* @since 2.0
*/
static const float INVALID_RATIO; // = -1f;
/**
* A variable used to represent a ratio which has not been specified.
* @since 2.0
*/
static const float nullptr_RATIO; // = -2f;
/**
* Adds an action set with the given id to this page layout.
* The id must name an action set contributed to the workbench's extension
* point (named <code>"org.blueberry.ui.actionSet"</code>).
*
* @param actionSetId the action set id
*/
//virtual void AddActionSet(const QString& actionSetId) = 0;
/**
* Adds a perspective shortcut to the page layout.
* These are typically shown in the UI to allow rapid navigation to appropriate new wizards.
* For example, in the Eclipse IDE, these appear as items under the Window > Open Perspective menu.
* The id must name a perspective extension contributed to the
* workbench's perspectives extension point (named <code>"org.blueberry.ui.perspectives"</code>).
*
* @param id the perspective id
*/
virtual void AddPerspectiveShortcut(const QString& id) = 0;
/**
* Adds a view placeholder to this page layout.
* A view placeholder is used to define the position of a view before the view
* appears. Initially, it is invisible; however, if the user ever opens a view
* whose compound id matches the placeholder, the view will appear at the same
* location as the placeholder.
* See the {@link IPageLayout} type documentation for more details about compound ids.
* If the placeholder contains wildcards, it remains in the layout, otherwise
* it is replaced by the view.
* If the primary id of the placeholder has no wildcards, it must refer to a view
* contributed to the workbench's view extension point
* (named <code>"org.blueberry.ui.views"</code>).
*
* @param viewId the compound view id (wildcards allowed)
* @param relationship the position relative to the reference part;
* one of <code>TOP</code>, <code>BOTTOM</code>, <code>LEFT</code>,
* or <code>RIGHT</code>
* @param ratio a ratio specifying how to divide the space currently occupied by the reference part,
* in the range <code>0.05f</code> to <code>0.95f</code>.
* Values outside this range will be clipped to facilitate direct manipulation.
* For a vertical split, the part on top gets the specified ratio of the current space
* and the part on bottom gets the rest.
* Likewise, for a horizontal split, the part at left gets the specified ratio of the current space
* and the part at right gets the rest.
* @param refId the id of the reference part; either a view id, a folder id,
* or the special editor area id returned by <code>getEditorArea</code>
*/
virtual void AddPlaceholder(const QString& viewId, int relationship, float ratio,
const QString& refId) = 0;
/**
* Adds an item to the Show In prompter.
* The id must name a view contributed to the workbench's view extension point
* (named <code>"org.blueberry.ui.views"</code>).
*
* @param id the view id
*
* @since 2.1
*/
virtual void AddShowInPart(const QString& id) = 0;
/**
* Adds a show view shortcut to the page layout.
* These are typically shown in the UI to allow rapid navigation to appropriate views.
* For example, in the Eclipse IDE, these appear as items under the Window > Show View menu.
* The id must name a view contributed to the workbench's views extension point
* (named <code>"org.blueberry.ui.views"</code>).
*
* @param id the view id
*/
virtual void AddShowViewShortcut(const QString& id) = 0;
/**
* Adds a view with the given compound id to this page layout.
* See the {@link IPageLayout} type documentation for more details about compound ids.
* The primary id must name a view contributed to the workbench's view extension point
* (named <code>"org.blueberry.ui.views"</code>).
*
* @param viewId the compound view id
* @param relationship the position relative to the reference part;
* one of <code>TOP</code>, <code>BOTTOM</code>, <code>LEFT</code>,
* or <code>RIGHT</code>
* @param ratio a ratio specifying how to divide the space currently occupied by the reference part,
* in the range <code>0.05f</code> to <code>0.95f</code>.
* Values outside this range will be clipped to facilitate direct manipulation.
* For a vertical split, the part on top gets the specified ratio of the current space
* and the part on bottom gets the rest.
* Likewise, for a horizontal split, the part at left gets the specified ratio of the current space
* and the part at right gets the rest.
* @param refId the id of the reference part; either a view id, a folder id,
* or the special editor area id returned by <code>getEditorArea</code>
*/
virtual void AddView(const QString& viewId, int relationship, float ratio,
const QString& refId) = 0;
/**
* Creates and adds a new folder with the given id to this page layout.
* The position and relative size of the folder is expressed relative to
* a reference part.
*
* @param folderId the id for the new folder. This must be unique within
* the layout to avoid collision with other parts.
* @param relationship the position relative to the reference part;
* one of <code>TOP</code>, <code>BOTTOM</code>, <code>LEFT</code>,
* or <code>RIGHT</code>
* @param ratio a ratio specifying how to divide the space currently occupied by the reference part,
* in the range <code>0.05f</code> to <code>0.95f</code>.
* Values outside this range will be clipped to facilitate direct manipulation.
* For a vertical split, the part on top gets the specified ratio of the current space
* and the part on bottom gets the rest.
* Likewise, for a horizontal split, the part at left gets the specified ratio of the current space
* and the part at right gets the rest.
* @param refId the id of the reference part; either a view id, a folder id,
* or the special editor area id returned by <code>getEditorArea</code>
* @return the new folder
*/
virtual IFolderLayout::Pointer CreateFolder(const QString& folderId, int relationship,
float ratio, const QString& refId) = 0;
/**
* Creates and adds a placeholder for a new folder with the given id to this page layout.
* The position and relative size of the folder is expressed relative to
* a reference part.
*
* @param folderId the id for the new folder. This must be unique within
* the layout to avoid collision with other parts.
* @param relationship the position relative to the reference part;
* one of <code>TOP</code>, <code>BOTTOM</code>, <code>LEFT</code>,
* or <code>RIGHT</code>
* @param ratio a ratio specifying how to divide the space currently occupied by the reference part,
* in the range <code>0.05f</code> to <code>0.95f</code>.
* Values outside this range will be clipped to facilitate direct manipulation.
* For a vertical split, the part on top gets the specified ratio of the current space
* and the part on bottom gets the rest.
* Likewise, for a horizontal split, the part at left gets the specified ratio of the current space
* and the part at right gets the rest.
* @param refId the id of the reference part; either a view id, a folder id,
* or the special editor area id returned by <code>getEditorArea</code>
* @return a placeholder for the new folder
* @since 2.0
*/
virtual IPlaceholderFolderLayout::Pointer CreatePlaceholderFolder(const QString& folderId,
int relationship, float ratio, const QString& refId) = 0;
/**
* Returns the special identifier for the editor area in this page
* layout. The identifier for the editor area is also stored in
* <code>ID_EDITOR_AREA</code>.
* <p>
* The editor area is automatically added to each layout before anything else.
* It should be used as the point of reference when adding views to a layout.
* </p>
*
* @return the special id of the editor area
*/
virtual QString GetEditorArea() = 0;
/**
* Returns whether the page's layout will show
* the editor area.
*
* @return <code>true</code> when editor area visible, <code>false</code> otherwise
*/
virtual bool IsEditorAreaVisible() = 0;
/**
* Show or hide the editor area for the page's layout.
*
* @param showEditorArea <code>true</code> to show the editor area, <code>false</code> to hide the editor area
*/
virtual void SetEditorAreaVisible(bool showEditorArea) = 0;
/**
* Sets whether this layout is fixed.
* In a fixed layout, layout parts cannot be moved or zoomed, and the initial
* set of views cannot be closed.
*
* @param isFixed <code>true</code> if this layout is fixed, <code>false</code> if not
* @since 3.0
*/
virtual void SetFixed(bool isFixed) = 0;
/**
* Returns <code>true</code> if this layout is fixed, <code>false</code> if not.
* In a fixed layout, layout parts cannot be moved or zoomed, and the initial
* set of views cannot be closed.
* The default is <code>false</code>.
*
* @return <code>true</code> if this layout is fixed, <code>false</code> if not.
* @since 3.0
*/
virtual bool IsFixed() = 0;
/**
* Returns the layout for the view or placeholder with the given compound id in
* this page layout.
* See the {@link IPageLayout} type documentation for more details about compound ids.
* Returns <code>null</code> if the specified view or placeholder is unknown to the layout.
*
* @param id the compound view id or placeholder
* @return the view layout, or <code>null</code>
* @since 3.0
*/
virtual IViewLayout::Pointer GetViewLayout(const QString& id) = 0;
/**
* Adds a standalone view with the given compound id to this page layout.
* See the {@link IPageLayout} type documentation for more details about compound ids.
* A standalone view cannot be docked together with other views.
* A standalone view's title can optionally be hidden. If hidden,
* then any controls typically shown with the title (such as the close button)
* are also hidden. Any contributions or other content from the view itself
* are always shown (e.g. toolbar or view menu contributions, content description).
* <p>
* The id must name a view contributed to the workbench's view extension point
* (named <code>"org.blueberry.ui.views"</code>).
* </p>
*
* @param viewId the compound view id
* @param showTitle <code>true</code> to show the title and related controls,
* <code>false</code> to hide them
* @param relationship the position relative to the reference part;
* one of <code>TOP</code>, <code>BOTTOM</code>, <code>LEFT</code>,
* or <code>RIGHT</code>
* @param ratio a ratio specifying how to divide the space currently occupied by the reference part,
* in the range <code>0.05f</code> to <code>0.95f</code>.
* Values outside this range will be clipped to facilitate direct manipulation.
* For a vertical split, the part on top gets the specified ratio of the current space
* and the part on bottom gets the rest.
* Likewise, for a horizontal split, the part at left gets the specified ratio of the current space
* and the part at right gets the rest.
* @param refId the id of the reference part; either a view id, a folder id,
* or the special editor area id returned by <code>getEditorArea</code>
*
* @since 3.0
*/
virtual void AddStandaloneView(const QString& viewId, bool showTitle,
int relationship, float ratio, const QString& refId) = 0;
/**
* Adds a standalone view placeholder to this page layout. A view
* placeholder is used to define the position of a view before the view
* appears. Initially, it is invisible; however, if the user ever opens a
* view whose compound id matches the placeholder, the view will appear at
* the same location as the placeholder. See the {@link IPageLayout} type
* documentation for more details about compound ids. If the placeholder
* contains wildcards, it remains in the layout, otherwise it is replaced by
* the view. If the primary id of the placeholder has no wildcards, it must
* refer to a view contributed to the workbench's view extension point
* (named <code>"org.blueberry.ui.views"</code>).
*
* @param viewId
* the compound view id (wildcards allowed)
* @param relationship
* the position relative to the reference part; one of
* <code>TOP</code>, <code>BOTTOM</code>, <code>LEFT</code>,
* or <code>RIGHT</code>
* @param ratio
* a ratio specifying how to divide the space currently occupied
* by the reference part, in the range <code>0.05f</code> to
* <code>0.95f</code>. Values outside this range will be
* clipped to facilitate direct manipulation. For a vertical
* split, the part on top gets the specified ratio of the current
* space and the part on bottom gets the rest. Likewise, for a
* horizontal split, the part at left gets the specified ratio of
* the current space and the part at right gets the rest.
* @param refId
* the id of the reference part; either a view id, a folder id,
* or the special editor area id returned by
* <code>getEditorArea</code>
* @param showTitle
* true to show the view's title, false if not
*
* @since 3.2
*/
virtual void AddStandaloneViewPlaceholder(const QString& viewId, int relationship,
float ratio, const QString& refId, bool showTitle) = 0;
/**
* Returns the perspective descriptor for the perspective being layed out.
*
* @return the perspective descriptor for the perspective being layed out
* @since 3.2
*/
virtual IPerspectiveDescriptor::Pointer GetDescriptor() = 0;
/**
* Returns the folder layout for the view or placeholder with the given
* compound id in this page layout. See the {@link IPageLayout} type
* documentation for more details about compound ids. Returns
* <code>null</code> if the specified view or placeholder is unknown to
* the layout, or the placeholder was not in a folder.
*
* @param id
* the compound view id or placeholder. Must not be
* <code>null</code>.
* @return the folder layout, or <code>null</code>
* @since 3.3
*/
virtual IPlaceholderFolderLayout::Pointer GetFolderForView(const QString& id) = 0;
};
}
#endif /*BERRYIPAGELAYOUT_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIPathEditorInput.h b/Plugins/org.blueberry.ui.qt/src/berryIPathEditorInput.h
index d85518d237..e4d3b840ff 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIPathEditorInput.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIPathEditorInput.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIPATHEDITORINPUT_H_
#define BERRYIPATHEDITORINPUT_H_
#include "berryIEditorInput.h"
#include <Poco/Path.h>
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* This interface defines an editor input based on the local file system path
* of a file.
* <p>
* Clients implementing this editor input interface should override
* <code>Object.equals(Object)</code> to answer true for two inputs
* that are the same. The <code>IWorkbenchPage.openEditor</code> APIs
* are dependent on this to find an editor with the same input.
* </p><p>
* Path-oriented editors should support this as a valid input type, and
* can allow full read-write editing of its content.
* </p><p>
* All editor inputs must implement the <code>IAdaptable</code> interface;
* extensions are managed by the platform's adapter manager.
* </p>
*
* @see org.blueberry.core.runtime.IPath
* @since 3.0
*/
struct BERRY_UI_QT IPathEditorInput : public IEditorInput {
- berryObjectMacro(berry::IPathEditorInput)
+ berryObjectMacro(berry::IPathEditorInput);
~IPathEditorInput() override;
/**
* Returns the local file system path of the file underlying this editor input.
*
* @return a local file system path
*/
virtual QString GetPath() const = 0;
};
}
#endif /*BERRYIPATHEDITORINPUT_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIPerspectiveDescriptor.h b/Plugins/org.blueberry.ui.qt/src/berryIPerspectiveDescriptor.h
index 1d95d23187..ff42689e9b 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIPerspectiveDescriptor.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIPerspectiveDescriptor.h
@@ -1,126 +1,126 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIPERSPECTIVEDESCRIPTOR_H_
#define BERRYIPERSPECTIVEDESCRIPTOR_H_
#include <berryMacros.h>
#include <berryObject.h>
#include <org_blueberry_ui_qt_Export.h>
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* A perspective descriptor describes a perspective in an
* <code>IPerspectiveRegistry</code>.
* <p>
* A perspective is a template for view visibility, layout, and action visibility
* within a workbench page. There are two types of perspective: a predefined
* perspective and a custom perspective.
* <ul>
* <li>A predefined perspective is defined by an extension to the workbench's
* perspective extension point (<code>"org.blueberry.ui.perspectives"</code>).
* The extension defines a id, label, and <code>IPerspectiveFactory</code>.
* A perspective factory is used to define the initial layout for a page.
* </li>
* <li>A custom perspective is defined by the user. In this case a predefined
* perspective is modified to suit a particular task and saved as a new
* perspective. The attributes for the perspective are stored in a separate file
* in the workbench's metadata directory.
* </li>
* </ul>
* </p>
* <p>
* Within a page the user can open any of the perspectives known
* to the workbench's perspective registry, typically by selecting one from the
* workbench's <code>Open Perspective</code> menu. When selected, the views
* and actions within the active page rearrange to reflect the perspective.
* </p>
* <p>
* This interface is not intended to be implemented by clients.
* </p>
* @see IPerspectiveRegistry
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IPerspectiveDescriptor : public virtual Object
{
- berryObjectMacro(berry::IPerspectiveDescriptor)
+ berryObjectMacro(berry::IPerspectiveDescriptor);
~IPerspectiveDescriptor() override;
/**
* Returns the description of this perspective.
* This is the value of its <code>"description"</code> attribute.
*
* @return the description
* @since 3.0
*/
virtual QString GetDescription() const = 0;
/**
* Returns this perspective's id. For perspectives declared via an extension,
* this is the value of its <code>"id"</code> attribute.
*
* @return the perspective id
*/
virtual QString GetId() const = 0;
/**
* Returns the descriptor of the image to show for this perspective.
* If the extension for this perspective specifies an image, the descriptor
* for it is returned. Otherwise a default image is returned.
*
* @return the descriptor of the image to show for this perspective
*/
virtual QIcon GetImageDescriptor() const = 0;
/**
* Returns this perspective's label. For perspectives declared via an extension,
* this is the value of its <code>"label"</code> attribute.
*
* @return the label
*/
virtual QString GetLabel() const = 0;
/**
* Returns <code>true</code> if this perspective is predefined by an
* extension.
*
* @return boolean whether this perspective is predefined by an extension
*/
//virtual bool IsPredefined() const = 0;
/**
* Return the category path of this descriptor
*
* @return the category path of this descriptor
*/
virtual QStringList GetCategoryPath() const = 0;
/**
* Returns a list of ids belonging to keyword reference extensions.
*
* The keywords listed in each referenced id can be used to filter
* this perspective.
*
* @return A list of ids for keyword reference extensions.
*/
virtual QStringList GetKeywordReferences() const = 0;
};
}
#endif /*BERRYIPERSPECTIVEDESCRIPTOR_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIPerspectiveFactory.h b/Plugins/org.blueberry.ui.qt/src/berryIPerspectiveFactory.h
index d09210cf68..8d8a497789 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIPerspectiveFactory.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIPerspectiveFactory.h
@@ -1,108 +1,108 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIPERSPECTIVEFACTORY_H_
#define BERRYIPERSPECTIVEFACTORY_H_
#include <berryMacros.h>
#include <org_blueberry_ui_qt_Export.h>
#include "berryIPageLayout.h"
#include <QObject>
namespace berry {
/**
* A perspective factory generates the initial page layout and visible
* action set for a page.
* <p>
* When a new page is created in the workbench a perspective is used to define
* the initial page layout. If this is a predefined perspective (based on an extension to
* the workbench's perspective extension point) an <code>IPerspectiveFactory</code>
* is used to define the initial page layout.
* </p><p>
* The factory for the perspective is created and passed an <code>IPageLayout</code>
* where views can be added. The default layout consists of the editor area with no
* additional views. Additional views are added to the layout using
* the editor area as the initial point of reference. The factory is used only briefly
* while a new page is created; then discarded.
* </p><p>
* To define a perspective clients should implement this interface and
* include the name of their class in an extension to the workbench's perspective
* extension point (named <code>"org.blueberry.ui.perspectives"</code>). For example,
* the plug-in's XML markup might contain:
* <pre>
* &lt;extension point="org.blueberry.ui.perspectives"&gt;
* &lt;perspective
* id="com.example.plugin.perspective"
* name="My Perspective"
* class="namespaze::MyPerspective"&gt;
* &lt;/perspective&gt;
* &lt;/extension&gt;
* </pre>
* </p><p>
* Example of populating a page with standard workbench views:
* <pre>
* public: void CreateInitialLayout(IPageLayout layout) {
* // Get the editor area.
* QString editorArea = layout->GetEditorArea();
*
* // Top left: Resource Navigator view and Bookmarks view placeholder
* IFolderLayout::Pointer topLeft = layout->CreateFolder("topLeft", IPageLayout::LEFT, 0.25f,
* editorArea);
* topLeft->AddView(IPageLayout::ID_RES_NAV);
* topLeft->AddPlaceholder(IPageLayout::ID_BOOKMARKS);
*
* // Bottom left: Outline view and Property Sheet view
* IFolderLayout::Pointer bottomLeft = layout->CreateFolder("bottomLeft", IPageLayout::BOTTOM, 0.50f,
* "topLeft");
* bottomLeft->AddView(IPageLayout::ID_OUTLINE);
* bottomLeft->AddView(IPageLayout::ID_PROP_SHEET);
*
* // Bottom right: Task List view
* layout->AddView(IPageLayout::ID_TASK_LIST, IPageLayout::BOTTOM, 0.66f, editorArea);
* }
* </pre>
* </p><p>
* Within the workbench a user may override the visible views, layout and
* action sets of a predefined perspective to create a custom perspective. In such cases
* the layout is persisted by the workbench and the factory is not used.
* </p>
*/
struct BERRY_UI_QT IPerspectiveFactory : public Object
{
- berryObjectMacro(berry::IPerspectiveFactory)
+ berryObjectMacro(berry::IPerspectiveFactory);
~IPerspectiveFactory() override;
/**
* Creates the initial layout for a page.
* <p>
* Implementors of this method may add additional views to a
* perspective. The perspective already contains an editor folder
* identified by the result of <code>IPageLayout.getEditorArea()</code>.
* Additional views should be added to the layout using this value as
* the initial point of reference.
* </p>
*
* @param layout the page layout
*/
virtual void CreateInitialLayout(IPageLayout::Pointer layout) = 0;
};
}
Q_DECLARE_INTERFACE(berry::IPerspectiveFactory, "org.blueberry.ui.IPerspectiveFactory")
#endif /* BERRYIPERSPECTIVEFACTORY_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIPlaceholderFolderLayout.h b/Plugins/org.blueberry.ui.qt/src/berryIPlaceholderFolderLayout.h
index f25d16d126..f931136110 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIPlaceholderFolderLayout.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIPlaceholderFolderLayout.h
@@ -1,97 +1,97 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIPLACEHOLDERFOLDERLAYOUT_H_
#define BERRYIPLACEHOLDERFOLDERLAYOUT_H_
#include <berryMacros.h>
#include <berryObject.h>
#include <org_blueberry_ui_qt_Export.h>
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* An <code>IPlaceholderFolderLayout</code> is used to define the initial
* view placeholders within a folder.
* The folder itself is contained within an <code>IPageLayout</code>.
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*
* @see IPageLayout#createPlaceholderFolder
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IPlaceholderFolderLayout : public Object
{
- berryObjectMacro(berry::IPlaceholderFolderLayout)
+ berryObjectMacro(berry::IPlaceholderFolderLayout);
~IPlaceholderFolderLayout() override;
/**
* Adds a view placeholder to this folder.
* A view placeholder is used to define the position of a view before the view
* appears. Initially, it is invisible; however, if the user ever opens a view
* whose compound id matches the placeholder, the view will appear at the same
* location as the placeholder.
* See the {@link IPageLayout} type documentation for more details about compound ids.
* If the placeholder contains wildcards, it remains in the layout, otherwise
* it is replaced by the view.
* If the primary id of the placeholder has no wildcards, it must refer to a view
* contributed to the workbench's view extension point
* (named <code>"org.blueberry.ui.views"</code>).
*
* @param viewId the compound view id (wildcards allowed)
*/
virtual void AddPlaceholder(const QString& viewId) = 0;
/**
* Returns the property with the given id or <code>null</code>. Folder
* properties are an extensible mechanism for perspective authors to
* customize the appearance of view stacks. The list of customizable
* properties is determined by the presentation factory.
*
* @param id
* Must not be <code>null</code>.
* @return property value, or <code>null</code> if the property is not
* set.
* @since 3.3
*/
virtual QString GetProperty(const QString& id) = 0;
/**
* Sets the given property to the given value. Folder properties are an
* extensible mechanism for perspective authors to customize the appearance
* of view stacks. The list of customizable properties is determined by the
* presentation factory.
* <p>
* These folder properties are intended to be set during
* <code>IPerspectiveFactory#createInitialLayout</code>. Any subsequent
* changes to property values after this method completes will not fire
* change notifications and will not be reflected in the presentation.
* </p>
*
* @param id
* property id. Must not be <code>null</code>.
* @param value
* property value. <code>null</code> will clear the property.
* @since 3.3
*/
virtual void SetProperty(const QString& id, const QString& value) = 0;
};
}
#endif /*BERRYIPLACEHOLDERFOLDERLAYOUT_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIPluginContribution.h b/Plugins/org.blueberry.ui.qt/src/berryIPluginContribution.h
index 4cea813d63..0e746c65ab 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIPluginContribution.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIPluginContribution.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIPLUGINCONTRIBUTION_H
#define BERRYIPLUGINCONTRIBUTION_H
#include <berryMacros.h>
#include <berryObject.h>
namespace berry {
/**
* An interface that descriptor classes may implement in addition to their
* descriptor interface. This indicates that they may or may not originate from
* a plugin contribution. This is useful in various activity filtering
* scenarios.
*/
struct IPluginContribution : public virtual Object
{
- berryObjectMacro(berry::IPluginContribution)
+ berryObjectMacro(berry::IPluginContribution);
/**
* @return the local id of the contribution. Must not be <code>null</code>.
* This should correspond to the extension-specific identifier for
* a given contribution.
*/
virtual QString GetLocalId() const = 0;
/**
* @return the id of the originating plugin. Can be <code>null</code> if
* this contribution did not originate from a plugin.
*/
virtual QString GetPluginId() const = 0;
};
}
#endif // BERRYIPLUGINCONTRIBUTION_H
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIPostSelectionProvider.h b/Plugins/org.blueberry.ui.qt/src/berryIPostSelectionProvider.h
index 2430b6ec0d..833e6144d2 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIPostSelectionProvider.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIPostSelectionProvider.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIPOSTSELECTIONPROVIDER_H_
#define BERRYIPOSTSELECTIONPROVIDER_H_
#include "berryISelectionProvider.h"
namespace berry
{
/**
* \ingroup org_blueberry_ui_qt
*
* Selection provider extension interface to allow providers
* to notify about post selection changed events.
* A post selection changed event is equivalent to selection changed event
* if the selection change was triggered by the mouse, but it has a delay
* if the selection change is triggered by keyboard navigation.
*
* @see ISelectionProvider
*/
struct BERRY_UI_QT IPostSelectionProvider : public ISelectionProvider
{
- berryObjectMacro(berry::IPostSelectionProvider)
+ berryObjectMacro(berry::IPostSelectionProvider);
~IPostSelectionProvider() override;
/**
* Adds a listener for post selection changes in this selection provider.
* Has no effect if an identical listener is already registered.
*
* @param listener a selection changed listener
*/
virtual void AddPostSelectionChangedListener(
ISelectionChangedListener* listener) = 0;
/**
* Removes the given listener for post selection changes from this selection
* provider.
* Has no affect if an identical listener is not registered.
*
* @param listener a selection changed listener
*/
virtual void RemovePostSelectionChangedListener(
ISelectionChangedListener* listener) = 0;
};
}
#endif /*BERRYIPOSTSELECTIONPROVIDER_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIPreferencePage.h b/Plugins/org.blueberry.ui.qt/src/berryIPreferencePage.h
index d611f2e886..126da437dc 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIPreferencePage.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIPreferencePage.h
@@ -1,105 +1,105 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIPREFERENCEPAGE_H_
#define BERRYIPREFERENCEPAGE_H_
#include "berryObject.h"
#include "berryIPreferences.h"
#include "berryIWorkbench.h"
#include <QObject>
namespace berry
{
/**
* \ingroup org_blueberry_ui_qt
*
* Interface for workbench preference pages.
* <p>
* Clients should implement this interface and include the name of their class
* in an extension contributed to the workbench's preference extension point
* (named <code>"org.blueberry.ui.preferencePages"</code>).
* For example, the plug-in's XML markup might contain:
* <pre>
* &LT;extension point="org.blueberry.ui.preferencePages"&GT;
* &LT;page id="com.example.myplugin.prefs"
* name="Knobs"
* class="ns::MyPreferencePage" /&GT;
* &LT;/extension&GT;
* </pre>
* </p>
*/
struct BERRY_UI_QT IPreferencePage: virtual public Object
{
- berryObjectMacro(berry::IPreferencePage)
+ berryObjectMacro(berry::IPreferencePage);
~IPreferencePage() override;
/**
* Initializes this preference page for the given workbench.
* <p>
* This method is called automatically as the preference page is being created
* and initialized. Clients must not call this method.
* </p>
*
* @param workbench the workbench
*/
virtual void Init(IWorkbench::Pointer workbench) = 0;
/**
* Creates the top level control for this preference
* page under the given parent widget.
* <p>
* Implementors are responsible for ensuring that
* the created control can be accessed via <code>GetControl</code>
* </p>
*
* @param parent the parent widget
*/
virtual void CreateControl(void* parent) = 0;
/**
* Returns the top level control for this dialog page.
* <p>
* May return <code>null</code> if the control
* has not been created yet.
* </p>
*
* @return the top level control or <code>null</code>
*/
virtual void* GetControl() const = 0;
///
/// Invoked when the OK button was clicked in the preferences dialog
///
virtual bool PerformOk() = 0;
///
/// Invoked when the Cancel button was clicked in the preferences dialog
///
virtual void PerformCancel() = 0;
///
/// Invoked when the user performed an import. As the values of the preferences may have changed
/// you should read all values again from the preferences service.
///
virtual void Update() = 0;
};
}
Q_DECLARE_INTERFACE(berry::IPreferencePage, "org.blueberry.ui.IPreferencePage")
#endif /*BERRYIPREFERENCEPAGE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIReusableEditor.h b/Plugins/org.blueberry.ui.qt/src/berryIReusableEditor.h
index 1ecde0b79d..b3c9830b3b 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIReusableEditor.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIReusableEditor.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIREUSABLEEDITOR_H_
#define BERRYIREUSABLEEDITOR_H_
#include "berryIEditorPart.h"
#include "berryIEditorInput.h"
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* Interface for reusable editors.
*
* An editors may support changing its input so that
* the workbench may change its contents instead of
* opening a new editor.
*/
struct BERRY_UI_QT IReusableEditor : public virtual IEditorPart
{
- berryObjectMacro(berry::IReusableEditor)
+ berryObjectMacro(berry::IReusableEditor);
~IReusableEditor() override;
/**
* Sets the input to this editor.
*
* <p><b>Note:</b> Clients must fire the {@link IWorkbenchPartConstants#PROP_INPUT }
* property change within their implementation of
* <code>setInput()</code>.<p>
*
* @param input the editor input
*/
virtual void SetInput(IEditorInput::Pointer input) = 0;
};
}
#endif /*BERRYIREUSABLEEDITOR_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryISaveablePart.h b/Plugins/org.blueberry.ui.qt/src/berryISaveablePart.h
index 8c992e5def..32e813c202 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryISaveablePart.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryISaveablePart.h
@@ -1,117 +1,117 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISAVEABLEPART_H_
#define BERRYISAVEABLEPART_H_
#include <berryMacros.h>
#include <berryObject.h>
#include <org_blueberry_ui_qt_Export.h>
#include <QtPlugin>
namespace berry {
/**
* Workbench parts implement or adapt to this interface to participate
* in the enablement and execution of the <code>Save</code> and
* <code>Save As</code> actions.
*
* @see IEditorPart
*/
struct BERRY_UI_QT ISaveablePart : public virtual Object
{
- berryObjectMacro(berry::ISaveablePart)
+ berryObjectMacro(berry::ISaveablePart);
/**
* The property id for <code>isDirty</code>.
*/
static const int PROP_DIRTY; // = IWorkbenchPartConstants.PROP_DIRTY;
/**
* Saves the contents of this part.
* <p>
* If the save is successful, the part should fire a property changed event
* reflecting the new dirty state (<code>PROP_DIRTY</code> property).
* </p>
* <p>
* If the save is cancelled through user action, or for any other reason, the
* part should invoke <code>setCancelled</code> on the <code>IProgressMonitor</code>
* to inform the caller.
* </p>
* <p>
* This method is long-running; progress and cancellation are provided
* by the given progress monitor.
* </p>
*
* @param monitor the progress monitor
*/
virtual void DoSave(/*IProgressMonitor monitor*/) = 0;
/**
* Saves the contents of this part to another object.
* <p>
* Implementors are expected to open a "Save As" dialog where the user will
* be able to select a new name for the contents. After the selection is made,
* the contents should be saved to that new name. During this operation a
* <code>IProgressMonitor</code> should be used to indicate progress.
* </p>
* <p>
* If the save is successful, the part fires a property changed event
* reflecting the new dirty state (<code>PROP_DIRTY</code> property).
* </p>
*/
virtual void DoSaveAs() = 0;
/**
* Returns whether the contents of this part have changed since the last save
* operation. If this value changes the part must fire a property listener
* event with <code>PROP_DIRTY</code>.
* <p>
* <b>Note:</b> this method is called often on a part open or part
* activation switch, for example by actions to determine their
* enabled status.
* </p>
*
* @return <code>true</code> if the contents have been modified and need
* saving, and <code>false</code> if they have not changed since the last
* save
*/
virtual bool IsDirty() const = 0;
/**
* Returns whether the "Save As" operation is supported by this part.
*
* @return <code>true</code> if "Save As" is supported, and <code>false</code>
* if not supported
*/
virtual bool IsSaveAsAllowed() const = 0;
/**
* Returns whether the contents of this part should be saved when the part
* is closed.
*
* @return <code>true</code> if the contents of the part should be saved on
* close, and <code>false</code> if the contents are expendable
*/
virtual bool IsSaveOnCloseNeeded() const = 0;
};
}
Q_DECLARE_INTERFACE(berry::ISaveablePart, "org.blueberry.ui.ISaveablePart")
#endif /* BERRYISAVEABLEPART_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/berryISaveablesLifecycleListener.h b/Plugins/org.blueberry.ui.qt/src/berryISaveablesLifecycleListener.h
index 9759ddcce1..b3190f6f87 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryISaveablesLifecycleListener.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryISaveablesLifecycleListener.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISAVEABLESLIFECYCLELISTENER_H_
#define BERRYISAVEABLESLIFECYCLELISTENER_H_
#include "berrySaveablesLifecycleEvent.h"
#include <berryMessage.h>
namespace berry {
/**
* Listener for events fired by implementers of {@link ISaveablesSource}.
*
* <p>
* This service can be acquired from a part's service locator:
*
* <pre>
* ISaveablesLifecycleListener listener = (ISaveablesLifecycleListener) getSite()
* .getService(ISaveablesLifecycleListener.class);
* </pre>
*
* or, in the case of implementers of {@link ISaveablesSource} that are not a
* part, from the workbench:
*
* <pre>
* ISaveablesLifecycleListener listener = (ISaveablesLifecycleListener) workbench
* .getService(ISaveablesLifecycleListener.class);
* </pre>
*
* <ul>
* <li>This service is available globally.</li>
* </ul>
* </p>
*/
struct ISaveablesLifecycleListener : public virtual Object
{
- berryObjectMacro(berry::ISaveablesLifecycleListener)
+ berryObjectMacro(berry::ISaveablesLifecycleListener);
struct Events {
Message1<const SaveablesLifecycleEvent::Pointer&> lifecycleChange;
void AddListener(ISaveablesLifecycleListener* listener);
void RemoveListener(ISaveablesLifecycleListener* listener);
private:
typedef MessageDelegate1<ISaveablesLifecycleListener, const SaveablesLifecycleEvent::Pointer&> Delegate;
};
~ISaveablesLifecycleListener() override;
/**
* Handle the given event. This method must be called on the UI thread.
*
* @param event
*/
virtual void HandleLifecycleEvent(const SaveablesLifecycleEvent::Pointer& event) = 0;
};
}
Q_DECLARE_INTERFACE(berry::ISaveablesLifecycleListener, "org.blueberry.ui.ISaveablesLifecycleListener")
#endif /* BERRYISAVEABLESLIFECYCLELISTENER_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/berryISaveablesSource.h b/Plugins/org.blueberry.ui.qt/src/berryISaveablesSource.h
index 64b020a682..8398ebbad0 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryISaveablesSource.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryISaveablesSource.h
@@ -1,121 +1,121 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISAVEABLESSOURCE_H_
#define BERRYISAVEABLESSOURCE_H_
#include <berryMacros.h>
#include <org_blueberry_ui_qt_Export.h>
#include "berrySaveable.h"
namespace berry {
/**
* Represents a source of Saveable objects (units of saveability). Workbench
* parts that show more than one unit of saveability, or whose units of
* saveability change over time, should implement this interface in order to
* provide better integration with workbench facilities like the Save command,
* prompts to save on part close or shutdown, etc.
* <p>
* IMPORTANT: As of 3.2, implementers of <code>ISaveablesSource</code> must
* satisfy the following conditions:
* <ul>
* <li>If ISaveablesSource is implemented by an IWorkbenchPart:
* <ul>
* <li>the part must implement <code>ISaveablePart</code></li>
* <li>if any of its Saveable objects are dirty, the part must return
* <code>true</code> from {@link ISaveablePart#isDirty()}</li>
* <li>the part must return <code>true</code> from
* {@link ISaveablePart#isSaveOnCloseNeeded()} if it is dirty (the default
* behaviour implemented by {@link EditorPart})</li>
* <li>the part must not implement {@link ISaveablePart2}</li>
* </ul>
* </li>
* <li>If ISaveablesSource is implemented by a non-part (possible as of 3.2.1 and 3.3):
* <ul>
* <li>the Workbench's {@link ISaveablesLifecycleListener} (obtained from the
* Workbench by calling
* <code>workbench.getService(ISaveablesLifecycleListener.class)</code>) must
* be notified of any change to the result of {@link #getSaveables()} </li>
* <li>getActiveSaveables() should be implemented to return an empty array
* </li>
* </ul>
* </ul>
* If any of these conditions are not met, it is undefined whether the Workbench
* will prompt to save dirty Saveables when closing parts or the Workbench.
* </p>
* <p>
* These conditions may be relaxed in future releases.
* </p>
*
* @since 3.2
*/
struct BERRY_UI_QT ISaveablesSource : public virtual Object
{
- berryObjectMacro(berry::ISaveablesSource)
+ berryObjectMacro(berry::ISaveablesSource);
~ISaveablesSource() override;
/**
* Returns the saveables presented by the workbench part. If the return
* value of this method changes during the lifetime of
* this part (i.e. after initialization and control creation but before disposal)
* the part must notify an implicit listener using
* {@link ISaveablesLifecycleListener#handleLifecycleEvent(SaveablesLifecycleEvent)}.
* <p>
* Additions of saveables to the list of saveables of this part are
* announced using an event of type
* {@link SaveablesLifecycleEvent#POST_OPEN}. Removals are announced in a
* two-stage process, first using an event of type
* {@link SaveablesLifecycleEvent#PRE_CLOSE} followed by an event of type
* {@link SaveablesLifecycleEvent#POST_CLOSE}. Since firing the
* <code>PRE_CLOSE</code> event may trigger prompts to save dirty
* saveables, the cancellation status of the event must be checked by the
* part after the notification. When removing only non-dirty saveables,
* <code>POST_CLOSE</code> notification is sufficient.
* </p>
* <p>
* The listener is obtained from the part site by calling
* <code>partSite.getService(ISaveablesLifecycleListener.class)</code>.
* </p>
* <p>
* The part must not notify from its initialization methods (e.g. <code>init</code>
* or <code>createPartControl</code>), or from its dispose method. Parts that
* implement {@link IReusableEditor} must notify when their input is changed
* through {@link IReusableEditor#setInput(IEditorInput)}.
* </p>
*
* @return the saveables presented by the workbench part
*
* @see ISaveablesLifecycleListener
*/
virtual QList<Saveable::Pointer> GetSaveables() = 0;
/**
* Returns the saveables currently active in the workbench part.
* <p>
* Certain workbench actions, such as Save, target only the active saveables
* in the active part. For example, the active saveables could be determined
* based on the current selection in the part.
* </p>
*
* @return the saveables currently active in the workbench part
*/
virtual QList<Saveable::Pointer> GetActiveSaveables() = 0;
};
}
#endif /* BERRYISAVEABLESSOURCE_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/berryISelection.h b/Plugins/org.blueberry.ui.qt/src/berryISelection.h
index 1541c5af8d..e83eb7ea0b 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryISelection.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryISelection.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISELECTION_H_
#define BERRYISELECTION_H_
#include <berryMacros.h>
#include <berryObject.h>
#include <org_blueberry_ui_qt_Export.h>
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* Interface for a selection.
*
* @see ISelectionProvider
* @see ISelectionChangedListener
* @see SelectionChangedEvent
*
**/
struct BERRY_UI_QT ISelection : public Object
{
- berryObjectMacro(berry::ISelection)
+ berryObjectMacro(berry::ISelection);
~ISelection() override;
/**
* Returns whether this selection is empty.
*
* @return <code>true</code> if this selection is empty,
* and <code>false</code> otherwise
*/
virtual bool IsEmpty() const = 0;
};
}
#endif /*BERRYISELECTION_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryISelectionProvider.h b/Plugins/org.blueberry.ui.qt/src/berryISelectionProvider.h
index 69556ba2c7..50cf12c30e 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryISelectionProvider.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryISelectionProvider.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISELECTIONPROVIDER_H_
#define BERRYISELECTIONPROVIDER_H_
#include <berryMacros.h>
#include "berryISelectionChangedListener.h"
#include "berryISelection.h"
namespace berry
{
/**
* \ingroup org_blueberry_ui_qt
*
* Interface common to all objects that provide a selection.
*
* @see ISelection
* @see ISelectionChangedListener
* @see SelectionChangedEvent
*/
struct BERRY_UI_QT ISelectionProvider : public virtual Object
{
- berryObjectMacro(berry::ISelectionProvider)
+ berryObjectMacro(berry::ISelectionProvider);
~ISelectionProvider() override;
/**
* Adds a listener for selection changes in this selection provider.
* Has no effect if an identical listener is already registered.
*
* @param listener a selection changed listener
*/
virtual void AddSelectionChangedListener(ISelectionChangedListener* listener) = 0;
/**
* Returns the current selection for this provider.
*
* @return the current selection
*/
virtual ISelection::ConstPointer GetSelection() const = 0;
/**
* Removes the given selection change listener from this selection provider.
* Has no affect if an identical listener is not registered.
*
* @param listener a selection changed listener
*/
virtual void RemoveSelectionChangedListener(
ISelectionChangedListener* listener) = 0;
/**
* Sets the current selection for this selection provider.
*
* @param selection the new selection
*/
virtual void SetSelection(const ISelection::ConstPointer& selection) = 0;
};
}
#endif /*BERRYISELECTIONPROVIDER_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIShellProvider.h b/Plugins/org.blueberry.ui.qt/src/berryIShellProvider.h
index 422a49c408..b77aec73ea 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIShellProvider.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIShellProvider.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISHELLPROVIDER_H_
#define BERRYISHELLPROVIDER_H_
#include <org_blueberry_ui_qt_Export.h>
#include "berryShell.h"
#include <berryMacros.h>
namespace berry {
/**
* Interface for objects that can return a shell. This is normally used for
* opening child windows. An object that wants to open child shells can take
* an IShellProvider in its constructor, and the object that implements IShellProvider
* can dynamically choose where child shells should be opened.
*
* @since 3.1
*/
struct BERRY_UI_QT IShellProvider : public virtual Object
{
- berryObjectMacro(berry::IShellProvider, Object)
+ berryObjectMacro(berry::IShellProvider, Object);
~IShellProvider() override;
/**
* Returns the current shell (or null if none). This return value may
* change over time, and should not be cached.
*
* @return the current shell or null if none
*/
virtual Shell::Pointer GetShell() const = 0;
};
}
#endif /* BERRYISHELLPROVIDER_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIShowInSource.h b/Plugins/org.blueberry.ui.qt/src/berryIShowInSource.h
index 8721ba6e40..44d6adec18 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIShowInSource.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIShowInSource.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISHOWINSOURCE_H
#define BERRYISHOWINSOURCE_H
#include <berryObject.h>
namespace berry {
class ShowInContext;
/**
* Parts which need to provide a particular context to a 'Show In' target can
* provide this interface.
* <p>
* The part can either directly implement this interface, or provide it via
* <code>IAdaptable#GetAdapter<IShowInSource>()</code>.
* </p
*
* @see IShowInTarget
*/
struct IShowInSource : public virtual Object
{
- berryObjectMacro(berry::IShowInSource)
+ berryObjectMacro(berry::IShowInSource);
/**
* Returns the context to show, or <code>null</code> if there is
* currently no valid context to show.
*
* @return the context to show, or <code>null</code>
*/
virtual SmartPointer<ShowInContext> GetShowInContext() const = 0;
};
}
Q_DECLARE_INTERFACE(berry::IShowInSource, "org.blueberry.ui.IShowInSource")
#endif // BERRYISHOWINSOURCE_H
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIShowInTarget.h b/Plugins/org.blueberry.ui.qt/src/berryIShowInTarget.h
index 12c8455484..32c70e8e4c 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIShowInTarget.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIShowInTarget.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISHOWINTARGET_H
#define BERRYISHOWINTARGET_H
#include <berryObject.h>
namespace berry {
class ShowInContext;
/**
* This interface must be provided by Show In targets (views listed in the 'Show In'
* menu).
* <p>
* The view can either directly implement this interface, or provide it via
* <code>IAdaptable.getAdapter(IShowInTarget.class)</code>.
* </p>
*
* @see IPageLayout#AddShowInPart
*/
struct IShowInTarget : public virtual Object
{
- berryObjectMacro(berry::IShowInTarget)
+ berryObjectMacro(berry::IShowInTarget);
/**
* Shows the given context in this target.
* The target should check the context's selection for elements
* to show. If there are no relevant elements in the selection,
* then it should check the context's input.
*
* @param context the context to show
* @return <code>true</code> if the context could be shown,
* <code>false</code> otherwise
*/
virtual bool Show(const SmartPointer<ShowInContext>& context) = 0;
};
}
#endif // BERRYISHOWINTARGET_H
diff --git a/Plugins/org.blueberry.ui.qt/src/berryISourceProvider.h b/Plugins/org.blueberry.ui.qt/src/berryISourceProvider.h
index cd6c5f9f0b..ff1c00c971 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryISourceProvider.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryISourceProvider.h
@@ -1,102 +1,102 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISOURCEPROVIDER_H_
#define BERRYISOURCEPROVIDER_H_
#include <berryObject.h>
#include <QHash>
#include <QStringList>
#include <QObject>
namespace berry {
struct ISourceProviderListener;
/**
* <p>
* A provider of notifications for when a change has occurred to a particular
* type of source. These providers can be given to the appropriate service, and
* this service will then re-evaluate the appropriate pieces of its internal
* state in response to these changes.
* </p>
* <p>
* It is recommended that clients subclass <code>AbstractSourceProvider</code>
* instead, as this provides some common support for listeners.
* </p>
*
* @see IHandlerService
* @see ISources
*/
struct ISourceProvider : public virtual Object
{
- berryObjectMacro(berry::ISourceProvider)
+ berryObjectMacro(berry::ISourceProvider);
typedef QHash<QString, Object::ConstPointer> StateMapType;
~ISourceProvider() override;
/**
* Adds a listener to this source provider. This listener will be notified
* whenever the corresponding source changes.
*
* @param listener
* The listener to add; must not be <code>null</code>.
*/
virtual void AddSourceProviderListener(ISourceProviderListener* listener) = 0;
/**
* Returns the current state of the sources tracked by this provider. This
* is used to provide a view of the world if the event loop is busy and
* things are some state has already changed.
* <p>
* For use with core expressions, this map should contain
* IEvaluationContext#UNDEFINED_VARIABLE for properties which
* are only sometimes available.
* </p>
*
* @return A map of variable names (<code>String</code>) to variable
* values (<code>Object</code>). This may be empty, and may be
* <code>null</code>.
*/
virtual StateMapType GetCurrentState() const = 0;
/**
* Returns the names of those sources provided by this class. This is used
* by clients of source providers to determine which source providers they
* actually need.
*
* @return An array of source names. This value should never be
* <code>null</code> or empty.
*/
virtual QList<QString> GetProvidedSourceNames() const = 0;
/**
* Removes a listener from this source provider. This listener will be
* notified whenever the corresponding source changes.
*
* @param listener
* The listener to remove; must not be <code>null</code>.
*/
virtual void RemoveSourceProviderListener(ISourceProviderListener* listener) = 0;
};
}
Q_DECLARE_INTERFACE(berry::ISourceProvider, "org.blueberry.ui.ISourceProvider")
#endif /* BERRYISOURCEPROVIDER_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIStructuredSelection.h b/Plugins/org.blueberry.ui.qt/src/berryIStructuredSelection.h
index 133c34d7dc..726dfa4325 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIStructuredSelection.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIStructuredSelection.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISTRUCTUREDSELECTION_H_
#define BERRYISTRUCTUREDSELECTION_H_
#include "berryISelection.h"
#include <berryObjectList.h>
#include <org_blueberry_ui_qt_Export.h>
namespace berry
{
/**
* A selection containing elements.
*/
struct BERRY_UI_QT IStructuredSelection : public ISelection {
typedef ObjectList<Object::Pointer> ContainerType;
typedef ContainerType::const_iterator iterator;
- berryObjectMacro(berry::IStructuredSelection)
+ berryObjectMacro(berry::IStructuredSelection);
/**
* Returns the first element in this selection, or <code>null</code>
* if the selection is empty.
*
* @return an element, or <code>null</code> if none
*/
virtual Object::Pointer GetFirstElement() const = 0;
/**
* Returns an iterator to the beginning of the elements of this selection.
*
* @return an iterator over the selected elements
*/
virtual iterator Begin() const = 0;
/**
* Returns an iterator to the end of the elements of this selection.
*
* @return an iterator over the selected elements
*/
virtual iterator End() const = 0;
/**
* Returns the number of elements selected in this selection.
*
* @return the number of elements selected
*/
virtual int Size() const = 0;
/**
* Returns the elements in this selection as a vector.
*
* @return the selected elements as a vector
*/
virtual ContainerType::Pointer ToVector() const = 0;
/*
* We need to define at least the destructor in this compilation unit
* because of the export macro above. Otherwise Windows throws
* a linker error in dependent librraies. The export macro is needed
* for gcc < 4.5 to correctly mark the type_info object of this class
* as visible (we have default visibility 'hidden') so that dynamic_cast calls work.
*/
~IStructuredSelection() override;
};
}
#endif /* BERRYISTRUCTUREDSELECTION_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIViewCategory.h b/Plugins/org.blueberry.ui.qt/src/berryIViewCategory.h
index 3d590ebb03..e06f56bf18 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIViewCategory.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIViewCategory.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIVIEWCATEGORY_H_
#define BERRYIVIEWCATEGORY_H_
#include "berryIViewDescriptor.h"
#include <berryMacros.h>
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
*/
struct BERRY_UI_QT IViewCategory : public virtual Object
{
- berryObjectMacro(berry::IViewCategory)
+ berryObjectMacro(berry::IViewCategory);
virtual QString GetId() const = 0;
virtual QString GetLabel() const = 0;
virtual QStringList GetPath() const = 0;
virtual QList<IViewDescriptor::Pointer> GetViews() const = 0;
~IViewCategory() override;
};
}
#endif /*BERRYIVIEWCATEGORY_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIViewDescriptor.h b/Plugins/org.blueberry.ui.qt/src/berryIViewDescriptor.h
index fbba6562ac..8a0337dcdf 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIViewDescriptor.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIViewDescriptor.h
@@ -1,109 +1,109 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIVIEWDESCRIPTOR_H_
#define BERRYIVIEWDESCRIPTOR_H_
#include <org_blueberry_ui_qt_Export.h>
#include "berryIWorkbenchPartDescriptor.h"
#include "berryIViewPart.h"
#include <berryIConfigurationElement.h>
#include <berryIAdaptable.h>
namespace berry
{
/**
* \ingroup org_blueberry_ui_qt
*
* This is a view descriptor. It provides a "description" of a given
* given view so that the view can later be constructed.
* <p>
* The view registry provides facilities to map from an extension
* to a IViewDescriptor.
* </p>
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*
* @see org.blueberry.ui.IViewRegistry
*/
struct BERRY_UI_QT IViewDescriptor : public IWorkbenchPartDescriptor, public IAdaptable
{
- berryObjectMacro(berry::IViewDescriptor)
+ berryObjectMacro(berry::IViewDescriptor);
~IViewDescriptor() override;
/**
* Creates an instance of the view defined in the descriptor.
*
* @return the view part
* @throws CoreException thrown if there is a problem creating the part
*/
virtual IViewPart::Pointer CreateView() = 0;
/**
* Returns a list of ids belonging to keyword reference extensions.
*
* The keywords listed in each referenced id can be used to filter
* this view.
*
* @return A list of ids for keyword reference extensions.
*/
virtual QStringList GetKeywordReferences() const = 0;
/**
* Returns an array of strings that represent
* view's category path. This array will be used
* for hierarchical presentation of the
* view in places like submenus.
* @return array of category tokens or null if not specified.
*/
virtual QStringList GetCategoryPath() const = 0;
/**
* Returns the description of this view.
*
* @return the description
*/
virtual QString GetDescription() const = 0;
/**
* Returns the descriptor for the icon to show for this view.
*/
QIcon GetImageDescriptor() const override = 0;
/**
* Returns whether this view allows multiple instances.
*
* @return whether this view allows multiple instances
*/
virtual bool GetAllowMultiple() const = 0;
/**
* Returns whether this view can be restored upon workbench restart.
*
* @return whether whether this view can be restored upon workbench restart
*/
virtual bool IsRestorable() const = 0;
bool operator==(const Object*) const override = 0;
};
}
#endif /*BERRYIVIEWDESCRIPTOR_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIViewLayout.h b/Plugins/org.blueberry.ui.qt/src/berryIViewLayout.h
index 5c3174b89e..6804297e17 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIViewLayout.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIViewLayout.h
@@ -1,88 +1,88 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIVIEWLAYOUT_H_
#define BERRYIVIEWLAYOUT_H_
#include <org_blueberry_ui_qt_Export.h>
#include <berryMacros.h>
#include <berryObject.h>
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* Represents the layout info for a view or placeholder in an {@link IPageLayout}.
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IViewLayout : public Object
{
- berryObjectMacro(berry::IViewLayout)
+ berryObjectMacro(berry::IViewLayout);
~IViewLayout() override;
/**
* Returns whether the view is closeable.
* The default is <code>true</code>.
*
* @return <code>true</code> if the view is closeable, <code>false</code> if not
*/
virtual bool IsCloseable() = 0;
/**
* Sets whether the view is closeable.
*
* @param closeable <code>true</code> if the view is closeable, <code>false</code> if not
*/
virtual void SetCloseable(bool closeable) = 0;
/**
* Returns whether the view is moveable.
* The default is <code>true</code>.
*
* @return <code>true</code> if the view is moveable, <code>false</code> if not
*/
virtual bool IsMoveable() = 0;
/**
* Sets whether the view is moveable.
*
* @param moveable <code>true</code> if the view is moveable, <code>false</code> if not
*/
virtual void SetMoveable(bool moveable) = 0;
/**
* Returns whether the view is a standalone view.
*
* @see IPageLayout#addStandaloneView
*/
virtual bool IsStandalone() = 0;
/**
* Returns whether the view shows its title.
* This is only applicable to standalone views.
*
* @see IPageLayout#addStandaloneView
*/
virtual bool GetShowTitle() = 0;
};
}
#endif /*BERRYIVIEWLAYOUT_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIViewPart.h b/Plugins/org.blueberry.ui.qt/src/berryIViewPart.h
index b437d88974..d7fdf7a829 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIViewPart.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIViewPart.h
@@ -1,121 +1,121 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIVIEWPART_H_
#define BERRYIVIEWPART_H_
#include <org_blueberry_ui_qt_Export.h>
#include "berryMacros.h"
#include "berryIMemento.h"
#include "berryIWorkbenchPart.h"
#include "berryIViewSite.h"
#include <QObject>
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* A view is a visual component within a workbench page. It is typically used to
* navigate a hierarchy of information (like the workspace), open an editor, or
* display properties for the active editor. Modifications made in a view are
* saved immediately (in contrast to an editor part, which conforms to a more
* elaborate open-save-close lifecycle).
* <p>
* Only one instance of a particular view type may exist within a workbench
* page. This policy is designed to simplify part management for a user.
* </p>
* <p>
* This interface may be implemented directly. For convenience, a base
* implementation is defined in <code>ViewPart</code>.
* </p>
* <p>
* A view is added to the workbench in two steps:
* <ol>
* <li>A view extension is contributed to the workbench registry. This
* extension defines the extension id and extension class.</li>
* <li>The view is included in the default layout for a perspective.
* Alternatively, the user may open the view from the Perspective menu.</li>
* </ol>
* </p>
* <p>
* Views implement the <code>IAdaptable</code> interface; extensions are
* managed by the platform's adapter manager.
* </p>
* <p>
* As of 3.4, views may optionally adapt to {@link ISizeProvider} if they have
* a preferred size. The default presentation will make a best effort to
* allocate the preferred size to a view if it is the only part in a stack. If
* there is more than one part in the stack, the constraints will be disabled
* for that stack. The size constraints are adjusted for the size of the tab and
* border trim. Note that this is considered to be a hint to the presentation,
* and not all presentations may honor size constraints.
* </p>
*
* @see IWorkbenchPage#showView
* @see org.blueberry.ui.part.ViewPart
* @see ISizeProvider
*/
struct BERRY_UI_QT IViewPart : public virtual IWorkbenchPart
{
- berryObjectMacro(berry::IViewPart, IWorkbenchPart)
+ berryObjectMacro(berry::IViewPart, IWorkbenchPart);
~IViewPart() override;
/**
* Returns the site for this view.
* This method is equivalent to <code>(IViewSite) getSite()</code>.
* <p>
* The site can be <code>null</code> while the view is being initialized.
* After the initialization is complete, this value must be non-<code>null</code>
* for the remainder of the view's life cycle.
* </p>
*
* @return the view site; this value may be <code>null</code> if the view
* has not yet been initialized
*/
virtual IViewSite::Pointer GetViewSite() = 0;
/**
* Initializes this view with the given view site. A memento is passed to
* the view which contains a snapshot of the views state from a previous
* session. Where possible, the view should try to recreate that state
* within the part controls.
* <p>
* This method is automatically called by the workbench shortly after the part
* is instantiated. It marks the start of the views's lifecycle. Clients must
* not call this method.
* </p>
*
* @param site the view site
* @param memento the IViewPart state or null if there is no previous saved state
* @exception PartInitException if this view was not initialized successfully
*/
virtual void Init(IViewSite::Pointer site, IMemento::Pointer memento = IMemento::Pointer(nullptr)) = 0;
/**
* Saves the object state within a memento.
*
* @param memento a memento to receive the object state
*/
virtual void SaveState(IMemento::Pointer memento) = 0;
};
}
Q_DECLARE_INTERFACE(berry::IViewPart, "org.blueberry.ui.IViewPart")
#endif /*BERRYIVIEWPART_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIViewReference.h b/Plugins/org.blueberry.ui.qt/src/berryIViewReference.h
index 88447b2fe8..bf2f8fcbc7 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIViewReference.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIViewReference.h
@@ -1,56 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIVIEWREFERENCE_H_
#define BERRYIVIEWREFERENCE_H_
#include "berryIWorkbenchPartReference.h"
#include "berryIViewPart.h"
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* Defines a reference to an IViewPart.
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*/
struct BERRY_UI_QT IViewReference : virtual public IWorkbenchPartReference {
- berryObjectMacro(berry::IViewReference)
+ berryObjectMacro(berry::IViewReference);
~IViewReference() override;
/**
* Returns the secondary ID for the view.
*
* @return the secondary ID, or <code>null</code> if there is no secondary id
* @see IWorkbenchPage#showView(String, String, int)
* @since 3.0
*/
virtual QString GetSecondaryId() = 0;
/**
* Returns the <code>IViewPart</code> referenced by this object.
* Returns <code>null</code> if the view was not instantiated or
* it failed to be restored. Tries to restore the view
* if <code>restore</code> is true.
*/
virtual IViewPart::Pointer GetView(bool restore) = 0;
};
} // namespace berry
#endif /*BERRYIVIEWREFERENCE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIViewSite.h b/Plugins/org.blueberry.ui.qt/src/berryIViewSite.h
index 54b83757fc..cf77f4dd4b 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIViewSite.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIViewSite.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIVIEWSITE_H_
#define BERRYIVIEWSITE_H_
#include "berryIWorkbenchPartSite.h"
#include <string>
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* The primary interface between a view part and the workbench.
* <p>
* The workbench exposes its implemention of view part sites via this interface,
* which is not intended to be implemented or extended by clients.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IViewSite : public virtual IWorkbenchPartSite
{
- berryObjectMacro(berry::IViewSite)
+ berryObjectMacro(berry::IViewSite);
~IViewSite() override;
/**
* Returns the action bars for this part site.
* Views have exclusive use of their site's action bars.
*
* @return the action bars
*/
//IActionBars getActionBars();
/**
* Returns the secondary id for this part site's part,
* or <code>null</code> if it has none.
*
* @see IWorkbenchPage#showView(String, String, int)
*/
virtual QString GetSecondaryId() = 0;
};
}
#endif /*BERRYIVIEWSITE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIWorkbench.h b/Plugins/org.blueberry.ui.qt/src/berryIWorkbench.h
index a9c7752d6b..49c5894bc9 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIWorkbench.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIWorkbench.h
@@ -1,423 +1,423 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIWORKBENCH_H_
#define BERRYIWORKBENCH_H_
#include <berryMacros.h>
#include "services/berryIServiceLocator.h"
#include "berryIViewRegistry.h"
#include "berryIEditorRegistry.h"
#include "intro/berryIIntroManager.h"
#include "berryIPerspectiveRegistry.h"
#include "berryIWorkbenchWindow.h"
#include "berryIWorkbenchListener.h"
#include "berryIWindowListener.h"
#include "berryDisplay.h"
namespace berry {
struct IElementFactory;
struct IExtensionTracker;
struct IWorkbenchPage;
/**
* \ingroup org_blueberry_ui_qt
*
* A workbench is the root object for the BlueBerry Platform user interface.
* <p>
* A <b>workbench</b> has one or more main windows which present to the end
* user information based on some underlying model, typically on resources in an
* underlying workspace. A workbench usually starts with a single open window,
* and automatically closes when its last window closes.
* </p>
* <p>
* Each <b>workbench window</b> has a collection of <b>pages</b>; the active
* page is the one that is being presented to the end user; at most one page is
* active in a window at a time.
* </p>
* <p>
* Each workbench page has a collection of <b>workbench parts</b>, of which
* there are two kinds: views and editors. A page's parts are arranged (tiled or
* stacked) for presentation on the screen. The arrangement is not fixed; the
* user can arrange the parts as they see fit. A <b>perspective</b> is a
* template for a page, capturing a collection of parts and their arrangement.
* </p>
* <p>
* The platform creates a workbench when the workbench plug-in is activated;
* since this happens at most once during the life of the running platform,
* there is only one workbench instance. Due to its singular nature, it is
* commonly referred to as <it>the</it> workbench.
* </p>
* <p>
* The workbench supports a few {@link IServiceLocator services} by default. If
* these services are used to allocate resources, it is important to remember to
* clean up those resources after you are done with them. Otherwise, the
* resources will exist until the workbench shuts down. The supported services
* are:
* </p>
* <ul>
* <li>{@link IBindingService}</li>
* <li>{@link ICommandService}</li>
* <li>{@link IContextService}</li>
* <li>{@link IHandlerService}</li>
* </ul>
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*
* @see PlatformUI#getWorkbench
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IWorkbench : public IServiceLocator {
- berryObjectMacro(berry::IWorkbench)
+ berryObjectMacro(berry::IWorkbench);
~IWorkbench() override;
/**
* Returns the display for this workbench.
* <p>
* Code should always ask the workbench for the display rather than rely on
* {@link Display#getDefault Display.getDefault()}.
* </p>
*
* @return the display to be used for all UI interactions with this
* workbench
*/
virtual Display* GetDisplay() const = 0;
/**
* Adds a workbench listener.
*
* @param listener
* the workbench listener to add
* @since 3.2
*/
virtual void AddWorkbenchListener(IWorkbenchListener* listener) = 0;
/**
* Removes a workbench listener.
*
* @param listener
* the workbench listener to remove
* @since 3.2
*/
virtual void RemoveWorkbenchListener(IWorkbenchListener* listener) = 0;
/**
* Returns the workbench events object
*/
virtual IWorkbenchListener::Events& GetWorkbenchEvents() = 0;
/**
* Adds a window listener.
*
* @param listener
* the window listener to add
* @since 2.0
*/
virtual void AddWindowListener(IWindowListener* listener) = 0;
/**
* Removes a window listener.
*
* @param listener
* the window listener to remove
* @since 2.0
*/
virtual void RemoveWindowListener(IWindowListener* listener) = 0;
/**
* Returns the window events object
*
*/
virtual IWindowListener::Events& GetWindowEvents() = 0;
/**
* Closes this workbench and all its open windows.
* <p>
* If the workbench has an open editor with unsaved content, the user will
* be given the opportunity to save it.
* </p>
*
* @return <code>true</code> if the workbench was successfully closed, and
* <code>false</code> if it is still open
*/
virtual bool Close() = 0;
/**
* Returns the currently active window for this workbench (if any). Returns
* <code>null</code> if there is no active workbench window. Returns
* <code>null</code> if called from a non-UI thread.
*
* @return the active workbench window, or <code>null</code> if there is
* no active workbench window or if called from a non-UI thread
*/
virtual IWorkbenchWindow::Pointer GetActiveWorkbenchWindow() const = 0;
/**
* Return the extension tracker for the workbench. This tracker may be used
* by plug-ins to ensure responsiveness to changes to the plug-in registry.
* <p>
* The tracker at this level of the workbench is typically used to track
* elements that persist for the life of the workbench. For example,
* <code>IEditorDescriptor</code> objects fall into this category.
* </p>
*
* @return the extension tracker
* @see IWorkbenchWindow#GetExtensionTracker()
* @see IWorkbenchPage#GetExtensionTracker()
*/
virtual IExtensionTracker* GetExtensionTracker() const = 0;
/**
* Returns the perspective registry for the workbench.
*
* @return the workbench perspective registry
*/
virtual IPerspectiveRegistry* GetPerspectiveRegistry() const = 0;
/**
* Returns the view registry for the workbench.
*
* @return the workbench view registry
* @since 3.1
*/
virtual IViewRegistry* GetViewRegistry() const = 0;
/**
* Returns the editor registry for the workbench.
*
* @return the workbench editor registry
*/
virtual IEditorRegistry* GetEditorRegistry() const = 0;
/**
* Returns the number of open main windows associated with this workbench.
* Note that wizards and dialogs are not included in this list since they
* are not considered main windows.
*
* @return the number of open windows
* @since 3.0
*/
virtual std::size_t GetWorkbenchWindowCount() const = 0;
/**
* Returns a list of the open main windows associated with this workbench.
* Note that wizards and dialogs are not included in this list since they
* are not considered main windows.
*
* @return a list of open windows
*/
virtual QList<IWorkbenchWindow::Pointer> GetWorkbenchWindows() const = 0;
/**
* Creates and opens a new workbench window with one page. The perspective
* of the new page is defined by the specified perspective ID. The new
* window and new page become active.
* <p>
* <b>Note:</b> The caller is responsible to ensure the action using this
* method will explicitly inform the user a new window will be opened.
* Otherwise, callers are strongly recommended to use the
* <code>openPerspective</code> APIs to programmatically show a
* perspective to avoid confusing the user.
* </p>
* <p>
* In most cases where this method is used the caller is tightly coupled to
* a particular perspective. They define it in the registry and contribute
* some user interface action to open or activate it. In situations like
* this a static variable is often used to identify the perspective ID.
* </p>
*
* @param perspectiveId
* the perspective id for the window's initial page, or
* <code>null</code> for no initial page
* @param input
* the page input, or <code>null</code> if there is no current
* input. This is used to seed the input for the new page's
* views.
* @return the new workbench window
* @exception WorkbenchException
* if a new window and page could not be opened
*
* @see IWorkbench#showPerspective(String, IWorkbenchWindow, IAdaptable)
*/
virtual IWorkbenchWindow::Pointer OpenWorkbenchWindow(const QString& perspectiveId,
IAdaptable* input) = 0;
/**
* Creates and opens a new workbench window with one page. The perspective
* of the new page is defined by the default perspective ID. The new window
* and new page become active.
* <p>
* <b>Note:</b> The caller is responsible to ensure the action using this
* method will explicitly inform the user a new window will be opened.
* Otherwise, callers are strongly recommended to use the
* <code>openPerspective</code> APIs to programmatically show a
* perspective to avoid confusing the user.
* </p>
*
* @param input
* the page input, or <code>null</code> if there is no current
* input. This is used to seed the input for the new page's
* views.
* @return the new workbench window
* @exception WorkbenchException
* if a new window and page could not be opened
*
* @see IWorkbench#showPerspective(String, IWorkbenchWindow, IAdaptable)
*/
virtual IWorkbenchWindow::Pointer OpenWorkbenchWindow(IAdaptable* input) = 0;
/**
* Shows the specified perspective to the user. The caller should use this
* method when the perspective to be shown is not dependent on the page's
* input. That is, the perspective can open in any page depending on user
* preferences.
* <p>
* The perspective may be shown in the specified window, in another existing
* window, or in a new window depending on user preferences. The exact
* policy is controlled by the workbench to ensure consistency to the user.
* The policy is subject to change. The current policy is as follows:
* <ul>
* <li>If the specified window has the requested perspective open, then the
* window is given focus and the perspective is shown. The page's input is
* ignored.</li>
* <li>If another window that has the workspace root as input and the
* requested perspective open and active, then the window is given focus.
* </li>
* <li>Otherwise the requested perspective is opened and shown in the
* specified window or in a new window depending on the current user
* preference for opening perspectives, and that window is given focus.
* </li>
* </ul>
* </p>
* <p>
* The workbench also defines a number of menu items to activate or open
* each registered perspective. A complete list of these perspectives is
* available from the perspective registry found on <code>IWorkbench</code>.
* </p>
*
* @param perspectiveId
* the perspective ID to show
* @param window
* the workbench window of the action calling this method.
* @return the workbench page that the perspective was shown
* @exception WorkbenchException
* if the perspective could not be shown
*
* @since 2.0
*/
virtual SmartPointer<IWorkbenchPage> ShowPerspective(const QString& perspectiveId,
IWorkbenchWindow::Pointer window) = 0;
/**
* Shows the specified perspective to the user. The caller should use this
* method when the perspective to be shown is dependent on the page's input.
* That is, the perspective can only open in any page with the specified
* input.
* <p>
* The perspective may be shown in the specified window, in another existing
* window, or in a new window depending on user preferences. The exact
* policy is controlled by the workbench to ensure consistency to the user.
* The policy is subject to change. The current policy is as follows:
* <ul>
* <li>If the specified window has the requested perspective open and the
* same requested input, then the window is given focus and the perspective
* is shown.</li>
* <li>If another window has the requested input and the requested
* perspective open and active, then that window is given focus.</li>
* <li>If the specified window has the same requested input but not the
* requested perspective, then the window is given focus and the perspective
* is opened and shown on condition that the user preference is not to open
* perspectives in a new window.</li>
* <li>Otherwise the requested perspective is opened and shown in a new
* window, and the window is given focus.</li>
* </ul>
* </p>
* <p>
* The workbench also defines a number of menu items to activate or open
* each registered perspective. A complete list of these perspectives is
* available from the perspective registry found on <code>IWorkbench</code>.
* </p>
*
* @param perspectiveId
* the perspective ID to show
* @param window
* the workbench window of the action calling this method.
* @param input
* the page input, or <code>null</code> if there is no current
* input. This is used to seed the input for the page's views
* @return the workbench page that the perspective was shown
* @exception WorkbenchException
* if the perspective could not be shown
*
* @since 2.0
*/
virtual SmartPointer<IWorkbenchPage> ShowPerspective(const QString& perspectiveId,
IWorkbenchWindow::Pointer window, IAdaptable* input) = 0;
/**
* Save all dirty editors in the workbench. Opens a dialog to prompt the
* user if <code>confirm</code> is true. Return true if successful. Return
* false if the user has canceled the command.
*
* @param confirm <code>true</code> to ask the user before saving unsaved
* changes (recommended), and <code>false</code> to save
* unsaved changes without asking
* @return <code>true</code> if the command succeeded, and
* <code>false</code> if the operation was canceled by the user or
* an error occurred while saving
*/
virtual bool SaveAllEditors(bool confirm) = 0;
/**
* Returns the element factory with the given id. The calles takes
* ownership of the returned pointer.
*
* @param factoryId
* the id of the element factory
* @return the element factory, or <code>null</code> if none
* @see IElementFactory
*/
virtual IElementFactory* GetElementFactory(const QString& factoryId) const = 0;
/**
* Return the intro manager for this workbench.
*
* @return the intro manager for this workbench. Guaranteed not to be
* <code>null</code>.
*/
virtual IIntroManager* GetIntroManager() const = 0;
/**
* Returns a boolean indicating whether the workbench is in the process of
* closing.
*
* @return <code>true</code> if the workbench is in the process of
* closing, <code>false</code> otherwise
* @since 3.1
*/
virtual bool IsClosing() const = 0;
/**
* Applies changes of the current theme to the user interface.
*/
virtual void UpdateTheme() = 0;
};
}
#endif /*BERRYIWORKBENCH_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPage.h b/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPage.h
index 492cec14ec..41c963df35 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPage.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPage.h
@@ -1,867 +1,867 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIWORKBENCHPAGE_H_
#define BERRYIWORKBENCHPAGE_H_
#include <berryMacros.h>
#include "berryIEditorReference.h"
#include "berryIViewReference.h"
#include "berryIPerspectiveDescriptor.h"
#include "berryIEditorPart.h"
#include "berryIViewPart.h"
#include "berryIEditorInput.h"
#include "berryIPartService.h"
#include "berryISelectionService.h"
#include "berryIReusableEditor.h"
#include "berryIWorkbenchWindow.h"
/**
* \ingroup org_blueberry_ui_qt
*
*/
namespace berry {
struct IExtensionTracker;
/**
* A workbench page consists of an arrangement of views and editors intended to
* be presented together to the user in a single workbench window.
* <p>
* A page can contain 0 or more views and 0 or more editors. These views and
* editors are contained wholly within the page and are not shared with other
* pages. The layout and visible action set for the page is defined by a
* perspective.
* <p>
* The number of views and editors within a page is restricted to simplify part
* management for the user. In particular:
* <ul>
* <li>Unless a view explicitly allows for multiple instances in its plugin
* declaration there will be only one instance in a given workbench page.</li>
* <li>Only one editor can exist for each editor input within a page.
* <li>
* </ul>
* </p>
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*
* @see IPerspectiveDescriptor
* @see IEditorPart
* @see IViewPart
*/
struct BERRY_UI_QT IWorkbenchPage : public IPartService, public ISelectionService, public Object
{
- berryObjectMacro(berry::IWorkbenchPage)
+ berryObjectMacro(berry::IWorkbenchPage);
~IWorkbenchPage() override;
/**
* An optional attribute within a workspace marker (<code>IMarker</code>)
* which identifies the preferred editor type to be opened when
* <code>openEditor</code> is called.
*
* @see #openEditor(IEditorInput, String)
* @see #openEditor(IEditorInput, String, boolean)
* @deprecated in 3.0 since the notion of markers this is not generally
* applicable. Use the IDE-specific constant
* <code>IDE.EDITOR_ID_ATTR</code>.
*/
static const QString EDITOR_ID_ATTR; // = "org.blueberry.ui.editorID";
/**
* Change event id when the perspective is reset to its original state.
*
* @see IPerspectiveListener
*/
static const QString CHANGE_RESET; // = "reset";
/**
* Change event id when the perspective has completed a reset to its
* original state.
*
* @since 3.0
* @see IPerspectiveListener
*/
static const QString CHANGE_RESET_COMPLETE; // = "resetComplete";
/**
* Change event id when one or more views are shown in a perspective.
*
* @see IPerspectiveListener
*/
static const QString CHANGE_VIEW_SHOW; // = "viewShow";
/**
* Change event id when one or more views are hidden in a perspective.
*
* @see IPerspectiveListener
*/
static const QString CHANGE_VIEW_HIDE; // = "viewHide";
/**
* Change event id when one or more editors are opened in a perspective.
*
* @see IPerspectiveListener
*/
static const QString CHANGE_EDITOR_OPEN; // = "editorOpen";
/**
* Change event id when one or more editors are closed in a perspective.
*
* @see IPerspectiveListener
*/
static const QString CHANGE_EDITOR_CLOSE; // = "editorClose";
/**
* Change event id when the editor area is shown in a perspective.
*
* @see IPerspectiveListener
*/
static const QString CHANGE_EDITOR_AREA_SHOW; // = "editorAreaShow";
/**
* Change event id when the editor area is hidden in a perspective.
*
* @see IPerspectiveListener
*/
static const QString CHANGE_EDITOR_AREA_HIDE; // = "editorAreaHide";
/**
* Change event id when an action set is shown in a perspective.
*
* @see IPerspectiveListener
*/
static const QString CHANGE_ACTION_SET_SHOW; // = "actionSetShow";
/**
* Change event id when an action set is hidden in a perspective.
*
* @see IPerspectiveListener
*/
static const QString CHANGE_ACTION_SET_HIDE; // = "actionSetHide";
/**
* Show view mode that indicates the view should be made visible and
* activated. Use of this mode has the same effect as calling
* {@link #showView(String)}.
*/
static const int VIEW_ACTIVATE; // = 1;
/**
* Show view mode that indicates the view should be made visible. If the
* view is opened in the container that contains the active view then this
* has the same effect as <code>VIEW_CREATE</code>.
*/
static const int VIEW_VISIBLE; // = 2;
/**
* Show view mode that indicates the view should be made created but not
* necessarily be made visible. It will only be made visible in the event
* that it is opened in its own container. In other words, only if it is not
* stacked with another view.
*/
static const int VIEW_CREATE; // = 3;
/**
* Editor opening match mode specifying that no matching against existing
* editors should be done.
*/
static const int MATCH_NONE; // = 0;
/**
* Editor opening match mode specifying that the editor input should be
* considered when matching against existing editors.
*/
static const int MATCH_INPUT; // = 1;
/**
* Editor opening match mode specifying that the editor id should be
* considered when matching against existing editors.
*/
static const int MATCH_ID; // = 2;
/**
* Activates the given part. The part will be brought to the front and given
* focus. The part must belong to this page.
*
* @param part
* the part to activate
*/
virtual void Activate(IWorkbenchPart::Pointer part) = 0;
/**
* Adds a property change listener.
*
* @param listener
* the property change listener to add
*/
//virtual void addPropertyChangeListener(IPropertyChangeListener listener);
/**
* Moves the given part forward in the Z order of this page so as to make it
* visible, without changing which part has focus. The part must belong to
* this page.
*
* @param part
* the part to bring forward
*/
virtual void BringToTop(IWorkbenchPart::Pointer part) = 0;
/**
* Closes this workbench page. If this page is the active one, this honor is
* passed along to one of the window's other pages if possible.
* <p>
* If the page has an open editor with unsaved content, the user will be
* given the opportunity to save it.
* </p>
*
* @return <code>true</code> if the page was successfully closed, and
* <code>false</code> if it is still open
*/
virtual bool Close() = 0;
/**
* Closes all of the editors belonging to this workbench page.
* <p>
* If the page has open editors with unsaved content and <code>save</code>
* is <code>true</code>, the user will be given the opportunity to save
* them.
* </p>
*
* @param save
*
* @return <code>true</code> if all editors were successfully closed, and
* <code>false</code> if at least one is still open
*/
virtual bool CloseAllEditors(bool save) = 0;
/**
* Closes the given <code>Array</code> of editor references. The editors
* must belong to this workbench page.
* <p>
* If any of the editors have unsaved content and <code>save</code> is
* <code>true</code>, the user will be given the opportunity to save
* them.
* </p>
*
* @param editorRefs
* the editors to close
* @param save
* <code>true</code> to save the editor contents if required
* (recommended), and <code>false</code> to discard any unsaved
* changes
* @return <code>true</code> if the editors were successfully closed, and
* <code>false</code> if the editors are still open
*/
virtual bool CloseEditors(const QList<IEditorReference::Pointer>& editorRefs, bool save) = 0;
/**
* Closes the given editor. The editor must belong to this workbench page.
* <p>
* If the editor has unsaved content and <code>save</code> is
* <code>true</code>, the user will be given the opportunity to save it.
* </p>
*
* @param editor
* the editor to close
* @param save
* <code>true</code> to save the editor contents if required
* (recommended), and <code>false</code> to discard any unsaved
* changes
* @return <code>true</code> if the editor was successfully closed, and
* <code>false</code> if the editor is still open
*/
virtual bool CloseEditor(IEditorPart::Pointer editor, bool save) = 0;
/**
* Returns the view in this page with the specified id. There is at most one
* view in the page with the specified id.
*
* @param viewId
* the id of the view extension to use
* @return the view, or <code>null</code> if none is found
*/
virtual IViewPart::Pointer FindView(const QString& viewId) = 0;
/**
* Returns the view reference with the specified id.
*
* @param viewId
* the id of the view extension to use
* @return the view reference, or <code>null</code> if none is found
*/
virtual IViewReference::Pointer FindViewReference(const QString& viewId) = 0;
/**
* Returns the view reference with the specified id and secondary id.
*
* @param viewId
* the id of the view extension to use
* @param secondaryId
* the secondary id to use, or <code>null</code> for no
* secondary id
* @return the view reference, or <code>null</code> if none is found
*/
virtual IViewReference::Pointer FindViewReference(const QString& viewId, const QString& secondaryId) = 0;
/**
* Returns the active editor open in this page.
* <p>
* This is the visible editor on the page, or, if there is more than one
* visible editor, this is the one most recently brought to top.
* </p>
*
* @return the active editor, or <code>null</code> if no editor is active
*/
virtual IEditorPart::Pointer GetActiveEditor() = 0;
/**
* Returns the editor with the specified input. Returns null if there is no
* opened editor with that input.
*
* @param input
* the editor input
* @return an editor with input equals to <code>input</code>
*/
virtual IEditorPart::Pointer FindEditor(IEditorInput::Pointer input) = 0;
/**
* Returns an array of editor references that match the given input and/or
* editor id, as specified by the given match flags. Returns an empty array
* if there are no matching editors, or if matchFlags is MATCH_NONE.
*
* @param input
* the editor input, or <code>null</code> if MATCH_INPUT is not
* specified in matchFlags
* @param editorId
* the editor id, or <code>null</code> if MATCH_ID is not
* specified in matchFlags
* @param matchFlags
* a bit mask consisting of zero or more of the MATCH_* constants
* OR-ed together
* @return the references for the matching editors
*
* @see #MATCH_NONE
* @see #MATCH_INPUT
* @see #MATCH_ID
*/
virtual QList<IEditorReference::Pointer> FindEditors(IEditorInput::Pointer input, const QString& editorId,
int matchFlags) = 0;
/**
* Returns a list of the editors open in this page.
* <p>
* Note that each page has its own editors; editors are never shared between
* pages.
* </p>
*
* @return a list of open editors
*
* @deprecated use #getEditorReferences() instead
*/
virtual QList<IEditorPart::Pointer> GetEditors() = 0;
/**
* Returns an array of references to open editors in this page.
* <p>
* Note that each page has its own editors; editors are never shared between
* pages.
* </p>
*
* @return a list of open editors
*/
virtual QList<IEditorReference::Pointer> GetEditorReferences() = 0;
/**
* Returns a list of dirty editors in this page.
*
* @return a list of dirty editors
*/
virtual QList<IEditorPart::Pointer> GetDirtyEditors() = 0;
/**
* Returns the input for this page.
*
* @return the input for this page, or <code>null</code> if none
*/
virtual IAdaptable* GetInput() = 0;
/**
* Returns the page label. This will be a unique identifier within the
* containing workbench window.
*
* @return the page label
*/
virtual QString GetLabel() = 0;
/**
* Returns the current perspective descriptor for this page, or
* <code>null</code> if there is no current perspective.
*
* @return the current perspective descriptor or <code>null</code>
* @see #setPerspective
* @see #savePerspective
*/
virtual IPerspectiveDescriptor::Pointer GetPerspective() = 0;
/**
* Returns a list of the reference to views visible on this page.
* <p>
* Note that each page has its own views; views are never shared between
* pages.
* </p>
*
* @return a list of references to visible views
*/
virtual QList<IViewReference::Pointer> GetViewReferences() = 0;
/**
* Returns a list of the views visible on this page.
* <p>
* Note that each page has its own views; views are never shared between
* pages.
* </p>
*
* @return a list of visible views
*
* @deprecated use #getViewReferences() instead.
*/
virtual QList<IViewPart::Pointer> GetViews() = 0;
/**
* Returns the workbench window of this page.
*
* @return the workbench window
*/
virtual IWorkbenchWindow::Pointer GetWorkbenchWindow() const = 0;
/**
* Hides the given view. The view must belong to this page.
*
* @param view
* the view to hide
*/
virtual void HideView(IViewPart::Pointer view) = 0;
/**
* Hides the given view that belongs to the reference, if any.
*
* @param view
* the references whos view is to be hidden
*/
virtual void HideView(IViewReference::Pointer view) = 0;
/**
* Returns true if perspective with given id contains view with given id
*/
//virtual bool HasView(const QString& perspectiveId, const QString& viewId) = 0;
/**
* Returns whether the specified part is visible.
*
* @param part
* the part to test
* @return boolean <code>true</code> if part is visible
*/
virtual bool IsPartVisible(IWorkbenchPart::Pointer part) = 0;
/**
* Removes the perspective specified by desc.
*
* @param desc
* the perspective that will be removed
*/
//virtual void RemovePerspective(IPerspectiveDescriptor::Pointer desc) = 0;
/**
* Reuses the specified editor by setting its new input.
*
* @param editor
* the editor to be reused
* @param input
* the new input for the reusable editor
*/
virtual void ReuseEditor(IReusableEditor::Pointer editor, IEditorInput::Pointer input) = 0;
/**
* Opens an editor on the given input.
* <p>
* If this page already has an editor open on the target input that editor
* is activated; otherwise, a new editor is opened. Two editor inputs,
* input1 and input2, are considered the same if
*
* <pre>
* input1.equals(input2) == true
* </pre>.
* </p>
* <p>
* The editor type is determined by mapping <code>editorId</code> to an
* editor extension registered with the workbench. An editor id is passed
* rather than an editor object to prevent the accidental creation of more
* than one editor for the same input. It also guarantees a consistent
* lifecycle for editors, regardless of whether they are created by the user
* or restored from saved data.
* </p>
*
* @param input
* the editor input
* @param editorId
* the id of the editor extension to use
* @return an open and active editor, or <code>null</code> if an external
* editor was opened
* @exception PartInitException
* if the editor could not be created or initialized
*/
virtual IEditorPart::Pointer OpenEditor(IEditorInput::Pointer input, const QString& editorId) = 0;
/**
* Opens an editor on the given input.
* <p>
* If this page already has an editor open on the target input that editor
* is brought to the front; otherwise, a new editor is opened. Two editor
* inputs are considered the same if they equal. See
* <code>Object.equals(Object)<code>
* and <code>IEditorInput</code>. If <code>activate == true</code> the editor
* will be activated.
* </p><p>
* The editor type is determined by mapping <code>editorId</code> to an editor
* extension registered with the workbench. An editor id is passed rather than
* an editor object to prevent the accidental creation of more than one editor
* for the same input. It also guarantees a consistent lifecycle for editors,
* regardless of whether they are created by the user or restored from saved
* data.
* </p>
*
* @param input the editor input
* @param editorId the id of the editor extension to use
* @param activate if <code>true</code> the editor will be activated
* @return an open editor, or <code>null</code> if an external editor was opened
* @exception PartInitException if the editor could not be created or initialized
*/
virtual IEditorPart::Pointer OpenEditor(IEditorInput::Pointer input, const QString& editorId,
bool activate) = 0;
/**
* Opens an editor on the given input.
* <p>
* If this page already has an editor open that matches the given input
* and/or editor id (as specified by the matchFlags argument), that editor
* is brought to the front; otherwise, a new editor is opened. Two editor
* inputs are considered the same if they equal. See
* <code>Object.equals(Object)<code>
* and <code>IEditorInput</code>. If <code>activate == true</code> the editor
* will be activated.
* </p><p>
* The editor type is determined by mapping <code>editorId</code> to an editor
* extension registered with the workbench. An editor id is passed rather than
* an editor object to prevent the accidental creation of more than one editor
* for the same input. It also guarantees a consistent lifecycle for editors,
* regardless of whether they are created by the user or restored from saved
* data.
* </p>
*
* @param input the editor input
* @param editorId the id of the editor extension to use
* @param activate if <code>true</code> the editor will be activated
* @param matchFlags a bit mask consisting of zero or more of the MATCH_* constants OR-ed together
* @return an open editor, or <code>null</code> if an external editor was opened
* @exception PartInitException if the editor could not be created or initialized
*
* @see #MATCH_NONE
* @see #MATCH_INPUT
* @see #MATCH_ID
*/
virtual IEditorPart::Pointer OpenEditor(IEditorInput::Pointer input,
const QString& editorId, bool activate, int matchFlags) = 0;
/**
* Removes the property change listener.
*
* @param listener
* the property change listener to remove
*/
//virtual void removePropertyChangeListener(IPropertyChangeListener listener);
/**
* Changes the visible views, their layout, and the visible action sets
* within the page to match the current perspective descriptor. This is a
* rearrangement of components and not a replacement. The contents of the
* current perspective descriptor are unaffected.
* <p>
* For more information on perspective change see
* <code>setPerspective()</code>.
* </p>
*/
virtual void ResetPerspective() = 0;
/**
* Saves the contents of all dirty editors belonging to this workbench page.
* If there are no dirty editors this method returns without effect.
* <p>
* If <code>confirm</code> is <code>true</code> the user is prompted to
* confirm the command.
* </p>
* <p>
* Note that as of 3.2, this method also saves views that implement
* ISaveablePart and are dirty.
* </p>
*
* @param confirm <code>true</code> to ask the user before saving unsaved
* changes (recommended), and <code>false</code> to save
* unsaved changes without asking
* @return <code>true</code> if the command succeeded, and
* <code>false</code> if the operation was canceled by the user or
* an error occurred while saving
*/
virtual bool SaveAllEditors(bool confirm) = 0;
/**
* Saves the contents of the given editor if dirty. If not, this method
* returns without effect.
* <p>
* If <code>confirm</code> is <code>true</code> the user is prompted to
* confirm the command. Otherwise, the save happens without prompt.
* </p>
* <p>
* The editor must belong to this workbench page.
* </p>
*
* @param editor
* the editor to close
* @param confirm
* <code>true</code> to ask the user before saving unsaved
* changes (recommended), and <code>false</code> to save
* unsaved changes without asking
* @return <code>true</code> if the command succeeded, and
* <code>false</code> if the editor was not saved
*/
virtual bool SaveEditor(IEditorPart::Pointer editor, bool confirm) = 0;
/**
* Saves the visible views, their layout, and the visible action sets for
* this page to the current perspective descriptor. The contents of the
* current perspective descriptor are overwritten.
*/
virtual void SavePerspective() = 0;
/**
* Saves the visible views, their layout, and the visible action sets for
* this page to the given perspective descriptor. The contents of the given
* perspective descriptor are overwritten and it is made the current one for
* this page.
*
* @param perspective
* the perspective descriptor to save to
*/
virtual void SavePerspectiveAs(IPerspectiveDescriptor::Pointer perspective) = 0;
/**
* Changes the visible views, their layout, and the visible action sets
* within the page to match the given perspective descriptor. This is a
* rearrangement of components and not a replacement. The contents of the
* old perspective descriptor are unaffected.
* <p>
* When a perspective change occurs the old perspective is deactivated
* (hidden) and cached for future reference. Then the new perspective is
* activated (shown). The views within the page are shared by all existing
* perspectives to make it easy for the user to switch between one
* perspective and another quickly without loss of context.
* </p>
* <p>
* During activation the action sets are modified. If an action set is
* specified in the new perspective which is not visible in the old one it
* will be created. If an old action set is not specified in the new
* perspective it will be disposed.
* </p>
* <p>
* The visible views and their layout within the page also change. If a view
* is specified in the new perspective which is not visible in the old one a
* new instance of the view will be created. If an old view is not specified
* in the new perspective it will be hidden. This view may reappear if the
* user selects it from the View menu or if they switch to a perspective
* (which may be the old one) where the view is visible.
* </p>
* <p>
* The open editors are not modified by this method.
* </p>
*
* @param perspective
* the perspective descriptor
*/
virtual void SetPerspective(IPerspectiveDescriptor::Pointer perspective) = 0;
/**
* Shows the view identified by the given view id in this page and gives it
* focus. If there is a view identified by the given view id (and with no
* secondary id) already open in this page, it is given focus.
*
* @param viewId
* the id of the view extension to use
* @return the shown view
* @exception PartInitException
* if the view could not be initialized
*/
virtual IViewPart::Pointer ShowView(const QString& viewId) = 0;
/**
* Shows a view in this page with the given id and secondary id. The
* behaviour of this method varies based on the supplied mode. If
* <code>VIEW_ACTIVATE</code> is supplied, the view is focus. If
* <code>VIEW_VISIBLE</code> is supplied, then it is made visible but not
* given focus. Finally, if <code>VIEW_CREATE</code> is supplied the view
* is created and will only be made visible if it is not created in a folder
* that already contains visible views.
* <p>
* This allows multiple instances of a particular view to be created. They
* are disambiguated using the secondary id. If a secondary id is given, the
* view must allow multiple instances by having specified
* allowMultiple="true" in its extension.
* </p>
*
* @param viewId
* the id of the view extension to use
* @param secondaryId
* the secondary id to use, or <code>null</code> for no
* secondary id
* @param mode
* the activation mode. Must be {@link #VIEW_ACTIVATE},
* {@link #VIEW_VISIBLE} or {@link #VIEW_CREATE}
* @return a view
* @exception PartInitException
* if the view could not be initialized
* @exception IllegalArgumentException
* if the supplied mode is not valid
*/
virtual IViewPart::Pointer ShowView(const QString& viewId, const QString& secondaryId, int mode) = 0;
/**
* Returns <code>true</code> if the editor is pinned and should not be
* reused.
*
* @param editor
* the editor to test
* @return boolean whether the editor is pinned
*/
virtual bool IsEditorPinned(IEditorPart::Pointer editor) = 0;
/**
* Returns the perspective shortcuts associated with the current
* perspective. Returns an empty array if there is no current perspective.
*
* @see IPageLayout#addPerspectiveShortcut(String)
* @return an array of perspective identifiers
*/
virtual QList<QString> GetPerspectiveShortcuts() = 0;
/**
* Returns the show view shortcuts associated with the current perspective.
* Returns an empty array if there is no current perspective.
*
* @see IPageLayout#addShowViewShortcut(String)
* @return an array of view identifiers
*/
virtual QList<QString> GetShowViewShortcuts() = 0;
/**
* Returns the descriptors for the perspectives that are open in this page,
* in the order in which they were opened.
*
* @return the open perspective descriptors, in order of opening
*/
virtual QList<IPerspectiveDescriptor::Pointer> GetOpenPerspectives() = 0;
/**
* Returns the descriptors for the perspectives that are open in this page,
* in the order in which they were activated (oldest first).
*
* @return the open perspective descriptors, in order of activation
*/
virtual QList<IPerspectiveDescriptor::Pointer> GetSortedPerspectives() = 0;
/**
* Closes current perspective. If last perspective, then entire page
* is closed.
*
* @param saveParts
* whether the page's parts should be saved if closed
* @param closePage
* whether the page itself should be closed if last perspective
*/
//virtual void CloseCurrentPerspective(bool saveParts, bool closePage) = 0;
/**
* Closes the specified perspective in this page. If the last perspective in
* this page is closed, then all editors are closed. Views that are not
* shown in other perspectives are closed as well. If <code>saveParts</code>
* is <code>true</code>, the user will be prompted to save any unsaved
* changes for parts that are being closed. The page itself is closed if
* <code>closePage</code> is <code>true</code>.
*
* @param desc
* the descriptor of the perspective to be closed
* @param saveParts
* whether the page's parts should be saved if closed
* @param closePage
* whether the page itself should be closed if last perspective
*/
virtual void ClosePerspective(IPerspectiveDescriptor::Pointer desc,
bool saveParts, bool closePage) = 0;
/**
* Closes all perspectives in this page. All editors are closed, prompting
* to save any unsaved changes if <code>saveEditors</code> is
* <code>true</code>. The page itself is closed if <code>closePage</code>
* is <code>true</code>.
*
* @param saveEditors
* whether the page's editors should be saved
* @param closePage
* whether the page itself should be closed
*/
virtual void CloseAllPerspectives(bool saveEditors, bool closePage) = 0;
/**
* Return the extension tracker for the workbench. This tracker may be used
* by plug-ins to ensure responsiveness to changes to the plug-in registry.
* <p>
* The tracker at this level of the workbench is typically used to track
* elements that only exist over the lifespan of a page. For example,
* <code>ViewPart</code> objects fall into this category.
* </p>
*
* @return the extension tracker
* @see IWorkbench#GetExtensionTracker()
* @see IWorkbenchWindow#GetExtensionTracker()
*/
virtual IExtensionTracker* GetExtensionTracker() const = 0;
/**
* Find the part reference for the given part. A convenience method to
* quickly go from part to part reference.
*
* @param part
* The part to search for. It can be <code>null</code>.
* @return The reference for the given part, or <code>null</code> if no
* reference can be found.
*/
virtual IWorkbenchPartReference::Pointer GetReference(IWorkbenchPart::Pointer part) = 0;
};
} // namespace berry
#endif /*BERRYIWORKBENCHPAGE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPart.h b/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPart.h
index 135a110331..9ddce93635 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPart.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPart.h
@@ -1,266 +1,266 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef IWORKBENCHPART_H_
#define IWORKBENCHPART_H_
#include <org_blueberry_ui_qt_Export.h>
#include "berryIPropertyChangeListener.h"
#include <berryMacros.h>
namespace berry {
struct IWorkbenchPartSite;
/**
* \ingroup org_blueberry_ui_qt
*
* A workbench part is a visual component within a workbench page. There
* are two subtypes: view and editor, as defined by <code>IViewPart</code> and
* <code>IEditorPart</code>.
* <p>
* A view is typically used to navigate a hierarchy of information (like the
* workspace), open an editor, or display properties for the active editor.
* Modifications made in a view are saved immediately.
* </p><p>
* An editor is typically used to edit or browse a document or input object.
* The input is identified using an <code>IEditorInput</code>. Modifications made
* in an editor part follow an open-save-close lifecycle model.
* </p><p>
* This interface may be implemented directly. For convenience, a base
* implementation is defined in <code>WorkbenchPart</code>.
* </p><p>
* The lifecycle of a workbench part is as follows:
* <ul>
* <li>When a part extension is created:
* <ul>
* <li>instantiate the part</li>
* <li>create a part site</li>
* <li>call <code>part.init(site)</code></li>
* </ul>
* <li>When a part becomes visible in the workbench:
* <ul>
* <li>add part to presentation by calling
* <code>part.createControl(parent)</code> to create actual widgets</li>
* <li>fire <code>partOpened</code> event to all listeners</li>
* </ul>
* </li>
* <li>When a part is activated or gets focus:
* <ul>
* <li>call <code>part.setFocus()</code></li>
* <li>fire <code>partActivated</code> event to all listeners</li>
* </ul>
* </li>
* <li>When a part is closed:
* <ul>
* <li>if save is needed, do save; if it fails or is canceled return</li>
* <li>if part is active, deactivate part</li>
* <li>fire <code>partClosed</code> event to all listeners</li>
* <li>remove part from presentation; part controls are disposed as part
* of the SWT widget tree
* <li>call <code>part.dispose()</code></li>
* </ul>
* </li>
* </ul>
* </p>
* <p>
* After <code>createPartControl</code> has been called, the implementor may
* safely reference the controls created. When the part is closed
* these controls will be disposed as part of an SWT composite. This
* occurs before the <code>IWorkbenchPart.dispose</code> method is called.
* If there is a need to free SWT resources the part should define a dispose
* listener for its own control and free those resources from the dispose
* listener. If the part invokes any method on the disposed SWT controls
* after this point an <code>SWTError</code> will be thrown.
* </p>
* <p>
* The last method called on <code>IWorkbenchPart</code> is <code>dispose</code>.
* This signals the end of the part lifecycle.
* </p>
* <p>
* An important point to note about this lifecycle is that following
* a call to init, createControl may never be called. Thus in the dispose
* method, implementors must not assume controls were created.
* </p>
* <p>
* Workbench parts implement the <code>IAdaptable</code> interface; extensions
* are managed by the platform's adapter manager.
* </p>
*
* @see IViewPart
* @see IEditorPart
*/
struct BERRY_UI_QT IWorkbenchPart : public virtual Object { // public IAdaptable {
- berryObjectMacro(berry::IWorkbenchPart, Object)
+ berryObjectMacro(berry::IWorkbenchPart, Object);
~IWorkbenchPart() override;
/**
* The property id for <code>getTitle</code>, <code>getTitleImage</code>
* and <code>getTitleToolTip</code>.
*/
//static const int PROP_TITLE = IWorkbenchPartConstants.PROP_TITLE;
/**
* Adds a listener for changes to properties of this workbench part.
* Has no effect if an identical listener is already registered.
* <p>
* The property ids are defined in {@link IWorkbenchPartConstants}.
* </p>
*
* @param listener a property listener
*/
virtual void AddPropertyListener(IPropertyChangeListener* listener) = 0;
/**
* Creates the controls for this workbench part.
* <p>
* Clients should not call this method (the workbench calls this method when
* it needs to, which may be never).
* </p>
* <p>
* For implementors this is a multi-step process:
* <ol>
* <li>Create one or more controls within the parent.</li>
* <li>Set the parent layout as needed.</li>
* <li>Register any global actions with the site's <code>IActionBars</code>.</li>
* <li>Register any context menus with the site.</li>
* <li>Register a selection provider with the site, to make it available to
* the workbench's <code>ISelectionService</code> (optional). </li>
* </ol>
* </p>
*
* @param parent the parent control
*/
virtual void CreatePartControl(QWidget* parent) = 0;
/**
* Returns the site for this workbench part. The site can be
* <code>null</code> while the workbench part is being initialized. After
* the initialization is complete, this value must be non-<code>null</code>
* for the remainder of the part's life cycle.
*
* @return The part site; this value may be <code>null</code> if the part
* has not yet been initialized
*/
virtual SmartPointer<IWorkbenchPartSite> GetSite() const = 0;
/**
* Returns the name of this part. If this value changes the part must fire a
* property listener event with {@link IWorkbenchPartConstants#PROP_PART_NAME}.
*
* @return the name of this view, or the empty string if the name is being managed
* by the workbench (not <code>null</code>)
*/
virtual QString GetPartName() const = 0;
/**
* Returns the content description of this part. The content description is an optional
* user-readable string that describes what is currently being displayed in the part.
* By default, the workbench will display the content description in a line
* near the top of the view or editor.
* An empty string indicates no content description
* text. If this value changes the part must fire a property listener event
* with {@link IWorkbenchPartConstants#PROP_CONTENT_DESCRIPTION}.
*
* @return the content description of this part (not <code>null</code>)
*/
virtual QString GetContentDescription() const = 0;
/**
* Returns the title image of this workbench part. If this value changes
* the part must fire a property listener event with
* <code>PROP_TITLE</code>.
* <p>
* The title image is usually used to populate the title bar of this part's
* visual container. Since this image is managed by the part itself, callers
* must <b>not</b> dispose the returned image.
* </p>
*
* @return the title image
*/
virtual QIcon GetTitleImage() const = 0;
/**
* Returns the title tool tip text of this workbench part.
* An empty string result indicates no tool tip.
* If this value changes the part must fire a property listener event with
* <code>PROP_TITLE</code>.
* <p>
* The tool tip text is used to populate the title bar of this part's
* visual container.
* </p>
*
* @return the workbench part title tool tip (not <code>null</code>)
*/
virtual QString GetTitleToolTip() const = 0;
/**
* Removes the given property listener from this workbench part.
* Has no affect if an identical listener is not registered.
*
* @param listener a property listener
*/
virtual void RemovePropertyListener(IPropertyChangeListener* listener) = 0;
/**
* Return the value for the arbitrary property key, or <code>null</code>.
*
* @param key
* the arbitrary property. Must not be <code>null</code>.
* @return the property value, or <code>null</code>.
*/
virtual QString GetPartProperty(const QString& key) const = 0;
/**
* Set an arbitrary property on the part. It is the implementor's
* responsibility to fire the corresponding PropertyChangeEvent.
* <p>
* A default implementation has been added to WorkbenchPart.
* </p>
*
* @param key
* the arbitrary property. Must not be <code>null</code>.
* @param value
* the property value. A <code>null</code> value will remove
* that property.
*/
virtual void SetPartProperty(const QString& key, const QString& value) = 0;
/**
* Return an unmodifiable map of the arbitrary properties. This method can
* be used to save the properties during workbench save/restore.
*
* @return A Map of the properties. Must not be <code>null</code>.
*/
virtual const QHash<QString, QString>& GetPartProperties() const = 0;
/**
* Asks this part to take focus within the workbench.
* <p>
* Clients should not call this method (the workbench calls this method at
* appropriate times). To have the workbench activate a part, use
* <code>IWorkbenchPage.activate(IWorkbenchPart) instead</code>.
* </p>
*/
virtual void SetFocus() = 0;
};
} // namespace berry
#endif /*IWORKBENCHPART_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPartDescriptor.h b/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPartDescriptor.h
index 02db2c3c4e..b2c5a07076 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPartDescriptor.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPartDescriptor.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIWORKBENCHPARTDESCRIPTOR_H_
#define BERRYIWORKBENCHPARTDESCRIPTOR_H_
#include <org_blueberry_ui_qt_Export.h>
#include <berryMacros.h>
#include <berryObject.h>
namespace berry
{
/**
* \ingroup org_blueberry_ui_qt
*
* Description of a workbench part. The part descriptor contains
* the information needed to create part instances.
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*/
struct BERRY_UI_QT IWorkbenchPartDescriptor : public virtual Object
{
- berryObjectMacro(berry::IWorkbenchPartDescriptor)
+ berryObjectMacro(berry::IWorkbenchPartDescriptor);
/**
* Returns the part id.
*
* @return the id of the part
*/
virtual QString GetId() const = 0;
/**
* Returns the descriptor of the image for this part.
*
* @return the descriptor of the image to display next to this part
*/
virtual QIcon GetImageDescriptor() const = 0;
/**
* Returns the label to show for this part.
*
* @return the part label
*/
virtual QString GetLabel() const = 0;
~IWorkbenchPartDescriptor() override;
};
} // namespace berry
#endif /*BERRYIWORKBENCHPARTDESCRIPTOR_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPartReference.h b/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPartReference.h
index 3b5ff65a54..cc5c390f3b 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPartReference.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPartReference.h
@@ -1,138 +1,138 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIWORKBENCHPARTREFERENCE_H_
#define BERRYIWORKBENCHPARTREFERENCE_H_
#include <berryMacros.h>
#include <org_blueberry_ui_qt_Export.h>
#include "berryIPropertyChangeListener.h"
namespace berry {
struct IWorkbenchPart;
struct IWorkbenchPage;
/**
* \ingroup org_blueberry_ui_qt
*
* Implements a reference to a IWorkbenchPart.
* The IWorkbenchPart will not be instanciated until the part
* becomes visible or the API getPart is sent with true;
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*/
struct BERRY_UI_QT IWorkbenchPartReference : public Object
{
- berryObjectMacro(berry::IWorkbenchPartReference)
+ berryObjectMacro(berry::IWorkbenchPartReference);
~IWorkbenchPartReference() override;
/**
* Returns the IWorkbenchPart referenced by this object.
* Returns <code>null</code> if the editors was not instantiated or
* it failed to be restored. Tries to restore the editor
* if <code>restore</code> is true.
*/
virtual SmartPointer<IWorkbenchPart> GetPart(bool restore) = 0;
/**
* @see IWorkbenchPart#getTitleImage
*/
virtual QIcon GetTitleImage() const = 0;
/**
* @see IWorkbenchPart#getTitleToolTip
*/
virtual QString GetTitleToolTip() const = 0;
/**
* @see IWorkbenchPartSite#getId
*/
virtual QString GetId() const = 0;
/**
* @see IWorkbenchPart#addPropertyListener
*/
virtual void AddPropertyListener(IPropertyChangeListener* listener) = 0;
/**
* @see IWorkbenchPart#removePropertyListener
*/
virtual void RemovePropertyListener(IPropertyChangeListener* listener) = 0;
/**
* Returns the workbench page that contains this part
*/
virtual SmartPointer<IWorkbenchPage> GetPage() const = 0;
/**
* Returns the name of the part, as it should be shown in tabs.
*
* @return the part name
*/
virtual QString GetPartName() const = 0;
/**
* Returns the content description for the part (or the empty string if none)
*
* @return the content description for the part
*/
virtual QString GetContentDescription() const = 0;
/**
* Returns true if the part is pinned otherwise returns false.
*/
virtual bool IsPinned() const = 0;
/**
* Returns whether the part is dirty (i.e. has unsaved changes).
*
* @return <code>true</code> if the part is dirty, <code>false</code> otherwise
*/
virtual bool IsDirty() const = 0;
/**
* Return an arbitrary property from the reference. If the part has been
* instantiated, it just delegates to the part. If not, then it looks in its
* own cache of properties. If the property is not available or the part has
* never been instantiated, it can return <code>null</code>.
*
* @param key
* The property to return. Must not be <code>null</code>.
* @return The String property, or <code>null</code>.
*/
virtual QString GetPartProperty(const QString& key) const = 0;
/**
* Add a listener for changes in the arbitrary properties set.
*
* @param listener
* Must not be <code>null</code>.
*/
//virtual void addPartPropertyListener(IPropertyChangeListener listener) = 0;
/**
* Remove a listener for changes in the arbitrary properties set.
*
* @param listener
* Must not be <code>null</code>.
*/
//virtual void removePartPropertyListener(IPropertyChangeListener listener) = 0;
};
} // namespace berry
#endif /*BERRYIWORKBENCHPARTREFERENCE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPartSite.h b/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPartSite.h
index e12646c966..df80570418 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPartSite.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPartSite.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef IWORKBENCHPARTSITE_H_
#define IWORKBENCHPARTSITE_H_
#include "berryIWorkbenchSite.h"
namespace berry {
struct IWorkbenchPart;
/**
* \ingroup org_blueberry_ui_qt
*
* The primary interface between a workbench part and the workbench.
* <p>
* This interface is not intended to be implemented or extended by clients.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IWorkbenchPartSite : public IWorkbenchSite
{
- berryObjectMacro(berry::IWorkbenchPartSite, IWorkbenchSite)
+ berryObjectMacro(berry::IWorkbenchPartSite, IWorkbenchSite);
~IWorkbenchPartSite() override;
/**
* Returns the part registry extension id for this workbench site's part.
* <p>
* The name comes from the <code>id</code> attribute in the configuration
* element.
* </p>
*
* @return the registry extension id
*/
virtual QString GetId() const = 0;
/**
* Returns the part associated with this site
*
* @return the part associated with this site
*/
virtual SmartPointer<IWorkbenchPart> GetPart() = 0;
/**
* Returns the unique identifier of the plug-in that defines this workbench
* site's part.
*
* @return the unique identifier of the declaring plug-in
*/
virtual QString GetPluginId() const = 0;
/**
* Returns the registered name for this workbench site's part.
* <p>
* The name comes from the <code>name</code> attribute in the configuration
* element.
* </p>
*
* @return the part name
*/
virtual QString GetRegisteredName() const = 0;
};
} // namespace berry
#endif /*IWORKBENCHPARTSITE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchSite.h b/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchSite.h
index 89cd93d328..352a53790f 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchSite.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchSite.h
@@ -1,105 +1,105 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIWORKBENCHSITE_H_
#define BERRYIWORKBENCHSITE_H_
#include <berryMacros.h>
#include <org_blueberry_ui_qt_Export.h>
#include "services/berryIServiceLocator.h"
namespace berry {
struct IWorkbenchPage;
struct ISelectionProvider;
struct IWorkbenchWindow;
class Shell;
/**
* \ingroup org_blueberry_ui_qt
*
* The common interface between the workbench and its parts, including pages
* within parts.
* <p>
* The workbench site supports a few {@link IServiceLocator services} by
* default. If these services are used to allocate resources, it is important to
* remember to clean up those resources after you are done with them. Otherwise,
* the resources will exist until the workbench site is disposed. The supported
* services are:
* </p>
* <ul>
* <li>{@link ICommandService}</li>
* <li>{@link IContextService}</li>
* <li>{@link IHandlerService}</li>
* <li>{@link IBindingService}. Resources allocated through this service will
* not be cleaned up until the workbench shuts down.</li>
* </ul>
* <p>
* This interface is not intended to be implemented or extended by clients.
* </p>
*
* @see org.blueberry.ui.IWorkbenchPartSite
* @see org.blueberry.ui.part.IPageSite
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IWorkbenchSite : public IServiceLocator { // IAdaptable, IShellProvider {
- berryObjectMacro(berry::IWorkbenchSite, IServiceLocator)
+ berryObjectMacro(berry::IWorkbenchSite, IServiceLocator);
~IWorkbenchSite() override;
/**
* Returns the page containing this workbench site.
*
* @return the page containing this workbench site
*/
virtual SmartPointer<IWorkbenchPage> GetPage() = 0;
/**
* Returns the selection provider for this workbench site.
*
* @return the selection provider, or <code>null</code> if none
*/
virtual SmartPointer<ISelectionProvider> GetSelectionProvider() = 0;
/**
* Returns the shell for this workbench site. Not intended to be called from
* outside the UI thread. Clients should call IWorkbench.getDisplay() to
* gain access to the display rather than calling getShell().getDisplay().
*
* @return the shell for this workbench site
*/
virtual SmartPointer<Shell> GetShell() = 0;
/**
* Returns the workbench window containing this workbench site.
*
* @return the workbench window containing this workbench site
*/
virtual SmartPointer<IWorkbenchWindow> GetWorkbenchWindow() = 0;
/**
* Sets the selection provider for this workbench site.
*
* @param provider
* the selection provider, or <code>null</code> to clear it
*/
virtual void SetSelectionProvider(SmartPointer<ISelectionProvider> provider) = 0;
};
}
#endif /*BERRYIWORKBENCHSITE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchWindow.h b/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchWindow.h
index cb363ace3c..71e0e1c5f0 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchWindow.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchWindow.h
@@ -1,218 +1,218 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIWORKBENCHWINDOW_H_
#define BERRYIWORKBENCHWINDOW_H_
#include <berryMacros.h>
#include <berryIAdaptable.h>
#include <org_blueberry_ui_qt_Export.h>
#include "berryIPageService.h"
#include "berryShell.h"
#include "services/berryIServiceLocator.h"
namespace berry {
struct IPartService;
struct ISelectionService;
struct IWorkbenchPage;
struct IWorkbench;
/**
* \ingroup org_blueberry_ui_qt
*
* A workbench window is a top level window in a workbench. Visually, a
* workbench window has a menubar, a toolbar, a status bar, and a main area for
* displaying a single page consisting of a collection of views and editors.
* <p>
* Each workbench window has a collection of 0 or more pages; the active page is
* the one that is being presented to the end user; at most one page is active
* in a window at a time.
* </p>
* <p>
* The workbench window supports a few {@link IServiceLocator services} by
* default. If these services are used to allocate resources, it is important to
* remember to clean up those resources after you are done with them. Otherwise,
* the resources will exist until the workbench window is closed. The supported
* services are:
* </p>
* <ul>
* <li>{@link ICommandService}</li>
* <li>{@link IContextService}</li>
* <li>{@link IHandlerService}</li>
* <li>{@link IBindingService}. Resources allocated through this service will
* not be cleaned up until the workbench shuts down.</li>
* </ul>
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*
* @see IWorkbenchPage
* @noimplement This interface is not intended to be implemented by clients.
*
*/
struct BERRY_UI_QT IWorkbenchWindow : public IPageService, public IServiceLocator, public virtual Object
{
- berryObjectMacro(berry::IWorkbenchWindow, IPageService, IServiceLocator, Object)
+ berryObjectMacro(berry::IWorkbenchWindow, IPageService, IServiceLocator, Object);
/**
* Closes this workbench window.
* <p>
* If the window has an open editor with unsaved content, the user will be
* given the opportunity to save it.
* </p>
*
* @return <code>true</code> if the window was successfully closed, and
* <code>false</code> if it is still open
*/
virtual bool Close() = 0;
/**
* Returns a list of the pages in this workbench window.
* <p>
* Note that each window has its own pages; pages are never shared between
* different windows.
* </p>
*
* @return a list of pages
*/
virtual QList<SmartPointer<IWorkbenchPage> > GetPages() const = 0;
/**
* Returns the currently active page for this workbench window.
*
* @return the active page, or <code>null</code> if none
*/
SmartPointer<IWorkbenchPage> GetActivePage() const override = 0;
/**
* Sets or clears the currently active page for this workbench window.
*
* @param page
* the new active page
*/
virtual void SetActivePage(SmartPointer<IWorkbenchPage> page) = 0;
/**
* Returns the part service which tracks part activation within this
* workbench window.
*
* @return the part service
*/
virtual IPartService* GetPartService() = 0;
/**
* Returns the selection service which tracks selection within this
* workbench window.
*
* @return the selection service
*/
virtual ISelectionService* GetSelectionService() const = 0;
/**
* Returns this workbench window's shell.
*
* @return the shell containing this window's controls or <code>null</code>
* if the shell has not been created yet or if the window has been closed
*/
virtual Shell::Pointer GetShell() const = 0;
/**
* Returns the workbench for this window.
*
* @return the workbench
*/
virtual IWorkbench* GetWorkbench() const = 0;
/**
* Returns whether the specified menu is an application menu as opposed to
* a part menu. Application menus contain items which affect the workbench
* or window. Part menus contain items which affect the active part (view
* or editor).
* <p>
* This is typically used during "in place" editing. Application menus
* should be preserved during menu merging. All other menus may be removed
* from the window.
* </p>
*
* @param menuId
* the menu id
* @return <code>true</code> if the specified menu is an application
* menu, and <code>false</code> if it is not
*/
//virtual bool IsApplicationMenu(const QString& menuId) = 0;
/**
* Creates and opens a new workbench page. The perspective of the new page
* is defined by the specified perspective ID. The new page become active.
* <p>
* <b>Note:</b> Since release 2.0, a window is limited to contain at most
* one page. If a page exist in the window when this method is used, then
* another window is created for the new page. Callers are strongly
* recommended to use the <code>IWorkbench.showPerspective</code> APIs to
* programmatically show a perspective.
* </p>
*
* @param perspectiveId
* the perspective id for the window's initial page
* @param input
* the page input, or <code>null</code> if there is no current
* input. This is used to seed the input for the new page's
* views.
* @return the new workbench page
* @exception WorkbenchException
* if a page could not be opened
*
* @see IWorkbench#showPerspective(String, IWorkbenchWindow, IAdaptable)
*/
virtual SmartPointer<IWorkbenchPage> OpenPage(const QString& perspectiveId, IAdaptable* input) = 0;
/**
* Creates and opens a new workbench page. The default perspective is used
* as a template for creating the page. The page becomes active.
* <p>
* <b>Note:</b> Since release 2.0, a window is limited to contain at most
* one page. If a page exist in the window when this method is used, then
* another window is created for the new page. Callers are strongly
* recommended to use the <code>IWorkbench.showPerspective</code> APIs to
* programmatically show a perspective.
* </p>
*
* @param input
* the page input, or <code>null</code> if there is no current
* input. This is used to seed the input for the new page's
* views.
* @return the new workbench window
* @exception WorkbenchException
* if a page could not be opened
*
* @see IWorkbench#showPerspective(String, IWorkbenchWindow, IAdaptable)
*/
virtual SmartPointer<IWorkbenchPage> OpenPage(IAdaptable* input) = 0;
//virtual void SetPerspectiveExcludeList(const QStringList& v) = 0;
//virtual QStringList GetPerspectiveExcludeList() const = 0;
//virtual void SetViewExcludeList(const QStringList& v) = 0;
//virtual QStringList GetViewExcludeList() const = 0;
~IWorkbenchWindow() override;
};
}
#endif /*BERRYIWORKBENCHWINDOW_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryPropertyChangeEvent.h b/Plugins/org.blueberry.ui.qt/src/berryPropertyChangeEvent.h
index e4281fae61..740bb995cc 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryPropertyChangeEvent.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryPropertyChangeEvent.h
@@ -1,125 +1,125 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYPROPERTYCHANGEEVENT_H_
#define BERRYPROPERTYCHANGEEVENT_H_
#include <berryMacros.h>
#include <berryObject.h>
#include <org_blueberry_ui_qt_Export.h>
namespace berry {
/**
* An event object describing a change to a named property.
* <p>
* This concrete class was designed to be instantiated, but may
* also be subclassed if required.
* </p>
* <p>
* The JFace frameworks contain classes that report property
* change events for internal state changes that may be of interest
* to external parties. A special listener interface
* (<code>IPropertyChangeListener</code>) is defined for this purpose,
* and a typical class allow listeners to be registered via
* an <code>addPropertyChangeListener</code> method.
* </p>
*
* @see IPropertyChangeListener
*/
class BERRY_UI_QT PropertyChangeEvent : public Object
{
public:
- berryObjectMacro(PropertyChangeEvent)
+ berryObjectMacro(PropertyChangeEvent);
private:
/**
* The name of the changed property.
*/
QString propertyName;
/**
* The old value of the changed property, or <code>null</code> if
* not known or not relevant.
*/
Object::Pointer oldValue;
/**
* The new value of the changed property, or <code>null</code> if
* not known or not relevant.
*/
Object::Pointer newValue;
/**
* The object on which the property change occured
*/
Object::Pointer source;
public:
/**
* Creates a new property change event.
*
* @param source the object whose property has changed
* @param property the property that has changed (must not be <code>null</code>)
* @param oldValue the old value of the property, or <code>null</code> if none
* @param newValue the new value of the property, or <code>null</code> if none
*/
PropertyChangeEvent(Object::Pointer source, const QString& property, Object::Pointer oldValue,
Object::Pointer newValue);
/**
* Returns the new value of the property.
*
* @return the new value, or <code>null</code> if not known
* or not relevant (for instance if the property was removed).
*/
Object::Pointer GetNewValue();
/**
* Returns the old value of the property.
*
* @return the old value, or <code>null</code> if not known
* or not relevant (for instance if the property was just
* added and there was no old value).
*/
Object::Pointer GetOldValue();
/**
* Returns the name of the property that changed.
* <p>
* Warning: there is no guarantee that the property name returned
* is a constant string. Callers must compare property names using
* equals, not ==.
* </p>
*
* @return the name of the property that changed
*/
QString GetProperty();
/**
* Returns the object whose property has changed
*
* @return the object whose property has changed
*/
Object::Pointer GetSource();
};
}
#endif /* BERRYPROPERTYCHANGEEVENT_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/berryQtEditorPart.h b/Plugins/org.blueberry.ui.qt/src/berryQtEditorPart.h
index 05f77fb7bb..c65c1f7de6 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryQtEditorPart.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryQtEditorPart.h
@@ -1,38 +1,38 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYQTEDITORPART_H_
#define BERRYQTEDITORPART_H_
#include <berryEditorPart.h>
#include <QWidget>
#include <org_blueberry_ui_qt_Export.h>
namespace berry
{
class BERRY_UI_QT QtEditorPart : public EditorPart
{
public:
- berryObjectMacro(QtEditorPart, EditorPart)
+ berryObjectMacro(QtEditorPart, EditorPart);
void CreatePartControl(QWidget* parent) override;
protected:
virtual void CreateQtPartControl(QWidget* parent) = 0;
};
}
#endif /*BERRYQTEDITORPART_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryQtViewPart.h b/Plugins/org.blueberry.ui.qt/src/berryQtViewPart.h
index a4113046be..0e0b161fe7 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryQtViewPart.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryQtViewPart.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYQTVIEWPART_H_
#define BERRYQTVIEWPART_H_
#include <berryViewPart.h>
#include <org_blueberry_ui_qt_Export.h>
#include <QWidget>
namespace berry
{
class BERRY_UI_QT QtViewPart : public ViewPart
{
public:
- berryObjectMacro(QtViewPart)
+ berryObjectMacro(QtViewPart);
void CreatePartControl(QWidget* parent) override;
protected:
virtual void CreateQtPartControl(QWidget* parent) = 0;
};
}
#endif /*BERRYQTVIEWPART_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berrySameShellProvider.h b/Plugins/org.blueberry.ui.qt/src/berrySameShellProvider.h
index 6b4b0afc5b..e94e1595cd 100644
--- a/Plugins/org.blueberry.ui.qt/src/berrySameShellProvider.h
+++ b/Plugins/org.blueberry.ui.qt/src/berrySameShellProvider.h
@@ -1,70 +1,70 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYSAMESHELLPROVIDER_H_
#define BERRYSAMESHELLPROVIDER_H_
#include <org_blueberry_ui_qt_Export.h>
#include "berryShell.h"
#include <berryMacros.h>
#include "berryIShellProvider.h"
namespace berry {
/**
* Standard shell provider that always returns the shell containing the given
* control. This will always return the correct shell for the control, even if
* the control is reparented.
*
* @since 3.1
*/
class BERRY_UI_QT SameShellProvider : public IShellProvider {
private:
QWidget* targetControl;
Shell::Pointer shell;
public:
- berryObjectMacro(SameShellProvider)
+ berryObjectMacro(SameShellProvider);
/**
* Returns a shell provider that always returns the current
* shell for the given control.
*
* @param targetControl control whose shell will be tracked, or null if getShell() should always
* return null
*/
SameShellProvider(QWidget* targetControl);
/**
* Returns a shell provider that always returns the given shell.
*
* @param shell the shell which should always be returned,
* or null if GetShell() should alway return null
*/
SameShellProvider(Shell::Pointer shell);
/* (non-javadoc)
* @see IShellProvider#getShell()
*/
Shell::Pointer GetShell() const override;
};
}
#endif /* BERRYSAMESHELLPROVIDER_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/berrySaveable.h b/Plugins/org.blueberry.ui.qt/src/berrySaveable.h
index 81dcf4a837..3164437a5b 100644
--- a/Plugins/org.blueberry.ui.qt/src/berrySaveable.h
+++ b/Plugins/org.blueberry.ui.qt/src/berrySaveable.h
@@ -1,282 +1,282 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYSAVEABLE_H_
#define BERRYSAVEABLE_H_
#include <berryMacros.h>
#include <berryObject.h>
#include <berryIAdaptable.h>
#include <org_blueberry_ui_qt_Export.h>
namespace berry {
struct IWorkbenchPage;
struct IWorkbenchPart;
/**
* A <code>Saveable</code> represents a unit of saveability, e.g. an editable
* subset of the underlying domain model that may contain unsaved changes.
* Different workbench parts (editors and views) may present the same saveables
* in different ways. This interface allows the workbench to provide more
* appropriate handling of operations such as saving and closing workbench
* parts. For example, if two editors sharing the same saveable with unsaved
* changes are closed simultaneously, the user is only prompted to save the
* changes once for the shared saveable, rather than once for each editor.
* <p>
* Workbench parts that work in terms of saveables should implement
* {@link ISaveablesSource}.
* </p>
*
* @see ISaveablesSource
*/
class BERRY_UI_QT Saveable : /*public InternalSaveable*/ public virtual Object, public IAdaptable
{
public:
- berryObjectMacro(Saveable)
+ berryObjectMacro(Saveable);
private:
//Cursor waitCursor;
//Cursor originalCursor;
public:
typedef QSet<Saveable::Pointer> Set;
/**
* Attempts to show this saveable in the given page and returns
* <code>true</code> on success. The default implementation does nothing
* and returns <code>false</code>.
*
* @param page
* the workbench page in which to show this saveable
* @return <code>true</code> if this saveable is now visible to the user
* @since 3.3
*/
virtual bool Show(SmartPointer<IWorkbenchPage> page);
/**
* Returns the name of this saveable for display purposes.
*
* @return the model's name; never <code>null</code>.
*/
virtual QString GetName() const = 0;
/**
* Returns the tool tip text for this saveable. This text is used to
* differentiate between two inputs with the same name. For instance,
* MyClass.java in folder X and MyClass.java in folder Y. The format of the
* text varies between input types.
*
* @return the tool tip text; never <code>null</code>
*/
virtual QString GetToolTipText() const = 0;
/**
* Returns the image descriptor for this saveable.
*
* @return the image descriptor for this model; may be <code>null</code>
* if there is no image
*/
virtual QIcon GetImageDescriptor() const = 0;
/**
* Saves the contents of this saveable.
* <p>
* If the save is cancelled through user action, or for any other reason,
* the part should invoke <code>setCancelled</code> on the
* <code>IProgressMonitor</code> to inform the caller.
* </p>
* <p>
* This method is long-running; progress and cancellation are provided by
* the given progress monitor.
* </p>
*
* @param monitor
* the progress monitor
* @throws CoreException
* if the save fails; it is the caller's responsibility to
* report the failure to the user
*/
virtual void DoSave(/*IProgressMonitor monitor*/) = 0;
/**
* Returns whether the contents of this saveable have changed since the last
* save operation.
* <p>
* <b>Note:</b> this method is called frequently, for example by actions to
* determine their enabled status.
* </p>
*
* @return <code>true</code> if the contents have been modified and need
* saving, and <code>false</code> if they have not changed since
* the last save
*/
virtual bool IsDirty() const = 0;
/**
* Clients must implement equals and hashCode as defined in
* {@link Object#equals(Object)} and {@link Object#hashCode()}. Two
* saveables should be equal if their dirty state is shared, and saving one
* will save the other. If two saveables are equal, their names, tooltips,
* and images should be the same because only one of them will be shown when
* prompting the user to save.
*
* @param object
* @return true if this Saveable is equal to the given object
*/
bool operator<(const Object* object) const override = 0;
/**
* Clients must implement equals and hashCode as defined in
* {@link Object#equals(Object)} and {@link Object#hashCode()}. Two
* saveables should be equal if their dirty state is shared, and saving one
* will save the other. If two saveables are equal, their hash codes MUST be
* the same, and their names, tooltips, and images should be the same
* because only one of them will be shown when prompting the user to save.
* <p>
* IMPORTANT: Implementers should ensure that the hashCode returned is
* sufficiently unique so as not to collide with hashCodes returned by other
* implementations. It is suggested that the defining plug-in's ID be used
* as part of the returned hashCode, as in the following example:
* </p>
*
* <pre>
* int PRIME = 31;
* int hash = ...; // compute the &quot;normal&quot; hash code, e.g. based on some identifier unique within the defining plug-in
* return hash * PRIME + MY_PLUGIN_ID.hashCode();
* </pre>
*
* @return a hash code
*/
uint HashCode() const override = 0;
/**
* Saves this saveable, or prepares this saveable for a background save
* operation. Returns null if this saveable has been successfully saved, or
* a job runnable that needs to be run to complete the save in the
* background. This method is called in the UI thread. If this saveable
* supports saving in the background, it should do only minimal work.
* However, since the job runnable returned by this method (if any) will not
* run on the UI thread, this method should copy any state that can only be
* accessed from the UI thread so that the job runnable will be able to
* access it.
* <p>
* The supplied shell provider can be used from within this method and from
* within the job runnable for the purpose of parenting dialogs. Care should
* be taken not to open dialogs gratuitously and only if user input is
* required for cases where the save cannot otherwise proceed - note that in
* any given save operation, many saveable objects may be saved at the same
* time. In particular, errors should be signaled by throwing an exception,
* or if an error occurs while running the job runnable, an error status
* should be returned.
* </p>
* <p>
* If the foreground part of the save is cancelled through user action, or
* for any other reason, the part should invoke <code>setCancelled</code>
* on the <code>IProgressMonitor</code> to inform the caller. If the
* background part of the save is cancelled, the job should return a
* {@link IStatus#CANCEL} status.
* </p>
* <p>
* This method is long-running; progress and cancellation are provided by
* the given progress monitor.
* </p>
* <p>
* The default implementation of this method calls
* {@link #doSave(IProgressMonitor)} and returns <code>null</code>.
* </p>
*
* @param monitor
* a progress monitor used for reporting progress and
* cancellation
* @param shellProvider
* an object that can provide a shell for parenting dialogs
* @return <code>null</code> if this saveable has been saved successfully,
* or a job runnable that needs to be run to complete the save in
* the background.
*
* @since 3.3
*/
//TODO Saveable IJobRunnable, IProgressMonitor, and IShellProvider
// virtual /*IJobRunnable*/void DoSave(/*IProgressMonitor monitor,
// IShellProvider shellProvider*/);
/**
* Disables the UI of the given parts containing this saveable if necessary.
* This method is not intended to be called by clients. A corresponding call
* to
* <p>
* Saveables that can be saved in the background should ensure that the user
* cannot make changes to their data from the UI, for example by disabling
* controls, unless they are prepared to handle this case. This method is
* called on the UI thread after a job runnable has been returned from
* {@link #doSave(IProgressMonitor, IShellProvider)} and before
* spinning the event loop. The <code>closing</code> flag indicates that
* this saveable is currently being saved in response to closing a workbench
* part, in which case further changes to this saveable through the UI must
* be prevented.
* </p>
* <p>
* The default implementation calls setEnabled(false) on the given parts'
* composites.
* </p>
*
* @param parts
* the workbench parts containing this saveable
* @param closing
* a boolean flag indicating whether the save was triggered by a
* request to close a workbench part, and all of the given parts
* will be closed after the save operation finishes successfully.
*
* @since 3.3
*/
virtual void DisableUI(const QList<SmartPointer<IWorkbenchPart> >& parts, bool closing);
/**
* Enables the UI of the given parts containing this saveable after a
* background save operation has finished. This method is not intended to be
* called by clients.
* <p>
* The default implementation calls setEnabled(true) on the given parts'
* composites.
* </p>
*
* @param parts
* the workbench parts containing this saveable
*
* @since 3.3
*/
virtual void EnableUI(QList<SmartPointer<IWorkbenchPart> >& parts);
protected:
/**
* This implementation of {@link IAdaptable#GetAdapterImpl(const std::type_info&)} returns
* <code>null</code>. Subclasses may override. This allows two unrelated
* subclasses of Saveable to implement {@link #equals(Object)} and
* {@link #hashCode()} based on an underlying implementation class that is
* shared by both Saveable subclasses.
*
* @since 3.3
*/
Object* GetAdapter(const QString& adapter) const override;
};
}
#endif /* BERRYSAVEABLE_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/berrySaveablesLifecycleEvent.h b/Plugins/org.blueberry.ui.qt/src/berrySaveablesLifecycleEvent.h
index 9ccefd711b..3522c11a52 100644
--- a/Plugins/org.blueberry.ui.qt/src/berrySaveablesLifecycleEvent.h
+++ b/Plugins/org.blueberry.ui.qt/src/berrySaveablesLifecycleEvent.h
@@ -1,138 +1,138 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYSAVEABLESLIFECYCLEEVENT_H_
#define BERRYSAVEABLESLIFECYCLEEVENT_H_
#include <berryMacros.h>
#include <org_blueberry_ui_qt_Export.h>
#include "berrySaveable.h"
#include <vector>
namespace berry {
/**
* Event object describing a change to a set of Saveable objects.
*/
class BERRY_UI_QT SaveablesLifecycleEvent : public Object
{
public:
- berryObjectMacro(SaveablesLifecycleEvent)
+ berryObjectMacro(SaveablesLifecycleEvent);
/**
* Event type constant specifying that the given saveables have been opened.
*/
static const int POST_OPEN; // = 1;
/**
* Event type constant specifying that the given saveables are about to be
* closed. Listeners may veto the closing if isForce() is false.
*/
static const int PRE_CLOSE; // = 2;
/**
* Event type constant specifying that the given saveables have been closed.
*/
static const int POST_CLOSE; // = 3;
/**
* Event type constant specifying that the dirty state of the given saveables
* has changed.
*/
static const int DIRTY_CHANGED; // = 4;
private:
int eventType;
QList<Saveable::Pointer> saveables;
bool force;
bool veto;
Object::Pointer source;
public:
/**
* Creates a new SaveablesLifecycleEvent.
*
* @param source
* The source of the event. If an ISaveablesSource notifies
* about changes to the saveables returned by
* {@link ISaveablesSource#getSaveables()}, the source must be
* the ISaveablesSource object.
* @param eventType
* the event type, currently one of POST_OPEN, PRE_CLOSE,
* POST_CLOSE, DIRTY_CHANGED
* @param saveables
* The affected saveables
* @param force
* true if the event type is PRE_CLOSE and this is a closed force
* that cannot be canceled.
*/
SaveablesLifecycleEvent(Object::Pointer source_, int eventType_,
const QList<Saveable::Pointer>& saveables_, bool force_);
/**
* Returns the eventType, currently one of POST_OPEN, PRE_CLOSE, POST_CLOSE,
* DIRTY_CHANGED. Listeners should silently ignore unknown event types since
* new event types might be added in the future.
*
* @return the eventType
*/
int GetEventType();
Object::Pointer GetSource();
/**
* Returns the affected saveables.
*
* @return the saveables
*/
QList<Saveable::Pointer> GetSaveables();
/**
* Returns the veto. This value is ignored for POST_OPEN,POST_CLOSE, and
* DIRTY_CHANGED.
*
* @return Returns the veto.
*/
bool IsVeto();
/**
* @param veto
* The veto to set.
*/
void SetVeto(bool veto);
/**
* Sets the force flag. This value is ignored for POST_OPEN, POST_CLOSE, and
* DIRTY_CHANGED.
*
* @return Returns the force.
*/
bool IsForce();
};
}
#endif /* BERRYSAVEABLESLIFECYCLEEVENT_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/berryShell.h b/Plugins/org.blueberry.ui.qt/src/berryShell.h
index bd9890b84a..4e2f8f64c6 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryShell.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryShell.h
@@ -1,324 +1,324 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYSHELL_H_
#define BERRYSHELL_H_
#include <berryMacros.h>
#include <org_blueberry_ui_qt_Export.h>
#include "berryIShellListener.h"
#include "guitk/berryGuiTkIControlListener.h"
namespace berry {
/**
* Instances of this class represent the "windows"
* which the desktop or "window manager" is managing.
* Instances that do not have a parent (that is, they
* are built using the constructor, which takes a
* <code>Display</code> as the argument) are described
* as <em>top level</em> shells. Instances that do have
* a parent are described as <em>secondary</em> or
* <em>dialog</em> shells.
* <p>
* Instances are always displayed in one of the maximized,
* minimized or normal states:
* <ul>
* <li>
* When an instance is marked as <em>maximized</em>, the
* window manager will typically resize it to fill the
* entire visible area of the display, and the instance
* is usually put in a state where it can not be resized
* (even if it has style <code>RESIZE</code>) until it is
* no longer maximized.
* </li><li>
* When an instance is in the <em>normal</em> state (neither
* maximized or minimized), its appearance is controlled by
* the style constants which were specified when it was created
* and the restrictions of the window manager (see below).
* </li><li>
* When an instance has been marked as <em>minimized</em>,
* its contents (client area) will usually not be visible,
* and depending on the window manager, it may be
* "iconified" (that is, replaced on the desktop by a small
* simplified representation of itself), relocated to a
* distinguished area of the screen, or hidden. Combinations
* of these changes are also possible.
* </li>
* </ul>
* </p><p>
* The <em>modality</em> of an instance may be specified using
* style bits. The modality style bits are used to determine
* whether input is blocked for other shells on the display.
* The <code>PRIMARY_MODAL</code> style allows an instance to block
* input to its parent. The <code>APPLICATION_MODAL</code> style
* allows an instance to block input to every other shell in the
* display. The <code>SYSTEM_MODAL</code> style allows an instance
* to block input to all shells, including shells belonging to
* different applications.
* </p><p>
* Note: The styles supported by this class are treated
* as <em>HINT</em>s, since the window manager for the
* desktop on which the instance is visible has ultimate
* control over the appearance and behavior of decorations
* and modality. For example, some window managers only
* support resizable windows and will always assume the
* RESIZE style, even if it is not set. In addition, if a
* modality style is not supported, it is "upgraded" to a
* more restrictive modality style that is supported. For
* example, if <code>PRIMARY_MODAL</code> is not supported,
* it would be upgraded to <code>APPLICATION_MODAL</code>.
* A modality style may also be "downgraded" to a less
* restrictive style. For example, most operating systems
* no longer support <code>SYSTEM_MODAL</code> because
* it can freeze up the desktop, so this is typically
* downgraded to <code>APPLICATION_MODAL</code>.
* <dl>
* <dt><b>Styles:</b></dt>
* <dd>BORDER, CLOSE, MIN, MAX, NO_TRIM, RESIZE, TITLE, ON_TOP, TOOL</dd>
* <dd>APPLICATION_MODAL, MODELESS, PRIMARY_MODAL, SYSTEM_MODAL</dd>
* <dt><b>Events:</b></dt>
* <dd>Activate, Close, Deactivate, Deiconify, Iconify</dd>
* </dl>
* Class <code>SWT</code> provides two "convenience constants"
* for the most commonly required style combinations:
* <dl>
* <dt><code>SHELL_TRIM</code></dt>
* <dd>
* the result of combining the constants which are required
* to produce a typical application top level shell: (that
* is, <code>CLOSE | TITLE | MIN | MAX | RESIZE</code>)
* </dd>
* <dt><code>DIALOG_TRIM</code></dt>
* <dd>
* the result of combining the constants which are required
* to produce a typical application dialog shell: (that
* is, <code>TITLE | CLOSE | BORDER</code>)
* </dd>
* </dl>
* </p>
* <p>
* Note: Only one of the styles APPLICATION_MODAL, MODELESS,
* PRIMARY_MODAL and SYSTEM_MODAL may be specified.
* </p><p>
* IMPORTANT: This class is not intended to be subclassed.
* </p>
*/
class BERRY_UI_QT Shell : public virtual Object
{
public:
- berryObjectMacro(Shell)
+ berryObjectMacro(Shell);
Shell();
Object::Pointer GetData(const QString& id = "") const;
void SetData(const Object::Pointer& data, const QString& id = "");
IShellListener* GetExtraShellListener() const;
void SetExtraShellListener(IShellListener* l);
void SetBounds(int x, int y, int width, int height);
virtual void SetBounds(const QRect& bounds) = 0;
virtual QRect GetBounds() const = 0;
virtual void SetLocation(int x, int y) = 0;
virtual QPoint ComputeSize(int wHint, int hHint, bool changed) = 0;
/**
* Returns the receiver's text, which is the string that the
* window manager will typically display as the receiver's title.
* If the text has not previously been set, returns an empty string.
*
* @return the text
*/
virtual QString GetText() const = 0;
/**
* Sets the receiver's text, which is the string that the window manager
* will typically display as the receiver's title, to the argument.
*/
virtual void SetText(const QString& text) = 0;
virtual bool IsVisible() const = 0;
virtual void SetVisible(bool visible) = 0;
virtual QWidget* GetControl() const = 0;
virtual void SetImages(const QList<QIcon>& images) = 0;
/**
* Returns <code>true</code> if the receiver is currently
* maximized, and false otherwise.
* <p>
*
* @return the maximized state
*
* @see #SetMaximized
*/
virtual bool GetMaximized() const = 0;
/**
* Returns <code>true</code> if the receiver is currently
* minimized, and false otherwise.
* <p>
*
* @return the minimized state
*
* @see #SetMinimized
*/
virtual bool GetMinimized() const = 0;
/**
* Sets the minimized stated of the receiver.
* If the argument is <code>true</code> causes the receiver
* to switch to the minimized state, and if the argument is
* <code>false</code> and the receiver was previously minimized,
* causes the receiver to switch back to either the maximized
* or normal states.
* <p>
* Note: The result of intermixing calls to <code>setMaximized(true)</code>
* and <code>setMinimized(true)</code> will vary by platform. Typically,
* the behavior will match the platform user's expectations, but not
* always. This should be avoided if possible.
* </p>
*
* @param minimized the new maximized state
*
* @see #SetMaximized
*/
virtual void SetMinimized(bool minimized) = 0;
/**
* Sets the maximized state of the receiver.
* If the argument is <code>true</code> causes the receiver
* to switch to the maximized state, and if the argument is
* <code>false</code> and the receiver was previously maximized,
* causes the receiver to switch back to either the minimized
* or normal states.
* <p>
* Note: The result of intermixing calls to <code>setMaximized(true)</code>
* and <code>setMinimized(true)</code> will vary by platform. Typically,
* the behavior will match the platform user's expectations, but not
* always. This should be avoided if possible.
* </p>
*
* @param maximized the new maximized state
*
* @see #SetMinimized
*/
virtual void SetMaximized(bool maximized) = 0;
/**
* Adds the listener to the collection of listeners who will
* be notified when operations are performed on the receiver,
* by sending the listener one of the messages defined in the
* <code>IShellListener</code> interface.
*
* @param listener the listener which should be notified
*
* @see IShellListener
* @see #RemoveShellListener
*/
virtual void AddShellListener(IShellListener* listener) = 0;
/**
* Removes the listener from the collection of listeners who will
* be notified when operations are performed on the receiver.
*
* @param listener the listener which should no longer be notified
*
* @see IShellListener
* @see #AddShellListener
*/
virtual void RemoveShellListener(IShellListener* listener) = 0;
/**
* Moves the receiver to the top of the drawing order for
* the display on which it was created (so that all other
* shells on that display, which are not the receiver's
* children will be drawn behind it), marks it visible,
* sets the focus and asks the window manager to make the
* shell active.
*/
virtual void Open(bool block = false) = 0;
/**
* Requests that the window manager close the receiver in
* the same way it would be closed when the user clicks on
* the "close box" or performs some other platform specific
* key or mouse combination that indicates the window
* should be removed.
*/
virtual void Close() = 0;
/**
* If the receiver is visible, moves it to the top of the
* drawing order for the display on which it was created
* (so that all other shells on that display, which are not
* the receiver's children will be drawn behind it) and
* asks the window manager to make the shell active.
*/
virtual void SetActive() = 0;
/**
* Returns an array containing all shells which are
* descendants of the receiver.
* <p>
* @return the dialog shells
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
virtual QList<Shell::Pointer> GetShells() = 0;
/**
* Returns the receiver's style information.
* <p>
* Note that the value which is returned by this method <em>may
* not match</em> the value which was provided to the constructor
* when the receiver was created. This can occur when the underlying
* operating system does not support a particular combination of
* requested styles. For example, if the platform widget used to
* implement a particular SWT widget always has scroll bars, the
* result of calling this method would always have the
* <code>SWT.H_SCROLL</code> and <code>SWT.V_SCROLL</code> bits set.
* </p>
*
* @return the style bits
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
virtual Qt::WindowFlags GetStyle () const = 0;
private:
QHash<QString, Object::Pointer> data;
IShellListener* extraShellListener;
};
}
Q_DECLARE_METATYPE(berry::Shell*)
#endif /* BERRYSHELL_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/berryShowInContext.h b/Plugins/org.blueberry.ui.qt/src/berryShowInContext.h
index 00b0d4fed5..517f6b029c 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryShowInContext.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryShowInContext.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYSHOWINCONTEXT_H
#define BERRYSHOWINCONTEXT_H
#include "berryObject.h"
#include <org_blueberry_ui_qt_Export.h>
namespace berry {
struct ISelection;
/**
* Carries the context for the Show In action.
* The default implementation carries an input and a selection.
* Subclasses may extend.
*
* @see IShowInSource
* @see IShowInTarget
*/
class BERRY_UI_QT ShowInContext : public virtual Object
{
private:
Object::Pointer input;
SmartPointer<const ISelection> selection;
public:
- berryObjectMacro(berry::ShowInContext)
+ berryObjectMacro(berry::ShowInContext);
/**
* Constructs a new <code>ShowInContext</code> with the given input and
* selection.
*
* @param input the input or <code>null</code>
* @param selection the selection or <code>null</code>
*/
ShowInContext(const Object::Pointer& input, const SmartPointer<const ISelection>& selection);
/**
* Returns the input, or <code>null</code> to indicate no input
*
* @return the input or <code>null</code>.
*/
Object::Pointer GetInput() const;
/**
* Returns the selection, or <code>null</code> to indicate no selection.
*
* @return the selection or <code>null</code>
*/
SmartPointer<const ISelection> GetSelection() const;
/**
* Sets the input, or <code>null</code> to indicate no input.
*
* @param input the input or <code>null</code>
*/
void SetInput(const Object::Pointer& input);
/**
* Sets the selection, or <code>null</code> to indicate no selection.
*
* @param selection the selection or <code>null</code>
*/
void SetSelection(const SmartPointer<const ISelection>& selection);
};
}
#endif // BERRYSHOWINCONTEXT_H
diff --git a/Plugins/org.blueberry.ui.qt/src/berryViewPart.h b/Plugins/org.blueberry.ui.qt/src/berryViewPart.h
index d8d20c69e3..314f412614 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryViewPart.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryViewPart.h
@@ -1,100 +1,100 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYVIEWPART_H_
#define BERRYVIEWPART_H_
#include "berryIViewPart.h"
#include "berryIViewSite.h"
#include "berryWorkbenchPart.h"
#include "berryIMemento.h"
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* Abstract base implementation of all workbench views.
* <p>
* This class should be subclassed by clients wishing to define new views.
* The name of the subclass should be given as the <code>"class"</code>
* attribute in a <code>view</code> extension contributed to the workbench's
* view extension point (named <code>"org.blueberry.ui.views"</code>).
* For example, the plug-in's XML markup might contain:
* <pre>
* &LT;extension point="org.blueberry.ui.views"&GT;
* &LT;view id="com.example.myplugin.view"
* name="My View"
* class="com.example.myplugin.MyView"
* icon="images/eview.gif"
* /&GT;
* &LT;/extension&GT;
* </pre>
* where <code>com.example.myplugin.MyView</code> is the name of the
* <code>ViewPart</code> subclass.
* </p>
* <p>
* Subclasses must implement the following methods:
* <ul>
* <li><code>createPartControl</code> - to create the view's controls </li>
* <li><code>setFocus</code> - to accept focus</li>
* </ul>
* </p>
* <p>
* Subclasses may extend or reimplement the following methods as required:
* <ul>
* <li><code>setInitializationData</code> - extend to provide additional
* initialization when view extension is instantiated</li>
* <li><code>init(IWorkbenchPartSite)</code> - extend to provide additional
* initialization when view is assigned its site</li>
* <li><code>dispose</code> - extend to provide additional cleanup</li>
* <li><code>getAdapter</code> - reimplement to make their view adaptable</li>
* </ul>
* </p>
*/
class BERRY_UI_QT ViewPart : public WorkbenchPart, public IViewPart
{
Q_OBJECT
Q_INTERFACES(berry::IViewPart)
protected:
ViewPart();
/**
* Checks that the given site is valid for this type of part.
* The site for a view must be an <code>IViewSite</code>.
*
* @param site the site to check
* @since 3.1
*/
void CheckSite(IWorkbenchPartSite::Pointer site) override;
public:
- berryObjectMacro(ViewPart, WorkbenchPart, IViewPart)
+ berryObjectMacro(ViewPart, WorkbenchPart, IViewPart);
void Init(IViewSite::Pointer site, IMemento::Pointer memento = IMemento::Pointer(nullptr)) override;
void SaveState(IMemento::Pointer memento) override;
/*
* Method declared on IViewPart.
*/
IViewSite::Pointer GetViewSite() override;
};
} // namespace berry
#endif /*BERRYVIEWPART_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryWindow.h b/Plugins/org.blueberry.ui.qt/src/berryWindow.h
index aac7200b24..14e0f74636 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryWindow.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryWindow.h
@@ -1,727 +1,727 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYWINDOW_H_
#define BERRYWINDOW_H_
#include <org_blueberry_ui_qt_Export.h>
#include "berryIShellProvider.h"
#include "berryIShellListener.h"
#include "internal/berryWindowManager.h"
#include "tweaklets/berryGuiWidgetsTweaklet.h"
#include <berryMacros.h>
#include <vector>
namespace berry
{
//struct IToolBarManager;
class MenuManager;
//class StatusLineManager;
/**
* A JFace window is an object that has no visual representation (no widgets)
* until it is told to open.
* <p>
* Creating a window involves the following steps:
* <ul>
* <li>creating an instance of a concrete subclass of <code>Window</code>
* </li>
* <li>creating the window's shell and widget tree by calling
* <code>create</code> (optional)</li>
* <li>assigning the window to a window manager using
* <code>WindowManager.add</code> (optional)</li>
* <li>opening the window by calling <code>open</code></li>
* </ul>
* Opening the window will create its shell and widget tree if they have not
* already been created. When the window is closed, the shell and widget tree
* are disposed of and are no longer referenced, and the window is automatically
* removed from its window manager. A window may be reopened.
* </p>
* <p>
* The JFace window framework (this package) consists of this class,
* <code>Window</code>, the abstract base of all windows, and one concrete
* window classes (<code>ApplicationWindow</code>) which may also be
* subclassed. Clients may define additional window subclasses as required.
* </p>
* <p>
* The <code>Window</code> class provides methods that subclasses may
* override to configure the window, including:
* <ul>
* <li><code>close</code>- extend to free other SWT resources</li>
* <li><code>configureShell</code>- extend or reimplement to set shell
* properties before window opens</li>
* <li><code>createContents</code>- extend or reimplement to create controls
* before window opens</li>
* <li><code>getInitialSize</code>- reimplement to give the initial size for
* the shell</li>
* <li><code>getInitialLocation</code>- reimplement to give the initial
* location for the shell</li>
* <li><code>getShellListener</code>- extend or reimplement to receive shell
* events</li>
* <li><code>handleFontChange</code>- reimplement to respond to font changes
* </li>
* <li><code>handleShellCloseEvent</code>- extend or reimplement to handle
* shell closings</li>
* </ul>
* </p>
*/
class BERRY_UI_QT Window: public IShellProvider
{
public:
- berryObjectMacro(Window, IShellProvider)
+ berryObjectMacro(Window, IShellProvider);
/**
* Standard return code constant (value 0) indicating that the window was
* opened.
*
* @see #open
*/
static const int OK; // = 0;
/**
* Standard return code constant (value 1) indicating that the window was
* canceled.
*
* @see #open
*/
static const int CANCEL; // = 1;
/**
* An array of images to be used for the window. It is expected that the
* array will contain the same icon rendered at different resolutions.
*/
static QList<QIcon> defaultImages;
/**
* This interface defines a Exception Handler which can be set as a global
* handler and will be called if an exception happens in the event loop.
*/
struct IExceptionHandler: public Object
{
- berryObjectMacro(IExceptionHandler)
+ berryObjectMacro(IExceptionHandler);
/**
* Handle the exception.
*
* @param t
* The exception that occured.
*/
virtual void HandleException(const std::exception& t) = 0;
};
private:
struct WindowShellListener : public IShellListener
{
WindowShellListener(Window* wnd);
void ShellClosed(const ShellEvent::Pointer& event) override;
private:
Window* window;
};
QScopedPointer<IShellListener> windowShellListener;
/**
* Defines a default exception handler.
*/
struct DefaultExceptionHandler: public IExceptionHandler
{
/*
* (non-Javadoc)
*
* @see org.blueberry.jface.window.Window.IExceptionHandler#handleException(java.lang.Throwable)
*/
void HandleException(const std::exception& t) override;
};
/**
* Menu bar manager, or <code>null</code> if none (default).
*
* @see #addMenuBar
*/
SmartPointer<MenuManager> menuBarManager;
/**
* Tool bar manager, or <code>null</code> if none (default).
*
* @see #addToolBar
*/
//SmartPointer<IToolBarManager> toolBarManager;
/**
* Status line manager, or <code>null</code> if none (default).
*
* @see #addStatusLine
*/
//SmartPointer<StatusLineManager> statusLineManager;
/**
* The exception handler for this application.
*/
static IExceptionHandler::Pointer exceptionHandler;
/**
* Object used to locate the default parent for modal shells
*/
struct DefaultModalParent: public IShellProvider
{
Shell::Pointer GetShell() const override;
};
friend struct DefaultModalParent;
static IShellProvider::Pointer defaultModalParent;
/**
* Object that returns the parent shell.
*/
IShellProvider::Pointer parentShell;
/**
* Shell style bits.
*
* @see #setShellStyle
*/
int shellStyle; // = Constants::SHELL_TRIM;
/**
* Window manager, or <code>null</code> if none.
*
* @see #setWindowManager
*/
WindowManager* windowManager;
/**
* Window shell, or <code>null</code> if none.
*/
Shell::Pointer shell;
/**
* Top level SWT control, or <code>null</code> if none
*/
QWidget* contents;
/**
* Window return code; initially <code>OK</code>.
*
* @see #setReturnCode
*/
int returnCode; // = OK;
/**
* <code>true</code> if the <code>open</code> method should not return
* until the window closes, and <code>false</code> if the
* <code>open</code> method should return immediately; initially
* <code>false</code> (non-blocking).
*
* @see #setBlockOnOpen
*/
bool block; // = false;
// /**
// * Internal class for informing this window when fonts change.
// */
// class FontChangeListener implements IPropertyChangeListener {
// public void propertyChange(PropertyChangeEvent event) {
// handleFontChange(event);
// }
// }
// /**
// * Internal font change listener.
// */
// private FontChangeListener fontChangeListener;
/**
* Internal fields to detect if shell size has been set
*/
//bool resizeHasOccurred = false;
//Listener resizeListener;
/**
* Returns the most specific modal child from the given list of Shells.
*
* @param toSearch shells to search for modal children
* @return the most specific modal child, or null if none
*
* @since 3.1
*/
static Shell::Pointer GetModalChild(
const QList<Shell::Pointer>& toSearch);
/**
* Runs the event loop for the given shell.
*
* @param loopShell
* the shell
*/
//void RunEventLoop();
protected:
/**
* Creates a window instance, whose shell will be created under the given
* parent shell. Note that the window will have no visual representation
* until it is told to open. By default, <code>open</code> does not block.
*
* @param parentShell
* the parent shell, or <code>null</code> to create a top-level
* shell. Try passing "(Shell)null" to this method instead of "null"
* if your compiler complains about an ambiguity error.
* @see #setBlockOnOpen
* @see #getDefaultOrientation()
*/
Window(Shell::Pointer parentShell);
/**
* Creates a new window which will create its shell as a child of whatever
* the given shellProvider returns.
*
* @param shellProvider object that will return the current parent shell. Not null.
*
*/
Window(IShellProvider::Pointer shellProvider);
~Window() override;
/**
* Given the desired position of the window, this method returns an adjusted
* position such that the window is no larger than its monitor, and does not
* extend beyond the edge of the monitor. This is used for computing the
* initial window position, and subclasses can use this as a utility method
* if they want to limit the region in which the window may be moved.
*
* @param preferredSize
* the preferred position of the window
* @return a rectangle as close as possible to preferredSize that does not
* extend outside the monitor
*
*/
QRect GetConstrainedShellBounds(const QRect& preferredSize);
/**
* Initializes this windows variables
*/
virtual void Init();
/**
* Determines if the window should handle the close event or do nothing.
* <p>
* The default implementation of this framework method returns
* <code>true</code>, which will allow the
* <code>handleShellCloseEvent</code> method to be called. Subclasses may
* extend or reimplement.
* </p>
*
* @return whether the window should handle the close event.
*/
virtual bool CanHandleShellCloseEvent();
/**
* Configures the given shell in preparation for opening this window in it.
* <p>
* The default implementation of this framework method sets the shell's
* image and gives it a grid layout. Subclasses may extend or reimplement.
* </p>
*
* @param newShell
* the shell
*/
virtual void ConfigureShell(Shell::Pointer newShell);
/**
* Constrain the shell size to be no larger than the display bounds.
*
* @since 2.0
*/
//void ConstrainShellSize();
/**
* Creates and returns this window's contents. Subclasses may attach any
* number of children to the parent. As a convenience, the return value of
* this method will be remembered and returned by subsequent calls to
* getContents(). Subclasses may modify the parent's layout if they overload
* getLayout() to return null.
*
* <p>
* It is common practise to create and return a single composite that
* contains the entire window contents.
* </p>
*
* <p>
* The default implementation of this framework method creates an instance
* of <code>Composite</code>. Subclasses may override.
* </p>
*
* @param parent
* the parent composite for the controls in this window. The type
* of layout used is determined by getLayout()
*
* @return the control that will be returned by subsequent calls to
* getContents()
*/
virtual QWidget* CreateContents(Shell::Pointer parent);
/**
* Creates and returns this window's shell.
* <p>
* The default implementation of this framework method creates a new shell
* and configures it using <code>configureShell</code>. Rather than
* override this method, subclasses should instead override
* <code>configureShell</code>.
* </p>
*
* @return the shell
*/
virtual Shell::Pointer CreateShell();
/**
* Returns the top level control for this window. The parent of this control
* is the shell.
*
* @return the top level control, or <code>null</code> if this window's
* control has not been created yet
*/
virtual QWidget* GetContents();
/**
* Returns the initial location to use for the shell. The default
* implementation centers the shell horizontally (1/2 of the difference to
* the left and 1/2 to the right) and vertically (1/3 above and 2/3 below)
* relative to the parent shell, or display bounds if there is no parent
* shell.
*
* @param initialSize
* the initial size of the shell, as returned by
* <code>getInitialSize</code>.
* @return the initial location of the shell
*/
virtual QPoint GetInitialLocation(const QPoint& initialSize);
/**
* Returns the initial size to use for the shell. The default implementation
* returns the preferred size of the shell, using
* <code>Shell.computeSize(SWT.DEFAULT, SWT.DEFAULT, true)</code>.
*
* @return the initial size of the shell
*/
virtual QPoint GetInitialSize();
/**
* Returns parent shell, under which this window's shell is created.
*
* @return the parent shell, or <code>null</code> if there is no parent
* shell
*/
Shell::Pointer GetParentShell();
/**
* Returns a shell listener. This shell listener gets registered with this
* window's shell.
* <p>
* The default implementation of this framework method returns a new
* listener that makes this window the active window for its window manager
* (if it has one) when the shell is activated, and calls the framework
* method <code>handleShellCloseEvent</code> when the shell is closed.
* Subclasses may extend or reimplement.
* </p>
*
* @return a shell listener
*/
virtual IShellListener* GetShellListener();
/**
* Returns the shell style bits.
* <p>
* The default value is <code>SWT.CLOSE|SWT.MIN|SWT.MAX|SWT.RESIZE</code>.
* Subclassers should call <code>setShellStyle</code> to change this
* value, rather than overriding this method.
* </p>
*
* @return the shell style bits
*/
int GetShellStyle();
/**
* Notifies that the window's close button was pressed, the close menu was
* selected, or the ESCAPE key pressed.
* <p>
* The default implementation of this framework method sets the window's
* return code to <code>CANCEL</code> and closes the window using
* <code>close</code>. Subclasses may extend or reimplement.
* </p>
*/
virtual void HandleShellCloseEvent();
/**
* Initializes the location and size of this window's SWT shell after it has
* been created.
* <p>
* This framework method is called by the <code>create</code> framework
* method. The default implementation calls <code>getInitialSize</code>
* and <code>getInitialLocation</code> and passes the results to
* <code>Shell.setBounds</code>. This is only done if the bounds of the
* shell have not already been modified. Subclasses may extend or
* reimplement.
* </p>
*/
virtual void InitializeBounds();
/**
* Changes the parent shell. This is only safe to use when the shell is not
* yet realized (i.e., created). Once the shell is created, it must be
* disposed (i.e., closed) before this method can be called.
*
* @param newParentShell
* The new parent shell; this value may be <code>null</code> if
* there is to be no parent.
* @since 3.1
*/
void SetParentShell(Shell::Pointer newParentShell);
/**
* Sets this window's return code. The return code is automatically returned
* by <code>open</code> if block on open is enabled. For non-blocking
* opens, the return code needs to be retrieved manually using
* <code>getReturnCode</code>.
*
* @param code
* the return code
*/
void SetReturnCode(int code);
/**
* Sets the shell style bits. This method has no effect after the shell is
* created.
* <p>
* The shell style bits are used by the framework method
* <code>createShell</code> when creating this window's shell.
* </p>
*
* @param newShellStyle
* the new shell style bits
*/
void SetShellStyle(int newShellStyle);
/**
* Configures this window to have a menu bar.
* Does nothing if it already has one.
* This method must be called before this window's shell is created.
*/
void AddMenuBar();
/**
* Returns a new menu manager for the window.
* <p>
* Subclasses may override this method to customize the menu manager.
* </p>
* @return a menu manager
*/
virtual SmartPointer<MenuManager> CreateMenuManager();
/**
* Creates the trim widgets around the content area.
*
* @param shell the shell
*/
virtual void CreateTrimWidgets(SmartPointer<Shell> shell);
public:
/**
* Closes this window, disposes its shell, and removes this window from its
* window manager (if it has one).
* <p>
* This framework method may be extended (<code>super.close</code> must
* be called).
* </p>
* <p>
* Note that in order to prevent recursive calls to this method
* it does not call <code>Shell#close()</code>. As a result <code>ShellListener</code>s
* will not receive a <code>shellClosed</code> event.
* </p>
*
* @return <code>true</code> if the window is (or was already) closed, and
* <code>false</code> if it is still open
*/
virtual bool Close();
/**
* Creates this window's widgetry in a new top-level shell.
* <p>
* The default implementation of this framework method creates this window's
* shell (by calling <code>createShell</code>), and its controls (by
* calling <code>createContents</code>), then initializes this window's
* shell bounds (by calling <code>initializeBounds</code>).
* </p>
*/
virtual void Create();
/**
* Returns the default image. This is the image that will be used for
* windows that have no shell image at the time they are opened. There is no
* default image unless one is installed via <code>setDefaultImage</code>.
*
* @return the default image, or <code>null</code> if none
* @see #setDefaultImage
*/
static QIcon GetDefaultImage();
/**
* Returns the array of default images to use for newly opened windows. It
* is expected that the array will contain the same icon rendered at
* different resolutions.
*
* @see org.blueberry.swt.widgets.Decorations#setImages(org.blueberry.swt.graphics.Image[])
*
* @return the array of images to be used when a new window is opened
* @see #setDefaultImages
* @since 3.0
*/
static QList<QIcon> GetDefaultImages();
/**
* Returns this window's return code. A window's return codes are
* window-specific, although two standard return codes are predefined:
* <code>OK</code> and <code>CANCEL</code>.
*
* @return the return code
*/
int GetReturnCode();
/**
* Returns this window's shell.
*
* @return this window's shell, or <code>null</code> if this window's
* shell has not been created yet
*/
Shell::Pointer GetShell() const override;
/**
* Returns the window manager of this window.
*
* @return the WindowManager, or <code>null</code> if none
*/
WindowManager* GetWindowManager();
/**
* Returns the menu bar manager for this window (if it has one).
*
* @return the menu bar manager, or <code>null</code> if
* this window does not have a menu bar
* @see #addMenuBar()
*/
MenuManager* GetMenuBarManager() const;
/**
* Opens this window, creating it first if it has not yet been created.
* <p>
* If this window has been configured to block on open (
* <code>setBlockOnOpen</code>), this method waits until the window is
* closed by the end user, and then it returns the window's return code;
* otherwise, this method returns immediately. A window's return codes are
* window-specific, although two standard return codes are predefined:
* <code>OK</code> and <code>CANCEL</code>.
* </p>
*
* @return the return code
*
* @see #create()
*/
int Open();
/**
* Sets whether the <code>open</code> method should block until the window
* closes.
*
* @param shouldBlock
* <code>true</code> if the <code>open</code> method should
* not return until the window closes, and <code>false</code>
* if the <code>open</code> method should return immediately
*/
void SetBlockOnOpen(bool shouldBlock);
/**
* Sets the default image. This is the image that will be used for windows
* that have no shell image at the time they are opened. There is no default
* image unless one is installed via this method.
*
* @param image
* the default image, or <code>null</code> if none
*/
static void SetDefaultImage(const QIcon& image);
/**
* Sets the array of default images to use for newly opened windows. It is
* expected that the array will contain the same icon rendered at different
* resolutions.
*
* @see org.blueberry.swt.widgets.Decorations#setImages(org.blueberry.swt.graphics.Image[])
*
* @param images
* the array of images to be used when this window is opened
* @since 3.0
*/
static void SetDefaultImages(const QList<QIcon>& images);
/**
* Sets the window manager of this window.
* <p>
* Note that this method is used by <code>WindowManager</code> to maintain
* a backpointer. Clients must not call the method directly.
* </p>
*
* @param manager
* the window manager, or <code>null</code> if none
*/
void SetWindowManager(WindowManager* manager);
/**
* Sets the exception handler for this application.
* <p>
* Note that the handler may only be set once. Subsequent calls to this method will be
* ignored.
* <p>
*
* @param handler
* the exception handler for the application.
*/
static void SetExceptionHandler(IExceptionHandler::Pointer handler);
/**
* Sets the default parent for modal Windows. This will be used to locate
* the parent for any modal Window constructed with a null parent.
*
* @param provider shell provider that will be used to locate the parent shell
* whenever a Window is created with a null parent
* @since 3.1
*/
static void SetDefaultModalParent(IShellProvider::Pointer provider);
};
}
#endif /* BERRYWINDOW_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/berryWorkbenchPart.cpp b/Plugins/org.blueberry.ui.qt/src/berryWorkbenchPart.cpp
index 44106cd73c..325e531c1d 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryWorkbenchPart.cpp
+++ b/Plugins/org.blueberry.ui.qt/src/berryWorkbenchPart.cpp
@@ -1,286 +1,286 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "berryWorkbenchPart.h"
#include "berryIWorkbenchPartConstants.h"
#include <berryIContributor.h>
#include <berrySafeRunner.h>
#include <util/berrySafeRunnable.h>
#include "berryWorkbenchPlugin.h"
#include <berryObjectString.h>
#include <berryObjects.h>
namespace berry
{
class PropChangedRunnable : public SafeRunnable
{
public:
- berryObjectMacro(PropChangedRunnable)
+ berryObjectMacro(PropChangedRunnable);
IPropertyChangeListener::Events::EventType::AbstractDelegate* delegate;
PropChangedRunnable(PropertyChangeEvent::Pointer event)
: event(event)
{}
void Run() override
{
delegate->Execute(event);
}
private:
PropertyChangeEvent::Pointer event;
};
WorkbenchPart::~WorkbenchPart()
{
}
WorkbenchPart::WorkbenchPart()
:m_Title(""),
m_ToolTip(""),
m_PartName(""),
m_ContentDescription("")
{
}
void WorkbenchPart::InternalSetContentDescription(
const QString& description)
{
//assert(description != 0)
//Do not send changes if they are the same
if (this->m_ContentDescription == description)
{
return;
}
this->m_ContentDescription = description;
this->FirePropertyChange(IWorkbenchPartConstants::PROP_CONTENT_DESCRIPTION);
}
void WorkbenchPart::InternalSetPartName(const QString& partName)
{
//partName = Util.safeString(partName);
//assert(partName != 0);
//Do not send changes if they are the same
if (this->m_PartName == partName)
{
return;
}
this->m_PartName = partName;
this->FirePropertyChange(IWorkbenchPartConstants::PROP_PART_NAME);
}
// IConfigurationElement* GetConfigurationElement()
// {
// return m_ConfigElement;
// }
// protected Image getDefaultImage() {
// return PlatformUI.getWorkbench().getSharedImages().getImage(
// ISharedImages.IMG_DEF_VIEW);
// }
void WorkbenchPart::SetSite(IWorkbenchPartSite::Pointer site)
{
this->CheckSite(site);
this->m_PartSite = site;
}
void WorkbenchPart::CheckSite(IWorkbenchPartSite::Pointer /*site*/)
{
// do nothing
}
void WorkbenchPart::SetTitleImage(const QIcon& titleImage)
{
//assert(titleImage == 0 || !titleImage.isDisposed());
//Do not send changes if they are the same
if (this->m_TitleImage.cacheKey() == titleImage.cacheKey())
{
return;
}
this->m_TitleImage = titleImage;
this->FirePropertyChange(IWorkbenchPartConstants::PROP_TITLE);
}
void WorkbenchPart::SetTitleToolTip(const QString& toolTip)
{
//toolTip = Util.safeString(toolTip);
//Do not send changes if they are the same
if (this->m_ToolTip == toolTip)
{
return;
}
this->m_ToolTip = toolTip;
this->FirePropertyChange(IWorkbenchPartConstants::PROP_TITLE);
}
void WorkbenchPart::SetPartName(const QString& partName)
{
InternalSetPartName(partName);
//setDefaultTitle();
}
void WorkbenchPart::SetContentDescription(const QString& description)
{
InternalSetContentDescription(description);
//setDefaultTitle();
}
void WorkbenchPart::FirePropertyChanged(const QString& key,
const QString& oldValue, const QString& newValue)
{
ObjectString::Pointer objOldVal(new ObjectString(oldValue));
ObjectString::Pointer objNewVal(new ObjectString(newValue));
Object::Pointer source(this);
PropertyChangeEvent::Pointer event(
new PropertyChangeEvent(source, key, objOldVal, objNewVal));
typedef IPropertyChangeListener::Events::EventType::ListenerList ListenerList;
PropChangedRunnable::Pointer runnable(new PropChangedRunnable(event));
const ListenerList& listeners =
partChangeEvents.propertyChange.GetListeners();
for (auto iter = listeners.begin(); iter
!= listeners.end(); ++iter)
{
runnable->delegate = *iter;
SafeRunner::Run(runnable);
}
}
void WorkbenchPart::FirePropertyChange(int propertyId)
{
ObjectInt::Pointer val(new ObjectInt(propertyId));
Object::Pointer source(this);
PropertyChangeEvent::Pointer event(
new PropertyChangeEvent(source, IWorkbenchPartConstants::INTEGER_PROPERTY, val, val));
typedef IPropertyChangeListener::Events::EventType::ListenerList ListenerList;
PropChangedRunnable::Pointer runnable(new PropChangedRunnable(event));
const ListenerList& listeners =
partChangeEvents.propertyChange.GetListeners();
for (auto iter = listeners.begin(); iter
!= listeners.end(); ++iter)
{
runnable->delegate = *iter;
SafeRunner::Run(runnable);
}
}
void WorkbenchPart::AddPropertyListener(IPropertyChangeListener* l)
{
partChangeEvents.AddListener(l);
}
void WorkbenchPart::RemovePropertyListener(IPropertyChangeListener* l)
{
partChangeEvents.RemoveListener(l);
}
void WorkbenchPart::SetPartProperty(const QString& key,
const QString& value)
{
QHash<QString, QString>::iterator iter = partProperties.find(key);
QString oldValue;
if (iter != partProperties.end())
oldValue = iter.value();
if (value == "")
{
partProperties.remove(key);
}
else
{
partProperties.insert(key, value);
}
this->FirePropertyChanged(key, oldValue, value);
}
QString WorkbenchPart::GetPartProperty(const QString& key) const
{
QHash<QString, QString>::const_iterator itr = partProperties.find(key);
if (itr == partProperties.end()) return "";
return itr.value();
}
const QHash<QString, QString> &WorkbenchPart::GetPartProperties() const
{
return partProperties;
}
IWorkbenchPartSite::Pointer WorkbenchPart::GetSite() const
{
return this->m_PartSite;
}
QString WorkbenchPart::GetPartName() const
{
return this->m_PartName;
}
QString WorkbenchPart::GetContentDescription() const
{
return this->m_ContentDescription;
}
QIcon WorkbenchPart::GetTitleImage() const
{
return this->m_TitleImage;
//return GetDefaultImage();
}
QString WorkbenchPart::GetTitleToolTip() const
{
return this->m_ToolTip;
}
void WorkbenchPart::SetInitializationData(const IConfigurationElement::Pointer& cfig,
const QString& /*propertyName*/, const Object::Pointer& /*data*/)
{
// Save config element.
m_ConfigElement = cfig;
// Part name and title.
m_PartName = cfig->GetAttribute("name");
m_Title = m_PartName;
// Icon.
QString strIcon = cfig->GetAttribute("icon");
if (strIcon.isEmpty())
{
return;
}
m_TitleImage = AbstractUICTKPlugin::ImageDescriptorFromPlugin(
m_ConfigElement->GetContributor()->GetName(), strIcon);
}
} // namespace berry
diff --git a/Plugins/org.blueberry.ui.qt/src/berryWorkbenchPart.h b/Plugins/org.blueberry.ui.qt/src/berryWorkbenchPart.h
index a3df7f1942..5941478e43 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryWorkbenchPart.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryWorkbenchPart.h
@@ -1,252 +1,252 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __BERRY_WORKBENCH_PART_H__
#define __BERRY_WORKBENCH_PART_H__
#include "berryIWorkbenchPart.h"
#include "berryIWorkbenchPartSite.h"
#include <berryIConfigurationElement.h>
#include <berryIExecutableExtension.h>
#include <QIcon>
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* Abstract base implementation of all workbench parts.
* <p>
* This class is not intended to be subclassed by clients outside this
* package; clients should instead subclass <code>ViewPart</code> or
* <code>EditorPart</code>.
* </p>
*
* @see org.blueberry.ui.part.ViewPart
* @see org.blueberry.ui.part.EditorPart
* @noextend This class is not intended to be subclassed by clients.
*/
class BERRY_UI_QT WorkbenchPart : public QObject,
public virtual IWorkbenchPart, public IExecutableExtension
{
Q_OBJECT
Q_INTERFACES(berry::IExecutableExtension);
public:
- berryObjectMacro(WorkbenchPart, QObject, IWorkbenchPart, IExecutableExtension)
+ berryObjectMacro(WorkbenchPart, QObject, IWorkbenchPart, IExecutableExtension);
~WorkbenchPart() override;
private:
QString m_Title;
QIcon m_TitleImage;
QString m_ToolTip;
IConfigurationElement::Pointer m_ConfigElement;
IWorkbenchPartSite::Pointer m_PartSite;
QString m_PartName;
QString m_ContentDescription;
QHash<QString, QString> partProperties;
IPropertyChangeListener::Events partChangeEvents;
void InternalSetContentDescription(const QString& description);
void InternalSetPartName(const QString& partName);
protected:
WorkbenchPart();
/**
* Returns the configuration element for this part. The configuration element
* comes from the plug-in registry entry for the extension defining this part.
*
* @return the configuration element for this part
*/
IConfigurationElement::Pointer GetConfigurationElement() const
{
return m_ConfigElement;
}
/**
* Returns the default title image.
*
* @return the default image
*/
// protected Image getDefaultImage() {
// return PlatformUI.getWorkbench().getSharedImages().getImage(
// ISharedImages.IMG_DEF_VIEW);
// }
/**
* Sets the part site.
* <p>
* Subclasses must invoke this method from <code>IEditorPart.init</code>
* and <code>IViewPart.init</code>.
*
* @param site the workbench part site
*/
void SetSite(IWorkbenchPartSite::Pointer site);
/**
* Checks that the given site is valid for this type of part.
* The default implementation does nothing.
*
* @param site the site to check
*/
virtual void CheckSite(IWorkbenchPartSite::Pointer site);
/**
* Sets or clears the title image of this part.
*
* @param titleImage the title image, or <code>null</code> to clear
*/
virtual void SetTitleImage(const QIcon& titleImage);
/**
* Sets or clears the title tool tip text of this part. Clients should
* call this method instead of overriding <code>getTitleToolTip</code>
*
* @param toolTip the new tool tip text, or <code>null</code> to clear
*/
virtual void SetTitleToolTip(const QString& toolTip);
/**
* Sets the name of this part. The name will be shown in the tab area for
* the part. Clients should call this method instead of overriding getPartName.
* Setting this to the empty string will cause a default part name to be used.
*
* @param partName the part name, as it should be displayed in tabs.
*/
virtual void SetPartName(const QString& partName);
/**
* Sets the content description for this part. The content description is typically
* a short string describing the current contents of the part. Setting this to the
* empty string will cause a default content description to be used. Clients should
* call this method instead of overriding getContentDescription(). For views, the
* content description is shown (by default) in a line near the top of the view. For
* editors, the content description is shown beside the part name when showing a
* list of editors. If the editor is open on a file, this typically contains the path
* to the input file, without the filename or trailing slash.
*
* @param description the content description
*/
virtual void SetContentDescription(const QString& description);
void FirePropertyChanged(const QString& key,
const QString& oldValue, const QString& newValue);
void FirePropertyChange(int propertyId);
public:
/* (non-Javadoc)
* Method declared on IWorkbenchPart.
*/
void AddPropertyListener(IPropertyChangeListener* l) override;
void RemovePropertyListener(IPropertyChangeListener* l) override;
void SetPartProperty(const QString& key, const QString& value) override;
/* (non-Javadoc)
* @see org.blueberry.ui.IWorkbenchPart3#getPartProperty(java.lang.String)
*/
QString GetPartProperty(const QString& key) const override;
/* (non-Javadoc)
* @see org.blueberry.ui.IWorkbenchPart3#getPartProperties()
*/
const QHash<QString, QString>& GetPartProperties() const override;
/**
* {@inheritDoc}
* The <code>WorkbenchPart</code> implementation of this
* <code>IExecutableExtension</code> records the configuration element in
* and internal state variable (accessible via <code>getConfigElement</code>).
* It also loads the title image, if one is specified in the configuration element.
* Subclasses may extend.
*
* Should not be called by clients. It is called by the core plugin when creating
* this executable extension.
*/
void SetInitializationData(const IConfigurationElement::Pointer& cfig,
const QString& propertyName, const Object::Pointer& data) override;
/*
* Creates the controls for this workbench part.
* <p>
* Subclasses must implement this method. For a detailed description of the
* requirements see <code>IWorkbenchPart</code>
* </p>
*
* @param parent the parent control
* @see IWorkbenchPart
*/
void CreatePartControl(QWidget* parent) override = 0;
/* (non-Javadoc)
* Asks this part to take focus within the workbench.
* <p>
* Subclasses must implement this method. For a detailed description of the
* requirements see <code>IWorkbenchPart</code>
* </p>
*
* @see IWorkbenchPart
*/
void SetFocus() override = 0;
/*
* Method declared on IWorkbenchPart.
*/
IWorkbenchPartSite::Pointer GetSite() const override;
/**
* {@inheritDoc}
* <p>
* It is considered bad practise to overload or extend this method.
* Parts should call setPartName to change their part name.
* </p>
*/
QString GetPartName() const override;
/**
* {@inheritDoc}
* <p>
* It is considered bad practise to overload or extend this method.
* Parts should call setContentDescription to change their content description.
* </p>
*/
QString GetContentDescription() const override;
/* (non-Javadoc)
* Method declared on IWorkbenchPart.
*/
QIcon GetTitleImage() const override;
/* (non-Javadoc)
* Gets the title tool tip text of this part.
*
* @return the tool tip text
*/
QString GetTitleToolTip() const override;
};
} // namespace berry
#endif // __BERRY_WORKBENCH_PART_H__
diff --git a/Plugins/org.blueberry.ui.qt/src/berryXMLMemento.h b/Plugins/org.blueberry.ui.qt/src/berryXMLMemento.h
index c279d96757..4ccdc565f2 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryXMLMemento.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryXMLMemento.h
@@ -1,283 +1,283 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYXMLMEMENTO_H_
#define BERRYXMLMEMENTO_H_
#include <berryMacros.h>
#include "berryIMemento.h"
#include "berryUIException.h"
#include "Poco/DOM/Document.h"
#include "Poco/DOM/Element.h"
#include "Poco/SAX/XMLReader.h"
namespace berry {
/**
* This class represents the default implementation of the
* <code>IMemento</code> interface.
* <p>
* This class is not intended to be extended by clients.
* </p>
*
* @see IMemento
*/
class BERRY_UI_QT XMLMemento : public IMemento
{
public:
- berryObjectMacro(XMLMemento)
+ berryObjectMacro(XMLMemento);
/**
* Defines a std::ostream as XML output stream
*/
typedef std::ostream XMLByteOutputStream;
/**
* Defines a std::istream as XML input stream
*/
typedef std::istream XMLByteInputStream;
/**
* Creates a memento for the specified document and element.
* <p>
* Clients should use <code>CreateReadRoot</code> and
* <code>CreateWriteRoot</code> to create the initial
* memento on a document.
* </p>
*
* @param document the document for the memento
* @param element the element node for the memento
*/
XMLMemento(Poco::XML::Document* document, Poco::XML::Element* elem);
~XMLMemento() override;
/**
* Creates a <code>Document</code> from the <code>Reader</code>
* and returns a memento on the first <code>Element</code> for reading
* the document.
*
* @param reader the <code>Reader</code> used to create the memento's document
* @return a memento on the first <code>Element</code> for reading the document
* @throws WorkbenchException if IO problems, invalid format, or no element.
*/
static XMLMemento::Pointer CreateReadRoot(berry::XMLMemento::XMLByteInputStream& reader);
/**
* Creates a <code>Document</code> from the <code>Reader</code>
* and returns a memento on the first <code>Element</code> for reading
* the document.
*
* @param reader the <code>Reader</code> used to create the memento's document
* @param baseDir the directory used to resolve relative file names
* in the XML document. This directory must exist and include the
* trailing separator. The directory format, including the separators,
* must be valid for the platform. Can be <code>null</code> if not
* needed.
* @return a memento on the first <code>Element</code> for reading the document
* @throws WorkbenchException if IO problems, invalid format, or no element.
*/
static XMLMemento::Pointer CreateReadRoot(berry::XMLMemento::XMLByteInputStream& reader, const QString& baseDir);
/**
* Returns a root memento for writing a document.
*
* @param type the element node type to create on the document
* @return the root memento for writing a document
*/
static XMLMemento::Pointer CreateWriteRoot(const QString& type);
/**
* Copies another Memento into this memento
*
* @param child the new child memento
* @return the new child memento
*/
IMemento::Pointer CopyChild(IMemento::Pointer child);
/**
* Creates a new child of this memento with the given type
*
* @param type the type
* @return a new child memento with the given type
*/
IMemento::Pointer CreateChild(const QString& type) override;
/**
* Creates a new child of this memento with the given type and id.
* The id is stored in the child memento (using a special reserved
* key, <code>TAG_ID</code>) and can be retrieved using <code>getId</code>.
* <p>
* The <code>getChild</code> and <code>getChildren</code> methods
* are used to retrieve children of a given type.
* </p>
*
* @param type the type
* @param id the child id
* @return a new child memento with the given type and id
* @see #getID
*/
IMemento::Pointer CreateChild(const QString& type, const QString& id) override;
/**
* Returns the first child with the given type id.
*
* @param type the type id
* @return the first child with the given type
*/
IMemento::Pointer GetChild(const QString& type) const override;
/**
* Returns all children with the given type id.
*
* @param type the type id
* @return an array of children with the given type
*/
QList< IMemento::Pointer > GetChildren(const QString& type) const override;
/**
* Returns the Type of this memento
*/
QString GetType() const override;
/**
* Returns the ID of this memento
*/
QString GetID() const override;
/**
* @see IMemento#GetInteger
*/
bool GetInteger(const QString& key, int& value) const override;
/**
* @see IMemento#GetFloat
*/
bool GetFloat(const QString& key, double& value) const override;
/**
* @see IMemento#GetString
*/
bool GetString(const QString& key, QString& value) const override;
/**
* @see IMemento#GetString
*/
bool GetBoolean(const QString& key, bool& value) const override;
/**
* Returns the data of the Text node of the memento. Each memento is allowed
* only one Text node.
*
* @return the data of the Text node of the memento, or <code>null</code>
* if the memento has no Text node.
*/
QString GetTextData() const override;
/**
* Returns an array of all the attribute keys of the memento. This will not
* be <code>null</code>. If there are no keys, an array of length zero will
* be returned.
* @return an vector with all the attribute keys of the memento
*/
QList< QString > GetAttributeKeys() const override;
/**
* Puts a float in this memento
*
* @param key the key
* @param value the value
*/
void PutFloat(const QString& key, double value) override;
/**
* Puts a integer in this memento
*
* @param key the key
* @param value the value
*/
void PutInteger(const QString& key, int value) override;
/**
* Puts another memento in this memento as a child
*
* @param key the key
* @param value the value
*/
void PutMemento(IMemento::Pointer memento) override;
/**
* Puts a string in this memento
*
* @param key the key
* @param value the value
*/
void PutString(const QString& key, const QString& value) override;
/**
* Puts a boolean in this memento
*
* @param key the key
* @param value the value
*/
void PutBoolean(const QString& key, bool value) override;
/**
* Puts a text in this memento
*
* @param data the text
*/
void PutTextData(const QString& data) override;
/**
* Saves this memento's document current values to the
* specified writer.
*
* @param writer the writer used to save the memento's document
* @throws IOException if there is a problem serializing the document to the stream.
*/
void Save(XMLByteOutputStream& writer); //TODO: throw(IOException)
/**
* Returns the element of the memento
*
* @return the xml element
*/
virtual Poco::XML::Element* GetElement() const;
private:
/**
* Returns the Text node of the memento. Each memento is allowed only
* one Text node.
*
* @return the Text node of the memento, or <code>null</code> if
* the memento has no Text node.
*/
Poco::XML::Text* GetTextNode() const;
/**
* Places the element's attributes into the document.
* @param copyText true if the first text node should be copied
*/
void PutElement(Poco::XML::Element* element, bool copyText);
Poco::XML::Document* factory;
Poco::XML::Element* element;
};
}//namespace berry
#endif /* BERRYXMLMEMENTO_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/commands/berryICommandImageService.h b/Plugins/org.blueberry.ui.qt/src/commands/berryICommandImageService.h
index 7a6c15373a..0d18b6cd79 100644
--- a/Plugins/org.blueberry.ui.qt/src/commands/berryICommandImageService.h
+++ b/Plugins/org.blueberry.ui.qt/src/commands/berryICommandImageService.h
@@ -1,99 +1,99 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYICOMMANDIMAGESERVICE_H_
#define BERRYICOMMANDIMAGESERVICE_H_
#include "../services/berryIDisposable.h"
#include <QIcon>
namespace berry {
/**
* <p>
* Provides a look-up facility for images associated with commands.
* </p>
* <p>
* The <em>type</em> of an image indicates the state of the associated command
* within the user interface. The supported types are: <code>TYPE_DEFAULT</code>
* (to be used for an enabled command), <code>TYPE_DISABLED</code> (to be used
* for a disabled command) and <code>TYPE_HOVER</code> (to be used for an
* enabled command over which the mouse is hovering).
* </p>
* <p>
* The <em>style</em> of an image is an arbitrary string used to distinguish
* between sets of images associated with a command. For example, a command may
* appear in the menus as the default style. However, in the toolbar, the
* command is simply the default action for a toolbar drop down item. As such,
* perhaps a different image style is appropriate. The classic case is the "Run
* Last Launched" command, which appears in the menu and the toolbar, but with
* different icons in each location.
* </p>
* <p>
* We currently support a default image style (none) and an image style of
* IMAGE_STYLE_TOOLBAR.
* </p>
*
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*
*/
struct BERRY_UI_QT ICommandImageService : public IDisposable
{
- berryObjectMacro(berry::ICommandImageService)
+ berryObjectMacro(berry::ICommandImageService);
/**
* The default image style. This is provided when no style is requested or
* when the requested style is unavailable. (Value is <b>null</b>)
*/
static const QString IMAGE_STYLE_DEFAULT;
/**
* The image style used for commands in a toolbar. This is useful if you
* want the icon for the command in the toolbar to be different than the one
* that is displayed with menu items. (Value is <b>toolbar</b>)
*/
static const QString IMAGE_STYLE_TOOLBAR; // = "toolbar";
/**
* Retrieves the image associated with the given command in the
* default style.
*
* @param commandId
* The identifier to find; must not be <code>null</code>.
* @return An image appropriate for the given command; may be
* <code>null</code>.
*/
virtual QIcon GetImage(const QString& commandId) = 0;
/**
* Retrieves the image associated with the given command in the
* given style.
*
* @param commandId
* The identifier to find; must not be <code>null</code>.
* @param style
* The style of the image to retrieve; may be <code>null</code>.
* @return An image appropriate for the given command; A null QIcon
* if the given image style cannot be found.
*/
virtual QIcon GetImage(const QString& commandId, const QString& style) = 0;
};
}
Q_DECLARE_INTERFACE(berry::ICommandImageService, "org.blueberry.ui.ICommandImageService")
#endif /* BERRYICOMMANDIMAGESERVICE_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/commands/berryICommandService.h b/Plugins/org.blueberry.ui.qt/src/commands/berryICommandService.h
index 4b1729e80c..45ed978431 100644
--- a/Plugins/org.blueberry.ui.qt/src/commands/berryICommandService.h
+++ b/Plugins/org.blueberry.ui.qt/src/commands/berryICommandService.h
@@ -1,372 +1,372 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYICOMMANDSERVICE_H_
#define BERRYICOMMANDSERVICE_H_
#include "../services/berryIDisposable.h"
#include <QHash>
namespace berry {
struct IExecutionListener;
struct IHandler;
struct IElementReference;
class UIElement;
class Command;
class CommandCategory;
class ParameterizedCommand;
class ParameterType;
/**
* <p>
* Provides services related to the command architecture within the workbench.
* This service can be used to access the set of commands and command
* categories.
* </p>
* <p>
* This service can be acquired from your service locator:
* <pre>
* ICommandService service = (ICommandService) getSite().getService(ICommandService.class);
* </pre>
* <ul>
* <li>This service is available globally.</li>
* </ul>
* </p>
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
struct BERRY_UI_QT ICommandService : public IDisposable
{
- berryObjectMacro(berry::ICommandService)
+ berryObjectMacro(berry::ICommandService);
/**
* The identifier of the category in which all auto-generated commands will
* appear. This value must never be <code>null</code>.
*/
static const QString AUTOGENERATED_CATEGORY_ID();
/**
* Adds an execution listener to the command service. This listener will be
* notified as commands are executed.
* <p>
* <b>Note:</b> listeners should be removed when no longer necessary. If
* not, they will be removed when the IServiceLocator used to acquire this
* service is disposed.
* </p>
*
* @param listener
* The listener to add; must not be <code>null</code>.
* @see #removeExecutionListener(IExecutionListener)
*/
virtual void AddExecutionListener(IExecutionListener* listener) = 0;
/**
* Sets the name and description of the category for uncategorized commands.
* This is the category that will be returned if
* {@link #getCategory(String)} is called with <code>null</code>.
*
* @param name
* The name of the category for uncategorized commands; must not
* be <code>null</code>.
* @param description
* The description of the category for uncategorized commands;
* may be <code>null</code>.
*/
virtual void DefineUncategorizedCategory(const QString& name, const QString& description) = 0;
/**
* <p>
* Returns a {@link ParameterizedCommand} with a command and
* parameterizations as specified in the provided
* <code>serializedParameterizedCommand</code> string. The
* <code>serializedParameterizedCommand</code> must use the format
* returned by {@link ParameterizedCommand#serialize()} and described in the
* Javadoc for that method.
* </p>
* <p>
* If a parameter id encoded in the
* <code>serializedParameterizedCommand</code> does not exist in the
* encoded command, that parameter id and value are ignored. A given
* parameter id should not be used more than once in
* <code>serializedParameterizedCommand</code>. This will not result in
* an exception, but the value of the parameter when the command is executed
* cannot be specified here.
* </p>
* <p>
* This method will never return <code>null</code>, however it may throw
* an exception if there is a problem processing the serialization string or
* the encoded command is undefined.
* </p>
*
* @param serializedParameterizedCommand
* a <code>String</code> representing a command id and
* parameter ids and values
* @return a <code>ParameterizedCommand</code> with the command and
* parameterizations encoded in the
* <code>serializedParameterizedCommand</code>
* @throws NotDefinedException
* if the command indicated in
* <code>serializedParameterizedCommand</code> is not defined
* @throws SerializationException
* if there is an error deserializing
* <code>serializedParameterizedCommand</code>
* @see ParameterizedCommand#serialize()
* @see CommandManager#deserialize(String)
*/
virtual SmartPointer<ParameterizedCommand> Deserialize(const QString& serializedParameterizedCommand) const = 0;
/**
* Retrieves the category with the given identifier. If no such category
* exists, then an undefined category with the given id is created.
*
* @param categoryId
* The identifier to find. If the category is <code>null</code>,
* then a category suitable for uncategorized items is defined
* and returned.
* @return A category with the given identifier, either defined or
* undefined.
*/
virtual SmartPointer<CommandCategory> GetCategory(const QString& categoryId) const = 0;
/**
* Retrieves the command with the given identifier. If no such command
* exists, then an undefined command with the given id is created.
*
* @param commandId
* The identifier to find; must not be <code>null</code>.
* @return A command with the given identifier, either defined or undefined.
*/
virtual SmartPointer<Command> GetCommand(const QString& commandId) const = 0;
/**
* Returns the collection of all of the defined categories in the workbench.
*
* @return The collection of categories (<code>Category</code>) that are
* defined; never <code>null</code>, but may be empty.
*/
virtual QList<SmartPointer<CommandCategory> > GetDefinedCategories() const = 0;
/**
* Returns the collection of the identifiers for all of the defined
* categories in the workbench.
*
* @return The collection of category identifiers (<code>String</code>)
* that are defined; never <code>null</code>, but may be empty.
*/
virtual QStringList GetDefinedCategoryIds() const = 0;
/**
* Returns the collection of the identifiers for all of the defined commands
* in the workbench.
*
* @return The collection of command identifiers (<code>String</code>)
* that are defined; never <code>null</code>, but may be empty.
*/
virtual QStringList GetDefinedCommandIds() const = 0;
/**
* Returns the collection of all of the defined commands in the workbench.
*
* @return The collection of commands (<code>Command</code>) that are
* defined; never <code>null</code>, but may be empty.
*/
virtual QList<SmartPointer<Command> > GetDefinedCommands() const = 0;
/**
* Returns the collection of the identifiers for all of the defined command
* parameter types in the workbench.
*
* @return The collection of command parameter type identifiers (<code>String</code>)
* that are defined; never <code>null</code>, but may be empty.
*/
virtual QStringList GetDefinedParameterTypeIds() const = 0;
/**
* Returns the collection of all of the defined command parameter types in
* the workbench.
*
* @return The collection of command parameter types (<code>ParameterType</code>)
* that are defined; never <code>null</code>, but may be empty.
*/
virtual QList<SmartPointer<ParameterType> > GetDefinedParameterTypes() const = 0;
/**
* Gets the help context identifier for a particular command. The command's
* handler is first checked for a help context identifier. If the handler
* does not have a help context identifier, then the help context identifier
* for the command is returned. If neither has a help context identifier,
* then <code>null</code> is returned.
*
* @param command
* The command for which the help context should be retrieved;
* must not be <code>null</code>.
* @return The help context identifier to use for the given command; may be
* <code>null</code>.
* @throws NotDefinedException
* If the given command is not defined.
*/
virtual QString GetHelpContextId(const SmartPointer<const Command>& command) const = 0;
/**
* Gets the help context identifier for a particular command. The command's
* handler is first checked for a help context identifier. If the handler
* does not have a help context identifier, then the help context identifier
* for the command is returned. If neither has a help context identifier,
* then <code>null</code> is returned.
*
* @param commandId
* The identifier of the command for which the help context
* should be retrieved; must not be <code>null</code>.
* @return The help context identifier to use for the given command; may be
* <code>null</code>.
* @throws NotDefinedException
* If the command with the given identifier is not defined.
*/
virtual QString GetHelpContextId(const QString& commandId) const = 0;
/**
* Retrieves the command parameter type with the given identifier. If no
* such parameter type exists, then an undefined parameter type with the
* given id is created.
*
* @param parameterTypeId
* The identifier to find; must not be <code>null</code>.
* @return A command parameter type with the given identifier, either
* defined or undefined.
*/
virtual SmartPointer<ParameterType> GetParameterType(const QString& parameterTypeId) const = 0;
/**
* <p>
* Reads the command information from the registry and the preferences. This
* will overwrite any of the existing information in the command service.
* This method is intended to be called during start-up. When this method
* completes, this command service will reflect the current state of the
* registry and preference store.
* </p>
*/
virtual void ReadRegistry() = 0;
/**
* Removes an execution listener from the command service.
*
* @param listener
* The listener to remove; must not be <code>null</code>.
*/
virtual void RemoveExecutionListener(IExecutionListener* listener) = 0;
/**
* Sets the help context identifier to associate with a particular handler.
*
* @param handler
* The handler with which to register a help context identifier;
* must not be <code>null</code>.
* @param helpContextId
* The help context identifier to register; may be
* <code>null</code> if the help context identifier should be
* removed.
*/
virtual void SetHelpContextId(const SmartPointer<IHandler>& handler, const QString& helpContextId) = 0;
/**
* Register that this element accepts callbacks for this parameterized
* command.
* <p>
* <b>Note:</b> elements should be removed when no longer necessary. If
* not, they will be removed when the IServiceLocator used to acquire this
* service is disposed.
* </p>
*
* @param command
* The parameterized command that is already specialized. Must
* not be <code>null</code>.
* @param element
* The callback to register for this specialized command
* instance. Must not be <code>null</code>.
* @return A reference for the registered element that can be used to
* unregister it.
* @throws NotDefinedException
* If the command included in the ParameterizedCommand is not
* defined, or the element is <code>null</code>.
* @see #unregisterElement(IElementReference)
*/
virtual SmartPointer<IElementReference> RegisterElementForCommand(
const SmartPointer<ParameterizedCommand>& command,
const SmartPointer<UIElement>& element) = 0;
/**
* Re-register a callback element provided by the ICommandService. This
* element reference must not currently be held by the ICommandService. i.e.
* it must have been removed using
* {@link #unregisterElement(IElementReference)}.
* <p>
* <b>Note:</b> elements should be removed when no longer necessary. If
* not, they will be removed when the IServiceLocator used to acquire this
* service is disposed.
* </p>
*
* @param elementReference
* The reference to re-register. Must not be <code>null</code>.
* @see #unregisterElement(IElementReference)
*/
virtual void RegisterElement(const SmartPointer<IElementReference>& elementReference) = 0;
/**
* Unregister an element callback. It will be removed from the
* ICommandService. The same service that is used to register an element for
* a command <b>must</b> be used to unregister the element.
*
* @param elementReference
* The callback reference that was provided by the command
* service on registration. Must not be <code>null</code>.
*/
virtual void UnregisterElement(const SmartPointer<IElementReference>& elementReference) = 0;
/**
* Refresh any elements registered against the command with the given id.
* It allows the active handler the opportunity to provide user feedback. If
* the command is parameterized, some of the parameters can be specified to
* help narrow down which elements to refresh.
* <p>
* The service locator used in registering the element can also be used to
* scope the search. For example: if you wanted all elements for your
* command but only within the part's workbench window, you could use:
*
* <pre>
* Map filter = new HashMap();
* filter.put(IServiceScopes.WINDOW_SCOPE, getSite().getPage()
* .getWorkbenchWindow());
* commandService.refreshElements(commandId, filter);
* </pre>
*
* </p>
*
* @param commandId
* The command id to refresh if it has registered eleemnts.
* @param filter
* key-value pairs that can narrow down the callbacks to return.
* The parameters are <b>AND</b>ed together. This may be
* <code>null</code>.
*/
virtual void RefreshElements(const QString& commandId, const QHash<QString, Object::Pointer>& filter) = 0;
};
}
Q_DECLARE_INTERFACE(berry::ICommandService, "org.blueberry.ui.ICommandService")
#endif /* BERRYICOMMANDSERVICE_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/commands/berryIElementReference.h b/Plugins/org.blueberry.ui.qt/src/commands/berryIElementReference.h
index 88c768430b..2b7990327c 100644
--- a/Plugins/org.blueberry.ui.qt/src/commands/berryIElementReference.h
+++ b/Plugins/org.blueberry.ui.qt/src/commands/berryIElementReference.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIELEMENTREFERENCE_H_
#define BERRYIELEMENTREFERENCE_H_
#include <berryObject.h>
#include <QHash>
namespace berry {
class UIElement;
/**
* the ICommandService will return a reference for all callbacks that are
* registered. This reference can be used to unregister the specific callback.
* <p>
* Similar in functionality to an IHandlerActivation. This interface should
* not be implemented or extended by clients.
* </p>
*/
struct IElementReference : public Object
{
- berryObjectMacro(berry::IElementReference)
+ berryObjectMacro(berry::IElementReference);
/**
* The command id that this callback was registered against.
*
* @return The command id. Will not be <code>null</code>.
*/
virtual QString GetCommandId() const = 0;
/**
* The callback that was registered.
*
* @return Adapts to provide appropriate user feedback. Will not be
* <code>null</code>.
*/
virtual SmartPointer<UIElement> GetElement() const = 0;
/**
* Parameters that help scope this callback registration. For example, it
* can include parameters from the ParameterizedCommand.
*
* @return scoping parameters. Will not be <code>null</code>.
*/
virtual QHash<QString, Object::Pointer> GetParameters() const = 0;
};
}
#endif /* BERRYIELEMENTREFERENCE_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/commands/berryIElementUpdater.h b/Plugins/org.blueberry.ui.qt/src/commands/berryIElementUpdater.h
index 9fe217c696..a3c02b34b4 100644
--- a/Plugins/org.blueberry.ui.qt/src/commands/berryIElementUpdater.h
+++ b/Plugins/org.blueberry.ui.qt/src/commands/berryIElementUpdater.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIELEMENTUPDATER_H
#define BERRYIELEMENTUPDATER_H
#include <berryObject.h>
namespace berry {
class UIElement;
/**
* An IHandler for a command that expects to provide feedback through the
* registered element mechanism must implement this interface.
*/
struct IElementUpdater : public virtual Object
{
- berryObjectMacro(berry::IElementUpdater)
+ berryObjectMacro(berry::IElementUpdater);
/**
* Whenever the elements for a command are refreshed, this method is called
* on the active handler for that command.
* <p>
* <b>Note:</b> Handlers must never cache the element, which can disappear
* or be replaced at any time. Everybody should go through the
* ICommandService refreshElements(*) method.
* </p>
*
* @param element
* An element for a specific UI element. Will not be
* <code>null</code>.
* @param parameters
* Any parameters registered with the callback. It may be empty.
*/
virtual void UpdateElement(UIElement* element, const QHash<QString,Object::Pointer>& parameters) = 0;
};
}
#endif // BERRYIELEMENTUPDATER_H
diff --git a/Plugins/org.blueberry.ui.qt/src/commands/berryIMenuService.h b/Plugins/org.blueberry.ui.qt/src/commands/berryIMenuService.h
index 33b6f9144f..2bcaf474d7 100644
--- a/Plugins/org.blueberry.ui.qt/src/commands/berryIMenuService.h
+++ b/Plugins/org.blueberry.ui.qt/src/commands/berryIMenuService.h
@@ -1,118 +1,118 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIMENUSERVICE_H_
#define BERRYIMENUSERVICE_H_
#include <berryIServiceWithSources.h>
namespace berry {
class AbstractContributionFactory;
class ContributionManager;
struct IEvaluationContext;
/**
* <p>
* Provides services related to the menu architecture within the workbench. It
* can be used to contribute additional items to the menu, tool bar and status
* line.
* </p>
* <p>
* This service can be acquired from your service locator:
* <pre>
* IMenuService service = (IMenuService) getSite().getService(IMenuService.class);
* </pre>
* <ul>
* <li>This service is available globally.</li>
* </ul>
* </p>
*
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
struct IMenuService : public IServiceWithSources
{
- berryObjectMacro(berry::IMenuService)
+ berryObjectMacro(berry::IMenuService);
/**
* Contribute and initialize the contribution factory. This should only be
* called once per factory. After the call, the factory should be treated as
* an unmodifiable object.
* <p>
* <b>Note:</b> factories should be removed when no longer necessary. If
* not, they will be removed when the IServiceLocator used to acquire this
* service is disposed.
* </p>
*
* @param factory
* the contribution factory. Must not be <code>null</code>
* @see #removeContributionFactory(AbstractContributionFactory)
*/
virtual void AddContributionFactory(const SmartPointer<AbstractContributionFactory>& factory) = 0;
/**
* Remove the contributed factory from the menu service. If the factory is
* not contained by this service, this call does nothing.
*
* @param factory
* the contribution factory to remove. Must not be
* <code>null</code>.
*/
virtual void RemoveContributionFactory(const SmartPointer<AbstractContributionFactory>& factory) = 0;
/**
* Populate a <code>ContributionManager</code> at the specified starting
* location with a set of <code>IContributionItems</code>s. It applies
* <code>AbstractContributionFactory</code>s that are stored against the
* provided location.
*
* @param mgr
* The ContributionManager to populate
* @param location
* The starting location to begin populating this contribution
* manager. The format is the Menu API URI format.
* @see #releaseContributions(ContributionManager)
*/
virtual void PopulateContributionManager(ContributionManager* mgr,
const QString& location) = 0;
/**
* Before calling dispose() on a ContributionManager populated by the menu
* service, you must inform the menu service to release its contributions.
* This takes care of unregistering any IContributionItems that have their
* visibleWhen clause managed by this menu service.
*
* @param mgr
* The manager that was populated by a call to
* {@link #populateContributionManager(ContributionManager, String)}
*/
virtual void ReleaseContributions(ContributionManager* mgr) = 0;
/**
* Get the current state of eclipse as seen by the menu service.
*
* @return an IEvaluationContext containing state variables.
*
* @see org.eclipse.ui.ISources
* @see org.eclipse.ui.services.IEvaluationService
*/
virtual SmartPointer<IEvaluationContext> GetCurrentState() const = 0;
};
}
Q_DECLARE_INTERFACE(berry::IMenuService, "org.blueberry.ui.IMenuService")
#endif /* BERRYIMENUSERVICE_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/commands/berryUIElement.h b/Plugins/org.blueberry.ui.qt/src/commands/berryUIElement.h
index efd4bb0c1c..5247283484 100644
--- a/Plugins/org.blueberry.ui.qt/src/commands/berryUIElement.h
+++ b/Plugins/org.blueberry.ui.qt/src/commands/berryUIElement.h
@@ -1,128 +1,128 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYUIELEMENT_H_
#define BERRYUIELEMENT_H_
#include <berryMacros.h>
#include <berryObject.h>
#include <org_blueberry_ui_qt_Export.h>
#include <QIcon>
namespace berry {
struct IServiceLocator;
/**
* Allow a command or application to provide feedback to a user through updating
* a MenuItem or ToolItem. Initially used to update properties for UI elements
* created by the CommandContributionItem.
* <p>
* This class may be extended by clients.
* </p>
*/
class BERRY_UI_QT UIElement : public Object
{
private:
IServiceLocator* serviceLocator;
protected:
/**
* Construct a new instance of this class keyed off of the provided service
* locator.
*
* @param serviceLocator
* the locator. May not be <code>null</code>.
*/
UIElement(IServiceLocator* serviceLocator);
public:
- berryObjectMacro(berry::UIElement)
+ berryObjectMacro(berry::UIElement);
/**
* Update the label on this UI element.
*
* @param text
* The new label to display.
*/
virtual void SetText(const QString& text) = 0;
/**
* Update the tooltip on this UI element. Tooltips are currently only valid
* for toolbar contributions.
*
* @param text
* The new tooltip to display.
*/
virtual void SetToolTip(const QString& text) = 0;
/**
* Update the icon on this UI element.
*
* @param icon
* The new icon to display.
*/
virtual void SetIcon(const QIcon& icon) = 0;
/**
* Update the checked state on this UI element. For example, if this was a
* toggle or radio button.
*
* @param checked
* true to set toggle on
*/
virtual void SetChecked(bool checked) = 0;
/**
* Get the service locator scope in which this UI element resides. May not
* be <code>null</code>.
*
* <p>
* The locator may be used to obtain services that are scoped in the same
* way as the {@link UIElement}. Such services include but are not limited
* to {@link IWorkbench}, {@link IWorkbenchWindow}, and
* {@link IWorkbenchPartSite}. While this method may not return
* <code>null</code> requests for any of these particular services may
* return <code>null</code>.
* </p>
*
* @return the service locator for this element
* @see IServiceLocator#getService(Class)
*/
IServiceLocator* GetServiceLocator() const;
/**
* Set the menu contribution id to use. This is only applicable to menu
* contributions that support a drop-down style menu. The default
* implementation does nothing.
* <p>
* Example: element.setDropdownId("org.eclipse.ui.navigate.back.my.menu");
* </p>
*
* @param id
* used to populate the dropdown menu. Must not be
* <code>null</code>.
*/
virtual void SetDropDownId(const QString& id);
};
}
#endif /* BERRYUIELEMENT_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkControlEvent.h b/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkControlEvent.h
index 7e17c62f64..5d03be43c3 100755
--- a/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkControlEvent.h
+++ b/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkControlEvent.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYGUITKCONTROLEVENT_H_
#define BERRYGUITKCONTROLEVENT_H_
#include "berryGuiTkEvent.h"
namespace berry
{
namespace GuiTk
{
/**
* Instances of this class are sent as a result of
* controls being moved or resized.
*
* @see ControlListener
* @see <a href="http://www.blueberry.org/swt/">Sample code and further information</a>
*/
class BERRY_UI_QT ControlEvent: public Event
{
public:
- berryObjectMacro(ControlEvent)
+ berryObjectMacro(ControlEvent);
ControlEvent();
ControlEvent(QWidget* item, int x = 0, int y = 0, int width = 0, int height = 0);
};
}
}
#endif /* BERRYGUITKCONTROLEVENT_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkEvent.h b/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkEvent.h
index ab9097b989..ab8768b7bd 100755
--- a/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkEvent.h
+++ b/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkEvent.h
@@ -1,142 +1,142 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYGUITKEVENT_H_
#define BERRYGUITKEVENT_H_
#include <berryObject.h>
#include <berryMacros.h>
#include <org_blueberry_ui_qt_Export.h>
namespace berry
{
namespace GuiTk
{
/**
* Instances of this class are sent as a result of
* GUI events.
* <p>
* Note: The fields that are filled in depend on the widget.
* </p>
*
*/
class BERRY_UI_QT Event: public Object
{
public:
- berryObjectMacro(Event)
+ berryObjectMacro(Event);
Event();
/**
* the widget that issued the event
*/
QWidget* item;
/**
* the event specific detail field, as defined by the detail constants
* in class <code>Constants</code>
*/
int detail;
/**
* depending on the event type, the x offset of the bounding
* rectangle of the region that requires painting or the
* widget-relative, x coordinate of the pointer at the
* time the mouse button was pressed or released
*/
int x;
/**
* depending on the event type, the y offset of the bounding
* rectangle of the region that requires painting or the
* widget-relative, y coordinate of the pointer at the
* time the mouse button was pressed or released
*/
int y;
/**
* the width of the bounding rectangle of the
* region that requires painting
*/
int width;
/**
* the height of the bounding rectangle of the
* region that requires painting
*/
int height;
/**
* the button that was pressed or released; 1 for the
* first button, 2 for the second button, and 3 for the
* third button, etc.
*/
int button;
/**
* depending on the event, the character represented by the key
* that was typed. This is the final character that results
* after all modifiers have been applied. For example, when the
* user types Ctrl+A, the character value is 0x01 (ASCII SOH).
* It is important that applications do not attempt to modify the
* character value based on a stateMask (such as SWT.CTRL) or the
* resulting character will not be correct.
*/
char character;
/**
* depending on the event, the key code of the key that was typed,
* as defined by the key code constants in class <code>SWT</code>.
* When the character field of the event is ambiguous, this field
* contains the unaffected value of the original character. For
* example, typing Ctrl+M or Enter both result in the character '\r'
* but the keyCode field will also contain '\r' when Enter was typed
* and 'm' when Ctrl+M was typed.
*/
int keyCode;
/**
* depending on the event, the state of the keyboard modifier
* keys and mouse masks at the time the event was generated.
*/
int stateMask;
/**
* depending on the event, the new text that will be inserted.
* Setting this field will change the text that is about to
* be inserted or deleted.
*/
QString text;
/**
* depending on the event, a flag indicating whether the operation
* should be allowed. Setting this field to false will cancel the
* operation.
*/
bool doit;
QString ToString() const override;
};
}
}
#endif /* BERRYGUITKEVENT_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkIControlListener.h b/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkIControlListener.h
index 53d37410ac..addd0fadf0 100755
--- a/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkIControlListener.h
+++ b/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkIControlListener.h
@@ -1,236 +1,236 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYGUITKICONTROLLISTENER_H_
#define BERRYGUITKICONTROLLISTENER_H_
#include <berryMacros.h>
#include <berryMessage.h>
#include <org_blueberry_ui_qt_Export.h>
#include "berryGuiTkControlEvent.h"
namespace berry
{
namespace GuiTk
{
/**
* Classes which implement this interface provide methods
* that deal with the events that are generated by moving
* and resizing controls.
* <p>
* After creating an instance of a class that implements
* this interface it can be added to a control using the
* <code>addControlListener</code> method and removed using
* the <code>removeControlListener</code> method. When a
* control is moved or resized, the appropriate method will
* be invoked.
* </p>
*
* @see ControlAdapter
* @see ControlEvent
*/
struct BERRY_UI_QT IControlListener: public virtual Object
{
- berryObjectMacro(berry::GuiTk::IControlListener)
+ berryObjectMacro(berry::GuiTk::IControlListener);
struct BERRY_UI_QT Events {
enum Type {
NONE = 0x00000000,
MOVED = 0x00000001,
RESIZED = 0x00000002,
ACTIVATED = 0x00000004,
DESTROYED = 0x00000008,
ALL = 0xffffffff
};
Q_DECLARE_FLAGS(Types, Type)
typedef Message1<ControlEvent::Pointer> EventType;
EventType movedEvent;
EventType resizedEvent;
EventType activatedEvent;
EventType destroyedEvent;
void AddListener(IControlListener::Pointer listener);
void RemoveListener(IControlListener::Pointer listener);
private:
typedef MessageDelegate1<IControlListener, ControlEvent::Pointer> Delegate;
};
~IControlListener() override;
virtual Events::Types GetEventTypes() const = 0;
/**
* Sent when the location (x, y) of a control changes relative
* to its parent (or relative to the display, for <code>Shell</code>s).
*
* @param e an event containing information about the move
*/
virtual void ControlMoved(ControlEvent::Pointer /*e*/)
{
}
/**
* Sent when the size (width, height) of a control changes.
*
* @param e an event containing information about the resize
*/
virtual void ControlResized(ControlEvent::Pointer /*e*/)
{
}
virtual void ControlActivated(ControlEvent::Pointer /*e*/)
{
}
virtual void ControlDestroyed(ControlEvent::Pointer /*e*/)
{
}
};
template<typename R>
struct ControlMovedAdapter: public IControlListener
{
typedef R Listener;
typedef void
(R::*Callback)(ControlEvent::Pointer);
ControlMovedAdapter(R* l, Callback c) :
listener(l), callback(c)
{
poco_assert(listener);
poco_assert(callback);
}
Events::Types GetEventTypes() const override
{
return Events::MOVED;
}
void ControlMoved(ControlEvent::Pointer e) override
{
(listener->*callback)(e);
}
private:
Listener* listener;
Callback callback;
};
template<typename R>
struct ControlResizedAdapter: public IControlListener
{
typedef R Listener;
typedef void
(R::*Callback)(ControlEvent::Pointer);
ControlResizedAdapter(R* l, Callback c) :
listener(l), callback(c)
{
poco_assert(listener);
poco_assert(callback);
}
Events::Types GetEventTypes() const override
{
return Events::RESIZED;
}
void ControlResized(ControlEvent::Pointer e) override
{
(listener->*callback)(e);
}
private:
Listener* listener;
Callback callback;
};
template<typename R>
struct ControlActivatedAdapter: public IControlListener
{
typedef R Listener;
typedef void
(R::*Callback)(ControlEvent::Pointer);
ControlActivatedAdapter(R* l, Callback c) :
listener(l), callback(c)
{
poco_assert(listener);
poco_assert(callback);
}
Events::Types GetEventTypes() const override
{
return Events::ACTIVATED;
}
void ControlActivated(ControlEvent::Pointer e) override
{
(listener->*callback)(e);
}
private:
Listener* listener;
Callback callback;
};
template<typename R>
struct ControlDestroyedAdapter: public IControlListener
{
typedef R Listener;
typedef void
(R::*Callback)(ControlEvent::Pointer);
ControlDestroyedAdapter(R* l, Callback c) :
listener(l), callback(c)
{
poco_assert(listener);
poco_assert(callback);
}
Events::Types GetEventTypes() const override
{
return Events::DESTROYED;
}
void ControlDestroyed(ControlEvent::Pointer e) override
{
(listener->*callback)(e);
}
private:
Listener* listener;
Callback callback;
};
}
}
Q_DECLARE_OPERATORS_FOR_FLAGS(berry::GuiTk::IControlListener::Events::Types)
#endif /* BERRYGUITKICONTROLLISTENER_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkISelectionListener.h b/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkISelectionListener.h
index 05b6976fac..a3779ef78e 100755
--- a/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkISelectionListener.h
+++ b/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkISelectionListener.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYGUITKISELECTIONLISTENER_H_
#define BERRYGUITKISELECTIONLISTENER_H_
#include <berryMacros.h>
#include <berryMessage.h>
#include "berryGuiTkSelectionEvent.h"
namespace berry
{
namespace GuiTk
{
/**
* Classes which implement this interface provide methods
* that deal with the events that are generated when selection
* occurs in a control.
* <p>
* After creating an instance of a class that implements
* this interface it can be added to a control using the
* <code>addSelectionListener</code> method and removed using
* the <code>removeSelectionListener</code> method. When
* selection occurs in a control the appropriate method
* will be invoked.
* </p>
*
* @see SelectionAdapter
* @see SelectionEvent
*/
struct BERRY_UI_QT ISelectionListener: public virtual Object
{
- berryObjectMacro(berry::GuiTk::ISelectionListener)
+ berryObjectMacro(berry::GuiTk::ISelectionListener);
struct BERRY_UI_QT Events {
typedef Message1<SelectionEvent::Pointer> EventType;
EventType selected;
EventType defaultSelected;
void AddListener(ISelectionListener::Pointer listener);
void RemoveListener(ISelectionListener::Pointer listener);
private:
typedef MessageDelegate1<ISelectionListener, SelectionEvent::Pointer> Delegate;
};
~ISelectionListener() override;
/**
* Sent when selection occurs in the control.
* <p>
* For example, selection occurs in a List when the user selects
* an item or items with the keyboard or mouse. On some platforms,
* the event occurs when a mouse button or key is pressed. On others,
* it happens when the mouse or key is released. The exact key or
* mouse gesture that causes this event is platform specific.
* </p>
*
* @param e an event containing information about the selection
*/
virtual void WidgetSelected(SelectionEvent::Pointer /*e*/) {}
/**
* Sent when default selection occurs in the control.
* <p>
* For example, on some platforms default selection occurs in a List
* when the user double-clicks an item or types return in a Text.
* On some platforms, the event occurs when a mouse button or key is
* pressed. On others, it happens when the mouse or key is released.
* The exact key or mouse gesture that causes this event is platform
* specific.
* </p>
*
* @param e an event containing information about the default selection
*/
virtual void WidgetDefaultSelected(SelectionEvent::Pointer /*e*/) {}
};
}
}
#endif /* BERRYGUITKISELECTIONLISTENER_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/handlers/berryIHandlerActivation.h b/Plugins/org.blueberry.ui.qt/src/handlers/berryIHandlerActivation.h
index 2b2a1de253..d9579d2f46 100755
--- a/Plugins/org.blueberry.ui.qt/src/handlers/berryIHandlerActivation.h
+++ b/Plugins/org.blueberry.ui.qt/src/handlers/berryIHandlerActivation.h
@@ -1,100 +1,100 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIHANDLERACTIVATION_H_
#define BERRYIHANDLERACTIVATION_H_
#include "internal/berryIEvaluationResultCache.h"
#include <org_blueberry_ui_qt_Export.h>
namespace berry {
struct IHandler;
struct IHandlerService;
/**
* <p>
* A token representing the activation of a handler. This token can later be
* used to cancel that activation. Without this token, then handler will only
* become inactive if the component in which the handler was activated is
* destroyed.
* </p>
* <p>
* This interface is not intended to be implemented or extended by clients.
* </p>
*
* @see org.eclipse.ui.ISources
* @see org.eclipse.ui.ISourceProvider
*/
struct BERRY_UI_QT IHandlerActivation : public virtual IEvaluationResultCache
{
- berryObjectMacro(berry::IHandlerActivation)
+ berryObjectMacro(berry::IHandlerActivation);
~IHandlerActivation() override;
/**
* The depth at which the root exists.
*/
static const int ROOT_DEPTH; // = 1;
/**
* Clears the cached computation of the <code>isActive</code> method, if
* any. This method is only intended for internal use. It provides a
* mechanism by which <code>ISourceProvider</code> events can invalidate
* state on a <code>IHandlerActivation</code> instance.
*
* @deprecated Use {@link IEvaluationResultCache#clearResult()} instead.
*/
virtual void ClearActive() = 0;
/**
* Returns the identifier of the command whose handler is being activated.
*
* @return The command identifier; never <code>null</code>.
*/
virtual QString GetCommandId() const = 0;
/**
* Returns the depth at which this activation was created within the
* services hierarchy. The root of the hierarchy is at a depth of
* <code>1</code>. This is used as the final tie-breaker in the event
* that no other method can be used to determine a winner.
*
* @return The depth at which the handler was inserted into the services
* hierarchy; should be a positive integer.
*/
virtual int GetDepth() const = 0;
/**
* Returns the handler that should be activated.
*
* @return The handler; may be <code>null</code>.
*/
virtual SmartPointer<IHandler> GetHandler() const = 0;
/**
* Returns the handler service from which this activation was requested.
* This is used to ensure that an activation can only be retracted from the
* same service which issued it.
*
* @return The handler service; never <code>null</code>.
*/
virtual IHandlerService* GetHandlerService() const = 0;
};
}
#endif /* BERRYIHANDLERACTIVATION_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/handlers/berryIHandlerService.h b/Plugins/org.blueberry.ui.qt/src/handlers/berryIHandlerService.h
index 181fa5f791..aa732682a7 100755
--- a/Plugins/org.blueberry.ui.qt/src/handlers/berryIHandlerService.h
+++ b/Plugins/org.blueberry.ui.qt/src/handlers/berryIHandlerService.h
@@ -1,391 +1,391 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIHANDLERSERVICE_H_
#define BERRYIHANDLERSERVICE_H_
#include "services/berryIServiceWithSources.h"
#include "common/berryCommandExceptions.h"
namespace berry {
class Command;
class ExecutionEvent;
class ParameterizedCommand;
class Expression;
class UIElement;
struct IEvaluationContext;
struct IHandler;
struct IHandlerActivation;
/**
* <p>
* Provides services related to activating and deactivating handlers within the
* workbench.
* </p>
* <p>
* This service can be acquired from your service locator:
* <pre>
* IHandlerService service = (IHandlerService) getSite().getService(IHandlerService.class);
* </pre>
* <ul>
* <li>This service is available globally.</li>
* </ul>
* </p>
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*
* @since 3.1
*/
struct BERRY_UI_QT IHandlerService : public IServiceWithSources
{
- berryObjectMacro(berry::IHandlerService)
+ berryObjectMacro(berry::IHandlerService);
~IHandlerService() override;
/**
* <p>
* Activates the given handler from a child service. This is used by slave
* and nested services to promote handler activations up to the root. By
* using this method, it is possible for handlers coming from a more nested
* component to override the nested component.
* </p>
*
* @param activation
* The activation that is local to the child service; must not be
* <code>null</code>.
* @return A token which can be used to later cancel the activation. Only
* someone with access to this token can cancel the activation. The
* activation will automatically be cancelled if the service locator
* context from which this service was retrieved is destroyed. This
* activation is local to this service (i.e., it is not the
* activation that is passed as a parameter).
* @since 3.2
*/
virtual SmartPointer<IHandlerActivation> ActivateHandler(const SmartPointer<IHandlerActivation>& activation) = 0;
/**
* <p>
* Activates the given handler within the context of this service. If this
* service was retrieved from the workbench, then this handler will be
* active globally. If the service was retrieved from a nested component,
* then the handler will only be active within that component.
* </p>
* <p>
* Also, it is guaranteed that the handlers submitted through a particular
* service will be cleaned up when that services is destroyed. So, for
* example, a service retrieved from a <code>IWorkbenchPartSite</code>
* would deactivate all of its handlers when the site is destroyed.
* </p>
*
* @param commandId
* The identifier for the command which this handler handles;
* must not be <code>null</code>.
* @param handler
* The handler to activate; must not be <code>null</code>.
* @return A token which can be used to later cancel the activation. Only
* someone with access to this token can cancel the activation. The
* activation will automatically be cancelled if the context from
* which this service was retrieved is destroyed.
*/
virtual SmartPointer<IHandlerActivation> ActivateHandler(
const QString& commandId, const SmartPointer<IHandler>& handler) = 0;
/**
* <p>
* Activates the given handler within the context of this service. The
* handler becomes active when <code>expression</code> evaluates to
* <code>true</code>. This is the same as calling
* {@link #activateHandler(String, IHandler, Expression, boolean)} with
* global==false.
* </p>
* <p>
* Also, it is guaranteed that the handlers submitted through a particular
* service will be cleaned up when that service is destroyed. So, for
* example, a service retrieved from a <code>IWorkbenchPartSite</code>
* would deactivate all of its handlers when the site is destroyed.
* </p>
*
* @param commandId
* The identifier for the command which this handler handles;
* must not be <code>null</code>.
* @param handler
* The handler to activate; must not be <code>null</code>.
* @param expression
* This expression must evaluate to <code>true</code> before
* this handler will really become active. The expression may be
* <code>null</code> if the handler should always be active.
* @return A token which can be used to later cancel the activation. Only
* someone with access to this token can cancel the activation. The
* activation will automatically be cancelled if the context from
* which this service was retrieved is destroyed.
*
* @see org.eclipse.ui.ISources
* @since 3.2
*/
virtual SmartPointer<IHandlerActivation> ActivateHandler(
const QString& commandId,
const SmartPointer<IHandler>& handler,
const SmartPointer<Expression>& expression) = 0;
/**
* <p>
* Activates the given handler within the context of this service. The
* handler becomes active when <code>expression</code> evaluates to
* <code>true</code>. if global==<code>false</code>, then this
* handler service must also be the active service to active the handler.
* For example, the handler service on a part is active when that part is
* active.
* </p>
* <p>
* Also, it is guaranteed that the handlers submitted through a particular
* service will be cleaned up when that services is destroyed. So, for
* example, a service retrieved from a <code>IWorkbenchPartSite</code>
* would deactivate all of its handlers when the site is destroyed.
* </p>
*
* @param commandId
* The identifier for the command which this handler handles;
* must not be <code>null</code>.
* @param handler
* The handler to activate; must not be <code>null</code>.
* @param expression
* This expression must evaluate to <code>true</code> before
* this handler will really become active. The expression may be
* <code>null</code> if the handler should always be active.
* @param global
* Indicates that the handler should be activated irrespectively
* of whether the corresponding workbench component (e.g.,
* window, part, etc.) is active.
* @return A token which can be used to later cancel the activation. Only
* someone with access to this token can cancel the activation. The
* activation will automatically be cancelled if the context from
* which this service was retrieved is destroyed.
*
* @see org.eclipse.ui.ISources
* @since 3.2
*/
virtual SmartPointer<IHandlerActivation> ActivateHandler(
const QString& commandId,
const SmartPointer<IHandler>& handler,
const SmartPointer<Expression>& expression, bool global) = 0;
/**
* Creates an execution event based on an SWT event. This execution event
* can then be passed to a command for execution.
*
* @param command
* The command for which an execution event should be created;
* must not be <code>null</code>.
* @param event
* The SWT event triggering the command execution; may be
* <code>null</code>.
* @return An execution event suitable for calling
* {@link Command#executeWithChecks(ExecutionEvent)}.
* @since 3.2
* @see Command#executeWithChecks(ExecutionEvent)
*/
virtual SmartPointer<const ExecutionEvent> CreateExecutionEvent(
const SmartPointer<const Command>& command,
const SmartPointer<const UIElement>& uielement) = 0;
/**
* Creates a parameterized execution event based on an SWT event and a
* parameterized command. This execution event can then be passed to a
* command for execution.
*
* @param command
* The parameterized command for which an execution event should
* be created; must not be <code>null</code>.
* @param event
* The SWT event triggering the command execution; may be
* <code>null</code>.
* @return An execution event suitable for calling
* {@link Command#executeWithChecks(ExecutionEvent)}.
* @since 3.2
* @see ParameterizedCommand#getCommand()
* @see Command#executeWithChecks(ExecutionEvent)
*/
virtual SmartPointer<const ExecutionEvent> CreateExecutionEvent(
const SmartPointer<const ParameterizedCommand>& command,
const SmartPointer<const UIElement>& uielement) = 0;
/**
* Deactivates the given handler within the context of this service. If the
* handler was activated with a different service, then it must be
* deactivated from that service instead. It is only possible to retract a
* handler activation with this method. That is, you must have the same
* <code>IHandlerActivation</code> used to activate the handler.
*
* @param activation
* The token that was returned from a call to
* <code>activateHandler</code>; must not be <code>null</code>.
*/
virtual void DeactivateHandler(const SmartPointer<IHandlerActivation>& activation) = 0;
/**
* Deactivates the given handlers within the context of this service. If the
* handler was activated with a different service, then it must be
* deactivated from that service instead. It is only possible to retract a
* handler activation with this method. That is, you must have the same
* <code>IHandlerActivation</code> used to activate the handler.
*
* @param activations
* The tokens that were returned from a call to
* <code>activateHandler</code>. This collection must only
* contain instances of <code>IHandlerActivation</code>. The
* collection must not be <code>null</code>.
*/
virtual void DeactivateHandlers(
const QList<SmartPointer<IHandlerActivation> >& activations) = 0;
/**
* Executes the command with the given identifier and no parameters.
*
* @param commandId
* The identifier of the command to execute; must not be
* <code>null</code>.
* @param event
* The SWT event triggering the command execution; may be
* <code>null</code>.
* @return The return value from the execution; may be <code>null</code>.
* @throws ExecutionException
* If the handler has problems executing this command.
* @throws NotDefinedException
* If the command you are trying to execute is not defined.
* @throws NotEnabledException
* If the command you are trying to execute is not enabled.
* @throws NotHandledException
* If there is no handler.
* @since 3.2
* @see Command#executeWithChecks(ExecutionEvent)
*/
virtual Object::Pointer ExecuteCommand(const QString& commandId,
const SmartPointer<const UIElement>& uielement) = 0;
/**
* Executes the given parameterized command.
*
* @param command
* The parameterized command to be executed; must not be
* <code>null</code>.
* @param event
* The SWT event triggering the command execution; may be
* <code>null</code>.
* @return The return value from the execution; may be <code>null</code>.
* @throws ExecutionException
* If the handler has problems executing this command.
* @throws NotDefinedException
* If the command you are trying to execute is not defined.
* @throws NotEnabledException
* If the command you are trying to execute is not enabled.
* @throws NotHandledException
* If there is no handler.
* @since 3.2
* @see Command#executeWithChecks(ExecutionEvent)
*/
virtual Object::Pointer ExecuteCommand(const SmartPointer<ParameterizedCommand>& command,
const SmartPointer<const UIElement>& uielement) = 0;
/**
* Executes the given parameterized command in the provided context. It
* takes care of finding the correct active handler given the context, calls
* {@link IHandler2#setEnabled(Object)} to update the enabled state if
* supported, and executes with that handler.
*
* @param command
* The parameterized command to be executed; must not be
* <code>null</code>.
* @param event
* The SWT event triggering the command execution; may be
* <code>null</code>.
* @param context
* the evaluation context to run against. Must not be
* <code>null</code>
* @return The return value from the execution; may be <code>null</code>.
* @throws ExecutionException
* If the handler has problems executing this command.
* @throws NotDefinedException
* If the command you are trying to execute is not defined.
* @throws NotEnabledException
* If the command you are trying to execute is not enabled.
* @throws NotHandledException
* If there is no handler.
* @since 3.4
* @see Command#executeWithChecks(ExecutionEvent)
* @see #createContextSnapshot(boolean)
*/
virtual Object::Pointer ExecuteCommandInContext(
const SmartPointer<ParameterizedCommand>& command,
const SmartPointer<const UIElement>& uielement,
const SmartPointer<IEvaluationContext>& context) = 0;
/**
* This method creates a copy of the application context returned by
* {@link #getCurrentState()}.
*
* @param includeSelection
* if <code>true</code>, include the default variable and
* selection variables
* @return an context filled with the current set of variables. If selection
* is not included, the default variable is an empty collection
*/
virtual SmartPointer<IEvaluationContext> CreateContextSnapshot(bool includeSelection) = 0;
/**
* Returns an evaluation context representing the current state of the
* world. This is equivalent to the application context required by
* {@link ExecutionEvent}.
*
* @return the current state of the application; never <code>null</code>.
* @see ParameterizedCommand#executeWithChecks(Object, Object)
* @see ExecutionEvent#ExecutionEvent(Command, java.util.Map, Object,
* Object)
* @see org.eclipse.ui.services.IEvaluationService
*/
virtual SmartPointer<IEvaluationContext> GetCurrentState() const = 0;
/**
* <p>
* Reads the handler information from the registry. This will overwrite any
* of the existing information in the handler service. This method is
* intended to be called during start-up. When this method completes, this
* handler service will reflect the current state of the registry.
* </p>
*/
virtual void ReadRegistry() = 0;
/**
* Sets the help context identifier to associate with a particular handler.
*
* @param handler
* The handler with which to register a help context identifier;
* must not be <code>null</code>.
* @param helpContextId
* The help context identifier to register; may be
* <code>null</code> if the help context identifier should be
* removed.
* @since 3.2
*/
virtual void SetHelpContextId(const SmartPointer<IHandler>& handler, const QString& helpContextId) = 0;
};
}
Q_DECLARE_INTERFACE(berry::IHandlerService, "org.blueberry.ui.IHandlerService")
#endif /* BERRYIHANDLERSERVICE_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryAbstractMenuAdditionCacheEntry.h b/Plugins/org.blueberry.ui.qt/src/internal/berryAbstractMenuAdditionCacheEntry.h
index e80286d8ef..4eddb1f0f6 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryAbstractMenuAdditionCacheEntry.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryAbstractMenuAdditionCacheEntry.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYABSTRACTMENUADDITIONCACHEENTRY_H
#define BERRYABSTRACTMENUADDITIONCACHEENTRY_H
#include "berryAbstractContributionFactory.h"
namespace berry {
struct IConfigurationElement;
/**
* Base class for factories derived from extensions.
*/
class AbstractMenuAdditionCacheEntry : public AbstractContributionFactory
{
private:
SmartPointer<IConfigurationElement> additionElement;
public:
- berryObjectMacro(berry::AbstractMenuAdditionCacheEntry)
+ berryObjectMacro(berry::AbstractMenuAdditionCacheEntry);
/**
* Create a new instance of this class.
*
* @param location the location URI
* @param namespace the namespace
* @param element the declaring configuration element
*/
AbstractMenuAdditionCacheEntry(const QString& location, const QString& namespaze,
const SmartPointer<IConfigurationElement>& element);
/**
* Return the configuration element.
*
* @return the configuration element
*/
SmartPointer<IConfigurationElement> GetConfigElement() const;
};
}
#endif // BERRYABSTRACTMENUADDITIONCACHEENTRY_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryAbstractPartSelectionTracker.h b/Plugins/org.blueberry.ui.qt/src/internal/berryAbstractPartSelectionTracker.h
index 897e5131e6..6f990fd3ff 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryAbstractPartSelectionTracker.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryAbstractPartSelectionTracker.h
@@ -1,139 +1,139 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYABSTRACTPARTSELECTIONTRACKER_H_
#define BERRYABSTRACTPARTSELECTIONTRACKER_H_
#include <berryObject.h>
#include <berryMacros.h>
#include "berryISelectionService.h"
#include "berryISelectionListener.h"
#include "berryIWorkbenchPart.h"
namespace berry {
class AbstractPartSelectionTracker : public virtual Object
{
public:
- berryObjectMacro(AbstractPartSelectionTracker)
+ berryObjectMacro(AbstractPartSelectionTracker);
private:
/**
* List of selection listeners for this tracker
*/
QList<ISelectionListener*> fListeners;
/**
* List of post selection listeners for this tracker
*/
QList<ISelectionListener*> fPostListeners;
/**
* The id of the part this tracker tracks
*/
QString fPartId;
public:
/**
* Constructs a part selection tracker for the part with the given id.
*
* @param id part identifier
*/
AbstractPartSelectionTracker(const QString& partId);
/**
* Adds a selection listener to this tracker
*
* @param listener the listener to add
*/
void AddSelectionListener(ISelectionListener* listener);
/**
* Adds a post selection listener to this tracker
*
* @param listener the listener to add
*/
void AddPostSelectionListener(ISelectionListener* listener);
/**
* Returns the selection from the part being tracked,
* or <code>null</code> if the part is closed or has no selection.
*/
virtual ISelection::ConstPointer GetSelection() = 0;
/**
* Removes a selection listener from this tracker.
*
* @param listener the listener to remove
*/
void RemoveSelectionListener(ISelectionListener* listener);
/**
* Removes a post selection listener from this tracker.
*
* @param listener the listener to remove
*/
void RemovePostSelectionListener(ISelectionListener* listener);
/**
* Disposes this selection tracker. This removes all listeners currently registered.
*/
~AbstractPartSelectionTracker() override;
protected:
/**
* Fires a selection event to the listeners.
*
* @param part the part or <code>null</code> if no active part
* @param sel the selection or <code>null</code> if no active selection
* @param listeners the list of listeners to notify
*/
void FireSelection(const IWorkbenchPart::Pointer& part, const ISelection::ConstPointer& sel);
/**
* Fires a post selection event to the listeners.
*
* @param part the part or <code>null</code> if no active part
* @param sel the selection or <code>null</code> if no active selection
* @param listeners the list of listeners to notify
*/
void FirePostSelection(const IWorkbenchPart::Pointer& part, const ISelection::ConstPointer& sel);
/**
* Returns the id of the part that this tracks.
*
* @return part identifier
*/
QString GetPartId();
private:
/**
* Sets the id of the part that this tracks.
*
* @param id view identifier
*/
void SetPartId(const QString& partId);
};
}
#endif /* BERRYABSTRACTPARTSELECTIONTRACKER_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryActivePartExpression.h b/Plugins/org.blueberry.ui.qt/src/internal/berryActivePartExpression.h
index c442c8d304..fa27ff32db 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryActivePartExpression.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryActivePartExpression.h
@@ -1,76 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYACTIVEPARTEXPRESSION_H
#define BERRYACTIVEPARTEXPRESSION_H
#include "berryExpression.h"
namespace berry {
struct IWorkbenchPart;
/**
* <p>
* An expression that is bound to a particular part instance.
* </p>
* <p>
* This class is not intended for use outside of the
* <code>org.blueberry.ui</code> plug-in.
* </p>
*/
class ActivePartExpression : public Expression
{
private:
/**
* The seed for the hash code for all schemes.
*/
static const int HASH_INITIAL;
/**
* The part that must be active for this expression to evaluate to
* <code>true</code>. This value is never <code>null</code>.
*/
IWorkbenchPart* const activePart;
public:
- berryObjectMacro(berry::ActivePartExpression)
+ berryObjectMacro(berry::ActivePartExpression);
/**
* Constructs a new instance of <code>ActivePartExpression</code>
*
* @param activePart
* The part to match with the active part; may be
* <code>null</code>
*/
ActivePartExpression(IWorkbenchPart* activePart);
void CollectExpressionInfo(ExpressionInfo* info) const override;
bool operator==(const Object* object) const override;
SmartPointer<const EvaluationResult> Evaluate(IEvaluationContext* context) const override;
QString ToString() const override;
protected:
uint ComputeHashCode() const override;
};
}
#endif // BERRYACTIVEPARTEXPRESSION_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryAlwaysEnabledExpression.h b/Plugins/org.blueberry.ui.qt/src/internal/berryAlwaysEnabledExpression.h
index e046750cc0..f253174681 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryAlwaysEnabledExpression.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryAlwaysEnabledExpression.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYALWAYSENABLEDEXPRESSION_H
#define BERRYALWAYSENABLEDEXPRESSION_H
#include <berryExpression.h>
namespace berry {
/**
* An expression that simply returns <code>true</code> at all times. A shared
* instance of this expression is provided.
*/
class AlwaysEnabledExpression : public Expression
{
public:
- berryObjectMacro(berry::AlwaysEnabledExpression)
+ berryObjectMacro(berry::AlwaysEnabledExpression);
~AlwaysEnabledExpression() override;
static const SmartPointer<AlwaysEnabledExpression> INSTANCE;
/*
* @see Expression#Evaluate(IEvaluationContext)
*/
EvaluationResult::ConstPointer Evaluate(IEvaluationContext* context) const override;
private:
AlwaysEnabledExpression();
};
}
#endif // BERRYALWAYSENABLEDEXPRESSION_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryCategory.h b/Plugins/org.blueberry.ui.qt/src/internal/berryCategory.h
index 5e599ece9d..99958816b5 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryCategory.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryCategory.h
@@ -1,193 +1,193 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYCATEGORY_H_
#define BERRYCATEGORY_H_
#include <berryIAdaptable.h>
#include <berryIPluginContribution.h>
namespace berry
{
/**
* \ingroup org_blueberry_ui_internal
*
* Category provides for hierarchical grouping of elements
* registered in the registry. One extension normally defines
* a category, and other reference it via its ID.
* <p>
* A category may specify its parent category in order to
* achieve hierarchy.
* </p>
*/
template<class T> class Category : /*IWorkbenchAdapter*/ public IPluginContribution, public IAdaptable
{
public:
- berryObjectMacro(Category<T>, IPluginContribution, IAdaptable)
+ berryObjectMacro(Category<T>, IPluginContribution, IAdaptable);
typedef T ElementType;
/**
* Name of the miscellaneous category
*/
const static QString MISC_NAME;
/**
* Identifier of the miscellaneous category
*/
const static QString MISC_ID;
private:
QString id;
QString name;
QList<QString> parentPath;
QList<ElementType> elements;
IConfigurationElement::Pointer configurationElement;
QString pluginId;
public:
/**
* Creates an instance of <code>Category</code> as a
* miscellaneous category.
*/
Category();
/**
* Creates an instance of <code>Category</code> with
* an ID and label.
*
* @param id the unique identifier for the category
* @param label the presentation label for this category
*/
Category(const QString& id, const QString& label);
/**
* Creates an instance of <code>Category</code> using the
* information from the specified configuration element.
*
* @param configElement the <code>IConfigurationElement<code> containing
* the ID, label, and optional parent category path.
* @throws WorkbenchException if the ID or label is <code>null</code
*/
Category(IConfigurationElement::Pointer configElement);
/**
* Add an element to this category.
*
* @param element the element to add
*/
void AddElement(ElementType element);
/* (non-Javadoc)
* Method declared on IWorkbenchAdapter.
*/
QIcon GetImageDescriptor() const;
/**
* Return the id for this category.
* @return the id
*/
const QString& GetId() const;
/**
* Return the label for this category.
*
* @return the label
*/
QString GetLabel() const;
/**
* Return the parent path for this category.
*
* @return the parent path
*/
QList<QString> GetParentPath();
/**
* Return the unparsed parent path. May be <code>null</code>.
*
* @return the unparsed parent path or <code>null</code>
*/
QString GetRawParentPath() const;
/**
* Return the root path for this category.
*
* @return the root path
*/
QString GetRootPath();
/**
* Return the elements contained in this category.
*
* @return the elements
*/
const QList<ElementType>& GetElements() const;
/**
* Return whether a given object exists in this category.
*
* @param o the object to search for
* @return whether the object is in this category
*/
bool HasElement(const ElementType& o) const;
/**
* Return whether this category has child elements.
*
* @return whether this category has child elements
*/
bool HasElements() const;
/*
* @see IWorkbenchAdapter#GetParent(Object)
*/
ElementType* GetParent(const ElementType& o);
/*
* @see IPluginContribution#GetLocalId()
*/
QString GetLocalId() const override;
/*
* @see IPluginContribution#GetPluginId()
*/
QString GetPluginId() const override;
/**
* Clear all elements from this category.
*
*/
void Clear();
protected:
/* (non-Javadoc)
* Method declared on IAdaptable.
*/
Object* GetAdapter(const QString& adapter) const override;
};
} // namespace berry
#include "berryCategory.txx"
#endif /*BERRYCATEGORY_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryCommandParameter.h b/Plugins/org.blueberry.ui.qt/src/internal/berryCommandParameter.h
index 8f1815f604..0ff245e569 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryCommandParameter.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryCommandParameter.h
@@ -1,187 +1,187 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYCOMMANDPARAMETER_H
#define BERRYCOMMANDPARAMETER_H
#include "berryIParameter.h"
#include "berryITypedParameter.h"
namespace berry {
struct IConfigurationElement;
/**
* <p>
* A parameter for a command. A parameter identifies a type of information that
* the command might accept. For example, a "Show View" command might accept the
* id of a view for display. This parameter also identifies possible values, for
* display in the user interface.
* </p>
* <p>
* Parameters are mutable, and can change as the command changes. Notifications
* will not be sent if the parameter itself changes. Listeners can be attached
* to the command.
* </p>
*/
class CommandParameter : public IParameter, public ITypedParameter
{
public:
- berryObjectMacro(berry::CommandParameter)
+ berryObjectMacro(berry::CommandParameter);
private:
/**
* The name of the configuration element attribute contain the values. This
* is used to retrieve the executable extension
* <code>IParameterValues</code>.
*/
static const QString ATTRIBUTE_VALUES; // = "values";
/**
* The constant integer hash code value meaning the hash code has not yet
* been computed.
*/
static const int HASH_CODE_NOT_COMPUTED; // = 0;
/**
* A factor for computing the hash code for all schemes.
*/
static const int HASH_FACTOR; // = 89;
/**
* The seed for the hash code for all schemes.
*/
static const int HASH_INITIAL;
/**
* The hash code for this object. This value is computed lazily, and marked
* as invalid when one of the values on which it is based changes.
*/
mutable int hashCode; // = HASH_CODE_NOT_COMPUTED;
/**
* The non-externalized name of this parameter. The name is used as the in a
* name-value parameter map. This value will never be <code>null</code>.
*/
const QString name;
/**
* Whether the parameter is optional (as opposed to required).
*/
const bool optional;
/**
* The type for this parameter. This value may be <code>null</code> if the
* parameter is not typed.
*/
const SmartPointer<ParameterType> parameterType;
/**
* The actual <code>IParameterValues</code> implementation. This is lazily
* loaded from the <code>valuesConfigurationElement</code>, to avoid
* unnecessary class-loading.
*/
mutable QScopedPointer<IParameterValues> values;
/**
* The configuration element providing the executable extension that will
* implement <code>IParameterValues</code>. This value will not be
* <code>null</code>.
*/
const SmartPointer<IConfigurationElement> valuesConfigurationElement;
protected:
/**
* The identifier for this object. This identifier should be unique across
* all objects of the same type and should never change. This value will
* never be <code>null</code>.
*/
const QString id;
/**
* The string representation of this object. This string is for debugging
* purposes only, and is not meant to be displayed to the user. This value
* is computed lazily, and is cleared if one of its dependent values
* changes.
*/
mutable QString str;
public:
/**
* Constructs a new instance of <code>Parameter</code> with all of its
* values pre-defined.
*
* @param id
* The identifier for this parameter; must not be
* <code>null</code>.
* @param name
* The name for this parameter; must not be <code>null</code>.
* @param values
* The values for this parameter; must not be <code>null</code>.
* @param parameterType
* the type for this parameter; may be <code>null</code> if the
* parmeter doesn't declare type.
* @param optional
* Whether this parameter is optional (as opposed to required).
* @param commandService
* The command service from which parameter types can be
* retrieved; must not be <code>null</code>.
*/
CommandParameter(const QString& id, const QString& name,
const SmartPointer<IConfigurationElement>& values,
const SmartPointer<ParameterType>& parameterType,
const bool optional);
/**
* Tests whether this object is equal to another object. A parameter is only
* equal to another parameter with the same properties.
*
* @param object
* The object with which to compare; may be <code>null</code>.
* @return <code>true</code> if the objects are equal; <code>false</code>
* otherwise.
*/
bool operator==(const Object* object) const override;
QString GetId() const override;
QString GetName() const override;
SmartPointer<ParameterType> GetParameterType() const override;
IParameterValues* GetValues() const override;
uint HashCode() const override
{
if (hashCode == HASH_CODE_NOT_COMPUTED)
{
hashCode = HASH_INITIAL * HASH_FACTOR + qHash(id);
if (hashCode == HASH_CODE_NOT_COMPUTED)
{
hashCode++;
}
}
return hashCode;
}
bool IsOptional() const override;
QString ToString() const override;
};
}
#endif // BERRYCOMMANDPARAMETER_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryCommandStateProxy.h b/Plugins/org.blueberry.ui.qt/src/internal/berryCommandStateProxy.h
index 8e6a2ce59e..5f9784bdeb 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryCommandStateProxy.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryCommandStateProxy.h
@@ -1,147 +1,147 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYCOMMANDSTATEPROXY_H
#define BERRYCOMMANDSTATEPROXY_H
#include "berryPersistentState.h"
namespace berry {
struct IConfigurationElement;
struct IPreferences;
/**
* <p>
* A proxy for handler state that has been defined in XML. This delays the class
* loading until the state is really asked for information. Asking a proxy for
* anything (except disposing, and adding and removing listeners) will cause the
* proxy to instantiate the proxied handler.
* </p>
* <p>
* Loading the proxied state will automatically cause it to load its value from
* the preference store. Disposing of the state will cause it to persist its
* value.
* </p>
* <p>
* This class is not intended for use outside of the
* <code>org.eclipse.ui.workbench</code> plug-in.
* </p>
*/
class CommandStateProxy : public PersistentState
{
public:
- berryObjectMacro(berry::CommandStateProxy)
+ berryObjectMacro(berry::CommandStateProxy);
private:
/**
* The configuration element from which the state can be created. This value
* will exist until the element is converted into a real class -- at which
* point this value will be set to <code>null</code>.
*/
SmartPointer<IConfigurationElement> configurationElement;
/**
* The key in the preference store to locate the persisted state.
*/
const QString preferenceKey;
/**
* The preference store containing the persisted state, if any.
*/
const SmartPointer<IPreferences> preferenceStore;
/**
* The real state. This value is <code>null</code> until the proxy is
* forced to load the real state. At this point, the configuration element
* is converted, nulled out, and this state gains a reference.
*/
SmartPointer<State> state;
/**
* The name of the configuration element attribute which contains the
* information necessary to instantiate the real state.
*/
const QString stateAttributeName;
public:
/**
* Constructs a new instance of <code>HandlerState</code> with all the
* information it needs to create the real state later.
*
* @param configurationElement
* The configuration element from which the real class can be
* loaded at run-time; must not be <code>null</code>.
* @param stateAttributeName
* The name of the attribute or element containing the state
* executable extension; must not be <code>null</code>.
* @param preferenceStore
* The preference store to which any persistent data should be
* written, and from which it should be loaded; may be
* <code>null</code>.
* @param preferenceKey
* The key at which the persistent data is located within the
* preference store.
*/
CommandStateProxy(const SmartPointer<IConfigurationElement>& configurationElement,
const QString& stateAttributeName,
const SmartPointer<IPreferences>& preferenceStore,
const QString& preferenceKey);
void AddListener(IStateListener* listener) override;
~CommandStateProxy() override;
Object::Pointer GetValue() const override;
void Load(const SmartPointer<IPreferences>& store,
const QString& preferenceKey) override;
using State::RemoveListener;
void RemoveListener(IStateListener* listener) override;
void Save(const SmartPointer<IPreferences>& store,
const QString& preferenceKey) override;
void SetId(const QString& id) override;
void SetShouldPersist(bool persisted) override;
void SetValue(const Object::Pointer& value) override;
bool ShouldPersist() override;
QString ToString() const override;
private:
/**
* Loads the state, if possible. If the state is loaded, then the member
* variables are updated accordingly and the state is told to load its value
* from the preference store.
*
* @param readPersistence
* Whether the persistent state for this object should be read.
* @return <code>true</code> if the state is now non-null;
* <code>false</code> otherwise.
*/
bool LoadState(bool readPersistence = false);
};
}
#endif // BERRYCOMMANDSTATEPROXY_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryCompositeExpression.h b/Plugins/org.blueberry.ui.qt/src/internal/berryCompositeExpression.h
index e8822c4d36..08fda6b8b8 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryCompositeExpression.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryCompositeExpression.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYCOMPOSITEEXPRESSION_H_
#define BERRYCOMPOSITEEXPRESSION_H_
#include "berryExpression.h"
#include "berryExpressionInfo.h"
#include "berryEvaluationResult.h"
#include "berryIEvaluationContext.h"
namespace berry
{
class CompositeExpression : public Expression
{
public:
- berryObjectMacro(CompositeExpression)
+ berryObjectMacro(CompositeExpression);
private:
/**
* The seed for the hash code for all composite expressions.
*/
static const uint HASH_INITIAL;
protected:
QList<Expression::Pointer> fExpressions;
virtual EvaluationResult::ConstPointer EvaluateAnd(IEvaluationContext* scope) const;
virtual EvaluationResult::ConstPointer EvaluateOr(IEvaluationContext* scope) const;
uint ComputeHashCode() const override;
public:
virtual void Add(Expression::Pointer expression);
virtual QList<Expression::Pointer> GetChildren();
void CollectExpressionInfo(ExpressionInfo* info) const override;
};
} // namespace berry
#endif /*BERRYCOMPOSITEEXPRESSION_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryContributionRoot.h b/Plugins/org.blueberry.ui.qt/src/internal/berryContributionRoot.h
index 0a69367487..6936da5c26 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryContributionRoot.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryContributionRoot.h
@@ -1,90 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYCONTRIBUTIONROOT_H
#define BERRYCONTRIBUTIONROOT_H
#include <berryIContributionRoot.h>
#include <QSet>
namespace berry {
struct IEvaluationReference;
struct InternalMenuService;
class ContributionManager;
class AbstractContributionFactory;
/**
* Default implementation.
*/
class ContributionRoot : public IContributionRoot
{
private:
QList<SmartPointer<IContributionItem> > topLevelItems;
QList<SmartPointer<IContributionItem> > itemsToExpressions;
InternalMenuService* menuService;
ContributionManager* mgr;
AbstractContributionFactory* factory;
public:
QSet<SmartPointer<IEvaluationReference> > restriction;
- berryObjectMacro(berry::ContributionRoot)
+ berryObjectMacro(berry::ContributionRoot);
ContributionRoot(InternalMenuService* menuService, const QSet<SmartPointer<IEvaluationReference> >& restriction,
ContributionManager* mgr, AbstractContributionFactory* factory);
/*
* @see IContributionRoot#AddContributionItem(IContributionItem, Expression)
*/
void AddContributionItem(const SmartPointer<IContributionItem>& item,
const SmartPointer<Expression>& visibleWhen) override;
QList<SmartPointer<IContributionItem> > GetItems() const;
/**
* Unregister all visible when expressions from the menu service.
*/
void Release();
/*
* @see IContributionRoot#RegisterVisibilityForChild(IContributionItem, Expression)
*/
void RegisterVisibilityForChild(const SmartPointer<IContributionItem>& item,
const SmartPointer<Expression>& visibleWhen) override;
/**
* @return Returns the mgr.
*/
ContributionManager* GetManager() const;
private:
/**
* Create the activity identifier for this contribution item.
*
* @param item the item
* @return the identifier
*/
QString CreateIdentifierId(const SmartPointer<IContributionItem>& item);
};
}
#endif // BERRYCONTRIBUTIONROOT_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryDefaultStackPresentationSite.h b/Plugins/org.blueberry.ui.qt/src/internal/berryDefaultStackPresentationSite.h
index ed6294a3ae..294011e7e7 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryDefaultStackPresentationSite.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryDefaultStackPresentationSite.h
@@ -1,97 +1,97 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYDEFAULTSTACKPRESENTATIONSITE_H_
#define BERRYDEFAULTSTACKPRESENTATIONSITE_H_
#include "presentations/berryIStackPresentationSite.h"
#include "presentations/berryStackPresentation.h"
namespace berry
{
class DefaultStackPresentationSite: public IStackPresentationSite
{
private:
StackPresentation::Pointer presentation;
int state;
int activeState;
public:
- berryObjectMacro(DefaultStackPresentationSite)
+ berryObjectMacro(DefaultStackPresentationSite);
DefaultStackPresentationSite();
void SetPresentation(StackPresentation::Pointer newPresentation);
StackPresentation::Pointer GetPresentation();
int GetState() override;
void SetActive(int activeState);
int GetActive();
/* (non-Javadoc)
* @see org.blueberry.ui.internal.skins.IStackPresentationSite#selectPart(org.blueberry.ui.internal.skins.IPresentablePart)
*/
void SelectPart(IPresentablePart::Pointer toSelect) override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.skins.IPresentationSite#setState(int)
*/
void SetState(int newState) override;
void SetPresentationState(int newState);
/* (non-Javadoc)
* @see org.blueberry.ui.internal.skins.IPresentablePart#isClosable()
*/
bool IsCloseable(IPresentablePart::Pointer part) override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.skins.IPresentationSite#dragStart(org.blueberry.ui.internal.skins.IPresentablePart, boolean)
*/
void DragStart(IPresentablePart::Pointer beingDragged,
QPoint& initialPosition, bool keyboard) override;
using IStackPresentationSite::Close;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.skins.IPresentationSite#close(org.blueberry.ui.internal.skins.IPresentablePart)
*/
void Close(IPresentablePart::Pointer toClose);
/* (non-Javadoc)
* @see org.blueberry.ui.internal.skins.IPresentationSite#dragStart(boolean)
*/
void DragStart(QPoint& initialPosition, bool keyboard) override;
/* (non-Javadoc)
* @see org.blueberry.ui.presentations.IStackPresentationSite#supportsState(int)
*/
bool SupportsState(int state) override;
// void AddSystemActions(IMenuManager menuManager) {
//
// }
};
}
#endif /* BERRYDEFAULTSTACKPRESENTATIONSITE_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryDetachedPlaceHolder.h b/Plugins/org.blueberry.ui.qt/src/internal/berryDetachedPlaceHolder.h
index 95287f6b2e..f0d7957612 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryDetachedPlaceHolder.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryDetachedPlaceHolder.h
@@ -1,105 +1,105 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYDETACHEDPLACEHOLDER_H_
#define BERRYDETACHEDPLACEHOLDER_H_
#include "berryPartPlaceholder.h"
#include "berryILayoutContainer.h"
#include "berryIMemento.h"
namespace berry {
/**
* DetachedPlaceHolder is the placeholder for detached views.
*
*/
class DetachedPlaceHolder : public PartPlaceholder, public ILayoutContainer
{
private:
QList<LayoutPart::Pointer> children;
QRect bounds;
public:
- berryObjectMacro(DetachedPlaceHolder)
+ berryObjectMacro(DetachedPlaceHolder);
/**
* DetachedPlaceHolder constructor comment.
* @param id java.lang.String
* @param bounds the size of the placeholder
*/
DetachedPlaceHolder(const QString& id, const QRect& b);
/**
* Add a child to the container.
*/
void Add(LayoutPart::Pointer newPart) override;
/**
* Return true if the container allows its
* parts to show a border if they choose to,
* else false if the container does not want
* its parts to show a border.
* @return boolean
*/
bool AllowsBorder();
bool AllowsAdd(LayoutPart::Pointer toAdd) override;
bool AllowsAutoFocus() override;
QRect GetBounds();
/**
* Returns a list of layout children.
*/
QList<LayoutPart::Pointer> GetChildren();
/**
* Remove a child from the container.
*/
void Remove(LayoutPart::Pointer part) override;
/**
* Replace one child with another
*/
void Replace(LayoutPart::Pointer oldPart, LayoutPart::Pointer newPart) override;
/**
* Restore the state from the memento.
* @param memento
*/
void RestoreState(IMemento::Pointer memento);
/**
* Save state to the memento.
* @param memento
*/
void SaveState(IMemento::Pointer memento);
void FindSashes(LayoutPart::Pointer part, PartPane::Sashes& sashes) override;
ILayoutContainer::ChildrenType GetChildren() const override;
void ResizeChild(LayoutPart::Pointer childThatChanged) override;
};
}
#endif /* BERRYDETACHEDPLACEHOLDER_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryDetachedWindow.h b/Plugins/org.blueberry.ui.qt/src/internal/berryDetachedWindow.h
index 60826f17a1..d1713c4339 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryDetachedWindow.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryDetachedWindow.h
@@ -1,192 +1,192 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYDETACHEDWINDOW_H_
#define BERRYDETACHEDWINDOW_H_
#include "berryPartStack.h"
#include "berryWorkbenchPage.h"
#include "berryLayoutPart.h"
#include "berryIDragOverListener.h"
#include "berryIShellListener.h"
#include "guitk/berryGuiTkIControlListener.h"
#include "berryShell.h"
namespace berry
{
/**
* TODO: Drag from detached to fast view bar back to detached causes NPE
*/
class DetachedWindow: public Object, private IPropertyChangeListener,
private IDragOverListener
{
public:
- berryObjectMacro(DetachedWindow)
+ berryObjectMacro(DetachedWindow);
private:
PartStack::Pointer folder;
WorkbenchPage* page;
QRect bounds;
Shell::Pointer windowShell;
bool hideViewsOnClose;
struct ShellListener: public IShellListener
{
ShellListener(DetachedWindow* wnd);
void ShellClosed(const ShellEvent::Pointer& e) override;
private:
DetachedWindow* window;
};
QScopedPointer<IShellListener> shellListener;
struct ShellControlListener: public GuiTk::IControlListener
{
ShellControlListener(DetachedWindow* wnd);
Events::Types GetEventTypes() const override;
void ControlResized(GuiTk::ControlEvent::Pointer e) override;
private:
DetachedWindow* window;
};
GuiTk::IControlListener::Pointer resizeListener;
// Listener activationListener = new Listener() {
// public void handleEvent(Event event) {
// switch (event.type) {
// case SWT.Activate:
// page.window.liftRestrictions();
// break;
// case SWT.Deactivate:
// page.window.imposeRestrictions();
// break;
// }
// }
// };
IWorkbenchPartReference::Pointer activePart;
public:
/**
* Create a new FloatingWindow.
*/
DetachedWindow(WorkbenchPage* workbenchPage);
using IPropertyChangeListener::PropertyChange;
void PropertyChange(const Object::Pointer& source, int propId) override;
Shell::Pointer GetShell();
void Create();
/**
* Adds a visual part to this window.
* Supports reparenting.
*/
void Add(LayoutPart::Pointer part);
bool BelongsToWorkbenchPage(IWorkbenchPage::Pointer workbenchPage);
bool Close();
/*
* @see org.blueberry.ui.internal.IDragOverListener#Drag(QWidget*, Object::Pointer, const QPoint&, const QRect& )
*/
IDropTarget::Pointer Drag(QWidget* currentControl,
const Object::Pointer& draggedObject, const QPoint& position,
const QRect& dragRectangle) override;
ILayoutContainer::ChildrenType GetChildren() const;
WorkbenchPage::Pointer GetWorkbenchPage();
/**
* @see IPersistablePart
*/
void RestoreState(IMemento::Pointer memento);
/**
* @see IPersistablePart
*/
void SaveState(IMemento::Pointer memento);
QWidget* GetControl();
/**
* Opens the detached window.
*/
int Open();
protected:
void ActivePartChanged(IWorkbenchPartReference::Pointer partReference);
/**
* This method will be called to initialize the given Shell's layout
*/
void ConfigureShell(Shell::Pointer shell);
/**
* Override this method to create the widget tree that is used as the window's contents.
*/
QWidget* CreateContents(QWidget* parent);
private:
void UpdateTitle();
/**
* Ensure that the shell's minimum size is equal to the minimum size
* of the first part added to the shell.
*/
void UpdateMinimumSize();
static IWorkbenchPartReference::Pointer GetPartReference(
LayoutPart::Pointer pane);
/**
* Closes this window and disposes its shell.
*/
bool HandleClose();
/**
* Prompts for and handles the saving of dirty, saveable views
* @param views The list of ViewPanes
* @return <code>true</code> unless the user cancels the save(s)
*/
bool HandleSaves(QList<PartPane::Pointer> views);
/**
* Answer a list of the view panes.
*/
void CollectViewPanes(QList<PartPane::Pointer>& result,
const QList<LayoutPart::Pointer>& parts);
};
}
#endif /* BERRYDETACHEDWINDOW_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryDirtyPerspectiveMarker.h b/Plugins/org.blueberry.ui.qt/src/internal/berryDirtyPerspectiveMarker.h
index 5d9acf5d3d..0fec21f6d3 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryDirtyPerspectiveMarker.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryDirtyPerspectiveMarker.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYDIRTYPERSPECTIVEMARKER_H
#define BERRYDIRTYPERSPECTIVEMARKER_H
#include <berryObject.h>
#include <QString>
namespace berry {
class DirtyPerspectiveMarker : public Object
{
public:
- berryObjectMacro(DirtyPerspectiveMarker)
+ berryObjectMacro(DirtyPerspectiveMarker);
QString perspectiveId;
/**
* @param id
*/
DirtyPerspectiveMarker(const QString& id);
uint HashCode() const override;
bool operator==(const Object* o) const override;
};
}
#endif // BERRYDIRTYPERSPECTIVEMARKER_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryEditorHistoryItem.h b/Plugins/org.blueberry.ui.qt/src/internal/berryEditorHistoryItem.h
index 872d3cd187..2bec7be160 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryEditorHistoryItem.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryEditorHistoryItem.h
@@ -1,120 +1,120 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYEDITORHISTORYITEM_H
#define BERRYEDITORHISTORYITEM_H
#include <berryObject.h>
#include <berrySmartPointer.h>
namespace berry {
struct IEditorInput;
struct IEditorDescriptor;
struct IMemento;
struct IStatus;
/**
* An item in the editor history.
*/
class EditorHistoryItem : public Object
{
private:
SmartPointer<IEditorInput> input;
SmartPointer<IEditorDescriptor> descriptor;
SmartPointer<IMemento> memento;
public:
- berryObjectMacro(EditorHistoryItem)
+ berryObjectMacro(EditorHistoryItem);
/**
* Constructs a new item.
*/
EditorHistoryItem(const SmartPointer<IEditorInput>& input, const SmartPointer<IEditorDescriptor>& descriptor);
/**
* Constructs a new item from a memento.
*/
EditorHistoryItem(const SmartPointer<IMemento>& memento);
/**
* Returns the editor descriptor.
*
* @return the editor descriptor.
*/
SmartPointer<IEditorDescriptor> GetDescriptor() const;
/**
* Returns the editor input.
*
* @return the editor input.
*/
SmartPointer<IEditorInput> GetInput() const;
/**
* Returns whether this item has been restored from the memento.
*/
bool IsRestored() const;
/**
* Returns the name of this item, either from the input if restored,
* otherwise from the memento.
*/
QString GetName() const;
/**
* Returns the tooltip text of this item, either from the input if restored,
* otherwise from the memento.
*/
QString GetToolTipText() const;
/**
* Returns whether this item matches the given editor input.
*/
bool Matches(const SmartPointer<IEditorInput>& input) const;
/**
* Returns the factory id of this item, either from the input if restored,
* otherwise from the memento.
* Returns <code>null</code> if there is no factory id.
*/
QString GetFactoryId() const;
/**
* Restores the object state from the memento.
*/
SmartPointer<const IStatus> RestoreState();
/**
* Returns whether this history item can be saved.
*/
bool CanSave() const;
/**
* Saves the object state in the given memento.
*
* @param memento the memento to save the object state in
*/
SmartPointer<const IStatus> SaveState(const SmartPointer<IMemento>& memento);
};
}
Q_DECLARE_METATYPE(berry::EditorHistoryItem::Pointer)
#endif // BERRYEDITORHISTORYITEM_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryEditorSashContainer.h b/Plugins/org.blueberry.ui.qt/src/internal/berryEditorSashContainer.h
index 4e3c9bcfbc..c44101999c 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryEditorSashContainer.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryEditorSashContainer.h
@@ -1,249 +1,249 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYEDITORSASHCONTAINER_H_
#define BERRYEDITORSASHCONTAINER_H_
#include "berryPartSashContainer.h"
#include "berryPartStack.h"
#include <list>
namespace berry
{
/**
* Represents the area set aside for editor workbooks.
* This container only accepts editor stacks (PartStack) and PartSash
* as layout parts.
*
* Note no views are allowed within this container.
*/
class EditorSashContainer: public PartSashContainer
{
public:
- berryObjectMacro(EditorSashContainer)
+ berryObjectMacro(EditorSashContainer);
private:
QList<PartStack::Pointer> editorWorkbooks;
PartStack::Pointer activeEditorWorkbook;
// DropTarget dropTarget;
void AddDropSupport();
PartStack::Pointer NewEditorWorkbook();
protected:
/* (non-Javadoc)
* @see org.blueberry.ui.internal.PartSashContainer#addChild(org.blueberry.ui.internal.PartSashContainer.RelationshipInfo)
*/
void AddChild(const RelationshipInfo& info) override;
/**
* Notification that a child layout part has been
* added to the container. Subclasses may override
* this method to perform any container specific
* work.
*/
void ChildAdded(LayoutPart::Pointer child) override;
/**
* Notification that a child layout part has been
* removed from the container. Subclasses may override
* this method to perform any container specific
* work.
*/
void ChildRemoved(LayoutPart::Pointer child) override;
PartStack::Pointer CreateDefaultWorkbook();
/**
* Subclasses override this method to specify
* the composite to use to parent all children
* layout parts it contains.
*/
QWidget* CreateParent(QWidget* parentWidget) override;
/**
* Subclasses override this method to dispose
* of any swt resources created during createParent.
*/
void DisposeParent() override;
/**
* Return true is the workbook specified
* is the active one.
*/
bool IsActiveWorkbook(PartStack::Pointer workbook);
//TODO DND
// /* package */DropTarget getDropTarget() {
// return dropTarget;
// }
/* (non-Javadoc)
* @see org.blueberry.ui.internal.PartSashContainer#createStack(org.blueberry.ui.internal.LayoutPart)
*/
PartStack::Pointer CreateStack() override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.PartSashContainer#setVisiblePart(org.blueberry.ui.internal.ILayoutContainer, org.blueberry.ui.internal.LayoutPart)
*/
void SetVisiblePart(ILayoutContainer::Pointer container,
PartPane::Pointer visiblePart) override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.PartSashContainer#getVisiblePart(org.blueberry.ui.internal.ILayoutContainer)
*/
LayoutPart::Pointer GetVisiblePart(ILayoutContainer::Pointer container) override;
public:
static const QString DEFAULT_WORKBOOK_ID;
EditorSashContainer(const QString& editorId, WorkbenchPage* page,
QWidget* parent);
bool AllowsAdd(LayoutPart::Pointer layoutPart) override;
/**
* Add an editor to the active workbook.
*/
void AddEditor(PartPane::Pointer pane, PartStack::Pointer stack);
/**
* Hides the min/max buttons for all editor stacks
* -except- for the upper/left one.
*/
void UpdateStackButtons();
/**
* @param stacks
* @return the EditorStack in the upper right position
*/
PartStack::Pointer GetUpperRightEditorStack();
/**
* @param stacks
* @return the EditorStack in the upper right position
*/
PartStack::Pointer GetUpperRightEditorStack(
const ILayoutContainer::ChildrenType& stacks);
/**
* Return the editor workbook which is active.
*/
PartStack::Pointer GetActiveWorkbook();
/**
* Return the editor workbook id which is active.
*/
QString GetActiveWorkbookID();
/**
* Return the all the editor workbooks.
*/
QList<PartStack::Pointer> GetEditorWorkbooks();
/**
* Return the all the editor workbooks.
*/
std::size_t GetEditorWorkbookCount();
/**
* Find the sashes around the specified part.
*/
void FindSashes(LayoutPart::Pointer pane, PartPane::Sashes& sashes) override;
/**
* Remove all the editors
*/
void RemoveAllEditors();
/**
* Remove an editor from its' workbook.
*/
void RemoveEditor(PartPane::Pointer pane);
/**
* @see IPersistablePart
*/
bool RestoreState(IMemento::Pointer memento);
/**
* @see IPersistablePart
*/
bool SaveState(IMemento::Pointer memento);
/**
* Set the editor workbook which is active.
*/
void SetActiveWorkbook(PartStack::Pointer newWorkbook, bool hasFocus);
/**
* Set the editor workbook which is active.
*/
void SetActiveWorkbookFromID(const QString& id);
PartStack::Pointer GetWorkbookFromID(const QString& id);
/**
* Updates the editor area's tab list to include the active
* editor and its tab.
*/
void UpdateTabList();
/**
* @see org.blueberry.ui.internal.LayoutPart#createControl(org.blueberry.swt.widgets.Composite)
*/
void CreateControl(QWidget* parent) override;
/**
* @see org.blueberry.ui.internal.LayoutPart#getImportance()
*/
bool IsCompressible() override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.PartSashContainer#isStackType(org.blueberry.ui.internal.LayoutPart)
*/
bool IsStackType(ILayoutContainer::Pointer toTest) override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.PartSashContainer#isPaneType(org.blueberry.ui.internal.LayoutPart)
*/
bool IsPaneType(LayoutPart::Pointer toTest) override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.PartSashContainer#pickPartToZoom()
*/
// LayoutPart pickPartToZoom() {
// return getActiveWorkbook();
// }
/**
* Restore the presentation state. Loop over the workbooks, create the appropriate serializer and pass to the presentation.
*
* @param areaMem the memento containing presentation
* @return the restoration status
*/
bool RestorePresentationState(IMemento::Pointer areaMem);
};
}
#endif /* BERRYEDITORSASHCONTAINER_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryErrorViewPart.h b/Plugins/org.blueberry.ui.qt/src/internal/berryErrorViewPart.h
index dd116441e3..c24d8dace0 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryErrorViewPart.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryErrorViewPart.h
@@ -1,76 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYERRORVIEWPART_H_
#define BERRYERRORVIEWPART_H_
#include "tweaklets/berryWorkbenchPageTweaklet.h"
#include "berryViewPart.h"
namespace berry {
/**
* This part is shown instead the views with errors.
*/
class ErrorViewPart : public ViewPart {
public:
- berryObjectMacro(ErrorViewPart)
+ berryObjectMacro(ErrorViewPart);
/**
* Creates instance of the class
*/
ErrorViewPart();
/**
* Creates instance of the class
*
* @param error the status
*/
ErrorViewPart(const QString& title, const QString& error);
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
void CreatePartControl(QWidget* parent) override;
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.part.ViewPart#setPartName(java.lang.String)
*/
void SetPartName(const QString& newName) override;
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.part.WorkbenchPart#setFocus()
*/
void SetFocus() override;
private:
//IStatus error;
QString title;
QString error;
Object::Pointer statusPart;
};
}
#endif /* BERRYERRORVIEWPART_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryEvaluationAuthority.h b/Plugins/org.blueberry.ui.qt/src/internal/berryEvaluationAuthority.h
index 4afbc24205..389b7bc792 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryEvaluationAuthority.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryEvaluationAuthority.h
@@ -1,136 +1,136 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYEVALUATIONAUTHORITY_H
#define BERRYEVALUATIONAUTHORITY_H
#include "berryExpressionAuthority.h"
#include <berryIPropertyChangeListener.h>
#include <QHash>
namespace berry {
struct IEvaluationReference;
class EvaluationReference;
class Expression;
class Shell;
class EvaluationAuthority : public ExpressionAuthority
{
public:
- berryObjectMacro(berry::EvaluationAuthority)
+ berryObjectMacro(berry::EvaluationAuthority);
private:
static const QString COMPONENT;
typedef QHash<SmartPointer<Expression>, QSet<SmartPointer<EvaluationReference> > > ExprToEvalsMapType;
/**
* A bucket sort of the evaluation references based on source priority. Each
* reference will appear only once per set, but may appear in multiple sets.
* If no references are defined for a particular priority level, then the
* array at that index will only contain <code>null</code>.
*/
QHash<QString,ExprToEvalsMapType> cachesBySourceName;
IPropertyChangeListener::Events serviceListeners;
MessageExceptionHandler<EvaluationAuthority> serviceExceptionHandler;
int notifying;
// private final Map cachesByExpression = new HashMap();
QStringList GetNames(const SmartPointer<IEvaluationReference>& ref) const;
/**
* This will evaluate all refs with the same expression.
*
* @param refs
*/
void RefsWithSameExpression(const QList<SmartPointer<EvaluationReference> >& refs);
/**
* @param sourceNames
*/
void StartSourceChange(const QStringList& sourceNames);
/**
* @param sourceNames
*/
void EndSourceChange(const QStringList& sourceNames);
/**
* @param ref
* @param oldValue
* @param newValue
*/
void FirePropertyChange(const SmartPointer<IEvaluationReference>& ref,
Object::Pointer oldValue, Object::Pointer newValue);
void FireServiceChange(const QString& property, Object::Pointer oldValue, Object::Pointer newValue);
void ServiceChangeException(const std::exception& exc);
Object::Pointer ValueOf(bool result);
protected:
/**
* Returns the currently active shell.
*
* @return The currently active shell; may be <code>null</code>.
*/
SmartPointer<const Shell> GetActiveShell() const;
public:
EvaluationAuthority();
/*
* @see ExpressionAuthority#SourceChanged(int)
*/
void SourceChanged(int sourcePriority) override;
/*
* @see ExpressionAuthority#SourceChanged(QString)
*/
void SourceChanged(const QStringList& sourceNames) override;
using ExpressionAuthority::SourceChanged;
void AddEvaluationListener(const SmartPointer<IEvaluationReference>& ref);
/**
* @param ref
*/
void RemoveEvaluationListener(const SmartPointer<IEvaluationReference>& ref);
/**
* @param listener
*/
void AddServiceListener(IPropertyChangeListener* listener);
/**
* @param listener
*/
void RemoveServiceListener(IPropertyChangeListener* listener);
};
}
#endif // BERRYEVALUATIONAUTHORITY_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryEvaluationReference.h b/Plugins/org.blueberry.ui.qt/src/internal/berryEvaluationReference.h
index 3f6d804320..61d2591877 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryEvaluationReference.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryEvaluationReference.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYEVALUATIONREFERENCE_H
#define BERRYEVALUATIONREFERENCE_H
#include "berryEvaluationResultCache.h"
#include <berryIEvaluationReference.h>
namespace berry {
class EvaluationReference : public EvaluationResultCache, public IEvaluationReference
{
private:
IPropertyChangeListener* listener;
QString property;
bool postingChanges;
public:
- berryObjectMacro(berry::EvaluationReference)
+ berryObjectMacro(berry::EvaluationReference);
/**
* @param expression
*/
EvaluationReference(const SmartPointer<Expression>& expression,
IPropertyChangeListener *listener,
const QString& property);
/*
* @see IEvaluationReference#GetListener()
*/
IPropertyChangeListener* GetListener() const override;
QString GetProperty() const override;
/*
* @see IEvaluationReference#SetFlopping(bool)
*/
void SetPostingChanges(bool evaluationEnabled);
/*
* @see IEvaluationReference#IsFlopping()
*/
bool IsPostingChanges() const;
};
}
#endif // BERRYEVALUATIONREFERENCE_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryEvaluationService.h b/Plugins/org.blueberry.ui.qt/src/internal/berryEvaluationService.h
index 5440cc47ea..078322342b 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryEvaluationService.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryEvaluationService.h
@@ -1,96 +1,96 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYEVALUATIONSERVICE_H
#define BERRYEVALUATIONSERVICE_H
#include <berryIEvaluationService.h>
namespace berry {
class EvaluationAuthority;
class EvaluationService : public IEvaluationService
{
private:
QScopedPointer<EvaluationAuthority, QScopedPointerObjectDeleter> evaluationAuthority;
public:
- berryObjectMacro(berry::EvaluationService)
+ berryObjectMacro(berry::EvaluationService);
EvaluationService();
~EvaluationService() override;
/*
* @see IEvaluationService#AddEvaluationListener(Expression, IPropertyChangeListener, QString)
*/
SmartPointer<IEvaluationReference> AddEvaluationListener(const SmartPointer<Expression>& expression,
IPropertyChangeListener* listener,
const QString& property) override;
/*
* @see IEvaluationService#AddEvaluationReference(IEvaluationReference)
*/
void AddEvaluationReference(const SmartPointer<IEvaluationReference>& ref) override;
/*
* @see IEvaluationService#RemoveEvaluationListener(IEvaluationReference)
*/
void RemoveEvaluationListener(const SmartPointer<IEvaluationReference>& ref) override;
/*
* @see IServiceWithSources#AddSourceProvider(ISourceProvider)
*/
void AddSourceProvider(const SmartPointer<ISourceProvider>& provider) override;
/*
* @see IServiceWithSources#RemoveSourceProvider(ISourceProvider)
*/
void RemoveSourceProvider(const SmartPointer<ISourceProvider>& provider) override;
/*
* @see IDisposable#Dispose()
*/
void Dispose() override;
/*
* @see IEvaluationService#GetCurrentState()
*/
SmartPointer<IEvaluationContext> GetCurrentState() const override;
/*
* @see IEvaluationService#AddServiceListener(IPropertyChangeListener)
*/
void AddServiceListener(IPropertyChangeListener *listener) override;
/*
* @see IEvaluationService#removeServiceListener(IPropertyChangeListener)
*/
void RemoveServiceListener(IPropertyChangeListener* listener) override;
/*
* @see IEvaluationService#RequestEvaluation(QString)
*/
void RequestEvaluation(const QString& propertyName) override;
//void UpdateShellKludge();
};
}
#endif // BERRYEVALUATIONSERVICE_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryExpressionAuthority.h b/Plugins/org.blueberry.ui.qt/src/internal/berryExpressionAuthority.h
index 353d337b0c..7408c214ea 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryExpressionAuthority.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryExpressionAuthority.h
@@ -1,219 +1,219 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYEXPRESSIONAUTHORITY_H
#define BERRYEXPRESSIONAUTHORITY_H
#include <berryISourceProviderListener.h>
namespace berry {
struct IEvaluationContext;
struct IEvaluationResultCache;
struct ISourceProvider;
/**
* <p>
* Provides common functionality for evaluating expressions and listening to
* {@link ISourceProvider} (i.e., the common event framework for commands).
* </p>
* <p>
* This class is not intended for use outside of the
* <code>org.eclipse.ui.qt</code> plug-in.
* </p>
*
* @see ISourceProvider
* @see ISources
* @see Expression
* @see IEvaluationContext
*/
class ExpressionAuthority : public Object, private ISourceProviderListener
{
public:
- berryObjectMacro(berry::ExpressionAuthority)
+ berryObjectMacro(berry::ExpressionAuthority);
private:
/**
* The evaluation context instance to use when evaluating expression. This
* context is shared, and so all calls into <code>sourceChanged</code>
* must happen on the event thread.
*/
SmartPointer<IEvaluationContext> context;
/**
* The current state of this authority. This is a child of the
* {@link #context} that has been given the selection as the default
* variable. This value is cleared to <code>null</code> whenever the
* selection changes.
*/
mutable SmartPointer<IEvaluationContext> currentState;
/**
* The collection of source providers used by this authority. This
* collection is consulted whenever a contribution is made. This collection
* only contains instances of <code>ISourceProvider</code>.
*/
QList<SmartPointer<ISourceProvider> > providers;
protected:
/**
* Constructs a new instance of <code>ExpressionAuthority</code>.
*/
ExpressionAuthority();
/**
* Returns whether at least one of the <code>IEvaluationResultCache</code>
* instances in <code>collection</code> evaluates to <code>true</code>.
*
* @param collection
* The evaluation result caches to check; must not be
* <code>null</code>, but may be empty.
* @return <code>true</code> if there is at least one expression that
* evaluates to <code>true</code>; <code>false</code>
* otherwise.
*/
bool Evaluate(const QList<SmartPointer<IEvaluationResultCache> >& collection) const;
/**
* Returns whether the <code>IEvaluationResultCache</code> evaluates to
* <code>true</code>.
*
* @param expression
* The evaluation result cache to check; must not be
* <code>null</code>.
* @return <code>true</code> if the expression evaluates to
* <code>true</code>; <code>false</code> otherwise.
*/
bool Evaluate(const SmartPointer<IEvaluationResultCache>& expression) const;
/**
* Returns the variable of the given name.
*
* @param name
* The name of the variable to get; must not be <code>null</code>.
* @return The variable of the given name; <code>null</code> if none.
*/
Object::ConstPointer GetVariable(const QString& name) const;
/**
* Changes the variable of the given name. If the <code>value</code> is
* <code>null</code>, then the variable is removed.
*
* @param name
* The name of the variable to change; must not be
* <code>null</code>.
* @param value
* The new value; the variable should be removed if this is
* <code>null</code>.
*/
void ChangeVariable(const QString& name, const Object::ConstPointer& value);
/**
* Carries out the actual source change notification. It assumed that by the
* time this method is called, <code>getEvaluationContext()</code> is
* up-to-date with the current state of the application.
*
* @param sourcePriority
* A bit mask of all the source priorities that have changed.
*/
virtual void SourceChanged(int sourcePriority) = 0;
/**
* Similar to sourceChanged(int) this notifies the subclass about the
* change, but using the array of source names that changed instead of the
* priority ... int based.
* <p>
* Clients may override this method.
* </p>
*
* @param sourceNames
* The array of names that changed.
*/
virtual void SourceChanged(const QStringList& sourceNames);
/**
* @param sourcePriority
* @param strings
*/
void SourceChanged(int sourcePriority, const QStringList& sourceNames);
/**
* Updates the evaluation context with the current state from all of the
* source providers.
*/
void UpdateCurrentState();
/**
* Updates this authority's evaluation context.
*
* @param name
* The name of the variable to update; must not be
* <code>null</code>.
* @param value
* The new value of the variable. If this value is
* <code>null</code>, then the variable is removed.
*/
void UpdateEvaluationContext(const QString& name, const Object::ConstPointer& value);
public:
/**
* Adds a source provider to a list of providers to check when updating.
* This also attaches this authority as a listener to the provider.
*
* @param provider
* The provider to add; must not be <code>null</code>.
*/
void AddSourceProvider(const SmartPointer<ISourceProvider>& provider);
/**
* Removes all of the source provider listeners.
*/
void Dispose();
~ExpressionAuthority() override;
/**
* Creates a new evaluation context based on the current evaluation context
* (i.e., the current state), and places the current selection as the
* default variable.
*
* @return An evaluation context that can be used for evaluating
* expressions; never <code>null</code>.
*/
SmartPointer<IEvaluationContext> GetCurrentState() const;
/**
* Removes this source provider from the list, and detaches this authority
* as a listener.
*
* @param provider
* The provider to remove; must not be <code>null</code>.
*/
void RemoveSourceProvider(const SmartPointer<ISourceProvider>& provider);
void SourceChanged(int sourcePriority,
const QHash<QString, Object::ConstPointer>& sourceValuesByName) override;
void SourceChanged(int sourcePriority, const QString& sourceName,
Object::ConstPointer sourceValue) override;
};
}
#endif // BERRYEXPRESSIONAUTHORITY_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryHandlerActivation.h b/Plugins/org.blueberry.ui.qt/src/internal/berryHandlerActivation.h
index d727259cce..73a9fbca2b 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryHandlerActivation.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryHandlerActivation.h
@@ -1,154 +1,154 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYHANDLERACTIVATION_H
#define BERRYHANDLERACTIVATION_H
#include "berryIHandlerActivation.h"
#include "berryEvaluationResultCache.h"
#include "berryIEvaluationReference.h"
#include "berryIPropertyChangeListener.h"
namespace berry {
struct IEvaluationReference;
struct IPropertyChangeListener;
/**
* <p>
* A token representing the activation of a handler. This token can later be
* used to cancel that activation. Without this token, then handler will only
* become inactive if the component in which the handler was activated is
* destroyed.
* </p>
* <p>
* This caches the command id and the handler, so that they can later be
* identified.
* </p>
* <p>
* <b>Note:</b> this class has a natural ordering that is inconsistent with
* equals.
* </p>
*/
class HandlerActivation : public EvaluationResultCache, public IHandlerActivation
{
public:
- berryObjectMacro(berry::HandlerActivation)
+ berryObjectMacro(berry::HandlerActivation);
private:
/**
* The identifier for the command which the activated handler handles. This
* value is never <code>null</code>.
*/
const QString commandId;
/**
* The depth of services at which this token was created. This is used as a
* final tie-breaker if all other things are equivalent.
*/
const int depth;
/**
* The handler that has been activated. This value may be <code>null</code>.
*/
SmartPointer<IHandler> handler;
/**
* The handler service from which this handler activation was request. This
* value is never <code>null</code>.
*/
IHandlerService* handlerService;
SmartPointer<IEvaluationReference> reference;
QScopedPointer<IPropertyChangeListener> listener;
public:
/**
* Constructs a new instance of <code>HandlerActivation</code>.
*
* @param commandId
* The identifier for the command which the activated handler
* handles. This value must not be <code>null</code>.
* @param handler `
* The handler that has been activated. This value may be
* <code>null</code>.
* @param expression
* The expression that must evaluate to <code>true</code>
* before this handler is active. This value may be
* <code>null</code> if it is always active.</code>.
* @param depth
* The depth at which this activation was created within the
* services hierarchy. This is used as the final tie-breaker if
* all other conditions are equal. This should be a positive
* integer.
* @param handlerService
* The handler service from which the handler activation was
* requested; must not be <code>null</code>.
* @see ISources
*/
HandlerActivation(const QString& commandId, const SmartPointer<IHandler>& handler,
const SmartPointer<Expression>& expression, int depth,
IHandlerService* handlerService);
void ClearActive() override;
/**
* Implement {@link Object#operator<(const Object*)}.
* <p>
* <b>Note:</b> this class has a natural ordering that is inconsistent with
* equals.
* </p>
*/
bool operator<(const Object* object) const override;
int CompareTo(const HandlerActivation* other) const;
QString GetCommandId() const override;
int GetDepth() const override;
SmartPointer<IHandler> GetHandler() const override;
IHandlerService* GetHandlerService() const override;
QString ToString() const override;
/**
* @return Returns the reference.
*/
SmartPointer<IEvaluationReference> GetReference();
/**
* @param reference
* The reference to set.
*/
void SetReference(const SmartPointer<IEvaluationReference>& reference);
/**
* @param listener The listener to set.
*/
void SetListener(IPropertyChangeListener* listener);
/**
* @return Returns the listener.
*/
IPropertyChangeListener* GetListener() const;
};
}
#endif // BERRYHANDLERACTIVATION_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryHandlerProxy.h b/Plugins/org.blueberry.ui.qt/src/internal/berryHandlerProxy.h
index 7dcbba0d84..82deb4cc46 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryHandlerProxy.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryHandlerProxy.h
@@ -1,227 +1,227 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYHANDLERPROXY_H
#define BERRYHANDLERPROXY_H
#include "berryAbstractHandlerWithState.h"
#include "berryIElementUpdater.h"
#include "berryIHandlerListener.h"
#include "berryIPropertyChangeListener.h"
namespace berry {
struct IConfigurationElement;
struct IEvaluationReference;
struct IEvaluationService;
class Expression;
/**
* <p>
* A proxy for a handler that has been defined in XML. This delays the class
* loading until the handler is really asked for information (besides the
* priority or the command identifier). Asking a proxy for anything but the
* attributes defined publicly in this class will cause the proxy to instantiate
* the proxied handler.
* </p>
*/
class HandlerProxy : public AbstractHandlerWithState, public IElementUpdater,
private IHandlerListener, private IPropertyChangeListener
{
public:
- berryObjectMacro(berry::HandlerProxy)
+ berryObjectMacro(berry::HandlerProxy);
private:
static QHash<SmartPointer<IConfigurationElement>, HandlerProxy*> CEToProxyMap;
/**
*
*/
static const QString PROP_ENABLED; // = "enabled";
/**
* The configuration element from which the handler can be created. This
* value will exist until the element is converted into a real class -- at
* which point this value will be set to <code>null</code>.
*/
mutable SmartPointer<IConfigurationElement> configurationElement;
/**
* The <code>enabledWhen</code> expression for the handler. Only if this
* expression evaluates to <code>true</code> (or the value is
* <code>null</code>) should we consult the handler.
*/
const SmartPointer<Expression> enabledWhenExpression;
/**
* The real handler. This value is <code>null</code> until the proxy is
* forced to load the real handler. At this point, the configuration element
* is converted, nulled out, and this handler gains a reference.
*/
mutable SmartPointer<IHandler> handler;
/**
* The name of the configuration element attribute which contains the
* information necessary to instantiate the real handler.
*/
const QString handlerAttributeName;
/**
* The evaluation service to use when evaluating
* <code>enabledWhenExpression</code>. This value may be
* <code>null</code> only if the <code>enabledWhenExpression</code> is
* <code>null</code>.
*/
IEvaluationService* evaluationService;
SmartPointer<IEvaluationReference> enablementRef;
bool proxyEnabled;
QString commandId;
//
// state to support checked or radio commands.
SmartPointer<State> checkedState;
SmartPointer<State> radioState;
// Exception that occurs while loading the proxied handler class
mutable ctkException* loadException;
public:
/**
* Constructs a new instance of <code>HandlerProxy</code> with all the
* information it needs to try to avoid loading until it is needed.
*
* @param commandId the id for this handler
* @param configurationElement
* The configuration element from which the real class can be
* loaded at run-time; must not be <code>null</code>.
* @param handlerAttributeName
* The name of the attribute or element containing the handler
* executable extension; must not be <code>null</code>.
* @param enabledWhenExpression
* The name of the element containing the enabledWhen expression.
* This should be a child of the
* <code>configurationElement</code>. If this value is
* <code>null</code>, then there is no enablement expression
* (i.e., enablement will be delegated to the handler when
* possible).
* @param evaluationService
* The evaluation service to manage enabledWhen expressions
* trying to evaluate the <code>enabledWhenExpression</code>.
* This value may be <code>null</code> only if the
* <code>enabledWhenExpression</code> is <code>null</code>.
*/
HandlerProxy(const QString commandId,
const SmartPointer<IConfigurationElement>& configurationElement,
const QString handlerAttributeName,
const SmartPointer<Expression> enabledWhenExpression = SmartPointer<Expression>(),
IEvaluationService* evaluationService = nullptr);
static void UpdateStaleCEs(const QList<SmartPointer<IConfigurationElement> >& replacements);
void SetEnabled(const Object::Pointer& evaluationContext) override;
/**
* Passes the dipose on to the proxied handler, if it has been loaded.
*/
void Dispose() override;
Object::Pointer Execute(const SmartPointer<const ExecutionEvent>& event) override;
bool IsEnabled() const override;
bool IsHandled() const override;
QString ToString() const override;
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.commands.IElementUpdater#updateElement(org.eclipse.ui.menus.UIElement,
* java.util.Map)
*/
void UpdateElement(UIElement* element, const QHash<QString, Object::Pointer>& parameters) override;
/* (non-Javadoc)
* @see org.eclipse.core.commands.IStateListener#handleStateChange(org.eclipse.core.commands.State, java.lang.Object)
*/
void HandleStateChange(const SmartPointer<State>& state, const Object::Pointer& oldValue) override;
/**
* @return the config element for use with the PDE framework.
*/
SmartPointer<IConfigurationElement> GetConfigurationElement() const;
QString GetAttributeName() const;
/**
* @return Returns the handler.
*/
SmartPointer<IHandler> GetHandler() const;
private:
/**
*
*/
void RegisterEnablement();
void SetProxyEnabled(bool enabled);
bool GetProxyEnabled() const;
/**
* @return
*/
IPropertyChangeListener* GetEnablementListener() const;
using IPropertyChangeListener::PropertyChange;
void PropertyChange(const SmartPointer<PropertyChangeEvent>& event) override;
/**
* Loads the handler, if possible. If the handler is loaded, then the member
* variables are updated accordingly.
*
* @return <code>true</code> if the handler is now non-null;
* <code>false</code> otherwise.
*/
bool LoadHandler() const;
IHandlerListener* GetHandlerListener() const;
void HandlerChanged(const SmartPointer<HandlerEvent>& handlerEvent) override;
/**
* Retrives the ConfigurationElement attribute according to the
* <code>handlerAttributeName</code>.
*
* @return the handlerAttributeName value, may be <code>null</code>.
*/
QString GetConfigurationElementAttribute() const;
bool IsOkToLoad() const;
void RefreshElements();
};
}
#endif // BERRYHANDLERPROXY_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryIDropTarget.h b/Plugins/org.blueberry.ui.qt/src/internal/berryIDropTarget.h
index f0df2f7447..03340ac288 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryIDropTarget.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryIDropTarget.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIDROPTARGET_H_
#define BERRYIDROPTARGET_H_
#include <berryMacros.h>
#include <berryConstants.h>
#include <berryObject.h>
#include <org_blueberry_ui_qt_Export.h>
namespace berry {
/**
* This interface is used to drop objects. It knows how to drop a particular object
* in a particular location. IDropTargets are typically created by IDragOverListeners, and
* it is the job of the IDragOverListener to supply the drop target with information about
* the object currently being dragged.
*
* @see IDragOverListener
*/
struct BERRY_UI_QT IDropTarget : public Object
{
- berryObjectMacro(IDropTarget)
+ berryObjectMacro(IDropTarget);
~IDropTarget() override;
/**
* Drops the object in this position
*/
virtual void Drop() = 0;
/**
* Returns a cursor id describing this drop operation
*
* @return a cursor id describing this drop operation
*/
virtual CursorType GetCursor() = 0;
/**
* Returns a rectangle (screen coordinates) describing the target location
* for this drop operation.
*
* @return a snap rectangle or null if this drop target does not have a specific snap
* location.
*/
virtual QRect GetSnapRectangle() = 0;
/**
* This is called whenever a drag operation is cancelled
*/
virtual void DragFinished(bool dropPerformed) = 0;
};
}
#endif /* BERRYIDROPTARGET_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryIEvaluationResultCache.h b/Plugins/org.blueberry.ui.qt/src/internal/berryIEvaluationResultCache.h
index 8c880a5dcc..9c11324cf2 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryIEvaluationResultCache.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryIEvaluationResultCache.h
@@ -1,96 +1,96 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEVALUATIONRESULTCACHE_H_
#define BERRYIEVALUATIONRESULTCACHE_H_
#include <berryObject.h>
#include <berryMacros.h>
#include <org_blueberry_ui_qt_Export.h>
namespace berry {
struct IEvaluationContext;
class Expression;
/**
* <p>
* A cache of the result of an expression. This also provides the source
* priority for the expression.
* </p>
* <p>
* This interface is not intended to be implemented or extended by clients.
* </p>
*
* @see ISources
* @see ISourceProvider
*/
struct BERRY_UI_QT IEvaluationResultCache : public virtual Object
{
- berryObjectMacro(berry::IEvaluationResultCache)
+ berryObjectMacro(berry::IEvaluationResultCache);
~IEvaluationResultCache() override;
/**
* Clears the cached computation of the <code>evaluate</code> method, if
* any. This method is only intended for internal use. It provides a
* mechanism by which <code>ISourceProvider</code> events can invalidate
* state on a <code>IEvaluationResultCache</code> instance.
*/
virtual void ClearResult() = 0;
/**
* Returns the expression controlling the activation or visibility of this
* item.
*
* @return The expression associated with this item; may be
* <code>null</code>.
*/
virtual SmartPointer<Expression> GetExpression() const = 0;
/**
* Returns the priority that has been given to this expression.
*
* @return The priority.
* @see ISources
*/
virtual int GetSourcePriority() const = 0;
/**
* Evaluates the expression -- given the current state of the workbench.
* This method should cache its computation. The cache will be cleared by a
* call to <code>clearResult</code>.
*
* @param context
* The context in which this state should be evaluated; must not
* be <code>null</code>.
* @return <code>true</code> if the expression currently evaluates to
* <code>true</code>; <code>false</code> otherwise.
*/
virtual bool Evaluate(IEvaluationContext* context) const = 0;
/**
* Forces the cached result to be a particular value. This will <b>not</b>
* notify any users of the cache that it has changed.
*
* @param result
* The cached result to use.
*/
virtual void SetResult(bool result) = 0;
};
}
#endif /* BERRYIEVALUATIONRESULTCACHE_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryILayoutContainer.h b/Plugins/org.blueberry.ui.qt/src/internal/berryILayoutContainer.h
index 547912aac2..369a8127e4 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryILayoutContainer.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryILayoutContainer.h
@@ -1,117 +1,117 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYILAYOUTCONTAINER_H_
#define BERRYILAYOUTCONTAINER_H_
#include "berryLayoutPart.h"
#include "berryPartPane.h"
namespace berry {
/**
* \ingroup org_blueberry_ui_internal
*
*/
struct BERRY_UI_QT ILayoutContainer : virtual public Object {
- berryObjectMacro(ILayoutContainer)
+ berryObjectMacro(ILayoutContainer);
~ILayoutContainer() override;
typedef QList<LayoutPart::Pointer> ChildrenType;
virtual bool AllowsAdd(LayoutPart::Pointer toAdd) = 0;
/**
* Add a child to the container.
*/
virtual void Add(LayoutPart::Pointer newPart) = 0;
/**
* Returns a list of layout children.
*/
virtual ChildrenType GetChildren() const = 0;
/**
* Remove a child from the container.
*/
virtual void Remove(LayoutPart::Pointer part) = 0;
/**
* Replace one child with another
*/
virtual void Replace(LayoutPart::Pointer oldPart, LayoutPart::Pointer newPart) = 0;
virtual void FindSashes(LayoutPart::Pointer toFind, PartPane::Sashes& result) = 0;
/**
* When a layout part closes, focus will return to the previously active part.
* This method determines whether the parts in this container should participate
* in this behavior. If this method returns true, its parts may automatically be
* given focus when another part is closed.
*
* @return true iff the parts in this container may be given focus when the active
* part is closed
*/
virtual bool AllowsAutoFocus() = 0;
/**
* Called by child parts to request a zoom in, given an immediate child
*
* @param toZoom
* @since 3.1
*/
//public void childRequestZoomIn(LayoutPart toZoom);
/**
* Called by child parts to request a zoom out
*
* @since 3.1
*/
//public void childRequestZoomOut();
/**
* Returns true iff the given child is obscured due to the fact that the container is zoomed into
* another part.
*
* @param toTest
* @return
* @since 3.1
*/
//public boolean childObscuredByZoom(LayoutPart toTest);
/**
* Returns true iff we are zoomed into the given part, given an immediate child of this container.
*
* @param toTest
* @return
* @since 3.1
*/
//public boolean childIsZoomed(LayoutPart toTest);
/**
* Called when the preferred size of the given child has changed, requiring a
* layout to be triggered.
*
* @param childThatChanged the child that triggered the new layout
*/
virtual void ResizeChild(LayoutPart::Pointer childThatChanged) = 0;
};
}
#endif /*BERRYILAYOUTCONTAINER_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryIServiceLocatorCreator.h b/Plugins/org.blueberry.ui.qt/src/internal/berryIServiceLocatorCreator.h
index 81fc27e5bb..eed031f010 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryIServiceLocatorCreator.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryIServiceLocatorCreator.h
@@ -1,88 +1,88 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISERVICELOCATORCREATOR_H_
#define BERRYISERVICELOCATORCREATOR_H_
#include <berryObject.h>
#include <berryMacros.h>
#include <org_blueberry_ui_qt_Export.h>
namespace berry {
struct IServiceLocator;
struct IServiceFactory;
struct IDisposable;
/**
* When creating components this service can be used to create the appropriate
* service locator for the new component. For use with the component framework.
* <p>
* <b>Note:</b> Must not be implemented or extended by clients.
* <p>
* <p>
* <strong>PROVISIONAL</strong>. This class or interface has been added as part
* of a work in progress. There is a guarantee neither that this API will work
* nor that it will remain the same. Please do not use this API without
* consulting with the Platform/UI team. This might disappear in 3.4 M5.
* </p>
*
*
* @since 3.4
*/
struct BERRY_UI_QT IServiceLocatorCreator : public virtual Object
{
- berryObjectMacro(berry::IServiceLocatorCreator)
+ berryObjectMacro(berry::IServiceLocatorCreator);
~IServiceLocatorCreator() override;
/**
* Creates a service locator that can be used for hosting a new service
* context. It will have the appropriate child services created as needed,
* and can be used with the Dependency Injection framework to reuse
* components (by simply providing your own implementation for certain
* services).
*
* @param parent
* the parent locator
* @param factory
* a factory that can lazily provide services if requested. This
* may be <code>null</code>
* @param owner
* an object whose {@link IDisposable#dispose()} method will be
* called on the UI thread if the created service locator needs
* to be disposed (typically, because a plug-in contributing
* services to the service locator via an
* {@link AbstractServiceFactory} is no longer available). The
* owner can be any object that implements {@link IDisposable}.
* The recommended implementation of the owner's dispose method
* is to do whatever is necessary to stop using the created
* service locator, and then to call
* {@link IDisposable#dispose()} on the service locator.
* @return the created service locator. The returned service locator will be
* an instance of {@link IDisposable}.
*/
virtual SmartPointer<IServiceLocator> CreateServiceLocator(
IServiceLocator* parent,
const IServiceFactory* factory,
WeakPointer<IDisposable> owner) = 0;
};
}
Q_DECLARE_INTERFACE(berry::IServiceLocatorCreator, "org.blueberry.ui.IServiceLocatorCreator")
#endif /* BERRYISERVICELOCATORCREATOR_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryIStickyViewManager.h b/Plugins/org.blueberry.ui.qt/src/internal/berryIStickyViewManager.h
index 4ff260c099..06240c770f 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryIStickyViewManager.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryIStickyViewManager.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISTICKYVIEWMANAGER_H_
#define BERRYISTICKYVIEWMANAGER_H_
#include <berryObject.h>
#include <berryMacros.h>
#include <berryIMemento.h>
#include <set>
namespace berry {
class Perspective;
struct BERRY_UI_QT IStickyViewManager : public Object
{
- berryObjectMacro(berry::IStickyViewManager)
+ berryObjectMacro(berry::IStickyViewManager);
~IStickyViewManager() override;
virtual void Remove(const QString& perspectiveId) = 0;
virtual void Add(const QString& perspectiveId, const std::set<QString>& stickyViewSet) = 0;
virtual void Clear() = 0;
virtual void Update(SmartPointer<Perspective> oldPersp, SmartPointer<Perspective> newPersp) = 0;
virtual void Save(IMemento::Pointer memento) = 0;
virtual void Restore(IMemento::Pointer memento) = 0;
};
}
#endif /* BERRYISTICKYVIEWMANAGER_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryIWorkbenchLocationService.h b/Plugins/org.blueberry.ui.qt/src/internal/berryIWorkbenchLocationService.h
index 503a8019c2..6bf40e01c6 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryIWorkbenchLocationService.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryIWorkbenchLocationService.h
@@ -1,82 +1,82 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIWORKBENCHLOCATIONSERVICE_H_
#define BERRYIWORKBENCHLOCATIONSERVICE_H_
#include <berryObject.h>
#include <org_blueberry_ui_qt_Export.h>
namespace berry {
struct IWorkbench;
struct IWorkbenchWindow;
struct IWorkbenchPartSite;
struct IPageSite;
/**
* Query where you are in the workbench hierarchy.
*
*/
struct BERRY_UI_QT IWorkbenchLocationService : public virtual Object
{
- berryObjectMacro(berry::IWorkbenchLocationService)
+ berryObjectMacro(berry::IWorkbenchLocationService);
~IWorkbenchLocationService() override;
/**
* Get the service scope.
*
* @return the service scope. May return <code>null</code>.
* @see IServiceScopes#PARTSITE_SCOPE
*/
virtual QString GetServiceScope() const = 0;
/**
* A more numeric representation of the service level.
*
* @return the level - 0==workbench, 1==workbench window, etc
*/
virtual int GetServiceLevel() const = 0;
/**
* @return the workbench. May return <code>null</code>.
*/
virtual IWorkbench* GetWorkbench() const = 0;
/**
* @return the workbench window in this service locator hierarchy. May
* return <code>null</code>.
*/
virtual IWorkbenchWindow* GetWorkbenchWindow() const = 0;
/**
* @return the part site in this service locator hierarchy. May return
* <code>null</code>.
*/
virtual IWorkbenchPartSite* GetPartSite() const = 0;
/**
* @return the inner page site for a page based view in this service locator
* hierarchy. May return <code>null</code>.
* @see PageBookView
*/
//virtual SmartPointer<IPageSite> GetPageSite() const = 0;
};
}
Q_DECLARE_INTERFACE(berry::IWorkbenchLocationService, "org.blueberry.ui.IWorkbenchLocationService")
#endif /* BERRYIWORKBENCHLOCATIONSERVICE_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutPart.h b/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutPart.h
index 81e63d28e2..fe6bc50962 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutPart.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutPart.h
@@ -1,299 +1,299 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYLAYOUTPART_H_
#define BERRYLAYOUTPART_H_
#include <berryMacros.h>
#include "berryIDropTarget.h"
#include "berryISizeProvider.h"
#include "berryShell.h"
namespace berry {
struct ILayoutContainer;
struct IWorkbenchWindow;
/**
* \ingroup org_blueberry_ui_internal
*
* A presentation part is used to build the presentation for the
* workbench. Common subclasses are pane and folder.
*/
class LayoutPart : virtual public Object, public virtual ISizeProvider
{
public:
- berryObjectMacro(LayoutPart)
+ berryObjectMacro(LayoutPart);
protected: ILayoutContainer* container;
protected: QString id;
public: static const QString PROP_VISIBILITY;// = "PROP_VISIBILITY";
/**
* Number of times deferUpdates(true) has been called without a corresponding
* deferUpdates(false)
*/
private: int deferCount;
/**
* PresentationPart constructor comment.
*/
public: LayoutPart(const QString& id);
public: ~LayoutPart() override;
/**
* When a layout part closes, focus will return to a previously active part.
* This method determines whether this part should be considered for activation
* when another part closes. If a group of parts are all closing at the same time,
* they will all return false from this method while closing to ensure that the
* parent does not activate a part that is in the process of closing. Parts will
* also return false from this method if they are minimized, closed fast views,
* obscured by zoom, etc.
*
* @return true iff the parts in this container may be given focus when the active
* part is closed
*/
public: virtual bool AllowsAutoFocus();
/**
* Creates the GUI control
*/
public: virtual void CreateControl(QWidget* parent) = 0;
/**
* Disposes the GUI control
*
* This can be used to execute cleanup code or notify listeners
* when a LayoutPart is no longer used, but is still referenced
* by a SmartPointer (instead of putting the code in the LayoutPart
* destructor).
*/
public: virtual void Dispose();
/**
* Gets the presentation bounds.
*/
public: QRect GetBounds();
/**
* Gets the parent for this part.
* <p>
* In general, this is non-null if the object has been added to a container and the
* container's widgetry exists. The exception to this rule is PartPlaceholders
* created when restoring a ViewStack using restoreState, which point to the
* ViewStack even if its widgetry doesn't exist yet. Returns null in the remaining
* cases.
* </p>
* <p>
* TODO: change the semantics of this method to always point to the parent container,
* regardless of whether its widgetry exists. Locate and refactor code that is currently
* depending on the special cases.
* </p>
*/
public: virtual SmartPointer<ILayoutContainer> GetContainer();
/**
* Get the part control. This method may return null.
*/
public: virtual QWidget* GetControl() = 0;
public: virtual bool IsPlaceHolder() const;
/**
* Gets the ID for this part.
*/
public: virtual QString GetID() const;
public: virtual bool IsCompressible();
/**
* Gets the presentation size.
*/
public: virtual QSize GetSize();
/**
* @see org.blueberry.ui.presentations.StackPresentation#getSizeFlags(boolean)
*
* @since 3.1
*/
public: int GetSizeFlags(bool horizontal) override;
/**
* @see org.blueberry.ui.presentations.StackPresentation#computePreferredSize(boolean, int, int, int)
*
* @since 3.1
*/
public: int ComputePreferredSize(bool width, int availableParallel, int availablePerpendicular, int preferredParallel) override;
public: virtual IDropTarget::Pointer GetDropTarget(Object::Pointer draggedObject, const QPoint& displayCoordinates);
public: bool IsDocked();
public: virtual Shell::Pointer GetShell();
/**
* Returns the workbench window window for a part.
*
* @return the workbench window, or <code>null</code> if there's no window
* associated with this part.
*/
public: virtual SmartPointer<IWorkbenchWindow> GetWorkbenchWindow();
/**
* Move the control over another one.
*/
public: virtual void MoveAbove(QWidget* refControl);
/**
* Reparent a part.
*/
public: virtual void Reparent(QWidget* newParent);
/**
* Returns true if this part was set visible. This returns whatever was last passed into
* setVisible, but does not necessarily indicate that the part can be seen (ie: one of its
* ancestors may be invisible)
*/
public: virtual bool GetVisible();
/**
* Returns true if this part can be seen. Returns false if the part or any of its ancestors
* are invisible.
*/
public: virtual bool IsVisible();
/**
* Shows the receiver if <code>visible</code> is true otherwise hide it.
*/
public: virtual void SetVisible(bool makeVisible);
/**
* Returns <code>true</code> if the given control or any of its descendents has focus.
*/
private: virtual bool IsFocusAncestor(QWidget* ctrl);
/**
* Sets the presentation bounds.
*/
public: virtual void SetBounds(const QRect& r);
/**
* Sets the parent for this part.
*/
public: virtual void SetContainer(SmartPointer<ILayoutContainer> container);
/**
* Sets focus to this part.
*/
public: virtual void SetFocus();
/**
* Sets the part ID.
*/
public: virtual void SetID(const QString& str);
/* (non-Javadoc)
* @see org.blueberry.ui.internal.IWorkbenchDragDropPart#getPart()
*/
public: virtual LayoutPart::Pointer GetPart();
/**
* deferUpdates(true) disables widget updates until a corresponding call to
* deferUpdates(false). Exactly what gets deferred is the decision
* of each LayoutPart, however the part may only defer operations in a manner
* that does not affect the final result.
* That is, the state of the receiver after the final call to deferUpdates(false)
* must be exactly the same as it would have been if nothing had been deferred.
*
* @param shouldDefer true iff events should be deferred
*/
public: void DeferUpdates(bool shouldDefer);
/**
* This is called when deferUpdates(true) causes UI events for this
* part to be deferred. Subclasses can overload to initialize any data
* structures that they will use to collect deferred events.
*/
protected: virtual void StartDeferringEvents();
/**
* Immediately processes all UI events which were deferred due to a call to
* deferUpdates(true). This is called when the last call is made to
* deferUpdates(false). Subclasses should overload this method if they
* defer some or all UI processing during deferUpdates.
*/
protected: virtual void HandleDeferredEvents();
/**
* Subclasses can call this method to determine whether UI updates should
* be deferred. Returns true iff there have been any calls to deferUpdates(true)
* without a corresponding call to deferUpdates(false). Any operation which is
* deferred based on the result of this method should be performed later within
* handleDeferredEvents().
*
* @return true iff updates should be deferred.
*/
protected: bool IsDeferred();
/**
* Writes a description of the layout to the given string buffer.
* This is used for drag-drop test suites to determine if two layouts are the
* same. Like a hash code, the description should compare as equal iff the
* layouts are the same. However, it should be user-readable in order to
* help debug failed tests. Although these are english readable strings,
* they do not need to be translated.
*
* @param buf
*/
public: virtual void DescribeLayout(QString& buf) const;
/**
* Returns an id representing this part, suitable for use in a placeholder.
*
* @since 3.0
*/
public: virtual QString GetPlaceHolderId();
public: virtual void ResizeChild(LayoutPart::Pointer childThatChanged);
public: void FlushLayout();
/**
* Returns true iff the given part can be added to this ILayoutContainer
* @param toAdd
* @return
* @since 3.1
*/
public: virtual bool AllowsAdd(LayoutPart::Pointer toAdd);
/**
* Tests the integrity of this object. Throws an exception if the object's state
* is not internally consistent. For use in test suites.
*/
public: virtual void TestInvariants();
public: QString ToString() const override;
};
}
#endif /*BERRYLAYOUTPART_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutTree.h b/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutTree.h
index 250bf0f9d8..9693505e10 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutTree.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutTree.h
@@ -1,366 +1,366 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYLAYOUTTREE_H_
#define BERRYLAYOUTTREE_H_
#include "berryISizeProvider.h"
#include "berryPartSashContainer.h"
#include <QRect>
namespace berry
{
class LayoutTreeNode;
class LayoutPartSash;
/**
* \ingroup org_blueberry_ui_internal
*
* Implementation of a tree where the node is allways a sash
* and it allways has two chidren. If a children is removed
* the sash, ie the node, is removed as well and its other children
* placed on its parent.
*/
class LayoutTree : public Object, public ISizeProvider
{ //implements ISizeProvider {
public:
- berryObjectMacro(LayoutTree)
+ berryObjectMacro(LayoutTree);
/* The parent of this tree or null if it is the root */
LayoutTreeNode* parent;
/* Any LayoutPart if this is a leaf or a LayoutSashPart if it is a node */
LayoutPart::Pointer part;
private:
// Cached information
int cachedMinimumWidthHint;
int cachedMinimumWidth;
int cachedMinimumHeightHint;
int cachedMinimumHeight;
int cachedMaximumWidthHint;
int cachedMaximumWidth;
int cachedMaximumHeightHint;
int cachedMaximumHeight;
bool forceLayout;
QRect currentBounds;
// Cached size flags
bool sizeFlagsDirty;
int widthSizeFlags;
int heightSizeFlags;
public:
// Cache statistics. For use in benchmarks and test suites only!
static int minCacheHits;
static int minCacheMisses;
static int maxCacheHits;
static int maxCacheMisses;
/**
* Initialize this tree with its part.
*/
LayoutTree(LayoutPart::Pointer part);
/**
* Add the relation ship between the children in the list
* and returns the left children.
*/
virtual LayoutPart::Pointer ComputeRelation(
QList<PartSashContainer::RelationshipInfo>& relations);
/**
* Locates the part that intersects the given point
*
* @param toFind
* @return
*/
virtual LayoutPart::Pointer FindPart(const QPoint& toFind);
/**
* Dispose all Sashs in this tree
*/
virtual void DisposeSashes();
/**
* Find a LayoutPart in the tree and return its sub-tree. Returns
* null if the child is not found.
*/
virtual SmartPointer<LayoutTree> Find(LayoutPart::Pointer child);
/**
* Find the Left,Right,Top and Bottom
* sashes around this tree and set them
* in <code>sashes</code>
*/
virtual void FindSashes(PartPane::Sashes sashes);
/**
* Find the part that is in the bottom right position.
*/
virtual LayoutPart::Pointer FindBottomRight();
/**
* Find a sash in the tree and return its sub-tree. Returns
* null if the sash is not found.
*/
virtual SmartPointer<LayoutTreeNode> FindSash(SmartPointer<LayoutPartSash> sash);
/**
* Return the bounds of this tree which is the rectangle that
* contains all Controls in this tree.
*/
QRect GetBounds();
/**
* Subtracts two integers. If a is INF, this is treated as
* positive infinity.
*
* @param a a positive integer or INF indicating positive infinity
* @param b a positive integer (may not be INF)
* @return a - b, or INF if a == INF
* @since 3.1
*/
static int Subtract(int a, int b);
/**
* Adds two positive integers. Treates INF as positive infinity.
*
* @param a a positive integer
* @param b a positive integer
* @return a + b, or INF if a or b are positive infinity
* @since 3.1
*/
static int Add(int a, int b);
/**
* Asserts that toCheck is a positive integer less than INF / 2 or equal
* to INF. Many of the methods of this class use positive integers as sizes,
* with INF indicating positive infinity. This picks up accidental addition or
* subtraction from infinity.
*
* @param toCheck integer to validate
* @since 3.1
*/
static void AssertValidSize(int toCheck);
/**
* Computes the preferred size for this object. The interpretation of the result depends on the flags returned
* by getSizeFlags(). If the caller is looking for a maximum or minimum size, this delegates to computeMinimumSize
* or computeMaximumSize in order to benefit from caching optimizations. Otherwise, it delegates to
* doComputePreferredSize. Subclasses should overload one of doComputeMinimumSize, doComputeMaximumSize, or
* doComputePreferredSize to specialize the return value.
*
* @see LayoutPart#computePreferredSize(boolean, int, int, int)
*/
int ComputePreferredSize(bool width, int availableParallel,
int availablePerpendicular, int preferredParallel) override;
protected:
/**
* Returns the size flags for this tree.
*
* @see org.blueberry.ui.presentations.StackPresentation#getSizeFlags(boolean)
*
* @param b indicates whether the caller wants the flags for computing widths (=true) or heights (=false)
* @return a bitwise combiniation of flags with the same meaning as StackPresentation.getSizeFlags(boolean)
*/
virtual int DoGetSizeFlags(bool width);
/**
* Subclasses should overload this method instead of computePreferredSize(boolean, int, int, int)
*
* @see org.blueberry.ui.presentations.StackPresentation#computePreferredSize(boolean, int, int, int)
*
* @since 3.1
*/
virtual int DoComputePreferredSize(bool width, int availableParallel,
int availablePerpendicular, int preferredParallel);
public:
/**
* Returns the minimum size for this subtree. Equivalent to calling
* computePreferredSize(width, INF, availablePerpendicular, 0).
* Returns a cached value if possible or defers to doComputeMinimumSize otherwise.
* Subclasses should overload doComputeMinimumSize if they want to specialize the
* return value.
*
* @param width true iff computing the minimum width, false iff computing the minimum height
* @param availablePerpendicular available space (pixels) perpendicular to the dimension
* being computed. This is a height when computing a width, or a width when computing a height.
*
* @see LayoutPart#computePreferredSize(boolean, int, int, int)
*/
int ComputeMinimumSize(bool width, int availablePerpendicular);
/**
* For use in benchmarks and test suites only. Displays cache utilization statistics for all
* LayoutTree instances.
*
* @since 3.1
*/
static void PrintCacheStatistics();
virtual int DoComputeMinimumSize(bool width, int availablePerpendicular);
int ComputeMaximumSize(bool width, int availablePerpendicular);
protected:
virtual int DoComputeMaximumSize(bool width, int availablePerpendicular);
public:
/**
* Called to flush any cached information in this tree and its parents.
*/
virtual void FlushNode();
/**
* Flushes all cached information about this node and all of its children.
* This should be called if something may have caused all children to become
* out of synch with their cached information (for example, if a lot of changes
* may have happened without calling flushCache after each change)
*
* @since 3.1
*/
virtual void FlushChildren();
/**
* Flushes all cached information about this node and all of its ancestors.
* This should be called when a single child changes.
*
* @since 3.1
*/
void FlushCache();
int GetSizeFlags(bool width) override;
/**
* Returns the parent of this tree or null if it is the root.
*/
virtual LayoutTreeNode* GetParent() const;
/**
* Inserts a new child on the tree. The child will be placed beside
* the <code>relative</code> child. Returns the new root of the tree.
*/
virtual SmartPointer<LayoutTree> Insert(LayoutPart::Pointer child, bool left,
SmartPointer<LayoutPartSash> sash, SmartPointer<LayoutPart> relative);
/**
* Returns true if this tree can be compressed and expanded.
* @return true if springy
*/
virtual bool IsCompressible();
/**
* Returns true if this tree has visible parts otherwise returns false.
*/
virtual bool IsVisible();
/**
* Recompute the ratios in this tree.
*/
virtual void RecomputeRatio();
/**
* Find a child in the tree and remove it and its parent.
* The other child of its parent is placed on the parent's parent.
* Returns the new root of the tree.
*/
virtual SmartPointer<LayoutTree> Remove(LayoutPart::Pointer child);
/**
* Sets the bounds of this node. If the bounds have changed or any children have
* changed then the children will be recursively layed out. This implementation
* filters out redundant calls and delegates to doSetBounds to layout the children.
* Subclasses should overload doSetBounds to lay out their children.
*
* @param bounds new bounds of the tree
*/
void SetBounds(const QRect& bounds);
protected:
/**
* Resize the parts on this tree to fit in <code>bounds</code>.
*/
virtual void DoSetBounds(const QRect& bounds);
public:
/**
* Set the parent of this tree.
*/
virtual void SetParent(LayoutTreeNode* parent);
/**
* Set the part of this leaf
*/
virtual void SetPart(LayoutPart::Pointer part);
/**
* Returns a string representation of this object.
*/
QString ToString() const override;
/**
* Creates SWT controls owned by the LayoutTree (ie: the sashes). Does not affect the
* LayoutParts that are being arranged by the LayoutTree.
*
* @param parent
* @since 3.1
*/
virtual void CreateControl(QWidget* parent);
/**
* Writes a description of the layout to the given string buffer.
* This is used for drag-drop test suites to determine if two layouts are the
* same. Like a hash code, the description should compare as equal iff the
* layouts are the same. However, it should be user-readable in order to
* help debug failed tests. Although these are english readable strings,
* they should not be translated or equality tests will fail.
* <p>
* This is only intended for use by test suites.
* </p>
*
* @param buf
*/
virtual void DescribeLayout(QString& buf) const;
/**
* This is a shorthand method that checks if the tree contains the
* given size flag. For example, hasSizeFlag(false, SWT.MIN) returns
* true iff the receiver enforces a minimum height, or
* hasSizeFlag(true, SWT.WRAP) returns true iff the receiver needs to
* know its height when computing its preferred width.
*
* @param vertical
* @return
* @since 3.1
*/
bool HasSizeFlag(bool width, int flag);
};
}
#endif /*BERRYLAYOUTTREE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutTreeNode.h b/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutTreeNode.h
index 1635c7c694..16e29546d0 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutTreeNode.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutTreeNode.h
@@ -1,225 +1,225 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYLAYOUTTREENODE_H_
#define BERRYLAYOUTTREENODE_H_
#include "berryLayoutTree.h"
#include "berryLayoutPartSash.h"
namespace berry {
/**
* \ingroup org_blueberry_ui_internal
*
* Implementation of a tree node. The node represents a
* sash and it allways has two children.
*/
class LayoutTreeNode : public LayoutTree {
public:
- berryObjectMacro(LayoutTreeNode)
+ berryObjectMacro(LayoutTreeNode);
struct ChildSizes {
int left;
int right;
bool resizable;
ChildSizes (int l, int r, bool resize);
};
/* The node children witch may be another node or a leaf */
private: LayoutTree::Pointer children[2];
/**
* Initialize this tree with its sash.
*/
public: LayoutTreeNode(LayoutPartSash::Pointer sash);
public: ~LayoutTreeNode() override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutTree#flushChildren()
*/
public: void FlushChildren() override;
/**
* Traverses the tree to find the part that intersects the given point
*
* @param toFind
* @return the part that intersects the given point
*/
public: LayoutPart::Pointer FindPart(const QPoint& toFind) override;
/**
* Add the relation ship between the children in the list
* and returns the left children.
*/
public: LayoutPart::Pointer ComputeRelation(QList<PartSashContainer::RelationshipInfo>& relations) override;
/**
* Dispose all Sashs in this tree
*/
public: void DisposeSashes() override;
/**
* Find a LayoutPart in the tree and return its sub-tree. Returns
* null if the child is not found.
*/
public: SmartPointer<LayoutTree> Find(LayoutPart::Pointer child) override;
/**
* Find the part that is in the bottom right position.
*/
public: LayoutPart::Pointer FindBottomRight() override;
/**
* Go up in the tree finding a parent that is common of both children.
* Return the subtree.
*/
LayoutTreeNode* FindCommonParent(LayoutPart::Pointer child1, LayoutPart::Pointer child2,
bool foundChild1 = false, bool foundChild2 = false);
/**
* Find a sash in the tree and return its sub-tree. Returns
* null if the sash is not found.
*/
public: SmartPointer<LayoutTreeNode> FindSash(LayoutPartSash::Pointer sash) override;
using LayoutTree::FindSashes;
/**
* Sets the elements in the array of sashes with the
* Left,Rigth,Top and Botton sashes. The elements
* may be null depending whether there is a shash
* beside the <code>part</code>
*/
void FindSashes(SmartPointer<LayoutTree> child, PartPane::Sashes sashes);
/**
* Returns the sash of this node.
*/
public: LayoutPartSash::Pointer GetSash() const;
private: int GetSashSize() const;
/**
* Returns true if this tree has visible parts otherwise returns false.
*/
public: bool IsVisible() override;
using LayoutTree::Remove;
/**
* Remove the child and this node from the tree
*/
SmartPointer<LayoutTree> Remove(SmartPointer<LayoutTree> child);
/**
* Replace a child with a new child and sets the new child's parent.
*/
void ReplaceChild(SmartPointer<LayoutTree> oldChild, SmartPointer<LayoutTree> newChild);
/**
* Go up from the subtree and return true if all the sash are
* in the direction specified by <code>isVertical</code>
*/
public: bool SameDirection(bool isVertical, SmartPointer<LayoutTreeNode> subTree);
public: int DoComputePreferredSize(bool width, int availableParallel, int availablePerpendicular, int preferredParallel) override;
/**
* Computes the pixel sizes of this node's children, given the available
* space for this node. Note that "width" and "height" actually refer
* to the distance perpendicular and parallel to the sash respectively.
* That is, their meaning is reversed when computing a horizontal sash.
*
* @param width the pixel width of a vertical node, or the pixel height
* of a horizontal node (INF if unbounded)
* @param height the pixel height of a vertical node, or the pixel width
* of a horizontal node (INF if unbounded)
* @return a struct describing the pixel sizes of the left and right children
* (this is a width for horizontal nodes and a height for vertical nodes)
*/
ChildSizes ComputeChildSizes(int width, int height, int left, int right, int preferredWidth);
protected: int DoGetSizeFlags(bool width) override;
/**
* Resize the parts on this tree to fit in <code>bounds</code>.
*/
public: void DoSetBounds(const QRect& bounds) override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutTree#createControl(org.blueberry.swt.widgets.Composite)
*/
public: void CreateControl(QWidget* parent) override;
//Added by hudsonr@us.ibm.com - bug 19524
public: bool IsCompressible() override;
/**
* Returns 0 if there is no bias. Returns -1 if the first child should be of
* fixed size, and the second child should be compressed. Returns 1 if the
* second child should be of fixed size.
* @return the bias
*/
public: int GetCompressionBias();
bool IsLeftChild(SmartPointer<const LayoutTree> toTest);
SmartPointer<LayoutTree> GetChild(bool left);
/**
* Sets a child in this node
*/
void SetChild(bool left, LayoutPart::Pointer part);
/**
* Sets a child in this node
*/
void SetChild(bool left, SmartPointer<LayoutTree> child);
/**
* Returns a string representation of this object.
*/
public: QString ToString() const override;
/**
* Create the sashes if the children are visible
* and dispose it if they are not.
*/
//public: void UpdateSashes(QWidget* parent);
/**
* Writes a description of the layout to the given string buffer.
* This is used for drag-drop test suites to determine if two layouts are the
* same. Like a hash code, the description should compare as equal iff the
* layouts are the same. However, it should be user-readable in order to
* help debug failed tests. Although these are english readable strings,
* they should not be translated or equality tests will fail.
*
* @param buf
*/
public: void DescribeLayout(QString& buf) const override;
private:
static QRect FlipRect(const QRect& rect);
};
}
#endif /*BERRYLAYOUTTREENODE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryNestableHandlerService.h b/Plugins/org.blueberry.ui.qt/src/internal/berryNestableHandlerService.h
index 042157b369..fe2b0f3425 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryNestableHandlerService.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryNestableHandlerService.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYNESTABLEHANDLERSERVICE_H
#define BERRYNESTABLEHANDLERSERVICE_H
#include "berrySlaveHandlerService.h"
#include "berryINestable.h"
namespace berry {
/**
* <p>
* A handler service which delegates almost all responsibility to the parent
* service. It is capable of being nested inside a component that is not
* recognizable by the "sources" event mechanism. This means that the handlers
* must be activated and deactivated manually.
* </p>
* <p>
* This class is not intended for use outside of the
* <code>org.eclipse.ui.workbench</code> plug-in.
* </p>
*/
class NestableHandlerService : public SlaveHandlerService, public INestable
{
private:
/**
* Whether the component with which this service is associated is active.
*/
bool active;
public:
- berryObjectMacro(berry::NestableHandlerService)
+ berryObjectMacro(berry::NestableHandlerService);
/**
* Constructs a new instance.
*
* @param parentHandlerService
* The parent handler service for this slave; must not be
* <code>null</code>.
* @param defaultExpression
* The default expression to use if none is provided. This is
* primarily used for conflict resolution. This value may be
* <code>null</code>.
*/
NestableHandlerService(IHandlerService* parentHandlerService,
const SmartPointer<Expression>& defaultExpression);
void Activate() override;
void Deactivate() override;
protected:
SmartPointer<IHandlerActivation> DoActivation(
const SmartPointer<IHandlerActivation>& localActivation) override;
};
}
#endif // BERRYNESTABLEHANDLERSERVICE_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryNullEditorInput.h b/Plugins/org.blueberry.ui.qt/src/internal/berryNullEditorInput.h
index 3a9a83eaa9..c277324aa9 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryNullEditorInput.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryNullEditorInput.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYnullptrEDITORINPUT_H_
#define BERRYnullptrEDITORINPUT_H_
#include "berryIEditorInput.h"
#include "berryEditorReference.h"
namespace berry {
/**
* \ingroup org_blueberry_ui_internal
*
*/
class NullEditorInput : public IEditorInput {
private: EditorReference::Pointer editorReference;
public:
- berryObjectMacro(NullEditorInput)
+ berryObjectMacro(NullEditorInput);
NullEditorInput();
/**
* Creates a <code>NullEditorInput</code> for the
* given editor reference.
*
* @param editorReference the editor reference
*/
NullEditorInput(EditorReference::Pointer editorReference);
bool Exists() const override;
QIcon GetIcon() const override;
QString GetName() const override;
const IPersistableElement* GetPersistable() const override;
QString GetToolTipText() const override;
Object* GetAdapter(const QString &adapterType) const override;
bool operator==(const Object* o) const override;
};
}
#endif /*BERRYnullptrEDITORINPUT_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryPagePartSelectionTracker.h b/Plugins/org.blueberry.ui.qt/src/internal/berryPagePartSelectionTracker.h
index 5f6218d524..6b73366edc 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryPagePartSelectionTracker.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryPagePartSelectionTracker.h
@@ -1,139 +1,139 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYPAGEPARTSELECTIONTRACKER_H_
#define BERRYPAGEPARTSELECTIONTRACKER_H_
#include "berryIPartListener.h"
#include "berryISelectionChangedListener.h"
#include "berryISelectionService.h"
#include "berryISelectionProvider.h"
#include "berrySelectionChangedEvent.h"
#include "berryIWorkbenchPage.h"
#include "berryAbstractPartSelectionTracker.h"
namespace berry
{
/**
* \ingroup org_blueberry_ui_internal
*
* Provides per-part selection tracking for the selection service.
*/
class PagePartSelectionTracker : public AbstractPartSelectionTracker
{
public:
- berryObjectMacro(PagePartSelectionTracker)
+ berryObjectMacro(PagePartSelectionTracker);
private:
/**
* The workbench page for which this is tracking selection.
*/
IWorkbenchPage* fPage;
/**
* The part in this tracker's page, or <code>null</code> if one is not open.
*/
IWorkbenchPart::Pointer fPart;
struct PostSelectionListener : public ISelectionChangedListener
{
PostSelectionListener(PagePartSelectionTracker* tracker);
void SelectionChanged(const SelectionChangedEvent::Pointer& event) override;
PagePartSelectionTracker* m_Tracker;
};
friend struct PostSelectionListener;
friend class SelTrackerPartListener;
friend class SelTrackerPerspectiveListener;
friend class SelTrackerSelectionChangedListener;
QScopedPointer<ISelectionChangedListener> postSelectionListener;
QScopedPointer<IPerspectiveListener> perspListener;
QScopedPointer<ISelectionChangedListener> selChangedListener;
QScopedPointer<IPartListener> partListener;
public:
/**
* Constructs a part selection tracker for the part with the given id.
*
* @param id part identifier
*/
PagePartSelectionTracker(IWorkbenchPage* page,
const QString& partId);
/**
* Returns the selection from the part being tracked,
* or <code>null</code> if the part is closed or has no selection.
*/
ISelection::ConstPointer GetSelection() override;
/**
* Disposes this selection tracker. This removes all listeners currently registered.
*/
~PagePartSelectionTracker() override;
protected:
/**
* Returns the part this is tracking,
* or <code>null</code> if it is not open
*
* @return part., or <code>null</code>
*/
IWorkbenchPart::Pointer GetPart();
/**
* Returns the page this selection provider works for
*
* @return workbench page
*/
IWorkbenchPage::Pointer GetPage();
ISelectionProvider::Pointer GetSelectionProvider();
private:
/**
* Returns the id for the given part, taking into account
* multi-view instances which may have a secondary id.
*
*/
QString GetPartId(IWorkbenchPart::Pointer part);
/**
* Sets the page this selection provider works for
*
* @param page workbench page
*/
void SetPage(IWorkbenchPage* page);
/**
* Sets the part for this selection tracker.
*
* @param part the part
* @param notify whether to send notification that the selection has changed.
*/
void SetPart(IWorkbenchPart::Pointer part, bool notify);
};
}
#endif /*BERRYPAGEPARTSELECTIONTRACKER_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryPartPane.h b/Plugins/org.blueberry.ui.qt/src/internal/berryPartPane.h
index 57f972194c..68f0a864ce 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryPartPane.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryPartPane.h
@@ -1,434 +1,434 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYPARTPANE_H_
#define BERRYPARTPANE_H_
#include "berryWorkbenchPartReference.h"
#include "berryLayoutPart.h"
#include "berryIPropertyChangeListener.h"
#include "guitk/berryGuiTkIControlListener.h"
class QToolBar;
namespace berry {
class WorkbenchPage;
class PartStack;
struct ILayoutContainer;
/**
* Provides the common behavior for both views
* and editor panes.
*
*/
class PartPane : public LayoutPart,
public IPropertyChangeListener,
public GuiTk::IControlListener
{
public:
- berryObjectMacro(PartPane)
+ berryObjectMacro(PartPane);
friend class PartSashContainer;
friend class EditorSashContainer;
friend class WorkbenchPage;
friend struct ILayoutContainer;
friend class PartStack;
friend class ContainerPlaceholder;
friend class LayoutTree;
friend class LayoutTreeNode;
friend class DetachedPlaceHolder;
friend class PerspectiveHelper;
// private: MenuManager paneMenuManager;
// private: ListenerList listeners = new ListenerList();
// private: ListenerList partListeners = new ListenerList();
private: IPropertyChangeListener::Events propertyChangeEvents;
protected: IWorkbenchPartReference::WeakPtr partReference;
protected: WorkbenchPage* page;
protected: QWidget* control;
private: bool inLayout;
// private: TraverseListener traverseListener = new TraverseListener() {
// /* (non-Javadoc)
// * @see org.blueberry.swt.events.TraverseListener#keyTraversed(org.blueberry.swt.events.TraverseEvent)
// */
// public: void keyTraversed(TraverseEvent e) {
// // Hack: Currently, SWT sets focus whenever we call Control.traverse. This doesn't
// // cause too much of a problem for ctrl-pgup and ctrl-pgdn, but it is seriously unexpected
// // for other traversal events. When (and if) it becomes possible to call traverse() without
// // forcing a focus change, this if statement should be removed and ALL events should be
// // forwarded to the container.
// if (e.detail == SWT.TRAVERSE_PAGE_NEXT
// || e.detail == SWT.TRAVERSE_PAGE_PREVIOUS) {
// ILayoutContainer container = getContainer();
// if (container != null && container instanceof LayoutPart) {
// LayoutPart parent = (LayoutPart) container;
// Control parentControl = parent.getControl();
// if (parentControl != null && !parentControl.isDisposed()) {
// e.doit = parentControl.traverse(e.detail);
// if (e.doit) {
// e.detail = SWT.TRAVERSE_NONE;
// }
// }
// }
// }
// }
//
// };
private: bool busy;
private: bool hasFocus;
//private: SmartPointer<PartStack> partStack;
protected:
/*static*/ class Sashes {
public:
Sashes();
/*Sash*/ QWidget* left;
/*Sash*/ QWidget* right;
/*Sash*/ QWidget* top;
/*Sash*/ QWidget* bottom;
};
/**
* Construct a pane for a part.
*/
public: PartPane(IWorkbenchPartReference::Pointer partReference,
WorkbenchPage* workbenchPage);
// public: void addSizeMenuItem(Menu menu, int index) {
// //Add size menu
// MenuItem item = new MenuItem(menu, SWT.CASCADE, index);
// item.setText(WorkbenchMessages.PartPane_size);
// Menu sizeMenu = new Menu(menu);
// item.setMenu(sizeMenu);
// addSizeItems(sizeMenu);
// }
/**
*
* Creates the GUI-dependent container control
* for the part widgets. This is passed to
* IWorkbenchPart::CreatePartControl(QWidget*)
*/
public: void CreateControl(QWidget* parent) override;
//public: virtual void SetControlEnabled(bool enabled) = 0;
/**
* Create a title bar for the pane if required.
*/
// protected: virtual void CreateTitleBar() = 0;
/**
* @private:
*/
public: ~PartPane() override;
/**
* User has requested to close the pane.
* Take appropriate action depending on type.
*/
public: void DoHide();
protected: QRect GetParentBounds();
/**
* Get the control.
*/
public: QWidget* GetControl() override;
/**
* Answer the part child.
*/
public: IWorkbenchPartReference::Pointer GetPartReference() const;
/**
* @see GuiTk::IControlListener
*/
public: void ControlActivated(GuiTk::ControlEvent::Pointer e) override;
/**
* @see GuiTk::IControlListener
*/
public: GuiTk::IControlListener::Events::Types GetEventTypes() const override;
/**
* Move the control over another one.
*/
public: void MoveAbove(QWidget* refControl) override;
/**
* Notify the workbook page that the part pane has
* been activated by the user.
*/
public: void RequestActivation();
/**
* Shows the receiver if <code>visible</code> is true otherwise hide it.
*/
public: void SetVisible(bool makeVisible) override;
public: bool GetVisible() override;
/**
* Sets focus to this part.
*/
public: void SetFocus() override;
/**
* Sets the workbench page of the view.
*/
public: void SetWorkbenchPage(SmartPointer<WorkbenchPage> workbenchPage);
public: void Reparent(QWidget* newParent) override;
/**
* Indicate focus in part.
*/
public: void ShowFocus(bool inFocus);
/**
* @see IPartDropTarget::targetPartFor
*/
// public: LayoutPart targetPartFor(LayoutPart dragSource) {
// return this;
// }
/**
* Returns the PartStack that contains this PartPane, or null if none.
*
* @return
*/
public: SmartPointer<PartStack> GetStack();
public: void SetContainer(SmartPointer<ILayoutContainer> stack) override;
/**
* Show a title label menu for this pane.
*/
// public: void ShowPaneMenu() {
// PartStack folder = getStack();
//
// if (folder != null) {
// folder.showPaneMenu();
// }
// }
/**
* Show the context menu for this part.
*/
// public: void showSystemMenu() {
// PartStack folder = getStack();
//
// if (folder != null) {
// folder.showSystemMenu();
// }
// }
/**
* Finds and return the sashes around this part.
*/
protected: Sashes FindSashes();
/**
* Enable the user to resize this part using
* the keyboard to move the specified sash
*/
// protected: void moveSash(final Sash sash) {
// moveSash(sash, this);
// }
// public: static void moveSash(final Sash sash,
// final LayoutPart toGetFocusWhenDone) {
// final KeyListener listener = new KeyAdapter() {
// public: void keyPressed(KeyEvent e) {
// if (e.character == SWT.ESC || e.character == '\r') {
// if (toGetFocusWhenDone != null) {
// toGetFocusWhenDone.setFocus();
// }
// }
// }
// };
// sash.addFocusListener(new FocusAdapter() {
// public: void focusGained(FocusEvent e) {
// sash.setBackground(sash.getDisplay().getSystemColor(
// SWT.COLOR_LIST_SELECTION));
// sash.addKeyListener(listener);
// }
//
// public: void focusLost(FocusEvent e) {
// sash.setBackground(null);
// sash.removeKeyListener(listener);
// }
// });
// sash.setFocus();
//
// }
/**
* Add a menu item to the Size Menu
*/
// protected: void addSizeItem(Menu sizeMenu, String labelMessage,
// final Sash sash) {
// MenuItem item = new MenuItem(sizeMenu, SWT.NONE);
// item.setText(labelMessage);
// item.addSelectionListener(new SelectionAdapter() {
// public: void widgetSelected(SelectionEvent e) {
// moveSash(sash);
// }
// });
// item.setEnabled(!isZoomed() && sash != null);
// }
/**
* Returns the workbench page of this pane.
*/
public: SmartPointer<WorkbenchPage> GetPage();
/**
* Add the Left,Right,Up,Botton menu items to the Size menu.
*/
// protected: void addSizeItems(Menu sizeMenu) {
// Sashes sashes = findSashes();
// addSizeItem(sizeMenu,
// WorkbenchMessages.PartPane_sizeLeft, sashes.left);
// addSizeItem(sizeMenu,
// WorkbenchMessages.PartPane_sizeRight, sashes.right);
// addSizeItem(sizeMenu,
// WorkbenchMessages.PartPane_sizeTop, sashes.top);
// addSizeItem(sizeMenu, WorkbenchMessages.PartPane_sizeBottom, sashes.bottom);
// }
/**
* Pin this part.
*/
protected: virtual void DoDock();
/**
* Set the busy state of the pane.
*/
public: virtual void SetBusy(bool isBusy);
/**
* Show a highlight for the receiver if it is
* not currently the part in the front of its
* presentation.
*
*/
public: virtual void ShowHighlight();
/**
* @return
*/
public: virtual QToolBar* GetToolBar();
/**
* @return
*/
public: bool HasViewMenu();
/**
* @param location
*/
// public: void ShowViewMenu(Point location) {
//
// }
public: bool IsBusy();
/**
* Writes a description of the layout to the given string buffer.
* This is used for drag-drop test suites to determine if two layouts are the
* same. Like a hash code, the description should compare as equal iff the
* layouts are the same. However, it should be user-readable in order to
* help debug failed tests. Although these are english readable strings,
* they do not need to be translated.
*
* @param buf
*/
public: void DescribeLayout(QString& buf) const override;
/**
* @return
* @since 3.1
*/
public: bool IsCloseable();
public: void SetInLayout(bool inLayout);
public: bool GetInLayout();
public: bool AllowsAutoFocus() override;
/**
* Clears all contribution items from the contribution managers (this is done separately
* from dispose() since it is done after the part is disposed). This is a bit of a hack.
* Really, the contribution managers should be part of the site, not the PartPane. If these
* were moved elsewhere, then disposal of the PartPane would be atomic and this method could
* be removed.
*/
public: virtual void RemoveContributions();
public: void AddPropertyListener(IPropertyChangeListener* listener);
public: void RemovePropertyListener(IPropertyChangeListener* listener);
public: void FirePropertyChange(const PropertyChangeEvent::Pointer& event);
/* (non-Javadoc)
* @see IPropertyChangeListener#PropertyChange(PropertyChangeEvent::Pointer)
*/
public:
using IPropertyChangeListener::PropertyChange;
void PropertyChange(const PropertyChangeEvent::Pointer& event) override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutPart#computePreferredSize(boolean, int, int, int)
*/
public: int ComputePreferredSize(bool width, int availableParallel,
int availablePerpendicular, int preferredParallel) override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutPart#getSizeFlags(boolean)
*/
public: int GetSizeFlags(bool horizontal) override;
/**
* Informs the pane that it's window shell has
* been activated.
*/
public: virtual void ShellActivated();
/**
* Informs the pane that it's window shell has
* been deactivated.
*/
public: virtual void ShellDeactivated();
};
}
#endif /*BERRYPARTPANE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryPartPlaceholder.h b/Plugins/org.blueberry.ui.qt/src/internal/berryPartPlaceholder.h
index 4a8deb4f2a..52198c31d1 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryPartPlaceholder.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryPartPlaceholder.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYPARTPLACEHOLDER_H_
#define BERRYPARTPLACEHOLDER_H_
#include "berryLayoutPart.h"
namespace berry {
/**
* \ingroup org_blueberry_ui_internal
*
* A PlaceHolder is a non-visible stand-in for a layout part.
*/
class PartPlaceholder : public LayoutPart {
public:
- berryObjectMacro(PartPlaceholder)
+ berryObjectMacro(PartPlaceholder);
/**
* Placeholder ids may contain wildcards. This is the wildcard string.
*
* @since 3.0
*/
static const QString WILD_CARD; // = "*";
PartPlaceholder(const QString& id);
/**
* Creates the SWT control
*/
void CreateControl(QWidget* parent) override;
/**
* Get the part control. This method may return null.
*/
QWidget* GetControl() override;
/**
* Returns whether this placeholder has a wildcard.
*
* @since 3.0
*/
bool HasWildCard();
bool IsPlaceHolder() const override;
};
}
#endif /*BERRYPARTPLACEHOLDER_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryPartSashContainer.h b/Plugins/org.blueberry.ui.qt/src/internal/berryPartSashContainer.h
index 2d991c78eb..d968134c10 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryPartSashContainer.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryPartSashContainer.h
@@ -1,695 +1,695 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYPARTSASHCONTAINER_H_
#define BERRYPARTSASHCONTAINER_H_
#include "berryLayoutPart.h"
#include "berryILayoutContainer.h"
#include "berryILayoutContainer.h"
#include "berryIDragOverListener.h"
#include "berryAbstractDropTarget.h"
#include "guitk/berryGuiTkIControlListener.h"
namespace berry
{
class WorkbenchPage;
class PartPane;
class LayoutTree;
class PartStack;
/**
* \ingroup org_blueberry_ui_internal
*
* Abstract container that groups various layout
* parts (possibly other containers) together as
* a unit. Manages the placement and size of these
* layout parts based on the location of sashes within
* the container.
*
* GUI specializations must override the following methods
* (read their documentation for implementation details):
*
* <ul>
* <li>PartSashContainer
*/
class PartSashContainer: public LayoutPart, public ILayoutContainer, public IDragOverListener {
public:
- berryObjectMacro(PartSashContainer)
+ berryObjectMacro(PartSashContainer);
friend class LayoutTree;
friend class LayoutTreeNode;
friend class PageLayout;
private:
QWidget* parentWidget;
//LayoutPart::Pointer zoomedPart;
/* Indicates if the children of a sash container should be aligned from left to right
* or the other way around. This is important if one child does
* not occupy all of the available space. Then the empty space
* is either on the left, or on the right side.
*/
bool static leftToRight;
protected:
struct ControlListener : public GuiTk::IControlListener
{
ControlListener(PartSashContainer* partSashContainer);
Events::Types GetEventTypes() const override;
void ControlResized(GuiTk::ControlEvent::Pointer e) override;
private: PartSashContainer* partSashContainer;
};
QWidget* parent;
GuiTk::IControlListener::Pointer resizeListener;
SmartPointer<LayoutTree> root;
WorkbenchPage* page;
bool active;
bool layoutDirty;
/* Array of LayoutPart */
ILayoutContainer::ChildrenType children;
protected:
struct RelationshipInfo
{
LayoutPart::Pointer part;
LayoutPart::Pointer relative;
int relationship;
/**
* Preferred size for the left child (this would be the size, in pixels of the child
* at the time the sash was last moved)
*/
int left;
/**
* Preferred size for the right child (this would be the size, in pixels of the child
* at the time the sash was last moved)
*/
int right;
};
private:
class SashContainerDropTarget : public AbstractDropTarget {
private:
int side;
int cursor;
// This is a ILayoutPart or ILayoutContainer
Object::Pointer targetPart;
// This is a ILayoutPart or ILayoutContainer
Object::Pointer sourcePart;
PartSashContainer* partSashContainer;
public:
- berryObjectMacro(SashContainerDropTarget)
+ berryObjectMacro(SashContainerDropTarget);
SashContainerDropTarget(PartSashContainer* partSashContainer, Object::Pointer sourcePart,
int side, int cursor, Object::Pointer targetPart);
void SetTarget(Object::Pointer sourcePart, int side, int cursor, Object::Pointer targetPart);
void Drop() override;
CursorType GetCursor() override;
QRect GetSnapRectangle() override;
};
SashContainerDropTarget::Pointer dropTarget;
public:
/**
* Constructs a PartSashContainer with the given id under the given page
* and parentWidget.
*
* GUI specializations must hook
*/
PartSashContainer(const QString& id, WorkbenchPage* page,
QWidget* parentWidget);
~PartSashContainer() override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.ILayoutContainer#obscuredByZoom(org.blueberry.ui.internal.LayoutPart)
*/
// public: bool childObscuredByZoom(LayoutPart toTest) {
// LayoutPart zoomPart = getZoomedPart();
//
// if (zoomPart != null && toTest != zoomPart) {
// return true;
// }
// return isObscuredByZoom();
// }
/**
* Given an object associated with a drag (a PartPane or PartStack), this returns
* the actual PartPanes being dragged.
*
* @param pane
* @return
*/
private:
QList<SmartPointer<PartPane> > GetVisibleParts(Object::Pointer pane);
/**
* Find the sashs around the specified part.
*/
public:
void FindSashes(LayoutPart::Pointer pane, PartPane::Sashes& sashes) override;
public:
/**
* Add a part.
*/
void Add(LayoutPart::Pointer child) override;
virtual void AddPart(LayoutPart::Pointer child);
/**
* Add a part relative to another. For compatibility only. New code should use
* addEnhanced, above.
*
* @param child the new part to add
* @param relationship one of PageLayout.TOP, PageLayout.BOTTOM, PageLayout.LEFT, or PageLayout.RIGHT
* @param ratio a value between 0.0 and 1.0, indicating how much space will be allocated to the UPPER-LEFT pane
* @param relative part where the new part will be attached
*/
virtual void Add(LayoutPart::Pointer child, int relationship, float ratio,
LayoutPart::Pointer relative);
protected:
virtual void DropObject(const QList<PartPane::Pointer>& toDrop,
LayoutPart::Pointer visiblePart,
Object::Pointer targetPart, int side);
/**
* Add a new part relative to another. This should be used in place of <code>add</code>.
* It differs as follows:
* <ul>
* <li>relationships are specified using SWT direction constants</li>
* <li>the ratio applies to the newly added child -- not the upper-left child</li>
* </ul>
*
* @param child new part to add to the layout
* @param swtDirectionConstant one of SWT.TOP, SWT.BOTTOM, SWT.LEFT, or SWT.RIGHT
* @param ratioForNewPart a value between 0.0 and 1.0 specifying how much space will be allocated for the newly added part
* @param relative existing part indicating where the new child should be attached
* @since 3.0
*/
protected:
virtual void AddEnhanced(LayoutPart::Pointer child, int swtDirectionConstant,
float ratioForNewPart, LayoutPart::Pointer relative);
protected:
static int MeasureTree(const QRect& outerBounds,
SmartPointer<const LayoutTree> toMeasure, bool horizontal);
protected:
virtual void AddChild(const RelationshipInfo& info);
/**
* Adds the child using ratio and position attributes
* from the specified placeholder without replacing
* the placeholder
*
* FIXME: I believe there is a bug in computeRelation()
* when a part is positioned relative to the editorarea.
* We end up with a null relative and 0.0 for a ratio.
*/
public:
virtual void AddChildForPlaceholder(LayoutPart::Pointer child,
LayoutPart::Pointer placeholder);
/**
* See ILayoutContainer#allowBorder
*/
public:
virtual bool AllowsBorder();
/**
* Notification that a child layout part has been
* added to the container. Subclasses may override
* this method to perform any container specific
* work.
*/
protected:
virtual void ChildAdded(LayoutPart::Pointer child);
/**
* Notification that a child layout part has been
* removed from the container. Subclasses may override
* this method to perform any container specific
* work.
*/
protected:
virtual void ChildRemoved(LayoutPart::Pointer child);
/**
* Returns an array with all the relation ship between the
* parts.
*/
public:
virtual QList<RelationshipInfo> ComputeRelation();
public:
virtual void SetActive(bool isActive);
/**
* @see LayoutPart#getControl
*/
public:
void CreateControl(QWidget* parentWidget) override;
/**
* Subclasses override this method to specify
* the composite to use to parent all children
* layout parts it contains.
*/
protected:
virtual QWidget* CreateParent(QWidget* parentWidget) = 0;
/**
* @see LayoutPart#dispose
*/
public:
void Dispose() override;
/**
* Subclasses override this method to dispose
* of any swt resources created during createParent.
*/
protected:
virtual void DisposeParent() = 0;
/**
* Dispose all sashs used in this perspective.
*/
public:
virtual void DisposeSashes();
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutPart#setVisible(boolean)
*/
public:
void SetVisible(bool makeVisible) override;
/**
* Return the most bottom right part or null if none.
*/
public:
virtual LayoutPart::Pointer FindBottomRight();
/**
* @see LayoutPart#getBounds
*/
public:
QRect GetBounds();
/**
* @see ILayoutContainer#getChildren
*/
public:
ChildrenType GetChildren() const override;
/**
* @see LayoutPart#getControl
*/
public:
QWidget* GetControl() override;
public:
virtual SmartPointer<LayoutTree> GetLayoutTree();
/**
* For themes.
*
* @return the current WorkbenchPage.
*/
public:
virtual SmartPointer<WorkbenchPage> GetPage();
/**
* Returns the composite used to parent all the
* layout parts contained within.
*/
public:
virtual QWidget* GetParent();
protected:
virtual bool IsChild(LayoutPart::Pointer part);
/**
* Returns whether this container is zoomed.
*/
// public: bool IsZoomed() {
// return (zoomedPart != null);
// }
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutPart#forceLayout(org.blueberry.ui.internal.LayoutPart)
*/
public:
void ResizeChild(LayoutPart::Pointer childThatChanged) override;
/**
* Remove a part.
*/
public:
void Remove(LayoutPart::Pointer child) override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutPart#forceLayout()
*/
public:
void FlushLayout();
/**
* Replace one part with another.
*/
public:
void Replace(LayoutPart::Pointer oldChild, LayoutPart::Pointer newChild) override;
private:
void ResizeSashes();
/**
* Returns the maximum size that can be utilized by this part if the given width and
* height are available. Parts can overload this if they have a quantized set of preferred
* sizes.
*
* @param width available horizontal space (pixels)
* @return returns a new point where point.x is <= availableWidth and point.y is <= availableHeight
*/
public:
int ComputePreferredSize(bool width, int availableParallel,
int availablePerpendicular, int preferredParallel) override;
public:
int GetSizeFlags(bool width) override;
/**
* @see LayoutPart#setBounds
*/
public:
void SetBounds(const QRect& r) override;
/**
* Zoom in on a particular layout part.
*
* The implementation of zoom is quite simple. When zoom occurs we create
* a zoom root which only contains the zoom part. We store the old
* root in unzoomRoot and then active the zoom root. When unzoom occurs
* we restore the unzoomRoot and dispose the zoom root.
*
* Note: Method assumes we are active.
*/
// private: void zoomIn(LayoutPart part) {
// // Sanity check.
// if (isZoomed()) {
// return;
// }
//
// // Hide the sashes
// root.disposeSashes();
//
// // Make all parts invisible except for the zoomed part
// LayoutPart[] children = getChildren();
// for (int i = 0; i < children.length; i++) {
// LayoutPart child = children[i];
// child.setVisible(child == part);
// }
//
// zoomedPart = part;
//
// // Notify the part that it has been zoomed
// part.setZoomed(true);
//
// // Remember that we need to trigger a layout
// layoutDirty = true;
// }
/**
* Returns the currently zoomed part or null if none
*
* @return the currently zoomed part or null if none
* @since 3.1
*/
// public: LayoutPart getZoomedPart() {
// return zoomedPart;
// }
// public: void childRequestZoomIn(LayoutPart toZoom) {
// if (!SwtUtil.isDisposed(this.parent)) {
// this.parent.setRedraw(false);
// }
// try {
// zoomIn(toZoom);
//
// requestZoomIn();
//
// if (layoutDirty) {
// resizeSashes();
// }
// } finally {
// if (!SwtUtil.isDisposed(this.parent)) {
// this.parent.setRedraw(true);
// }
// }
// }
// public: void childRequestZoomOut() {
// if (!SwtUtil.isDisposed(this.parent)) {
// this.parent.setRedraw(false);
// }
// try {
// zoomOut();
//
// requestZoomOut();
//
// if (layoutDirty) {
// resizeSashes();
// }
// } finally {
// if (!SwtUtil.isDisposed(this.parent)) {
// this.parent.setRedraw(true);
// }
// }
// }
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutPart#setZoomed(boolean)
*/
// public: void setZoomed(boolean isZoomed) {
// if (!isZoomed) {
// zoomOut();
// } else {
// if (!isZoomed()) {
// LayoutPart toZoom = pickPartToZoom();
//
// if (toZoom != null) {
// zoomIn(toZoom);
// }
// }
// }
// super.setZoomed(isZoomed);
// }
// public: LayoutPart pickPartToZoom() {
// return findBottomRight();
// }
/**
* Zoom out.
*
* See zoomIn for implementation details.
*
* Note: Method assumes we are active.
*/
// private: void zoomOut() {
// // Sanity check.
// if (!isZoomed()) {
// return;
// }
//
// LayoutPart zoomedPart = this.zoomedPart;
// this.zoomedPart = null;
// // Inform the part that it is no longer zoomed
// zoomedPart.setZoomed(false);
//
// // Make all children visible
// LayoutPart[] children = getChildren();
// for (int i = 0; i < children.length; i++) {
// LayoutPart child = children[i];
//
// child.setVisible(true);
// }
//
// // Recreate the sashes
// root.createControl(getParent());
//
// // Ensure that the part being un-zoomed will have its size refreshed.
// LayoutTree node = root.find(zoomedPart);
// node.flushCache();
//
// layoutDirty = true;
// }
/* (non-Javadoc)
* @see org.blueberry.ui.internal.dnd.IDragOverListener#drag(org.blueberry.swt.widgets.Control, java.lang.Object, org.blueberry.swt.graphics.QPoint, org.blueberry.swt.graphics.QRect)
*/
public:
IDropTarget::Pointer Drag(QWidget* currentControl, const Object::Pointer& draggedObject,
const QPoint& position, const QRect& dragRectangle) override;
/**
* @param sourcePart
* @param targetPart
* @param side
* @param cursor
* @return
* @since 3.1
*/
private:
SashContainerDropTarget::Pointer CreateDropTarget(Object::Pointer sourcePart, int side, int cursor, Object::Pointer targetPart);
/**
* Returns true iff this PartSashContainer allows its parts to be stacked onto the given
* container.
*
* @param container
* @return
*/
public:
virtual bool IsStackType(ILayoutContainer::Pointer toTest) = 0;
public:
virtual bool IsPaneType(LayoutPart::Pointer toTest) = 0;
protected:
virtual SmartPointer<PartStack> CreateStack() = 0;
public:
virtual void Stack(LayoutPart::Pointer newPart, SmartPointer<ILayoutContainer> container);
/**
* @param container
* @param visiblePart
*/
protected:
virtual void SetVisiblePart(ILayoutContainer::Pointer container,
SmartPointer<PartPane> visiblePart) = 0;
/**
* @param container
* @return
*/
protected:
virtual LayoutPart::Pointer GetVisiblePart(
ILayoutContainer::Pointer container) = 0;
/**
* @param sourcePart
*/
protected:
virtual void DerefPart(LayoutPart::Pointer sourcePart);
protected:
virtual std::size_t GetVisibleChildrenCount(ILayoutContainer::Pointer container);
protected:
virtual float
GetDockingRatio(Object::Pointer dragged, ILayoutContainer::Pointer target);
/**
* Writes a description of the layout to the given string buffer.
* This is used for drag-drop test suites to determine if two layouts are the
* same. Like a hash code, the description should compare as equal iff the
* layouts are the same. However, it should be user-readable in order to
* help debug failed tests. Although these are english readable strings,
* they should not be translated or equality tests will fail.
*
* @param buf
*/
public:
void DescribeLayout(QString& buf) const override;
/**
* Adds a new child to the container relative to some part
*
* @param child
* @param relationship
* @param left preferred pixel size of the left/top child
* @param right preferred pixel size of the right/bottom child
* @param relative relative part
*/
protected:
virtual void Add(LayoutPart::Pointer child, int relationship, int left, int right,
LayoutPart::Pointer relative);
/* (non-Javadoc)
* @see org.blueberry.ui.internal.ILayoutContainer#isZoomed(org.blueberry.ui.internal.LayoutPart)
*/
// public: bool childIsZoomed(LayoutPart toTest) {
// return toTest == getZoomedPart();
// }
/* (non-Javadoc)
* @see org.blueberry.ui.internal.ILayoutContainer#allowsAutoFocus()
*/
public:
bool AllowsAutoFocus() override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutPart#startDeferringEvents()
*/
protected:
void StartDeferringEvents() override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutPart#handleDeferredEvents()
*/
protected:
void HandleDeferredEvents() override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutPart#testInvariants()
*/
public:
void TestInvariants() override;
};
}
#endif /*BERRYPARTSASHCONTAINER_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryPartSite.h b/Plugins/org.blueberry.ui.qt/src/internal/berryPartSite.h
index 4622bf396e..8cf91d2489 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryPartSite.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryPartSite.h
@@ -1,310 +1,310 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYPARTSITE_H_
#define BERRYPARTSITE_H_
#include <berryIConfigurationElement.h>
#include "berryServiceLocator.h"
#include "berryIWorkbenchPartSite.h"
#include "berryIWorkbenchPartReference.h"
#include "berryISelectionProvider.h"
namespace berry {
struct IWorkbenchPart;
struct IWorkbenchPage;
struct IWorkbenchWindow;
struct IWorkbenchLocationService;
class PartPane;
class Shell;
/**
* \ingroup org_blueberry_ui_internal
*
* <code>PartSite</code> is the general implementation for an
* <code>IWorkbenchPartSite</code>. A site maintains the context for a part,
* including the part, its pane, active contributions, selection provider, etc.
* Together, these components make up the complete behavior for a part as if it
* was implemented by one person.
*
* The <code>PartSite</code> lifecycle is as follows ..
*
* <ol>
* <li>a site is constructed </li>
* <li>a part is constructed and stored in the part </li>
* <li>the site calls part.init() </li>
* <li>a pane is constructed and stored in the site </li>
* <li>the action bars for a part are constructed and stored in the site </li>
* <li>the pane is added to a presentation </li>
* <li>the SWT widgets for the pane and part are created </li>
* <li>the site is activated, causing the actions to become visible </li>
* </ol>
*/
class PartSite : public virtual IWorkbenchPartSite
{
public:
- berryObjectMacro(PartSite, IWorkbenchPartSite)
+ berryObjectMacro(PartSite, IWorkbenchPartSite);
/**
* This is a helper method for the register context menu functionality. It
* is provided so that different implementations of the
* <code>IWorkbenchPartSite</code> interface don't have to worry about how
* context menus should work.
*
* @param menuId
* the menu id
* @param menuManager
* the menu manager
* @param selectionProvider
* the selection provider
* @param includeEditorInput
* whether editor inputs should be included in the structured
* selection when calculating contributions
* @param part
* the part for this site
* @param menuExtenders
* the collection of menu extenders for this site
* @see IWorkbenchPartSite#registerContextMenu(MenuManager,
* ISelectionProvider)
*/
//public: static void RegisterContextMenu(const QString& menuId,
// const MenuManager menuManager,
// const ISelectionProvider selectionProvider,
// bool includeEditorInput, IWorkbenchPart::ConstPointer part,
// const Collection menuExtenders);
private:
IWorkbenchPartReference::WeakPtr partReference;
WeakPointer<IWorkbenchPart> part;
IWorkbenchPage* page;
QString extensionID;
QString pluginID;
QString extensionName;
ISelectionProvider::Pointer selectionProvider;
//SubActionBars actionBars;
//KeyBindingService keyBindingService;
//ArrayList menuExtenders;
//WorkbenchSiteProgressService progressService;
struct ServiceLocatorOwner : public IDisposable
{
ServiceLocatorOwner(PartSite* site);
PartSite* site;
void Dispose() override;
};
ServiceLocatorOwner::Pointer serviceLocatorOwner;
QScopedPointer<IWorkbenchLocationService, QScopedPointerObjectDeleter> workbenchLocationService;
protected:
ServiceLocator::Pointer serviceLocator;
/**
* Build the part site.
*
* @param ref
* the part reference
* @param part
* the part
* @param page
* the page it belongs to
*/
public: PartSite(IWorkbenchPartReference::Pointer ref, SmartPointer<IWorkbenchPart> part,
IWorkbenchPage* page);
/**
* Initialize the local services.
*/
private: void InitializeDefaultServices();
/**
* Dispose the contributions.
*/
public: ~PartSite() override;
/**
* Returns the action bars for the part. If this part is a view then it has
* exclusive use of the action bars. If this part is an editor then the
* action bars are shared among this editor and other editors of the same
* type.
*/
//public: virtual IActionBars GetActionBars();
/**
* Returns the part registry extension ID.
*
* @return the registry extension ID
*/
public: QString GetId() const override;
/**
* Returns the page containing this workbench site's part.
*
* @return the page containing this part
*/
public: SmartPointer<IWorkbenchPage> GetPage() override;
/**
* Gets the part pane.
*/
public: SmartPointer<PartPane> GetPane();
/**
* Returns the part.
*/
public: SmartPointer<IWorkbenchPart> GetPart() override;
/**
* Returns the part reference.
*/
public: virtual IWorkbenchPartReference::Pointer GetPartReference();
/**
* Returns the part registry plugin ID. It cannot be <code>null</code>.
*
* @return the registry plugin ID
*/
public: QString GetPluginId() const override;
/**
* Returns the registered name for this part.
*/
public: QString GetRegisteredName() const override;
/**
* Returns the selection provider for a part.
*/
public: ISelectionProvider::Pointer GetSelectionProvider() override;
/**
* Returns the shell containing this part.
*
* @return the shell containing this part
*/
public: SmartPointer<Shell> GetShell() override;
/**
* Returns the workbench window containing this part.
*
* @return the workbench window containing this part
*/
public: SmartPointer<IWorkbenchWindow> GetWorkbenchWindow() override;
/**
* Register a popup menu for extension.
*/
//public: virtual void RegisterContextMenu(const QString& menuID,
// MenuManager menuMgr,
// ISelectionProvider selProvider);
/**
* Register a popup menu with the default id for extension.
*/
//public: virtual void RegisterContextMenu(MenuManager menuMgr,
// ISelectionProvider selProvider);
// getContextMenuIds() added by Dan Rubel (dan_rubel@instantiations.com)
/**
* Get the registered popup menu identifiers
*/
//public: virtual void GetContextMenuIds(QList<QString>& menuIds);
/**
* Sets the action bars for the part.
*/
//public: virtual void SetActionBars(SubActionBars bars);
/**
* Sets the configuration element for a part.
*/
public: virtual void SetConfigurationElement(IConfigurationElement::Pointer configElement);
protected: virtual void SetPluginId(const QString& pluginId);
/**
* Sets the part registry extension ID.
*
* @param id
* the registry extension ID
*/
protected: virtual void SetId(const QString& id);
/**
* Sets the part.
*/
public: virtual void SetPart(SmartPointer<IWorkbenchPart> newPart);
/**
* Sets the registered name for this part.
*
* @param name
* the registered name
*/
protected: virtual void SetRegisteredName(const QString& name);
/**
* Set the selection provider for a part.
*/
public: void SetSelectionProvider(ISelectionProvider::Pointer provider) override;
/*
* @see IWorkbenchPartSite#getKeyBindingService()
*
* TODO deprecated: use IHandlerService instead
*/
//public: virtual IKeyBindingService GetKeyBindingService();
protected: virtual QString GetInitialScopeId();
/**
* Get an adapter for this type.
*
* @param adapter
* @return
*/
protected: void* GetAdapterImpl(const std::type_info& adapter) const;
//public: virtual void ActivateActionBars(bool forceVisibility);
//public: virtual void DeactivateActionBars(bool forceHide);
/**
* Get a progress service for the receiver.
*
* @return WorkbenchSiteProgressService
*/
//public: virtual WorkbenchSiteProgressService GetSiteProgressService();
public: Object* GetService(const QString& api) override;
public: bool HasService(const QString& api) const override;
/**
* Prints out the identifier, the plug-in identifier and the registered
* name. This is for debugging purposes only.
*
* @since 3.2
*/
public: QString ToString() const override;
};
} // namespace berry
#endif /*BERRYPARTSITE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryPartStack.h b/Plugins/org.blueberry.ui.qt/src/internal/berryPartStack.h
index 013a820fab..ff2bd3012e 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryPartStack.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryPartStack.h
@@ -1,756 +1,756 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYPARTSTACK_H_
#define BERRYPARTSTACK_H_
#include "berryLayoutPart.h"
#include "berryILayoutContainer.h"
#include "berryWorkbenchPage.h"
#include "berryPresentablePart.h"
#include "berryPartPlaceholder.h"
#include "berryDefaultStackPresentationSite.h"
#include "berryPresentationFactoryUtil.h"
#include "berryAbstractDropTarget.h"
#include "berryPartPane.h"
#include "berryIMemento.h"
#include "presentations/berryIPresentationFactory.h"
namespace berry {
/**
* \ingroup org_blueberry_ui_internal
*
* Implements the common behavior for stacks of Panes (ie: EditorStack and ViewStack)
* This layout container has PartPanes as children and belongs to a PartSashContainer.
*
* @since 3.0
*/
class PartStack : public LayoutPart, public ILayoutContainer {
friend class EditorSashContainer;
friend class PartSashContainer;
friend class DetachedWindow;
public:
- berryObjectMacro(PartStack)
+ berryObjectMacro(PartStack);
public: static const int PROP_SELECTION; // = 0x42;
private: typedef QList<LayoutPart::Pointer> ChildVector;
private: ChildVector children;
private: WorkbenchPage* page;
private: bool isActive;
private: bool allowStateChanges;
private: typedef QList<IPresentablePart::Pointer> PresentableVector;
private: PresentableVector presentableParts;
private: QHash<QString, QString> properties;
protected: int appearance;
/**
* Stores the last value passed to setSelection. If UI updates are being deferred,
* this may be significantly different from the other current pointers. Once UI updates
* are re-enabled, the stack will update the presentation selection to match the requested
* current pointer.
*/
private: LayoutPart::Pointer requestedCurrent;
/**
* Stores the current part for the stack. Whenever the outside world asks a PartStack
* for the current part, this is what gets returned. This pointer is only updated after
* the presentation selection has been restored and the stack has finished updating its
* internal state. If the stack is still in the process of updating the presentation,
* it will still point to the previous part until the presentation is up-to-date.
*/
private: LayoutPart::Pointer current;
/**
* Stores the presentable part sent to the presentation. Whenever the presentation
* asks for the current part, this is what gets returned. This is updated before sending
* the part to the presentation, and it is not updated while UI updates are disabled.
* When UI updates are enabled, the stack first makes presentationCurrent match
* requestedCurrent. Once the presentation is displaying the correct part, the "current"
* pointer on PartStack is updated.
*/
private: PresentablePart::Pointer presentationCurrent;
private: bool ignoreSelectionChanges;
protected: IMemento::Pointer savedPresentationState;
protected:
class MyStackPresentationSite : public DefaultStackPresentationSite {
private:
PartStack* partStack;
public:
MyStackPresentationSite(PartStack* stack);
void Close(IPresentablePart::Pointer part);
void Close(const QList<IPresentablePart::Pointer>& parts) override;
void DragStart(IPresentablePart::Pointer beingDragged,
QPoint& initialLocation, bool keyboard) override;
void DragStart(QPoint& initialLocation, bool keyboard) override;
bool IsPartMoveable(IPresentablePart::Pointer part) override;
void SelectPart(IPresentablePart::Pointer toSelect) override;
bool SupportsState(int state) override;
void SetState(int newState) override;
IPresentablePart::Pointer GetSelectedPart() override;
// void AddSystemActions(IMenuManager menuManager) {
// PartStack.this.addSystemActions(menuManager);
// }
bool IsStackMoveable() override;
void FlushLayout() override;
PresentableVector GetPartList() override;
QString GetProperty(const QString& id) override;
};
DefaultStackPresentationSite::Pointer presentationSite;
private:
class PartStackDropResult : public AbstractDropTarget {
private:
PartPane::WeakPtr pane;
// Result of the presentation's dragOver method or null if we are stacking over the
// client area of the pane.
StackDropResult::Pointer dropResult;
PartStack::WeakPtr stack;
public:
- berryObjectMacro(PartStackDropResult)
+ berryObjectMacro(PartStackDropResult);
/**
* Resets the target of this drop result (allows the same drop result object to be
* reused)
*
* @param stack
* @param pane
* @param result result of the presentation's dragOver method, or null if we are
* simply stacking anywhere.
* @since 3.1
*/
void SetTarget(PartStack::Pointer stack, PartPane::Pointer pane, StackDropResult::Pointer result);
void Drop() override;
CursorType GetCursor() override;
QRect GetSnapRectangle() override;
};
private: static PartStackDropResult::Pointer dropResult;
// protected: bool isMinimized;
private: IPropertyChangeListener::Events propEvents;
/**
* Custom presentation factory to use for this stack, or null to
* use the default
*/
private: IPresentationFactory* factory;
// private: boolean smartZoomed = false;
// private: boolean doingUnzoom = false;
protected: virtual bool IsMoveable(IPresentablePart::Pointer part);
// protected: abstract void addSystemActions(IMenuManager menuManager);
protected: virtual bool SupportsState(int newState);
protected: virtual bool CanMoveFolder();
protected: virtual void DerefPart(LayoutPart::Pointer toDeref);
protected: virtual bool AllowsDrop(PartPane::Pointer part);
// protected: static void appendToGroupIfPossible(IMenuManager m,
// String groupId, ContributionItem item) {
// try {
// m.appendToGroup(groupId, item);
// } catch (IllegalArgumentException e) {
// m.add(item);
// }
// }
/**
* Creates a new part stack that uses the given custom presentation factory
* @param appearance
* @param factory custom factory to use (or null to use the default)
*/
public: PartStack(WorkbenchPage* page,
bool allowsStateChanges = true,
int appearance = PresentationFactoryUtil::ROLE_VIEW,
IPresentationFactory* factory = nullptr);
/**
* Adds a property listener to this stack. The listener will receive a PROP_SELECTION
* event whenever the result of getSelection changes
*
* @param listener
*/
public: void AddListener(IPropertyChangeListener* listener);
public: void RemoveListener(IPropertyChangeListener* listener);
public: int GetAppearance() const;
public: QString GetID() const override;
protected: bool IsStandalone();
/**
* Returns the currently selected IPresentablePart, or null if none
*
* @return
*/
protected: IPresentablePart::Pointer GetSelectedPart();
protected: IStackPresentationSite::Pointer GetPresentationSite();
/**
* Tests the integrity of this object. Throws an exception if the object's state
* is invalid. For use in test suites.
*/
public: void TestInvariants() override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutPart#describeLayout(java.lang.StringBuffer)
*/
public: void DescribeLayout(QString& buf) const override;
/**
* See IVisualContainer#add
*/
public: void Add(LayoutPart::Pointer child) override;
/**
* Add a part at a particular position
*/
protected: void Add(LayoutPart::Pointer newChild, Object::Pointer cookie);
public: bool AllowsAdd(LayoutPart::Pointer toAdd) override;
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.internal.ILayoutContainer#allowsAutoFocus()
*/
public: bool AllowsAutoFocus() override;
/**
* @param parts
*/
protected: void Close(const QList<IPresentablePart::Pointer>& parts);
/**
* @param part
*/
protected: void Close(IPresentablePart::Pointer part);
protected: IPresentationFactory* GetFactory();
public: void CreateControl(QWidget* parent) override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutPart#getDropTarget(java.lang.Object, org.blueberry.swt.graphics.QPoint)
*/
public: IDropTarget::Pointer GetDropTarget(Object::Pointer draggedObject, const QPoint& position) override;
public: void SetActive(bool isActive);
public: IDropTarget::Pointer CreateDropTarget(PartPane::Pointer pane, StackDropResult::Pointer result);
/**
* Saves the current state of the presentation to savedPresentationState, if the
* presentation exists.
*/
protected: void SavePresentationState();
public: ~PartStack() override;
/**
* See LayoutPart#Dispose
*/
public: void Dispose() override;
public: void FindSashes(LayoutPart::Pointer toFind, PartPane::Sashes& sashes) override;
/**
* Gets the presentation bounds.
*/
public: QRect GetBounds();
/**
* See IVisualContainer#getChildren
*/
public: ChildVector GetChildren() const override;
public: QWidget* GetControl() override;
/**
* Answer the number of children.
*/
public: ChildVector::size_type GetItemCount();
/**
* Returns the LayoutPart for the given IPresentablePart, or null if the given
* IPresentablePart is not in this stack. Returns null if given a null argument.
*
* @param part to locate or null
* @return
*/
protected: PartPane::Pointer GetPaneFor(IPresentablePart::Pointer part);
/**
* Get the parent control.
*/
public: QWidget* GetParent();
/**
* Returns a list of IPresentablePart
*
* @return
*/
public: PresentableVector GetPresentableParts();
private: PresentablePart::Pointer GetPresentablePart(LayoutPart::Pointer pane);
protected: StackPresentation::Pointer GetPresentation();
/**
* Returns the visible child.
* @return the currently visible part, or null if none
*/
public: PartPane::Pointer GetSelection();
private: void PresentationSelectionChanged(IPresentablePart::Pointer newSelection);
/**
* See IVisualContainer#remove
*/
public: void Remove(LayoutPart::Pointer child) override;
/**
* Reparent a part. Also reparent visible children...
*/
public: void Reparent(QWidget* newParent) override;
/**
* See IVisualContainer#replace
*/
public: void Replace(LayoutPart::Pointer oldChild, LayoutPart::Pointer newChild) override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutPart#computePreferredSize(boolean, int, int, int)
*/
public: int ComputePreferredSize(bool width, int availableParallel,
int availablePerpendicular, int preferredParallel) override;
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutPart#getSizeFlags(boolean)
*/
public: int GetSizeFlags(bool horizontal) override;
/**
* @see IPersistable
*/
public: bool RestoreState(IMemento::Pointer memento);
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutPart#setVisible(boolean)
*/
public: void SetVisible(bool makeVisible) override;
/**
* @see IPersistable
*/
public: bool SaveState(IMemento::Pointer memento);
protected: WorkbenchPage::Pointer GetPage();
/**
* Set the active appearence on the tab folder.
*
* @param active
*/
public: void SetActive(int activeState);
public: int GetActive() const;
public: void CreateControl(QWidget* parent, StackPresentation::Pointer presentation);
/**
* Sets the presentation bounds.
*/
public: void SetBounds(const QRect& r) override;
public: void SetSelection(LayoutPart::Pointer part);
/**
* Updates the enablement state of actions
*/
protected: virtual void UpdateActions(PresentablePart::Pointer current);
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutPart#handleDeferredEvents()
*/
protected: void HandleDeferredEvents() override;
private: void RefreshPresentationSelection();
public: int GetState();
/**
* Sets the minimized state for this stack. The part may call this method to
* minimize or restore itself. The minimized state only affects the view
* when unzoomed in the 3.0 presentation (in 3.3 it's handled by the
* ViewStack directly and works as expected).
*/
// public: void setMinimized(boolean minimized) {
// if (minimized != isMinimized) {
// isMinimized = minimized;
//
// refreshPresentationState();
// }
// }
/* (non-Javadoc)
* @see org.blueberry.ui.internal.ILayoutContainer#obscuredByZoom(org.blueberry.ui.internal.LayoutPart)
*/
// public: boolean childObscuredByZoom(LayoutPart toTest) {
// return isObscuredByZoom();
// }
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutPart#requestZoom(org.blueberry.ui.internal.LayoutPart)
*/
// public: void childRequestZoomIn(LayoutPart toZoom) {
// super.childRequestZoomIn(toZoom);
//
// requestZoomIn();
// }
/* (non-Javadoc)
* @see org.blueberry.ui.internal.LayoutPart#requestZoomOut()
*/
// public: void childRequestZoomOut() {
// super.childRequestZoomOut();
//
// requestZoomOut();
// }
/* (non-Javadoc)
* @see org.blueberry.ui.internal.ILayoutContainer#isZoomed(org.blueberry.ui.internal.LayoutPart)
*/
// public: boolean childIsZoomed(LayoutPart toTest) {
// return isZoomed();
// }
/**
* This is a hack that allows us to preserve the old
* min/max behavior for the stack containing the IntroPart.
* This is required to have the initial Intro (Welcome)
* pane to show correctly but will induce strange
* effects should a user re-locate the part to
* stacks other that its initial one...
*
* @return true if the stack contains the intro
* as a ViewPane (not if it's only a placeholder)
*/
// private: boolean isIntroInStack() {
// LayoutPart[] kids = getChildren();
// for (int i = 0; i < kids.length; i++) {
// if (kids[i] instanceof ViewPane) {
// ViewPane vp = (ViewPane) kids[i];
// if (vp.getID().equals(IIntroConstants.INTRO_VIEW_ID))
// return true;
// }
// }
// return false;
// }
// private: void smartZoom() {
// WorkbenchWindow wbw = (WorkbenchWindow) getPage().getWorkbenchWindow();
// if (wbw == null || wbw.getShell() == null)
// return;
//
// Perspective perspective = getPage().getActivePerspective();
// FastViewManager fvm = perspective.getFastViewManager();
//
// fvm.deferUpdates(true);
//
// // Cache the layout bounds
// perspective.getPresentation().updateBoundsMap();
//
// LayoutPart[] children = perspective.getPresentation().getLayout().getChildren();
// for (int i = 0; i < children.length; i++) {
// if (children[i] != this) {
// if (children[i] instanceof ViewStack) {
// ((ViewStack) children[i]).setMinimized(true);
// ViewStackTrimToolBar vstb = fvm
// .getViewStackTrimToolbar(children[i]
// .getID());
// vstb.setRestoreOnUnzoom(true);
// }
// else if (children[i] instanceof EditorSashContainer && !(this instanceof EditorStack)) {
// perspective.setEditorAreaState(IStackPresentationSite.STATE_MINIMIZED);
// perspective.setEditorAreaRestoreOnUnzoom(true);
// }
// }
// }
//
// // If the editor area has changed state tell the perspective
// if (this instanceof EditorStack)
// perspective.setEditorAreaState(IStackPresentationSite.STATE_MAXIMIZED);
//
// // Clear the boundsMap
// perspective.getPresentation().resetBoundsMap();
//
// // We're done batching...
// fvm.deferUpdates(false);
//
// perspective.getPresentation().setMaximizedStack(this);
// smartZoomed = true;
// }
// protected: void smartUnzoom() {
// // Prevent recursion through 'setMinimized'
// if (doingUnzoom)
// return;
// doingUnzoom = true;
//
// WorkbenchWindow wbw = (WorkbenchWindow) getPage().getWorkbenchWindow();
// if (wbw == null || wbw.getShell() == null)
// return;
//
// ITrimManager tbm = wbw.getTrimManager();
// Perspective perspective = getPage().getActivePerspective();
// FastViewManager fvm = perspective.getFastViewManager();
//
// ILayoutContainer root = getContainer();
//
// // We go up one more level when maximizing an editor stack
// // so that we 'zoom' the editor area
// boolean restoringEditorArea = false;
// if (root instanceof EditorSashContainer) {
// root = ((EditorSashContainer) root).getContainer();
// restoringEditorArea = true;
// }
//
// // This is a compound operation
// fvm.deferUpdates(true);
//
// LayoutPart[] children = root.getChildren();
// for (int i = 0; i < children.length; i++) {
// if (children[i] != this) {
// IWindowTrim trim = tbm.getTrim(children[i].getID());
// if (trim == null)
// continue;
//
// if (trim instanceof ViewStackTrimToolBar) {
// ViewStackTrimToolBar vstb = (ViewStackTrimToolBar) trim;
// if (vstb.restoreOnUnzoom()
// && children[i] instanceof ContainerPlaceholder) {
// // In the current presentation its a
// // container placeholder
// ViewStack realStack = (ViewStack) ((ContainerPlaceholder) children[i])
// .getRealContainer();
// realStack.setMinimized(false);
//
// vstb.setRestoreOnUnzoom(false);
// }
// } else if (trim instanceof EditorAreaTrimToolBar) {
// if (perspective.getEditorAreaRestoreOnUnzoom())
// perspective.setEditorAreaState(IStackPresentationSite.STATE_RESTORED);
// }
// }
// }
//
// // If the editor area has changed state tell the perspective
// if (restoringEditorArea)
// perspective.setEditorAreaState(IStackPresentationSite.STATE_RESTORED);
//
// perspective.getPresentation().setMaximizedStack(null);
//
// fvm.deferUpdates(false);
// smartZoomed = false;
//
// doingUnzoom = false;
// }
protected: void SetState(const int newState);
/**
* Called by the workbench page to notify this part that it has been zoomed or unzoomed.
* The PartStack should not call this method itself -- it must request zoom changes by
* talking to the WorkbenchPage.
*/
// public: void setZoomed(boolean isZoomed) {
//
// super.setZoomed(isZoomed);
//
// LayoutPart[] children = getChildren();
//
// for (int i = 0; i < children.length; i++) {
// LayoutPart next = children[i];
//
// next.setZoomed(isZoomed);
// }
//
// refreshPresentationState();
// }
// public: boolean isZoomed() {
// ILayoutContainer container = getContainer();
//
// if (container != null) {
// return container.childIsZoomed(this);
// }
//
// return false;
// }
// protected: void refreshPresentationState() {
// if (isZoomed() || smartZoomed) {
// presentationSite.setPresentationState(IStackPresentationSite.STATE_MAXIMIZED);
// } else {
//
// boolean wasMinimized = (presentationSite.getState() == IStackPresentationSite.STATE_MINIMIZED);
//
// if (isMinimized) {
// presentationSite.setPresentationState(IStackPresentationSite.STATE_MINIMIZED);
// } else {
// presentationSite.setPresentationState(IStackPresentationSite.STATE_RESTORED);
// }
//
// if (isMinimized != wasMinimized) {
// flushLayout();
//
// if (isMinimized) {
// WorkbenchPage page = getPage();
//
// if (page != null) {
// page.refreshActiveView();
// }
// }
// }
// }
// }
/**
* Makes the given part visible in the presentation.
* @param part the part to add to the stack
* @param cookie other information
*/
private: void ShowPart(LayoutPart::Pointer part, Object::Pointer cookie);
/**
* Update the container to show the correct visible tab based on the
* activation list.
*/
private: void UpdateContainerVisibleTab();
/**
*
*/
public: void ShowSystemMenu();
public: void ShowPaneMenu();
public: void ShowPartList();
public: QList<QWidget*> GetTabList(LayoutPart::Pointer part);
/**
*
* @param beingDragged
* @param initialLocation
* @param keyboard
*/
private: void DragStart(IPresentablePart::Pointer beingDragged, QPoint& initialLocation,
bool keyboard);
public: void PaneDragStart(PartPane::Pointer pane, QPoint& initialLocation,
bool keyboard);
/**
* @return Returns the savedPresentationState.
*/
public: IMemento::Pointer GetSavedPresentationState();
private: void FireInternalPropertyChange(int id);
// TrimStack Support
/**
* Explicitly sets the presentation state. This is used by the
* new min/max code to force the CTabFolder to show the proper
* state without going through the 'setState' code (which causes
* nasty side-effects.
* @param newState The state to set the presentation to
*/
// public: void setPresentationState(int newState) {
// presentationSite.setPresentationState(newState);
// }
//
// Support for passing perspective layout properties to the presentation
public: QString GetProperty(const QString& id);
public: void SetProperty(const QString& id, const QString& value);
/**
* Copies all appearance related data from this stack to the given stack.
*/
public: void CopyAppearanceProperties(PartStack::Pointer copyTo);
public: void ResizeChild(LayoutPart::Pointer childThatChanged) override;
};
}
#endif /*BERRYPARTSTACK_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryPersistentState.h b/Plugins/org.blueberry.ui.qt/src/internal/berryPersistentState.h
index f212d24a3a..030c8e1a4c 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryPersistentState.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryPersistentState.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYPERSISTENTSTATE_H
#define BERRYPERSISTENTSTATE_H
#include "berryState.h"
namespace berry {
struct IPreferences;
/**
* <p>
* This is a state that can be made persistent. A state is persisted to a
* preference store.
* </p>
* <p>
* Clients may extend this class.
* </p>
*
* @since 3.2
*/
class PersistentState : public State
{
public:
- berryObjectMacro(berry::PersistentState)
+ berryObjectMacro(berry::PersistentState);
PersistentState();
/**
* Loads this state from the preference store, given the location at which
* to look. This method must be symmetric with a call to
* {@link #save(IPreferenceStore, String)}.
*
* @param store
* The store from which to read; must not be <code>null</code>.
* @param preferenceKey
* The key at which the state is stored; must not be
* <code>null</code>.
*/
virtual void Load(const SmartPointer<IPreferences>& store,
const QString& preferenceKey) = 0;
/**
* Saves this state to the preference store, given the location at which to
* write. This method must be symmetric with a call to
* {@link #load(IPreferenceStore, String)}.
*
* @param store
* The store to which the state should be written; must not be
* <code>null</code>.
* @param preferenceKey
* The key at which the state should be stored; must not be
* <code>null</code>.
*/
virtual void Save(const SmartPointer<IPreferences>& store,
const QString& preferenceKey) = 0;
/**
* Sets whether this state should be persisted.
*
* @param persisted
* Whether this state should be persisted.
*/
virtual void SetShouldPersist(bool persisted);
/**
* Whether this state should be persisted. Subclasses should check this
* method before loading or saving.
*
* @return <code>true</code> if this state should be persisted;
* <code>false</code> otherwise.
*/
virtual bool ShouldPersist();
private:
/**
* Whether this state should be persisted.
*/
bool persisted;
};
}
#endif // BERRYPERSISTENTSTATE_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryPerspective.h b/Plugins/org.blueberry.ui.qt/src/internal/berryPerspective.h
index fb5895e705..f715546a5e 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryPerspective.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryPerspective.h
@@ -1,633 +1,633 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYPERSPECTIVE_H_
#define BERRYPERSPECTIVE_H_
#include <berryMacros.h>
#include "berryPerspectiveDescriptor.h"
#include "berryPartPlaceholder.h"
#include "berryViewLayoutRec.h"
#include "berryWorkbenchPage.h"
#include "berryLayoutPart.h"
#include "berryPageLayout.h"
#include "berryPartPane.h"
#include "berryIWorkbenchPartReference.h"
#include "berryIViewReference.h"
#include "berryIViewPart.h"
#include "berryIStatus.h"
namespace berry {
class ViewFactory;
class PerspectiveHelper;
/**
* \ingroup org_blueberry_ui_internal
*
*/
class Perspective : public Object {
public:
- berryObjectMacro(Perspective)
+ berryObjectMacro(Perspective);
friend class WorkbenchPage;
bool ContainsView(const QString& viewId) const;
private:
ViewFactory* viewFactory;
QHash<QString, ViewLayoutRec::Pointer> mapIDtoViewLayoutRec;
static const QString VERSION_STRING; // = "0.016";
/**
* Reference to the part that was previously active
* when this perspective was deactivated.
*/
IWorkbenchPartReference::Pointer oldPartRef;
protected:
PerspectiveDescriptor::Pointer descriptor;
WorkbenchPage* page;
// Editor Area management
LayoutPart::Pointer editorArea;
PartPlaceholder::Pointer editorHolder;
bool editorHidden;
int editorAreaState;
//ArrayList alwaysOnActionSets;
//ArrayList alwaysOffActionSets;
QList<QString> showViewShortcuts;
QList<QString> perspectiveShortcuts;
bool fixed;
QList<QString> showInPartIds;
//HashMap showInTimes;
IMemento::Pointer memento;
PerspectiveHelper* presentation;
bool shouldHideEditorsOnActivate;
PageLayout::Pointer layout;
/**
* ViewManager constructor comment.
*/
public: Perspective(PerspectiveDescriptor::Pointer desc, WorkbenchPage::Pointer page);
/**
* ViewManager constructor comment.
*/
protected: Perspective(WorkbenchPage::Pointer page);
protected: void Init(WorkbenchPage::Pointer page);
/**
* Moves a part forward in the Z order of a perspective so it is visible.
*
* @param part the part to bring to move forward
* @return true if the part was brought to top, false if not.
*/
public: bool BringToTop(IViewReference::Pointer ref);
/**
* Returns whether a view exists within the perspective.
*/
public: bool ContainsView(IViewPart::Pointer view);
/**
* Create the initial list of action sets.
*/
// protected: void CreateInitialActionSets(List outputList, List stringList) {
// ActionSetRegistry reg = WorkbenchPlugin.getDefault()
// .getActionSetRegistry();
// Iterator iter = stringList.iterator();
// while (iter.hasNext()) {
// String id = (String) iter.next();
// IActionSetDescriptor desc = reg.findActionSet(id);
// if (desc != null) {
// outputList.add(desc);
// } else {
// WorkbenchPlugin.log("Unable to find Action Set: " + id);//$NON-NLS-1$
// }
// }
// }
/**
* Create a presentation for a perspective.
*/
private: void CreatePresentation(PerspectiveDescriptor::Pointer persp);
/**
* Dispose the perspective and all views contained within.
*/
public: ~Perspective() override;
private: void DisposeViewRefs();
/**
* Finds the view with the given ID that is open in this page, or <code>null</code>
* if not found.
*
* @param viewId the view ID
*/
public: IViewReference::Pointer FindView(const QString& viewId);
/**
* Finds the view with the given id and secondary id that is open in this page,
* or <code>null</code> if not found.
*
* @param viewId the view ID
* @param secondaryId the secondary ID
*/
public: IViewReference::Pointer FindView(const QString& id, const QString& secondaryId);
/**
* Returns the window's client composite widget
* which views and editor area will be parented.
*/
public: QWidget* GetClientComposite();
/**
* Returns the perspective.
*/
public: IPerspectiveDescriptor::Pointer GetDesc();
/**
* Returns the pane for a view reference.
*/
protected: PartPane::Pointer GetPane(IViewReference::Pointer ref);
/**
* Returns the perspective shortcuts associated with this perspective.
*
* @return an array of perspective identifiers
*/
public: QList<QString> GetPerspectiveShortcuts();
/**
* Returns the presentation.
*/
public: PerspectiveHelper* GetPresentation() const;
/**
* Returns the show view shortcuts associated with this perspective.
*
* @return an array of view identifiers
*/
public: QList<QString> GetShowViewShortcuts();
/**
* Returns the view factory.
*/
public: ViewFactory* GetViewFactory();
/**
* See IWorkbenchPage.
*/
public: QList<IViewReference::Pointer> GetViewReferences();
/**
* Hide the editor area if visible
*/
protected: void HideEditorArea();
/**
* Hide the editor area if visible
*/
protected: void HideEditorAreaLocal();
public: bool HideView(IViewReference::Pointer ref);
/*
* Return whether the editor area is visible or not.
*/
protected: bool IsEditorAreaVisible();
/**
* Returns the view layout rec for the given view reference,
* or null if not found. If create is true, it creates the record
* if not already created.
*/
public: ViewLayoutRec::Pointer GetViewLayoutRec(IViewReference::Pointer ref, bool create);
/**
* Returns the view layout record for the given view id
* or null if not found. If create is true, it creates the record
* if not already created.
*/
private: ViewLayoutRec::Pointer GetViewLayoutRec(const QString& viewId, bool create);
/**
* Returns true if a layout or perspective is fixed.
*/
public: bool IsFixedLayout();
/**
* Returns true if a view is standalone.
*
* @since 3.0
*/
public: bool IsStandaloneView(IViewReference::Pointer ref);
/**
* Returns whether the title for a view should
* be shown. This applies only to standalone views.
*
* @since 3.0
*/
public: bool GetShowTitleView(IViewReference::Pointer ref);
/**
* Creates a new presentation from a persistence file.
* Note: This method should not modify the current state of the perspective.
*/
private: void LoadCustomPersp(PerspectiveDescriptor::Pointer persp);
private: void UnableToOpenPerspective(PerspectiveDescriptor::Pointer persp,
const QString& status);
/**
* Create a presentation for a perspective.
* Note: This method should not modify the current state of the perspective.
*/
protected: void LoadPredefinedPersp(PerspectiveDescriptor::Pointer persp);
// private: void RemoveAlwaysOn(IActionSetDescriptor::Pointer descriptor) {
// if (descriptor == null) {
// return;
// }
// if (!alwaysOnActionSets.contains(descriptor)) {
// return;
// }
//
// alwaysOnActionSets.remove(descriptor);
// if (page != null) {
// page.perspectiveActionSetChanged(this, descriptor, ActionSetManager.CHANGE_HIDE);
// }
// }
// protected: void AddAlwaysOff(IActionSetDescriptor descriptor) {
// if (descriptor == null) {
// return;
// }
// if (alwaysOffActionSets.contains(descriptor)) {
// return;
// }
// alwaysOffActionSets.add(descriptor);
// if (page != null) {
// page.perspectiveActionSetChanged(this, descriptor, ActionSetManager.CHANGE_MASK);
// }
// removeAlwaysOn(descriptor);
// }
// protected: void AddAlwaysOn(IActionSetDescriptor descriptor) {
// if (descriptor == null) {
// return;
// }
// if (alwaysOnActionSets.contains(descriptor)) {
// return;
// }
// alwaysOnActionSets.add(descriptor);
// if (page != null) {
// page.perspectiveActionSetChanged(this, descriptor, ActionSetManager.CHANGE_SHOW);
// }
// removeAlwaysOff(descriptor);
// }
// private: void RemoveAlwaysOff(IActionSetDescriptor descriptor) {
// if (descriptor == null) {
// return;
// }
// if (!alwaysOffActionSets.contains(descriptor)) {
// return;
// }
// alwaysOffActionSets.remove(descriptor);
// if (page != null) {
// page.perspectiveActionSetChanged(this, descriptor, ActionSetManager.CHANGE_UNMASK);
// }
// }
/**
* activate.
*/
protected: void OnActivate();
private:
/**
* An 'orphan' perspective is one that was originally created through a
* contribution but whose contributing bundle is no longer available. In
* order to allow it to behave correctly within the environment (for Close,
* Reset...) we turn it into a 'custom' perspective on its first activation.
*/
void FixOrphan();
/**
* deactivate.
*/
protected: void OnDeactivate();
/**
* Notifies that a part has been activated.
*/
public: void PartActivated(IWorkbenchPart::Pointer activePart);
/**
* The user successfully performed a Show In... action on the specified part.
* Update the history.
*/
public: void PerformedShowIn(const QString& partId);
/**
* Fills a presentation with layout data.
* Note: This method should not modify the current state of the perspective.
*/
public: bool RestoreState(IMemento::Pointer memento);
bool CreateReferences(const QList<IMemento::Pointer>& views);
/**
* Fills a presentation with layout data.
* Note: This method should not modify the current state of the perspective.
*/
public: bool RestoreState();
/**
* Returns the ActionSets read from perspectiveExtensions in the registry.
*/
// protected: ArrayList GetPerspectiveExtensionActionSets() {
// PerspectiveExtensionReader reader = new PerspectiveExtensionReader();
// reader
// .setIncludeOnlyTags(new String[] { IWorkbenchRegistryConstants.TAG_ACTION_SET });
// PageLayout layout = new PageLayout();
// reader.extendLayout(null, descriptor.getOriginalId(), layout);
// return layout.getActionSets();
// }
/**
* Returns the Show In... part ids read from the registry.
*/
protected: QList<QString> GetShowInIdsFromRegistry();
/**
* Save the layout.
*/
public: void SaveDesc();
/**
* Save the layout.
*/
public: void SaveDescAs(IPerspectiveDescriptor::Pointer desc);
/**
* Save the layout.
*/
public: bool SaveState(IMemento::Pointer memento);
/**
* Save the layout.
*/
private: bool SaveState(IMemento::Pointer memento, PerspectiveDescriptor::Pointer p,
bool saveInnerViewState);
// public: void turnOnActionSets(IActionSetDescriptor[] newArray) {
// for (int i = 0; i < newArray.length; i++) {
// IActionSetDescriptor descriptor = newArray[i];
//
// addAlwaysOn(descriptor);
// }
// }
// public: void turnOffActionSets(IActionSetDescriptor[] toDisable) {
// for (int i = 0; i < toDisable.length; i++) {
// IActionSetDescriptor descriptor = toDisable[i];
//
// turnOffActionSet(descriptor);
// }
// }
// public: void turnOffActionSet(IActionSetDescriptor toDisable) {
// addAlwaysOff(toDisable);
// }
/**
* Sets the perspective actions for this page.
* This is List of Strings.
*/
public: void SetPerspectiveActionIds(const QList<QString>& list);
/**
* Sets the ids of the parts to list in the Show In... prompter.
* This is a List of Strings.
*/
public: void SetShowInPartIds(const QList<QString>& list);
/**
* Sets the ids of the views to list in the Show View shortcuts.
* This is a List of Strings.
*/
public: void SetShowViewActionIds(const QList<QString>& list);
/**
* Show the editor area if not visible
*/
protected: void ShowEditorArea();
/**
* Show the editor area if not visible
*/
protected: void ShowEditorAreaLocal();
public: void SetEditorAreaState(int newState);
public: int GetEditorAreaState();
/**
*
*/
public: void RefreshEditorAreaVisibility();
/**
* Resolves a view's id into its reference, creating the
* view if necessary.
*
* @param viewId The primary id of the view (must not be
* <code>null</code>
* @param secondaryId The secondary id of a multiple-instance view
* (may be <code>null</code>).
*
* @return The reference to the specified view. This may be null if the
* view fails to create (i.e. thrown a PartInitException)
*/
public: IViewReference::Pointer GetViewReference(const QString& viewId, const QString& secondaryId);
/**
* Shows the view with the given id and secondary id.
*/
public: IViewPart::Pointer ShowView(const QString& viewId, const QString& secondaryId);
/**
* Returns the old part reference.
* Returns null if there was no previously active part.
*
* @return the old part reference or <code>null</code>
*/
public: IWorkbenchPartReference::Pointer GetOldPartRef();
/**
* Sets the old part reference.
*
* @param oldPartRef The old part reference to set, or <code>null</code>
*/
public: void SetOldPartRef(IWorkbenchPartReference::Pointer oldPartRef);
// //for dynamic UI
// protected: void AddActionSet(IActionSetDescriptor newDesc) {
// IContextService service = (IContextService)page.getWorkbenchWindow().getService(IContextService.class);
// try {
// service.activateContext(ContextAuthority.DEFER_EVENTS);
// for (int i = 0; i < alwaysOnActionSets.size(); i++) {
// IActionSetDescriptor desc = (IActionSetDescriptor) alwaysOnActionSets
// .get(i);
// if (desc.getId().equals(newDesc.getId())) {
// removeAlwaysOn(desc);
// removeAlwaysOff(desc);
// break;
// }
// }
// addAlwaysOn(newDesc);
// } finally {
// service.activateContext(ContextAuthority.SEND_EVENTS);
// }
// }
// // for dynamic UI
// /* package */void removeActionSet(String id) {
// IContextService service = (IContextService)page.getWorkbenchWindow().getService(IContextService.class);
// try {
// service.activateContext(ContextAuthority.DEFER_EVENTS);
// for (int i = 0; i < alwaysOnActionSets.size(); i++) {
// IActionSetDescriptor desc = (IActionSetDescriptor) alwaysOnActionSets
// .get(i);
// if (desc.getId().equals(id)) {
// removeAlwaysOn(desc);
// break;
// }
// }
//
// for (int i = 0; i < alwaysOffActionSets.size(); i++) {
// IActionSetDescriptor desc = (IActionSetDescriptor) alwaysOffActionSets
// .get(i);
// if (desc.getId().equals(id)) {
// removeAlwaysOff(desc);
// break;
// }
// }
// } finally {
// service.activateContext(ContextAuthority.SEND_EVENTS);
// }
// }
// void removeActionSet(IActionSetDescriptor toRemove) {
// removeAlwaysOn(toRemove);
// removeAlwaysOff(toRemove);
// }
/**
* Returns whether the given view is closeable in this perspective.
*
* @since 3.0
*/
public: bool IsCloseable(IViewReference::Pointer reference);
/**
* Returns whether the given view is moveable in this perspective.
*
* @since 3.0
*/
public: bool IsMoveable(IViewReference::Pointer reference);
/**
* Writes a description of the layout to the given string buffer.
* This is used for drag-drop test suites to determine if two layouts are the
* same. Like a hash code, the description should compare as equal iff the
* layouts are the same. However, it should be user-readable in order to
* help debug failed tests. Although these are english readable strings,
* they should not be translated or equality tests will fail.
* <p>
* This is only intended for use by test suites.
* </p>
*
* @param buf
*/
public: void DescribeLayout(QString& buf) const;
/**
* Sanity-checks the LayoutParts in this perspective. Throws an Assertation exception
* if an object's internal state is invalid.
*/
public: void TestInvariants();
// public: IActionSetDescriptor[] getAlwaysOnActionSets() {
// return (IActionSetDescriptor[]) alwaysOnActionSets.toArray(new IActionSetDescriptor[alwaysOnActionSets.size()]);
// }
// public: IActionSetDescriptor[] getAlwaysOffActionSets() {
// return (IActionSetDescriptor[]) alwaysOffActionSets.toArray(new IActionSetDescriptor[alwaysOffActionSets.size()]);
// }
/**
* Used to restrict the use of the new min/max behavior to envoronments
* in which it has a chance of working...
*
* @param activePerspective We pass this in as an arg so others won't have
* to check it for 'null' (which is one of the failure cases)
*
*/
public: static bool UseNewMinMax(Perspective::Pointer activePerspective);
};
}
#endif /*BERRYPERSPECTIVE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveDescriptor.h b/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveDescriptor.h
index 929ffa0885..c256ff5443 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveDescriptor.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveDescriptor.h
@@ -1,238 +1,238 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYPERSPECTIVEDESCRIPTOR_H_
#define BERRYPERSPECTIVEDESCRIPTOR_H_
#include <berryIConfigurationElement.h>
#include "berryIPerspectiveDescriptor.h"
#include "berryIPerspectiveFactory.h"
#include "berryIPluginContribution.h"
#include "berryIMemento.h"
#include <QStringList>
#include <QIcon>
namespace berry {
/**
* \ingroup org_blueberry_ui_internal
*
* PerspectiveDescriptor.
* <p>
* A PerspectiveDesciptor has 3 states:
* </p>
* <ol>
* <li>It <code>isPredefined()</code>, in which case it was defined from an
* extension point.</li>
* <li>It <code>isPredefined()</code> and <code>hasCustomFile</code>, in
* which case the user has customized a predefined perspective.</li>
* <li>It <code>hasCustomFile</code>, in which case the user created a new
* perspective.</li>
* </ol>
*
*/
class PerspectiveDescriptor : public IPerspectiveDescriptor, public IPluginContribution {
public:
- berryObjectMacro(PerspectiveDescriptor, IPerspectiveDescriptor, IPluginContribution)
+ berryObjectMacro(PerspectiveDescriptor, IPerspectiveDescriptor, IPluginContribution);
private:
QString id;
QString pluginId;
QString originalId;
QString label;
QString className;
QString description;
bool singleton;
bool fixed;
mutable QIcon imageDescriptor;
IConfigurationElement::Pointer configElement;
mutable QStringList categoryPath;
public:
/**
* Create a new empty descriptor.
*
* @param id
* the id of the new descriptor
* @param label
* the label of the new descriptor
* @param originalDescriptor
* the descriptor that this descriptor is based on
*/
PerspectiveDescriptor(const QString& id, const QString& label,
PerspectiveDescriptor::Pointer originalDescriptor);
/**
* Create a descriptor from a config element.
*
* @param id
* the id of the element to create
* @param configElement
* the element to base this perspective on
* @throws CoreException
* thrown if there are any missing attributes
*/
PerspectiveDescriptor(const QString& id, IConfigurationElement::Pointer configElement);
/**
* Creates a factory for a predefined perspective. If the perspective is not
* predefined return <code>null</code>.
*
* @return the IPerspectiveFactory or <code>null</code>
* @throws CoreException
* if the object could not be instantiated.
*/
IPerspectiveFactory::Pointer CreateFactory();
/**
* Deletes the custom definition for a perspective..
*/
void DeleteCustomDefinition();
/*
* @see IPerspectiveDescriptor#getDescription()
*/
QString GetDescription() const override;
void SetDescription(const QString& desc);
QStringList GetKeywordReferences() const override;
/**
* Returns whether or not this perspective is fixed.
*
* @return whether or not this perspective is fixed
*/
bool GetFixed() const;
/*
* @see IPerspectiveDescriptor#GetId()
*/
QString GetId() const override;
QString GetLocalId() const override;
QString GetPluginId() const override;
/*
* @see IPerspectiveDescriptor#GetImageDescriptor()
*/
QIcon GetImageDescriptor() const override;
/*
* @see IPerspectiveDescriptor#GetLabel()
*/
QString GetLabel() const override;
/**
* Return the original id of this descriptor.
*
* @return the original id of this descriptor
*/
QString GetOriginalId() const;
/**
* Returns <code>true</code> if this perspective has a custom definition.
*
* @return whether this perspective has a custom definition
*/
bool HasCustomDefinition() const;
/**
* Returns <code>true</code> if this perspective wants to be default.
*
* @return whether this perspective wants to be default
*/
bool HasDefaultFlag() const;
/**
* Returns <code>true</code> if this perspective is predefined by an
* extension.
*
* @return boolean whether this perspective is predefined by an extension
*/
bool IsPredefined() const;
/**
* Returns <code>true</code> if this perspective is a singleton.
*
* @return whether this perspective is a singleton
*/
bool IsSingleton() const;
/**
* Restore the state of a perspective from a memento.
*
* @param memento
* the memento to restore from
* @return the <code>IStatus</code> of the operation
* @see org.blueberry.ui.IPersistableElement
*/
bool RestoreState(IMemento::Pointer memento);
/**
* Revert to the predefined extension template. Does nothing if this
* descriptor is user defined.
*/
void RevertToPredefined();
/**
* Save the state of a perspective to a memento.
*
* @param memento
* the memento to restore from
* @return the <code>IStatus</code> of the operation
* @see org.blueberry.ui.IPersistableElement
*/
bool SaveState(IMemento::Pointer memento);
/**
* Return the configuration element used to create this perspective, if one
* was used.
*
* @return the configuration element used to create this perspective
*/
IConfigurationElement::Pointer GetConfigElement() const;
/**
* Returns the factory class name for this descriptor.
*
* @return the factory class name for this descriptor
*/
QString GetFactoryClassName() const;
/**
* Return the category path of this descriptor
*
* @return the category path of this descriptor
*/
QStringList GetCategoryPath() const override;
};
}
#endif /*BERRYPERSPECTIVEDESCRIPTOR_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryPresentablePart.h b/Plugins/org.blueberry.ui.qt/src/internal/berryPresentablePart.h
index 4ec04393fc..b7751caede 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryPresentablePart.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryPresentablePart.h
@@ -1,262 +1,262 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYPRESENTABLEPART_H_
#define BERRYPRESENTABLEPART_H_
#include "presentations/berryIPresentablePart.h"
#include "berryWorkbenchPartReference.h"
namespace berry
{
class PartPane;
/**
* This is a lightweight adapter that allows PartPanes to be used by a StackPresentation. All methods
* either redirect directly to PartPane or do trivial type conversions. All listeners registered by
* the presentation are kept here rather than registering them directly on the PartPane. This allows
* us to remove all listeners registered by a presentation that has been disposed, offering some
* protection against memory leaks.
*/
class PresentablePart: public IPresentablePart
{
public:
- berryObjectMacro(PresentablePart)
+ berryObjectMacro(PresentablePart);
private:
SmartPointer<PartPane> part;
/**
* Local listener list -- we use this rather than registering listeners directly on the part
* in order to protect against memory leaks in badly behaved presentations.
*/
//List listeners = new ArrayList();
// Lazily initialized. Use getPropertyListenerProxy() to access.
QScopedPointer<IPropertyChangeListener> lazyPropertyListenerProxy;
//ListenerList partPropertyChangeListeners = new ListenerList();
IPropertyChangeListener::Events partPropertyChangeEvents;
//IPropertyChangeListener::Pointer lazyPartPropertyChangeListener;
// Lazily initialized. Use getMenu() to access
//IPartMenu viewMenu;
// True iff the "set" methods on this object are talking to the real part (disabled
// if the part is currently being managed by another presentation stack)
bool enableInputs;
// True iff the "get" methods are returning up-to-date info from the real part (disabled
// for efficiency if the presentation is invisible)
bool enableOutputs;
QRect savedBounds;
bool isVisible;
// Saved state (only used when the part is inactive)
QString name;
QString titleStatus;
bool isDirty;
bool isBusy;
bool hasViewMenu;
struct PropertyListenerProxy: public IPropertyChangeListener
{
PropertyListenerProxy(PresentablePart* part);
using IPropertyChangeListener::PropertyChange;
void PropertyChange(const PropertyChangeEvent::Pointer& e) override;
private:
PresentablePart* part;
};
friend struct PropertyListenerProxy;
IPropertyChangeListener* GetPropertyListenerProxy();
WorkbenchPartReference::Pointer GetPartReference() const;
protected:
void FirePropertyChange(int propId);
void FirePropertyChange(const PropertyChangeEvent::Pointer& event);
public:
/**
* Constructor
*
* @param part
*/
PresentablePart(SmartPointer<PartPane> part, QWidget* parent);
SmartPointer<PartPane> GetPane() const;
/**
* Detach this PresentablePart from the real part. No further methods should
* be invoked on this object.
*/
~PresentablePart() override;
// void firePropertyChange(int propertyId) {
// for (int i = 0; i < listeners.size(); i++) {
// ((IPropertyListener) listeners.get(i)).propertyChanged(this, propertyId);
// }
// }
void AddPropertyListener(IPropertyChangeListener* listener) override;
void RemovePropertyListener(IPropertyChangeListener* listener) override;
// void addPartPropertyListener(IPropertyChangeListener listener) {
// partPropertyChangeListeners.add(listener);
// }
//
// void removePartPropertyListener(IPropertyChangeListener listener) {
// partPropertyChangeListeners.remove(listener);
// }
/* (non-Javadoc)
* @see org.blueberry.ui.presentations.IPresentablePart#setBounds(org.blueberry.swt.graphics.QRect)
*/
void SetBounds(const QRect& bounds) override;
/* (non-Javadoc)
* @see org.blueberry.ui.presentations.IPresentablePart#setVisible(boolean)
*/
void SetVisible(bool isVisible) override;
/* (non-Javadoc)
* @see org.blueberry.ui.presentations.IPresentablePart#setFocus()
*/
void SetFocus() override;
/* (non-Javadoc)
* @see org.blueberry.ui.presentations.IPresentablePart#getName()
*/
QString GetName() const override;
/* (non-Javadoc)
* @see org.blueberry.ui.presentations.IPresentablePart#getTitle()
*/
QString GetTitle() const override;
/* (non-Javadoc)
* @see org.blueberry.ui.presentations.IPresentablePart#getTitleStatus()
*/
QString GetTitleStatus() const override;
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.presentations.IPresentablePart#getTitleImage()
*/
QIcon GetTitleImage() override;
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.presentations.IPresentablePart#getTitleToolTip()
*/
QString GetTitleToolTip() const override;
/* (non-Javadoc)
* @see org.blueberry.ui.presentations.IPresentablePart#isDirty()
*/
bool IsDirty() const override;
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.presentations.IPresentablePart#isBusy()
*/
bool IsBusy() const override;
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.presentations.IPresentablePart#getToolBar()
*/
QToolBar* GetToolBar() override;
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.presentations.IPresentablePart#getMenu()
*/
// IPartMenu getMenu() {
// boolean hasMenu;
//
// if (enableOutputs) {
// hasMenu = part.hasViewMenu();
// } else {
// hasMenu = this.hasViewMenu;
// }
//
// if (!hasMenu) {
// return null;
// }
//
// if (viewMenu == null) {
// viewMenu = new IPartMenu() {
// public void showMenu(Point location) {
// part.showViewMenu(location);
// }
// };
// }
//
// return viewMenu;
// }
/* (non-Javadoc)
* @see org.blueberry.ui.presentations.IPresentablePart#isCloseable()
*/
bool IsCloseable() const override;
/* (non-Javadoc)
* @see org.blueberry.ui.presentations.IPresentablePart#getControl()
*/
QWidget* GetControl() override;
void EnableOutputs(bool isActive);
void EnableInputs(bool isActive);
/* (non-Javadoc)
* @see org.blueberry.ui.presentations.IPresentablePart#getPartProperty(java.lang.String)
*/
QString GetPartProperty(const QString& key) const override;
/* (non-Javadoc)
* @see org.blueberry.ui.ISizeProvider#computePreferredSize(boolean, int, int, int)
*/
int ComputePreferredSize(bool width, int availableParallel,
int availablePerpendicular, int preferredResult) override;
/* (non-Javadoc)
* @see org.blueberry.ui.ISizeProvider#getSizeFlags(boolean)
*/
int GetSizeFlags(bool width) override;
};
}
#endif /* BERRYPRESENTABLEPART_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryReopenEditorMenu.h b/Plugins/org.blueberry.ui.qt/src/internal/berryReopenEditorMenu.h
index 4f57d22635..b7cb2ae327 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryReopenEditorMenu.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryReopenEditorMenu.h
@@ -1,108 +1,108 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYREOPENEDITORMENU_H
#define BERRYREOPENEDITORMENU_H
#include <berryContributionItem.h>
namespace berry {
struct IMenuManager;
struct IWorkbenchWindow;
class EditorHistory;
class EditorHistoryItem;
/**
* A dynamic menu item which supports to switch to other Windows.
*/
class ReopenEditorMenu : public QObject, public ContributionItem
{
Q_OBJECT
public:
- berryObjectMacro(ReopenEditorMenu)
+ berryObjectMacro(ReopenEditorMenu);
/**
* Create a new instance.
* @param window the window on which the menu is to be created
* @param id menu's id
* @param showSeparator whether or not to show a separator
*/
ReopenEditorMenu(IWorkbenchWindow* window, const QString& id,
bool showSeparator);
/**
* Return a string suitable for a file MRU list. This should not be called
* outside the framework.
*
* @param index the index in the MRU list
* @param name the file name
* @param toolTip potentially the path
* @param rtl should it be right-to-left
* @return a string suitable for an MRU file menu
*/
static QString CalcText(int index, const QString& name, const QString& toolTip, bool rtl);
/**
* Fills the given menu with
* menu items for all windows.
*/
void Fill(QMenu* menu, QAction* before) override;
using ContributionItem::Fill;
/**
* Overridden to always return true and force dynamic menu building.
*/
bool IsDirty() const override;
/**
* Overridden to always return true and force dynamic menu building.
*/
bool IsDynamic() const override;
private:
/**
* Reopens the editor for the given history item.
*/
void Open(const SmartPointer<EditorHistoryItem>& item);
/**
* Returns the text for a history item. This may be truncated to fit
* within the MAX_TEXT_LENGTH.
*/
static QString CalcText(int index, const SmartPointer<EditorHistoryItem>& item);
IWorkbenchWindow* window;
EditorHistory* history;
bool showSeparator;
bool dirty;
Q_SLOT void MenuAboutToShow(IMenuManager* manager);
// the maximum length for a file name; must be >= 4
static const int MAX_TEXT_LENGTH = 40;
// only assign mnemonic to the first nine items
static const int MAX_MNEMONIC_SIZE = 9;
};
}
#endif // BERRYREOPENEDITORMENU_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berrySaveablesList.h b/Plugins/org.blueberry.ui.qt/src/internal/berrySaveablesList.h
index 4322719707..d1aa37cdd6 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berrySaveablesList.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berrySaveablesList.h
@@ -1,355 +1,355 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYSAVEABLESLIST_H_
#define BERRYSAVEABLESLIST_H_
#include "berryISaveablesLifecycleListener.h"
#include "berryISaveablesSource.h"
#include "berryIWorkbenchWindow.h"
#include "berryIWorkbenchPart.h"
#include "berryWorkbenchPart.h"
#include <map>
#include <set>
#include <list>
#include <vector>
namespace berry
{
/**
* The model manager maintains a list of open saveable models.
*
* @see Saveable
* @see ISaveablesSource
*/
class SaveablesList: public ISaveablesLifecycleListener
{
public:
- berryObjectMacro(SaveablesList)
+ berryObjectMacro(SaveablesList);
private:
ISaveablesLifecycleListener::Events events;
// event source (mostly ISaveablesSource) -> Set of Saveable
QHash<Object*, Saveable::Set> modelMap;
// reference counting map, Saveable -> Integer
QHash<Saveable::Pointer, int> modelRefCounts;
QSet<ISaveablesSource::Pointer> nonPartSources;
// returns true if this model has not yet been in getModels()
bool AddModel(Object::Pointer source, Saveable::Pointer model);
/**
* returns true if the given key was added for the first time
*
* @param referenceMap
* @param key
* @return true if the ref count of the given key is now 1
*/
bool IncrementRefCount(QHash<Saveable::Pointer, int>& referenceMap,
Saveable::Pointer key);
/**
* returns true if the given key has been removed
*
* @param referenceMap
* @param key
* @return true if the ref count of the given key was 1
*/
bool DecrementRefCount(QHash<Saveable::Pointer, int>& referenceMap,
Saveable::Pointer key);
// returns true if this model was removed from getModels();
bool RemoveModel(Object::Pointer source, Saveable::Pointer model);
void LogWarning(const QString& message, Object::Pointer source,
Saveable::Pointer model);
/**
* Updates the set of non-part saveables sources.
* @param source
*/
void UpdateNonPartSource(ISaveablesSource::Pointer source);
/**
* @param source
* @param modelArray
*/
void RemoveModels(Object::Pointer source,
const QList<Saveable::Pointer>& modelArray);
/**
* @param source
* @param modelArray
*/
void AddModels(Object::Pointer source,
const QList<Saveable::Pointer>& modelArray);
/**
* @param event
*/
void FireModelLifecycleEvent(SaveablesLifecycleEvent::Pointer event);
/**
* @param window
* @param modelsClosing
* @param canCancel
* @return true if the user canceled
*/
bool
PromptForSavingIfNecessary(IWorkbenchWindow::Pointer window,
const Saveable::Set& modelsClosing,
const QHash<Saveable::Pointer, int>& modelsDecrementing,
bool canCancel);
/**
* @param modelsClosing
* @param modelsDecrementing
*/
void FillModelsClosing(Saveable::Set& modelsClosing,
const QHash<Saveable::Pointer, int>& modelsDecrementing);
/**
* Returns the saveable models provided by the given part. If the part does
* not provide any models, a default model is returned representing the
* part.
*
* @param part
* the workbench part
* @return the saveable models
*/
QList<Saveable::Pointer> GetSaveables(IWorkbenchPart::Pointer part);
//TODO SaveablesList ListSelectionDialog
// class MyListSelectionDialog extends
// ListSelectionDialog {
// private final boolean canCancel;
// private Button checkbox;
// private boolean dontPromptSelection;
// private boolean stillOpenElsewhere;
//
// private MyListSelectionDialog(Shell shell, Object input,
// IStructuredContentProvider contentprovider,
// ILabelProvider labelProvider, String message, boolean canCancel, boolean stillOpenElsewhere) {
// super(shell, input, contentprovider, labelProvider, message);
// this.canCancel = canCancel;
// this.stillOpenElsewhere = stillOpenElsewhere;
// if (!canCancel) {
// int shellStyle = getShellStyle();
// shellStyle &= ~SWT.CLOSE;
// setShellStyle(shellStyle);
// }
// }
//
// /**
// * @return
// */
// public boolean getDontPromptSelection() {
// return dontPromptSelection;
// }
//
// protected void createButtonsForButtonBar(Composite parent) {
// createButton(parent, IDialogConstants.OK_ID,
// IDialogConstants.OK_LABEL, true);
// if (canCancel) {
// createButton(parent, IDialogConstants.CANCEL_ID,
// IDialogConstants.CANCEL_LABEL, false);
// }
// }
//
// protected Control createDialogArea(Composite parent) {
// Composite dialogAreaComposite = (Composite) super.createDialogArea(parent);
//
// if (stillOpenElsewhere) {
// Composite checkboxComposite = new Composite(dialogAreaComposite, SWT.NONE);
// checkboxComposite.setLayout(new GridLayout(2, false));
//
// checkbox = new Button(checkboxComposite, SWT.CHECK);
// checkbox.addSelectionListener(new SelectionAdapter() {
// public void widgetSelected(SelectionEvent e) {
// dontPromptSelection = checkbox.getSelection();
// }
// });
// GridData gd = new GridData();
// gd.horizontalAlignment = SWT.BEGINNING;
// checkbox.setLayoutData(gd);
//
// Label label = new Label(checkboxComposite, SWT.NONE);
// label.setText(WorkbenchMessages.EditorManager_closeWithoutPromptingOption);
// gd = new GridData();
// gd.grabExcessHorizontalSpace = true;
// gd.horizontalAlignment = SWT.BEGINNING;
// }
//
// return dialogAreaComposite;
// }
// }
public:
struct PostCloseInfo : public Object
{
berryObjectMacro(PostCloseInfo);
QList<SmartPointer<WorkbenchPart> > partsClosing;
QHash<Saveable::Pointer, int> modelsDecrementing;
Saveable::Set modelsClosing;
private:
PostCloseInfo() {}
friend class SaveablesList;
};
/**
* Returns the list of open models managed by this model manager.
*
* @return a list of models
*/
Saveable::Set GetOpenModels();
/**
* This implementation of handleModelLifecycleEvent must be called by
* implementers of ISaveablesSource whenever the list of models of the model
* source changes, or when the dirty state of models changes. The
* ISaveablesSource instance must be passed as the source of the event
* object.
* <p>
* This method may also be called by objects that hold on to models but are
* not workbench parts. In this case, the event source must be set to an
* object that is not an instanceof IWorkbenchPart.
* </p>
* <p>
* Corresponding open and close events must originate from the same
* (identical) event source.
* </p>
* <p>
* This method must be called on the UI thread.
* </p>
*/
void HandleLifecycleEvent(const SaveablesLifecycleEvent::Pointer& event) override;
/**
* Adds the given listener to the list of listeners. Has no effect if the
* same (identical) listener has already been added. The listener will be
* notified about changes to the models managed by this model manager. Event
* types include: <br>
* POST_OPEN when models were added to the list of models <br>
* POST_CLOSE when models were removed from the list of models <br>
* DIRTY_CHANGED when the dirty state of models changed
* <p>
* Listeners should ignore all other event types, including PRE_CLOSE. There
* is no guarantee that listeners are notified before models are closed.
*
* @param listener
*/
void AddModelLifecycleListener(ISaveablesLifecycleListener* listener);
/**
* Removes the given listener from the list of listeners. Has no effect if
* the given listener is not contained in the list.
*
* @param listener
*/
void RemoveModelLifecycleListener(ISaveablesLifecycleListener* listener);
/**
* @param partsToClose
* @param save
* @param window
* @return the post close info to be passed to postClose
*/
PostCloseInfo::Pointer PreCloseParts(
const QList<SmartPointer<IWorkbenchPart> >& partsToClose, bool save,
IWorkbenchWindow::Pointer window);
/**
* Prompt the user to save the given saveables.
* @param modelsToSave the saveables to be saved
* @param shellProvider the provider used to obtain a shell in prompting is
* required. Clients can use a workbench window for this.
* @param runnableContext a runnable context that will be used to provide a
* progress monitor while the save is taking place. Clients can
* use a workbench window for this.
* @param canCancel whether the operation can be canceled
* @param stillOpenElsewhere whether the models are referenced by open parts
* @return true if the user canceled
*/
bool PromptForSaving(const QList<Saveable::Pointer>& modelsToSave,
/*final IShellProvider shellProvider, IRunnableContext runnableContext,*/
bool canCancel, bool stillOpenElsewhere);
/**
* Save the given models.
* @param finalModels the list of models to be saved
* @param shellProvider the provider used to obtain a shell in prompting is
* required. Clients can use a workbench window for this.
* @param runnableContext a runnable context that will be used to provide a
* progress monitor while the save is taking place. Clients can
* use a workbench window for this.
* @return <code>true</code> if the operation was canceled
*/
bool SaveModels(const QList<Saveable::Pointer>& finalModels
/*final IShellProvider shellProvider, IRunnableContext runnableContext*/);
/**
* @param postCloseInfoObject
*/
void PostClose(PostCloseInfo::Pointer postCloseInfoObject);
/**
* @param actualPart
*/
void PostOpen(IWorkbenchPart::Pointer part);
/**
* @param actualPart
*/
void DirtyChanged(IWorkbenchPart::Pointer part);
/**
* For testing purposes. Not to be called by clients.
*
* @param model
* @return
*/
QList<Object::Pointer> TestGetSourcesForModel(Saveable::Pointer model);
/**
* @return a list of ISaveablesSource objects registered with this saveables
* list which are not workbench parts.
*/
QList<ISaveablesSource::Pointer> GetNonPartSources();
/**
* @param model
*/
QList<IWorkbenchPart::Pointer> GetPartsForSaveable(
Saveable::Pointer model);
};
}
#endif /* BERRYSAVEABLESLIST_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryShellPool.h b/Plugins/org.blueberry.ui.qt/src/internal/berryShellPool.h
index 9bb22b249f..3888473679 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryShellPool.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryShellPool.h
@@ -1,83 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYSHELLPOOL_H_
#define BERRYSHELLPOOL_H_
#include "berryShell.h"
#include <list>
namespace berry
{
/**
* Manages a pool of shells. This can be used instead of creating and destroying
* shells. By reusing shells, they will never be disposed until the pool goes away.
* This is useful in situations where client code may have cached pointers to the
* shells to use as a parent for dialogs. It also works around bug 86226 (SWT menus
* cannot be reparented).
*
* @since 3.1
*/
class ShellPool: public Object, public IShellListener
{
int flags;
/**
* Parent shell (or null if none)
*
* The parentShell is owned by the WorkbenchWindow, which also owns a ShellPool instance
*/
Shell::WeakPtr parentShell;
QList<Shell::Pointer> availableShells;
static const QString CLOSE_LISTENER; // = "close listener";
// DisposeListener disposeListener = new DisposeListener() {
// public void widgetDisposed(DisposeEvent e) {
// WorkbenchPlugin.log(new RuntimeException("Widget disposed too early!")); //$NON-NLS-1$
// }
// };
friend class WorkbenchWindow;
public:
- berryObjectMacro(ShellPool)
+ berryObjectMacro(ShellPool);
void ShellClosed(const ShellEvent::Pointer& e) override;
/**
* Creates a shell pool that allocates shells that are children of the
* given parent and are created with the given flags.
*
* @param parentShell parent shell (may be null, indicating that this pool creates
* top-level shells)
* @param childFlags flags for all child shells
*/
ShellPool(Shell::Pointer parentShell, int childFlags);
/**
* Returns a new shell. The shell must not be disposed directly, but it may be closed.
* Once the shell is closed, it will be returned to the shell pool. Note: callers must
* remove all listeners from the shell before closing it.
*/
Shell::Pointer AllocateShell(IShellListener* closeListener);
};
}
#endif /* BERRYSHELLPOOL_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berrySourceProviderService.h b/Plugins/org.blueberry.ui.qt/src/internal/berrySourceProviderService.h
index 5126af1cbd..2fe179942f 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berrySourceProviderService.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berrySourceProviderService.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYSOURCEPROVIDERSERVICE_H
#define BERRYSOURCEPROVIDERSERVICE_H
#include "berryISourceProviderService.h"
#include "berryIDisposable.h"
namespace berry {
struct IServiceLocator;
/**
* <p>
* A service holding all of the registered source providers.
* </p>
* <p>
* This class is not intended for use outside of the
* <code>org.eclipse.ui.workbench</code> plug-in.
* </p>
*/
class SourceProviderService : public ISourceProviderService, public IDisposable
{
private:
/**
* The source providers registered with this service. This value is never
* <code>null</code>. This is a map of the source name ({@link String})
* to the source provider ({@link ISourceProvider}).
*/
QHash<QString,SmartPointer<ISourceProvider> > sourceProvidersByName;
/**
* All of the source providers registered with this service. This value is
* never <code>null</code>.
*/
QSet<SmartPointer<ISourceProvider> > sourceProviders;
IServiceLocator* locator;
public:
- berryObjectMacro(berry::SourceProviderService)
+ berryObjectMacro(berry::SourceProviderService);
SourceProviderService(IServiceLocator* locator);
void Dispose() override;
SmartPointer<ISourceProvider> GetSourceProvider(const QString& sourceName) const override;
QList<SmartPointer<ISourceProvider> > GetSourceProviders() const override;
void RegisterProvider(const SmartPointer<ISourceProvider>& sourceProvider);
void UnregisterProvider(const SmartPointer<ISourceProvider>& sourceProvider);
void ReadRegistry();
};
}
#endif // BERRYSOURCEPROVIDERSERVICE_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryTestDropLocation.h b/Plugins/org.blueberry.ui.qt/src/internal/berryTestDropLocation.h
index 55a7f1252f..e258f31ea8 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryTestDropLocation.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryTestDropLocation.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYTESTDROPLOCATION_H_
#define BERRYTESTDROPLOCATION_H_
#include <berryObject.h>
#include "berryShell.h"
#include <vector>
namespace berry {
/**
* This is an interface intended for use in test suites. Objects can implement
* this interface to force any dragged object to be dropped at a particular
* location.
*
* @since 3.0
*/
struct TestDropLocation : public Object {
- berryObjectMacro(TestDropLocation)
+ berryObjectMacro(TestDropLocation);
/**
* Location where the object should be dropped, in display coordinates
*
* @return a location in display coordinates
*/
virtual QPoint GetLocation() = 0;
/**
* The drop code will pretend that only the given shells are open,
* and that they have the specified Z-order.
*
* @return the shells to check for drop targets, from bottom to top.
*/
virtual QList<Shell::Pointer> GetShells() = 0;
};
}
#endif /* BERRYTESTDROPLOCATION_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbench.h b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbench.h
index 6e06e3dd94..dc7d306d9c 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbench.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbench.h
@@ -1,649 +1,649 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYWORKBENCH_H_
#define BERRYWORKBENCH_H_
#include "berryIViewPart.h"
#include "berryIWorkbench.h"
#include "berryWorkbenchWindow.h"
#include "berryIWorkbenchPage.h"
#include "berryIWorkbenchPartReference.h"
#include "berryXMLMemento.h"
#include "berryPartPane.h"
#include "berryEditorAreaHelper.h"
#include "berryWindowManager.h"
#include "berryWorkbenchConfigurer.h"
#include "application/berryWorkbenchAdvisor.h"
#include "berryWorkbenchTestable.h"
#include "intro/berryIntroDescriptor.h"
#include "intro/berryWorkbenchIntroManager.h"
#include "berryILayoutContainer.h"
#include "berryServiceLocator.h"
#include <Poco/Exception.h>
#include <Poco/File.h>
namespace berry {
struct ICommandService;
struct IEvaluationService;
struct IMenuService;
struct IServiceLocatorCreator;
struct ISaveablesLifecycleListener;
struct ISourceProviderService;
struct IWorkbenchLocationService;
class CommandManager;
class EditorHistory;
class ViewRegistry;
class EditorRegistry;
class WorkbenchWindowConfigurer;
/**
* \ingroup org_blueberry_ui_qt
*
* The workbench class represents the top of the BlueBerry user interface. Its
* primary responsibility is the management of workbench windows, dialogs,
* wizards, and other workbench-related windows.
* <p>
* Note that any code that is run during the creation of a workbench instance
* should not required access to the display.
*/
class BERRY_UI_QT Workbench : public IWorkbench, private IWindowListener
{
public:
- berryObjectMacro(Workbench)
+ berryObjectMacro(Workbench);
friend class RestoreStateRunnable;
/**
* Creates the workbench and associates it with the the given display and
* workbench advisor, and runs the workbench UI. This entails processing and
* dispatching events until the workbench is closed or restarted.
* <p>
* This method is intended to be called by <code>PlatformUI</code>. Fails
* if the workbench UI has already been created.
* </p>
* <p>
* The display passed in must be the default display.
* </p>
*
* @param display
* the display to be used for all UI interactions with the
* workbench
* @param advisor
* the application-specific advisor that configures and
* specializes the workbench
* @return return code {@link PlatformUI#RETURN_OK RETURN_OK}for normal
* exit; {@link PlatformUI#RETURN_RESTART RETURN_RESTART}if the
* workbench was terminated with a call to
* {@link IWorkbench#restart IWorkbench.restart}; other values
* reserved for future use
*/
static int CreateAndRunWorkbench(Display* display, WorkbenchAdvisor* advisor);
/**
* Creates the <code>Display</code> to be used by the workbench.
*
* @return the display
*/
static Display* CreateDisplay();
/**
* Returns the one and only instance of the workbench, if there is one.
*
* @return the workbench, or <code>null</code> if the workbench has not
* been created, or has been created and already completed
*/
static Workbench* GetInstance();
~Workbench() override;
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.services.IServiceLocator#getService(java.lang.Object)
*/
Object* GetService(const QString& key) override;
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.services.IServiceLocator#hasService(java.lang.Object)
*/
bool HasService(const QString& key) const override;
/*
* Method declared on IWorkbench.
*/
bool Close() override;
/**
* Returns the testable object facade, for use by the test harness.
*
* @return the testable object facade
* @since 3.0
*/
static WorkbenchTestable::Pointer GetWorkbenchTestable();
/*
* Method declared on IWorkbench.
*/
void AddWorkbenchListener(IWorkbenchListener* listener) override;
/*
* Method declared on IWorkbench.
*/
void RemoveWorkbenchListener(IWorkbenchListener* listener) override;
/*
* Method declared on IWorkbench.
*/
IWorkbenchListener::Events& GetWorkbenchEvents() override;
/*
* Method declared on IWorkbench.
*/
void AddWindowListener(IWindowListener* l) override;
/*
* Method declared on IWorkbench.
*/
void RemoveWindowListener(IWindowListener* l) override;
/*
* Method declared on IWorkbench.
*/
IWindowListener::Events& GetWindowEvents() override;
IWorkbenchWindow::Pointer GetActiveWorkbenchWindow() const override;
IViewRegistry* GetViewRegistry() const override;
IEditorRegistry* GetEditorRegistry() const override;
EditorHistory* GetEditorHistory() const;
IPerspectiveRegistry* GetPerspectiveRegistry() const override;
std::size_t GetWorkbenchWindowCount() const override;
QList<IWorkbenchWindow::Pointer> GetWorkbenchWindows() const override;
IWorkbenchWindow::Pointer OpenWorkbenchWindow(const QString& perspectiveId,
IAdaptable* input) override;
IWorkbenchWindow::Pointer OpenWorkbenchWindow(IAdaptable* input) override;
IWorkbenchPage::Pointer ShowPerspective(const QString& perspectiveId,
IWorkbenchWindow::Pointer window) override;
IWorkbenchPage::Pointer ShowPerspective(const QString& perspectiveId,
IWorkbenchWindow::Pointer window, IAdaptable* input) override;
bool SaveAllEditors(bool confirm) override;
IIntroManager* GetIntroManager() const override;
/**
* @return the workbench intro manager
*/
WorkbenchIntroManager* GetWorkbenchIntroManager() const;
/**
* @return the intro extension for this workbench.
*/
IntroDescriptor::Pointer GetIntroDescriptor() const;
/**
* This method exists as a test hook. This method should <strong>NEVER</strong>
* be called by clients.
*
* @param descriptor
* The intro descriptor to use.
*/
void SetIntroDescriptor(IntroDescriptor::Pointer descriptor);
/**
* Returns <code>true</code> if the workbench is running,
* <code>false</code> if it has been terminated.
*
* @return <code>true</code> if the workbench is running,
* <code>false</code> if it has been terminated.
*/
bool IsRunning() const;
/**
* Returns true if the Workbench is in the process of starting.
*
* @return <code>true</code> if the Workbench is starting, but not yet
* running the event loop.
*/
bool IsStarting() const;
bool IsClosing() const override;
/**
* Returns the default perspective id, which may be <code>null</code>.
*
* @return the default perspective id, or <code>null</code>
*/
QString GetDefaultPerspectiveId() const;
/**
* Returns the default workbench window page input.
*
* @return the default window page input or <code>null</code> if none
*/
IAdaptable* GetDefaultPageInput() const;
/**
* Return the presentation ID specified by the preference or the default ID
* if undefined.
*
* @return the presentation ID
* @see IWorkbenchPreferenceConstants#PRESENTATION_FACTORY_ID
*/
QString GetPresentationId() const;
IElementFactory* GetElementFactory(const QString& factoryId) const override;
void UpdateTheme() override;
/**
* <p>
* Indicates the start of a large update within the workbench. This is used
* to disable CPU-intensive, change-sensitive services that were temporarily
* disabled in the midst of large changes. This method should always be
* called in tandem with <code>largeUpdateEnd</code>, and the event loop
* should not be allowed to spin before that method is called.
* </p>
* <p>
* Important: always use with <code>largeUpdateEnd</code>!
* </p>
*/
void LargeUpdateStart();
/**
* <p>
* Indicates the end of a large update within the workbench. This is used to
* re-enable services that were temporarily disabled in the midst of large
* changes. This method should always be called in tandem with
* <code>largeUpdateStart</code>, and the event loop should not be
* allowed to spin before this method is called.
* </p>
* <p>
* Important: always protect this call by using <code>finally</code>!
* </p>
*/
void LargeUpdateEnd();
IExtensionTracker* GetExtensionTracker() const override;
protected:
friend class PlatformUI;
friend class WorkbenchConfigurer;
friend class WorkbenchWindowConfigurer;
friend class WorkbenchWindow;
friend struct WorkbenchWindow::ShellEventFilter;
int RunUI();
void OpenFirstTimeWindow();
IWorkbenchWindow::Pointer RestoreWorkbenchWindow(IMemento::Pointer memento);
bool Init();
/*
* Restores the workbench UI from the workbench state file (workbench.xml).
*
* @return a status object indicating OK if a window was opened,
* RESTORE_CODE_RESET if no window was opened but one should be, and
* RESTORE_CODE_EXIT if the workbench should close immediately
*/
/* package */
bool RestoreState();
/**
* Closes the workbench, returning the given return code from the run
* method. If forced, the workbench is closed no matter what.
*
* @param returnCode
* {@link PlatformUI#RETURN_OK RETURN_OK}for normal exit;
* {@link PlatformUI#RETURN_RESTART RETURN_RESTART}if the
* workbench was terminated with a call to
* {@link IWorkbench#restart IWorkbench.restart};
* {@link PlatformUI#RETURN_EMERGENCY_CLOSE} for an emergency
* shutdown
* {@link PlatformUI#RETURN_UNSTARTABLE RETURN_UNSTARTABLE}if
* the workbench could not be started; other values reserved for
* future use
*
* @param force
* true to force the workbench close, and false for a "soft"
* close that can be canceled
* @return true if the close was successful, and false if the close was
* canceled
*/
/* package */
bool Close(int returnCode, bool force);
/**
* Returns the unique object that applications use to configure the
* workbench.
* <p>
* IMPORTANT This method is declared protected to prevent regular
* plug-ins from downcasting IWorkbench to Workbench and getting hold of the
* workbench configurer that would allow them to tamper with the workbench.
* The workbench configurer is available only to the application.
* </p>
*/
WorkbenchConfigurer::Pointer GetWorkbenchConfigurer();
/**
* Returns the workbench advisor that created this workbench.
* <p>
* IMPORTANT This method is declared protected to prevent regular
* plug-ins from downcasting IWorkbench to Workbench and getting hold of the
* workbench advisor that would allow them to tamper with the workbench. The
* workbench advisor is internal to the application.
* </p>
*/
WorkbenchAdvisor* GetAdvisor() const;
/*
* Returns the workbench window which was last known being the active one,
* or <code> null </code> .
*/
SmartPointer<WorkbenchWindow> GetActivatedWindow() const;
/*
* Sets the workbench window which was last known being the active one, or
* <code> null </code> .
*/
void SetActivatedWindow(SmartPointer<WorkbenchWindow> window);
/**
* Fire workbench preShutdown event, stopping at the first one to veto
*
* @param forced
* flag indicating whether the shutdown is being forced
* @return <code>true</code> to allow the workbench to proceed with
* shutdown, <code>false</code> to veto a non-forced shutdown
* @since 3.2
*/
bool FirePreShutdown(bool forced);
/**
* Fire workbench postShutdown event.
*
* @since 3.2
*/
void FirePostShutdown();
/**
* Fire window opened event.
*
* @param window
* The window which just opened; should not be <code>null</code>.
*/
void FireWindowOpened(IWorkbenchWindow::Pointer window);
/**
* Fire window closed event.
*
* @param window
* The window which just closed; should not be <code>null</code>.
*/
void FireWindowClosed(IWorkbenchWindow::Pointer window);
/**
* Fire window activated event.
*
* @param window
* The window which was just activated; should not be
* <code>null</code>.
*/
void FireWindowActivated(IWorkbenchWindow::Pointer window);
/**
* Fire window deactivated event.
*
* @param window
* The window which was just deactivated; should not be
* <code>null</code>.
*/
void FireWindowDeactivated(IWorkbenchWindow::Pointer window);
private:
/**
* Holds onto the only instance of Workbench.
*/
static Workbench* instance;
/**
* The testable object facade.
*/
static WorkbenchTestable::Pointer testableObject;
static const unsigned int VERSION_STRING_COUNT; // = 1;
static const QString VERSION_STRING[1];
static const QString DEFAULT_WORKBENCH_STATE_FILENAME; // = "workbench.xml";
IWorkbenchListener::Events workbenchEvents;
IWindowListener::Events windowEvents;
WorkbenchAdvisor* advisor;
WorkbenchConfigurer::Pointer workbenchConfigurer;
/**
* The service locator maintained by the workbench. These services are
* initialized during workbench during the <code>init</code> method.
*/
ServiceLocator::Pointer serviceLocator;
QScopedPointer<IEvaluationService, QScopedPointerObjectDeleter> evaluationService;
QScopedPointer<ISaveablesLifecycleListener, QScopedPointerObjectDeleter> saveablesList;
/**
* The single instance of the command manager used by the workbench. This is
* initialized in <code>Workbench.init(Display)</code> and then never
* changed. This value will only be <code>null</code> if the
* initialization call has not yet completed.
*/
QScopedPointer<CommandManager> commandManager;
QScopedPointer<ICommandService, QScopedPointerObjectDeleter> commandService;
QScopedPointer<IMenuService, QScopedPointerObjectDeleter> menuService;
mutable QScopedPointer<IExtensionTracker> tracker;
/**
* A count of how many plug-ins were loaded while restoring the workbench
* state. Initially -1 for unknown number.
*/
int progressCount;
/**
* A field to hold the workbench windows that have been restored. In the
* event that not all windows have been restored, this field allows the
* openWindowsAfterRestore method to open some windows.
*/
QList<WorkbenchWindow::Pointer> createdWindows;
struct ServiceLocatorOwner : public IDisposable
{
ServiceLocatorOwner(Workbench* workbench);
void Dispose() override;
private:
Workbench* workbench;
};
friend struct ServiceLocatorOwner;
IDisposable::Pointer serviceLocatorOwner;
QScopedPointer<IServiceLocatorCreator, QScopedPointerObjectDeleter> serviceLocatorCreator;
QScopedPointer<IWorkbenchLocationService, QScopedPointerObjectDeleter> workbenchLocationService;
QScopedPointer<ISourceProviderService, QScopedPointerObjectDeleter> sourceProviderService;
/**
* A count of how many large updates are going on. This tracks nesting of
* requests to disable services during a large update -- similar to the
* <code>setRedraw</code> functionality on <code>Control</code>. When
* this value becomes greater than zero, services are disabled. When this
* value becomes zero, services are enabled. Please see
* <code>largeUpdateStart()</code> and <code>largeUpdateEnd()</code>.
*/
int largeUpdates;
/**
* The display used for all UI interactions with this workbench.
*/
Display* display;
WindowManager windowManager;
SmartPointer<WorkbenchWindow> activatedWindow;
mutable QScopedPointer<EditorHistory> editorHistory;
mutable QScopedPointer<WorkbenchIntroManager> introManager;
/**
* The descriptor for the intro extension that is valid for this workspace,
* <code>null</code> if none.
*/
IntroDescriptor::Pointer introDescriptor;
bool isStarting;
bool isClosing;
int returnCode;
mutable QString factoryID;
WorkbenchWindow* activeWorkbenchWindow;
/**
* Creates a new workbench.
*
* @param display
* the display to be used for all UI interactions with the
* workbench
* @param advisor
* the application-specific advisor that configures and
* specializes this workbench instance
*/
Workbench(Display*, WorkbenchAdvisor* advisor);
/**
* see IWorkbench#GetDisplay
*/
Display* GetDisplay() const override;
/*
* Creates a new workbench window.
*
* @return the new workbench window
*/
SmartPointer<WorkbenchWindow> NewWorkbenchWindow();
void OpenWindowsAfterRestore();
/*
* Returns the number for a new window. This will be the first number > 0
* which is not used to identify another window in the workbench.
*/
int GetNewWindowNumber();
/**
* Initializes all of the default services for the workbench. For
* initializing the command-based services, this also parses the registry
* and hooks up all the required listeners.
*/
void InitializeDefaultServices();
/**
* Closes the workbench. Assumes that the busy cursor is active.
*
* @param force
* true if the close is mandatory, and false if the close is
* allowed to fail
* @return true if the close succeeded, and false otherwise
*/
bool BusyClose(bool force);
/*
* Record the workbench UI in a document
*/
XMLMemento::Pointer RecordWorkbenchState();
/*
* Restores the state of the previously saved workbench
*/
bool RestoreState(IMemento::Pointer memento);
void DoRestoreState(IMemento::Pointer memento, bool& result);
/*
* Saves the current state of the workbench so it can be restored later on
*/
bool SaveState(IMemento::Pointer memento);
/*
* Save the workbench UI in a persistence file.
*/
bool SaveMementoToFile(XMLMemento::Pointer memento);
/*
* Answer the workbench state file.
*/
QString GetWorkbenchStateFile() const;
/*
* Shuts down the application.
*/
void Shutdown();
/**
* Opens a new workbench window and page with a specific perspective.
*
* Assumes that busy cursor is active.
*/
IWorkbenchWindow::Pointer BusyOpenWorkbenchWindow(const QString& perspID,
IAdaptable* input);
void InitializeSourcePriorities();
void StartSourceProviders();
void UpdateActiveWorkbenchWindowMenuManager(bool textOnly);
void WindowActivated(const IWorkbenchWindow::Pointer& /*window*/) override;
void WindowDeactivated(const IWorkbenchWindow::Pointer& /*window*/) override;
void WindowClosed(const IWorkbenchWindow::Pointer& /*window*/) override;
void WindowOpened(const IWorkbenchWindow::Pointer& /*window*/) override;
};
} // namespace berry
#endif /*BERRYWORKBENCH_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchConfigurer.h b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchConfigurer.h
index 64dd57cdfc..5196f1a10c 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchConfigurer.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchConfigurer.h
@@ -1,161 +1,161 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYWORKBENCHCONFIGURER_H_
#define BERRYWORKBENCHCONFIGURER_H_
#include "application/berryIWorkbenchConfigurer.h"
#include <Poco/HashMap.h>
namespace berry
{
/**
* Internal class providing special access for configuring the workbench.
* <p>
* Note that these objects are only available to the main application
* (the plug-in that creates and owns the workbench).
* </p>
* <p>
* This class is not intended to be instantiated or subclassed by clients.
* </p>
*/
class WorkbenchConfigurer : public IWorkbenchConfigurer
{
public:
- berryObjectMacro(WorkbenchConfigurer)
+ berryObjectMacro(WorkbenchConfigurer);
private:
/**
* Table to hold arbitrary key-data settings.
* @see #SetData
*/
QHash<QString, Object::Pointer> extraData;
/**
* Indicates whether workbench state should be saved on close and
* restored on subsequent open.
*/
bool saveAndRestore;
/**
* Indicates whether the workbench is being forced to close. During
* an emergency close, no interaction with the user should be done.
*/
bool isEmergencyClosing;
/**
* Indicates the behaviour when the last window is closed.
* If <code>true</code>, the workbench will exit (saving the last window's state,
* if configured to do so).
* If <code>false</code> the window will be closed, leaving the workbench running.
*
* @since 3.1
*/
bool exitOnLastWindowClose;
public:
/**
* Creates a new workbench configurer.
* <p>
* This method is declared package-private. Clients are passed an instance
* only via {@link WorkbenchAdvisor#initialize WorkbenchAdvisor.initialize}
* </p>
*/
WorkbenchConfigurer();
/* (non-javadoc)
* @see org.blueberry.ui.application.IWorkbenchConfigurer#getWorkbench
*/
IWorkbench* GetWorkbench() override;
/* (non-javadoc)
* @see org.blueberry.ui.application.IWorkbenchConfigurer#declareImage
*/
// void declareImage(String symbolicName, ImageDescriptor descriptor,
// boolean shared) {
// if (symbolicName == null || descriptor == null) {
// throw new IllegalArgumentException();
// }
// WorkbenchImages.declareImage(symbolicName, descriptor, shared);
// }
/* (non-javadoc)
* @see org.blueberry.ui.application.IWorkbenchConfigurer#getWindowConfigurer
*/
IWorkbenchWindowConfigurer::Pointer GetWindowConfigurer(IWorkbenchWindow::Pointer window) override;
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchConfigurer#getSaveAndRestore()
*/
bool GetSaveAndRestore() override;
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchConfigurer#setSaveAndRestore(boolean)
*/
void SetSaveAndRestore(bool enabled) override;
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchConfigurer#getData
*/
Object::Pointer GetData(const QString& key) const override;
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchConfigurer#setData(String, Object)
*/
void SetData(const QString& key, Object::Pointer data) override;
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchConfigurer#emergencyClose()
*/
void EmergencyClose() override;
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchConfigurer#emergencyClosing()
*/
bool EmergencyClosing() override;
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchConfigurer#restoreState()
*/
bool RestoreState() override;
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchConfigurer#openFirstTimeWindow()
*/
void OpenFirstTimeWindow() override;
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchConfigurer#restoreWorkbenchWindow(org.blueberry.ui.IMemento)
*/
IWorkbenchWindowConfigurer::Pointer RestoreWorkbenchWindow(IMemento::Pointer memento) override;
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchConfigurer#getExitOnLastWindowClose()
*/
bool GetExitOnLastWindowClose() override;
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchConfigurer#setExitOnLastWindowClose(boolean)
*/
void SetExitOnLastWindowClose(bool enabled) override;
};
}
#endif /*BERRYWORKBENCHCONFIGURER_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchMenuService.h b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchMenuService.h
index 12885e2061..ce694cc472 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchMenuService.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchMenuService.h
@@ -1,323 +1,323 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYWORKBENCHMENUSERVICE_H
#define BERRYWORKBENCHMENUSERVICE_H
#include "berryInternalMenuService.h"
#include "berryIPropertyChangeListener.h"
#include <QString>
#include <QSet>
namespace berry {
struct IEvaluationService;
struct IEvaluationReference;
struct IContributionManager;
struct IConfigurationElement;
struct IRegistryChangeEvent;
class AbstractMenuAdditionCacheEntry;
class ContributionRoot;
class ToolBarManager;
/**
* <p>
* Provides services related to contributing menu elements to the workbench.
* </p>
* <p>
* This class is only intended for internal use.
* </p>
*/
class WorkbenchMenuService : public InternalMenuService, private IPropertyChangeListener
{
private:
friend class ContributionItemUpdater;
class ManagerPopulationRecord
{
public:
WorkbenchMenuService* wms;
IServiceLocator* serviceLocatorToUse;
QSet<SmartPointer<IEvaluationReference> > restriction;
QString uri;
bool recurse;
QHash<SmartPointer<AbstractContributionFactory>, SmartPointer<ContributionRoot> > factoryToItems;
ManagerPopulationRecord();
ManagerPopulationRecord(WorkbenchMenuService* wms, IServiceLocator* serviceLocatorToUse,
const QSet<SmartPointer<IEvaluationReference> >& restriction, const QString& uri, bool recurse);
void AddFactoryContribution(const SmartPointer<AbstractContributionFactory>& factory,
const SmartPointer<ContributionRoot>& ciList);
void RemoveFactoryContribution(const SmartPointer<AbstractContributionFactory>& factory);
SmartPointer<ContributionRoot> GetContributions(const SmartPointer<AbstractContributionFactory>& factory) const;
/**
* Delegates back to the workbench to remove -all- the contributions
* associated with this contribution manager
*/
void ReleaseContributions();
};
static const QString INDEX_AFTER_ADDITIONS_QK; // = "after";
static const QString INDEX_AFTER_ADDITIONS_QV; // = "additions";
static const QString PROP_VISIBLE; // = "visible";
typedef QList<SmartPointer<AbstractContributionFactory> > FactoryListType;
QHash<QUrl,FactoryListType> uriToFactories;
QHash<SmartPointer<IContributionItem>,SmartPointer<IEvaluationReference> > evaluationsByItem;
//QHash activityListenersByItem;
QSet<IContributionManager*> managersAwaitingUpdates;
QHash<IContributionManager*,ManagerPopulationRecord> populatedManagers;
//SmartPointer<IRegistryChangeListener> registryChangeListener;
/**
* The class providing persistence for this service.
*/
//MenuPersistence menuPersistence;
/**
* The central authority for determining which menus are visible within this
* window.
*/
IEvaluationService* evaluationService;
/**
* The service locator into which this service will be inserted.
*/
IServiceLocator* serviceLocator;
//SmartPointer<IActivityManagerListener> activityManagerListener;
public:
- berryObjectMacro(berry::WorkbenchMenuService)
+ berryObjectMacro(berry::WorkbenchMenuService);
/**
* Constructs a new instance of <code>MenuService</code> using a menu
* manager.
*/
WorkbenchMenuService(IServiceLocator* serviceLocator);
~WorkbenchMenuService() override;
void Dispose() override;
void AddSourceProvider(const SmartPointer<ISourceProvider>& provider) override;
void ReadRegistry();
void RemoveSourceProvider(const SmartPointer<ISourceProvider>& provider) override;
void UpdateManagers();
FactoryListType GetAdditionsForURI(const QUrl& uri) override;
/*
* @see IMenuService#AddContributionFactory(AbstractContributionFactory)
*/
void AddContributionFactory(const SmartPointer<AbstractContributionFactory>& factory) override;
/*
* @see IMenuService#RemoveContributionFactory(AbstractContributionFactory*)
*/
void RemoveContributionFactory(const SmartPointer<AbstractContributionFactory> &factory) override;
/*
* @see org.eclipse.ui.internal.menus.IMenuService#populateMenu(org.eclipse.jface.action.ContributionManager,
* org.eclipse.ui.internal.menus.MenuLocationURI)
*/
void PopulateContributionManager(ContributionManager* mgr, const QString& uri) override;
void PopulateContributionManager(IServiceLocator* serviceLocatorToUse,
const QSet<SmartPointer<IEvaluationReference> >& restriction,
ContributionManager* mgr,
const QString& uri, bool recurse) override;
void AddContributionsToManager(IServiceLocator* serviceLocatorToUse,
const QSet<SmartPointer<IEvaluationReference> >& restriction,
ContributionManager *mgr,
const QString& uri, bool recurse,
const QList<SmartPointer<AbstractContributionFactory> >& factories);
/*
* @see IMenuService#GetCurrentState()
*/
SmartPointer<IEvaluationContext> GetCurrentState() const override;
/*
* @see IMenuService#RegisterVisibleWhen(IContributionItem, Expression)
*/
void RegisterVisibleWhen(const SmartPointer<IContributionItem>& item,
const SmartPointer<Expression>& visibleWhen,
QSet<SmartPointer<IEvaluationReference> >& restriction,
const QString& identifierID) override;
/*
* @see IMenuService#UnregisterVisibleWhen(IContributionItem)
*/
void UnregisterVisibleWhen(const SmartPointer<IContributionItem>& item,
QSet<SmartPointer<IEvaluationReference> >& restriction) override;
/*
* @see IMenuService#ReleaseMenu(ContributionManager)
*/
void ReleaseContributions(ContributionManager* mgr) override;
/**
* Process additions to the menus that occur through ExtensionRegistry changes
* @param menuAdditions The list of new menu addition extensions to process
*/
//void HandleDynamicAdditions(const QList<SmartPointer<IConfigurationElement> >& menuAdditions);
/**
* Process additions to the menus that occur through ExtensionRegistry changes
* @param menuRemovals The list of menu addition extensions to remove
*/
//void HandleDynamicRemovals(const QList<SmartPointer<IConfigurationElement> >& menuRemovals);
/**
* @param event
*/
//void HandleRegistryChanges(const SmartPointer<IRegistryChangeEvent>& event);
/**
* @return Returns the menuPersistence.
*/
//MenuPersistence* GetMenuPersistence();
/*
* @see InternalMenuService#PopulateContributionManager(ContributionManager, QString, bool)
*/
void PopulateContributionManager(ContributionManager* mgr,
const QString& uri, bool recurse) override;
protected:
/**
* Removes all cached info for the given manager/factory tuple. This
* includes unregistering expressions...
*
* @param manager The contribution manager owning the contributions
* @param factory The factory responsible for the contributions
*/
void RemoveContributionsForFactory(IContributionManager* manager,
const SmartPointer<AbstractContributionFactory> &factory);
/**
* @param manager
*/
void ReleaseContributions(ContributionRoot* items);
private:
//SmartPointer<IActivityManagerListener> GetActivityManagerListener();
using IPropertyChangeListener::PropertyChange;
void PropertyChange(const PropertyChangeEvent::Pointer& event) override;
IPropertyChangeListener* GetServiceListener();
//void UpdateTrim(ToolBarManager* mgr);
bool UpdateToolBar(ToolBarManager* mgr);
/**
* Construct an 'id' string from the given URI. The resulting 'id' is the
* part of the URI not containing the query:
* <p>
* i.e. [menu | popup | toolbar]:id
* </p>
*
* @param uri
* The URI to construct the id from
* @return The id
*/
QString GetIdFromURI(const QUrl& uri);
/**
* Return a list of managers that have already been populated and
* whose URI matches the given one
* @param factoryId The factoryId to check for
* @return The list of interested managers
*/
QList<IContributionManager *> GetManagersFor(const QString& factoryId);
bool ProcessAdditions(IServiceLocator* serviceLocatorToUse,
const QSet<SmartPointer<IEvaluationReference> >& restriction,
ContributionManager *mgr,
const SmartPointer<AbstractContributionFactory>& cache,
QSet<QString> &itemsAdded);
/**
* Determines whether the factory should be processed for this manager.
*
* @param factory
* The factory to be added
* @param mgr
* The contribution manager
* @return <code>true</code> if the factory to be processed,
* <code>false</code> otherwise
*/
bool ProcessFactory(ContributionManager *mgr,
const SmartPointer<AbstractContributionFactory>& factory);
/**
* @param items
*/
void ReleaseCache(ContributionRoot* items);
int GetInsertionIndex(ContributionManager *mgr, const QString& location);
/**
* @param item
*/
void ReleaseItem(const SmartPointer<IContributionItem>& item, QSet<SmartPointer<IEvaluationReference> >& restriction);
/**
* Return whether or not this contribution is programmatic (ie: has a class attribute).
*
* @param menuAddition
* @return whether or not this contribution is programamtic
*/
bool IsProgramaticContribution(const SmartPointer<IConfigurationElement>& menuAddition) const;
/**
* @param ceToRemove
* @return
*/
SmartPointer<AbstractMenuAdditionCacheEntry> FindFactory(const SmartPointer<IConfigurationElement>& ceToRemove);
//void HandleMenuChanges(const SmartPointer<IRegistryChangeEvent>& event);
};
}
#endif // BERRYWORKBENCHMENUSERVICE_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchPage.h b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchPage.h
index 31464d9020..f2abe33ad0 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchPage.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchPage.h
@@ -1,1429 +1,1429 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYWORKBENCHPAGE_H_
#define BERRYWORKBENCHPAGE_H_
#include <berryIAdaptable.h>
#include "berryIWorkbenchPage.h"
#include "berryIWorkbenchPartReference.h"
#include "berryIReusableEditor.h"
#include "berryILayoutContainer.h"
#include "berryIStickyViewManager.h"
#include "berryWorkbenchPagePartList.h"
#include "berryWorkbenchPartReference.h"
#include "berryPageSelectionService.h"
#include "berryEditorManager.h"
#include "berryViewFactory.h"
#include "berryPartPane.h"
#include <list>
namespace berry
{
struct IExtensionPoint;
struct IExtensionTracker;
//class PartPane;
//class PartPane::Sashes;
class EditorAreaHelper;
class WorkbenchWindow;
class Perspective;
class PerspectiveHelper;
class PerspectiveDescriptor;
class LayoutPartSash;
class LayoutTree;
class LayoutTreeNode;
class PartService;
/**
* \ingroup org_blueberry_ui_internal
*
* A collection of views and editors in a workbench.
*/
class BERRY_UI_QT WorkbenchPage: public IWorkbenchPage
{
public:
- berryObjectMacro(WorkbenchPage)
+ berryObjectMacro(WorkbenchPage);
protected:
//TODO Weakpointer
WorkbenchWindow* window;
friend class ViewFactory;
friend class WorkbenchWindow;
friend class EditorAreaHelper;
friend class WWinPartService;
private:
/**
* Manages editor contributions and action set part associations.
*/
class ActionSwitcher
{
public:
ActionSwitcher(WorkbenchPage* page);
/**
* Updates the contributions given the new part as the active part.
*
* @param newPart
* the new active part, may be <code>null</code>
*/
void UpdateActivePart(IWorkbenchPart::Pointer newPart);
/**
* Updates the contributions given the new part as the topEditor.
*
* @param newEditor
* the new top editor, may be <code>null</code>
*/
void UpdateTopEditor(IEditorPart::Pointer newEditor);
private:
/**
* Activates the contributions of the given part. If <code>enable</code>
* is <code>true</code> the contributions are visible and enabled,
* otherwise they are disabled.
*
* @param part
* the part whose contributions are to be activated
* @param enable
* <code>true</code> the contributions are to be enabled,
* not just visible.
*/
void ActivateContributions(IWorkbenchPart::Pointer part, bool enable);
/**
* Deactivates the contributions of the given part. If <code>remove</code>
* is <code>true</code> the contributions are removed, otherwise they
* are disabled.
*
* @param part
* the part whose contributions are to be deactivated
* @param remove
* <code>true</code> the contributions are to be removed,
* not just disabled.
*/
void DeactivateContributions(IWorkbenchPart::Pointer part, bool remove);
WorkbenchPage* page;
IWorkbenchPart::WeakPtr activePart;
IEditorPart::WeakPtr topEditor;
};
class ActivationList
{
public:
//List of parts in the activation order (oldest first)
typedef std::deque<IWorkbenchPartReference::Pointer> PartListType;
typedef std::deque<IWorkbenchPartReference::Pointer>::iterator PartListIter;
typedef std::deque<IWorkbenchPartReference::Pointer>::reverse_iterator PartListReverseIter;
private:
PartListType parts;
WorkbenchPage* page;
public:
ActivationList(WorkbenchPage* page);
/*
* Add/Move the active part to end of the list;
*/
void SetActive(SmartPointer<IWorkbenchPart> part);
/*
* Ensures that the given part appears AFTER any other part in the same
* container.
*/
void BringToTop(SmartPointer<IWorkbenchPartReference> ref);
/*
* Returns the last (most recent) iterator (index) of the given container in the activation list, or returns
* end() if the given container does not appear in the activation list.
*/
PartListIter LastIndexOfContainer(SmartPointer<ILayoutContainer> container);
/*
* Add/Move the active part to end of the list;
*/
void SetActive(SmartPointer<IWorkbenchPartReference> ref);
/*
* Add the active part to the beginning of the list.
*/
void Add(SmartPointer<IWorkbenchPartReference> ref);
/*
* Return the active part. Filter fast views.
*/
SmartPointer<IWorkbenchPart> GetActive();
/*
* Return the previously active part. Filter fast views.
*/
SmartPointer<IWorkbenchPart> GetPreviouslyActive();
SmartPointer<IWorkbenchPartReference> GetActiveReference(bool editorsOnly);
/*
* Retuns the index of the part within the activation list. The higher
* the index, the more recently it was used.
*/
PartListIter IndexOf(SmartPointer<IWorkbenchPart> part);
/*
* Returns the index of the part reference within the activation list.
* The higher the index, the more recent it was used.
*/
PartListIter IndexOf(SmartPointer<IWorkbenchPartReference> ref);
/*
* Remove a part from the list
*/
bool Remove(SmartPointer<IWorkbenchPartReference> ref);
/*
* Returns the topmost editor on the stack, or null if none.
*/
SmartPointer<IEditorPart> GetTopEditor();
/*
* Returns the editors in activation order (oldest first).
*/
QList<SmartPointer<IEditorReference> > GetEditors();
/*
* Return a list with all parts (editors and views).
*/
QList<SmartPointer<IWorkbenchPartReference> > GetParts();
private:
SmartPointer<IWorkbenchPart> GetActive(PartListIter start);
SmartPointer<IWorkbenchPartReference> GetActiveReference(PartListIter start, bool editorsOnly);
/*
* Find a part in the list starting from the end and filter
* and views from other perspectives. Will filter fast views
* unless 'includeActiveFastViews' is true;
*/
SmartPointer<IWorkbenchPartReference> GetActiveReference(PartListIter start, bool editorsOnly, bool skipPartsObscuredByZoom);
};
/**
* Helper class to keep track of all opened perspective. Both the opened
* and used order is kept.
*/
struct PerspectiveList
{
public:
typedef QList<SmartPointer<Perspective> > PerspectiveListType;
typedef PerspectiveListType::iterator iterator;
private:
/**
* List of perspectives in the order they were opened;
*/
PerspectiveListType openedList;
/**
* List of perspectives in the order they were used. Last element is
* the most recently used, and first element is the least recently
* used.
*/
PerspectiveListType usedList;
/**
* The perspective explicitly set as being the active one
*/
SmartPointer<Perspective> active;
void UpdateActionSets(SmartPointer<Perspective> oldPersp,
SmartPointer<Perspective> newPersp);
public:
/**
* Creates an empty instance of the perspective list
*/
PerspectiveList();
/**
* Update the order of the perspectives in the opened list
*
* @param perspective
* @param newLoc
*/
void Reorder(IPerspectiveDescriptor::Pointer perspective, int newLoc);
/**
* Return all perspectives in the order they were activated.
*
* @return an array of perspectives sorted by activation order, least
* recently activated perspective last.
*/
PerspectiveListType GetSortedPerspectives();
/**
* Adds a perspective to the list. No check is done for a duplicate when
* adding.
* @param perspective the perspective to add
* @return boolean <code>true</code> if the perspective was added
*/
bool Add(SmartPointer<Perspective> perspective);
/**
* Returns an iterator on the perspective list in the order they were
* opened.
*/
PerspectiveListType::iterator Begin();
PerspectiveListType::iterator End();
/**
* Returns an array with all opened perspectives
*/
PerspectiveListType GetOpenedPerspectives();
/**
* Removes a perspective from the list.
*/
bool Remove(SmartPointer<Perspective> perspective);
/**
* Swap the opened order of old perspective with the new perspective.
*/
void Swap(SmartPointer<Perspective> oldPerspective,
SmartPointer<Perspective> newPerspective);
/**
* Returns whether the list contains any perspectives
*/
bool IsEmpty();
/**
* Returns the most recently used perspective in the list.
*/
SmartPointer<Perspective> GetActive();
/**
* Returns the next most recently used perspective in the list.
*/
SmartPointer<Perspective> GetNextActive();
/**
* Returns the number of perspectives opened
*/
PerspectiveListType::size_type Size();
/**
* Marks the specified perspective as the most recently used one in the
* list.
*/
void SetActive(SmartPointer<Perspective> perspective);
};
IAdaptable* input;
QWidget* composite;
//Could be delete. This information is in the active part list;
ActivationList* activationList;
EditorManager* editorMgr;
EditorAreaHelper* editorPresentation;
//ListenerList propertyChangeListeners = new ListenerList();
PageSelectionService* selectionService;
QScopedPointer<WorkbenchPagePartList> partList; // = new WorkbenchPagePartList(selectionService);
//IActionBars actionBars;
ViewFactory* viewFactory;
PerspectiveList perspList;
SmartPointer<PerspectiveDescriptor> deferredActivePersp;
//NavigationHistory navigationHistory = new NavigationHistory(this);
IStickyViewManager::Pointer stickyViewMan;
/**
* Returns true if perspective with given id contains view with given id
*/
bool HasView(const QString& perspectiveId, const QString& viewId);
/**
* If we're in the process of activating a part, this points to the new part.
* Otherwise, this is null.
*/
IWorkbenchPartReference::Pointer partBeingActivated;
/**
* Contains a list of perspectives that may be dirty due to plugin
* installation and removal.
*/
std::set<QString> dirtyPerspectives;
ActionSwitcher actionSwitcher;
mutable QScopedPointer<IExtensionTracker> tracker;
// Deferral count... delays disposing parts and sending certain events if nonzero
int deferCount;
// Parts waiting to be disposed
QList<WorkbenchPartReference::Pointer> pendingDisposals;
SmartPointer<IExtensionPoint> GetPerspectiveExtensionPoint();
public:
/**
* Constructs a new page with a given perspective and input.
*
* @param w
* the parent window
* @param layoutID
* must not be <code>null</code>
* @param input
* the page input
* @throws WorkbenchException
* on null layout id
*/
WorkbenchPage(WorkbenchWindow* w, const QString& layoutID,
IAdaptable* input);
/**
* Constructs a page. <code>restoreState(IMemento)</code> should be
* called to restore this page from data stored in a persistance file.
*
* @param w
* the parent window
* @param input
* the page input
* @throws WorkbenchException
*/
WorkbenchPage(WorkbenchWindow* w, IAdaptable* input);
~WorkbenchPage() override;
/**
* Activates a part. The part will be brought to the front and given focus.
*
* @param part
* the part to activate
*/
void Activate(IWorkbenchPart::Pointer part) override;
/**
* Adds an IPartListener to the part service.
*/
void AddPartListener(IPartListener* l) override;
/*
* (non-Javadoc) Method declared on ISelectionListener.
*/
void AddSelectionListener(ISelectionListener* listener) override;
/*
* (non-Javadoc) Method declared on ISelectionListener.
*/
void AddSelectionListener(const QString& partId,
ISelectionListener* listener) override;
/*
* (non-Javadoc) Method declared on ISelectionListener.
*/
void AddPostSelectionListener(ISelectionListener* listener) override;
/*
* (non-Javadoc) Method declared on ISelectionListener.
*/
void AddPostSelectionListener(const QString& partId,
ISelectionListener* listener) override;
/**
* Moves a part forward in the Z order of a perspective so it is visible.
* If the part is in the same stack as the active part, the new part is
* activated.
*
* @param part
* the part to bring to move forward
*/
void BringToTop(IWorkbenchPart::Pointer part) override;
private:
/**
* Activates a part. The part is given focus, the pane is hilighted.
*/
void ActivatePart(const IWorkbenchPart::Pointer part);
ILayoutContainer::Pointer GetContainer(IWorkbenchPart::Pointer part);
ILayoutContainer::Pointer GetContainer(IWorkbenchPartReference::Pointer part);
SmartPointer<PartPane> GetPane(IWorkbenchPart::Pointer part);
SmartPointer<PartPane> GetPane(IWorkbenchPartReference::Pointer part);
/**
* Brings a part to the front of its stack. Does not update the active part or
* active editor. This should only be called if the caller knows that the part
* is not in the same stack as the active part or active editor, or if the caller
* is prepared to update activation after the call.
*
* @param part
*/
bool InternalBringToTop(IWorkbenchPartReference::Pointer part);
/**
* Resets the layout for the perspective. The active part in the old layout
* is activated in the new layout for consistent user context.
*
* Assumes the busy cursor is active.
*/
void BusyResetPerspective();
/**
* Implements <code>setPerspective</code>.
*
* Assumes that busy cursor is active.
*
* @param desc
* identifies the new perspective.
*/
void BusySetPerspective(IPerspectiveDescriptor::Pointer desc);
/*
* Performs showing of the view in the given mode.
*/
void BusyShowView(IViewPart::Pointer part, int mode);
/**
* Returns whether a part exists in the current page.
*/
bool CertifyPart(IWorkbenchPart::Pointer part);
protected:
/**
* Shows a view.
*
* Assumes that a busy cursor is active.
*/
IViewPart::Pointer BusyShowView(const QString& viewID,
const QString& secondaryID, int mode);
public:
void UpdateActionBars();
/**
* Removes the perspective which match the given description.
*
* @param desc
* identifies the perspective to be removed.
*/
void RemovePerspective(IPerspectiveDescriptor::Pointer desc);
/**
* Closes the perspective.
*/
bool Close() override;
/**
* See IWorkbenchPage
*/
bool CloseAllSavedEditors();
/**
* See IWorkbenchPage
*/
bool CloseAllEditors(bool save) override;
/**
* See IWorkbenchPage
*/
bool CloseEditors(const QList<IEditorReference::Pointer>& refArray,
bool save) override;
private:
void UpdateActivePart();
/**
* Makes the given part active. Brings it in front if necessary. Permits null
* (indicating that no part should be active).
*
* @param ref new active part (or null)
*/
void MakeActive(IWorkbenchPartReference::Pointer ref);
/**
* Makes the given editor active. Brings it to front if necessary. Permits <code>null</code>
* (indicating that no editor is active).
*
* @param ref the editor to make active, or <code>null</code> for no active editor
*/
void MakeActiveEditor(IEditorReference::Pointer ref);
/**
* Enables or disables listener notifications. This is used to delay listener notifications until the
* end of a public method.
*
* @param shouldDefer
*/
void DeferUpdates(bool shouldDefer);
void StartDeferring();
void HandleDeferredEvents();
bool IsDeferred();
public:
/**
* See IWorkbenchPage#closeEditor
*/
bool CloseEditor(IEditorReference::Pointer editorRef, bool save);
/**
* See IWorkbenchPage#closeEditor
*/
bool CloseEditor(IEditorPart::Pointer editor, bool save) override;
/**
* Closes current perspective. If last perspective, then entire page
* is closed.
*
* @param saveParts
* whether the page's parts should be saved if closed
* @param closePage
* whether the page itself should be closed if last perspective
*/
void CloseCurrentPerspective(bool saveParts, bool closePage);
/**
* @see IWorkbenchPage#closePerspective(IPerspectiveDescriptor, boolean, boolean)
*/
void ClosePerspective(IPerspectiveDescriptor::Pointer desc, bool saveParts,
bool closePage) override;
/**
* @see IWorkbenchPage#closeAllPerspectives(boolean, boolean)
*/
void CloseAllPerspectives(bool saveEditors, bool closePage) override;
protected:
/**
* Closes the specified perspective. If last perspective, then entire page
* is closed.
*
* @param persp
* the perspective to be closed
* @param saveParts
* whether the parts that are being closed should be saved
* (editors if last perspective, views if not shown in other
* parspectives)
*/
void ClosePerspective(SmartPointer<Perspective> persp, bool saveParts,
bool closePage);
/**
* This is called by child objects after a part has been added to the page.
* The page will in turn notify its listeners.
*/
void PartAdded(WorkbenchPartReference::Pointer ref);
/**
* This is called by child objects after a part has been added to the page.
* The part will be queued for disposal after all listeners have been notified
*/
void PartRemoved(WorkbenchPartReference::Pointer ref);
private:
/**
* Creates the client composite.
*/
void CreateClientComposite();
/**
* Creates a new view set. Return null on failure.
*
* @param desc the perspective descriptor
* @param notify whether to fire a perspective opened event
*/
SmartPointer<Perspective> CreatePerspective(SmartPointer<PerspectiveDescriptor> desc,
bool notify);
void DisposePart(WorkbenchPartReference::Pointer ref);
/**
* Deactivates a part. The pane is unhilighted.
*/
void DeactivatePart(IWorkbenchPart::Pointer part);
/**
* Dispose a perspective.
*
* @param persp the perspective descriptor
* @param notify whether to fire a perspective closed event
*/
void DisposePerspective(SmartPointer<Perspective> persp, bool notify);
public:
/**
* Detaches a view from the WorkbenchWindow.
*/
void DetachView(IViewReference::Pointer ref);
/**
* Removes a detachedwindow.
*/
void AttachView(IViewReference::Pointer ref);
/**
* Returns the first view manager with given ID.
*/
SmartPointer<Perspective> FindPerspective(IPerspectiveDescriptor::Pointer desc);
/**
* See IWorkbenchPage@findView.
*/
IViewPart::Pointer FindView(const QString& id) override;
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.IWorkbenchPage
*/
IViewReference::Pointer FindViewReference(const QString& viewId) override;
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.IWorkbenchPage
*/
IViewReference::Pointer FindViewReference(const QString& viewId,
const QString& secondaryId) override;
/**
* Notify property change listeners about a property change.
*
* @param changeId
* the change id
* @param oldValue
* old property value
* @param newValue
* new property value
*/
//private: void FirePropertyChange(String changeId, Object oldValue,
// Object newValue) {
//
// UIListenerLogging.logPagePropertyChanged(this, changeId, oldValue, newValue);
//
// Object[] listeners = propertyChangeListeners.getListeners();
// PropertyChangeEvent event = new PropertyChangeEvent(this, changeId,
// oldValue, newValue);
//
// for (int i = 0; i < listeners.length; i++) {
// ((IPropertyChangeListener) listeners[i]).propertyChange(event);
// }
// }
/**
* @see IWorkbenchPage
*/
IEditorPart::Pointer GetActiveEditor() override;
/**
* Returns the reference for the active editor, or <code>null</code>
* if there is no active editor.
*
* @return the active editor reference or <code>null</code>
*/
IEditorReference::Pointer GetActiveEditorReference();
/*
* (non-Javadoc) Method declared on IPartService
*/
IWorkbenchPart::Pointer GetActivePart() override;
/*
* (non-Javadoc) Method declared on IPartService
*/
IWorkbenchPartReference::Pointer GetActivePartReference() override;
/**
* Returns the active perspective for the page, <code>null</code> if
* none.
*/
SmartPointer<Perspective> GetActivePerspective();
/**
* Returns the client composite.
*/
QWidget* GetClientComposite();
// for dynamic UI - change access from private to protected
// for testing purposes only, changed from protected to public
/**
* Answer the editor manager for this window.
*/
EditorManager* GetEditorManager();
/**
* Answer the perspective presentation.
*/
PerspectiveHelper* GetPerspectivePresentation();
/**
* Answer the editor presentation.
*/
EditorAreaHelper* GetEditorPresentation();
/**
* Allow access to the part service for this page ... used internally to
* propogate certain types of events to the page part listeners.
* @return the part service for this page.
*/
PartService* GetPartService();
/**
* See IWorkbenchPage.
*/
QList<IEditorPart::Pointer> GetEditors() override;
QList<IEditorPart::Pointer> GetDirtyEditors() override;
QList<ISaveablePart::Pointer> GetDirtyParts();
/**
* See IWorkbenchPage.
*/
IEditorPart::Pointer FindEditor(IEditorInput::Pointer input) override;
/**
* See IWorkbenchPage.
*/
QList<IEditorReference::Pointer> FindEditors(
IEditorInput::Pointer input, const QString& editorId, int matchFlags) override;
/**
* See IWorkbenchPage.
*/
QList<IEditorReference::Pointer> GetEditorReferences() override;
/**
* @see IWorkbenchPage
*/
IAdaptable* GetInput() override;
/**
* Returns the page label. This is a combination of the page input and
* active perspective.
*/
QString GetLabel() override;
/**
* Returns the perspective.
*/
IPerspectiveDescriptor::Pointer GetPerspective() override;
/*
* (non-Javadoc) Method declared on ISelectionService
*/
ISelection::ConstPointer GetSelection() const override;
/*
* (non-Javadoc) Method declared on ISelectionService
*/
ISelection::ConstPointer GetSelection(const QString& partId) override;
//public:
// SelectionEvents& GetSelectionEvents(const QString& partId = "");
/*
* Returns the view factory.
*/
ViewFactory* GetViewFactory();
/**
* See IWorkbenchPage.
*/
QList<IViewReference::Pointer> GetViewReferences() override;
/**
* See IWorkbenchPage.
*/
QList<IViewPart::Pointer> GetViews() override;
protected:
/**
* Returns all view parts in the specified perspective
*
* @param persp the perspective
* @return an array of view parts
*/
/*package*/
QList<IViewPart::Pointer> GetViews(SmartPointer<Perspective> persp,
bool restore);
/* package */
void RefreshActiveView();
public:
/**
* See IWorkbenchPage.
*/
IWorkbenchWindow::Pointer GetWorkbenchWindow() const override;
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.IWorkbenchPage#hideView(org.blueberry.ui.IViewReference)
*/
void HideView(IViewReference::Pointer ref) override;
/**
* See IPerspective
*/
void HideView(IViewPart::Pointer view) override;
private:
/**
* Initialize the page.
*
* @param w
* the parent window
* @param layoutID
* may be <code>null</code> if restoring from file
* @param input
* the page input
* @param openExtras
* whether to process the perspective extras preference
*/
void Init(WorkbenchWindow* w, const QString& layoutID,
IAdaptable* input, bool openExtras);
/**
* Opens the perspectives specified in the PERSPECTIVE_BAR_EXTRAS preference (see bug 84226).
*/
public:
void OpenPerspectiveExtras();
/**
* See IWorkbenchPage.
*/
bool IsPartVisible(IWorkbenchPart::Pointer part) override;
/**
* See IWorkbenchPage.
*/
bool IsEditorAreaVisible();
/**
* Returns whether the view is fast.
*/
bool IsFastView(IViewReference::Pointer ref);
/**
* Return whether the view is closeable or not.
*
* @param ref the view reference to check. Must not be <code>null</code>.
* @return true if the part is closeable.
*/
bool IsCloseable(IViewReference::Pointer ref);
/**
* Return whether the view is moveable or not.
*
* @param ref the view reference to check. Must not be <code>null</code>.
* @return true if the part is moveable.
*/
bool IsMoveable(IViewReference::Pointer ref);
/**
* Returns whether the layout of the active
* perspective is fixed.
*/
bool IsFixedLayout();
protected:
/**
* Return true if the perspective has a dirty editor.
*/
bool IsSaveNeeded();
/**
* This method is called when the page is activated.
*/
void OnActivate();
/**
* This method is called when the page is deactivated.
*/
void OnDeactivate();
public:
/**
* See IWorkbenchPage.
*/
void ReuseEditor(IReusableEditor::Pointer editor, IEditorInput::Pointer input) override;
/**
* See IWorkbenchPage.
*/
IEditorPart::Pointer OpenEditor(IEditorInput::Pointer input,
const QString& editorID) override;
/**
* See IWorkbenchPage.
*/
IEditorPart::Pointer OpenEditor(IEditorInput::Pointer input,
const QString& editorID, bool activate) override;
/**
* See IWorkbenchPage.
*/
IEditorPart::Pointer OpenEditor(IEditorInput::Pointer input,
const QString& editorID, bool activate, int matchFlags) override;
/**
* This is not public API but for use internally. editorState can be <code>null</code>.
*/
IEditorPart::Pointer OpenEditor(IEditorInput::Pointer input,
const QString& editorID, bool activate, int matchFlags,
IMemento::Pointer editorState);
/*
* Added to fix Bug 178235 [EditorMgmt] DBCS 3.3 - Cannot open file with external program.
* Opens a new editor using the given input and descriptor. (Normally, editors are opened using
* an editor ID and an input.)
*/
IEditorPart::Pointer OpenEditorFromDescriptor(IEditorInput::Pointer input,
IEditorDescriptor::Pointer editorDescriptor, bool activate,
IMemento::Pointer editorState);
private:
/**
* @see #openEditor(IEditorInput, String, boolean, int)
*/
IEditorPart::Pointer BusyOpenEditor(IEditorInput::Pointer input,
const QString& editorID, bool activate, int matchFlags,
IMemento::Pointer editorState);
/*
* Added to fix Bug 178235 [EditorMgmt] DBCS 3.3 - Cannot open file with external program.
* See openEditorFromDescriptor().
*/
IEditorPart::Pointer BusyOpenEditorFromDescriptor(
IEditorInput::Pointer input,
EditorDescriptor::Pointer editorDescriptor, bool activate,
IMemento::Pointer editorState);
/*
* Added to fix Bug 178235 [EditorMgmt] DBCS 3.3 - Cannot open file with external program.
* See openEditorFromDescriptor().
*/
IEditorPart::Pointer BusyOpenEditorFromDescriptorBatched(
IEditorInput::Pointer input, EditorDescriptor::Pointer editorDescriptor,
bool activate, IMemento::Pointer editorState);
public:
void OpenEmptyTab();
/**
* See IWorkbenchPage.
*/
bool IsEditorPinned(IEditorPart::Pointer editor) override;
/**
* Removes an IPartListener from the part service.
*/
void RemovePartListener(IPartListener* l) override;
/*
* (non-Javadoc) Method declared on ISelectionListener.
*/
void RemoveSelectionListener(ISelectionListener* listener) override;
/*
* (non-Javadoc) Method declared on ISelectionListener.
*/
void RemoveSelectionListener(const QString& partId,
ISelectionListener* listener) override;
/*
* (non-Javadoc) Method declared on ISelectionListener.
*/
void RemovePostSelectionListener(ISelectionListener* listener) override;
/*
* (non-Javadoc) Method declared on ISelectionListener.
*/
void RemovePostSelectionListener(const QString& partId,
ISelectionListener* listener) override;
/**
* This method is called when a part is activated by clicking within it. In
* response, the part, the pane, and all of its actions will be activated.
*
* In the current design this method is invoked by the part pane when the
* pane, the part, or any children gain focus.
*/
void RequestActivation(IWorkbenchPart::Pointer part);
/**
* Resets the layout for the perspective. The active part in the old layout
* is activated in the new layout for consistent user context.
*/
void ResetPerspective() override;
/**
* Restore this page from the memento and ensure that the active
* perspective is equals the active descriptor otherwise create a new
* perspective for that descriptor. If activeDescriptor is null active the
* old perspective.
*/
/*IStatus*/bool RestoreState(IMemento::Pointer memento,
IPerspectiveDescriptor::Pointer activeDescriptor);
/**
* See IWorkbenchPage
*/
bool SaveAllEditors(bool confirm) override;
/**
* @param confirm
* @param addNonPartSources true if saveables from non-part sources should be saved too
* @return false if the user cancelled
*
*/
bool SaveAllEditors(bool confirm, bool addNonPartSources);
/**
* Saves an editors in the workbench. If <code>confirm</code> is <code>true</code>
* the user is prompted to confirm the command.
*
* @param confirm
* if user confirmation should be sought
* @return <code>true</code> if the command succeeded, or <code>false</code>
* if the user cancels the command
*/
bool SaveEditor(IEditorPart::Pointer editor, bool confirm) override;
/**
* Saves the current perspective.
*/
void SavePerspective() override;
/**
* Saves the perspective.
*/
void SavePerspectiveAs(IPerspectiveDescriptor::Pointer newDesc) override;
/**
* Save the state of the page.
*/
/*IStatus*/bool SaveState(IMemento::Pointer memento);
/**
* See IWorkbenchPage.
*/
void SetEditorAreaVisible(bool showEditorArea);
/**
* Sets the perspective.
*
* @param desc
* identifies the new perspective.
*/
void SetPerspective(IPerspectiveDescriptor::Pointer desc) override;
/**
* See IWorkbenchPage.
*/
IViewPart::Pointer ShowView(const QString& viewID) override;
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.IWorkbenchPage#showView(java.lang.String,
* java.lang.String, int)
*/
IViewPart::Pointer ShowView(const QString& viewID,
const QString& secondaryID, int mode) override;
/*
* Returns the editors in activation order (oldest first).
*/
QList<IEditorReference::Pointer> GetSortedEditors();
/**
* @see IWorkbenchPage#getOpenPerspectives()
*/
QList<IPerspectiveDescriptor::Pointer> GetOpenPerspectives() override;
protected:
/**
* Do not call this method. Use <code>busyOpenEditor</code>.
*
* @see IWorkbenchPage#openEditor(IEditorInput, String, boolean)
*/
IEditorPart::Pointer BusyOpenEditorBatched(IEditorInput::Pointer input,
const QString& editorID, bool activate, int matchFlags,
IMemento::Pointer editorState);
void ShowEditor(bool activate, IEditorPart::Pointer editor);
/*
* Saves the workbench part.
*/
bool SavePart(ISaveablePart::Pointer saveable, IWorkbenchPart::Pointer part,
bool confirm);
/**
* Restore the toolbar layout for the active perspective.
*/
void ResetToolBarLayout();
/**
* Return all open Perspective objects.
*
* @return all open Perspective objects
*/
/*package*/
QList<SmartPointer<Perspective> > GetOpenInternalPerspectives();
/**
* Checks perspectives in the order they were activiated
* for the specfied part. The first sorted perspective
* that contains the specified part is returned.
*
* @param part specified part to search for
* @return the first sorted perspespective containing the part
*/
/*package*/
SmartPointer<Perspective> GetFirstPerspectiveWithView(IViewPart::Pointer part);
// for dynamic UI
void AddPerspective(SmartPointer<Perspective> persp);
public:
/**
* Returns the perspectives in activation order (oldest first).
*/
QList<IPerspectiveDescriptor::Pointer> GetSortedPerspectives() override;
/*
* Returns the parts in activation order (oldest first).
*/
QList<IWorkbenchPartReference::Pointer> GetSortedParts();
/**
* Returns the reference to the given part, or <code>null</code> if it has no reference
* (i.e. it is not a top-level part in this workbench page).
*
* @param part the part
* @return the part's reference or <code>null</code> if the given part does not belong
* to this workbench page
*/
IWorkbenchPartReference::Pointer GetReference(IWorkbenchPart::Pointer part) override;
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.IWorkbenchPage#getViewStack(org.blueberry.ui.IViewPart)
*/
QList<IViewPart::Pointer> GetViewStack(IViewPart::Pointer part);
/**
* Allow for programmatically resizing a part.
* <p>
* <em>EXPERIMENTAL</em>
* </p>
* <p>
* Known limitations:
* <ul>
* <li>currently applies only to views</li>
* <li>has no effect when view is zoomed</li>
* </ul>
*/
void ResizeView(IViewPart::Pointer part, int width, int height);
/**
* Sanity-checks the objects in this page. Throws an Assertation exception
* if an object's internal state is invalid. ONLY INTENDED FOR USE IN THE
* UI TEST SUITES.
*/
void TestInvariants();
IExtensionTracker* GetExtensionTracker() const override;
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.IWorkbenchPage#getPerspectiveShortcuts()
*/
QList<QString> GetPerspectiveShortcuts() override;
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.IWorkbenchPage#getShowViewShortcuts()
*/
QList<QString> GetShowViewShortcuts() override;
bool IsPartVisible(IWorkbenchPartReference::Pointer reference);
private:
QString GetId(IWorkbenchPart::Pointer part);
QString GetId(IWorkbenchPartReference::Pointer ref);
/**
* Sets the active part.
*/
void SetActivePart(IWorkbenchPart::Pointer newPart);
/**
* Sets the layout of the page. Assumes the new perspective is not null.
* Keeps the active part if possible. Updates the window menubar and
* toolbar if necessary.
*/
void SetPerspective(SmartPointer<Perspective> newPersp);
/*
* Update visibility state of all views.
*/
void UpdateVisibility(SmartPointer<Perspective> oldPersp,
SmartPointer<Perspective> newPersp);
/**
* @param mode the mode to test
* @return whether the mode is recognized
*/
bool CertifyMode(int mode);
/**
* Find the stack of view references stacked with this view part.
*
* @param part
* the part
* @return the stack of references
*/
QList<IViewReference::Pointer> GetViewReferenceStack(
IViewPart::Pointer part);
struct ActivationOrderPred : std::binary_function<IViewReference::Pointer,
IViewReference::Pointer, bool>
{
ActivationOrderPred(ActivationList* partList);
ActivationList* activationList;
bool operator()(const IViewReference::Pointer o1, const IViewReference::Pointer o2) const;
};
// provides sash information for the given pane
struct SashInfo
{
SmartPointer<LayoutPartSash> right;
SmartPointer<LayoutPartSash> left;
SmartPointer<LayoutPartSash> top;
SmartPointer<LayoutPartSash> bottom;
SmartPointer<LayoutTreeNode> rightNode;
SmartPointer<LayoutTreeNode> leftNode;
SmartPointer<LayoutTreeNode> topNode;
SmartPointer<LayoutTreeNode> bottomNode;
};
void FindSashParts(SmartPointer<LayoutTree> tree, const PartPane::Sashes& sashes,
SashInfo& info);
protected:
/**
* Returns all parts that are owned by this page
*
* @return
*/
QList<IWorkbenchPartReference::Pointer> GetAllParts();
/**
* Returns all open parts that are owned by this page (that is, all parts
* for which a part opened event would have been sent -- these would be
* activated parts whose controls have already been created.
*/
QList<IWorkbenchPartReference::Pointer> GetOpenParts();
private:
void SuggestReset();
};
}
#endif /*BERRYWORKBENCHPAGE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchPartReference.h b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchPartReference.h
index 2e9c88e202..dcef407afc 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchPartReference.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchPartReference.h
@@ -1,284 +1,284 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYWORKBENCHPARTREFERENCE_H_
#define BERRYWORKBENCHPARTREFERENCE_H_
#include <berryMessage.h>
#include "berryISizeProvider.h"
#include "berryIWorkbenchPartReference.h"
#include "berryIWorkbenchPart.h"
#include <QIcon>
namespace berry {
class PartPane;
/**
* \ingroup org_blueberry_ui_internal
*
*/
class BERRY_UI_QT WorkbenchPartReference : virtual public IWorkbenchPartReference, public ISizeProvider {
public:
- berryObjectMacro(WorkbenchPartReference)
+ berryObjectMacro(WorkbenchPartReference);
// State constants //////////////////////////////
/**
* State constant indicating that the part is not created yet
*/
static int STATE_LAZY; // = 0
/**
* State constant indicating that the part is in the process of being created
*/
static int STATE_CREATION_IN_PROGRESS; // = 1
/**
* State constant indicating that the part has been created
*/
static int STATE_CREATED; // = 2
/**
* State constant indicating that the reference has been disposed (the reference shouldn't be
* used anymore)
*/
static int STATE_DISPOSED; // = 3
WorkbenchPartReference();
~WorkbenchPartReference() override;
virtual bool IsDisposed() const;
virtual void Init(const QString& id, const QString& tooltip,
const QIcon& desc, const QString& paneName, const QString& contentDescription);
/**
* @see IWorkbenchPart
*/
void AddPropertyListener(IPropertyChangeListener* listener) override;
/**
* @see IWorkbenchPart
*/
void RemovePropertyListener(IPropertyChangeListener* listener) override;
QString GetId() const override;
QString GetTitleToolTip() const override;
/**
* Returns the pane name for the part
*
* @return the pane name for the part
*/
QString GetPartName() const override;
/**
* Returns the content description for this part.
*
* @return the pane name for the part
*/
QString GetContentDescription() const override;
bool IsDirty() const override;
QIcon GetTitleImage() const override;
virtual void FireVisibilityChange();
virtual bool GetVisible();
virtual void SetVisible(bool isVisible);
IWorkbenchPart::Pointer GetPart(bool restore) override;
/**
* Returns the part pane for this part reference. Does not return null.
*
* @return
*/
SmartPointer<PartPane> GetPane();
void Dispose();
virtual void SetPinned(bool newPinned);
bool IsPinned() const override;
/*
* @see org.blueberry.ui.IWorkbenchPartReference#getPartProperty(java.lang.String)
*/
QString GetPartProperty(const QString& key) const override;
int ComputePreferredSize(bool width, int availableParallel,
int availablePerpendicular, int preferredResult) override;
int GetSizeFlags(bool width) override;
protected:
IWorkbenchPart::Pointer part;
SmartPointer<PartPane> pane;
QHash<QString, QString> propertyCache;
virtual void CheckReference();
virtual void SetPartName(const QString& newPartName);
virtual void SetContentDescription(const QString& newContentDescription);
virtual void SetImageDescriptor(const QIcon& descriptor);
virtual void SetToolTip(const QString& newToolTip);
virtual void PropertyChanged(const Object::Pointer& source, int propId);
virtual void PropertyChanged(const PropertyChangeEvent::Pointer& event);
/**
* Refreshes all cached values with the values from the real part
*/
virtual void RefreshFromPart();
virtual QIcon ComputeImageDescriptor();
// /* package */ virtual void fireZoomChange();
QString GetRawToolTip() const;
/**
* Gets the part name directly from the associated workbench part,
* or the empty string if none.
*
* @return
*/
QString GetRawPartName() const;
virtual QString ComputePartName() const;
/**
* Computes a new content description for the part. Subclasses may override to change the
* default behavior
*
* @return the new content description for the part
*/
virtual QString ComputeContentDescription() const;
/**
* Returns the content description as set directly by the part, or the empty string if none
*
* @return the unmodified content description from the part (or the empty string if none)
*/
QString GetRawContentDescription() const;
virtual void FirePropertyChange(int id);
virtual IWorkbenchPart::Pointer CreatePart() = 0;
virtual SmartPointer<PartPane> CreatePane() = 0;
void DoDisposePart();
virtual void FirePropertyChange(const PropertyChangeEvent::Pointer& event);
virtual void CreatePartProperties(IWorkbenchPart::Pointer workbenchPart);
private:
/**
* Current state of the reference. Used to detect recursive creation errors, disposed
* references, etc.
*/
int state;
QString id;
bool pinned;
QString tooltip;
QIcon defaultImageDescriptor;
/**
* Stores the current image descriptor for the part.
*/
QIcon imageDescriptor;
/**
* API listener list
*/
IPropertyChangeListener::Events propChangeEvents;
//private: ListenerList partChangeListeners = new ListenerList();
QString partName;
QString contentDescription;
/**
* Used to remember which events have been queued.
*/
QSet<int> queuedEvents;
bool queueEvents;
//static DisposeListener prematureDisposeListener = new DisposeListener() {
// public void widgetDisposed(DisposeEvent e) {
// WorkbenchPlugin.log(new RuntimeException("Widget disposed too early!")); //$NON-NLS-1$
// }
// };
struct PropertyChangeListener : public IPropertyChangeListener
{
PropertyChangeListener(WorkbenchPartReference* ref);
using IPropertyChangeListener::PropertyChange;
void PropertyChange(const PropertyChangeEvent::Pointer& event) override;
private:
WorkbenchPartReference* partRef;
};
QScopedPointer<IPropertyChangeListener> propertyChangeListener;
/**
* Calling this with deferEvents(true) will queue all property change events until a subsequent
* call to deferEvents(false). This should be used at the beginning of a batch of related changes
* to prevent duplicate property change events from being sent.
*
* @param shouldQueue
*/
void DeferEvents(bool shouldQueue);
void ImmediateFirePropertyChange(int id);
/**
* Clears all of the listeners in a listener list. TODO Bug 117519 Remove
* this method when fixed.
*
* @param list
* The list to be clear; must not be <code>null</code>.
*/
//private: void clearListenerList(const ListenerList list);
};
} // namespace berry
#endif /*BERRYWORKBENCHPARTREFERENCE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchSourceProvider.h b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchSourceProvider.h
index 14473d46d3..c15da22199 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchSourceProvider.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchSourceProvider.h
@@ -1,239 +1,239 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYWORKBENCHSOURCEPROVIDER_H
#define BERRYWORKBENCHSOURCEPROVIDER_H
#include "berryAbstractSourceProvider.h"
#include "berryINullSelectionListener.h"
#include "berryIPartListener.h"
#include "berryIWindowListener.h"
#include "berryIPropertyChangeListener.h"
#include "berryIPerspectiveListener.h"
#include "berryIShellListener.h"
namespace berry {
struct IEditorPart;
struct IEditorInput;
struct IShowInSource;
class Display;
class ObjectBool;
class ObjectString;
class ShowInContext;
class WorkbenchWindow;
class WorkbenchSourceProvider : public QObject, public AbstractSourceProvider,
private INullSelectionListener, private IPartListener, private IWindowListener,
private IPropertyChangeListener, private IPerspectiveListener
{
Q_OBJECT
Q_INTERFACES(berry::ISourceProvider)
private:
/**
* The names of the sources supported by this source provider.
*/
static const QList<QString> PROVIDED_SOURCE_NAMES;
IWorkbench* workbench;
WeakPointer<IWorkbenchWindow> lastWindow;
// private IServiceLocator locator;
// Selection SourceProvider
SmartPointer<const ISelection> selection;
public:
- berryObjectMacro(berry::WorkbenchSourceProvider)
+ berryObjectMacro(berry::WorkbenchSourceProvider);
WorkbenchSourceProvider();
void Initialize(IServiceLocator* locator) override;
~WorkbenchSourceProvider() override;
QList<QString> GetProvidedSourceNames() const override;
ISourceProvider::StateMapType GetCurrentState() const override;
private:
void SelectionChanged(const SmartPointer<IWorkbenchPart>& part,
const SmartPointer<const ISelection>& newSelection) override;
int UpdateSelection(ISourceProvider::StateMapType& currentState) const;
void UpdateWindows(IWorkbenchWindow* newWindow);
// Active Part SourceProvider
/**
* The last active editor part seen as active by this provider. This value
* may be <code>null</code> if there is no currently active editor.
*/
const IEditorPart* lastActiveEditor;
/**
* The last active editor id seen as active by this provider. This value may
* be <code>null</code> if there is no currently active editor.
*/
SmartPointer<const ObjectString> lastActiveEditorId;
/**
* The last active part seen as active by this provider. This value may be
* <code>null</code> if there is no currently active part.
*/
const IWorkbenchPart* lastActivePart;
/**
* The last active part id seen as active by this provider. This value may
* be <code>null</code> if there is no currently active part.
*/
SmartPointer<const ObjectString> lastActivePartId;
/**
* The last active part site seen by this provider. This value may be
* <code>null</code> if there is no currently active site.
*/
const IWorkbenchPartSite* lastActivePartSite;
SmartPointer<const Object> lastShowInInput;
void PartActivated(const SmartPointer<IWorkbenchPartReference>& part) override;
void PartBroughtToTop(const SmartPointer<IWorkbenchPartReference>& part) override;
void PartClosed(const SmartPointer<IWorkbenchPartReference>& part) override;
void PartDeactivated(const SmartPointer<IWorkbenchPartReference>& part) override;
void PartOpened(const SmartPointer<IWorkbenchPartReference>& part) override;
void WindowActivated(const SmartPointer<IWorkbenchWindow>& window) override;
void WindowClosed(const SmartPointer<IWorkbenchWindow>& window) override;
void WindowDeactivated(const SmartPointer<IWorkbenchWindow>& window) override;
void WindowOpened(const SmartPointer<IWorkbenchWindow>& window) override;
WeakPointer<const IEditorInput> lastEditorInput;
void HandleCheck(const SmartPointer<const Shell>& s);
void CheckActivePart();
void CheckActivePart(bool updateShowInSelection);
SmartPointer<IShowInSource> GetShowInSource(const SmartPointer<IWorkbenchPart>& sourcePart) const;
SmartPointer<ShowInContext> GetContext(const SmartPointer<IWorkbenchPart>& sourcePart) const;
IWorkbenchWindow* GetActiveWindow() const;
void UpdateActivePart(ISourceProvider::StateMapType& currentState) const;
void UpdateActivePart(ISourceProvider::StateMapType& currentState, bool updateShowInSelection) const;
// Active Part SourceProvider
/**
* The display on which this provider is working.
*/
Display* display;
/**
* The last shell seen as active by this provider. This value may be
* <code>null</code> if the last call to
* <code>Display.getActiveShell()</code> returned <code>null</code>.
*/
WeakPointer<const Shell> lastActiveShell;
/**
* The last workbench window shell seen as active by this provider. This
* value may be <code>null</code> if the last call to
* <code>workbench.getActiveWorkbenchWindow()</code> returned
* <code>null</code>.
*/
WeakPointer<const Shell> lastActiveWorkbenchWindowShell;
/**
* The last workbench window seen as active by this provider. This value may
* be null if the last call to
* <code>workbench.getActiveWorkbenchWindow()</code> returned
* <code>null</code>.
*/
WeakPointer<const WorkbenchWindow> lastActiveWorkbenchWindow;
/**
* The result of the last visibility check on the toolbar of the last active
* workbench window.
*/
SmartPointer<const ObjectBool> lastToolbarVisibility;
/**
* The result of the last visibility check on the perspective bar of the
* last active workbench window.
*/
SmartPointer<const ObjectBool> lastPerspectiveBarVisibility;
/**
* The result of the last visibility check on the status line for the last
* workbench window.
*/
SmartPointer<const ObjectBool> lastStatusLineVisibility;
/**
* The last perspective id that was provided by this source.
*/
SmartPointer<const ObjectString> lastPerspectiveId;
/**
* The listener to individual window properties.
*/
void PropertyChange(const SmartPointer<PropertyChangeEvent>& event) override;
void PropertyChange(const Object::Pointer& source, int propId) override;
void PerspectiveActivated(const SmartPointer<IWorkbenchPage>& page,
const SmartPointer<IPerspectiveDescriptor>& perspective) override;
using IPerspectiveListener::PerspectiveChanged;
void PerspectiveChanged(const SmartPointer<IWorkbenchPage>& page,
const SmartPointer<IPerspectiveDescriptor>& perspective,
const QString& changeId) override;
bool eventFilter(QObject *obj, QEvent *event) override;
/**
* The listener to shell activations on the display.
* Notifies all listeners that the source has changed.
*/
void HandleShellEvent();
void CheckOtherSources(const SmartPointer<const Shell>& s);
void HandleInputChanged(const SmartPointer<IEditorPart>& editor);
void HookListener(WorkbenchWindow* lastActiveWorkbenchWindow,
WorkbenchWindow* newActiveWorkbenchWindow);
void HookListener(IEditorPart* lastActiveEditor,
IEditorPart* newActiveEditor);
void UpdateActiveShell(ISourceProvider::StateMapType& currentState) const;
IPartListener::Events::Types GetPartEventTypes() const override;
IPerspectiveListener::Events::Types GetPerspectiveEventTypes() const override;
};
}
#endif // BERRYWORKBENCHSOURCEPROVIDER_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindow.h b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindow.h
index ebc3763f93..05e0899876 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindow.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindow.h
@@ -1,705 +1,705 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYWORKBENCHWINDOW_H_
#define BERRYWORKBENCHWINDOW_H_
#include "berryIWorkbenchWindow.h"
#include "berryIPerspectiveListener.h"
#include "berryWindow.h"
#include "berryWorkbenchWindowConfigurer.h"
#include "berryShellPool.h"
#include "berryServiceLocator.h"
#include "berryWWinPartService.h"
#include "application/berryWorkbenchAdvisor.h"
#include "application/berryWorkbenchWindowAdvisor.h"
#include "application/berryActionBarAdvisor.h"
#include <QStringList>
#include <QRect>
namespace berry
{
struct IEvaluationReference;
struct IWorkbench;
struct IWorkbenchPage;
struct IPartService;
struct ISelectionService;
struct IPerspectiveDescriptor;
struct IWorkbenchLocationService;
class Workbench;
class WorkbenchPage;
class WWinActionBars;
/**
* \ingroup org_blueberry_ui_qt
*
*/
class BERRY_UI_QT WorkbenchWindow: public Window, public IWorkbenchWindow
{
public:
/**
* Toolbar visibility change property.
*/
static const QString PROP_TOOLBAR_VISIBLE; // = "toolbarVisible";
/**
* Perspective bar visibility change property.
*/
static const QString PROP_PERSPECTIVEBAR_VISIBLE; // = "perspectiveBarVisible";
/**
* The status line visibility change property. for internal use only.
*/
static const QString PROP_STATUS_LINE_VISIBLE; // = "statusLineVisible";
public:
- berryObjectMacro(WorkbenchWindow, Window, IWorkbenchWindow)
+ berryObjectMacro(WorkbenchWindow, Window, IWorkbenchWindow);
WorkbenchWindow(int number);
~WorkbenchWindow() override;
Object* GetService(const QString& key) override;
bool HasService(const QString& key) const override;
int Open();
bool Close() override;
Shell::Pointer GetShell() const override;
/**
* @see org.blueberry.ui.IPageService
*/
void AddPerspectiveListener(IPerspectiveListener* l) override;
/**
* @see org.blueberry.ui.IPageService
*/
void RemovePerspectiveListener(IPerspectiveListener* l) override;
/**
* @see org.blueberry.ui.IPageService
*/
IPerspectiveListener::Events& GetPerspectiveEvents() override;
/**
* Returns the action bars for this window.
*/
WWinActionBars* GetActionBars();
SmartPointer<IWorkbenchPage> GetActivePage() const override;
QList<SmartPointer<IWorkbenchPage> > GetPages() const override;
void SetPerspectiveExcludeList(const QStringList& v);
QStringList GetPerspectiveExcludeList() const;
void SetViewExcludeList(const QStringList& v);
QStringList GetViewExcludeList() const;
/**
* Sets the active page within the window.
*
* @param in
* identifies the new active page, or <code>null</code> for no
* active page
*/
void SetActivePage(SmartPointer<IWorkbenchPage> in) override;
/**
* Answer the menu manager for this window.
*/
MenuManager* GetMenuManager() const;
IWorkbench* GetWorkbench() const override;
IPartService* GetPartService() override;
ISelectionService* GetSelectionService() const override;
/**
* @return whether the tool bar should be shown. This is only applicable if
* the window configurer also wishes the cool bar to be visible.
*/
bool GetToolBarVisible() const;
/**
* @return whether the perspective bar should be shown. This is only
* applicable if the window configurer also wishes the perspective
* bar to be visible.
*/
bool GetPerspectiveBarVisible() const;
/**
* @return whether the status line should be shown. This is only applicable if
* the window configurer also wishes status line to be visible.
*/
bool GetStatusLineVisible() const;
/**
* Add a generic property listener.
*
* @param listener the listener to add
*/
void AddPropertyChangeListener(IPropertyChangeListener* listener);
/**
* Removes a generic property listener.
*
* @param listener the listener to remove
*/
void RemovePropertyChangeListener(IPropertyChangeListener* listener);
SmartPointer<IWorkbenchPage> OpenPage(const QString& perspectiveId,
IAdaptable* input) override;
SmartPointer<IWorkbenchPage> OpenPage(IAdaptable* input) override;
//TODO menu manager
//virtual QWidget* GetMenuManager() = 0;
virtual bool SaveState(IMemento::Pointer memento);
/**
* Called when this window is about to be closed.
*
* Subclasses may overide to add code that returns <code>false</code> to
* prevent closing under certain conditions.
*/
virtual bool OkToClose();
bool RestoreState(IMemento::Pointer memento, SmartPointer<
IPerspectiveDescriptor> activeDescriptor);
/**
* Returns the number. This corresponds to a page number in a window or a
* window number in the workbench.
*/
int GetNumber();
/**
* update the action bars.
*/
void UpdateActionBars();
/**
* <p>
* Indicates the start of a large update within this window. This is used to
* disable CPU-intensive, change-sensitive services that were temporarily
* disabled in the midst of large changes. This method should always be
* called in tandem with <code>largeUpdateEnd</code>, and the event loop
* should not be allowed to spin before that method is called.
* </p>
* <p>
* Important: always use with <code>largeUpdateEnd</code>!
* </p>
*
* @since 3.1
*/
void LargeUpdateStart();
/**
* <p>
* Indicates the end of a large update within this window. This is used to
* re-enable services that were temporarily disabled in the midst of large
* changes. This method should always be called in tandem with
* <code>largeUpdateStart</code>, and the event loop should not be
* allowed to spin before this method is called.
* </p>
* <p>
* Important: always protect this call by using <code>finally</code>!
* </p>
*
* @since 3.1
*/
void LargeUpdateEnd();
QSet<SmartPointer<IEvaluationReference> > GetMenuRestrictions() const;
protected:
friend class WorkbenchConfigurer;
friend class WorkbenchWindowConfigurer;
friend class WorkbenchWindowConfigurer::WindowActionBarConfigurer;
friend class Workbench;
friend class LayoutPartSash;
friend class EditorSashContainer;
friend class WorkbenchPage;
friend class DetachedWindow;
/**
* Returns the GUI dependent page composite, under which the window's
* pages create their controls.
*/
QWidget* GetPageComposite();
/**
* Creates and remembers the client composite, under which workbench pages
* create their controls.
*/
QWidget* CreatePageComposite(QWidget* parent);
/**
* Creates the contents of the workbench window, including trim controls and
* the client composite. This MUST create the client composite via a call to
* <code>createClientComposite</code>.
*
* @since 3.0
*/
QWidget* CreateContents(Shell::Pointer parent) override;
/**
* Creates the default contents and layout of the shell.
*
* @param shell
* the shell
*/
virtual void CreateDefaultContents(Shell::Pointer shell);
void CreateTrimWidgets(SmartPointer<Shell> shell) override;
/**
* Returns the unique object that applications use to configure this window.
* <p>
* IMPORTANT This method is declared package-private to prevent regular
* plug-ins from downcasting IWorkbenchWindow to WorkbenchWindow and getting
* hold of the workbench window configurer that would allow them to tamper
* with the workbench window. The workbench window configurer is available
* only to the application.
* </p>
*/
WorkbenchWindowConfigurer::Pointer GetWindowConfigurer() const;
bool CanHandleShellCloseEvent() override;
/*
* @see berry::Window#configureShell(Shell::Pointer)
*/
void ConfigureShell(Shell::Pointer shell) override;
ShellPool::Pointer GetDetachedWindowPool();
/**
* Fills the window's real action bars.
*
* @param flags
* indicate which bars to fill
*/
void FillActionBars(ActionBarAdvisor::FillFlags flags);
/**
* The <code>WorkbenchWindow</code> implementation of this method
* delegates to the window configurer.
*
* @since 3.0
*/
QPoint GetInitialSize() override;
/**
* Returns the default page input for workbench pages opened in this window.
*
* @return the default page input or <code>null</code> if none
* @since 3.1
*/
IAdaptable* GetDefaultPageInput();
bool IsClosing();
/**
* Opens a new page. Assumes that busy cursor is active.
* <p>
* <b>Note:</b> Since release 2.0, a window is limited to contain at most
* one page. If a page exist in the window when this method is used, then
* another window is created for the new page. Callers are strongly
* recommended to use the <code>IWorkbench.openPerspective</code> APIs to
* programmatically show a perspective.
* </p>
*/
SmartPointer<IWorkbenchPage> BusyOpenPage(const QString& perspID,
IAdaptable* input);
bool ClosePage(SmartPointer<IWorkbenchPage> in, bool save);
/**
* Makes the window visible and frontmost.
*/
void MakeVisible();
/**
* The composite under which workbench pages create their controls.
*/
QWidget* pageComposite;
private:
/**
* Constant indicating that all the actions bars should be filled.
*/
static const ActionBarAdvisor::FillFlags FILL_ALL_ACTION_BARS;
ShellPool::Pointer detachedWindowShells;
/**
* Object for configuring this workbench window. Lazily initialized to an
* instance unique to this window.
*/
mutable WorkbenchWindowConfigurer::Pointer windowConfigurer;
WorkbenchWindowAdvisor* windowAdvisor;
ActionBarAdvisor::Pointer actionBarAdvisor;
SmartPointer<WWinActionBars> actionBars;
IPropertyChangeListener::Events genericPropertyListeners;
int number;
/**
* The number of large updates that are currently going on. If this is
* number is greater than zero, then UI updateActionBars is a no-op.
*/
int largeUpdates;
bool closing;
bool shellActivated;
bool updateDisabled;
bool toolBarVisible;
bool perspectiveBarVisible;
bool statusLineVisible;
/**
* The map of services maintained by the workbench window. These services
* are initialized during workbench window during the
* {@link #configureShell(Shell)}.
*/
ServiceLocator::Pointer serviceLocator;
QScopedPointer<IWorkbenchLocationService, QScopedPointerObjectDeleter> workbenchLocationService;
bool emptyWindowContentsCreated;
QWidget* emptyWindowContents;
QRect normalBounds;
bool asMaximizedState;
IPerspectiveListener::Events perspectiveEvents;
WWinPartService partService;
QStringList perspectiveExcludeList;
QStringList viewExcludeList;
struct ServiceLocatorOwner: public IDisposable
{
ServiceLocatorOwner(WorkbenchWindow* wnd);
WorkbenchWindow* window;
void Dispose() override;
};
IDisposable::Pointer serviceLocatorOwner;
class PageList
{
private:
// List of pages in the order they were created;
QList<SmartPointer<IWorkbenchPage> > pagesInCreationOrder;
// List of pages where the top is the last activated.
QList<SmartPointer<IWorkbenchPage> > pagesInActivationOrder;
// The page explicitly activated
SmartPointer<IWorkbenchPage> active;
public:
typedef QList<SmartPointer<IWorkbenchPage> >::iterator iterator;
bool Add(SmartPointer<IWorkbenchPage> object);
iterator Begin();
iterator End();
void Clear();
bool Contains(SmartPointer<IWorkbenchPage> object);
bool Remove(SmartPointer<IWorkbenchPage> object);
bool IsEmpty();
QList<SmartPointer<IWorkbenchPage> > GetPages() const;
void SetActive(SmartPointer<IWorkbenchPage> page);
SmartPointer<WorkbenchPage> GetActive() const;
SmartPointer<WorkbenchPage> GetNextActive();
};
PageList pageList;
/**
* Notifies interested parties (namely the advisor) that the window is about
* to be opened.
*
* @since 3.1
*/
void FireWindowOpening();
/**
* Notifies interested parties (namely the advisor) that the window has been
* restored from a previously saved state.
*
* @throws WorkbenchException
* passed through from the advisor
* @since 3.1
*/
void FireWindowRestored();
/**
* Notifies interested parties (namely the advisor) that the window has been
* created.
*
* @since 3.1
*/
void FireWindowCreated();
/**
* Notifies interested parties (namely the advisor and the window listeners)
* that the window has been opened.
*
* @since 3.1
*/
void FireWindowOpened();
/**
* Notifies interested parties (namely the advisor) that the window's shell
* is closing. Allows the close to be vetoed.
*
* @return <code>true</code> if the close should proceed,
* <code>false</code> if it should be canceled
* @since 3.1
*/
bool FireWindowShellClosing();
/**
* Notifies interested parties (namely the advisor and the window listeners)
* that the window has been closed.
*
* @since 3.1
*/
void FireWindowClosed();
// /**
// * Fires page activated
// */
// void FirePageActivated(IWorkbenchPage::Pointer page);
//
// /**
// * Fires page closed
// */
// void FirePageClosed(IWorkbenchPage::Pointer page);
//
// /**
// * Fires page opened
// */
// void FirePageOpened(IWorkbenchPage::Pointer page);
/**
* Fires perspective activated
*/
void FirePerspectiveActivated(SmartPointer<IWorkbenchPage> page,
IPerspectiveDescriptor::Pointer perspective);
/**
* Fires perspective deactivated.
*
* @since 3.2
*/
void FirePerspectivePreDeactivate(SmartPointer<IWorkbenchPage> page,
IPerspectiveDescriptor::Pointer perspective);
/**
* Fires perspective deactivated.
*
* @since 3.1
*/
void FirePerspectiveDeactivated(SmartPointer<IWorkbenchPage> page,
IPerspectiveDescriptor::Pointer perspective);
/**
* Fires perspective changed
*/
void FirePerspectiveChanged(SmartPointer<IWorkbenchPage> ,
IPerspectiveDescriptor::Pointer perspective, const QString& changeId);
/**
* Fires perspective changed for an affected part
*/
void FirePerspectiveChanged(SmartPointer<IWorkbenchPage> ,
IPerspectiveDescriptor::Pointer perspective,
IWorkbenchPartReference::Pointer partRef, const QString& changeId);
/**
* Fires perspective closed
*/
void FirePerspectiveClosed(SmartPointer<IWorkbenchPage> ,
IPerspectiveDescriptor::Pointer perspective);
/**
* Fires perspective opened
*/
void FirePerspectiveOpened(SmartPointer<IWorkbenchPage> ,
IPerspectiveDescriptor::Pointer perspective);
/**
* Fires perspective saved as.
*
* @since 3.1
*/
void FirePerspectiveSavedAs(SmartPointer<IWorkbenchPage> ,
IPerspectiveDescriptor::Pointer oldPerspective,
IPerspectiveDescriptor::Pointer newPerspective);
/**
* Returns the workbench advisor. Assumes the workbench has been created
* already.
* <p>
* IMPORTANT This method is declared private to prevent regular plug-ins
* from downcasting IWorkbenchWindow to WorkbenchWindow and getting hold of
* the workbench advisor that would allow them to tamper with the workbench.
* The workbench advisor is internal to the application.
* </p>
*/
/* private - DO NOT CHANGE */
WorkbenchAdvisor* GetAdvisor();
/**
* Returns the window advisor, creating a new one for this window if needed.
* <p>
* IMPORTANT This method is declared private to prevent regular plug-ins
* from downcasting IWorkbenchWindow to WorkbenchWindow and getting hold of
* the window advisor that would allow them to tamper with the window. The
* window advisor is internal to the application.
* </p>
*/
/* private - DO NOT CHANGE */
WorkbenchWindowAdvisor* GetWindowAdvisor();
/**
* Returns the action bar advisor, creating a new one for this window if
* needed.
* <p>
* IMPORTANT This method is declared private to prevent regular plug-ins
* from downcasting IWorkbenchWindow to WorkbenchWindow and getting hold of
* the action bar advisor that would allow them to tamper with the window's
* action bars. The action bar advisor is internal to the application.
* </p>
*/
/* private - DO NOT CHANGE */
ActionBarAdvisor::Pointer GetActionBarAdvisor();
/*
* Returns the IWorkbench implementation.
*/
Workbench* GetWorkbenchImpl();
bool UnableToRestorePage(IMemento::Pointer pageMem);
/**
* Close the window.
*
* Assumes that busy cursor is active.
*/
bool BusyClose();
/**
* Unconditionally close this window. Assumes the proper flags have been set
* correctly (e.i. closing and updateDisabled)
*/
bool HardClose();
/**
* Close all of the pages.
*/
void CloseAllPages();
/**
* Save all of the pages. Returns true if the operation succeeded.
*/
bool SaveAllPages(bool bConfirm);
void ShowEmptyWindowContents();
void HideEmptyWindowContents();
struct ShellEventFilter : public QObject
{
ShellEventFilter(WorkbenchWindow* window);
bool eventFilter(QObject* watched, QEvent* event) override;
private:
void SaveBounds(const QRect& newBounds);
void ShellActivated();
void ShellDeactivated();
WorkbenchWindow* window;
};
ShellEventFilter resizeEventFilter;
/**
* Hooks a listener to track the resize of the window's shell. Stores the
* new bounds if in normal state - that is, not in minimized or maximized
* state)
*/
void TrackShellResize(Shell::Pointer newShell);
/**
* Returns true iff we are currently deferring UI processing due to a large
* update
*
* @return true iff we are deferring UI updates.
*/
bool UpdatesDeferred() const;
/**
* Initializes all of the default command-based services for the workbench
* window.
*/
void InitializeDefaultServices();
void FirePropertyChanged(const QString& property, const Object::Pointer& oldValue,
const Object::Pointer& newValue);
};
}
#endif /*BERRYWORKBENCHWINDOW_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindowConfigurer.h b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindowConfigurer.h
index ef6b30291a..4528b507d6 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindowConfigurer.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindowConfigurer.h
@@ -1,402 +1,402 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYWORKBENCHWINDOWCONFIGURER_H_
#define BERRYWORKBENCHWINDOWCONFIGURER_H_
#include "application/berryIActionBarConfigurer.h"
#include "application/berryIWorkbenchConfigurer.h"
#include "application/berryIWorkbenchWindowConfigurer.h"
#include <berryWeakPointer.h>
#include <QSet>
#include <QPoint>
class QToolBar;
class QMenuBar;
namespace berry
{
class WorkbenchWindow;
/**
* Internal class providing special access for configuring workbench windows.
* <p>
* Note that these objects are only available to the main application
* (the plug-in that creates and owns the workbench).
* </p>
* <p>
* This class is not intended to be instantiated or subclassed by clients.
* </p>
*/
class WorkbenchWindowConfigurer : public IWorkbenchWindowConfigurer
{
friend class WorkbenchWindow;
public:
- berryObjectMacro(WorkbenchWindowConfigurer)
+ berryObjectMacro(WorkbenchWindowConfigurer);
/**
* Creates a new workbench window configurer.
* <p>
* This method is declared package-private:. Clients obtain instances
* via {@link WorkbenchAdvisor#getWindowConfigurer
* WorkbenchAdvisor.getWindowConfigurer}
* </p>
*
* @param window the workbench window that this object configures
* @see WorkbenchAdvisor#getWindowConfigurer
*/
WorkbenchWindowConfigurer(const SmartPointer<WorkbenchWindow>& window);
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#getWindow
*/
SmartPointer<IWorkbenchWindow> GetWindow() override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#getWorkbenchConfigurer()
*/
SmartPointer<IWorkbenchConfigurer> GetWorkbenchConfigurer() override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#getTitle
*/
QString GetTitle() override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#setTitle
*/
void SetTitle(const QString& title) override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#getShowMenuBar
*/
bool GetShowMenuBar() const override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#setShowMenuBar
*/
void SetShowMenuBar(bool show) override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#getShowToolBar
*/
bool GetShowToolBar() const override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
void SetShowToolBar(bool show) override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
bool GetShowPerspectiveBar() const override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
void SetShowPerspectiveBar(bool show) override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#getShowStatusLine
*/
bool GetShowStatusLine() const override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#setShowStatusLine
*/
void SetShowStatusLine(bool show) override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
bool GetShowProgressIndicator() const override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
void SetShowProgressIndicator(bool show) override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#getData
*/
// Object getData(String key) {
// if (key == null) {
// throw new IllegalArgumentException();
// }
// return extraData.get(key);
// }
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#setData
*/
// void setData(String key, Object data) {
// if (key == null) {
// throw new IllegalArgumentException();
// }
// if (data != null) {
// extraData.put(key, data);
// } else {
// extraData.remove(key);
// }
// }
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#addEditorAreaTransfer
*/
void AddEditorAreaTransfer(const QStringList& transferTypes) override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
void ConfigureEditorAreaDropListener(IDropTargetListener* listener) override;
/**
* Returns the array of <code>Transfer</code> added by the application
*/
QStringList GetTransfers() const;
/**
* Returns the drop listener provided by the application.
*/
IDropTargetListener* GetDropTargetListener() const;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
SmartPointer<IActionBarConfigurer> GetActionBarConfigurer() override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
Qt::WindowFlags GetWindowFlags() const override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
void SetWindowFlags(Qt::WindowFlags shellStyle) override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
QPoint GetInitialSize() const override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
void SetInitialSize(QPoint size) override;
/**
* Creates the default window contents.
*
* @param shell the shell
*/
void CreateDefaultContents(SmartPointer<Shell> shell);
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
QMenuBar* CreateMenuBar() override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
QWidget* CreateToolBar(QWidget* parent) override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
// public: Control createStatusLineControl(Composite parent) {
// return window.getStatusLineManager().createControl(parent);
// }
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
QWidget* CreatePageComposite(QWidget* parent) override;
/*
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#saveState(org.blueberry.ui.IMemento)
*/
bool SaveState(SmartPointer<IMemento> memento) override;
protected:
/**
* Returns the title as set by <code>setTitle</code>, without consulting the shell.
*
* @return the window title as set, or <code>null</code> if not set
*/
QString BasicGetTitle();
private:
/**
* Action bar configurer that changes this workbench window.
* This implementation keeps track of tool bar items
*/
class WindowActionBarConfigurer : public IActionBarConfigurer
{
private:
IActionBarConfigurer::Pointer proxy;
WeakPointer<WorkbenchWindow> window;
public:
- berryObjectMacro(WindowActionBarConfigurer)
+ berryObjectMacro(WindowActionBarConfigurer);
WindowActionBarConfigurer(WeakPointer<WorkbenchWindow> wnd);
/**
* Sets the proxy to use, or <code>null</code> for none.
*
* @param proxy the proxy
*/
void SetProxy(IActionBarConfigurer::Pointer proxy);
/*
* @see org.blueberry.ui.application.IActionBarConfigurer#getWindowConfigurer()
*/
IWorkbenchWindowConfigurer::Pointer GetWindowConfigurer() override;
/*
* @see org.blueberry.ui.application.IActionBarConfigurer
*/
// public: IStatusLineManager getStatusLineManager() {
// if (proxy != null) {
// return proxy.getStatusLineManager();
// }
// return window.getStatusLineManager();
// }
/*
* @see org.blueberry.ui.application.IActionBarConfigurer
*/
IMenuManager* GetMenuManager() override;
/*
* @see org.blueberry.ui.internal.AbstractActionBarConfigurer
*/
IToolBarManager* GetToolBarManager() override;
/*
* @see org.blueberry.ui.application.IActionBarConfigurer
*/
// public: void registerGlobalAction(IAction action) {
// if (proxy != null) {
// proxy.registerGlobalAction(action);
// }
// window.registerGlobalAction(action);
// }
/*
* @see org.blueberry.ui.application.IActionBarConfigurer#createToolBarManager()
*/
// public: IToolBarManager createToolBarManager() {
// if (proxy != null) {
// return proxy.createToolBarManager();
// }
// return getActionBarPresentationFactory().createToolBarManager();
// }
};
/**
* The workbench window associated with this configurer.
*/
WeakPointer<WorkbenchWindow> window;
/**
* The shell style bits to use when the window's shell is being created.
*/
Qt::WindowFlags shellStyle;
/**
* The window title to set when the window's shell has been created.
*/
QString windowTitle;
/*
* Whether the workbench window should show the fast view bars.
*/
//bool showFastViewBars = false;
/**
* Whether the workbench window should show the perspective bar
*/
bool showPerspectiveBar;
/**
* Whether the workbench window should show the status line.
*/
bool showStatusLine;
/**
* Whether the workbench window should show the main tool bar.
*/
bool showToolBar;
/**
* Whether the workbench window should show the main menu bar.
*/
bool showMenuBar;
/**
* Whether the workbench window should have a progress indicator.
*/
bool showProgressIndicator;
/*
* Table to hold arbitrary key-data settings (key type: <code>String</code>,
* value type: <code>Object</code>).
* @see #setData
*/
//Map extraData = new HashMap(1);
/**
* Holds the list drag and drop <code>Transfer</code> for the
* editor area
*/
QSet<QString> transferTypes;
/**
* The <code>DropTargetListener</code> implementation for handling a
* drop into the editor area.
*/
IDropTargetListener* dropTargetListener;
/**
* The initial size to use for the shell.
*/
QPoint initialSize;
/**
* Object for configuring this workbench window's action bars.
* Lazily initialized to an instance unique to this window.
*/
SmartPointer<WindowActionBarConfigurer> actionBarConfigurer;
};
}
#endif /*BERRYWORKBENCHWINDOWCONFIGURER_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindowExpression.h b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindowExpression.h
index 48c71737f2..e74a8fc520 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindowExpression.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindowExpression.h
@@ -1,83 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYWORKBENCHWINDOWEXPRESSION_H
#define BERRYWORKBENCHWINDOWEXPRESSION_H
#include "berryExpression.h"
namespace berry {
struct IWorkbenchWindow;
/**
* <p>
* An expression that evaluates to {@link EvaluationResult#TRUE} when the active
* workbench window matches the window held by this expression.
* </p>
*/
class WorkbenchWindowExpression : public Expression
{
private:
/**
* The seed for the hash code for all schemes.
*/
static const int HASH_INITIAL;
/**
* The workbench window that must be active for this expression to evaluate
* to <code>true</code>. If this value is <code>null</code>, then any
* workbench window may be active.
*/
IWorkbenchWindow* const window;
public:
- berryObjectMacro(berry::WorkbenchWindowExpression)
+ berryObjectMacro(berry::WorkbenchWindowExpression);
/**
* Constructs a new instance.
*
* @param window
* The workbench window which must be active for this expression
* to evaluate to <code>true</code>; may be <code>null</code>
* if this expression is always <code>true</code>.
*/
WorkbenchWindowExpression(IWorkbenchWindow* window);
void CollectExpressionInfo(ExpressionInfo* info) const override;
bool operator==(const Object* object) const override;
SmartPointer<const EvaluationResult> Evaluate(IEvaluationContext* context) const override;
QString ToString() const override;
protected:
uint ComputeHashCode() const override;
/**
* Returns the workbench window to which this expression applies.
*
* @return The workbench window to which this expression applies; may be
* <code>null</code>.
*/
IWorkbenchWindow* GetWindow() const;
};
}
#endif // BERRYWORKBENCHWINDOWEXPRESSION_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/handlers/berryShowPerspectiveHandler.h b/Plugins/org.blueberry.ui.qt/src/internal/handlers/berryShowPerspectiveHandler.h
index 5383a4476e..b17f773977 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/handlers/berryShowPerspectiveHandler.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/handlers/berryShowPerspectiveHandler.h
@@ -1,72 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYSHOWPERSPECTIVEHANDLER_H
#define BERRYSHOWPERSPECTIVEHANDLER_H
#include <berryAbstractHandler.h>
#include <berryExecutionEvent.h>
namespace berry {
struct IWorkbenchWindow;
/**
* Shows the given perspective. If no perspective is specified in the
* parameters, then this opens the perspective selection dialog.
*/
class ShowPerspectiveHandler : public AbstractHandler
{
Q_OBJECT
public:
- berryObjectMacro(ShowPerspectiveHandler)
+ berryObjectMacro(ShowPerspectiveHandler);
Object::Pointer Execute(const ExecutionEvent::ConstPointer& event) override;
private:
/**
* Opens the specified perspective in a new window.
*
* @param perspectiveId
* The perspective to open; must not be <code>null</code>
* @throws ExecutionException
* If the perspective could not be opened.
*/
void OpenNewWindowPerspective(const QString& perspectiveId,
const IWorkbenchWindow* activeWorkbenchWindow);
/**
* Opens a view selection dialog, allowing the user to chose a view.
*
* @throws ExecutionException
* If the perspective could not be opened.
*/
void OpenOther(IWorkbenchWindow* activeWorkbenchWindow);
/**
* Opens the perspective with the given identifier.
*
* @param perspectiveId
* The perspective to open; must not be <code>null</code>
* @throws ExecutionException
* If the perspective could not be opened.
*/
void OpenPerspective(const QString& perspectiveId,
IWorkbenchWindow* activeWorkbenchWindow);
};
}
#endif // BERRYSHOWPERSPECTIVEHANDLER_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/handlers/berryShowViewHandler.h b/Plugins/org.blueberry.ui.qt/src/internal/handlers/berryShowViewHandler.h
index 3334b1216f..20990b9bc0 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/handlers/berryShowViewHandler.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/handlers/berryShowViewHandler.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYSHOWVIEWHANDLER_H_
#define BERRYSHOWVIEWHANDLER_H_
#include <berryAbstractHandler.h>
#include <berryExecutionEvent.h>
#include "berryIWorkbenchWindow.h"
namespace berry
{
/**
* \ingroup org_blueberry_ui_qt
*
* Shows the given view. If no view is specified in the parameters, then this
* opens the view selection dialog.
*/
class ShowViewHandler : public AbstractHandler
{
Q_OBJECT
public:
- berryObjectMacro(ShowViewHandler)
+ berryObjectMacro(ShowViewHandler);
/**
* Creates a new ShowViewHandler that will open the view in its default location.
*/
ShowViewHandler();
Object::Pointer Execute(const ExecutionEvent::ConstPointer& event) override;
private:
/**
* Opens a view selection dialog, allowing the user to chose a view.
*/
void OpenOther(IWorkbenchWindow::Pointer window);
/**
* Opens the view with the given identifier.
*
* @param viewId
* The view to open; must not be <code>null</code>
* @param secondaryId
* An optional secondary id; may be <code>null</code>
* @throws PartInitException
* If the part could not be initialized.
*/
void OpenView(const QString& viewId, const QString& secondaryId, IWorkbenchWindow::Pointer activeWorkbenchWindow);
};
}
#endif /*BERRYSHOWVIEWHANDLER_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/intro/berryIIntroDescriptor.h b/Plugins/org.blueberry.ui.qt/src/internal/intro/berryIIntroDescriptor.h
index 743050d05e..0886b7e9b2 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/intro/berryIIntroDescriptor.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/intro/berryIIntroDescriptor.h
@@ -1,72 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIINTRODESCRIPTOR_H_
#define BERRYIINTRODESCRIPTOR_H_
#include <berryObject.h>
#include <berryMacros.h>
#include "intro/berryIIntroPart.h"
namespace berry {
/**
* Describes an introduction extension.
*
* @since 3.0
*/
struct BERRY_UI_QT IIntroDescriptor : public Object
{
- berryObjectMacro(berry::IIntroDescriptor)
+ berryObjectMacro(berry::IIntroDescriptor);
~IIntroDescriptor() override;
/**
* Creates an instance of the intro part defined in the descriptor.
*/
virtual IIntroPart::Pointer CreateIntro() = 0;
/**
* Returns the role of the intro part (view or editor)
* @return the role of the part
*/
virtual int GetRole() const = 0;
/**
* Returns the part id.
*
* @return the id of the part
*/
virtual QString GetId() const = 0;
/**
* Returns the descriptor of the image for this part.
*
* @return the descriptor of the image to display next to this part
*/
virtual QIcon GetImageDescriptor() const = 0;
/**
* Return the label override string for this part.
*
* @return the label override string or the empty string if one has not
* been specified
*/
virtual QString GetLabelOverride() const = 0;
};
}
#endif /* BERRYIINTRODESCRIPTOR_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/intro/berryIntroDescriptor.h b/Plugins/org.blueberry.ui.qt/src/internal/intro/berryIntroDescriptor.h
index 444605453f..2331f9cb89 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/intro/berryIntroDescriptor.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/intro/berryIntroDescriptor.h
@@ -1,86 +1,86 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYINTRODESCRIPTOR_H_
#define BERRYINTRODESCRIPTOR_H_
#include "berryIIntroDescriptor.h"
#include "intro/berryIntroContentDetector.h"
#include "intro/berryIIntroPart.h"
#include <berryIConfigurationElement.h>
#include <QIcon>
namespace berry
{
/**
* Describes an introduction extension.
*
*/
class IntroDescriptor: public IIntroDescriptor
{
private:
IConfigurationElement::Pointer element;
mutable QIcon imageDescriptor;
public:
- berryObjectMacro(IntroDescriptor)
+ berryObjectMacro(IntroDescriptor);
/**
* Create a new IntroDescriptor for an extension.
*/
IntroDescriptor(IConfigurationElement::Pointer configElement);
/*
* @see IIntroDescriptor#CreateIntro()
*/
IIntroPart::Pointer CreateIntro() override;
IntroContentDetector::Pointer GetIntroContentDetector();
int GetRole() const override;
/*
* @see IIntroDescriptor#GetId()
*/
QString GetId() const override;
QString GetPluginId() const;
/*
* @see IIntroDescriptor#GetImageDescriptor()
*/
QIcon GetImageDescriptor() const override;
/**
* Returns the configuration element.
*
* @return the configuration element
*/
IConfigurationElement::Pointer GetConfigurationElement() const;
/*
* @see IIntroDescriptor#GetLabelOverride()
*/
QString GetLabelOverride() const override;
};
}
#endif /* BERRYINTRODESCRIPTOR_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroPart.h b/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroPart.h
index cf862aac41..d3378c7f9d 100644
--- a/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroPart.h
+++ b/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroPart.h
@@ -1,209 +1,209 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIINTROPART_H_
#define BERRYIINTROPART_H_
#include <berryObject.h>
#include <berryMacros.h>
#include <berryIMemento.h>
#include <berryIPropertyChangeListener.h>
#include <berryUIException.h>
#include "berryIIntroSite.h"
#include <QObject>
namespace berry {
/**
* The intro part is a visual component within the workbench responsible for
* introducing the product to new users. The intro part is typically shown the
* first time a product is started up.
* <p>
* The intro part implementation is contributed to the workbench via the
* <code>org.blueberry.ui.intro</code> extension point. There can be several
* intro part implementations, and associations between intro part
* implementations and products. The workbench will only make use of the intro
* part implementation for the current product (as given by
* {@link berry::Platform#GetProduct()}. There is at most one
* intro part instance in the entire workbench, and it resides in exactly one
* workbench window at a time.
* </p>
* <p>
* This interface in not intended to be directly implemented. Rather, clients
* providing a intro part implementation should subclass
* {@link berry::IntroPart}.
* </p>
*
* @see IIntroManager#ShowIntro(IWorkbenchWindow::Pointer, bool)
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IIntroPart : public virtual Object
{ // IAdaptable {
- berryObjectMacro(berry::IIntroPart)
+ berryObjectMacro(berry::IIntroPart);
~IIntroPart() override;
/**
* The property id for <code>getTitleImage</code> and
* <code>getTitle</code>.
*
* @since 3.2 this property now covers changes to <code>getTitle</code> in
* addition to <code>getTitleImage</code>
*/
//static const int PROP_TITLE = IWorkbenchPart::PROP_TITLE;
/**
* Returns the site for this intro part.
*
* @return the intro site
*/
virtual IIntroSite::Pointer GetIntroSite() const = 0;
/**
* Initializes this intro part with the given intro site. A memento is
* passed to the part which contains a snapshot of the part state from a
* previous session. Where possible, the part should try to recreate that
* state.
* <p>
* This method is automatically called by the workbench shortly after
* part construction. It marks the start of the intro's lifecycle. Clients
* must not call this method.
* </p>
*
* @param site the intro site
* @param memento the intro part state or <code>null</code> if there is no previous
* saved state
* @exception PartInitException if this part was not initialized
* successfully
*/
virtual void Init(IIntroSite::Pointer site, IMemento::Pointer memento) = 0;
/**
* Sets the standby state of this intro part. An intro part should render
* itself differently in the full and standby modes. In standby mode, the
* part should be partially visible to the user but otherwise allow them
* to work. In full mode, the part should be fully visible and be the center
* of the user's attention.
* <p>
* This method is automatically called by the workbench at appropriate
* times. Clients must not call this method directly (call
* {@link IIntroManager#setIntroStandby(IIntroPart, boolean)} instead.
* </p>
*
* @param standby <code>true</code> to put this part in its partially
* visible standy mode, and <code>false</code> to make it fully visible
*/
virtual void StandbyStateChanged(bool standby) = 0;
/**
* Saves the object state within a memento.
* <p>
* This method is automatically called by the workbench at appropriate
* times. Clients must not call this method directly.
* </p>
*
* @param memento a memento to receive the object state
*/
virtual void SaveState(IMemento::Pointer memento) = 0;
/**
* Adds a listener for changes to properties of this intro part.
* Has no effect if an identical listener is already registered.
* <p>
* The properties ids are as follows:
* <ul>
* <li><code>IIntroPart.PROP_TITLE</code> </li>
* </ul>
* </p>
*
* @param listener a property listener
*/
virtual void AddPropertyListener(IPropertyChangeListener* listener) = 0;
/**
* Creates the SWT controls for this intro part.
* <p>
* Clients should not call this method (the workbench calls this method when
* it needs to, which may be never).
* </p>
* <p>
* For implementors this is a multi-step process:
* <ol>
* <li>Create one or more controls within the parent.</li>
* <li>Set the parent layout as needed.</li>
* <li>Register any global actions with the <code>IActionService</code>.</li>
* <li>Register any popup menus with the <code>IActionService</code>.</li>
* <li>Register a selection provider with the <code>ISelectionService</code>
* (optional). </li>
* </ol>
* </p>
*
* @param parent the parent control
*/
virtual void CreatePartControl(void* parent) = 0;
/**
* Returns the title image of this intro part. If this value changes
* the part must fire a property listener event with
* {@link IIntroPart#PROP_TITLE}.
* <p>
* The title image is usually used to populate the title bar of this part's
* visual container. Since this image is managed by the part itself, callers
* must <b>not</b> dispose the returned image.
* </p>
*
* @return the title image
*/
virtual QIcon GetTitleImage() const = 0;
/**
* Returns the title of this intro part. If this value changes
* the part must fire a property listener event with
* {@link IIntroPart#PROP_TITLE}.
* <p>
* The title is used to populate the title bar of this part's visual
* container.
* </p>
*
* @return the intro part title (not <code>null</code>)
*/
virtual QString GetPartName() const = 0;
/**
* Removes the given property listener from this intro part.
* Has no affect if an identical listener is not registered.
*
* @param listener a property listener
*/
virtual void RemovePropertyListener(IPropertyChangeListener* listener) = 0;
/**
* Asks this part to take focus within the workbench.
* <p>
* Clients should not call this method (the workbench calls this method at
* appropriate times). To have the workbench activate a part, use
* {@link IIntroManager#showIntro(IWorkbenchWindow, boolean)}.
* </p>
*/
virtual void SetFocus() = 0;
};
}
Q_DECLARE_INTERFACE(berry::IIntroPart, "org.blueberry.ui.IIntroPart")
#endif /* BERRYIINTROPART_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroSite.h b/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroSite.h
index 61dd966373..4d3db03698 100644
--- a/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroSite.h
+++ b/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroSite.h
@@ -1,68 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIINTROSITE_H_
#define BERRYIINTROSITE_H_
#include <berryIWorkbenchSite.h>
namespace berry {
/**
* The primary interface between an intro part and the workbench.
* <p>
* The workbench exposes its implemention of intro part sites via this
* interface, which is not intended to be implemented or extended by clients.
* </p>
*
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IIntroSite : public IWorkbenchSite
{
- berryObjectMacro(berry::IIntroSite)
+ berryObjectMacro(berry::IIntroSite);
~IIntroSite() override;
/**
* Returns the part registry extension id for this intro site's part.
* <p>
* The name comes from the <code>id</code> attribute in the configuration
* element.
* </p>
*
* @return the registry extension id
*/
virtual QString GetId() const = 0;
/**
* Returns the unique identifier of the plug-in that defines this intro
* site's part.
*
* @return the unique identifier of the declaring plug-in
* @see org.eclipse.core.runtime.IPluginDescriptor#getUniqueIdentifier()
*/
virtual QString GetPluginId() const = 0;
/**
* Returns the action bars for this part site.
* The intro part has exclusive use of its site's action bars.
*
* @return the action bars
*/
//virtual IActionBars GetActionBars() const = 0;
};
}
#endif /* BERRYIINTROSITE_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/intro/berryIntroContentDetector.h b/Plugins/org.blueberry.ui.qt/src/intro/berryIntroContentDetector.h
index 1d8b1aac34..1b68b649ff 100644
--- a/Plugins/org.blueberry.ui.qt/src/intro/berryIntroContentDetector.h
+++ b/Plugins/org.blueberry.ui.qt/src/intro/berryIntroContentDetector.h
@@ -1,54 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYINTROCONTENTDETECTOR_H_
#define BERRYINTROCONTENTDETECTOR_H_
#include <berryObject.h>
#include <berryMacros.h>
#include <org_blueberry_ui_qt_Export.h>
namespace berry {
/**
* An intro content detector is used when starting the Workbench to determine if
* new intro content is available. Since calling this method is part of the
* Workbench start sequence, subclasses should be implemented with care as not
* to introduce noticeable delay at startup. If an intro content detector
* reports new available content, the view part showing the content will be
* opened again even if the user had closed it in a previous session. Because of
* this, the intro view part should draw the user's attention to the new content
* to avoid confusion about why the intro view part was opened again without the
* user requesting it.
*
*/
struct BERRY_UI_QT IntroContentDetector : public Object
{
- berryObjectMacro(berry::IntroContentDetector)
+ berryObjectMacro(berry::IntroContentDetector);
/**
* Returns <code>true</code> if new intro content is available.
*
* @return <code>true</code> if new intro content is available
*/
virtual bool IsNewContentAvailable() const = 0;
};
}
Q_DECLARE_INTERFACE(berry::IntroContentDetector, "org.blueberry.ui.IntroContentDetector")
#endif /* BERRYINTROCONTENTDETECTOR_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/intro/berryIntroPart.cpp b/Plugins/org.blueberry.ui.qt/src/intro/berryIntroPart.cpp
index 8e503c1df6..7d97da6e18 100644
--- a/Plugins/org.blueberry.ui.qt/src/intro/berryIntroPart.cpp
+++ b/Plugins/org.blueberry.ui.qt/src/intro/berryIntroPart.cpp
@@ -1,179 +1,179 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "berryIntroPart.h"
#include <berrySafeRunner.h>
#include <berryObjects.h>
#include <berryIContributor.h>
#include <berryIWorkbenchPartConstants.h>
#include <berryAbstractUICTKPlugin.h>
#include "util/berrySafeRunnable.h"
#include "internal/berryWorkbenchRegistryConstants.h"
namespace berry
{
class PropChangedRunnable: public SafeRunnable
{
public:
- berryObjectMacro(PropChangedRunnable)
+ berryObjectMacro(PropChangedRunnable);
IPropertyChangeListener::Events::EventType::AbstractDelegate* delegate;
PropChangedRunnable(PropertyChangeEvent::Pointer event) :
event(event)
{
}
void Run() override
{
delegate->Execute(event);
}
private:
PropertyChangeEvent::Pointer event;
};
QString IntroPart::GetDefaultTitle() const
{
return "Welcome";
}
void IntroPart::FirePropertyChange(int propertyId)
{
ObjectInt::Pointer val(new ObjectInt(propertyId));
Object::Pointer source(this);
PropertyChangeEvent::Pointer event(new PropertyChangeEvent(source,
IWorkbenchPartConstants::INTEGER_PROPERTY, val, val));
typedef IPropertyChangeListener::Events::EventType::ListenerList ListenerList;
PropChangedRunnable::Pointer runnable(new PropChangedRunnable(event));
const ListenerList& listeners =
propChangeEvents.propertyChange.GetListeners();
for (auto iter = listeners.begin(); iter
!= listeners.end(); ++iter)
{
runnable->delegate = *iter;
SafeRunner::Run(runnable);
}
}
IConfigurationElement::Pointer IntroPart::GetConfigurationElement()
{
return configElement;
}
QIcon IntroPart::GetDefaultImage() const
{
return QIcon();
}
void IntroPart::SetSite(IIntroSite::Pointer site)
{
this->partSite = site;
}
void IntroPart::SetTitleImage(const QIcon& titleImage)
{
//Do not send changes if they are the same
if (this->imageDescriptor.cacheKey() == titleImage.cacheKey())
{
return;
}
this->imageDescriptor = titleImage;
FirePropertyChange(IWorkbenchPartConstants::PROP_TITLE);
}
void IntroPart::SetTitle(const QString& titleLabel)
{
if (this->titleLabel == titleLabel)
return;
this->titleLabel = titleLabel;
FirePropertyChange(IWorkbenchPartConstants::PROP_TITLE);
}
void IntroPart::AddPropertyListener(IPropertyChangeListener *l)
{
propChangeEvents.AddListener(l);
}
IntroPart::~IntroPart()
{
}
IIntroSite::Pointer IntroPart::GetIntroSite() const
{
return partSite;
}
QIcon IntroPart::GetTitleImage() const
{
if (!this->imageDescriptor.isNull())
{
return this->imageDescriptor;
}
return GetDefaultImage();
}
QString IntroPart::GetPartName() const
{
if (!titleLabel.isEmpty())
{
return titleLabel;
}
return GetDefaultTitle();
}
void IntroPart::Init(IIntroSite::Pointer site, IMemento::Pointer /*memento*/)
{
SetSite(site);
}
void IntroPart::RemovePropertyListener(IPropertyChangeListener *l)
{
propChangeEvents.RemoveListener(l);
}
void IntroPart::SaveState(IMemento::Pointer /*memento*/)
{
//no-op
}
void IntroPart::SetInitializationData(const IConfigurationElement::Pointer& cfig,
const QString& /*propertyName*/, const Object::Pointer& /*data*/)
{
// Save config element.
configElement = cfig;
titleLabel = cfig->GetAttribute(WorkbenchRegistryConstants::ATT_LABEL);
// Icon.
QString strIcon = cfig->GetAttribute(WorkbenchRegistryConstants::ATT_ICON);
if (strIcon.isEmpty())
{
return;
}
imageDescriptor = AbstractUICTKPlugin::ImageDescriptorFromPlugin(
configElement->GetContributor()->GetName(), strIcon);
}
}
diff --git a/Plugins/org.blueberry.ui.qt/src/presentations/berryIPresentablePart.h b/Plugins/org.blueberry.ui.qt/src/presentations/berryIPresentablePart.h
index 2afa0f8f57..36f5615a04 100755
--- a/Plugins/org.blueberry.ui.qt/src/presentations/berryIPresentablePart.h
+++ b/Plugins/org.blueberry.ui.qt/src/presentations/berryIPresentablePart.h
@@ -1,266 +1,266 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIPRESENTABLEPART_H_
#define BERRYIPRESENTABLEPART_H_
#include <berryMacros.h>
#include "berryISizeProvider.h"
#include "berryIPropertyChangeListener.h"
class QToolBar;
namespace berry {
/**
* This is a skin's interface to the contents of a view or editor. Note that this
* is essentially the same as IWorkbenchPart, except it does not provide access
* to lifecycle events and allows repositioning of the part.
*
* Not intended to be implemented by clients.
*
* @since 3.0
* @since 3.4 now extends {@link org.blueberry.ui.ISizeProvider}
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IPresentablePart : public Object, public ISizeProvider {
- berryObjectMacro(berry::IPresentablePart)
+ berryObjectMacro(berry::IPresentablePart);
~IPresentablePart() override;
/**
* The property id for <code>isDirty</code>.
*/
static const int PROP_DIRTY; // = IWorkbenchPartConstants.PROP_DIRTY;
/**
* The property id for <code>getEditorInput</code>.
*/
static const int PROP_INPUT; // = IWorkbenchPartConstants.PROP_INPUT;
/**
* The property id for <code>getTitle</code>, <code>getTitleImage</code>
* and <code>getTitleToolTip</code>.
*/
static const int PROP_TITLE; // = IWorkbenchPartConstants.PROP_TITLE;
/**
* The property id for <code>IWorkbenchPart2.getContentDescription()</code>
*/
static const int PROP_CONTENT_DESCRIPTION; // = IWorkbenchPartConstants.PROP_CONTENT_DESCRIPTION;
/**
* The property id for <code>IWorkbenchPart2.getContentDescription()</code>
*/
static const int PROP_PART_NAME; // = IWorkbenchPartConstants.PROP_PART_NAME;
/**
* The property id for <code>isBusy</code>.
*/
static const int PROP_BUSY; // = 0x92;
/**
* The property id for toolbar changes
*/
static const int PROP_TOOLBAR; // = 0x93;
/**
* The property id for highlighting the
* part if it is not in front.
*/
static const int PROP_HIGHLIGHT_IF_BACK; // = 0x94;
/**
* The property id for pane menu changes
*/
static const int PROP_PANE_MENU; // = 0x302;
/**
* The property id for preferred size changes
* @since 3.4
*/
static const int PROP_PREFERRED_SIZE; // = IWorkbenchPartConstants.PROP_PREFERRED_SIZE;
/**
* Sets the bounds of this part.
*
* @param bounds bounding rectangle (not null)
*/
virtual void SetBounds(const QRect& bounds) = 0;
/**
* Notifies the part whether or not it is visible in the current
* perspective. A part is visible iff any part of its widgetry can
* be seen.
*
* @param isVisible true if the part has just become visible, false
* if the part has just become hidden
*/
virtual void SetVisible(bool isVisible) = 0;
/**
* Forces this part to have focus.
*/
virtual void SetFocus() = 0;
/**
* Adds a listener for changes to properties of this workbench part.
* Has no effect if an identical listener is already registered.
* <p>
* The properties ids are defined by the PROP_* constants, above.
* </p>
*
* @param listener a property listener (not null)
*/
virtual void AddPropertyListener(IPropertyChangeListener* listener) = 0;
/**
* Remove a listener that was previously added using addPropertyListener.
*
* @param listener a property listener (not null)
*/
virtual void RemovePropertyListener(IPropertyChangeListener* listener) = 0;
/**
* Returns the short name of the part. This is used as the text on
* the tab when this part is stacked on top of other parts.
*
* @return the short name of the part (not null)
*/
virtual QString GetName() const = 0;
/**
* Returns the title of this workbench part. If this value changes
* the part must fire a property listener event with
* <code>PROP_TITLE</code>.
* <p>
* The title is used to populate the title bar of this part's visual
* container.
* </p>
*
* @return the workbench part title (not null)
*/
virtual QString GetTitle() const = 0;
/**
* Returns the status message from the part's title, or the empty string if none.
* This is a substring of the part's title. A typical title will consist of
* the part name, a separator, and a status message describing the current contents.
* <p>
* Presentations can query getName() and getTitleStatus() if they want to display
* the status message and name separately, or they can use getTitle() if they want
* to display the entire title.
* </p>
*
* @return the status message or the empty string if none (not null)
*/
virtual QString GetTitleStatus() const = 0;
/**
* Returns the title image of this workbench part. If this value changes
* the part must fire a property listener event with
* <code>PROP_TITLE</code>.
* <p>
* The title image is usually used to populate the title bar of this part's
* visual container. Since this image is managed by the part itself, callers
* must <b>not</b> dispose the returned image.
* </p>
*
* @return the title image
*/
virtual QIcon GetTitleImage() = 0;
/**
* Returns the title tool tip text of this workbench part. If this value
* changes the part must fire a property listener event with
* <code>PROP_TITLE</code>.
* <p>
* The tool tip text is used to populate the title bar of this part's
* visual container.
* </p>
*
* @return the workbench part title tool tip (not null)
*/
virtual QString GetTitleToolTip() const = 0;
/**
* Returns true iff the contents of this part have changed recently. For
* editors, this indicates that the part has changed since the last save.
* For views, this indicates that the view contains interesting changes
* that it wants to draw the user's attention to.
*
* @return true iff the part is dirty
*/
virtual bool IsDirty() const = 0;
/**
* Return true if the the receiver is currently in a busy state.
* @return boolean true if busy
*/
virtual bool IsBusy() const = 0;
/**
* Returns true iff this part can be closed
*
* @return true iff this part can be closed
* @since 3.1
*/
virtual bool IsCloseable() const = 0;
/**
* Returns the local toolbar for this part, or null if this part does not
* have a local toolbar. Callers must not dispose or downcast the return value.
*
* @return the local toolbar for the part, or null if none
*/
virtual QToolBar* GetToolBar() = 0;
/**
* Returns the menu for this part or null if none
*
* @return the menu for this part or null if none
*/
//virtual IPartMenu getMenu();
/**
* Returns an SWT control that can be used to indicate the tab order for
* this part. This can be returned as part of the result to
* {@link StackPresentation#getTabList(IPresentablePart)}. Any other use of this control is
* unsupported. This may return a placeholder control that is only
* meaningful in the context of <code>getTabList</code>.
*
* @return the part's control (not null)
*/
virtual QWidget* GetControl() = 0;
/**
* Get a property from the part's arbitrary property set.
* <p>
* <b>Note:</b> this is a different set of properties than the ones covered
* by the PROP_* constants.
* </p>
*
* @param key
* The property key to retrieve. Must not be <code>null</code>.
* @return the property, or <code>null</code> if that property is not set.
* @since 3.3
*/
virtual QString GetPartProperty(const QString& key) const = 0;
};
}
#endif /* BERRYIPRESENTABLEPART_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/presentations/berryIStackPresentationSite.h b/Plugins/org.blueberry.ui.qt/src/presentations/berryIStackPresentationSite.h
index b35f35d394..0b460acee5 100755
--- a/Plugins/org.blueberry.ui.qt/src/presentations/berryIStackPresentationSite.h
+++ b/Plugins/org.blueberry.ui.qt/src/presentations/berryIStackPresentationSite.h
@@ -1,188 +1,188 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISTACKPRESENTATIONSITE_H_
#define BERRYISTACKPRESENTATIONSITE_H_
#include <berryMacros.h>
#include <list>
#include "berryIPresentablePart.h"
#include <org_blueberry_ui_qt_Export.h>
namespace berry
{
/**
* Represents the main interface between a StackPresentation and the workbench.
*
* Not intended to be implemented by clients.
*
* @since 3.0
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IStackPresentationSite : public Object
{
- berryObjectMacro(berry::IStackPresentationSite)
+ berryObjectMacro(berry::IStackPresentationSite);
static int STATE_MINIMIZED; // = 0;
static int STATE_MAXIMIZED; // = 1;
static int STATE_RESTORED; // = 2;
~IStackPresentationSite() override;
/**
* Sets the state of the container. Called by the presentation when the
* user causes the the container to be minimized, maximized, etc.
*
* @param newState one of the STATE_* constants
*/
virtual void SetState(int newState) = 0;
/**
* Returns the current state of the site (one of the STATE_* constants)
*
* @return the current state of the site (one of the STATE_* constants)
*/
virtual int GetState() = 0;
/**
* Returns true iff the site supports the given state
*
* @param state one of the STATE_* constants, above
* @return true iff the site supports the given state
*/
virtual bool SupportsState(int state) = 0;
/**
* Begins dragging the given part
*
* @param beingDragged the part to drag (not null)
* @param initialPosition the mouse position at the time of the initial mousedown
* (display coordinates, not null)
* @param keyboard true iff the drag was initiated via mouse dragging,
* and false if the drag may be using the keyboard
*/
virtual void DragStart(IPresentablePart::Pointer beingDragged,
QPoint& initialPosition, bool keyboard) = 0;
/**
* Closes the given set of parts.
*
* @param toClose the set of parts to close (Not null. All of the entries must be non-null)
*/
virtual void Close(const QList<IPresentablePart::Pointer>& toClose) = 0;
/**
* Begins dragging the entire stack of parts
*
* @param initialPosition the mouse position at the time of the initial mousedown (display coordinates,
* not null)
* @param keyboard true iff the drag was initiated via mouse dragging,
* and false if the drag may be using the keyboard
*/
virtual void DragStart(QPoint& initialPosition, bool keyboard) = 0;
/**
* Returns true iff this site will allow the given part to be closed
*
* @param toClose part to test (not null)
* @return true iff the part may be closed
*/
virtual bool IsCloseable(IPresentablePart::Pointer toClose) = 0;
/**
* Returns true iff the given part can be dragged. If this
* returns false, the given part should not trigger a drag.
*
* @param toMove part to test (not null)
* @return true iff this part is a valid drag source
*/
virtual bool IsPartMoveable(IPresentablePart::Pointer toMove) = 0;
/**
* Returns true iff this entire stack can be dragged
*
* @return true iff the stack can be dragged
*/
virtual bool IsStackMoveable() = 0;
/**
* Makes the given part active
*
* @param toSelect
*/
virtual void SelectPart(IPresentablePart::Pointer toSelect) = 0;
/**
* Returns the currently selected part or null if the stack is empty
*
* @return the currently selected part or null if the stack is empty
*/
virtual IPresentablePart::Pointer GetSelectedPart() = 0;
/**
* Adds system actions to the given menu manager. The site may
* make use of the following group ids:
* <ul>
* <li><code>close</code>, for close actions</li>
* <li><code>size</code>, for resize actions</li>
* <li><code>misc</code>, for miscellaneous actions</li>
* </ul>
* The presentation can control the insertion position by creating
* these group IDs where appropriate.
*
* @param menuManager the menu manager to populate
*/
//virtual void AddSystemActions(IMenuManager menuManager);
/**
* Notifies the workbench that the preferred size of the presentation has
* changed. Hints to the workbench that it should trigger a layout at the
* next opportunity.
*
* @since 3.1
*/
virtual void FlushLayout() = 0;
/**
* Returns the list of presentable parts currently in this site
*
* @return the list of presentable parts currently in this site
* @since 3.1
*/
virtual QList<IPresentablePart::Pointer> GetPartList() = 0;
/**
* Returns the property with the given id or <code>null</code>. Folder
* properties are an extensible mechanism for perspective authors to
* customize the appearance of view stacks. The list of customizable
* properties is determined by the presentation factory, and set in the
* perspective factory.
*
* @param id
* Must not be <code>null</code>.
* @return property value, or <code>null</code> if the property is not
* set.
* @since 3.3
*/
virtual QString GetProperty(const QString& id) = 0;
};
}
#endif /* BERRYISTACKPRESENTATIONSITE_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/presentations/berryStackDropResult.h b/Plugins/org.blueberry.ui.qt/src/presentations/berryStackDropResult.h
index 79e9587923..96af51b137 100755
--- a/Plugins/org.blueberry.ui.qt/src/presentations/berryStackDropResult.h
+++ b/Plugins/org.blueberry.ui.qt/src/presentations/berryStackDropResult.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYSTACKDROPRESULT_H_
#define BERRYSTACKDROPRESULT_H_
#include <berryMacros.h>
#include <berryObject.h>
#include <org_blueberry_ui_qt_Export.h>
#include <QRect>
namespace berry {
/**
* This structure describes a drop event that will cause a dragged part
* to be stacked in a position currently occupied by another part.
*
*/
class BERRY_UI_QT StackDropResult : public Object {
public:
- berryObjectMacro(StackDropResult)
+ berryObjectMacro(StackDropResult);
private:
QRect snapRectangle;
Object::Pointer cookie;
public:
/**
* Creates a drop result
*
* @param snapRectangle region that should be highlighted by the tracking
* rectangle (display coordinates)
* @param cookie the presentation may attach an object to this drop result
* in order to identify the drop location. This object will be passed back into the
* presentation's add method.
*/
StackDropResult(const QRect& snapRectangle, Object::Pointer cookie);
/**
* Returns a rectangle (screen coordinates) describing the target location
* for this drop operation. While dragging, the tracking rectangle will
* snap to this position.
*
* @return a snap rectangle (not null)
*/
QRect GetSnapRectangle();
/**
* Returns the cookie for this drop result. This object provided by the presentation,
* but is remembered by the workbench. It will be given back to the presentation's add
* method to indicate that a part is being added as a result of a drop operation.
*
* @return the drop cookie for this drop result
*/
Object::Pointer GetCookie();
};
}
#endif /* BERRYSTACKDROPRESULT_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/presentations/berryStackPresentation.h b/Plugins/org.blueberry.ui.qt/src/presentations/berryStackPresentation.h
index 4d1dc06e21..74b645dc20 100755
--- a/Plugins/org.blueberry.ui.qt/src/presentations/berryStackPresentation.h
+++ b/Plugins/org.blueberry.ui.qt/src/presentations/berryStackPresentation.h
@@ -1,271 +1,271 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYSTACKPRESENTATION_H_
#define BERRYSTACKPRESENTATION_H_
#include <berryMacros.h>
#include <org_blueberry_ui_qt_Export.h>
#include "berryIStackPresentationSite.h"
#include "berryIPresentationSerializer.h"
#include "berryStackDropResult.h"
#include "berryISizeProvider.h"
#include "berryIMemento.h"
namespace berry
{
/**
* This represents an object that can supply trim around a IPresentablePart.
* Clients can implement subclasses to provide the appearance for editor workbooks,
* view folders, fast views, and detached windows.
* <p>
* StackPresentations do not store any persistent state and cannot
* directly make changes to the workbench. They are given an IStackPresentationSite
* reference on creation, which allows them to send events and requests to the workbench.
* However, the workbench is free to ignore these requests. The workbench will call one
* of the public methods on StackPresentation when (and if) the presentation is expected to
* change state.
* </p>
* <p>
* For example, if the user clicks a button that is intended to close a part, the
* StackPresentation will send a close request to its site, but should not assume
* that the part has been closed until the workbench responds with a call
* <code>StackPresentation.remove</code>.
* </p>
*
* @since 3.0
*/
class BERRY_UI_QT StackPresentation : public Object, public ISizeProvider {
public:
- berryObjectMacro(StackPresentation)
+ berryObjectMacro(StackPresentation);
private:
/**
* The presentation site.
*/
IStackPresentationSite::WeakPtr site;
protected:
/**
* Constructs a new stack presentation with the given site.
*
* @param stackSite the stack site
*/
StackPresentation(IStackPresentationSite::Pointer stackSite);
~StackPresentation() override;
/**
* Returns the presentation site (not null).
* @return IStackPresentationSite
*/
IStackPresentationSite::Pointer GetSite();
public:
/**
* Inactive state. This is the default state for deselected presentations.
*/
static const int AS_INACTIVE; // = 0;
/**
* Activation state indicating that one of the parts in the presentation currently has focus
*/
static const int AS_ACTIVE_FOCUS; // = 1;
/**
* Activation state indicating that none of the parts in the presentation have focus, but
* one of the parts is being used as the context for global menus and toolbars
*/
static const int AS_ACTIVE_NOFOCUS; // = 2;
/**
* Sets the bounding rectangle for this presentation.
*
* @param bounds new bounding rectangle (not null)
*/
virtual void SetBounds(const QRect& bounds) = 0;
/**
* Returns the minimum size for this stack. The stack is prevented
* from being resized smaller than this amount, and this is used as
* the default size for the stack when it is minimized. Typically,
* this is the amount of space required to fit the minimize, close,
* and maximize buttons and one tab.
*
* @return the minimum size for this stack (not null)
*
* @deprecated replaced by computePreferredSize
*/
virtual QSize ComputeMinimumSize();
/*
* @see ISizeProvider#getSizeFlags(boolean)
*/
int GetSizeFlags(bool width) override;
/*
* @see ISizeProvider#computePreferredSize(boolean, int, int, int)
*/
int ComputePreferredSize(bool width, int availableParallel, int availablePerpendicular, int preferredResult) override;
/**
* This is invoked to notify the presentation that its activation
* state has changed. StackPresentations can have three possible activation
* states (see the AS_* constants above)
*
* @param newState one of AS_INACTIVE, AS_ACTIVE, or AS_ACTIVE_NOFOCUS
*/
virtual void SetActive(int newState) = 0;
/**
* This causes the presentation to become visible or invisible.
* When a presentation is invisible, it must not respond to user
* input or modify its parts. For example, a presentations will
* be made invisible if it belongs to a perspective and the user
* switches to another perspective.
*
* @param isVisible the state to set visibility to
*
* @since 3.0
*/
virtual void SetVisible(bool isVisible) = 0;
/**
* Sets the state of the presentation. That is, notifies the presentation
* that is has been minimized, maximized, or restored. Note that this method
* is the only way that a presentation is allowed to change its state.
* <p>
* If a presentation wishes to minimize itself, it must call setState
* on its associated IStackPresentationSite. If the site chooses to respond
* to the state change, it will call this method at the correct time.
* The presentation should not call this method directly.
* </p>
*
* @param state one of the IStackPresentationSite.STATE_* constants.
*/
virtual void SetState(int state) = 0;
/**
* Returns the control for this presentation
*
* @return the control for this presentation (not null)
*/
virtual QWidget* GetControl() = 0;
/**
* Adds the given part to the stack. The presentation is free to determine
* where the part should be inserted. If the part is being inserted as the
* result of a drag/drop operation, it will be given a cookie
* identifying the drop location. Has no effect if an identical part is
* already in the presentation.
*
* @param newPart the new part to add (not null)
* @param cookie an identifier for a drop location, or null. When the presentation
* attaches a cookie to a StackDropResult, that cookie is passed back into
* addPart when a part is actually dropped in that location.
*/
virtual void AddPart(IPresentablePart::Pointer newPart, Object::Pointer cookie) = 0;
/**
* Removes the given part from the stack.
*
* @param oldPart the part to remove (not null)
*/
virtual void RemovePart(IPresentablePart::Pointer oldPart) = 0;
/**
* Moves a part to a new location as the result of a drag/drop
* operation within this presentation.
*
* @param toMove a part that already belongs to this presentation
* @param cookie a drop cookie returned by <code>StackPresentation#dragOver</code>
* @since 3.1
*/
virtual void MovePart(IPresentablePart::Pointer toMove, Object::Pointer cookie);
/**
* Brings the specified part to the foreground. This should not affect
* the current focus.
*
* @param toSelect the new active part (not null)
*/
virtual void SelectPart(IPresentablePart::Pointer toSelect) = 0;
/**
* This method is invoked whenever a part is dragged over the stack's control.
* It returns a StackDropResult if and only if the part may be dropped in this
* location.
*
* @param currentControl the control being dragged over
* @param location cursor location (display coordinates)
* @return a StackDropResult or null if the presentation does not have
* a drop target in this location.
*/
virtual StackDropResult::Pointer DragOver(QWidget* currentControl, const QPoint& location) = 0;
/**
* Instructs the presentation to display the system menu
*
*/
// virtual void ShowSystemMenu() = 0;
/**
* Instructs the presentation to display the pane menu
*/
// virtual void ShowPaneMenu() = 0;
/**
* Instructs the presentation to display a list of all parts in the stack, and
* allow the user to change the selection using the keyboard.
*/
virtual void ShowPartList();
/**
* Saves the state of this presentation to the given memento.
*
* @param context object that can be used to generate unique IDs for IPresentableParts (this
* may be a temporary object - the presentation should not keep any references to it)
* @param memento memento where the data will be saved
*/
virtual void SaveState(IPresentationSerializer* context, IMemento::Pointer memento);
/**
* Restores the state of this presentation to a previously saved state.
*
* @param context object that can be used to find IPresentableParts given string IDs (this
* may be a temporary object - the presentation should not keep any references to it)
* @param memento memento where the data will be saved
*/
virtual void RestoreState(IPresentationSerializer* context, IMemento::Pointer memento);
/**
* Returns the tab-key traversal order for the given <code>IPresentablePart</code>.
*
* @param part the part
* @return the tab-key traversal order
*/
virtual QList<QWidget*> GetTabList(IPresentablePart::Pointer part) = 0;
};
}
#endif /* BERRYSTACKPRESENTATION_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/services/berryIDisposable.h b/Plugins/org.blueberry.ui.qt/src/services/berryIDisposable.h
index 64c9054b9f..d1332c8656 100755
--- a/Plugins/org.blueberry.ui.qt/src/services/berryIDisposable.h
+++ b/Plugins/org.blueberry.ui.qt/src/services/berryIDisposable.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIDISPOSABLE_H_
#define BERRYIDISPOSABLE_H_
#include <org_blueberry_ui_qt_Export.h>
#include <berryObject.h>
#include <berryMacros.h>
namespace berry {
/**
* <p>
* The interface that should be implemented by services that make themselves
* available through the <code>IAdaptable</code> mechanism. This is the
* interface that drives the majority of services provided at the workbench
* level.
* </p>
* <p>
* A service has life-cycle. When the constructor completes, the service must be
* fully functional. When it comes time for the service to go away, then the
* service will receive a {@link #dispose()} call. At this point, the service
* must release all resources and detach all listeners. A service can only be
* disposed once; it cannot be reused.
* </p>
* <p>
* This interface has nothing to do with OSGi services.
* </p>
* <p>
* This interface can be extended or implemented by clients.
* </p>
*/
struct IDisposable : public virtual Object
{
- berryObjectMacro(berry::IDisposable)
+ berryObjectMacro(berry::IDisposable);
~IDisposable() override;
/**
* Disposes of this service. All resources must be freed. All listeners must
* be detached. Dispose will only be called once during the life cycle of a
* service.
*/
virtual void Dispose() = 0;
};
}
#endif /* BERRYIDISPOSABLE_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/services/berryIEvaluationReference.h b/Plugins/org.blueberry.ui.qt/src/services/berryIEvaluationReference.h
index e6c1ac01e1..09608163c0 100644
--- a/Plugins/org.blueberry.ui.qt/src/services/berryIEvaluationReference.h
+++ b/Plugins/org.blueberry.ui.qt/src/services/berryIEvaluationReference.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEVALUATIONREFERENCE_H
#define BERRYIEVALUATIONREFERENCE_H
#include "internal/berryIEvaluationResultCache.h"
namespace berry {
struct IPropertyChangeListener;
/**
* A token representing a core expression and property change listener currently
* working in the <code>IEvaluationService</code>.
*
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
struct IEvaluationReference : public virtual IEvaluationResultCache
{
- berryObjectMacro(berry::IEvaluationReference)
+ berryObjectMacro(berry::IEvaluationReference);
/**
* The property change listener associated with the evaluated expression.
*
* @return the listener for updates.
*/
virtual IPropertyChangeListener* GetListener() const = 0;
/**
* The property used in change notifications.
*
* @return the property name.
*/
virtual QString GetProperty() const = 0;
};
}
#endif // BERRYIEVALUATIONREFERENCE_H
diff --git a/Plugins/org.blueberry.ui.qt/src/services/berryIEvaluationService.h b/Plugins/org.blueberry.ui.qt/src/services/berryIEvaluationService.h
index 42be600949..7f6c9d9f13 100644
--- a/Plugins/org.blueberry.ui.qt/src/services/berryIEvaluationService.h
+++ b/Plugins/org.blueberry.ui.qt/src/services/berryIEvaluationService.h
@@ -1,209 +1,209 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEVALUATIONSERVICE_H
#define BERRYIEVALUATIONSERVICE_H
#include <berryIServiceWithSources.h>
#include <org_blueberry_ui_qt_Export.h>
namespace berry {
struct IEvaluationContext;
struct IEvaluationReference;
struct IPropertyChangeListener;
class Expression;
/**
* Evaluate a core expression against the workbench application context and
* report updates using a Boolean property. Clients supply an
* <code>IPropertyChangeListener</code> that will be notified as changes
* occur.
* <p>
* This can be used to implement core expressions in client extension points
* similar to the &lt;enabledWhen&gt; of
* <code>org.blueberry.ui.handlers/handler</code> elements.
* </p>
* <p>
* The service will fire <code>TRUE</code> and
* <code>FALSE</code> for the oldValue and newValue in the property
* change events.
* </p>
* <p>
* Adding the evaluation listener will fire one change with oldValue=<code>null</code>
* and newValue=&quot;evaluated expression&quot;. Remove the
* <code>IEvaluationReference</code> will fire one change with
* oldValue=&quot;last evaluated value&quot; and newValue=<code>null</code>.
* </p>
* <p>
* Adding a service listener will fire the {@link #PROP_NOTIFYING} property
* change event with newValue=<code>TRUE</code> when a source change
* causes expression evaluations to update and another {@link #PROP_NOTIFYING}
* property change event with newValue=<code>FALSE</code> when the
* changes that started with a specific source change have finished. The
* {@link #PROP_NOTIFYING} change events will not be fired for source changes
* caused by the outer most recalculations.
* </p>
* <p>
* Variable sources can be provided to this service using the <code>org.blueberry.ui.services</code>
* Extension Point. This makes the available to &lt;with/&gt; expressions.
* </p>
* <p>
* This service can be acquired from your service locator:
* <pre>
* IEvaluationService::Pointer service = GetSite()->GetService(IEvaluationService::GetManifestName());
* </pre>
* <ul>
* <li>This service is available globally.</li>
* </ul>
* </p>
*
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI_QT IEvaluationService : public IServiceWithSources
{
- berryObjectMacro(berry::IEvaluationService)
+ berryObjectMacro(berry::IEvaluationService);
/**
* A general property that can be used.
*/
static const QString RESULT; // = "org.blueberry.ui.services.result";
/**
* The property used to notify any service listeners.
*/
static const QString PROP_NOTIFYING; // = "org.blueberry.ui.services.notifying";
/**
* When a source change starts recalculating expressions the
* {@link #PROP_NOTIFYING} property change is fired with the newValue=<code>TRUE</code>.
* This property is not fired for any source changes caused by the outer
* recalculations.
* <p>
* <b>Note:</b> listeners should be removed when no longer necessary. If
* not, they will be removed when the IServiceLocator used to acquire this
* service is disposed.
* </p>
*
* @param listener
* The listener to be notified. Must not be <code>null</code>.
* Has no effect if the listener has already been added.
*/
virtual void AddServiceListener(IPropertyChangeListener* listener) = 0;
/**
* Remove the listener for {@link #PROP_NOTIFYING} property changes.
*
* @param listener
* The listener to remove. Must not be <code>null</code>. Has
* no effect if the listener is not currently registered.
*/
virtual void RemoveServiceListener(IPropertyChangeListener* listener) = 0;
/**
* Add a listener that can be notified when the workbench application
* context causes the expression evaluation value to change.
* <p>
* <b>Note:</b> listeners should be removed when no longer necessary. If
* not, they will be removed when the IServiceLocator used to acquire this
* service is disposed.
* </p>
*
* @param expression
* the core expression to evaluate.
* @param listener
* the listener to be notified.
* @param property
* the property contained in the notification
* @return a token that can be used to remove this listener.
* {@link #removeEvaluationListener(IEvaluationReference)}
*/
virtual SmartPointer<IEvaluationReference> AddEvaluationListener(
const SmartPointer<Expression>& expression,
IPropertyChangeListener* listener,
const QString& property) = 0;
/**
* Re-add a property change listener that has already been removed by
* {@link #removeEvaluationListener(IEvaluationReference)}.
* <p>
* It will only accept IEvaluationReferences returned from a previous call
* to
* {@link #addEvaluationListener(Expression, IPropertyChangeListener, String)}
* on this service.
* </p>
* <p>
* <b>Note:</b> references should be removed when no longer necessary. If
* not, they will be removed when the IServiceLocator used to acquire this
* service is disposed.
* </p>
*
* @param ref
* The listener to re-add.
* @see #removeEvaluationListener(IEvaluationReference)
*/
virtual void AddEvaluationReference(const SmartPointer<IEvaluationReference>& ref) = 0;
/**
* Remove the listener represented by the evaluation reference.
*
* @param ref
* the reference to be removed.
*/
virtual void RemoveEvaluationListener(const SmartPointer<IEvaluationReference>& ref) = 0;
/**
* Get an IEvaluationContext that contains the current state of the
* workbench application context. This context changes with the application
* state, but becomes invalid when the global current selection changes.
* <p>
* Note: This context should not be modified.
* </p>
*
* @return the latest context.
* @see ISources#ACTIVE_CURRENT_SELECTION_NAME
*/
virtual SmartPointer<IEvaluationContext> GetCurrentState() const = 0;
/**
* Request that this service re-evaluate all registered core expressions
* that contain a property tester for the given property name. This will
* fire a {@link #PROP_NOTIFYING} property change event to service
* listeners.
* <p>
* Notes:
* <ul>
* <li>the property must be able to return the new value before this
* re-evaluation is requested</li>
* <li>limit calls to this method to avoid unnecessary churn</li>
* <li>A re-evaluation that does not change the value of an expression will
* not fire a property change event</li>
* </ul>
* </p>
*
* @param propertyName
* The fully qualified property name, like
* <code>org.eclipse.core.resources.name</code>. Must not be
* <code>null</code>.
*/
virtual void RequestEvaluation(const QString& propertyName) = 0;
};
}
Q_DECLARE_INTERFACE(berry::IEvaluationService, "org.blueberry.ui.IEvaluationService")
#endif // BERRYIEVALUATIONSERVICE_H
diff --git a/Plugins/org.blueberry.ui.qt/src/services/berryINestable.h b/Plugins/org.blueberry.ui.qt/src/services/berryINestable.h
index 604796cfe7..ea16233c61 100755
--- a/Plugins/org.blueberry.ui.qt/src/services/berryINestable.h
+++ b/Plugins/org.blueberry.ui.qt/src/services/berryINestable.h
@@ -1,76 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYINESTABLE_H_
#define BERRYINESTABLE_H_
#include <org_blueberry_ui_qt_Export.h>
#include <berryObject.h>
#include <berryMacros.h>
namespace berry {
/**
* </p>
* A service which can appear on a component which is wholly contained with
* another component. The component on which it appears can be active or
* inactive -- depending on the state of the application. For example, a
* workbench part is a component which appears within a workbench window. This
* workbench part can either be active or inactive, depending on what the user
* is doing.
* </p>
* <p>
* Services implement this interface, and are then notified by the component
* when the activation changes. It is the responsibility of the component to
* notify such services when the activation changes.
* </p>
* <p>
* This class is not intended for use outside of the
* <code>org.blueberry.ui.workbench</code> plug-in.
* </p>
* <p>
* <strong>PROVISIONAL</strong>. This class or interface has been added as part
* of a work in progress. There is a guarantee neither that this API will work
* nor that it will remain the same. Please do not use this API without
* consulting with the Platform/UI team.
* </p>
* <p>
* This class should eventually move to <code>org.blueberry.ui.services</code>.
* </p>
*/
struct BERRY_UI_QT INestable : public virtual Object
{
- berryObjectMacro(berry::INestable)
+ berryObjectMacro(berry::INestable);
~INestable() override;
/**
* Notifies this service that the component within which it exists has
* become active. The service should modify its state as appropriate.
*
*/
virtual void Activate() = 0;
/**
* Notifies this service that the component within which it exists has
* become inactive. The service should modify its state as appropriate.
*/
virtual void Deactivate() = 0;
};
}
#endif /* BERRYINESTABLE_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/services/berryIServiceLocator.h b/Plugins/org.blueberry.ui.qt/src/services/berryIServiceLocator.h
index bfaf0d1328..3467b50bd2 100755
--- a/Plugins/org.blueberry.ui.qt/src/services/berryIServiceLocator.h
+++ b/Plugins/org.blueberry.ui.qt/src/services/berryIServiceLocator.h
@@ -1,103 +1,103 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISERVICELOCATOR_H_
#define BERRYISERVICELOCATOR_H_
#include <org_blueberry_ui_qt_Export.h>
#include <berryObject.h>
#include <berryMacros.h>
#include <berryLog.h>
#include <QObject>
#include <typeinfo>
namespace berry {
/**
* <p>
* A component with which one or more services are registered. The services can
* be retrieved from this locator using the service type. For example:
* </p>
*
* <pre>
* IHandlerService* service = workbenchWindow->GetService<IHandlerService>();
* </pre>
*
* <p>
* This interface is not to be implemented or extended by clients.
* </p>
*/
struct BERRY_UI_QT IServiceLocator : public virtual Object
{
- berryObjectMacro(berry::IServiceLocator, Object)
+ berryObjectMacro(berry::IServiceLocator, Object);
~IServiceLocator() override;
/**
* Retrieves the service corresponding to the given API.
*
* @tparam S
* This is the interface that the service implements. Must not be
* <code>null</code>.
* @return The service, or <code>null</code> if no such service could be
* found.
*/
template<class S>
S* GetService()
{
const char* typeName = qobject_interface_iid<S*>();
if (typeName == nullptr)
{
BERRY_WARN << "Error getting service: Cannot get the interface id for type '" << Reflection::GetClassName<S>()
<< "'. It is probably missing a Q_DECLARE_INTERFACE macro in its header.";
return nullptr;
}
Object* obj = this->GetService(typeName);
S* service = dynamic_cast<S*>(obj);
if (obj != nullptr && service == nullptr)
{
BERRY_WARN << "Error getting service: Class '" << obj->GetClassName() << "' cannot be cast to service interface "
<< "'" << Reflection::GetClassName<S>() << "'";
}
return service;
}
/**
* Whether this service exists within the scope of this service locator.
* This does not include looking for the service within the scope of the
* parents. This method can be used to determine whether a particular
* service supports nesting in this scope.
*
* @tparam S
* This is the interface that the service implements. Must not be
* <code>null</code>.
* @return <code>true</code> iff the service locator can find a service
* for the given interface; <code>false</code> otherwise.
*/
template<class S>
bool HasService() const
{
return this->HasService(qobject_interface_iid<S*>());
}
virtual Object* GetService(const QString& api) = 0;
virtual bool HasService(const QString& api) const = 0;
};
}
#endif /* BERRYISERVICELOCATOR_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/services/berryIServiceWithSources.h b/Plugins/org.blueberry.ui.qt/src/services/berryIServiceWithSources.h
index 68227e9a54..c29c247d06 100755
--- a/Plugins/org.blueberry.ui.qt/src/services/berryIServiceWithSources.h
+++ b/Plugins/org.blueberry.ui.qt/src/services/berryIServiceWithSources.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISERVICEWITHSOURCES_H_
#define BERRYISERVICEWITHSOURCES_H_
#include "berryIDisposable.h"
namespace berry {
struct ISourceProvider;
/**
* <p>
* A service that responds to changes in one or more sources. These sources can
* be plugged into the service. Sources represent a common event framework for
* services.
* </p>
* <p>
* Clients must not extend or implement.
* </p>
*
*/
struct IServiceWithSources : public IDisposable {
- berryObjectMacro(berry::IServiceWithSources)
+ berryObjectMacro(berry::IServiceWithSources);
~IServiceWithSources() override;
/**
* Adds a source provider to this service. A source provider will notify the
* service when the source it provides changes. An example of a source might
* be an active editor or the current selection. This amounts to a pluggable
* state tracker for the service.
*
* @param provider
* The provider to add; must not be <code>null</code>.
*/
virtual void AddSourceProvider(const SmartPointer<ISourceProvider>& provider) = 0;
/**
* Removes a source provider from this service. Most of the time, this
* method call is not required as source providers typically share the same
* life span as the workbench itself.
*
* @param provider
* The provider to remove; must not be <code>null</code>.
*/
virtual void RemoveSourceProvider(const SmartPointer<ISourceProvider>& provider) = 0;
};
}
#endif /* BERRYISERVICEWITHSOURCES_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/services/berryISourceProviderService.h b/Plugins/org.blueberry.ui.qt/src/services/berryISourceProviderService.h
index 6a0c339276..c6d096ba9a 100644
--- a/Plugins/org.blueberry.ui.qt/src/services/berryISourceProviderService.h
+++ b/Plugins/org.blueberry.ui.qt/src/services/berryISourceProviderService.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISOURCEPROVIDERSERVICE_H
#define BERRYISOURCEPROVIDERSERVICE_H
#include "org_blueberry_ui_qt_Export.h"
#include "berryObject.h"
#include <QList>
namespace berry {
template<class T> class SmartPointer;
struct ISourceProvider;
/**
* <p>
* A service from which all of the source providers can be retrieved.
* </p>
* <p>
* This service can be acquired from your service locator:
* <pre>
* ISourceProviderService* service = GetSite()->GetService<ISourceProviderService>();
* </pre>
* <ul>
* <li>This service is available globally.</li>
* </ul>
* </p>
*
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*
* @see IEvaluationService
*/
struct BERRY_UI_QT ISourceProviderService : public virtual Object
{
- berryObjectMacro(berry::ISourceProviderService)
+ berryObjectMacro(berry::ISourceProviderService);
~ISourceProviderService() override;
/**
* Retrieves a source provider providing the given source. This is used by
* clients who only need specific sources.
*
* @param sourceName
* The name of the source; must not be <code>null</code>.
* @return A source provider which provides the request source, or
* <code>null</code> if no such source exists.
* @see ISources
*/
virtual SmartPointer<ISourceProvider> GetSourceProvider(const QString& sourceName) const = 0;
/**
* Retrieves all of the source providers registered with this service at the
* time of this call.
* <p>
* <code>IEvaluationService</code> can be used
* to receive notifications about source variable changes and to
* evaluate core expressions against source providers.
* </p>
*
* @return The source providers registered with this service. This value may be empty.
*/
virtual QList<SmartPointer<ISourceProvider> > GetSourceProviders() const = 0;
};
}
Q_DECLARE_INTERFACE(berry::ISourceProviderService, "org.blueberry.ui.ISourceProviderService")
#endif // BERRYISOURCEPROVIDERSERVICE_H
diff --git a/Plugins/org.blueberry.ui.qt/src/testing/berryITestHarness.h b/Plugins/org.blueberry.ui.qt/src/testing/berryITestHarness.h
index cbd878bf25..5375dda789 100644
--- a/Plugins/org.blueberry.ui.qt/src/testing/berryITestHarness.h
+++ b/Plugins/org.blueberry.ui.qt/src/testing/berryITestHarness.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYITESTHARNESS_H_
#define BERRYITESTHARNESS_H_
#include <berryObject.h>
#include <berryMacros.h>
#include <org_blueberry_ui_qt_Export.h>
#include <QtPlugin>
namespace berry {
/**
* Represents an arbitrary test harness.
*
* @since 3.0
*/
struct BERRY_UI_QT ITestHarness : public virtual Object
{
- berryObjectMacro(berry::ITestHarness)
+ berryObjectMacro(berry::ITestHarness);
/**
* Runs the tests.
*/
virtual void RunTests() = 0;
};
}
Q_DECLARE_INTERFACE(berry::ITestHarness, "org.blueberry.ui.ITestHarness")
#endif /* BERRYITESTHARNESS_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/util/berryISafeRunnableRunner.h b/Plugins/org.blueberry.ui.qt/src/util/berryISafeRunnableRunner.h
index 694a00c155..a2b40d3c6b 100644
--- a/Plugins/org.blueberry.ui.qt/src/util/berryISafeRunnableRunner.h
+++ b/Plugins/org.blueberry.ui.qt/src/util/berryISafeRunnableRunner.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYISAFERUNNABLERUNNER_H_
#define BERRYISAFERUNNABLERUNNER_H_
#include <org_blueberry_ui_qt_Export.h>
#include <berryObject.h>
#include <berryMacros.h>
#include <berryISafeRunnable.h>
namespace berry {
/**
* Runs a safe runnables.
* <p>
* Clients may provide their own implementation to change
* how safe runnables are run from within the workbench.
* </p>
*
* @see SafeRunnable#GetRunner()
* @see SafeRunnable#SetRunner(ISafeRunnableRunner::Pointer)
* @see SafeRunnable#Run(ISafeRunnable::Pointer)
*/
struct BERRY_UI_QT ISafeRunnableRunner : public Object
{
public:
- berryObjectMacro(berry::ISafeRunnableRunner)
+ berryObjectMacro(berry::ISafeRunnableRunner);
~ISafeRunnableRunner() override;
/**
* Runs the runnable. All <code>ISafeRunnableRunners</code> must catch any exception
* thrown by the <code>ISafeRunnable</code> and pass the exception to
* <code>ISafeRunnable::HandleException()</code>.
* @param code the code executed as a save runnable
*
* @see SafeRunnable#Run(ISafeRunnable::Pointer)
*/
virtual void Run(ISafeRunnable::Pointer code) = 0;
};
}
#endif /* BERRYISAFERUNNABLERUNNER_H_ */
diff --git a/Plugins/org.mitk.core.ext/src/mitkIInputDevice.h b/Plugins/org.mitk.core.ext/src/mitkIInputDevice.h
index 18bb978df6..aacf2b8093 100644
--- a/Plugins/org.mitk.core.ext/src/mitkIInputDevice.h
+++ b/Plugins/org.mitk.core.ext/src/mitkIInputDevice.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKIINPUTDEVICE_H_
#define MITKIINPUTDEVICE_H_
#include <berryObject.h>
#include <berryMacros.h>
#include <vector>
namespace mitk
{
/**
* An input device provides a method to register and unregister itself. Meaning <br>
* for example adding listeners and instianciate classes necessary to use the input device.
*
* @noimplement This interface is not intended to be implemented by clients.
* @ingroup org_mitk_core_ext
*/
struct IInputDevice : public berry::Object
{
- berryObjectMacro(mitk::IInputDevice)
+ berryObjectMacro(mitk::IInputDevice);
/**
* Register the input device at one or more instances.
*/
virtual bool RegisterInputDevice() = 0;
/**
* Unregister the input device at one or more instances.
*/
virtual bool UnRegisterInputDevice() = 0;
~IInputDevice() override {}
}; // end struct IInputDevice
} // end namespace mitk
Q_DECLARE_INTERFACE(mitk::IInputDevice, "org.mitk.IInputDevice")
#endif /*MITKIINPUTDEVICE_H_*/
diff --git a/Plugins/org.mitk.core.ext/src/mitkIInputDeviceDescriptor.h b/Plugins/org.mitk.core.ext/src/mitkIInputDeviceDescriptor.h
index 6e19ae1279..d3e2a8971f 100644
--- a/Plugins/org.mitk.core.ext/src/mitkIInputDeviceDescriptor.h
+++ b/Plugins/org.mitk.core.ext/src/mitkIInputDeviceDescriptor.h
@@ -1,86 +1,86 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKIINPUTDEVICEDESCRIPTOR_H_
#define MITKIINPUTDEVICEDESCRIPTOR_H_
#include <berryObject.h>
#include <berryMacros.h>
#include "mitkIInputDevice.h"
namespace mitk
{
/**
* This is an input device descriptor. It provides a "description" of a given
* input device, so that the input device can later be constructed and registered.
* <p>
* The input device registry provides facilities to map from an extension
* to a IInputDeviceDescriptor.
* </p>
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*
* @see mitk::IInputDeviceRegistry
* @ingroup org_mitk_core_ext
*/
struct IInputDeviceDescriptor : public berry::Object
{
- berryObjectMacro(mitk::IInputDeviceDescriptor)
+ berryObjectMacro(mitk::IInputDeviceDescriptor);
/**
* Creates an instance of an input device defined in the descriptor.
*
* @return the input device
*/
virtual IInputDevice::Pointer CreateInputDevice() = 0;
/**
* Returns the description of this input device.
*
* @return the description
*/
virtual QString GetDescription() const = 0;
/**
* Returns the id of this input device.
*
* @return the id
*/
virtual QString GetID() const = 0;
/**
* Returns the name of this input device.
*
* @return the name
*/
virtual QString GetName() const = 0;
// /**
// * Returns the descriptor for the icon to show for this view.
// */
//virtual SmartPointer<ImageDescriptor> GetImageDescriptor() const = 0;
/**
* Equals this class with the given parameter.
*
* @param object the object for the equation
* @return true, if the objects are equal :: false, if they differ in any way
*/
bool operator==(const Object* object) const override = 0;
}; // end struct IInputDeviceDescriptor
} //end namespace mitk
#endif /*MITKIINPUTDEVICEDESCRIPTOR_H_*/
diff --git a/Plugins/org.mitk.core.services/src/mitkIDataStorageReference.h b/Plugins/org.mitk.core.services/src/mitkIDataStorageReference.h
index a60853185e..17a5755440 100644
--- a/Plugins/org.mitk.core.services/src/mitkIDataStorageReference.h
+++ b/Plugins/org.mitk.core.services/src/mitkIDataStorageReference.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKIDATASTORAGEREFERENCE_H_
#define MITKIDATASTORAGEREFERENCE_H_
#include <berryObject.h>
#include <berryMacros.h>
#include <org_mitk_core_services_Export.h>
#include <mitkDataStorage.h>
namespace mitk
{
/**
* \ingroup org_mitk_core_services
*/
struct MITK_CORE_SERVICES_PLUGIN IDataStorageReference : public berry::Object
{
- berryObjectMacro(mitk::IDataStorageReference)
+ berryObjectMacro(mitk::IDataStorageReference);
virtual DataStorage::Pointer GetDataStorage() const = 0;
virtual bool IsDefault() const = 0;
virtual QString GetLabel() const = 0;
virtual void SetLabel(const QString& label) = 0;
bool operator==(const berry::Object* o) const override = 0;
};
}
#endif /*MITKIDATASTORAGEREFERENCE_H_*/
diff --git a/Plugins/org.mitk.gui.common/src/mitkDataStorageEditorInput.h b/Plugins/org.mitk.gui.common/src/mitkDataStorageEditorInput.h
index d7f1c48e9e..a7d5a39320 100644
--- a/Plugins/org.mitk.gui.common/src/mitkDataStorageEditorInput.h
+++ b/Plugins/org.mitk.gui.common/src/mitkDataStorageEditorInput.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKDATASTORAGEEDITORINPUT_H_
#define MITKDATASTORAGEEDITORINPUT_H_
#include <berryIEditorInput.h>
#include <berryIPersistableElement.h>
#include <mitkIDataStorageReference.h>
#include <org_mitk_gui_common_Export.h>
namespace mitk
{
/**
* \ingroup org_mitk_gui_common
*
* \brief An editor input based on a mitk::DataStorage.
*
* This editor input is usually used in render window editors inheriting from
* QmitkAbstractRenderEditor.
*/
class MITK_GUI_COMMON_PLUGIN DataStorageEditorInput : public berry::IEditorInput //, private berry::IPersistableElement
{
public:
- berryObjectMacro(DataStorageEditorInput)
+ berryObjectMacro(DataStorageEditorInput);
DataStorageEditorInput();
DataStorageEditorInput(IDataStorageReference::Pointer ref);
bool Exists() const override;
QString GetName() const override;
QString GetToolTipText() const override;
QIcon GetIcon() const override;
const berry::IPersistableElement* GetPersistable() const override;
Object* GetAdapter(const QString &adapterType) const override;
IDataStorageReference::Pointer GetDataStorageReference();
bool operator==(const berry::Object*) const override;
private:
//QString GetFactoryId() const;
//void SaveState(const berry::SmartPointer<berry::IMemento>& memento) const;
IDataStorageReference::Pointer m_DataStorageRef;
};
}
#endif /*MITKDATASTORAGEEDITORINPUT_H_*/
diff --git a/Plugins/org.mitk.gui.qt.application/files.cmake b/Plugins/org.mitk.gui.qt.application/files.cmake
index 9bf54191ea..4d661dfef3 100644
--- a/Plugins/org.mitk.gui.qt.application/files.cmake
+++ b/Plugins/org.mitk.gui.qt.application/files.cmake
@@ -1,87 +1,86 @@
set(SRC_CPP_FILES
QmitkAbstractDataNodeAction.cpp
QmitkCloseProjectAction.cpp
QmitkDataNodeColorAction.cpp
QmitkDataNodeColorMapAction.cpp
QmitkDataNodeComponentAction.cpp
QmitkDataNodeContextMenu.cpp
QmitkDataNodeGlobalReinitAction.cpp
QmitkDataNodeHideAllAction.cpp
QmitkDataNodeOpacityAction.cpp
QmitkDataNodeOpenInAction.cpp
QmitkDataNodeReinitAction.cpp
QmitkDataNodeRemoveAction.cpp
QmitkDataNodeShowDetailsAction.cpp
QmitkDataNodeShowSelectedNodesAction.cpp
QmitkDataNodeSurfaceRepresentationAction.cpp
QmitkDataNodeTextureInterpolationAction.cpp
QmitkDataNodeToggleVisibilityAction.cpp
QmitkDefaultDropTargetListener.cpp
QmitkFileExitAction.cpp
QmitkFileOpenAction.cpp
QmitkFileSaveAction.cpp
QmitkUndoAction.cpp
QmitkRedoAction.cpp
QmitkPreferencesDialog.cpp
QmitkStatusBar.cpp
)
set(INTERNAL_CPP_FILES
org_mitk_gui_qt_application_Activator.cpp
QmitkEditorsPreferencePage.cpp
QmitkGeneralPreferencePage.cpp
QmitkShowPreferencePageHandler.cpp
)
set(MOC_H_FILES
- src/QmitkAbstractDataNodeAction.h
src/QmitkCloseProjectAction.h
src/QmitkDataNodeColorAction.h
src/QmitkDataNodeColorMapAction.h
src/QmitkDataNodeComponentAction.h
src/QmitkDataNodeGlobalReinitAction.h
src/QmitkDataNodeContextMenu.h
src/QmitkDataNodeHideAllAction.h
src/QmitkDataNodeOpacityAction.h
src/QmitkDataNodeOpenInAction.h
src/QmitkDataNodeReinitAction.h
src/QmitkDataNodeRemoveAction.h
src/QmitkDataNodeShowDetailsAction.h
src/QmitkDataNodeShowSelectedNodesAction.h
src/QmitkDataNodeSurfaceRepresentationAction.h
src/QmitkDataNodeTextureInterpolationAction.h
src/QmitkDataNodeToggleVisibilityAction.h
src/QmitkFileExitAction.h
src/QmitkFileOpenAction.h
src/QmitkFileSaveAction.h
src/QmitkUndoAction.h
src/QmitkRedoAction.h
src/QmitkPreferencesDialog.h
src/internal/org_mitk_gui_qt_application_Activator.h
src/internal/QmitkEditorsPreferencePage.h
src/internal/QmitkGeneralPreferencePage.h
src/internal/QmitkShowPreferencePageHandler.h
)
set(UI_FILES
src/QmitkPreferencesDialog.ui
)
set(CACHED_RESOURCE_FILES
plugin.xml
)
set(QRC_FILES
resources/resources.qrc
)
set(CPP_FILES )
foreach(file ${SRC_CPP_FILES})
set(CPP_FILES ${CPP_FILES} src/${file})
endforeach(file ${SRC_CPP_FILES})
foreach(file ${INTERNAL_CPP_FILES})
set(CPP_FILES ${CPP_FILES} src/internal/${file})
endforeach(file ${INTERNAL_CPP_FILES})
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkStatusBar.h b/Plugins/org.mitk.gui.qt.application/src/QmitkStatusBar.h
index 280c169aee..a0bf089128 100755
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkStatusBar.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkStatusBar.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QMITKSTATUSBAR_H
#define QMITKSTATUSBAR_H
#include <mitkStatusBarImplementation.h>
#include <mitkCommon.h>
#include <QStatusBar>
#include <org_mitk_gui_qt_application_Export.h>
#include <QLabel>
/**
* \ingroup org_mitk_gui_qt_application
*
* \brief QT-Toolkit/GUI dependent class that provides to send a Message to the QT's StatusBar
*
* A delay time can be set.
*
* All mitk-classes will call this class for output:
* mitk::StatusBar::GetInstance();
*/
class MITK_QT_APP QmitkStatusBar : public mitk::StatusBarImplementation
{
public:
- mitkClassMacro(QmitkStatusBar, mitk::StatusBarImplementation)
+ mitkClassMacro(QmitkStatusBar, mitk::StatusBarImplementation);
//##Documentation
//##@brief Constructor;
//## holds param instance internaly and connects this to the mitkStatusBar
QmitkStatusBar(QStatusBar* instance);
//##Documentation
//##@brief Destructor
~QmitkStatusBar() override;
//##Documentation
//## @brief Send a string to the applications StatusBar (QStatusBar).
void DisplayText(const char* t) override;
void DisplayText(const char* t, int ms) override;
//##Documentation
//## @brief Send a string as an error message to StatusBar.
//## The implementation calls DisplayText()
void DisplayErrorText(const char *t) override { this->DisplayText(t); };
void DisplayWarningText(const char *t) override { this->DisplayText(t); };
void DisplayWarningText(const char *t, int ms) override { this->DisplayText(t, ms); };
void DisplayGenericOutputText(const char *t) override {this->DisplayText(t);}
void DisplayDebugText(const char *t) override { this->DisplayText(t); };
void DisplayGreyValueText(const char *t) override;
//##Documentation
//## @brief removes any temporary message being shown.
void Clear() override;
//##Documentation
//## @brief Set the QSizeGrip of the window
//## (the triangle in the lower right Windowcorner for changing the size)
//## to enabled or disabled
void SetSizeGripEnabled(bool enable) override;
private:
//static Pointer m_Instance;
QStatusBar* m_StatusBar;
QLabel* m_GreyValueLabel;
};
#endif /* define QMITKSTATUSBAR_H */
diff --git a/Plugins/org.mitk.gui.qt.common.legacy/src/internal/QmitkFunctionalityUtil.h b/Plugins/org.mitk.gui.qt.common.legacy/src/internal/QmitkFunctionalityUtil.h
index c59c55b8bb..14c7521f6f 100644
--- a/Plugins/org.mitk.gui.qt.common.legacy/src/internal/QmitkFunctionalityUtil.h
+++ b/Plugins/org.mitk.gui.qt.common.legacy/src/internal/QmitkFunctionalityUtil.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QMITKFUNCTIONALITYUTIL_H
#define QMITKFUNCTIONALITYUTIL_H
#include <berryISelectionProvider.h>
class QmitkFunctionality;
#include <mitkDataNode.h>
#include <mitkDataNodeSelection.h>
///
/// Internal class for selection providing
///
class QmitkFunctionalitySelectionProvider: public berry::ISelectionProvider
{
public:
///
/// Creates smartpointer typedefs
///
- berryObjectMacro(QmitkFunctionalitySelectionProvider)
+ berryObjectMacro(QmitkFunctionalitySelectionProvider);
QmitkFunctionalitySelectionProvider(QmitkFunctionality* _Functionality);
~QmitkFunctionalitySelectionProvider() override;
//# ISelectionProvider methods
///
/// \see ISelectionProvider::AddSelectionChangedListener()
///
void AddSelectionChangedListener(berry::ISelectionChangedListener* listener) override;
///
/// \see ISelectionProvider::GetSelection()
///
berry::ISelection::ConstPointer GetSelection() const override;
///
/// \see ISelectionProvider::RemoveSelectionChangedListener()
///
void RemoveSelectionChangedListener(berry::ISelectionChangedListener* listener) override;
///
/// \see ISelectionProvider::SetSelection()
///
void SetSelection(const berry::ISelection::ConstPointer& selection) override;
///
/// Sends the nodes as selected to the workbench
///
void FireNodesSelected(const std::vector<mitk::DataNode::Pointer>& nodes );
protected:
///
/// the functionality parent
///
QmitkFunctionality* m_Functionality;
///
/// Holds the current selection (selection made by m_Functionality !!!)
///
mitk::DataNodeSelection::ConstPointer m_CurrentSelection;
///
/// The selection events other parts can listen too
///
berry::ISelectionChangedListener::Events m_SelectionEvents;
};
#endif // QMITKFUNCTIONALITYUTIL_H
diff --git a/Plugins/org.mitk.gui.qt.common/files.cmake b/Plugins/org.mitk.gui.qt.common/files.cmake
index 67e72c7578..0bde8b2087 100755
--- a/Plugins/org.mitk.gui.qt.common/files.cmake
+++ b/Plugins/org.mitk.gui.qt.common/files.cmake
@@ -1,72 +1,71 @@
set(SRC_CPP_FILES
QmitkAbstractMultiWidgetEditor.cpp
QmitkAbstractRenderEditor.cpp
QmitkAbstractView.cpp
QmitkDataNodeSelectionProvider.cpp
QmitkDnDFrameWidget.cpp
QmitkSelectionServiceConnector.cpp
QmitkSliceNavigationListener.cpp
QmitkSingleNodeSelectionWidget.cpp
QmitkNodeSelectionDialog.cpp
QmitkAbstractNodeSelectionWidget.cpp
QmitkMultiNodeSelectionWidget.cpp
QmitkMultiWidgetDecorationManager.cpp
QmitkNodeSelectionPreferenceHelper.cpp
QmitkNodeSelectionButton.cpp
QmitkSimpleTextOverlayWidget.cpp
)
set(INTERNAL_CPP_FILES
QmitkCommonActivator.cpp
QmitkDataNodeItemModel.cpp
QmitkDataNodeSelection.cpp
QmitkViewCoordinator.cpp
QmitkNodeSelectionConstants.cpp
QmitkNodeSelectionPreferencePage.cpp
QmitkNodeSelectionListItemWidget.cpp
)
set(UI_FILES
src/QmitkSingleNodeSelectionWidget.ui
src/QmitkMultiNodeSelectionWidget.ui
src/QmitkNodeSelectionDialog.ui
src/internal/QmitkNodeSelectionPreferencePage.ui
src/internal/QmitkNodeSelectionListItemWidget.ui
)
set(MOC_H_FILES
src/QmitkAbstractMultiWidgetEditor.h
src/QmitkAbstractRenderEditor.h
src/QmitkDnDFrameWidget.h
src/QmitkSelectionServiceConnector.h
src/QmitkSliceNavigationListener.h
- src/ImporterUtil.h
src/QmitkSingleNodeSelectionWidget.h
src/QmitkNodeSelectionDialog.h
src/QmitkAbstractNodeSelectionWidget.h
src/QmitkMultiNodeSelectionWidget.h
src/QmitkNodeSelectionButton.h
src/QmitkSimpleTextOverlayWidget.h
src/internal/QmitkCommonActivator.h
src/internal/QmitkNodeSelectionPreferencePage.h
src/internal/QmitkNodeSelectionListItemWidget.h
)
set(CACHED_RESOURCE_FILES
plugin.xml
resources/times.svg
)
set(QRC_FILES
resources/common.qrc
)
set(CPP_FILES )
foreach(file ${SRC_CPP_FILES})
set(CPP_FILES ${CPP_FILES} src/${file})
endforeach(file ${SRC_CPP_FILES})
foreach(file ${INTERNAL_CPP_FILES})
set(CPP_FILES ${CPP_FILES} src/internal/${file})
endforeach(file ${INTERNAL_CPP_FILES})
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractMultiWidgetEditor.h b/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractMultiWidgetEditor.h
index 435b6b5b22..3d2bcbd669 100644
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractMultiWidgetEditor.h
+++ b/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractMultiWidgetEditor.h
@@ -1,139 +1,139 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QMITKABSTRACTMULTIWIDGETEDITOR_H
#define QMITKABSTRACTMULTIWIDGETEDITOR_H
#include <org_mitk_gui_qt_common_Export.h>
// org mitk gui qt common plugin
#include <QmitkAbstractRenderEditor.h>
// mitk core
#include <mitkInteractionSchemeSwitcher.h>
// berry
#include <berryIPartListener.h>
// c++
#include <memory>
class QmitkAbstractMultiWidget;
class QmitkLevelWindowWidget;
class MITK_QT_COMMON QmitkAbstractMultiWidgetEditor : public QmitkAbstractRenderEditor, public berry::IPartListener
{
Q_OBJECT
public:
- berryObjectMacro(QmitkAbstractMultiWidgetEditor, QmitkAbstractRenderEditor, IPartListener)
+ berryObjectMacro(QmitkAbstractMultiWidgetEditor, QmitkAbstractRenderEditor, IPartListener);
static const QString EDITOR_ID;
QmitkAbstractMultiWidgetEditor();
virtual ~QmitkAbstractMultiWidgetEditor() override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
virtual QmitkRenderWindow* GetActiveQmitkRenderWindow() const override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
virtual QHash<QString, QmitkRenderWindow*> GetQmitkRenderWindows() const override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
virtual QmitkRenderWindow* GetQmitkRenderWindow(const QString& id) const override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
virtual QmitkRenderWindow* GetQmitkRenderWindow(const mitk::BaseRenderer::ViewDirection& viewDirection) const override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
virtual mitk::Point3D GetSelectedPosition(const QString& id = QString()) const override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
virtual void SetSelectedPosition(const mitk::Point3D& pos, const QString& id = QString()) override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
virtual void EnableDecorations(bool enable, const QStringList& decorations = QStringList()) override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
virtual bool IsDecorationEnabled(const QString& decoration) const override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
virtual QStringList GetDecorations() const override;
/**
* @brief Overridden from berry::IPartListener
*/
virtual berry::IPartListener::Events::Types GetPartEventTypes() const override;
/**
* @brief Overridden from berry::IPartListener
*/
virtual void PartOpened(const berry::IWorkbenchPartReference::Pointer& partRef) override;
/**
* @brief Overridden from berry::IPartListener
*/
virtual void PartClosed(const berry::IWorkbenchPartReference::Pointer& partRef) override;
/**
* @brief Retrieve a QmitkRenderWindow by its index.
*/
virtual QmitkRenderWindow* GetQmitkRenderWindowByIndex(int index) const;
/**
* @brief Retrieve a QmitkRenderWindow by the row and column position.
*/
virtual QmitkRenderWindow* GetQmitkRenderWindowByIndex(int row, int column) const;
/**
* @brief Set the current multi widget of this editor.
*/
virtual void SetMultiWidget(QmitkAbstractMultiWidget* multiWidget);
/**
* @brief Return the current multi widget of this editor.
*/
virtual QmitkAbstractMultiWidget* GetMultiWidget() const;
/**
* @brief Return the number of rows of the underlying multi widget.
*/
virtual int GetRowCount() const;
/**
* @brief Return the number of columns of the underlying multi widget.
*/
virtual int GetColumnCount() const;
virtual QmitkLevelWindowWidget* GetLevelWindowWidget() const = 0;
public Q_SLOTS:
/**
* @brief A slot that can be called if the layout has been changed.
* This function will call the function 'SetLayout' of the multi widget where
* custom behavior can be implemented.
* Finally 'FirePropertyChange' is called to inform the workbench about an input change.
*/
virtual void OnLayoutSet(int row, int column);
virtual void OnSynchronize(bool synchronized);
virtual void OnInteractionSchemeChanged(mitk::InteractionSchemeSwitcher::InteractionScheme scheme);
private:
struct Impl;
std::unique_ptr<Impl> m_Impl;
};
#endif // QMITKABSTRACTMULTIWIDGETEDITOR_H
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractRenderEditor.h b/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractRenderEditor.h
index 6b53464b0b..104e7b1b60 100644
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractRenderEditor.h
+++ b/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractRenderEditor.h
@@ -1,155 +1,155 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QMITKABSTRACTRENDEREDITOR_H
#define QMITKABSTRACTRENDEREDITOR_H
#include <berryQtEditorPart.h>
#include <berryIBerryPreferences.h>
#include "mitkIRenderWindowPart.h"
#include <mitkIDataStorageReference.h>
#include <mitkDataStorage.h>
#include <org_mitk_gui_qt_common_Export.h>
class QmitkAbstractRenderEditorPrivate;
/**
* \ingroup org_mitk_gui_qt_common
*
* \brief A convenient base class for MITK render window BlueBerry Editors.
*
* QmitkAbstractRenderEditor provides several convenience methods that ease the introduction of
* a new editor for rendering a MITK DataStorage:
*
* <ol>
* <li> Access to the DataStorage (~ the shared data repository)
* <li> Access to and update notification for the editor's preferences
* <li> Default implementation of some mitk::IRenderWindowPart methods
* </ol>
*
* When inheriting from QmitkAbstractRenderEditor, you must implement the following methods:
* <ul>
* <li>void CreateQtPartControl(QWidget* parent)
* <li>void SetFocus()
* </ul>
*
* You may reimplement the following private virtual methods to be notified about certain changes:
* <ul>
* <li>void OnPreferencesChanged(const berry::IBerryPreferences*)
* </ul>
*
* \see IRenderWindowPart
* \see ILinkedRenderWindowPart
*/
class MITK_QT_COMMON QmitkAbstractRenderEditor : public berry::QtEditorPart,
public virtual mitk::IRenderWindowPart
{
Q_OBJECT
Q_INTERFACES(mitk::IRenderWindowPart)
public:
- berryObjectMacro(QmitkAbstractRenderEditor, QtEditorPart, mitk::IRenderWindowPart)
+ berryObjectMacro(QmitkAbstractRenderEditor, QtEditorPart, mitk::IRenderWindowPart);
QmitkAbstractRenderEditor();
~QmitkAbstractRenderEditor() override;
protected:
/**
* Initializes this editor by checking for a valid mitk::DataStorageEditorInput as <code>input</code>.
*
* \see berry::IEditorPart::Init
*/
void Init(berry::IEditorSite::Pointer site, berry::IEditorInput::Pointer input) override;
/**
* Get a reference to the DataStorage set by the editor input.
*/
virtual mitk::IDataStorageReference::Pointer GetDataStorageReference() const;
/**
* Get the DataStorage set by the editor input.
*/
virtual mitk::DataStorage::Pointer GetDataStorage() const;
/**
* Get the preferences for this editor.
*/
virtual berry::IPreferences::Pointer GetPreferences() const;
/**
* Get the RenderingManager used by this editor. This default implementation uses the
* global MITK RenderingManager provided by mitk::RenderingManager::GetInstance().
*
* \see mitk::IRenderWindowPart::GetRenderingManager
*/
mitk::IRenderingManager* GetRenderingManager() const override;
/**
* Request an update of this editor's render windows.
* This implementation calls mitk::IRenderingManager::RequestUpdate on the rendering
* manager interface returned by GetRenderingManager();
*
* \param requestType The type of render windows for which an update is requested.
*
* \see mitk::IRenderWindowPart::RequestUpdate
*/
void RequestUpdate(mitk::RenderingManager::RequestType requestType = mitk::RenderingManager::REQUEST_UPDATE_ALL) override;
/**
* Force an immediate update of this editor's render windows.
* This implementation calls mitk::IRenderingManager::ForceImmediateUpdate() on the rendering
* manager interface returned by GetRenderingManager();
*
* \param requestType The type of render windows for which an immedate update is forced.
*
* \see mitk::IRenderWindowPart::ForceImmediateUpdate
*/
void ForceImmediateUpdate(mitk::RenderingManager::RequestType requestType = mitk::RenderingManager::REQUEST_UPDATE_ALL) override;
/**
* Get the time navigation controller for this editor.
* This implementation returns the SliceNavigationController returned by the mitk::IRenderingManager::GetTimeNavigationController()
* method of the interface implementation returned by GetRenderingManager().
*
* \see mitk::IRenderingManager::GetTimeNavigationController
*/
mitk::SliceNavigationController* GetTimeNavigationController() const override;
/** \see berry::IEditorPart::DoSave */
void DoSave() override;
/** \see berry::IEditorPart::DoSaveAs */
void DoSaveAs() override;
/** \see berry::IEditorPart::IsDirty */
bool IsDirty() const override;
/** \see berry::IEditorPart::IsSaveAsAllowed */
bool IsSaveAsAllowed() const override;
private:
virtual void OnPreferencesChanged(const berry::IBerryPreferences*);
private:
QScopedPointer<QmitkAbstractRenderEditorPrivate> d;
};
#endif // QMITKABSTRACTRENDEREDITOR_H
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.cpp b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.cpp
index e98c808a83..312473eac9 100644
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.cpp
+++ b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.cpp
@@ -1,182 +1,222 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "QmitkNodeSelectionDialog.h"
#include <mitkDataStorageInspectorGenerator.h>
-#include <QmitkDataStorageTreeInspector.h>
#include <QmitkNodeSelectionPreferenceHelper.h>
+#include <QmitkDataStorageSelectionHistoryInspector.h>
QmitkNodeSelectionDialog::QmitkNodeSelectionDialog(QWidget* parent, QString title, QString hint) : QDialog(parent),
m_NodePredicate(nullptr), m_SelectOnlyVisibleNodes(false), m_SelectedNodes(NodeList()), m_SelectionMode(QAbstractItemView::SingleSelection)
{
m_Controls.setupUi(this);
+ m_CheckFunction = [](const NodeList &) { return ""; };
+
auto providers = mitk::DataStorageInspectorGenerator::GetProviders();
auto visibleProviders = mitk::GetVisibleDataStorageInspectors();
auto favoriteID = mitk::GetFavoriteDataStorageInspector();
if (visibleProviders.empty())
{
MITK_DEBUG << "No presets for visible node selection inspectors available. Use fallback (show all available inspectors)";
unsigned int order = 0;
for (auto proIter : providers)
{
visibleProviders.insert(std::make_pair(order, proIter.first));
++order;
}
}
int favIndex = 0;
bool favoriteFound = false;
for (auto proIter : visibleProviders)
{
auto finding = providers.find(proIter.second);
if (finding != providers.end())
{
auto inspector = finding->second->CreateInspector();
QString name = QString::fromStdString(finding->second->GetInspectorDisplayName());
QString desc = QString::fromStdString(finding->second->GetInspectorDescription());
AddPanel(inspector, name, desc);
favoriteFound = favoriteFound || proIter.second == favoriteID;
if (!favoriteFound)
{
++favIndex;
}
}
else
{
MITK_DEBUG << "No provider registered for inspector that is defined as visible in the preferences. Illegal inspector ID: " << proIter.second;
}
}
m_Controls.tabWidget->setCurrentIndex(favIndex);
this->setWindowTitle(title);
this->setToolTip(hint);
m_Controls.hint->setText(hint);
m_Controls.hint->setVisible(!hint.isEmpty());
+ m_FavoriteNodesButton = new QPushButton("Add to favorites");
+ m_Controls.buttonBox->addButton(m_FavoriteNodesButton, QDialogButtonBox::ActionRole);
+
+ connect(m_FavoriteNodesButton, &QPushButton::clicked, this, &QmitkNodeSelectionDialog::OnFavoriteNodesButtonClicked);
connect(m_Controls.buttonBox, SIGNAL(accepted()), this, SLOT(OnOK()));
connect(m_Controls.buttonBox, SIGNAL(rejected()), this, SLOT(OnCancel()));
}
void QmitkNodeSelectionDialog::SetDataStorage(mitk::DataStorage* dataStorage)
{
if (m_DataStorage != dataStorage)
{
m_DataStorage = dataStorage;
if (!m_DataStorage.IsExpired())
{
for (auto panel : m_Panels)
{
panel->SetDataStorage(dataStorage);
}
}
}
}
void QmitkNodeSelectionDialog::SetNodePredicate(mitk::NodePredicateBase* nodePredicate)
{
if (m_NodePredicate != nodePredicate)
{
m_NodePredicate = nodePredicate;
for (auto panel : m_Panels)
{
panel->SetNodePredicate(m_NodePredicate);
}
}
}
mitk::NodePredicateBase* QmitkNodeSelectionDialog::GetNodePredicate() const
{
return m_NodePredicate;
}
QmitkNodeSelectionDialog::NodeList QmitkNodeSelectionDialog::GetSelectedNodes() const
{
return m_SelectedNodes;
}
+void QmitkNodeSelectionDialog::SetSelectionCheckFunction(const SelectionCheckFunctionType &checkFunction)
+{
+ m_CheckFunction = checkFunction;
+ auto checkResponse = m_CheckFunction(m_SelectedNodes);
+
+ m_Controls.hint->setText(QString::fromStdString(checkResponse));
+ m_Controls.hint->setVisible(!checkResponse.empty());
+ m_Controls.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(checkResponse.empty());
+}
+
+bool QmitkNodeSelectionDialog::GetSelectOnlyVisibleNodes() const
+{
+ return m_SelectOnlyVisibleNodes;
+}
+
+void QmitkNodeSelectionDialog::SetSelectionMode(SelectionMode mode)
+{
+ m_SelectionMode = mode;
+ for (auto panel : m_Panels)
+ {
+ panel->SetSelectionMode(mode);
+ }
+}
+
+QmitkNodeSelectionDialog::SelectionMode QmitkNodeSelectionDialog::GetSelectionMode() const
+{
+ return m_SelectionMode;
+}
+
void QmitkNodeSelectionDialog::SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes)
{
if (m_SelectOnlyVisibleNodes != selectOnlyVisibleNodes)
{
m_SelectOnlyVisibleNodes = selectOnlyVisibleNodes;
for (auto panel : m_Panels)
{
panel->SetSelectOnlyVisibleNodes(m_SelectOnlyVisibleNodes);
}
}
}
void QmitkNodeSelectionDialog::SetCurrentSelection(NodeList selectedNodes)
{
m_SelectedNodes = selectedNodes;
+ auto checkResponse = m_CheckFunction(m_SelectedNodes);
+
+ m_Controls.hint->setText(QString::fromStdString(checkResponse));
+ m_Controls.hint->setVisible(!checkResponse.empty());
+ m_Controls.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(checkResponse.empty());
+
for (auto panel : m_Panels)
{
panel->SetCurrentSelection(selectedNodes);
}
}
void QmitkNodeSelectionDialog::OnSelectionChanged(NodeList selectedNodes)
{
SetCurrentSelection(selectedNodes);
emit CurrentSelectionChanged(selectedNodes);
}
+void QmitkNodeSelectionDialog::OnFavoriteNodesButtonClicked()
+{
+ for (auto node : m_SelectedNodes)
+ {
+ node->SetBoolProperty("org.mitk.selection.favorite", true);
+ }
+}
+
+void QmitkNodeSelectionDialog::OnOK()
+{
+ for (auto node : m_SelectedNodes)
+ {
+ QmitkDataStorageSelectionHistoryInspector::AddNodeToHistory(node);
+ }
+
+ this->accept();
+}
+
+void QmitkNodeSelectionDialog::OnCancel()
+{
+ this->reject();
+}
+
void QmitkNodeSelectionDialog::AddPanel(QmitkAbstractDataStorageInspector* view, QString name, QString desc)
{
view->setParent(this);
view->SetSelectionMode(m_SelectionMode);
auto tabPanel = new QWidget();
- tabPanel->setObjectName(QString("tab_")+name);
+ tabPanel->setObjectName(QString("tab_") + name);
tabPanel->setToolTip(desc);
m_Controls.tabWidget->insertTab(m_Controls.tabWidget->count(), tabPanel, name);
auto verticalLayout = new QVBoxLayout(tabPanel);
verticalLayout->setSpacing(0);
verticalLayout->setContentsMargins(0, 0, 0, 0);
verticalLayout->addWidget(view);
m_Panels.push_back(view);
connect(view, &QmitkAbstractDataStorageInspector::CurrentSelectionChanged, this, &QmitkNodeSelectionDialog::OnSelectionChanged);
}
-
-void QmitkNodeSelectionDialog::OnOK()
-{
- this->accept();
-}
-
-void QmitkNodeSelectionDialog::OnCancel()
-{
- this->reject();
-}
-
-void QmitkNodeSelectionDialog::SetSelectionMode(SelectionMode mode)
-{
- m_SelectionMode = mode;
- for (auto panel : m_Panels)
- {
- panel->SetSelectionMode(mode);
- }
-}
-
-QmitkNodeSelectionDialog::SelectionMode QmitkNodeSelectionDialog::GetSelectionMode() const
-{
- return m_SelectionMode;
-}
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.h b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.h
index 2d48d7e047..89b30af430 100644
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.h
+++ b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.h
@@ -1,121 +1,139 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QMITK_NODE_SELECTION_DIALOG_H
#define QMITK_NODE_SELECTION_DIALOG_H
#include <mitkDataStorage.h>
#include <mitkWeakPointer.h>
#include <mitkNodePredicateBase.h>
#include <QmitkAbstractDataStorageInspector.h>
#include "org_mitk_gui_qt_common_Export.h"
#include "ui_QmitkNodeSelectionDialog.h"
#include <QDialog>
+#include <QPushButton>
/**
* \class QmitkNodeSelectionDialog
* \brief Widget that allows to show and edit the content of an mitk::IsoDoseLevel instance.
*/
class MITK_QT_COMMON QmitkNodeSelectionDialog : public QDialog
{
Q_OBJECT
public:
explicit QmitkNodeSelectionDialog(QWidget* parent = nullptr, QString caption = "", QString hint = "");
- /*
+ /**
* @brief Sets the data storage that will be used /monitored by widget.
*
* @param dataStorage A pointer to the data storage to set.
*/
void SetDataStorage(mitk::DataStorage* dataStorage);
- /*
+ /**
* @brief Sets the node predicate and updates the widget, according to the node predicate.
*
* @param nodePredicate A pointer to node predicate.
*/
virtual void SetNodePredicate(mitk::NodePredicateBase* nodePredicate);
mitk::NodePredicateBase* GetNodePredicate() const;
using NodeList = QList<mitk::DataNode::Pointer>;
-
NodeList GetSelectedNodes() const;
+ /**
+ * @brief Helper function that is used to check the given selection for consistency.
+ * Returning an empty string assumes that everything is alright and the selection is valid.
+ * If the string is not empty, the content of the string will be used as error message.
+ */
+ using SelectionCheckFunctionType = std::function<std::string(const NodeList &)>;
+ /**
+ * @brief A selection check function can be set. If set the dialog uses this function to check the made/set selection.
+ * If the selection is valid, everything is fine.
+ * If the selection is indicated as invalid, the dialog will display the selection check function error message.
+ */
+ void SetSelectionCheckFunction(const SelectionCheckFunctionType &checkFunction);
+
bool GetSelectOnlyVisibleNodes() const;
using SelectionMode = QAbstractItemView::SelectionMode;
void SetSelectionMode(SelectionMode mode);
SelectionMode GetSelectionMode() const;
Q_SIGNALS:
/*
* @brief A signal that will be emitted if the selected node has changed.
*
* @param nodes A list of data nodes that are newly selected.
*/
void CurrentSelectionChanged(NodeList nodes);
public Q_SLOTS:
/*
* @brief Change the selection modus of the item view's selection model.
*
* If true, an incoming selection will be filtered (reduced) to only those nodes that are visible by the current view.
* An outgoing selection can then at most contain the filtered nodes.
* If false, the incoming non-visible selection will be stored and later added to the outgoing selection,
* to include the original selection that could not be modified.
* The part of the original selection, that is non-visible are the nodes that are not
*
* @param selectOnlyVisibleNodes The bool value to define the selection modus.
*/
void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes);
/*
* @brief Transform a list of data nodes into a model selection and set this as a new selection of the
* selection model of the private member item view.
*
* The function filters the given list of nodes according to the 'm_SelectOnlyVisibleNodes' member variable. If
* necessary, the non-visible nodes are stored. This is done if 'm_SelectOnlyVisibleNodes' is false: In this case
* the selection may be filtered and only a subset of the selected nodes may be visible and therefore (de-)selectable
* in the data storage viewer. By storing the non-visible nodes it is possible to send the new, modified selection
* but also include the selected nodes from the original selection that could not be modified (see 'SetSelectOnlyVisibleNodes').
*
* @param nodes A list of data nodes that should be newly selected.
*/
void SetCurrentSelection(NodeList selectedNodes);
protected Q_SLOTS:
+
void OnSelectionChanged(NodeList selectedNodes);
+ void OnFavoriteNodesButtonClicked();
void OnOK();
void OnCancel();
protected:
void AddPanel(QmitkAbstractDataStorageInspector* view, QString name, QString desc);
mitk::WeakPointer<mitk::DataStorage> m_DataStorage;
mitk::NodePredicateBase::Pointer m_NodePredicate;
bool m_SelectOnlyVisibleNodes;
NodeList m_SelectedNodes;
+ SelectionCheckFunctionType m_CheckFunction;
+
SelectionMode m_SelectionMode;
using PanelVectorType = std::vector<QmitkAbstractDataStorageInspector*>;
PanelVectorType m_Panels;
+ QPushButton* m_FavoriteNodesButton;
Ui_QmitkNodeSelectionDialog m_Controls;
};
-#endif // QmitkNodeSelectionDialog_H
+#endif // QMITK_NODE_SELECTION_DIALOG_H
diff --git a/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorView.cpp b/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorView.cpp
index eff06bd45a..2a3a0f3090 100644
--- a/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorView.cpp
+++ b/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorView.cpp
@@ -1,385 +1,374 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-
// Blueberry
#include <berryISelectionService.h>
#include <berryIWorkbenchWindow.h>
#include <berryIWorkbenchPage.h>
// mitk
#include <QmitkRenderWindow.h>
#include <mitkImagePixelReadAccessor.h>
#include <mitkPixelTypeMultiplex.h>
// Qt
#include <QMessageBox>
#include <QMessageBox>
#include <QFileDialog>
#include <qwt_plot_marker.h>
#include "QmitkDicomInspectorView.h"
const std::string QmitkDicomInspectorView::VIEW_ID = "org.mitk.gui.qt.dicominspector";
QmitkDicomInspectorView::ObserverInfo::ObserverInfo(mitk::SliceNavigationController* controller,
int observerTag, const std::string& renderWindowName, mitk::IRenderWindowPart* part) : controller(controller), observerTag(observerTag),
renderWindowName(renderWindowName), renderWindowPart(part)
{
}
-QmitkDicomInspectorView::QmitkDicomInspectorView() :
-m_renderWindowPart(nullptr),
-m_PendingSliceChangedEvent(false),
-m_currentSelectedTimeStep(0),
-m_currentSelectedZSlice(0),
-m_currentSelectedNode(nullptr),
-m_internalUpdateFlag(false)
+QmitkDicomInspectorView::QmitkDicomInspectorView()
+ : m_RenderWindowPart(nullptr)
+ , m_PendingSliceChangedEvent(false)
+ , m_SelectedNode(nullptr)
+ , m_SelectedTimeStep(0)
+ , m_CurrentSelectedZSlice(0)
{
- m_currentSelectedPosition.Fill(0.0);
+ m_SelectedPosition.Fill(0.0);
}
QmitkDicomInspectorView::~QmitkDicomInspectorView()
{
this->RemoveAllObservers();
}
+void QmitkDicomInspectorView::RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart)
+{
+ if (m_RenderWindowPart != renderWindowPart)
+ {
+ m_RenderWindowPart = renderWindowPart;
+
+ if (!InitObservers())
+ {
+ QMessageBox::information(nullptr, "Error", "Unable to set up the event observers. The " \
+ "plot will not be triggered on changing the crosshair, " \
+ "position or time step.");
+ }
+ }
+}
+
+void QmitkDicomInspectorView::RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart)
+{
+ m_RenderWindowPart = nullptr;
+ this->RemoveAllObservers(renderWindowPart);
+}
+
+void QmitkDicomInspectorView::CreateQtPartControl(QWidget* parent)
+{
+ // create GUI widgets from the Qt Designer's .ui file
+ m_Controls.setupUi(parent);
+
+ m_Controls.singleSlot->SetDataStorage(GetDataStorage());
+ m_Controls.singleSlot->SetSelectionIsOptional(true);
+ m_Controls.singleSlot->SetEmptyInfo(QString("Please select a data node"));
+ m_Controls.singleSlot->SetPopUpTitel(QString("Select data node"));
+
+ m_SelectionServiceConnector = std::make_unique<QmitkSelectionServiceConnector>();
+ SetAsSelectionListener(true);
+
+ m_Controls.timePointValueLabel->setText(QString(""));
+ m_Controls.sliceNumberValueLabel->setText(QString(""));
+
+ connect(m_Controls.singleSlot, &QmitkSingleNodeSelectionWidget::CurrentSelectionChanged,
+ this, &QmitkDicomInspectorView::OnCurrentSelectionChanged);
+
+ mitk::IRenderWindowPart* renderWindowPart = GetRenderWindowPart();
+ RenderWindowPartActivated(renderWindowPart);
+}
bool QmitkDicomInspectorView::InitObservers()
{
bool result = true;
typedef QHash<QString, QmitkRenderWindow*> WindowMapType;
- WindowMapType windowMap = m_renderWindowPart->GetQmitkRenderWindows();
+ WindowMapType windowMap = m_RenderWindowPart->GetQmitkRenderWindows();
auto i = windowMap.begin();
while (i != windowMap.end())
{
mitk::SliceNavigationController* sliceNavController =
i.value()->GetSliceNavigationController();
if (sliceNavController)
{
- itk::ReceptorMemberCommand<QmitkDicomInspectorView>::Pointer cmdSliceEvent =
- itk::ReceptorMemberCommand<QmitkDicomInspectorView>::New();
+ auto cmdSliceEvent = itk::SimpleMemberCommand<QmitkDicomInspectorView>::New();
cmdSliceEvent->SetCallbackFunction(this, &QmitkDicomInspectorView::OnSliceChanged);
int tag = sliceNavController->AddObserver(
- mitk::SliceNavigationController::GeometrySliceEvent(nullptr, 0),
- cmdSliceEvent);
+ mitk::SliceNavigationController::GeometrySliceEvent(nullptr, 0), cmdSliceEvent);
m_ObserverMap.insert(std::make_pair(sliceNavController, ObserverInfo(sliceNavController, tag,
- i.key().toStdString(), m_renderWindowPart)));
+ i.key().toStdString(), m_RenderWindowPart)));
- itk::ReceptorMemberCommand<QmitkDicomInspectorView>::Pointer cmdTimeEvent =
- itk::ReceptorMemberCommand<QmitkDicomInspectorView>::New();
+ auto cmdTimeEvent = itk::SimpleMemberCommand<QmitkDicomInspectorView>::New();
cmdTimeEvent->SetCallbackFunction(this, &QmitkDicomInspectorView::OnSliceChanged);
tag = sliceNavController->AddObserver(
- mitk::SliceNavigationController::GeometryTimeEvent(nullptr, 0),
- cmdTimeEvent);
+ mitk::SliceNavigationController::GeometryTimeEvent(nullptr, 0), cmdTimeEvent);
m_ObserverMap.insert(std::make_pair(sliceNavController, ObserverInfo(sliceNavController, tag,
- i.key().toStdString(), m_renderWindowPart)));
+ i.key().toStdString(), m_RenderWindowPart)));
- itk::MemberCommand<QmitkDicomInspectorView>::Pointer cmdDelEvent =
- itk::MemberCommand<QmitkDicomInspectorView>::New();
- cmdDelEvent->SetCallbackFunction(this,
- &QmitkDicomInspectorView::OnSliceNavigationControllerDeleted);
- tag = sliceNavController->AddObserver(
- itk::DeleteEvent(), cmdDelEvent);
+ auto cmdDelEvent = itk::MemberCommand<QmitkDicomInspectorView>::New();
+ cmdDelEvent->SetCallbackFunction(this, &QmitkDicomInspectorView::OnSliceNavigationControllerDeleted);
+ tag = sliceNavController->AddObserver(itk::DeleteEvent(), cmdDelEvent);
m_ObserverMap.insert(std::make_pair(sliceNavController, ObserverInfo(sliceNavController, tag,
- i.key().toStdString(), m_renderWindowPart)));
+ i.key().toStdString(), m_RenderWindowPart)));
}
++i;
result = result && sliceNavController;
}
return result;
}
-void QmitkDicomInspectorView::RemoveObservers(const mitk::SliceNavigationController*
- deletedSlicer)
+void QmitkDicomInspectorView::RemoveObservers(const mitk::SliceNavigationController* deletedSlicer)
{
-
- std::pair < ObserverMapType::const_iterator, ObserverMapType::const_iterator> obsRange =
+ std::pair<ObserverMapType::const_iterator, ObserverMapType::const_iterator> obsRange =
m_ObserverMap.equal_range(deletedSlicer);
for (ObserverMapType::const_iterator pos = obsRange.first; pos != obsRange.second; ++pos)
{
pos->second.controller->RemoveObserver(pos->second.observerTag);
}
m_ObserverMap.erase(deletedSlicer);
}
void QmitkDicomInspectorView::RemoveAllObservers(mitk::IRenderWindowPart* deletedPart)
{
for (ObserverMapType::const_iterator pos = m_ObserverMap.begin(); pos != m_ObserverMap.end();)
{
ObserverMapType::const_iterator delPos = pos++;
- if (deletedPart == nullptr || deletedPart == delPos->second.renderWindowPart)
+ if (nullptr == deletedPart || deletedPart == delPos->second.renderWindowPart)
{
delPos->second.controller->RemoveObserver(delPos->second.observerTag);
m_ObserverMap.erase(delPos);
}
}
}
-void QmitkDicomInspectorView::OnSliceNavigationControllerDeleted(const itk::Object* sender,
- const itk::EventObject& /*e*/)
+void QmitkDicomInspectorView::OnCurrentSelectionChanged(QList<mitk::DataNode::Pointer> nodes)
{
- const mitk::SliceNavigationController* sendingSlicer =
- dynamic_cast<const mitk::SliceNavigationController*>(sender);
-
- this->RemoveObservers(sendingSlicer);
-}
+ if (nodes.empty() || nodes.front().IsNull())
+ {
+ m_SelectedNode = nullptr;
+ m_SelectedData = nullptr;
+ UpdateData();
+ return;
+ }
-void QmitkDicomInspectorView::RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart)
-{
- if (m_renderWindowPart != renderWindowPart)
+ if (nodes.front() != this->m_SelectedNode)
{
- m_renderWindowPart = renderWindowPart;
+ // node is selected, create DICOM tag table
+ m_SelectedNode = nodes.front();
+ m_SelectedData = this->m_SelectedNode->GetData();
- if (!InitObservers())
- {
- QMessageBox::information(nullptr, "Error", "Unable to set up the event observers. The " \
- "plot will not be triggered on changing the crosshair, " \
- "position or time step.");
- }
+ m_SelectedNodeTime.Modified();
+ UpdateData();
+ OnSliceChangedDelayed();
}
}
-void QmitkDicomInspectorView::RenderWindowPartDeactivated(
- mitk::IRenderWindowPart* renderWindowPart)
+void QmitkDicomInspectorView::OnSliceChanged()
{
- m_renderWindowPart = nullptr;
- this->RemoveAllObservers(renderWindowPart);
-}
-
-void QmitkDicomInspectorView::CreateQtPartControl(QWidget* parent)
-{
- // create GUI widgets from the Qt Designer's .ui file
- m_Controls.setupUi(parent);
-
- m_Controls.labelNode->setText(QString("select node..."));
- m_Controls.labelTime->setText(QString(""));
- m_Controls.labelSlice->setText(QString(""));
-
- mitk::IRenderWindowPart* renderWindowPart = GetRenderWindowPart();
- RenderWindowPartActivated(renderWindowPart);
-}
+ // Taken from QmitkStdMultiWidget::HandleCrosshairPositionEvent().
+ // Since there are always 3 events arriving (one for each render window) every time the slice
+ // or time changes, the slot OnSliceChangedDelayed is triggered - and only if it hasn't been
+ // triggered yet - so it is only executed once for every slice/time change.
+ if (!m_PendingSliceChangedEvent)
+ {
+ m_PendingSliceChangedEvent = true;
-void QmitkDicomInspectorView::SetFocus()
-{
+ QTimer::singleShot(0, this, SLOT(OnSliceChangedDelayed()));
+ }
}
-void QmitkDicomInspectorView::OnSelectionChanged(berry::IWorkbenchPart::Pointer /*source*/,
- const QList<mitk::DataNode::Pointer>& nodes)
+void QmitkDicomInspectorView::OnSliceNavigationControllerDeleted(const itk::Object* sender, const itk::EventObject& /*e*/)
{
- if (nodes.size() > 0)
- {
- if (nodes.front() != this->m_currentSelectedNode)
- {
- m_internalUpdateFlag = true;
- this->m_currentSelectedNode = nodes.front();
- this->m_currentSelectedData = this->m_currentSelectedNode->GetData();
- m_internalUpdateFlag = false;
-
- m_selectedNodeTime.Modified();
- UpdateData();
- OnSliceChangedDelayed();
- }
- }
- else
- {
- if (this->m_currentSelectedNode.IsNotNull())
- {
- m_internalUpdateFlag = true;
- this->m_currentSelectedNode = nullptr;
- this->m_currentSelectedData = nullptr;
- m_internalUpdateFlag = false;
-
- m_selectedNodeTime.Modified();
- UpdateData();
- OnSliceChangedDelayed();
- }
- }
+ auto sendingSlicer = dynamic_cast<const mitk::SliceNavigationController*>(sender);
+ this->RemoveObservers(sendingSlicer);
}
void QmitkDicomInspectorView::ValidateAndSetCurrentPosition()
{
mitk::Point3D currentSelectedPosition = GetRenderWindowPart()->GetSelectedPosition(nullptr);
unsigned int currentSelectedTimeStep = GetRenderWindowPart()->GetTimeNavigationController()->GetTime()->GetPos();
- if (m_currentSelectedPosition != currentSelectedPosition
- || m_currentSelectedTimeStep != currentSelectedTimeStep
- || m_selectedNodeTime > m_currentPositionTime)
+ if (m_SelectedPosition != currentSelectedPosition
+ || m_SelectedTimeStep != currentSelectedTimeStep
+ || m_SelectedNodeTime > m_CurrentPositionTime)
{
- //the current position has been changed or the selected node has been changed since the last position validation -> check position
- m_currentSelectedPosition = currentSelectedPosition;
- m_currentSelectedTimeStep = currentSelectedTimeStep;
- m_currentPositionTime.Modified();
- m_validSelectedPosition = false;
-
- if (m_currentSelectedData.IsNull())
+ // the current position has been changed or the selected node has been changed since
+ // the last position validation -> check position
+ m_SelectedPosition = currentSelectedPosition;
+ m_SelectedTimeStep = currentSelectedTimeStep;
+ m_CurrentPositionTime.Modified();
+ m_ValidSelectedPosition = false;
+
+ if (m_SelectedData.IsNull())
{
return;
}
- mitk::BaseGeometry::Pointer geometry = m_currentSelectedData->GetTimeGeometry()->GetGeometryForTimeStep(
- m_currentSelectedTimeStep);
+ mitk::BaseGeometry::Pointer geometry = m_SelectedData->GetTimeGeometry()->GetGeometryForTimeStep(
+ m_SelectedTimeStep);
// check for invalid time step
if (geometry.IsNull())
{
- geometry = m_currentSelectedData->GetTimeGeometry()->GetGeometryForTimeStep(0);
+ geometry = m_SelectedData->GetTimeGeometry()->GetGeometryForTimeStep(0);
}
if (geometry.IsNull())
{
return;
}
- m_validSelectedPosition = geometry->IsInside(m_currentSelectedPosition);
+ m_ValidSelectedPosition = geometry->IsInside(m_SelectedPosition);
itk::Index<3> index;
- geometry->WorldToIndex(m_currentSelectedPosition, index);
-
- m_currentSelectedZSlice = index[2];
- }
-}
+ geometry->WorldToIndex(m_SelectedPosition, index);
-void QmitkDicomInspectorView::OnSliceChanged(const itk::EventObject&)
-{
- // Taken from QmitkStdMultiWidget::HandleCrosshairPositionEvent().
- // Since there are always 3 events arriving (one for each render window) every time the slice
- // or time changes, the slot OnSliceChangedDelayed is triggered - and only if it hasn't been
- // triggered yet - so it is only executed once for every slice/time change.
- if (!m_PendingSliceChangedEvent)
- {
- m_PendingSliceChangedEvent = true;
-
- QTimer::singleShot(0, this, SLOT(OnSliceChangedDelayed()));
+ m_CurrentSelectedZSlice = index[2];
}
}
void QmitkDicomInspectorView::OnSliceChangedDelayed()
{
m_PendingSliceChangedEvent = false;
ValidateAndSetCurrentPosition();
- m_Controls.tableTags->setEnabled(m_validSelectedPosition);
+ m_Controls.tableTags->setEnabled(m_ValidSelectedPosition);
- if (m_currentSelectedNode.IsNotNull())
+ if (m_SelectedNode.IsNotNull())
{
RenderTable();
}
}
void QmitkDicomInspectorView::RenderTable()
{
- assert(m_renderWindowPart != nullptr);
+ assert(nullptr != m_RenderWindowPart);
// configure fit information
unsigned int rowIndex = 0;
for (const auto& element : m_Tags)
{
- QTableWidgetItem* newItem = new QTableWidgetItem(QString::fromStdString(element.second.prop->GetValue(m_currentSelectedTimeStep, m_currentSelectedZSlice, true, true)));
+ QTableWidgetItem* newItem = new QTableWidgetItem(QString::fromStdString(
+ element.second.prop->GetValue(m_SelectedTimeStep, m_CurrentSelectedZSlice, true, true)));
m_Controls.tableTags->setItem(rowIndex, 3, newItem);
++rowIndex;
}
UpdateLabels();
}
void QmitkDicomInspectorView::UpdateData()
{
QStringList headers;
m_Controls.tableTags->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents);
m_Tags.clear();
- if (m_currentSelectedData.IsNotNull())
+ if (m_SelectedData.IsNotNull())
{
- for (const auto& element : *(m_currentSelectedData->GetPropertyList()->GetMap()))
+ for (const auto& element : *(m_SelectedData->GetPropertyList()->GetMap()))
{
if (element.first.find("DICOM") == 0)
{
std::istringstream stream(element.first);
std::string token;
std::getline(stream, token, '.'); //drop the DICOM suffix
std::getline(stream, token, '.'); //group id
unsigned long dcmgroup = std::stoul(token, nullptr, 16);
std::getline(stream, token, '.'); //element id
unsigned long dcmelement = std::stoul(token, nullptr, 16);
TagInfo info(mitk::DICOMTag(dcmgroup, dcmelement), dynamic_cast<const mitk::DICOMProperty*>(element.second.GetPointer()));
m_Tags.insert(std::make_pair(element.first, info));
}
}
}
m_Controls.tableTags->setRowCount(m_Tags.size());
unsigned int rowIndex = 0;
for (const auto& element : m_Tags)
{
QTableWidgetItem* newItem = new QTableWidgetItem(QString::number(element.second.tag.GetGroup(), 16));
m_Controls.tableTags->setItem(rowIndex, 0, newItem);
newItem = new QTableWidgetItem(QString::number(element.second.tag.GetElement(), 16));
m_Controls.tableTags->setItem(rowIndex, 1, newItem);
newItem = new QTableWidgetItem(QString::fromStdString(element.second.tag.GetName()));
m_Controls.tableTags->setItem(rowIndex, 2, newItem);
newItem = new QTableWidgetItem(QString::fromStdString(element.second.prop->GetValue()));
m_Controls.tableTags->setItem(rowIndex, 3, newItem);
++rowIndex;
}
+
UpdateLabels();
}
void QmitkDicomInspectorView::UpdateLabels()
{
- if (m_currentSelectedData.IsNull())
+ if (m_SelectedData.IsNull())
{
- if (m_currentSelectedNode.IsNotNull())
- {
- m_Controls.labelNode->setText(QString("<font color='red'><b>INVALIDE NODE</font>"));
- }
- else
- {
- m_Controls.labelNode->setText(QString("select node..."));
- }
- m_Controls.labelTime->setText(QString(""));
- m_Controls.labelSlice->setText(QString(""));
+ m_Controls.timePointValueLabel->setText(QString(""));
+ m_Controls.sliceNumberValueLabel->setText(QString(""));
}
else
{
- m_Controls.labelNode->setText(QString::fromStdString(m_currentSelectedNode->GetName()));
- if (m_validSelectedPosition)
+ if (m_ValidSelectedPosition)
{
- m_Controls.labelTime->setText(QString::number(m_currentSelectedTimeStep));
- m_Controls.labelSlice->setText(QString::number(m_currentSelectedZSlice));
+ m_Controls.timePointValueLabel->setText(QString::number(m_SelectedTimeStep));
+ m_Controls.sliceNumberValueLabel->setText(QString::number(m_CurrentSelectedZSlice));
}
else
{
- m_Controls.labelTime->setText(QString("outside data geometry"));
- m_Controls.labelSlice->setText(QString("outside data geometry"));
+ m_Controls.timePointValueLabel->setText(QString("outside data geometry"));
+ m_Controls.sliceNumberValueLabel->setText(QString("outside data geometry"));
}
}
}
+
+void QmitkDicomInspectorView::SetAsSelectionListener(bool checked)
+{
+ if (checked)
+ {
+ m_SelectionServiceConnector->AddPostSelectionListener(GetSite()->GetWorkbenchWindow()->GetSelectionService());
+ connect(m_SelectionServiceConnector.get(), &QmitkSelectionServiceConnector::ServiceSelectionChanged,
+ m_Controls.singleSlot, &QmitkSingleNodeSelectionWidget::SetCurrentSelection);
+ }
+ else
+ {
+ m_SelectionServiceConnector->RemovePostSelectionListener();
+ disconnect(m_SelectionServiceConnector.get(), &QmitkSelectionServiceConnector::ServiceSelectionChanged,
+ m_Controls.singleSlot, &QmitkSingleNodeSelectionWidget::SetCurrentSelection);
+ }
+}
diff --git a/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorView.h b/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorView.h
index 926eb5a5ac..8746fa6126 100644
--- a/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorView.h
+++ b/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorView.h
@@ -1,158 +1,155 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-
#ifndef QmitkDicomInspectorView_h
#define QmitkDicomInspectorView_h
+#include "ui_QmitkDicomInspectorViewControls.h"
+
// Blueberry
-//#include <berryISelectionListener.h>
#include <berryIPartListener.h>
-// mitk
-#include <QmitkAbstractView.h>
-#include <mitkIRenderWindowPartListener.h>
+// mitk DICOMReader module
#include <mitkDICOMTag.h>
#include <mitkDICOMProperty.h>
-// Qt
-#include "ui_QmitkDicomInspectorViewControls.h"
+// mitk gui common plugin
+#include <mitkIRenderWindowPartListener.h>
+// mitk gui qt common plugin
+#include <QmitkAbstractView.h>
+#include <QmitkSelectionServiceConnector.h>
/**
- * @brief View class defining the UI part of the ModelFitVisualization plug-in.
+ * @brief View class to inspect all DICOM tags available for the data of a node.
*/
-class QmitkDicomInspectorView :
- public QmitkAbstractView,
- public mitk::IRenderWindowPartListener
+class QmitkDicomInspectorView : public QmitkAbstractView, public mitk::IRenderWindowPartListener
{
- // this is needed for all Qt objects that should have a Qt meta-object
- // (everything that derives from QObject and wants to have signal/slots)
+
Q_OBJECT
public:
QmitkDicomInspectorView();
~QmitkDicomInspectorView() override;
static const std::string VIEW_ID;
- protected slots:
+ void SetFocus() override { };
- /**
- * @brief Triggered when the voxel or time step selection changes.
- * Calculates the curve and points for the current fit if the visualization is running.
- */
- void OnSliceChangedDelayed();
+ void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override;
+ void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override;
protected:
void CreateQtPartControl(QWidget* parent) override;
- void SetFocus() override;
+ /** @brief Initializes and sets the observers that are used to monitor changes in the selected position
+ or time point in order to actualize the view*/
+ bool InitObservers();
- /** @brief called by QmitkFunctionality when DataManager's selection has changed */
- void OnSelectionChanged(berry::IWorkbenchPart::Pointer source,
- const QList<mitk::DataNode::Pointer>& nodes) override;
+ /** @brief Removes all observers of the specific deleted slice navigation controller.*/
+ void RemoveObservers(const mitk::SliceNavigationController* deletedSlicer);
- /** @brief Calls OnSliceChangedDelayed so the event isn't triggered multiple times. */
- void OnSliceChanged(const itk::EventObject& e);
+ /** @brief Removes all observers of the deletedPart. If null pointer is passed all observers will be removed.*/
+ void RemoveAllObservers(mitk::IRenderWindowPart* deletedPart = nullptr);
- void OnSliceNavigationControllerDeleted(const itk::Object* sender, const itk::EventObject& /*e*/);
+ /** @brief Called by the selection widget when the selection has changed.*/
+ void OnCurrentSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
- void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override;
- void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override;
+ /** @brief Calls OnSliceChangedDelayed so the event isn't triggered multiple times.*/
+ void OnSliceChanged();
- /** Initializes and sets the observers that are used to monitor changes in the selected position
- or time point in order to actualize the view.h*/
- bool InitObservers();
- void RemoveObservers(const mitk::SliceNavigationController* deletedSlicer);
- /** Removes all observers of the deletedPart. If null pointer is passed all observers will be removed.*/
- void RemoveAllObservers(mitk::IRenderWindowPart* deletedPart = nullptr);
+ void OnSliceNavigationControllerDeleted(const itk::Object* sender, const itk::EventObject& /*e*/);
- /** Sets m_currentSelectedPosition to the current selection and validates if this position is valid
+ /** @brief Sets m_currentSelectedPosition to the current selection and validates if this position is valid
* for the input image of the currently selected fit. If it is valid, m_validSelectedPosition is set to true.
* If the fit, his input image or geometry is not specified, it will also handled as invalid.*/
void ValidateAndSetCurrentPosition();
- Ui::DicomInspectorViewControls m_Controls;
- mitk::IRenderWindowPart* m_renderWindowPart;
+private Q_SLOTS:
+
+ /** @brief Updates the current slice and time is correctly displayed.*/
+ void OnSliceChangedDelayed();
+
+private:
+
+ void RenderTable();
+
+ /** (Re-)initializes the headers of the data table.*/
+ void UpdateData();
+ void UpdateLabels();
+
+ void SetAsSelectionListener(bool checked);
- // Needed for observing the events for when a slice or time step is changed.
+ Ui::QmitkDicomInspectorViewControls m_Controls;
+ mitk::IRenderWindowPart* m_RenderWindowPart;
+
+ std::unique_ptr<QmitkSelectionServiceConnector> m_SelectionServiceConnector;
+
+ /** Needed for observing the events for when a slice or time step is changed.*/
bool m_PendingSliceChangedEvent;
- /**Helper structure to manage the registered observer events.*/
+ /** Helper structure to manage the registered observer events.*/
struct ObserverInfo
{
mitk::SliceNavigationController* controller;
int observerTag;
std::string renderWindowName;
mitk::IRenderWindowPart* renderWindowPart;
ObserverInfo(mitk::SliceNavigationController* controller, int observerTag,
const std::string& renderWindowName, mitk::IRenderWindowPart* part);
};
typedef std::multimap<const mitk::SliceNavigationController*, ObserverInfo> ObserverMapType;
ObserverMapType m_ObserverMap;
- /** @brief currently valid selected position in the inspector*/
- mitk::Point3D m_currentSelectedPosition;
- /** @brief indicates if the currently selected position is valid for the currently selected fit.
- * This it is within the input image */
- bool m_validSelectedPosition;
-
- unsigned int m_currentSelectedTimeStep;
-
- itk::IndexValueType m_currentSelectedZSlice;
+ /** @brief Currently selected node for the DICOM information.*/
+ mitk::DataNode::ConstPointer m_SelectedNode;
+ /** @brief Base data of the currently selected node.*/
+ mitk::BaseData::ConstPointer m_SelectedData;
- /** @brief currently selected node for the visualization logic*/
- mitk::DataNode::ConstPointer m_currentSelectedNode;
+ /** @brief Valid selected position in the inspector.*/
+ mitk::Point3D m_SelectedPosition;
+ /** @brief Indicates if the currently selected position is valid for the currently selected data.*/
+ bool m_ValidSelectedPosition;
- mitk::BaseData::ConstPointer m_currentSelectedData;
+ unsigned int m_SelectedTimeStep;
- /** @brief Is a visualization currently running? */
- bool m_internalUpdateFlag;
-
- /** @brief Number of interpolation steps between two x values */
- static const unsigned int INTERPOLATION_STEPS;
+ itk::IndexValueType m_CurrentSelectedZSlice;
/*************************************/
/* Members for visualizing the model */
- itk::TimeStamp m_selectedNodeTime;
- itk::TimeStamp m_currentFitTime;
- itk::TimeStamp m_currentPositionTime;
- itk::TimeStamp m_lastRefreshTime;
+ itk::TimeStamp m_SelectedNodeTime;
+ itk::TimeStamp m_CurrentPositionTime;
/**Helper structure to manage the registered observer events.*/
struct TagInfo
{
mitk::DICOMTag tag;
mitk::DICOMProperty::ConstPointer prop;
- TagInfo(const mitk::DICOMTag& aTag, mitk::DICOMProperty::ConstPointer aProp) : tag(aTag), prop(aProp)
+ TagInfo(const mitk::DICOMTag& aTag, mitk::DICOMProperty::ConstPointer aProp)
+ : tag(aTag)
+ , prop(aProp)
{
};
};
typedef std::map<std::string, TagInfo> TagMapType;
TagMapType m_Tags;
- void RenderTable();
-
- /** (re)initializes the headers of the data table*/
- void UpdateData();
- void UpdateLabels();
};
#endif // QmitkDicomInspectorView_h
diff --git a/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorViewControls.ui b/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorViewControls.ui
index bd7b2fad2c..8acd57fbec 100644
--- a/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorViewControls.ui
+++ b/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorViewControls.ui
@@ -1,194 +1,195 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
- <class>DicomInspectorViewControls</class>
- <widget class="QWidget" name="DicomInspectorViewControls">
+ <class>QmitkDicomInspectorViewControls</class>
+ <widget class="QWidget" name="QmitkDicomInspectorViewControls">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>402</width>
- <height>777</height>
+ <width>300</width>
+ <height>600</height>
</rect>
</property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="windowTitle">
- <string>QmitkTemplate</string>
- </property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>5</number>
</property>
<property name="leftMargin">
<number>5</number>
</property>
<property name="topMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<property name="bottomMargin">
<number>5</number>
</property>
<item>
<layout class="QGridLayout" name="gridLayout">
- <item row="1" column="0">
- <widget class="QLabel" name="label_5">
- <property name="text">
- <string>Time point:</string>
- </property>
- </widget>
- </item>
<item row="0" column="0">
- <widget class="QLabel" name="label_6">
+ <widget class="QLabel" name="selectedDataNodeLabel">
+ <property name="sizePolicy">
+- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+- <horstretch>0</horstretch>
+- <verstretch>0</verstretch>
+- </sizepolicy>
+- </property>
<property name="text">
- <string>Node:</string>
+ <string>Selected data node</string>
</property>
</widget>
</item>
<item row="0" column="1">
- <widget class="QLabel" name="labelNode">
+ <widget class="QmitkSingleNodeSelectionWidget" name="singleSlot" native="true">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="text">
- <string>textlabel</string>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>40</height>
+ </size>
</property>
</widget>
</item>
- <item row="1" column="1">
- <widget class="QLabel" name="labelTime">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <item row="1" column="0">
+ <widget class="QLabel" name="timePointLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
- <string>TextLabel</string>
+ <string>Time point</string>
</property>
</widget>
</item>
- <item row="2" column="0">
- <widget class="QLabel" name="label">
+ <item row="1" column="1">
+ <widget class="QLabel" name="timePointValueLabel">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="sliceNumberLabel">
+ <property name="sizePolicy">
+- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+- <horstretch>0</horstretch>
+- <verstretch>0</verstretch>
+- </sizepolicy>
+- </property>
<property name="text">
- <string>Slice Nr:</string>
+ <string>Slice number</string>
</property>
</widget>
</item>
<item row="2" column="1">
- <widget class="QLabel" name="labelSlice">
+ <widget class="QLabel" name="sliceNumberValueLabel">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="text">
- <string>TextLabel</string>
- </property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTableWidget" name="tableTags">
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>false</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::NoSelection</enum>
</property>
<property name="sortingEnabled">
<bool>false</bool>
</property>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>75</number>
</attribute>
<attribute name="horizontalHeaderHighlightSections">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<number>20</number>
</attribute>
<attribute name="verticalHeaderMinimumSectionSize">
<number>20</number>
</attribute>
<column>
<property name="text">
<string>Group #</string>
</property>
<property name="toolTip">
<string extracomment="DICOM group ID"/>
</property>
</column>
<column>
<property name="text">
<string>Element #</string>
</property>
<property name="toolTip">
<string extracomment="DICOM element ID"/>
</property>
</column>
<column>
<property name="text">
<string>Name</string>
</property>
<property name="toolTip">
<string extracomment="Human readable name of the DICOM tag"/>
</property>
</column>
<column>
<property name="text">
<string>Value</string>
</property>
<property name="toolTip">
<string extracomment="Value of the DICOM tag"/>
</property>
</column>
</widget>
</item>
- <item>
- <widget class="QLabel" name="lInfo">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
+ <customwidgets>
+ <customwidget>
+ <class>QmitkSingleNodeSelectionWidget</class>
+ <extends>QWidget</extends>
+ <header location="global">QmitkSingleNodeSelectionWidget.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
<resources/>
<connections/>
</ui>
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkFloatingImageToUltrasoundRegistrationFilter.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkFloatingImageToUltrasoundRegistrationFilter.h
index 80692c72b2..a30ec33cee 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkFloatingImageToUltrasoundRegistrationFilter.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkFloatingImageToUltrasoundRegistrationFilter.h
@@ -1,70 +1,70 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKFLOATINGIMAGETOULTRASOUNDREGISTRATIONFILTER_H_HEADER_INCLUDED_
#define MITKFLOATINGIMAGETOULTRASOUNDREGISTRATIONFILTER_H_HEADER_INCLUDED_
#include <mitkNavigationDataPassThroughFilter.h>
#include <mitkImage.h>
namespace mitk
{
/**Documentation
* \brief This filter transforms a given floating image into the ultrasound coordinate system.
*
*
* \ingroup US
*/
class FloatingImageToUltrasoundRegistrationFilter : public NavigationDataPassThroughFilter
{
public:
mitkClassMacro(FloatingImageToUltrasoundRegistrationFilter, NavigationDataPassThroughFilter);
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
void InitializeTransformationMarkerCSToSensorCS( bool useNdiTracker = false );
void SetSegmentation(mitk::DataNode::Pointer segmentationNode, mitk::Image::Pointer ctimage);
void SetSurface(mitk::DataNode::Pointer surfaceNode);
void SetPointSet(mitk::DataNode::Pointer pointSetNode);
void SetTransformMarkerCSToFloatingImageCS( mitk::AffineTransform3D::Pointer transform );
void SetTransformUSimageCSToTrackingCS(mitk::AffineTransform3D::Pointer transform);
protected:
FloatingImageToUltrasoundRegistrationFilter();
~FloatingImageToUltrasoundRegistrationFilter() override;
/**Documentation
* \brief filter execute method
*
*
*/
void GenerateData() override;
mitk::AffineTransform3D::Pointer GetInverseTransform(mitk::AffineTransform3D::Pointer transform);
private:
mitk::DataNode::Pointer m_Segmentation;
mitk::DataNode::Pointer m_Surface;
mitk::DataNode::Pointer m_PointSet;
mitk::Image::Pointer m_CTimage;
mitk::AffineTransform3D::Pointer m_TransformMarkerCSToSensorCS;
mitk::AffineTransform3D::Pointer m_TransformMarkerCSToFloatingImageCS;
mitk::AffineTransform3D::Pointer m_TransformUSimageCSToTrackingCS;
mitk::AffineTransform3D::Pointer m_TransformCTimageIndexToWorld;
mitk::BaseGeometry::Pointer m_SurfaceGeometry;
bool m_TrackedUltrasoundActive;
};
} // namespace mitk
#endif // MITKFLOATINGIMAGETOULTRASOUNDREGISTRATIONFILTER_H_HEADER_INCLUDED_
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetIntersectionFilter.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetIntersectionFilter.h
index a640f6ede8..a9902f396c 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetIntersectionFilter.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetIntersectionFilter.h
@@ -1,90 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKUSNAVIGATIONTARGETINTERSECTIONFILTER_H
#define MITKUSNAVIGATIONTARGETINTERSECTIONFILTER_H
#include "mitkCommon.h"
#include "mitkNumericTypes.h"
#include "itkObjectFactory.h"
#include "vtkSmartPointer.h"
#include "vtkPolyData.h"
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk {
class Surface;
class PointSet;
/**
* \brief Calculates the intersection between a mitk::Surface and a line.
* Surface and line have to be set by SetTargetSurface() and SetLine.
* CalculateIntersection() can be called then to calculate the intersection.
* The results can be got afterwards by GetIsIntersecting(),
* GetIntersectionPoint(), GetIntersectionNearestSurfacePointId() and
* GetDistanceToIntersection().
*/
class USNavigationTargetIntersectionFilter : public itk::Object {
public:
- mitkClassMacroItkParent(USNavigationTargetIntersectionFilter, itk::Object)
- itkNewMacro(Self)
-
- itkSetMacro(TargetSurface, itk::SmartPointer<mitk::Surface>)
+ mitkClassMacroItkParent(USNavigationTargetIntersectionFilter, itk::Object);
+ itkNewMacro(Self);
+
+ itkSetMacro(TargetSurface, itk::SmartPointer<mitk::Surface>);
void SetLine(itk::SmartPointer<mitk::PointSet> line);
/**
* \return if line and surface are intersecting
*/
- itkGetMacro(IsIntersecting, bool)
+ itkGetMacro(IsIntersecting, bool);
/**
* \return the position where the intersection occured, the result is not defined if no intersection occured
*/
mitk::Point3D GetIntersectionPoint();
/**
* \return id of the nearest vertex of the target to the interseciont, the result is not defined if no intersection occured
*/
int GetIntersectionNearestSurfacePointId();
/**
* \return distance between the first line point and the intersection point
*/
double GetDistanceToIntersection();
/**
* \brief Does the intersection calculation.
* SetTargetSurface() and SetLine() have to be called before.
*/
void CalculateIntersection();
protected:
USNavigationTargetIntersectionFilter();
~USNavigationTargetIntersectionFilter() override;
itk::SmartPointer<mitk::Surface> m_TargetSurface;
vtkSmartPointer<vtkPolyData> m_TargetSurfaceVtk;
double m_LinePoint1[3];
double m_LinePoint2[3];
bool m_IsIntersecting;
double m_IntersectionPoint[3];
int m_IntersectionCellId;
double m_Distance;
};
}
#endif // MITKUSNAVIGATIONTARGETINTERSECTIONFILTER_H
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetOcclusionFilter.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetOcclusionFilter.h
index 05b713ba86..e82a9267b0 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetOcclusionFilter.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetOcclusionFilter.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef USNAVIGATIONTARGETOCCLUSIONFILTER_H
#define USNAVIGATIONTARGETOCCLUSIONFILTER_H
#include "mitkNavigationDataPassThroughFilter.h"
#include "mitkDataStorage.h"
namespace itk {
template<class T> class SmartPointer;
}
class vtkPolyData;
template<class T> class vtkSmartPointer;
namespace mitk {
class DataNode;
/**
* \brief NavigationData filter calcuting occluded positions on a target surface.
* The occlusion caused by obstacle structures is calculated between the current
* NavigationData position and a given target surface.
*/
class USNavigationTargetOcclusionFilter : public NavigationDataPassThroughFilter
{
public:
- mitkClassMacro(USNavigationTargetOcclusionFilter, NavigationDataPassThroughFilter)
- itkNewMacro(Self)
+ mitkClassMacro(USNavigationTargetOcclusionFilter, NavigationDataPassThroughFilter);
+ itkNewMacro(Self);
/**
* \brief Sets the target structure for which the occluded positions should be calculated.
* \param targetStructure DataNode conatining a mitk::Surface
*/
void SetTargetStructure(itk::SmartPointer<DataNode> targetStructure);
/**
* \brief Sets the obstacle structures which can occlude the target structure.
* \param obstacleStructures Set of DataNodes containing a mitk::Surface each
*/
void SetObstacleStructures(DataStorage::SetOfObjects::ConstPointer obstacleStructures);
/**
* \brief Sets the index of the input which is used for occlusion calculation.
* The occlusion will be calculated between the NavigationData position of
* this input and the target structure.
*/
void SelectStartPositionInput(unsigned int n);
protected:
USNavigationTargetOcclusionFilter();
~USNavigationTargetOcclusionFilter() override;
void GenerateData() override;
/**
* \brief Returns the vtk poly data of the target structure.
* \return vtkPolyData if the target structure data node contains one, returns null otherwise
*/
vtkSmartPointer<vtkPolyData> GetVtkPolyDataOfTarget();
DataStorage::SetOfObjects::ConstPointer m_ObstacleStructures;
itk::SmartPointer<DataNode> m_TargetStructure;
unsigned int m_StartPositionInput;
std::vector<bool> m_OccludedPositions;
};
} // namespace mitk
#endif // USNAVIGATIONTARGETOCCLUSIONFILTER_H
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetUpdateFilter.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetUpdateFilter.h
index d2ad030be2..9b8fe2f613 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetUpdateFilter.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetUpdateFilter.h
@@ -1,136 +1,136 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef USNAVIGATIONTARGETUPDATEFILTER_H
#define USNAVIGATIONTARGETUPDATEFILTER_H
#include "itkObjectFactory.h"
#include "mitkCommon.h"
#include "mitkNumericTypes.h"
#include "mitkDataStorage.h"
namespace itk {
template<class T> class SmartPointer;
}
class vtkPolyData;
template<class T> class vtkSmartPointer;
namespace mitk {
class DataNode;
class LookupTableProperty;
class BaseGeometry;
/**
* \brief Calculates a score for target placement for every vertex of a given surface.
* The scores are calculated for placing the targets equally on the surface. It
* is assumed that the surface approximates a sphere. For every vertex of the
* surface a score between 0 and 1 is calculated. The scores are stored in the
* vtkSurface as a vtkFloatArray. The name of this array can be set by calling
* SetScalarArrayIdentifier().
*
* The target surface and the number of targets (between zero and four) or an
* optimal angle between the targets must be set first. The scores are then
* updated every time a target node is added by SetControlNode() or removed by
* RemovePositionOfTarget().
*
*/
class USNavigationTargetUpdateFilter : public itk::Object
{
public:
- mitkClassMacroItkParent(USNavigationTargetUpdateFilter, itk::Object)
- itkFactorylessNewMacro(Self)
- itkCloneMacro(Self)
+ mitkClassMacroItkParent(USNavigationTargetUpdateFilter, itk::Object);
+ itkFactorylessNewMacro(Self);
+ itkCloneMacro(Self);
/**
* \brief Set the target surface for which the scores should be calculated.
* \param targetStructure DataNode containing a mitk::Surface for the target structure
*/
void SetTargetStructure(itk::SmartPointer<DataNode> targetStructure);
/**
* \brief Setter for the number of targets to be placed on the target surface.
* The optimal angle for placing the targets is calculated based on this number.
*
* \return false if the number of targets is smaller than one or larger than four
*/
bool SetNumberOfTargets(unsigned int numberOfTargets);
/**
* \brief Setter for the optimal angle between to targets on the target surface.
* This value overwrites the value calculated by a previous call to
* SetNumberOfTargets() and will be overwritten when SetNumberOfTargets() is
* called afterwards.
*/
void SetOptimalAngle(double optimalAngle);
/**
* \return Angle calculated by SetNumberOfTargets() or explicitly set by SetOptimalAngle()
*/
double GetOptimalAngle();
/**
* \brief Sets the identifier for the vtkFloatArray of scores.
* This array is stored as scalars of the vtkPolyData of the target surface.
*/
void SetScalarArrayIdentifier(std::string scalarArrayIdentifier);
/**
* \brief Set whether the maximum score or the minimum score between the targets should be used.
* Whenever more then one target position is already set, the scores to every
* target position are calculated. The resulting score is the the minimum of
* this scores (default) or the maximum.
*
*/
void SetUseMaximumScore(bool useMaximumScore);
/**
* \brief Sets the origin of the given node for the filter.
* This origin is the position of an already placed target and is used to
* calculate the scores for the surface vertices.
*
* \param id number of the node which position should be set or updated
* \param controlNode DataNode which origin should be set into the filter
*/
void SetControlNode(unsigned int id, itk::SmartPointer<DataNode> controlNode);
/**
* \brief Removes the position of the target with the current id from the filter.
*/
void RemovePositionOfTarget(unsigned int id);
/**
* \brief Removes all target positions from the filter and resets the scores.
*/
void Reset();
protected:
USNavigationTargetUpdateFilter();
~USNavigationTargetUpdateFilter() override;
void UpdateTargetScores();
vtkSmartPointer<vtkPolyData> GetVtkPolyDataOfTarget();
itk::SmartPointer<mitk::BaseGeometry> GetGeometryOfTarget();
itk::SmartPointer<DataNode> m_TargetStructure;
unsigned int m_NumberOfTargets;
double m_OptimalAngle;
std::string m_ScalarArrayIdentifier;
bool m_UseMaximumScore;
std::vector<itk::SmartPointer<DataNode> > m_ControlNodesVector;
};
} // namespace mitk
#endif // USNAVIGATIONTARGETUPDATEFILTER_H
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationCombinedModalityPersistence.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationCombinedModalityPersistence.h
index 8f58290f2f..a24060a175 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationCombinedModalityPersistence.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationCombinedModalityPersistence.h
@@ -1,85 +1,86 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef USCOMBINEDMODALITYPERSISTENCE_H
#define USCOMBINEDMODALITYPERSISTENCE_H
#include <itkObjectFactory.h>
#include "mitkCommon.h"
#include "mitkUSCombinedModality.h"
#include "mitkNavigationDataSource.h"
// Microservices
#include <usModuleContext.h>
namespace mitk {
/**
* \brief Persistence for the mitk::CombinedModality micro services.
* The micro services are saved into QSettings on destruction of this objects
* and they are loaded again when their NavigationDataSource and USDevice will
* become registered as a micro service.
*
* The NavigationDataSources are identified by their name and the USDevices are
* identified by their manufacturer, model and comment.
*
* For using this persistence class for combined modalites an object of this
* class has to be created an held as long as newly created combined modalities
* should be made persistent.
*/
class USNavigationCombinedModalityPersistence : public itk::Object
{
public:
- mitkClassMacroItkParent(USNavigationCombinedModalityPersistence, itk::Object)
- itkNewMacro(Self)
+ mitkClassMacroItkParent(USNavigationCombinedModalityPersistence, itk::Object);
+ itkNewMacro(Self);
+
protected:
/**
* \brief Restores combined modality from QSettings and registers on service events.
* Combined modalities are registered as a micro service as soon as their
* NavigationDataSource and USDevice are available. The constructor adds
* mitk::USNavigationCombinedModalityPersistence::OnServiceEvent() as a
* listener to the module context to be notified when micro services become
* available.
*/
USNavigationCombinedModalityPersistence();
/**
* \brief The destructor stores combined modalities by calling mitk::USNavigationCombinedModalityPersistence::StoreCurrentDevices().
*/
~USNavigationCombinedModalityPersistence() override;
private:
void OnServiceEvent(const us::ServiceEvent event);
void StoreCurrentDevices();
void LoadStoredDevices();
/**
* \brief Try to get combined modality with given properties from the service registry.
* \return the combined modality if it was found, null otherwise
*/
mitk::USCombinedModality::Pointer GetCombinedModality(std::string manufacturer, std::string model);
/**
* \brief Try to get ultrasound device with given properties from the service registry.
* \return the ultrasound device if it was found, null otherwise
*/
mitk::USDevice::Pointer GetUSDevice(std::string manufacturer, std::string model, std::string comment);
/**
* \brief Try to get navigation data source with given properties from the service registry.
* \return the navigation data source if it was found, null otherwise
*/
mitk::NavigationDataSource::Pointer GetNavigationDataSource(std::string name);
};
} // namespace mitk
#endif // USCOMBINEDMODALITYPERSISTENCE_H
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationExperimentLogging.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationExperimentLogging.h
index 2a625e6eb8..e90ffc2c14 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationExperimentLogging.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationExperimentLogging.h
@@ -1,108 +1,108 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKUSNAVIGATIONEXPERIMENTLOGGING_H
#define MITKUSNAVIGATIONEXPERIMENTLOGGING_H
#include <mitkCommon.h>
#include <itkObjectFactory.h>
#include <Poco/DOM/AutoPtr.h>
#include <ostream>
namespace itk {
template<class T> class SmartPointer;
class RealTimeClock;
}
namespace mitk {
class DataNode;
}
namespace Poco {
namespace XML {
class Document;
class Element;
}
}
namespace mitk {
/**
* \brief Logs data node properties to an XML file.
*/
class USNavigationExperimentLogging : public itk::Object {
public:
- mitkClassMacroItkParent(USNavigationExperimentLogging, itk::Object)
- itkNewMacro(USNavigationExperimentLogging)
+ mitkClassMacroItkParent(USNavigationExperimentLogging, itk::Object);
+ itkNewMacro(USNavigationExperimentLogging);
/**
* \brief Clears the XML tree.
* Can be used to start logging a new experiment. Make sure that the output
* file name was changed by calling SetFileName() before setting a new result
* by calling SetResult() if you do not want your previous results to be
* overwritten.
*
* The real time clock is restarted, too.
*/
void Reset();
/**
* \brief Setter for the file path and name of the XML file.
*/
void SetFileName(const std::string& fileName);
/**
* \brief The properties of the given node are appended to the XML tree.
* The data node gets its own XML node under the root of the XML tree and the
* XML node will get the name of the data node as its name. The properties of
* the data node are stored as nodes under this XML node. The current tree is
* written to the output file on every call of this method.
*
* If a key prefix is set by SetKeyPrefix, only properties which keys that are
* starting with this prefix are stored in the XML tree. The prefix is cut from
* the resulting key for the XML tree.
*/
void SetResult(const itk::SmartPointer<mitk::DataNode> resultNode);
/**
* \brief Only properties with this prefix are written into the output file.
*/
- itkSetMacro(KeyPrefix, std::string)
- itkGetMacro(KeyPrefix, std::string)
+ itkSetMacro(KeyPrefix, std::string);
+ itkGetMacro(KeyPrefix, std::string);
protected:
/**
* \brief Constructs an empty XML tree and starts the real time clock.
*/
USNavigationExperimentLogging();
~USNavigationExperimentLogging() override;
void AddCurrentTimeAttributes(Poco::AutoPtr<Poco::XML::Element>);
/**
* \brief Does the actual writing of the complete XML tree to the file system.
*/
void WriteXmlToFile();
std::string m_KeyPrefix;
std::string m_FileName;
unsigned int m_CurrentResultNumber;
itk::SmartPointer<itk::RealTimeClock> m_RealTimeClock;
double m_StartTime;
Poco::AutoPtr<Poco::XML::Document> m_OutputXML;
Poco::AutoPtr<Poco::XML::Element> m_OutputXMLRoot;
};
} // namespace mitk
#endif // MITKUSNAVIGATIONEXPERIMENTLOGGING_H
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationStepTimer.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationStepTimer.h
index 0f141ec451..5e16c028a1 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationStepTimer.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationStepTimer.h
@@ -1,109 +1,109 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKUSNAVIGATIONSTEPTIMER_H
#define MITKUSNAVIGATIONSTEPTIMER_H
#include <mitkCommon.h>
#include <itkObjectFactory.h>
#include <itkTimeProbe.h>
namespace mitk {
/**
* \brief Timer for measureing the durations of navigation steps.
* The different steps are identified by indices. To measure the duraion of a
* step it can be activated by calling SetActiveIndex(). The duration is
* measured until another step is activated by calling SetActiveIndex() with an
* other index or Stop() is called.
*
* If a file name for an output file was set (SetOutputFileName()), the results
* are written to this file, every time a new duration was measured. If a file
* name is set later on, the results are written to the file at the moment of
* setting the file name.
*/
class USNavigationStepTimer : public itk::Object {
public:
- mitkClassMacroItkParent(USNavigationStepTimer, itk::Object)
- itkNewMacro(USNavigationStepTimer)
+ mitkClassMacroItkParent(USNavigationStepTimer, itk::Object);
+ itkNewMacro(USNavigationStepTimer);
/**
* \brief Stops the timer for the current index.
* The measured time to if written to the output file if a file path was
* already set.
*/
void Stop();
/**
* \brief Removes all measured durations.
*/
void Reset();
/**
* \brief Sets the name of the output file.
* If there are already measurements of durations, they are written to this
* file immediately.
*/
void SetOutputFileName(std::string filename);
/**
* \brief Starts measurement for the step with the given index.
*/
void SetActiveIndex(unsigned int index, std::string description = "");
/**
* \brief Returns the sum of all durations.
*/
double GetTotalDuration();
/**
* \brief Returns measured duration for the step with the given index.
* All measurements of this index are summed up.
*/
double GetDurationForIndex(unsigned int index);
/**
* \brief Read durations from the file of the given file name.
* This file must have exactly the same format as it is written by this class.
*/
void ReadFromFile(std::string filename);
protected:
USNavigationStepTimer();
~USNavigationStepTimer() override;
struct DurationForIndex {
unsigned int index;
double duration;
std::string description;
DurationForIndex(unsigned int index, double duration) : index(index), duration(duration) {}
DurationForIndex(unsigned int index, double duration, std::string description) : index(index), duration(duration), description(description) {}
};
void FinishCurrentIndex();
void WriteLineToFile(const DurationForIndex& element);
void WriteEverythingToFile();
typedef std::vector<DurationForIndex> DurationsVector;
DurationsVector m_Durations;
unsigned int m_CurrentIndex;
std::string m_CurrentDescription;
itk::TimeProbe m_TimeProbe;
std::string m_OutputFileName;
};
} // namespace mitk
#endif // MITKUSNAVIGATIONSTEPTIMER_H
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSPointMarkInteractor.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSPointMarkInteractor.h
index 48bf96a7b9..ff4fc31f57 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSPointMarkInteractor.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSPointMarkInteractor.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKUSPOINTMARKINTERACTOR_H
#define MITKUSPOINTMARKINTERACTOR_H
#include "mitkDataInteractor.h"
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk
{
/**
* \brief Simple interactor for getting just one position on mouse click.
*/
class USPointMarkInteractor : public DataInteractor
{
public:
- mitkClassMacro(USPointMarkInteractor, DataInteractor)
- itkNewMacro(Self)
+ mitkClassMacro(USPointMarkInteractor, DataInteractor);
+ itkNewMacro(Self);
typedef Message1<DataNode*> PointMarkInteractorEvent;
PointMarkInteractorEvent CoordinatesChangedEvent;
protected:
static void UpdateSurface(itk::SmartPointer<mitk::DataNode>);
USPointMarkInteractor();
~USPointMarkInteractor() override;
/**
* \brief Connects the functions from the state machine to methods of this class.
*/
void ConnectActionsAndFunctions() override;
/**
* \brief Sets empty surface as data for the new data node.
* This is necessary as data nodes without data do not work
* with data interactors.
*/
void DataNodeChanged() override;
/**
* \brief Set current position as origin to the data node.
*/
void AddPoint(StateMachineAction*, InteractionEvent*);
};
} // namespace mitk
#endif // MITKUSPOINTMARKINTERACTOR_H
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSZonesInteractor.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSZonesInteractor.h
index 3d908b9bcb..8f28c6e83d 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSZonesInteractor.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSZonesInteractor.h
@@ -1,107 +1,108 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKUSZONESINTERACTOR_H
#define MITKUSZONESINTERACTOR_H
#include "mitkDataInteractor.h"
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk
{
class Surface;
class DataNode;
/**
* \brief DataInteractor for creating a sphere at a specific coordinate.
* The origin is set by mitk::USZonesInteractor::AddCenter() and then the
* radius can be updated by mitk::USZonesInteractor::ChangeRadius(). An
* updated sphere is rendered every time the radius changes.
*
* DataNode attributes set by this class:
* * zone.size (float) - the radius of the sphere
* * zone.created (bool) - determines if the interactor reached its final state
*
* Two state machines for this interactor are available as resources of the
* USNavigation module.
* * USZoneInteractions.xml: Create a sphere by clicking left, moving the mouse
* and clicking left againg. Aborting is possible by right mouse click.
* * USZoneInteractionsHold.xml: Create a sphere by pressing the left mouse button,
* moving the mouse while holding it pressed and finally release the button.
* Aborting is possible by right mouse click.
*/
class USZonesInteractor : public DataInteractor
{
public:
static const char* DATANODE_PROPERTY_SIZE;
static const char* DATANODE_PROPERTY_CREATED;
- mitkClassMacro(USZonesInteractor, DataInteractor)
- itkNewMacro(Self)
+ mitkClassMacro(USZonesInteractor, DataInteractor);
+
+ itkNewMacro(Self);
/**
* \brief Creates Vtk Sphere according to current radius.
* The radius is gotten from the float property "zone.size" of the
* data node.
*/
static void UpdateSurface(itk::SmartPointer<mitk::DataNode>);
protected:
USZonesInteractor();
~USZonesInteractor() override;
/**
* \brief Connects the functions from the state machine to methods of this class.
*/
void ConnectActionsAndFunctions() override;
/**
* \brief Sets empty surface as data for the new data node.
* This is necessary as data nodes without data do not work
* with data interactors.
*/
void DataNodeChanged() override;
/**
* \brief Sets origin of the data node to the coordinates of the position event.
* \return false if interaction event isn't a position event, true otherwise
*/
void AddCenter(StateMachineAction*, InteractionEvent*);
/**
* \brief Updates radius attribute according to position event.
* Calculates distance between the data node origin and the current position
* event and updates the data node attribue "zone.size" accordingly. The
* mitk::USZonesInteractor::UpdateSurface() function is called then.
*
* \return false if interaction event isn't a position event, true otherwise
*/
void ChangeRadius(StateMachineAction*, InteractionEvent*);
/**
* \brief Sets the property "zone.created" of the data node to true.
* \return always true
*/
void EndCreation(StateMachineAction*, InteractionEvent*);
/**
* \brief Removes Vtk Sphere from data node.
* \return always true
*/
void AbortCreation(StateMachineAction*, InteractionEvent*);
};
} // namespace mitk
#endif // MITKUSZONESINTERACTOR_H
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/mitkUSTargetPlacementQualityCalculator.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/mitkUSTargetPlacementQualityCalculator.h
index 3040fcf13d..f43ce8061f 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/mitkUSTargetPlacementQualityCalculator.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/mitkUSTargetPlacementQualityCalculator.h
@@ -1,89 +1,89 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef MITKUSTARGETPLACEMENTQUALITYCALCULATOR_H
#define MITKUSTARGETPLACEMENTQUALITYCALCULATOR_H
#include <mitkCommon.h>
#include <mitkNumericTypes.h>
#include <itkObjectFactory.h>
template<class T> class vtkSmartPointer;
class vtkPolyData;
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk {
class Surface;
class PointSet;
/**
* \brief Calculates qualitiy metrics for given target positions.
* The calculated metrics are:
* - the distance of the centers of mass of the target surface and the target
* points
* - the differences of the angles between the target points to the given
* optimal angle
* - the mean of the angle differences
*/
class USTargetPlacementQualityCalculator : public itk::Object
{
public:
- mitkClassMacroItkParent(USTargetPlacementQualityCalculator, itk::Object)
- itkNewMacro(Self)
-
- /**
+ mitkClassMacroItkParent(USTargetPlacementQualityCalculator, itk::Object);
+ itkNewMacro(Self); /**
* \brief Setter for the surface where the targets are placed around.
*/
- itkSetMacro(TargetSurface, itk::SmartPointer<Surface>)
+ itkSetMacro(TargetSurface, itk::SmartPointer<Surface>);
/**
* \brief Setter for the target points which are placed around the target surface.
*/
- itkSetMacro(TargetPoints, itk::SmartPointer<PointSet>)
+ itkSetMacro(TargetPoints, itk::SmartPointer<PointSet>);
/**
* \brief Setter for the optimal angle of the target placement.
* This angle is subtracted from the target angles when calculating the angle
* differences.
*/
- itkSetMacro(OptimalAngle, double)
+ itkSetMacro(OptimalAngle, double);
/**
* \brief Calculates the quality metrics.
* This method should be called before calling the getters for the metrics.
*/
void Update();
- itkGetMacro(CentersOfMassDistance, double)
- itkGetMacro(MeanAngleDifference, double)
- itkGetMacro(AngleDifferences, mitk::VnlVector)
+ itkGetMacro(CentersOfMassDistance, double);
+
+ itkGetMacro(MeanAngleDifference, double);
+
+ itkGetMacro(AngleDifferences, mitk::VnlVector);
protected:
USTargetPlacementQualityCalculator();
~USTargetPlacementQualityCalculator() override;
vtkSmartPointer<vtkPolyData> GetTransformedPolydata();
itk::SmartPointer<Surface> m_TargetSurface;
itk::SmartPointer<PointSet> m_TargetPoints;
double m_OptimalAngle;
double m_CentersOfMassDistance;
double m_MeanAngleDifference;
mitk::VnlVector m_AngleDifferences;
};
} // namespace mitk
#endif // MITKUSTARGETPLACEMENTQUALITYCALCULATOR_H
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.batch/src/internal/QmitkMatchPointBatchProcessor.h b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.batch/src/internal/QmitkMatchPointBatchProcessor.h
index 30416c771b..95b3bbccdd 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.batch/src/internal/QmitkMatchPointBatchProcessor.h
+++ b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.batch/src/internal/QmitkMatchPointBatchProcessor.h
@@ -1,199 +1,199 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __Q_MITK_MATCHPOINT_BATCH_PROCESSOR_H
#define __Q_MITK_MATCHPOINT_BATCH_PROCESSOR_H
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include "ui_QmitkMatchPointBatchProcessor.h"
// MatchPoint
#include <mapDeploymentDLLInfo.h>
#include <mapDeploymentDLLHandle.h>
#include <mapRegistrationAlgorithmBase.h>
#include <mapIterativeAlgorithmInterface.h>
#include <mapMultiResRegistrationAlgorithmInterface.h>
#include <mapStoppableAlgorithmInterface.h>
#include <mitkMAPRegistrationWrapper.h>
class QmitkRegistrationJob;
class QmitkMappingJob;
/*!
\brief View for registration batch processing based on MatchPoint
This view composes the GUI and implements the business logic needed to allow registration
batch processing (one target, many moving images).
\ingroup ${plugin_target}_internal
*/
class QmitkMatchPointBatchProcessor : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
* Creates smartpointer typedefs
*/
- berryObjectMacro(QmitkMatchPointBatchProcessor)
+ berryObjectMacro(QmitkMatchPointBatchProcessor);
QmitkMatchPointBatchProcessor();
~QmitkMatchPointBatchProcessor() override;
protected slots:
/**
* @brief Connect all GUI elements to its corresponding slots
*/
virtual void CreateConnections();
/// \brief Called when the user clicks the GUI button
void OnLoadAlgorithmButtonPushed();
void OnSelectedAlgorithmChanged();
void OnLockMovingButtonPushed();
void OnLockTargetButtonPushed();
void OnStartRegBtnPushed();
void OnStopRegBtnPushed();
void OnRegJobError(QString err);
void OnRegResultIsAvailable(mitk::MAPRegistrationWrapper::Pointer spResultRegistration,
const QmitkRegistrationJob* pRegJob);
void OnRegJobFinished();
void OnMapJobError(QString err);
void OnMapResultIsAvailable(mitk::BaseData::Pointer spMappedData, const QmitkMappingJob* job);
void OnAlgorithmIterated(QString info, bool hasIterationCount, unsigned long currentIteration);
void OnLevelChanged(QString info, bool hasLevelCount, unsigned long currentLevel);
void OnAlgorithmStatusChanged(QString info);
void OnAlgorithmInfo(QString info);
protected:
void CreateQtPartControl(QWidget* parent) override;
void SetFocus() override;
/// \brief called by QmitkFunctionality when DataManager's selection has changed
void OnSelectionChanged(berry::IWorkbenchPart::Pointer source,
const QList<mitk::DataNode::Pointer>& nodes) override;
private:
typedef QList<mitk::DataNode::Pointer> NodeListType;
/** Spawns a registration job for the next selected moving node (see m_nextNodeToSpawn).
* If no nodes are left, no job will be spawned and false is returned.
* If at least one node is left, a job will be spawned, m_nextNodeToSpawn will be incremented
* and true will be returned.*/
bool SpawnNextJob();
/**
* @brief Adapt the visibility of GUI elements depending on the current data loaded
*/
void UpdateAlgorithmSelectionGUI();
void Error(QString msg);
void UpdateAlgorithmList();
/**
* checks if appropriated nodes are selected in the data manager. If nodes are selected,
* they are stored in m_spSelectedTargetNode and m_selectedMovingNodes. It also sets the info labels accordingly.*/
void CheckInputs();
/**
* Updates the state of registration control buttons. Regarding to selected
* inputs, loaded algorithm and its state.*/
void ConfigureRegistrationControls();
/**
* Configures the progress bars according to the chosen algorithm.
*/
void ConfigureProgressInfos();
/** Methods returns a list of all nodes selected in the data manager that do
* NOT contain registration wrappers. The list may be empty if nothing is
* selected or no appropriate data node is selected.*/
NodeListType GetSelectedDataNodes();
/** Methods returns a list of all nodes in the data manager containing a registration wrapper.
* The list may be empty.*/
mitk::DataStorage::SetOfObjects::Pointer GetRegNodes() const;
/** Returns a proposal for a (unique) default reg job name */
std::string GetDefaultRegJobName() const;
/** Returns the Pointer to the DLL info of the algorithm currently selected by the system.
The info is received via m_SelectionListener.
@return If there is no item selected the returning pointer
will be null.
*/
const map::deployment::DLLInfo* GetSelectedAlgorithmDLL() const;
//! [Qt Selection Listener method and pointer]
/**
* @brief Method of berry::ISelectionListener that implements the selection listener functionality.
* @param sourcepart The workbench part responsible for the selection change.
* @param selection This parameter holds the current selection.
*
* @see ISelectionListener
*/
void OnAlgorithmSelectionChanged(const berry::IWorkbenchPart::Pointer& sourcepart,
const berry::ISelection::ConstPointer& selection);
void UpdateAlgorithmSelection(berry::ISelection::ConstPointer selection);
friend struct berry::SelectionChangedAdapter<QmitkMatchPointBatchProcessor>;
QWidget* m_Parent;
/** @brief this pointer holds the algorithm selection listener */
QScopedPointer<berry::ISelectionListener> m_AlgorithmSelectionListener;
::map::deployment::DLLHandle::Pointer m_LoadedDLLHandle;
::map::algorithm::RegistrationAlgorithmBase::Pointer m_LoadedAlgorithm;
::map::deployment::DLLInfo::ConstPointer m_SelectedAlgorithmInfo;
typedef map::algorithm::facet::IterativeAlgorithmInterface IIterativeAlgorithm;
typedef map::algorithm::facet::MultiResRegistrationAlgorithmInterface IMultiResAlgorithm;
typedef map::algorithm::facet::StoppableAlgorithmInterface IStoppableAlgorithm;
/**All selected nodes stored by OnSelectionChanged()*/
NodeListType m_currentlySelectedNodes;
mitk::DataNode::Pointer m_spSelectedTargetNode;
NodeListType m_selectedMovingNodes;
/**indicates the next selected moving nodes that should be spawned as job.*/
unsigned int m_nextNodeToSpawn;
// boolean variables to control visibility of GUI elements
bool m_CanLoadAlgorithm;
bool m_ValidInputs;
bool m_Working;
Ui::MatchPointAdvancedControls m_Controls;
};
#endif // MatchPoint_h
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/QmitkMatchPointBrowser.h b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/QmitkMatchPointBrowser.h
index ea7d2c70de..1e410ac03a 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/QmitkMatchPointBrowser.h
+++ b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/QmitkMatchPointBrowser.h
@@ -1,126 +1,126 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __Q_MITK_MATCHPOINT_H
#define __Q_MITK_MATCHPOINT_H
#include <QmitkAbstractView.h>
#include <berryISelectionListener.h>
#include <berryIPreferences.h>
#include <berryIPreferencesService.h>
#include <berryIBerryPreferences.h>
//QT
#include <QSortFilterProxyModel>
// MatchPoint
#include <mapDeploymentDLLHandle.h>
#include <mapRegistrationAlgorithmBase.h>
#include <mapMetaPropertyAlgorithmInterface.h>
#include "ui_QmitkMatchPointBrowserControls.h"
#include "QmitkMAPAlgorithmModel.h"
#include "QmitkAlgorithmListModel.h"
#include "mitkAlgorithmInfoSelectionProvider.h"
/*!
\brief MatchPoint
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\sa QmitkFunctionality
\ingroup ${plugin_target}_internal
*/
class QmitkMatchPointBrowser : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
* Creates smartpointer typedefs
*/
- berryObjectMacro(QmitkMatchPointBrowser)
+ berryObjectMacro(QmitkMatchPointBrowser);
QmitkMatchPointBrowser();
~QmitkMatchPointBrowser() override;
/**
* \brief Called by the framework to indicate that the preferences have changed.
* \param prefs not used, as we call RetrievePreferenceValues().
*/
void OnPreferencesChanged(const berry::IBerryPreferences* prefs) override;
protected slots:
/**
* @brief Connect all GUI elements to its corresponding slots
*/
virtual void CreateConnections();
/// \brief Called when the user clicks the GUI button
void OnSearchFolderButtonPushed();
void OnAlgoListSelectionChanged(const QModelIndex&);
void OnSearchChanged(const QString&);
protected:
void CreateQtPartControl(QWidget* parent) override;
void SetFocus() override;
Ui::MatchPointBrowserControls m_Controls;
//! [Qt Selection Provider]
/** @brief this pointer holds the selection provider*/
mitk::AlgorithmInfoSelectionProvider::Pointer m_SelectionProvider;
//! [Qt Selection Provider]
private:
void SetSelectionProvider() override;
void Error(QString msg);
/**
* \brief Called on startup and by OnPreferencesChanged to load all
* preferences except the temporary folder into member variables.
*/
void RetrieveAndStorePreferenceValues();
void OnInvalidDeploymentEvent(const ::itk::Object *, const itk::EventObject &event);
void OnValidDeploymentEvent(const ::itk::Object *, const itk::EventObject &event);
/**
* \brief Called to get hold of the actual preferences node.
*/
berry::IBerryPreferences::Pointer RetrievePreferences();
QWidget* m_Parent;
::map::deployment::DLLDirectoryBrowser::DLLInfoListType m_DLLInfoList;
QStringList m_currentSearchPaths;
QmitkAlgorithmListModel* m_algModel;
QSortFilterProxyModel* m_filterProxy;
::map::deployment::DLLHandle::Pointer m_LoadedDLLHandle;
::map::algorithm::RegistrationAlgorithmBase::Pointer m_LoadedAlgorithm;
};
#endif // MatchPoint_h
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/mitkAlgorithmInfoSelectionProvider.h b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/mitkAlgorithmInfoSelectionProvider.h
index 164bbb771d..e71a423e73 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/mitkAlgorithmInfoSelectionProvider.h
+++ b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/mitkAlgorithmInfoSelectionProvider.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_ALGORITHM_SELECTION_PROVIDER_H
#define _MITK_ALGORITHM_SELECTION_PROVIDER_H
#include <org_mitk_gui_qt_matchpoint_algorithm_browser_Export.h>
#include <berryISelectionProvider.h>
#include <QObject>
#include "mitkMAPAlgorithmInfoSelection.h"
namespace mitk
{
class AlgorithmInfoSelectionProvider: public QObject,
public berry::ISelectionProvider
{
Q_OBJECT
public:
- berryObjectMacro(AlgorithmInfoSelectionProvider)
+ berryObjectMacro(AlgorithmInfoSelectionProvider);
AlgorithmInfoSelectionProvider();
void AddSelectionChangedListener(berry::ISelectionChangedListener* listener) override;
void RemoveSelectionChangedListener( berry::ISelectionChangedListener* listener) override;
berry::ISelection::ConstPointer GetSelection() const override;
void SetSelection(const berry::ISelection::ConstPointer& selection) override;
MAPAlgorithmInfoSelection::ConstPointer GetInfoSelection() const;
void SetInfoSelection(MAPAlgorithmInfoSelection::ConstPointer selection);
protected:
berry::ISelectionChangedListener::Events _selectionEvents;
MAPAlgorithmInfoSelection::ConstPointer _selection;
};
}
#endif /* BERRYQTSELECTIONPROVIDER_H_ */
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/src/internal/QmitkMatchPoint.h b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/src/internal/QmitkMatchPoint.h
index 0b6e28df64..ae6be2b27e 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/src/internal/QmitkMatchPoint.h
+++ b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/src/internal/QmitkMatchPoint.h
@@ -1,210 +1,210 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __Q_MITK_MATCHPOINT_H
#define __Q_MITK_MATCHPOINT_H
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include "ui_QmitkMatchPointControls.h"
#include <mitkImage.h>
// MatchPoint
#include <mapDeploymentDLLInfo.h>
#include <mapDeploymentDLLHandle.h>
#include <mapRegistrationAlgorithmBase.h>
#include <mapIterativeAlgorithmInterface.h>
#include <mapMultiResRegistrationAlgorithmInterface.h>
#include <mapStoppableAlgorithmInterface.h>
#include <mitkMAPRegistrationWrapper.h>
class QmitkRegistrationJob;
class QmitkMappingJob;
/*!
\brief MatchPoint
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\sa QmitkFunctionality
\ingroup ${plugin_target}_internal
*/
class QmitkMatchPoint : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
* Creates smartpointer typedefs
*/
- berryObjectMacro(QmitkMatchPoint)
+ berryObjectMacro(QmitkMatchPoint);
QmitkMatchPoint();
~QmitkMatchPoint() override;
protected slots:
/**
* @brief Connect all GUI elements to its corresponding slots
*/
virtual void CreateConnections();
/// \brief Called when the user clicks the GUI button
void OnLoadAlgorithmButtonPushed();
void OnSelectedAlgorithmChanged();
void OnNodeSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
void OnStartRegBtnPushed();
void OnStopRegBtnPushed();
void OnSaveLogBtnPushed();
void OnRegJobError(QString err);
void OnRegResultIsAvailable(mitk::MAPRegistrationWrapper::Pointer spResultRegistration,
const QmitkRegistrationJob* pRegJob);
void OnRegJobFinished();
void OnMapJobError(QString err);
void OnMapResultIsAvailable(mitk::BaseData::Pointer spMappedData, const QmitkMappingJob* job);
void OnAlgorithmIterated(QString info, bool hasIterationCount, unsigned long currentIteration);
void OnLevelChanged(QString info, bool hasLevelCount, unsigned long currentLevel);
void OnAlgorithmStatusChanged(QString info);
void OnAlgorithmInfo(QString info);
protected:
void CreateQtPartControl(QWidget* parent) override;
void SetFocus() override;
/// \brief called by QmitkFunctionality when DataManager's selection has changed
void OnSelectionChanged(berry::IWorkbenchPart::Pointer source,
const QList<mitk::DataNode::Pointer>& nodes) override;
private:
/**
* @brief Adapt the visibility of GUI elements depending on the current data loaded
*/
void AdaptFolderGUIElements();
void Error(QString msg);
void UpdateAlgorithmList();
/**
* checks if appropriated nodes are selected in the data manager. If nodes are selected,
* they are stored m_MovingData and m_TargetData. It also sets the info lables accordingly.
* @return True: All inputs are set and valid (images). False: At least one input is not set
* or invalid */
bool CheckInputs();
/**
* Updates the state of registration control buttons. Regarding to selected
* inputs, loaded algorithm and its state.*/
void ConfigureRegistrationControls();
/**
* Configures the progress bars according to the chosen algorithm.
*/
void ConfigureProgressInfos();
/**
Configure the node selectors predicates and informations according to the selected algorithm.
*/
void ConfigureNodeSelectors();
/** Methods returns a list of all nodes in the data manager containing a registration wrapper.
* The list may be empty.*/
mitk::DataStorage::SetOfObjects::Pointer GetRegNodes() const;
/** Returns a proposal for a (unique) default reg job name */
std::string GetDefaultRegJobName() const;
/** Returns the display name of the passed node. Normally it is just node->GetName().
* if the node contains a point set it is additionally checked if the point set node
* has a source node and its name will be added in parentheses.*/
std::string GetInputNodeDisplayName(const mitk::DataNode* node) const;
/** Returns the Pointer to the DLL info of the algorithm currently selected by the system.
The info is received via m_AlgorithmSelectionListener.
@return If there is no item selected the returning pointer
will be null.
*/
const map::deployment::DLLInfo* GetSelectedAlgorithmDLL() const;
//! [Qt Selection Listener method and pointer]
/**
* @brief Method of berry::ISelectionListener that implements the selection listener functionality.
* @param sourcepart The workbench part responsible for the selection change.
* @param selection This parameter holds the current selection.
*
* @see ISelectionListener
*/
void OnAlgorithmSelectionChanged(const berry::IWorkbenchPart::Pointer& sourcepart,
const berry::ISelection::ConstPointer& selection);
void UpdateAlgorithmSelection(berry::ISelection::ConstPointer selection);
friend struct berry::SelectionChangedAdapter<QmitkMatchPoint>;
QWidget* m_Parent;
/** @brief this pointer holds the algorithm selection listener */
QScopedPointer<berry::ISelectionListener> m_AlgorithmSelectionListener;
::map::deployment::DLLHandle::Pointer m_LoadedDLLHandle;
::map::algorithm::RegistrationAlgorithmBase::Pointer m_LoadedAlgorithm;
::map::deployment::DLLInfo::ConstPointer m_SelectedAlgorithmInfo;
typedef map::algorithm::facet::IterativeAlgorithmInterface IIterativeAlgorithm;
typedef map::algorithm::facet::MultiResRegistrationAlgorithmInterface IMultiResAlgorithm;
typedef map::algorithm::facet::StoppableAlgorithmInterface IStoppableAlgorithm;
mitk::DataNode::Pointer m_spSelectedTargetNode;
mitk::DataNode::Pointer m_spSelectedMovingNode;
/*Data of the selected target node that should be used for registration.
Can be the direct return of node->GetData(), but can also be a sub
set (like a special time frame).*/
mitk::BaseData::ConstPointer m_spSelectedTargetData;
/*Data of the selected moving node that should be used for registration.
Can be the direct return of node->GetData(), but can also be a sub
set (like a special time frame).*/
mitk::BaseData::ConstPointer m_spSelectedMovingData;
mitk::DataNode::Pointer m_spSelectedTargetMaskNode;
mitk::DataNode::Pointer m_spSelectedMovingMaskNode;
/*Data of the selected target mask node that should be used for registration.
Can be the direct return of node->GetData(), but can also be a sub
set (like a special time frame).*/
mitk::Image::ConstPointer m_spSelectedTargetMaskData;
/*Data of the selected moving mask node that should be used for registration.
Can be the direct return of node->GetData(), but can also be a sub
set (like a special time frame).*/
mitk::Image::ConstPointer m_spSelectedMovingMaskData;
// boolean variables to control visibility of GUI elements
bool m_CanLoadAlgorithm;
bool m_ValidInputs;
bool m_Working;
Ui::MatchPointAdvancedControls m_Controls;
};
#endif // MatchPoint_h
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvaluator.h b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvaluator.h
index 861d5a2fac..002b3a1d64 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvaluator.h
+++ b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvaluator.h
@@ -1,119 +1,119 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __Q_MITK_MATCHPOINT_REGISTRATION_EVALUATOR_H
#define __Q_MITK_MATCHPOINT_REGISTRATION_EVALUATOR_H
#include <QmitkAbstractView.h>
#include <mitkIRenderWindowPartListener.h>
#include <QmitkSliceNavigationListener.h>
#include "ui_QmitkMatchPointRegistrationEvaluator.h"
/*!
\brief QmitkMatchPointRegistrationEvaluator
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\sa QmitkFunctionality
\ingroup ${plugin_target}_internal
*/
class QmitkMatchPointRegistrationEvaluator : public QmitkAbstractView, public mitk::IRenderWindowPartListener
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
* Creates smartpointer typedefs
*/
- berryObjectMacro(QmitkMatchPointRegistrationEvaluator)
+ berryObjectMacro(QmitkMatchPointRegistrationEvaluator);
QmitkMatchPointRegistrationEvaluator();
~QmitkMatchPointRegistrationEvaluator() override;
void CreateQtPartControl(QWidget *parent) override;
protected slots:
/// \brief Called when the user clicks the GUI button
void OnEvalBtnPushed();
void OnStopBtnPushed();
void OnSettingsChanged(mitk::DataNode*);
void OnSliceChanged();
protected:
/// \brief called by QmitkFunctionality when DataManager's selection has changed
void OnSelectionChanged( berry::IWorkbenchPart::Pointer source,
const QList<mitk::DataNode::Pointer>& nodes) override;
void NodeRemoved(const mitk::DataNode* node) override;
void SetFocus() override;
void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override;
Ui::MatchPointRegistrationEvaluatorControls m_Controls;
private:
QWidget *m_Parent;
void Error(QString msg);
/** Methods returns a list of all eval nodes in the data manager.*/
QList<mitk::DataNode::Pointer> GetEvalNodes();
/**
* Checks if appropriated nodes are selected in the data manager. If nodes are selected,
* they are stored m_spSelectedRegNode, m_spSelectedInputNode and m_spSelectedRefNode.
* They are also checked for vadility and stored in m_ValidInput,... .
* It also sets the info lables accordingly.*/
void CheckInputs();
/**
* Updates the state of controls regarding to selected eval object.*/
void ConfigureControls();
mitk::DataNode::Pointer m_selectedEvalNode;
QmitkSliceNavigationListener m_SliceChangeListener;
itk::TimeStamp m_selectedNodeTime;
itk::TimeStamp m_currentPositionTime;
bool m_activeEvaluation;
bool m_autoMoving;
bool m_autoTarget;
/** @brief currently valid selected position in the inspector*/
mitk::Point3D m_currentSelectedPosition;
/** @brief indicates if the currently selected position is valid for the currently selected fit.
* This it is within the input image */
unsigned int m_currentSelectedTimeStep;
mitk::DataNode::Pointer m_spSelectedRegNode;
mitk::DataNode::Pointer m_spSelectedMovingNode;
mitk::DataNode::Pointer m_spSelectedTargetNode;
static const std::string HelperNodeName;
};
#endif // MatchPoint_h
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/QmitkMatchPointFrameCorrection.h b/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/QmitkMatchPointFrameCorrection.h
index 4e94e51701..de7c088605 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/QmitkMatchPointFrameCorrection.h
+++ b/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/QmitkMatchPointFrameCorrection.h
@@ -1,201 +1,201 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __Q_MITK_MATCHPOINT_FRAME_CORRECTION_H
#define __Q_MITK_MATCHPOINT_FRAME_CORRECTION_H
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include "ui_QmitkMatchPointFrameCorrectionControls.h"
#include <mitkImage.h>
// MatchPoint
#include <mapDeploymentDLLInfo.h>
#include <mapDeploymentDLLHandle.h>
#include <mapRegistrationAlgorithmBase.h>
#include <mapIterativeAlgorithmInterface.h>
#include <mapMultiResRegistrationAlgorithmInterface.h>
#include <mapStoppableAlgorithmInterface.h>
#include <mitkMAPRegistrationWrapper.h>
#include <QmitkFramesRegistrationJob.h>
/*!
\brief View for motion artefact correction of images.
The view utalizes MatchPoint registration algorithms and the mitk::TimeFramesRegistrationHelper and implemnts the GUI
business logic to make frame correction aka motion artefact correction on 3D+t images.
*/
class QmitkMatchPointFrameCorrection : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
* Creates smartpointer typedefs
*/
- berryObjectMacro(QmitkMatchPointFrameCorrection)
+ berryObjectMacro(QmitkMatchPointFrameCorrection);
QmitkMatchPointFrameCorrection();
~QmitkMatchPointFrameCorrection() override;
protected slots:
/**
* @brief Connect all GUI elements to its corresponding slots
*/
virtual void CreateConnections();
/// \brief Called when the user clicks the GUI button
void OnMaskCheckBoxToggeled(bool checked);
void OnLoadAlgorithmButtonPushed();
void OnSelectedAlgorithmChanged();
void OnStartRegBtnPushed();
void OnSaveLogBtnPushed();
void OnFramesSelectAllPushed();
void OnFramesDeSelectAllPushed();
void OnFramesInvertPushed();
void OnRegJobError(QString err);
void OnRegJobFinished();
void OnMapJobError(QString err);
void OnMapResultIsAvailable(mitk::Image::Pointer spMappedData,
const QmitkFramesRegistrationJob* job);
void OnAlgorithmIterated(QString info, bool hasIterationCount, unsigned long currentIteration);
void OnLevelChanged(QString info, bool hasLevelCount, unsigned long currentLevel);
void OnAlgorithmStatusChanged(QString info);
void OnAlgorithmInfo(QString info);
void OnFrameProcessed(double progress);
void OnFrameRegistered(double progress);
void OnFrameMapped(double progress);
protected:
void CreateQtPartControl(QWidget* parent) override;
void SetFocus() override;
/// \brief called by QmitkFunctionality when DataManager's selection has changed
void OnSelectionChanged(berry::IWorkbenchPart::Pointer source,
const QList<mitk::DataNode::Pointer>& nodes) override;
private:
/**
* @brief Adapt the visibility of GUI elements depending on the current data loaded
*/
void AdaptFolderGUIElements();
void Error(QString msg);
void UpdateAlgorithmList();
/**
* checks if appropriated nodes are selected in the data manager. If nodes are selected,
* they are stored m_MovingData and m_TargetData. It also sets the info lables accordingly.
* @return True: All inputs are set and valid (images). False: At least one input is not set
* or invalid */
bool CheckInputs();
/**
* Updates the state of registration control buttons. Regarding to selected
* inputs, loaded algorithm and its state.*/
void ConfigureRegistrationControls();
/**
* Configures the progress bars according to the chosen algorithm.
*/
void ConfigureProgressInfos();
/**configure the frame list widget based on the selected target.*/
void ConfigureFrameList();
/**generates the ignore list based on the frame list widget selection.*/
mitk::TimeFramesRegistrationHelper::IgnoreListType GenerateIgnoreList() const;
/** Methods returns a list of all nodes in the data manager containing a registration wrapper.
* The list may be empty.*/
mitk::DataStorage::SetOfObjects::Pointer GetRegNodes() const;
/** Returns a proposal for a (unique) default reg job name */
std::string GetDefaultJobName() const;
/** Returns the display name of the passed node. Normally it is just node->GetName().
* if the node contains a point set it is additionally checked if the point set node
* has a source node and its name will be added in parentheses.*/
std::string GetInputNodeDisplayName(const mitk::DataNode* node) const;
/** Returns the Pointer to the DLL info of the algorithm currently selected by the system.
The info is received via m_AlgorithmSelectionListener.
@return If there is no item selected the returning pointer
will be null.
*/
const map::deployment::DLLInfo* GetSelectedAlgorithmDLL() const;
//! [Qt Selection Listener method and pointer]
/**
* @brief Method of berry::ISelectionListener that implements the selection listener functionality.
* @param sourcepart The workbench part responsible for the selection change.
* @param selection This parameter holds the current selection.
*
* @see ISelectionListener
*/
void OnAlgorithmSelectionChanged(const berry::IWorkbenchPart::Pointer& sourcepart,
const berry::ISelection::ConstPointer& selection);
void UpdateAlgorithmSelection(berry::ISelection::ConstPointer selection);
friend struct berry::SelectionChangedAdapter<QmitkMatchPointFrameCorrection>;
QWidget* m_Parent;
/** @brief this pointer holds the algorithm selection listener */
QScopedPointer<berry::ISelectionListener> m_AlgorithmSelectionListener;
::map::deployment::DLLHandle::Pointer m_LoadedDLLHandle;
::map::algorithm::RegistrationAlgorithmBase::Pointer m_LoadedAlgorithm;
::map::deployment::DLLInfo::ConstPointer m_SelectedAlgorithmInfo;
typedef map::algorithm::facet::IterativeAlgorithmInterface IIterativeAlgorithm;
typedef map::algorithm::facet::MultiResRegistrationAlgorithmInterface IMultiResAlgorithm;
typedef map::algorithm::facet::StoppableAlgorithmInterface IStoppableAlgorithm;
mitk::DataNode::Pointer m_spSelectedTargetNode;
/*Data of the selected target node that should be used for registration.
Can be the direct return of node->GetData(), but can also be a sub
set (like a special time frame).*/
mitk::BaseData::ConstPointer m_spSelectedTargetData;
mitk::DataNode::Pointer m_spSelectedTargetMaskNode;
mitk::Image::ConstPointer m_spSelectedTargetMaskData;
// boolean variables to control visibility of GUI elements
bool m_CanLoadAlgorithm;
bool m_ValidInputs;
bool m_Working;
Ui::MatchPointFrameCorrectionControls m_Controls;
};
#endif // MatchPoint_h
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.manipulator/src/internal/QmitkMatchPointRegistrationManipulator.h b/Plugins/org.mitk.gui.qt.matchpoint.manipulator/src/internal/QmitkMatchPointRegistrationManipulator.h
index d02b08b5cd..658f8e3877 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.manipulator/src/internal/QmitkMatchPointRegistrationManipulator.h
+++ b/Plugins/org.mitk.gui.qt.matchpoint.manipulator/src/internal/QmitkMatchPointRegistrationManipulator.h
@@ -1,149 +1,149 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __Q_MITK_MATCHPOINT_REGISTRATION_MANIPULATOR_H
#define __Q_MITK_MATCHPOINT_REGISTRATION_MANIPULATOR_H
#include <QmitkAbstractView.h>
#include <mitkIRenderWindowPartListener.h>
#include <QmitkSliceNavigationListener.h>
#include <mitkMAPRegistrationWrapper.h>
#include <itkEuler3DTransform.h>
#include "ui_QmitkMatchPointRegistrationManipulator.h"
class QmitkMappingJob;
/*!
\brief QmitkMatchPointRegistrationManipulator
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\sa QmitkFunctionality
\ingroup ${plugin_target}_internal
*/
class QmitkMatchPointRegistrationManipulator : public QmitkAbstractView, public mitk::IRenderWindowPartListener
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
* Creates smartpointer typedefs
*/
- berryObjectMacro(QmitkMatchPointRegistrationManipulator)
+ berryObjectMacro(QmitkMatchPointRegistrationManipulator);
QmitkMatchPointRegistrationManipulator();
~QmitkMatchPointRegistrationManipulator() override;
void CreateQtPartControl(QWidget *parent) override;
protected slots:
/// \brief Called when the user clicks the GUI button
void OnStartBtnPushed();
void OnCancelBtnPushed();
void OnStoreBtnPushed();
void OnSettingsChanged(mitk::DataNode*);
void OnSelectionChanged();
void OnRegistrationChanged();
void OnCenterTypeChanged(int);
void OnSliceChanged();
void OnMapResultIsAvailable(mitk::BaseData::Pointer spMappedData, const QmitkMappingJob* job);
void Error(QString msg);
protected:
/// \brief called by QmitkFunctionality when DataManager's selection has changed
void OnSelectionChanged( berry::IWorkbenchPart::Pointer source,
const QList<mitk::DataNode::Pointer>& nodes) override;
void NodeRemoved(const mitk::DataNode* node) override;
void SetFocus() override;
void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override;
Ui::MatchPointRegistrationManipulatorControls m_Controls;
private:
QWidget *m_Parent;
/** Methods returns a list of all eval nodes in the data manager.*/
QList<mitk::DataNode::Pointer> GetEvalNodes();
/**
* Checks if appropriated nodes are selected in the data manager. If nodes are selected,
* they are stored m_spSelectedRegNode, m_spSelectedInputNode and m_spSelectedRefNode.
* They are also checked for validity.*/
void CheckInputs();
/**
* Updates the state of controls regarding to the state of the view and it objects.*/
void ConfigureControls();
/** Initialize the state of the view, so the manipulation can start.*/
void InitSession();
/** Stops session, removes all obsolete members (e.g. RegEvalObject). After that the view is in a valid but inactive state.*/
void StopSession();
void ConfigureTransformCenter(int centerType);
mitk::DataNode::Pointer m_EvalNode;
QmitkSliceNavigationListener m_SliceChangeListener;
itk::TimeStamp m_selectedNodeTime;
itk::TimeStamp m_currentPositionTime;
bool m_activeManipulation;
bool m_autoMoving;
bool m_autoTarget;
/** @brief currently valid selected position in the inspector*/
mitk::Point3D m_currentSelectedPosition;
/** @brief indicates if the currently selected position is valid for the currently selected fit.
* This it is within the input image */
unsigned int m_currentSelectedTimeStep;
mitk::DataNode::Pointer m_SelectedPreRegNode;
mitk::DataNode::Pointer m_SelectedMovingNode;
mitk::DataNode::Pointer m_SelectedTargetNode;
mitk::MAPRegistrationWrapper::Pointer m_CurrentRegistrationWrapper;
map::core::RegistrationBase::Pointer m_CurrentRegistration;
using MAPRegistrationType = map::core::Registration<3, 3>;
MAPRegistrationType::Pointer m_SelectedPreReg;
bool m_internalUpdate;
static const std::string HelperNodeName;
};
#endif // MatchPoint_h
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.h b/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.h
index b45e892856..93c7cfc7c3 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.h
+++ b/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.h
@@ -1,176 +1,176 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __Q_MITK_MATCHPOINT_MAPPER_H
#define __Q_MITK_MATCHPOINT_MAPPER_H
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include <QSortFilterProxyModel>
#include "ui_QmitkMatchPointMapper.h"
#include "QmitkMappingJob.h"
// MatchPoint
/*!
\brief QmitkMatchPointMapper
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\sa QmitkFunctionality
\ingroup ${plugin_target}_internal
*/
class QmitkMatchPointMapper : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
* Creates smartpointer typedefs
*/
- berryObjectMacro(QmitkMatchPointMapper)
+ berryObjectMacro(QmitkMatchPointMapper);
QmitkMatchPointMapper();
void CreateQtPartControl(QWidget *parent) override;
protected slots:
/**
* @brief Connect all GUI elements to its corresponding slots
*/
virtual void CreateConnections();
/// \brief Called when the user clicks the GUI button
void OnLockRegButtonPushed();
void OnLockInputButtonPushed();
void OnLockReferenceButtonPushed();
void OnManualRefChecked();
void OnLinkSampleFactorChecked();
void OnXFactorChanged(double d);
void OnMapBtnPushed();
void OnRefineBtnPushed();
void OnMapJobError(QString err);
void OnMapResultIsAvailable(mitk::BaseData::Pointer spMappedData, const QmitkMappingJob* job);
void OnMappingInfo(QString info);
protected:
void SetFocus() override;
/// \brief called by QmitkFunctionality when DataManager's selection has changed
void OnSelectionChanged(berry::IWorkbenchPart::Pointer source,
const QList<mitk::DataNode::Pointer>& nodes) override;
Ui::MatchPointMapperControls m_Controls;
private:
QWidget *m_Parent;
void MapNStoreImage(QmitkMappingJob* job);
void Error(QString msg);
/** Method checks if the currently selected reg node has a direct kernel that
* can be decomposed in a rotation matrix and a offset. If this is true, true
* is returned. In all other cases false is returned.*/
bool IsAbleToRefineGeometry() const;
/** Method checks if the currently selected input is a binary image (property binary == true).
* If this is true, true is returned. In all other cases false is returned.*/
bool IsBinaryInput() const;
/** Method checks if the currently selected input is a point set.
* If this is true, true is returned. In all other cases false is returned.*/
bool IsPointSetInput() const;
/** Function returns the first data node containing a registration wrapper
* in the current selection of the data manager. If nothing is selected or
* no registration wrapper is selected it return nullptr.*/
mitk::DataNode::Pointer GetSelectedRegNode();
/** Methods returns a list of all nodes selected in the data manager that do
* NOT contain registration wrappers. The list may be empty if nothing is
* selected or no appropriate data node is selected.*/
QList<mitk::DataNode::Pointer> GetSelectedDataNodes();
/** If a registration node is set, this function determines the auto reference node.
* The auto reference node is the node of the target data used to determine the
* registration object or, if the first cannot be determined, the currently selected input
* node.
* @return Pointer to the reference node (target data of the registration algorithm run).
* Function may return nullptr if the referenced node cannot be found or is not defined
* by the registration.*/
mitk::DataNode::Pointer GetAutoRefNodeByReg();
/**
* Checks if appropriated nodes are selected in the data manager. If nodes are selected,
* they are stored m_spSelectedRegNode, m_spSelectedInputNode and m_spSelectedRefNode.
* They are also checked for vadility and stored in m_ValidInput,... .
* It also sets the info lables accordingly.*/
void CheckInputs();
/** Methods checks the validity of the currently stored
* m_spSelectedRegNode, m_spSelectedInputNode and m_spSelectedRefNode.
* Results are returned via the parameters. Details of the evaluation are
* printed to the log widget.*/
void CheckNodesValidity(bool& validReg, bool& validInput, bool& validRef);
/**
* Updates the state of mapping control button regarding to selected
* input, registration and reference.*/
void ConfigureMappingControls();
/**
* Configures the progress bars accoarding to the choosen algorithm.
*/
void ConfigureProgressInfos();
/**
* Used to generate, configure and execute a mapping job regarding the
* current settings.
* @param doGeometryRefinement Set true if only a geometry refinement should be done.
* Set to false if a mapping/resampling of the input should be done.*/
void SpawnMappingJob(bool doGeometryRefinement = false);
mitk::DataNode::Pointer m_spSelectedRegNode;
mitk::DataNode::Pointer m_spSelectedInputNode;
mitk::DataNode::Pointer m_spSelectedRefNode;
/** boolean variable to control visibility of GUI elements*/
bool m_ValidReg;
/** boolean variable to control visibility of GUI elements*/
bool m_ValidInput;
/** boolean variable to control visibility of GUI elements*/
bool m_ValidRef;
/** used for the internal logic to indicate of the current settings
are set for mapping binary images (used by ConfigureMappingControls()).*/
bool m_preparedForBinaryInput;
};
#endif // MatchPoint_h
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.h b/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.h
index 41e5da3db4..ff100e84f7 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.h
+++ b/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.h
@@ -1,158 +1,158 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef __Q_MITK_MATCHPOINT_REGISTRATION_VISUALIZER_H
#define __Q_MITK_MATCHPOINT_REGISTRATION_VISUALIZER_H
#include <vtkPolyData.h>
#include <vtkSmartPointer.h>
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include <QSortFilterProxyModel>
#include "mitkMAPRegistrationWrapper.h"
#include "ui_QmitkMatchPointRegistrationVisualizer.h"
/*!
\brief QmitkMatchPointRegistrationVisualizer
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\sa QmitkFunctionality
\ingroup ${plugin_target}_internal
*/
class QmitkMatchPointRegistrationVisualizer : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
* Creates smartpointer typedefs
*/
- berryObjectMacro(QmitkMatchPointRegistrationVisualizer)
+ berryObjectMacro(QmitkMatchPointRegistrationVisualizer);
QmitkMatchPointRegistrationVisualizer();
void CreateQtPartControl(QWidget* parent) override;
/** Returns the registration currently handled by the plugin.
* May return nullptr, if no registration is selected/handled by
* the plugin*/
mitk::MAPRegistrationWrapper* GetCurrentRegistration();
protected slots:
/**
* @brief Connect all GUI elements to its corresponding slots
*/
virtual void CreateConnections();
void OnLockRegButtonPushed();
void OnStyleButtonPushed();
void OnDirectionChanged(int index);
void OnUseFOVRefBtnPushed();
void OnUpdateBtnPushed();
void OnColorInterpolationChecked(bool);
protected:
void SetFocus() override;
/// \brief called by QmitkFunctionality when DataManager's selection has changed
void OnSelectionChanged(berry::IWorkbenchPart::Pointer source,
const QList<mitk::DataNode::Pointer>& nodes) override;
void ActualizeRegInfo(mitk::MAPRegistrationWrapper* currentReg);
Ui::MatchPointRegVisControls* m_Controls;
private:
QWidget* m_Parent;
void Error(QString msg);
void CheckInputs();
/** Function returns the first data node containing a registration wrapper
* in the current selection of the data manager. If nothing is selected or
* no registration wrapper is selected it return nullptr.*/
mitk::DataNode::Pointer GetSelectedRegNode() const;
/** If a registration node is set, this function determines the relevant referenced node.
* The reference node is the node of the target or moving data (depending on the selected directions)
* used to determine the* registration object.
* @return Pointer to the reference node (moving or target data of the registration algorithm run).
* Function may return nullptr if the referenced node cannot be found or is not defined
* by the registration.*/
mitk::DataNode::Pointer GetRefNodeOfReg(bool target) const;
/** Methods returns the first node selected in the data manager that does
* NOT contain a registration wrapper and has a data pointer with a geometry.
* Returned pointer may be nullptr if nothing is selected or no appropriate data
* node is selected.*/
mitk::DataNode::Pointer GetSelectedDataNode();
/** Methods checks if the given gridRes is larger than maxGridRes and scales down the spacing if necessary.
* @param gridRes the resolution of the "grid".
* @param spacing the spacing that would be used on the grid.
* @param maxGridRes the maximum resolution of the "grid".*/
mitk::ScalarType GetSaveSpacing(mitk::ScalarType gridRes, mitk::ScalarType spacing,
unsigned int maxGridRes) const;
/**
* Checks for mandatory node properties and defines them with default values if they are missing.*/
void InitRegNode();
/**
* Updates the gui controls regarding the current state of the instance.*/
void ConfigureVisualizationControls();
/**
* Updates the properties of the selected node according to the states of the gui controls.*/
void StoreStateInNode();
/**
* Updates the state of the gui controls according to the properties of the selected node.*/
void LoadStateFromNode();
/**
* Checks accordung to the current direction if there is a default FOV ref and sets it,
* if the current FOV ref is not locked.*/
void CheckAndSetDefaultFOVRef();
void UpdateOrientationMatrixWidget();
/**indicates if the gui updates is triggered internally or by user. Needed to
* avoid update loops by ConfigureVisualizationControlls();*/
bool m_internalUpdateGuard;
mitk::DataNode::Pointer m_spSelectedFOVRefNode;
mitk::DataNode::Pointer m_spSelectedRegNode;
/**Used to store informations about the FOV reference orientation. Default is identity matrix.*/
mitk::AffineTransform3D::MatrixType m_FOVRefOrientation;
};
#endif // MatchPoint_h
diff --git a/Plugins/org.mitk.gui.qt.properties/src/internal/QmitkPropertyTreeView.cpp b/Plugins/org.mitk.gui.qt.properties/src/internal/QmitkPropertyTreeView.cpp
index 98933fe429..e70d8edae3 100644
--- a/Plugins/org.mitk.gui.qt.properties/src/internal/QmitkPropertyTreeView.cpp
+++ b/Plugins/org.mitk.gui.qt.properties/src/internal/QmitkPropertyTreeView.cpp
@@ -1,456 +1,439 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "mitkGetPropertyService.h"
#include "QmitkAddNewPropertyDialog.h"
#include "QmitkPropertiesPreferencePage.h"
#include "QmitkPropertyItemDelegate.h"
#include "QmitkPropertyItemModel.h"
#include "QmitkPropertyItemSortFilterProxyModel.h"
#include "QmitkPropertyTreeView.h"
#include <berryIBerryPreferences.h>
#include <berryQtStyleManager.h>
#include <mitkIPropertyAliases.h>
#include <mitkIPropertyDescriptions.h>
#include <mitkIPropertyPersistence.h>
#include <QmitkRenderWindow.h>
#include <QPainter>
#include <memory>
const std::string QmitkPropertyTreeView::VIEW_ID = "org.mitk.views.properties";
QmitkPropertyTreeView::QmitkPropertyTreeView()
- : m_Parent(nullptr),
- m_PropertyNameChangedTag(0),
- m_PropertyAliases(nullptr),
+ : m_PropertyAliases(nullptr),
m_PropertyDescriptions(nullptr),
m_PropertyPersistence(nullptr),
m_ShowAliasesInDescription(true),
m_ShowPersistenceInDescription(true),
m_DeveloperMode(false),
m_ProxyModel(nullptr),
m_Model(nullptr),
m_Delegate(nullptr),
m_Renderer(nullptr)
{
}
QmitkPropertyTreeView::~QmitkPropertyTreeView()
{
}
-void QmitkPropertyTreeView::CreateQtPartControl(QWidget* parent)
+void QmitkPropertyTreeView::SetFocus()
+{
+ m_Controls.filterLineEdit->setFocus();
+}
+
+void QmitkPropertyTreeView::RenderWindowPartActivated(mitk::IRenderWindowPart* /*renderWindowPart*/)
{
- m_Parent = parent;
+ if (m_Controls.propertyListComboBox->count() == 2)
+ {
+ QHash<QString, QmitkRenderWindow*> renderWindows = this->GetRenderWindowPart()->GetQmitkRenderWindows();
+ Q_FOREACH(QString renderWindow, renderWindows.keys())
+ {
+ m_Controls.propertyListComboBox->insertItem(m_Controls.propertyListComboBox->count() - 1, QString("Data node: ") + renderWindow);
+ }
+ }
+}
+
+void QmitkPropertyTreeView::RenderWindowPartDeactivated(mitk::IRenderWindowPart*)
+{
+ if (m_Controls.propertyListComboBox->count() > 2)
+ {
+ m_Controls.propertyListComboBox->clear();
+ m_Controls.propertyListComboBox->addItem("Data node: common");
+ m_Controls.propertyListComboBox->addItem("Base data");
+ }
+}
+
+void QmitkPropertyTreeView::CreateQtPartControl(QWidget* parent)
+{
m_Controls.setupUi(parent);
m_Controls.propertyListComboBox->addItem("Data node: common");
mitk::IRenderWindowPart* renderWindowPart = this->GetRenderWindowPart();
-
if (renderWindowPart != nullptr)
{
QHash<QString, QmitkRenderWindow*> renderWindows = renderWindowPart->GetQmitkRenderWindows();
- Q_FOREACH(QString renderWindow, renderWindows.keys())
+ for(const auto& renderWindow : renderWindows.keys())
{
m_Controls.propertyListComboBox->addItem(QString("Data node: ") + renderWindow);
}
}
m_Controls.propertyListComboBox->addItem("Base data");
m_Controls.newButton->setEnabled(false);
this->HideAllIcons();
m_Controls.descriptionLabel->hide();
m_Controls.propertyListLabel->hide();
m_Controls.propertyListComboBox->hide();
m_Controls.newButton->hide();
m_ProxyModel = new QmitkPropertyItemSortFilterProxyModel(m_Controls.treeView);
m_Model = new QmitkPropertyItemModel(m_ProxyModel);
m_ProxyModel->setSourceModel(m_Model);
m_ProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
m_ProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
m_ProxyModel->setDynamicSortFilter(true);
m_Delegate = new QmitkPropertyItemDelegate(m_Controls.treeView);
+ m_Controls.singleSlot->SetDataStorage(GetDataStorage());
+ m_Controls.singleSlot->SetSelectionIsOptional(true);
+ m_Controls.singleSlot->SetEmptyInfo(QString("Please select a data node"));
+ m_Controls.singleSlot->SetPopUpTitel(QString("Select data node"));
+
+ m_SelectionServiceConnector = std::make_unique<QmitkSelectionServiceConnector>();
+ SetAsSelectionListener(true);
+
m_Controls.filterLineEdit->setClearButtonEnabled(true);
m_Controls.treeView->setItemDelegateForColumn(1, m_Delegate);
m_Controls.treeView->setModel(m_ProxyModel);
m_Controls.treeView->setColumnWidth(0, 160);
m_Controls.treeView->sortByColumn(0, Qt::AscendingOrder);
m_Controls.treeView->setSelectionBehavior(QAbstractItemView::SelectRows);
m_Controls.treeView->setSelectionMode(QAbstractItemView::SingleSelection);
m_Controls.treeView->setEditTriggers(QAbstractItemView::SelectedClicked | QAbstractItemView::DoubleClicked);
const int ICON_SIZE = 32;
auto icon = berry::QtStyleManager::ThemeIcon(QStringLiteral(":/org_mitk_icons/icons/awesome/scalable/tags.svg"));
m_Controls.tagsLabel->setPixmap(icon.pixmap(ICON_SIZE));
icon = berry::QtStyleManager::ThemeIcon(QStringLiteral(":/org_mitk_icons/icons/awesome/scalable/tag.svg"));
m_Controls.tagLabel->setPixmap(icon.pixmap(ICON_SIZE));
icon = berry::QtStyleManager::ThemeIcon(QStringLiteral(":/org_mitk_icons/icons/awesome/scalable/actions/document-save.svg"));
m_Controls.saveLabel->setPixmap(icon.pixmap(ICON_SIZE));
- connect(m_Controls.filterLineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(OnFilterTextChanged(const QString&)));
- connect(m_Controls.propertyListComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(OnPropertyListChanged(int)));
- connect(m_Controls.newButton, SIGNAL(clicked()), this, SLOT(OnAddNewProperty()));
- connect(m_Controls.treeView->selectionModel(), SIGNAL(currentRowChanged(const QModelIndex&, const QModelIndex&)), this, SLOT(OnCurrentRowChanged(const QModelIndex&, const QModelIndex&)));
- connect(m_Model, SIGNAL(modelReset()), this, SLOT(OnModelReset()));
+ connect(m_Controls.singleSlot, &QmitkSingleNodeSelectionWidget::CurrentSelectionChanged,
+ this, &QmitkPropertyTreeView::OnCurrentSelectionChanged);
+ connect(m_Controls.filterLineEdit, &QLineEdit::textChanged,
+ this, &QmitkPropertyTreeView::OnFilterTextChanged);
+ connect(m_Controls.propertyListComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
+ this, &QmitkPropertyTreeView::OnPropertyListChanged);
+ connect(m_Controls.newButton, &QPushButton::clicked,
+ this, &QmitkPropertyTreeView::OnAddNewProperty);
+ connect(m_Controls.treeView->selectionModel(), &QItemSelectionModel::currentRowChanged,
+ this, &QmitkPropertyTreeView::OnCurrentRowChanged);
+ connect(m_Model, &QmitkPropertyItemModel::modelReset,
+ this, &QmitkPropertyTreeView::OnModelReset);
+}
+
+void QmitkPropertyTreeView::OnPreferencesChanged(const berry::IBerryPreferences* preferences)
+{
+ bool showAliases = preferences->GetBool(QmitkPropertiesPreferencePage::SHOW_ALIASES, true);
+ bool showDescriptions = preferences->GetBool(QmitkPropertiesPreferencePage::SHOW_DESCRIPTIONS, true);
+ bool showAliasesInDescription = preferences->GetBool(QmitkPropertiesPreferencePage::SHOW_ALIASES_IN_DESCRIPTION, true);
+ bool showPersistenceInDescription = preferences->GetBool(QmitkPropertiesPreferencePage::SHOW_PERSISTENCE_IN_DESCRIPTION, true);
+ bool developerMode = preferences->GetBool(QmitkPropertiesPreferencePage::DEVELOPER_MODE, false);
+ bool filterProperties = preferences->GetBool(QmitkPropertiesPreferencePage::FILTER_PROPERTIES, true);
+
+ m_Model->SetFilterProperties(filterProperties);
+ m_Model->SetShowAliases(showAliases);
+
+ bool updateAliases = showAliases != (m_PropertyAliases != nullptr);
+ bool updateDescriptions = showDescriptions != (m_PropertyDescriptions != nullptr);
+ bool updateAliasesInDescription = showAliasesInDescription != m_ShowAliasesInDescription;
+ bool updatePersistenceInDescription = showPersistenceInDescription != m_ShowPersistenceInDescription;
+ bool updateDeveloperMode = developerMode != m_DeveloperMode;
+
+ if (updateAliases)
+ m_PropertyAliases = showAliases
+ ? mitk::GetPropertyService<mitk::IPropertyAliases>()
+ : nullptr;
+
+ if (updateDescriptions)
+ m_PropertyDescriptions = showDescriptions
+ ? mitk::GetPropertyService<mitk::IPropertyDescriptions>()
+ : nullptr;
+
+ if (showPersistenceInDescription)
+ m_PropertyPersistence = mitk::GetPropertyService<mitk::IPropertyPersistence>();
+
+ if (updateAliasesInDescription)
+ m_ShowAliasesInDescription = showAliasesInDescription;
+
+ if (updatePersistenceInDescription)
+ m_ShowPersistenceInDescription = showPersistenceInDescription;
+
+ if (updateDescriptions || updateAliasesInDescription || updatePersistenceInDescription)
+ {
+ QModelIndexList selection = m_Controls.treeView->selectionModel()->selectedRows();
+
+ if (!selection.isEmpty())
+ this->OnCurrentRowChanged(selection[0], selection[0]);
+ }
+
+ if (updateDeveloperMode)
+ {
+ m_DeveloperMode = developerMode;
+
+ if (!developerMode)
+ m_Controls.propertyListComboBox->setCurrentIndex(0);
+
+ m_Controls.propertyListLabel->setVisible(developerMode);
+ m_Controls.propertyListComboBox->setVisible(developerMode);
+ m_Controls.newButton->setVisible(developerMode);
+ }
+
+ m_Model->OnPreferencesChanged();
+}
+
+void QmitkPropertyTreeView::SetAsSelectionListener(bool checked)
+{
+ if (checked)
+ {
+ m_SelectionServiceConnector->AddPostSelectionListener(GetSite()->GetWorkbenchWindow()->GetSelectionService());
+ connect(m_SelectionServiceConnector.get(), &QmitkSelectionServiceConnector::ServiceSelectionChanged, m_Controls.singleSlot, &QmitkSingleNodeSelectionWidget::SetCurrentSelection);
+ }
+ else
+ {
+ m_SelectionServiceConnector->RemovePostSelectionListener();
+ disconnect(m_SelectionServiceConnector.get(), &QmitkSelectionServiceConnector::ServiceSelectionChanged, m_Controls.singleSlot, &QmitkSingleNodeSelectionWidget::SetCurrentSelection);
+ }
}
QString QmitkPropertyTreeView::GetPropertyNameOrAlias(const QModelIndex& index)
{
QString propertyName;
if (index.isValid())
{
QModelIndex current = index;
while (current.isValid())
{
QString name = m_ProxyModel->data(m_ProxyModel->index(current.row(), 0, current.parent())).toString();
propertyName.prepend(propertyName.isEmpty()
? name
: name.append('.'));
current = current.parent();
}
}
return propertyName;
}
+void QmitkPropertyTreeView::OnCurrentSelectionChanged(QList<mitk::DataNode::Pointer> nodes)
+{
+ if (nodes.empty() || nodes.front().IsNull())
+ {
+ m_SelectedNode = nullptr;
+
+ this->SetPartName("Properties");
+ m_Model->SetPropertyList(nullptr);
+ m_Delegate->SetPropertyList(nullptr);
+
+ m_Controls.newButton->setEnabled(false);
+
+ return;
+ }
+
+ // node is selected, create tree with node properties
+ m_SelectedNode = nodes.front();
+ mitk::PropertyList* propertyList = m_Model->GetPropertyList();
+ if (m_Renderer == nullptr && m_Controls.propertyListComboBox->currentText() == "Base data")
+ {
+ propertyList = m_SelectedNode->GetData() != nullptr
+ ? m_SelectedNode->GetData()->GetPropertyList()
+ : nullptr;
+ }
+ else
+ {
+ propertyList = m_SelectedNode->GetPropertyList(m_Renderer);
+ }
+
+ QString selectionClassName = m_SelectedNode->GetData() != nullptr
+ ? m_SelectedNode->GetData()->GetNameOfClass()
+ : "";
+
+ m_SelectionClassName = selectionClassName.toStdString();
+
+ m_Model->SetPropertyList(propertyList, selectionClassName);
+ m_Delegate->SetPropertyList(propertyList);
+
+ m_Controls.newButton->setEnabled(true);
+
+ if (!m_ProxyModel->filterRegExp().isEmpty())
+ {
+ m_Controls.treeView->expandAll();
+ }
+}
+
+void QmitkPropertyTreeView::HideAllIcons()
+{
+ m_Controls.tagLabel->hide();
+ m_Controls.tagsLabel->hide();
+ m_Controls.saveLabel->hide();
+}
+
void QmitkPropertyTreeView::OnCurrentRowChanged(const QModelIndex& current, const QModelIndex&)
{
if (m_PropertyDescriptions != nullptr && current.isValid())
{
QString name = this->GetPropertyNameOrAlias(current);
if (!name.isEmpty())
{
QString alias;
bool isTrueName = true;
if (m_PropertyAliases != nullptr)
{
std::string trueName = m_PropertyAliases->GetPropertyName(name.toStdString());
if (trueName.empty() && !m_SelectionClassName.empty())
trueName = m_PropertyAliases->GetPropertyName(name.toStdString(), m_SelectionClassName);
if (!trueName.empty())
{
alias = name;
name = QString::fromStdString(trueName);
isTrueName = false;
}
}
QString description = QString::fromStdString(m_PropertyDescriptions->GetDescription(name.toStdString()));
std::vector<std::string> aliases;
if (!isTrueName && m_PropertyAliases != nullptr)
{
aliases = m_PropertyAliases->GetAliases(name.toStdString(), m_SelectionClassName);
if (aliases.empty() && !m_SelectionClassName.empty())
aliases = m_PropertyAliases->GetAliases(name.toStdString());
}
bool isPersistent = false;
if (m_PropertyPersistence != nullptr)
isPersistent = m_PropertyPersistence->HasInfo(name.toStdString());
if (!description.isEmpty() || !aliases.empty() || isPersistent)
{
QString customizedDescription;
if (m_ShowAliasesInDescription && !aliases.empty())
{
customizedDescription = "<h3 style=\"margin-bottom:0\">" + name + "</h3>";
std::size_t numAliases = aliases.size();
std::size_t lastAlias = numAliases - 1;
for (std::size_t i = 0; i < numAliases; ++i)
{
customizedDescription += i != lastAlias
? "<h5 style=\"margin-top:0;margin-bottom:0\">"
: "<h5 style=\"margin-top:0;margin-bottom:10px\">";
customizedDescription += QString::fromStdString(aliases[i]) + "</h5>";
}
}
else
{
customizedDescription = "<h3 style=\"margin-bottom:10px\">" + name + "</h3>";
}
if (!description.isEmpty())
customizedDescription += "<p>" + description + "</p>";
m_Controls.tagsLabel->setVisible(!aliases.empty() && aliases.size() > 1);
m_Controls.tagLabel->setVisible(!aliases.empty() && aliases.size() == 1);
m_Controls.saveLabel->setVisible(isPersistent);
m_Controls.descriptionLabel->setText(customizedDescription);
m_Controls.descriptionLabel->show();
return;
}
}
}
m_Controls.descriptionLabel->hide();
this->HideAllIcons();
}
-void QmitkPropertyTreeView::OnFilterTextChanged(const QString& filter)
-{
- m_ProxyModel->setFilterWildcard(filter);
-
- if (filter.isEmpty())
- m_Controls.treeView->collapseAll();
- else
- m_Controls.treeView->expandAll();
-}
-
-void QmitkPropertyTreeView::OnModelReset()
-{
- m_Controls.descriptionLabel->hide();
- this->HideAllIcons();
-}
-
-void QmitkPropertyTreeView::OnPreferencesChanged(const berry::IBerryPreferences* preferences)
-{
- bool showAliases = preferences->GetBool(QmitkPropertiesPreferencePage::SHOW_ALIASES, true);
- bool showDescriptions = preferences->GetBool(QmitkPropertiesPreferencePage::SHOW_DESCRIPTIONS, true);
- bool showAliasesInDescription = preferences->GetBool(QmitkPropertiesPreferencePage::SHOW_ALIASES_IN_DESCRIPTION, true);
- bool showPersistenceInDescription = preferences->GetBool(QmitkPropertiesPreferencePage::SHOW_PERSISTENCE_IN_DESCRIPTION, true);
- bool developerMode = preferences->GetBool(QmitkPropertiesPreferencePage::DEVELOPER_MODE, false);
- bool filterProperties = preferences->GetBool(QmitkPropertiesPreferencePage::FILTER_PROPERTIES, true);
-
- m_Model->SetFilterProperties(filterProperties);
- m_Model->SetShowAliases(showAliases);
-
- bool updateAliases = showAliases != (m_PropertyAliases != nullptr);
- bool updateDescriptions = showDescriptions != (m_PropertyDescriptions != nullptr);
- bool updateAliasesInDescription = showAliasesInDescription != m_ShowAliasesInDescription;
- bool updatePersistenceInDescription = showPersistenceInDescription != m_ShowPersistenceInDescription;
- bool updateDeveloperMode = developerMode != m_DeveloperMode;
-
- if (updateAliases)
- m_PropertyAliases = showAliases
- ? mitk::GetPropertyService<mitk::IPropertyAliases>()
- : nullptr;
-
- if (updateDescriptions)
- m_PropertyDescriptions = showDescriptions
- ? mitk::GetPropertyService<mitk::IPropertyDescriptions>()
- : nullptr;
-
- if (showPersistenceInDescription)
- m_PropertyPersistence = mitk::GetPropertyService<mitk::IPropertyPersistence>();
-
- if (updateAliasesInDescription)
- m_ShowAliasesInDescription = showAliasesInDescription;
-
- if (updatePersistenceInDescription)
- m_ShowPersistenceInDescription = showPersistenceInDescription;
-
- if (updateDescriptions || updateAliasesInDescription || updatePersistenceInDescription)
- {
- QModelIndexList selection = m_Controls.treeView->selectionModel()->selectedRows();
-
- if (!selection.isEmpty())
- this->OnCurrentRowChanged(selection[0], selection[0]);
- }
-
- if (updateDeveloperMode)
- {
- m_DeveloperMode = developerMode;
-
- if (!developerMode)
- m_Controls.propertyListComboBox->setCurrentIndex(0);
-
- m_Controls.propertyListLabel->setVisible(developerMode);
- m_Controls.propertyListComboBox->setVisible(developerMode);
- m_Controls.newButton->setVisible(developerMode);
- }
-
- m_Model->OnPreferencesChanged();
-}
-
-void QmitkPropertyTreeView::OnPropertyNameChanged(const itk::EventObject&)
-{
- mitk::PropertyList* propertyList = m_Model->GetPropertyList();
-
- if (propertyList != nullptr)
- {
- mitk::BaseProperty* nameProperty = propertyList->GetProperty("name");
-
- if (nameProperty != nullptr)
- {
- QString partName = "Properties (";
- partName.append(QString::fromStdString(nameProperty->GetValueAsString())).append(')');
- this->SetPartName(partName);
- }
- }
-}
-
-void QmitkPropertyTreeView::OnSelectionChanged(berry::IWorkbenchPart::Pointer, const QList<mitk::DataNode::Pointer>& nodes)
-{
- mitk::PropertyList* propertyList = m_Model->GetPropertyList();
-
- if (propertyList != nullptr)
- {
- mitk::BaseProperty* nameProperty = propertyList->GetProperty("name");
-
- if (nameProperty != nullptr)
- nameProperty->RemoveObserver(m_PropertyNameChangedTag);
-
- m_PropertyNameChangedTag = 0;
- }
-
- if (nodes.empty() || nodes.front().IsNull())
- {
- m_SelectedNode = nullptr;
-
- this->SetPartName("Properties");
- m_Model->SetPropertyList(nullptr);
- m_Delegate->SetPropertyList(nullptr);
-
- m_Controls.newButton->setEnabled(false);
- }
- else
- {
- m_SelectedNode = nodes.front();
-
- QString selectionClassName = m_SelectedNode->GetData() != nullptr
- ? m_SelectedNode->GetData()->GetNameOfClass()
- : "";
-
- m_SelectionClassName = selectionClassName.toStdString();
-
- mitk::PropertyList::Pointer propertyList;
-
- if (m_Renderer == nullptr && m_Controls.propertyListComboBox->currentText() == "Base data")
- {
- propertyList = m_SelectedNode->GetData() != nullptr
- ? m_SelectedNode->GetData()->GetPropertyList()
- : nullptr;
- }
- else
- {
- propertyList = m_SelectedNode->GetPropertyList(m_Renderer);
- }
-
- m_Model->SetPropertyList(propertyList, selectionClassName);
- m_Delegate->SetPropertyList(propertyList);
-
- OnPropertyNameChanged(itk::ModifiedEvent());
-
- mitk::BaseProperty* nameProperty = m_SelectedNode->GetProperty("name");
-
- if (nameProperty != nullptr)
- {
- itk::ReceptorMemberCommand<QmitkPropertyTreeView>::Pointer command = itk::ReceptorMemberCommand<QmitkPropertyTreeView>::New();
- command->SetCallbackFunction(this, &QmitkPropertyTreeView::OnPropertyNameChanged);
- m_PropertyNameChangedTag = nameProperty->AddObserver(itk::ModifiedEvent(), command);
- }
-
- m_Controls.newButton->setEnabled(true);
- }
-
- if (!m_ProxyModel->filterRegExp().isEmpty())
- m_Controls.treeView->expandAll();
-}
-
-void QmitkPropertyTreeView::SetFocus()
-{
- m_Controls.filterLineEdit->setFocus();
-}
-
-void QmitkPropertyTreeView::RenderWindowPartActivated(mitk::IRenderWindowPart* /*renderWindowPart*/)
-{
- if (m_Controls.propertyListComboBox->count() == 2)
- {
- QHash<QString, QmitkRenderWindow*> renderWindows = this->GetRenderWindowPart()->GetQmitkRenderWindows();
-
- Q_FOREACH(QString renderWindow, renderWindows.keys())
- {
- m_Controls.propertyListComboBox->insertItem(m_Controls.propertyListComboBox->count() - 1, QString("Data node: ") + renderWindow);
- }
- }
-}
-
-void QmitkPropertyTreeView::RenderWindowPartDeactivated(mitk::IRenderWindowPart*)
-{
- if (m_Controls.propertyListComboBox->count() > 2)
- {
- m_Controls.propertyListComboBox->clear();
- m_Controls.propertyListComboBox->addItem("Data node: common");
- m_Controls.propertyListComboBox->addItem("Base data");
- }
-}
-
void QmitkPropertyTreeView::OnPropertyListChanged(int index)
{
if (index == -1)
return;
QString renderer = m_Controls.propertyListComboBox->itemText(index);
if (renderer.startsWith("Data node: "))
renderer = QString::fromStdString(renderer.toStdString().substr(11));
m_Renderer = renderer != "common" && renderer != "Base data"
? this->GetRenderWindowPart()->GetQmitkRenderWindow(renderer)->GetRenderer()
: nullptr;
QList<mitk::DataNode::Pointer> nodes;
if (m_SelectedNode.IsNotNull())
nodes << m_SelectedNode;
- berry::IWorkbenchPart::Pointer workbenchPart;
-
- this->OnSelectionChanged(workbenchPart, nodes);
+ this->OnCurrentSelectionChanged(nodes);
}
void QmitkPropertyTreeView::OnAddNewProperty()
{
std::unique_ptr<QmitkAddNewPropertyDialog> dialog(m_Controls.propertyListComboBox->currentText() != "Base data"
- ? new QmitkAddNewPropertyDialog(m_SelectedNode, m_Renderer, m_Parent)
- : new QmitkAddNewPropertyDialog(m_SelectedNode->GetData()));
+ ? new QmitkAddNewPropertyDialog(m_SelectedNode, m_Renderer)
+ : new QmitkAddNewPropertyDialog(m_SelectedNode->GetData()));
if (dialog->exec() == QDialog::Accepted)
this->m_Model->Update();
}
-void QmitkPropertyTreeView::HideAllIcons()
+void QmitkPropertyTreeView::OnFilterTextChanged(const QString& filter)
{
- m_Controls.tagLabel->hide();
- m_Controls.tagsLabel->hide();
- m_Controls.saveLabel->hide();
+ m_ProxyModel->setFilterWildcard(filter);
+
+ if (filter.isEmpty())
+ m_Controls.treeView->collapseAll();
+ else
+ m_Controls.treeView->expandAll();
+}
+
+void QmitkPropertyTreeView::OnModelReset()
+{
+ m_Controls.descriptionLabel->hide();
+ this->HideAllIcons();
}
diff --git a/Plugins/org.mitk.gui.qt.properties/src/internal/QmitkPropertyTreeView.h b/Plugins/org.mitk.gui.qt.properties/src/internal/QmitkPropertyTreeView.h
index 4c5c23f6c1..f0621609a7 100644
--- a/Plugins/org.mitk.gui.qt.properties/src/internal/QmitkPropertyTreeView.h
+++ b/Plugins/org.mitk.gui.qt.properties/src/internal/QmitkPropertyTreeView.h
@@ -1,84 +1,99 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkPropertyTreeView_h
#define QmitkPropertyTreeView_h
+#include <ui_QmitkPropertyTreeView.h>
+
+// mitk core module
#include <mitkDataNode.h>
+
+// mitk gui common plugin
#include <mitkIRenderWindowPartListener.h>
+
+// mitk gui qt common plugin
#include <QmitkAbstractView.h>
-#include <ui_QmitkPropertyTreeView.h>
+#include "QmitkSelectionServiceConnector.h"
class QmitkPropertyItemDelegate;
class QmitkPropertyItemModel;
class QmitkPropertyItemSortFilterProxyModel;
namespace mitk
{
class IPropertyAliases;
class IPropertyDescriptions;
class IPropertyPersistence;
}
class QmitkPropertyTreeView : public QmitkAbstractView, public mitk::IRenderWindowPartListener
{
Q_OBJECT
public:
+
static const std::string VIEW_ID;
berryObjectMacro(QmitkPropertyTreeView);
QmitkPropertyTreeView();
~QmitkPropertyTreeView() override;
void SetFocus() override;
void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart*) override;
protected:
+
void CreateQtPartControl(QWidget* parent) override;
private:
- QString GetPropertyNameOrAlias(const QModelIndex& index);
+
void OnPreferencesChanged(const berry::IBerryPreferences* preferences) override;
- void OnPropertyNameChanged(const itk::EventObject& event);
- void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override;
+
+ void SetAsSelectionListener(bool checked);
+
+ QString GetPropertyNameOrAlias(const QModelIndex& index);
+
+ void OnCurrentSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
void HideAllIcons();
-private slots:
+private Q_SLOTS:
+
void OnCurrentRowChanged(const QModelIndex& current, const QModelIndex& previous);
void OnPropertyListChanged(int index);
void OnAddNewProperty();
void OnFilterTextChanged(const QString& filter);
void OnModelReset();
private:
- QWidget* m_Parent;
- unsigned long m_PropertyNameChangedTag;
+
std::string m_SelectionClassName;
mitk::IPropertyAliases* m_PropertyAliases;
mitk::IPropertyDescriptions* m_PropertyDescriptions;
mitk::IPropertyPersistence* m_PropertyPersistence;
bool m_ShowAliasesInDescription;
bool m_ShowPersistenceInDescription;
bool m_DeveloperMode;
Ui::QmitkPropertyTreeView m_Controls;
QmitkPropertyItemSortFilterProxyModel* m_ProxyModel;
QmitkPropertyItemModel* m_Model;
QmitkPropertyItemDelegate* m_Delegate;
mitk::DataNode::Pointer m_SelectedNode;
mitk::BaseRenderer* m_Renderer;
+
+ std::unique_ptr<QmitkSelectionServiceConnector> m_SelectionServiceConnector;
};
#endif
diff --git a/Plugins/org.mitk.gui.qt.properties/src/internal/QmitkPropertyTreeView.ui b/Plugins/org.mitk.gui.qt.properties/src/internal/QmitkPropertyTreeView.ui
index f572c39667..d1c7d1acce 100644
--- a/Plugins/org.mitk.gui.qt.properties/src/internal/QmitkPropertyTreeView.ui
+++ b/Plugins/org.mitk.gui.qt.properties/src/internal/QmitkPropertyTreeView.ui
@@ -1,208 +1,249 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QmitkPropertyTreeView</class>
<widget class="QWidget" name="QmitkPropertyTreeView">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>300</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="selectedDataNodeLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Selected data node</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QmitkSingleNodeSelectionWidget" name="singleSlot" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>40</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="propertyListLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Property List</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="propertyListComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="newButton">
<property name="toolTip">
<string>Add new property</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../resources/Properties.qrc">
<normaloff>:/Properties/new.png</normaloff>:/Properties/new.png</iconset>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLineEdit" name="filterLineEdit">
<property name="placeholderText">
<string>Filter</string>
</property>
</widget>
</item>
<item>
<widget class="QTreeView" name="treeView">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="styleSheet">
<string notr="true">::item {
border-right: 1px solid palette(midlight);
padding-bottom: 1px;
padding-top: 1px;
}
::item:last {
border-right: 0;
}
::item:selected {
background: palette(highlight);
color: palette(highlighted-text);
}</string>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<attribute name="headerDefaultSectionSize">
<number>54</number>
</attribute>
</widget>
</item>
<item>
<widget class="QLabel" name="descriptionLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="iconLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="tagLabel">
<property name="minimumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="tagsLabel">
<property name="minimumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="saveLabel">
<property name="minimumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
+ <customwidgets>
+ <customwidget>
+ <class>QmitkSingleNodeSelectionWidget</class>
+ <extends>QWidget</extends>
+ <header location="global">QmitkSingleNodeSelectionWidget.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
<resources>
<include location="../../resources/Properties.qrc"/>
</resources>
<connections/>
</ui>
diff --git a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatEditor.h b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatEditor.h
index 19cccb9023..b4f0e0635d 100644
--- a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatEditor.h
+++ b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatEditor.h
@@ -1,122 +1,122 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QMITKXNATEDITOR_h
#define QMITKXNATEDITOR_h
#include <berryIReusableEditor.h>
#include <berryQtEditorPart.h>
#include <berryISelectionListener.h>
#include <mitkIDataStorageService.h>
#include <QmitkAbstractView.h>
#include "ui_QmitkXnatEditorControls.h"
#include "ctkXnatListModel.h"
#include "ctkXnatSession.h"
#include <ctkServiceTracker.h>
#include "mitkXnatSessionTracker.h"
/*!
\brief QmitkXnatEditor
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\ingroup ${plugin_target}_internal
*/
class QmitkXnatEditor : public berry::QtEditorPart, public berry::IReusableEditor
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
- berryObjectMacro(QmitkXnatEditor)
+ berryObjectMacro(QmitkXnatEditor);
QmitkXnatEditor();
~QmitkXnatEditor();
static const QString EDITOR_ID;
void CreateQtPartControl(QWidget *parent) override;
void DoSave(/*IProgressMonitor monitor*/) override;
void DoSaveAs() override;
void Init(berry::IEditorSite::Pointer site, berry::IEditorInput::Pointer input) override;
bool IsDirty() const override;
bool IsSaveAsAllowed() const override;
void SetInput(berry::IEditorInput::Pointer input) override;
/**
\brief Here the root object will be set and the view reset. Additionally the breadcrumbs will set visible.
*/
void UpdateList();
protected slots:
/**
\brief Any XNAT resource (file or folder) will be downloaded to the chosen download path.
*/
void DownloadResource();
/**
\brief Every time you activate a node in the list, the root item will be updated to a child of the previous parent.\
In exception of the node is a file. The file will be downloaded and loaded to the DataManager.
*/
void OnObjectActivated(const QModelIndex& index);
// Breadcrumb button slots
void OnDataModelButtonClicked();
void OnProjectButtonClicked();
void OnSubjectButtonClicked();
void OnExperimentButtonClicked();
void OnKindOfDataButtonClicked();
void OnSessionButtonClicked();
void OnResourceButtonClicked();
/// \brief Updates the ctkXnatSession and the user interface
void UpdateSession(ctkXnatSession* session);
void CleanListModel(ctkXnatSession* session);
void itemSelected(const QModelIndex &index);
protected:
virtual void SetFocus() override;
Ui::QmitkXnatEditorControls m_Controls;
private:
int m_ParentCount;
QString m_DownloadPath;
ctkServiceTracker<mitk::IDataStorageService*> m_DataStorageServiceTracker;
void InternalFileDownload(const QModelIndex& index);
int ParentChecker(ctkXnatObject* child);
void ToHigherLevel();
ctkXnatListModel* m_ListModel;
ctkXnatSession* m_Session;
mitk::XnatSessionTracker* m_Tracker;
QScopedPointer<berry::ISelectionListener> m_SelectionListener;
void SelectionChanged(const berry::IWorkbenchPart::Pointer& sourcepart,
const berry::ISelection::ConstPointer& selection);
};
#endif // QMITKXNATEDITOR_h
diff --git a/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoObject.h b/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoObject.h
index dcab93d9ba..567bf2b9ff 100644
--- a/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoObject.h
+++ b/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoObject.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef _MITK_MAP_ALGORITHM_INFO_OBJECT_H
#define _MITK_MAP_ALGORITHM_INFO_OBJECT_H
#include <berryObject.h>
#include <berryMacros.h>
#include <mapDeploymentDLLInfo.h>
#include "org_mitk_matchpoint_core_helper_Export.h"
namespace mitk
{
/**
* @Class berry wrapper for a MatchPoint algorithm deployment info
* Used by mitk::MAPAlgorithmInfoSelection.
*/
class MITK_MATCHPOINT_CORE_HELPER_EXPORT MAPAlgorithmInfoObject : public berry::Object
{
public:
- berryObjectMacro(mitk::MAPAlgorithmInfoObject)
+ berryObjectMacro(mitk::MAPAlgorithmInfoObject);
MAPAlgorithmInfoObject();
MAPAlgorithmInfoObject(::map::deployment::DLLInfo::ConstPointer info);
const ::map::deployment::DLLInfo* GetInfo() const;
bool operator==(const berry::Object* obj) const override;
private:
::map::deployment::DLLInfo::ConstPointer m_Info;
};
}
#endif
diff --git a/SuperBuild.cmake b/SuperBuild.cmake
index b77c18d592..c1a7f06b60 100644
--- a/SuperBuild.cmake
+++ b/SuperBuild.cmake
@@ -1,480 +1,481 @@
include(mitkFunctionInstallExternalCMakeProject)
#-----------------------------------------------------------------------------
# Convenient macro allowing to download a file
#-----------------------------------------------------------------------------
if(NOT MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL)
set(MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL http://mitk.org/download/thirdparty)
endif()
macro(downloadFile url dest)
file(DOWNLOAD ${url} ${dest} STATUS status)
list(GET status 0 error_code)
list(GET status 1 error_msg)
if(error_code)
message(FATAL_ERROR "error: Failed to download ${url} - ${error_msg}")
endif()
endmacro()
#-----------------------------------------------------------------------------
# MITK Prerequisites
#-----------------------------------------------------------------------------
if(UNIX AND NOT APPLE)
include(mitkFunctionCheckPackageHeader)
# Check for libxt-dev
mitkFunctionCheckPackageHeader(StringDefs.h libxt-dev /usr/include/X11/)
# Check for libtiff4-dev
mitkFunctionCheckPackageHeader(tiff.h libtiff4-dev)
endif()
# We need a proper patch program. On Linux and MacOS, we assume
# that "patch" is available. On Windows, we download patch.exe
# if not patch program is found.
find_program(PATCH_COMMAND patch)
if((NOT PATCH_COMMAND OR NOT EXISTS ${PATCH_COMMAND}) AND WIN32)
downloadFile(${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/patch.exe
${CMAKE_CURRENT_BINARY_DIR}/patch.exe)
find_program(PATCH_COMMAND patch ${CMAKE_CURRENT_BINARY_DIR})
endif()
if(NOT PATCH_COMMAND)
message(FATAL_ERROR "No patch program found.")
endif()
#-----------------------------------------------------------------------------
# ExternalProjects
#-----------------------------------------------------------------------------
get_property(external_projects GLOBAL PROPERTY MITK_EXTERNAL_PROJECTS)
if(MITK_CTEST_SCRIPT_MODE)
# Write a file containing the list of enabled external project targets.
# This file can be read by a ctest script to separately build projects.
set(SUPERBUILD_TARGETS )
foreach(proj ${external_projects})
if(MITK_USE_${proj})
list(APPEND SUPERBUILD_TARGETS ${proj})
endif()
endforeach()
file(WRITE "${CMAKE_BINARY_DIR}/SuperBuildTargets.cmake" "set(SUPERBUILD_TARGETS ${SUPERBUILD_TARGETS})")
endif()
# A list of "nice" external projects, playing well together with CMake
set(nice_external_projects ${external_projects})
list(REMOVE_ITEM nice_external_projects Boost)
foreach(proj ${nice_external_projects})
if(MITK_USE_${proj})
set(EXTERNAL_${proj}_DIR "${${proj}_DIR}" CACHE PATH "Path to ${proj} build directory")
mark_as_advanced(EXTERNAL_${proj}_DIR)
if(EXTERNAL_${proj}_DIR)
set(${proj}_DIR ${EXTERNAL_${proj}_DIR})
endif()
endif()
endforeach()
set(EXTERNAL_BOOST_ROOT "${BOOST_ROOT}" CACHE PATH "Path to Boost directory")
mark_as_advanced(EXTERNAL_BOOST_ROOT)
if(EXTERNAL_BOOST_ROOT)
set(BOOST_ROOT ${EXTERNAL_BOOST_ROOT})
endif()
# Setup file for setting custom ctest vars
configure_file(
CMake/SuperbuildCTestCustom.cmake.in
${MITK_BINARY_DIR}/CTestCustom.cmake
@ONLY
)
if(BUILD_TESTING)
set(EXTERNAL_MITK_DATA_DIR "${MITK_DATA_DIR}" CACHE PATH "Path to the MITK data directory")
mark_as_advanced(EXTERNAL_MITK_DATA_DIR)
if(EXTERNAL_MITK_DATA_DIR)
set(MITK_DATA_DIR ${EXTERNAL_MITK_DATA_DIR})
endif()
endif()
#-----------------------------------------------------------------------------
# External project settings
#-----------------------------------------------------------------------------
include(ExternalProject)
include(mitkMacroQueryCustomEPVars)
set(ep_prefix "${CMAKE_BINARY_DIR}/ep")
set_property(DIRECTORY PROPERTY EP_PREFIX ${ep_prefix})
# Compute -G arg for configuring external projects with the same CMake generator:
if(CMAKE_EXTRA_GENERATOR)
set(gen "${CMAKE_EXTRA_GENERATOR} - ${CMAKE_GENERATOR}")
else()
set(gen "${CMAKE_GENERATOR}")
endif()
set(gen_platform ${CMAKE_GENERATOR_PLATFORM})
# Use this value where semi-colons are needed in ep_add args:
set(sep "^^")
##
if(MSVC_VERSION)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj /MP")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /MP")
endif()
if(MITK_USE_Boost_LIBRARIES)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_ALL_DYN_LINK")
endif()
# This is a workaround for passing linker flags
# actually down to the linker invocation
set(_cmake_required_flags_orig ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS "-Wl,-rpath")
mitkFunctionCheckCompilerFlags(${CMAKE_REQUIRED_FLAGS} _has_rpath_flag)
set(CMAKE_REQUIRED_FLAGS ${_cmake_required_flags_orig})
set(_install_rpath_linkflag )
if(_has_rpath_flag)
if(APPLE)
set(_install_rpath_linkflag "-Wl,-rpath,@loader_path/../lib")
else()
set(_install_rpath_linkflag "-Wl,-rpath='$ORIGIN/../lib'")
endif()
endif()
set(_install_rpath)
if(APPLE)
set(_install_rpath "@loader_path/../lib")
elseif(UNIX)
# this work for libraries as well as executables
set(_install_rpath "\$ORIGIN/../lib")
endif()
set(ep_common_args
-DCMAKE_CXX_EXTENSIONS:STRING=${CMAKE_CXX_EXTENSIONS}
-DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD}
-DCMAKE_CXX_STANDARD_REQUIRED:BOOL=${CMAKE_CXX_STANDARD_REQUIRED}
-DCMAKE_MACOSX_RPATH:BOOL=TRUE
"-DCMAKE_INSTALL_RPATH:STRING=${_install_rpath}"
-DBUILD_TESTING:BOOL=OFF
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DBUILD_SHARED_LIBS:BOOL=ON
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
"-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} ${MITK_CXX14_FLAG}"
#debug flags
-DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG}
-DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG}
#release flags
-DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}
-DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}
#relwithdebinfo
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
-DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO}
#link flags
-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
-DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
-DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_MODULE_LINKER_FLAGS}
)
if(MSVC_VERSION)
list(APPEND ep_common_args
-DCMAKE_DEBUG_POSTFIX:STRING=d
)
set(DCMTK_CMAKE_DEBUG_POSTFIX d)
endif()
set(ep_common_cache_args
)
set(ep_common_cache_default_args
"-DCMAKE_PREFIX_PATH:PATH=<INSTALL_DIR>;${CMAKE_PREFIX_PATH}"
"-DCMAKE_INCLUDE_PATH:PATH=${CMAKE_INCLUDE_PATH}"
"-DCMAKE_LIBRARY_PATH:PATH=${CMAKE_LIBRARY_PATH}"
)
# Pass the CMAKE_OSX variables to external projects
if(APPLE)
set(MAC_OSX_ARCHITECTURE_ARGS
-DCMAKE_OSX_ARCHITECTURES:PATH=${CMAKE_OSX_ARCHITECTURES}
-DCMAKE_OSX_DEPLOYMENT_TARGET:PATH=${CMAKE_OSX_DEPLOYMENT_TARGET}
-DCMAKE_OSX_SYSROOT:PATH=${CMAKE_OSX_SYSROOT}
)
set(ep_common_args
${MAC_OSX_ARCHITECTURE_ARGS}
${ep_common_args}
)
endif()
set(mitk_superbuild_ep_args)
set(mitk_depends )
# Include external projects
include(CMakeExternals/MITKData.cmake)
foreach(p ${external_projects})
if(EXISTS ${CMAKE_SOURCE_DIR}/CMakeExternals/${p}.cmake)
include(CMakeExternals/${p}.cmake)
else()
foreach(MITK_EXTENSION_DIR ${MITK_EXTENSION_DIRS})
get_filename_component(MITK_EXTENSION_DIR ${MITK_EXTENSION_DIR} ABSOLUTE)
set(MITK_CMAKE_EXTERNALS_EXTENSION_DIR ${MITK_EXTENSION_DIR}/CMakeExternals)
if(EXISTS ${MITK_CMAKE_EXTERNALS_EXTENSION_DIR}/${p}.cmake)
include(${MITK_CMAKE_EXTERNALS_EXTENSION_DIR}/${p}.cmake)
break()
endif()
endforeach()
endif()
list(APPEND mitk_superbuild_ep_args
-DMITK_USE_${p}:BOOL=${MITK_USE_${p}}
)
get_property(_package GLOBAL PROPERTY MITK_${p}_PACKAGE)
if(_package)
list(APPEND mitk_superbuild_ep_args -D${p}_DIR:PATH=${${p}_DIR})
endif()
list(APPEND mitk_depends ${${p}_DEPENDS})
endforeach()
if (SWIG_EXECUTABLE)
list(APPEND mitk_superbuild_ep_args -DSWIG_EXECUTABLE=${SWIG_EXECUTABLE})
endif()
#-----------------------------------------------------------------------------
# Set superbuild boolean args
#-----------------------------------------------------------------------------
set(mitk_cmake_boolean_args
BUILD_SHARED_LIBS
WITH_COVERAGE
BUILD_TESTING
MITK_BUILD_ALL_PLUGINS
MITK_BUILD_ALL_APPS
MITK_BUILD_EXAMPLES
MITK_USE_Qt5
MITK_USE_SYSTEM_Boost
MITK_USE_BLUEBERRY
MITK_USE_OpenCL
MITK_USE_OpenMP
MITK_ENABLE_PIC_READER
)
#-----------------------------------------------------------------------------
# Create the final variable containing superbuild boolean args
#-----------------------------------------------------------------------------
set(mitk_superbuild_boolean_args)
foreach(mitk_cmake_arg ${mitk_cmake_boolean_args})
list(APPEND mitk_superbuild_boolean_args -D${mitk_cmake_arg}:BOOL=${${mitk_cmake_arg}})
endforeach()
if(MITK_BUILD_ALL_PLUGINS)
list(APPEND mitk_superbuild_boolean_args -DBLUEBERRY_BUILD_ALL_PLUGINS:BOOL=ON)
endif()
#-----------------------------------------------------------------------------
# MITK Utilities
#-----------------------------------------------------------------------------
set(proj MITK-Utilities)
ExternalProject_Add(${proj}
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
DEPENDS
${mitk_depends}
)
#-----------------------------------------------------------------------------
# Additional MITK CXX/C Flags
#-----------------------------------------------------------------------------
set(MITK_ADDITIONAL_C_FLAGS "" CACHE STRING "Additional C Flags for MITK")
set(MITK_ADDITIONAL_C_FLAGS_RELEASE "" CACHE STRING "Additional Release C Flags for MITK")
set(MITK_ADDITIONAL_C_FLAGS_DEBUG "" CACHE STRING "Additional Debug C Flags for MITK")
mark_as_advanced(MITK_ADDITIONAL_C_FLAGS MITK_ADDITIONAL_C_FLAGS_DEBUG MITK_ADDITIONAL_C_FLAGS_RELEASE)
set(MITK_ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional CXX Flags for MITK")
set(MITK_ADDITIONAL_CXX_FLAGS_RELEASE "" CACHE STRING "Additional Release CXX Flags for MITK")
set(MITK_ADDITIONAL_CXX_FLAGS_DEBUG "" CACHE STRING "Additional Debug CXX Flags for MITK")
mark_as_advanced(MITK_ADDITIONAL_CXX_FLAGS MITK_ADDITIONAL_CXX_FLAGS_DEBUG MITK_ADDITIONAL_CXX_FLAGS_RELEASE)
set(MITK_ADDITIONAL_EXE_LINKER_FLAGS "" CACHE STRING "Additional exe linker flags for MITK")
set(MITK_ADDITIONAL_SHARED_LINKER_FLAGS "" CACHE STRING "Additional shared linker flags for MITK")
set(MITK_ADDITIONAL_MODULE_LINKER_FLAGS "" CACHE STRING "Additional module linker flags for MITK")
mark_as_advanced(MITK_ADDITIONAL_EXE_LINKER_FLAGS MITK_ADDITIONAL_SHARED_LINKER_FLAGS MITK_ADDITIONAL_MODULE_LINKER_FLAGS)
#-----------------------------------------------------------------------------
# MITK Configure
#-----------------------------------------------------------------------------
if(MITK_INITIAL_CACHE_FILE)
set(mitk_initial_cache_arg -C "${MITK_INITIAL_CACHE_FILE}")
endif()
set(mitk_optional_cache_args )
foreach(type RUNTIME ARCHIVE LIBRARY)
if(DEFINED CTK_PLUGIN_${type}_OUTPUT_DIRECTORY)
list(APPEND mitk_optional_cache_args -DCTK_PLUGIN_${type}_OUTPUT_DIRECTORY:PATH=${CTK_PLUGIN_${type}_OUTPUT_DIRECTORY})
endif()
endforeach()
# Optional python variables
if(MITK_USE_Python3)
list(APPEND mitk_optional_cache_args
-DMITK_USE_Python3:BOOL=${MITK_USE_Python3}
"-DPython3_EXECUTABLE:FILEPATH=${Python3_EXECUTABLE}"
"-DPython3_INCLUDE_DIR:PATH=${Python3_INCLUDE_DIRS}"
"-DPython3_LIBRARY:FILEPATH=${Python3_LIBRARY}"
"-DPython3_STDLIB:FILEPATH=${Python3_STDLIB}"
"-DPython3_SITELIB:FILEPATH=${Python3_SITELIB}"
)
endif()
if(OPENSSL_ROOT_DIR)
list(APPEND mitk_optional_cache_args
"-DOPENSSL_ROOT_DIR:PATH=${OPENSSL_ROOT_DIR}"
)
endif()
if(CMAKE_FRAMEWORK_PATH)
list(APPEND mitk_optional_cache_args
"-DCMAKE_FRAMEWORK_PATH:PATH=${CMAKE_FRAMEWORK_PATH}"
)
endif()
if(Eigen_INCLUDE_DIR)
list(APPEND mitk_optional_cache_args
-DEigen_INCLUDE_DIR:PATH=${Eigen_INCLUDE_DIR}
)
endif()
# Optional pass through of Doxygen
if(DOXYGEN_EXECUTABLE)
list(APPEND mitk_optional_cache_args
-DDOXYGEN_EXECUTABLE:FILEPATH=${DOXYGEN_EXECUTABLE}
)
endif()
set(proj MITK-Configure)
ExternalProject_Add(${proj}
LIST_SEPARATOR ${sep}
DOWNLOAD_COMMAND ""
CMAKE_GENERATOR ${gen}
CMAKE_GENERATOR_PLATFORM ${gen_platform}
CMAKE_CACHE_ARGS
# --------------- Build options ----------------
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
"-DCMAKE_PREFIX_PATH:PATH=${ep_prefix};${CMAKE_PREFIX_PATH}"
"-DCMAKE_LIBRARY_PATH:PATH=${CMAKE_LIBRARY_PATH}"
"-DCMAKE_INCLUDE_PATH:PATH=${CMAKE_INCLUDE_PATH}"
# --------------- Compile options ----------------
-DCMAKE_CXX_EXTENSIONS:STRING=${CMAKE_CXX_EXTENSIONS}
-DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD}
-DCMAKE_CXX_STANDARD_REQUIRED:BOOL=${CMAKE_CXX_STANDARD_REQUIRED}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} ${MITK_ADDITIONAL_C_FLAGS}"
"-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} ${MITK_ADDITIONAL_CXX_FLAGS}"
# debug flags
"-DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG} ${MITK_ADDITIONAL_CXX_FLAGS_DEBUG}"
"-DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG} ${MITK_ADDITIONAL_C_FLAGS_DEBUG}"
# release flags
"-DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE} ${MITK_ADDITIONAL_CXX_FLAGS_RELEASE}"
"-DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE} ${MITK_ADDITIONAL_C_FLAGS_RELEASE}"
# relwithdebinfo
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
-DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO}
# link flags
"-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS} ${MITK_ADDITIONAL_EXE_LINKER_FLAGS}"
"-DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS} ${MITK_ADDITIONAL_SHARED_LINKER_FLAGS}"
"-DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_MODULE_LINKER_FLAGS} ${MITK_ADDITIONAL_MODULE_LINKER_FLAGS}"
# Output directories
-DMITK_CMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${MITK_CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-DMITK_CMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${MITK_CMAKE_RUNTIME_OUTPUT_DIRECTORY}
-DMITK_CMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${MITK_CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
# ------------- Boolean build options --------------
${mitk_superbuild_boolean_args}
${mitk_optional_cache_args}
-DMITK_USE_SUPERBUILD:BOOL=OFF
-DMITK_BUILD_CONFIGURATION:STRING=${MITK_BUILD_CONFIGURATION}
-DMITK_FAST_TESTING:BOOL=${MITK_FAST_TESTING}
+ -DMITK_XVFB_TESTING:BOOL=${MITK_XVFB_TESTING}
-DCTEST_USE_LAUNCHERS:BOOL=${CTEST_USE_LAUNCHERS}
# ----------------- Miscellaneous ---------------
-DCMAKE_LIBRARY_PATH:PATH=${CMAKE_LIBRARY_PATH}
-DCMAKE_INCLUDE_PATH:PATH=${CMAKE_INCLUDE_PATH}
-DMITK_CTEST_SCRIPT_MODE:STRING=${MITK_CTEST_SCRIPT_MODE}
-DMITK_SUPERBUILD_BINARY_DIR:PATH=${MITK_BINARY_DIR}
-DMITK_MODULES_TO_BUILD:INTERNAL=${MITK_MODULES_TO_BUILD}
-DMITK_WHITELIST:STRING=${MITK_WHITELIST}
-DMITK_WHITELISTS_EXTERNAL_PATH:STRING=${MITK_WHITELISTS_EXTERNAL_PATH}
-DMITK_WHITELISTS_INTERNAL_PATH:STRING=${MITK_WHITELISTS_INTERNAL_PATH}
-DMITK_EXTENSION_DIRS:STRING=${MITK_EXTENSION_DIRS}
-DMITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES:STRING=${MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES}
-DMITK_ACCESSBYITK_FLOATING_PIXEL_TYPES:STRING=${MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES}
-DMITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES:STRING=${MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES}
-DMITK_ACCESSBYITK_VECTOR_PIXEL_TYPES:STRING=${MITK_ACCESSBYITK_VECTOR_PIXEL_TYPES}
-DMITK_ACCESSBYITK_DIMENSIONS:STRING=${MITK_ACCESSBYITK_DIMENSIONS}
# --------------- External project options ---------------
-DMITK_DATA_DIR:PATH=${MITK_DATA_DIR}
-DMITK_EXTERNAL_PROJECT_PREFIX:PATH=${ep_prefix}
-DCppMicroServices_DIR:PATH=${CppMicroServices_DIR}
-DDCMTK_CMAKE_DEBUG_POSTFIX:STRING=${DCMTK_CMAKE_DEBUG_POSTFIX}
-DBOOST_ROOT:PATH=${BOOST_ROOT}
-DBOOST_LIBRARYDIR:PATH=${BOOST_LIBRARYDIR}
-DMITK_USE_Boost_LIBRARIES:STRING=${MITK_USE_Boost_LIBRARIES}
-DQt5_DIR:PATH=${Qt5_DIR}
CMAKE_ARGS
${mitk_initial_cache_arg}
${MAC_OSX_ARCHITECTURE_ARGS}
${mitk_superbuild_ep_args}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
BINARY_DIR ${CMAKE_BINARY_DIR}/MITK-build
BUILD_COMMAND ""
INSTALL_COMMAND ""
DEPENDS
MITK-Utilities
)
mitkFunctionInstallExternalCMakeProject(${proj})
#-----------------------------------------------------------------------------
# MITK
#-----------------------------------------------------------------------------
if(CMAKE_GENERATOR MATCHES ".*Makefiles.*")
set(mitk_build_cmd "$(MAKE)")
else()
set(mitk_build_cmd ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/MITK-build --config ${CMAKE_CFG_INTDIR})
endif()
if(NOT DEFINED SUPERBUILD_EXCLUDE_MITKBUILD_TARGET OR NOT SUPERBUILD_EXCLUDE_MITKBUILD_TARGET)
set(MITKBUILD_TARGET_ALL_OPTION "ALL")
else()
set(MITKBUILD_TARGET_ALL_OPTION "")
endif()
add_custom_target(MITK-build ${MITKBUILD_TARGET_ALL_OPTION}
COMMAND ${mitk_build_cmd}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/MITK-build
DEPENDS MITK-Configure
)
#-----------------------------------------------------------------------------
# Custom target allowing to drive the build of the MITK project itself
#-----------------------------------------------------------------------------
add_custom_target(MITK
COMMAND ${mitk_build_cmd}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/MITK-build
)

File Metadata

Mime Type
application/octet-stream
Expires
Sun, Apr 21, 6:17 AM (2 d)
Storage Engine
chunks
Storage Format
Chunks
Storage Handle
vpkqW7b_GHQQ
Default Alt Text
(4 MB)

Event Timeline